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

431 lines
1.3 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[210,5,7,8,13],{"+NIl":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";de.defineMode("stex",function(Z,M){"use strict";function V(h,r){h.cmdState.push(r)}function I(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function B(h){var r=h.cmdState.pop();r&&r.closeBracket()}function K(h){for(var r=h.cmdState,d=r.length-1;d>=0;d--){var l=r[d];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(h,r,d){return function(){this.name=h,this.bracketNo=0,this.style=r,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var L={};L.importmodule=W("importmodule","tag",["string","builtin"]),L.documentclass=W("documentclass","tag",["","atom"]),L.usepackage=W("usepackage","tag",["atom"]),L.begin=W("begin","tag",["atom"]),L.end=W("end","tag",["atom"]),L.label=W("label","tag",["atom"]),L.ref=W("ref","tag",["atom"]),L.eqref=W("eqref","tag",["atom"]),L.cite=W("cite","tag",["atom"]),L.bibitem=W("bibitem","tag",["atom"]),L.Bibitem=W("Bibitem","tag",["atom"]),L.RBibitem=W("RBibitem","tag",["atom"]),L.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(h,r){h.f=r}function b(h,r){var d;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return d=L.hasOwnProperty(l)?L[l]:L.DEFAULT,d=new d,V(r,d),P(r,_),d.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return P(r,function(u,c){return p(u,c,"\\]")}),"keyword";if(h.match("\\("))return P(r,function(u,c){return p(u,c,"\\)")}),"keyword";if(h.match("$$"))return P(r,function(u,c){return p(u,c,"$$")}),"keyword";if(h.match("$"))return P(r,function(u,c){return p(u,c,"$")}),"keyword";var a=h.next();if(a=="%")return h.skipToEnd(),"comment";if(a=="}"||a=="]"){if(d=I(r),d)d.closeBracket(a),P(r,_);else return"error";return"bracket"}else return a=="{"||a=="["?(d=L.DEFAULT,d=new d,V(r,d),"bracket"):/\d/.test(a)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),d=K(r),d.name=="begin"&&(d.argument=h.current()),d.styleIdentifier())}function p(h,r,d){if(h.eatSpace())return null;if(d&&h.match(d))return P(r,b),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=h.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(h.skipToEnd(),"comment"):"error"}function _(h,r){var d=h.peek(),l;return d=="{"||d=="["?(l=I(r),l.openBracket(d),h.eat(d),P(r,b),"bracket"):/[ \t\r]/.test(d)?(h.eat(d),null):(P(r,b),B(r),b(h,r))}return{startState:function(){var h=M.inMathMode?function(r,d){return p(r,d)}:b;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,r){return r.f(h,r)},blankLine:function(h){h.f=b,h.cmdState.length=0},lineComment:"%"}}),de.defineMIME("text/x-stex","stex"),de.defineMIME("text/x-latex","stex")})},"+ua5":function(ft,Xe,G){},"+vTd":function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___37CPQ",flex_space_between:"flex_space_between___1yzV5",flex_box_vertical_center:"flex_box_vertical_center___2QH_C",flex_box_center_end:"flex_box_center_end___22kLi",flex_box_column:"flex_box_column___1Y3On",line:"line___-rzSr",b1:"b1___1zz_c",b2:"b2___1dAOW",list:"list___1gpez",title:"title___21uOv",tr:"tr___3kTJL",itemDetail:"itemDetail___8QmqJ",answerWrapper:"answerWrapper___3guKO",decoration:"decoration___1rcYW",row:"row___3uQSh",typeRow:"typeRow___ADZSj",type:"type___2pfNZ",typeName:"typeName___8ZhPv",typeIcon:"typeIcon___1Xniv",unpublished:"unpublished___dTXTI",private:"private___XQiDx",public:"public___iIFou",reviewFlag:"reviewFlag___YP4vk",typeRightAction:"typeRightAction___1PQjp",actionLink:"actionLink___2E5q_",actionIcon:"actionIcon___GCvNK",topicTitle:"topicTitle___3fJds",topicTitleContent:"topicTitleContent___35cf9",judgmentContent:"judgmentContent___SU5rV",programContent:"programContent___3G6-D",otherContent:"otherContent___1JHnX",combinationContent:"combinationContent___6ZXO-",con:"con___1_qCl",otherContentItem:"otherContentItem___18WrV",otehrContentHtml:"otehrContentHtml___LW3nV",difficultyRow:"difficultyRow___3HvT0",updateTimeRow:"updateTimeRow___1dNd0",updateTimeWrap:"updateTimeWrap___2PKks",updateTimeContent:"updateTimeContent___1mNBy",programLanguage:"programLanguage___3CnaJ",updateTimeRowAction:"updateTimeRowAction___1DaMt",bottomAction:"bottomAction___Y-BNC",borderColorBlue:"borderColorBlue___2Xd-0",borderColorRed:"borderColorRed___2zA_q",borderColorFFF:"borderColorFFF___2R5-5",borderColorGray:"borderColorGray___nZnDe",selectIcon:"selectIcon___2byLd",colorGreen:"colorGreen___1iOKR",parseAnswerBorder:"parseAnswerBorder___1LTYn",answer:"answer___2L9lv",answerHtml:"answerHtml___3zrOk",parse:"parse___3d3dm",parseText:"parseText___1C_VL",parseAnswer:"parseAnswer___QMVPC",parseAnswerHtml:"parseAnswerHtml___2TCVz",actionBar:"actionBar___2ItMN",know:"know___y8QKK",menu:"menu___SYdg7",bottom:"bottom___2dFIa",textBtn:"textBtn___1y00f"}},"+z73":function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___3WSrc",flex_space_between:"flex_space_between___1fpCp",flex_box_vertical_center:"flex_box_vertical_center___3Wy8W",flex_box_center_end:"flex_box_center_end___3YIs2",flex_box_column:"flex_box_column___3CNwR",pWrap:"pWrap___2jVbQ",few:"few___3Eebn"}},"19Vz":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){de.defineOption("placeholder","",function(W,L,P){var b=P&&P!=de.Init;if(L&&!b)W.on("blur",I),W.on("change",B),W.on("swapDoc",B),de.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){V(W)}),B(W);else if(!L&&b){W.off("blur",I),W.off("change",B),W.off("swapDoc",B),de.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),Z(W);var p=W.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}L&&!W.hasFocus()&&I(W)});function Z(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function M(W){Z(W);var L=W.state.placeholder=document.createElement("pre");L.style.cssText="height: 0; overflow: visible",L.style.direction=W.getOption("direction"),L.className="CodeMirror-placeholder CodeMirror-line-like";var P=W.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),L.appendChild(P),W.display.lineSpace.insertBefore(L,W.display.lineSpace.firstChild)}function V(W){setTimeout(function(){var L=!1,P=W.getInputField();P.nodeName=="TEXTAREA"?L=!P.value:W.lineCount()==1&&(L=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),L?M(W):Z(W)},20)}function I(W){K(W)&&M(W)}function B(W){var L=W.getWrapperElement(),P=K(W);L.className=L.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?M(W):Z(W)}function K(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1ZF9":function(ft,Xe,G){ft.exports=G.p+"static/Authorize.cc9c212f.png"},"1eCo":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";var Z={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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};de.defineMode("xml",function(V,I){var B=V.indentUnit,K={},W=I.htmlMode?Z:M;for(var L in W)K[L]=W[L];for(var L in I)K[L]=I[L];var P,b;function p(o,E){function g(U){return E.tokenize=U,U(o,E)}var C=o.next();if(C=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?g(r("atom","]]>")):null:o.match("--")?g(r("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),g(d(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),E.tokenize=r("meta","?>"),"meta"):(P=o.eat("/")?"closeTag":"openTag",E.tokenize=_,"tag bracket");if(C=="&"){var N;return o.eat("#")?o.eat("x")?N=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):N=o.eatWhile(/[\d]/)&&o.eat(";"):N=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),N?"atom":"error"}else return o.eatWhile(/[^&<]/),null}p.isInText=!0;function _(o,E){var g=o.next();if(g==">"||g=="/"&&o.eat(">"))return E.tokenize=p,P=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return P="equals",null;if(g=="<"){E.tokenize=p,E.state=c,E.tagName=E.tagStart=null;var C=E.tokenize(o,E);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(g)?(E.tokenize=h(g),E.stringStartCol=o.column(),E.tokenize(o,E)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(o){var E=function(g,C){for(;!g.eol();)if(g.next()==o){C.tokenize=_;break}return"string"};return E.isInAttribute=!0,E}function r(o,E){return function(g,C){for(;!g.eol();){if(g.match(E)){C.tokenize=p;break}g.next()}return o}}function d(o){return function(E,g){for(var C;(C=E.next())!=null;){if(C=="<")return g.tokenize=d(o+1),g.tokenize(E,g);if(C==">")if(o==1){g.tokenize=p;break}else return g.tokenize=d(o-1),g.tokenize(E,g)}return"meta"}}function l(o,E,g){this.prev=o.context,this.tagName=E,this.indent=o.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(E)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function u(o,E){for(var g;;){if(!o.context)return;if(g=o.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(E))return;a(o)}}function c(o,E,g){return o=="openTag"?(g.tagStart=E.column(),R):o=="closeTag"?O:c}function R(o,E,g){return o=="word"?(g.tagName=E.current(),b="tag",w):K.allowMissingTagName&&o=="endTag"?(b="tag bracket",w(o,E,g)):(b="error",R)}function O(o,E,g){if(o=="word"){var C=E.current();return g.context&&g.context.tagName!=C&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&a(g),g.context&&g.context.tagName==C||K.matchClosing===!1?(b="tag",T):(b="tag error",A)}else return K.allowMissingTagName&&o=="endTag"?(b="tag bracket",T(o,E,g)):(b="error",A)}function T(o,E,g){return o!="endTag"?(b="error",T):(a(g),c)}function A(o,E,g){return b="error",T(o,E,g)}function w(o,E,g){if(o=="word")return b="attribute",m;if(o=="endTag"||o=="selfcloseTag"){var C=g.tagName,N=g.tagStart;return g.tagName=g.tagStart=null,o=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(C)?u(g,C):(u(g,C),g.context=new l(g,C,N==g.indented)),c}return b="error",w}function m(o,E,g){return o=="equals"?v:(K.allowMissing||(b="error"),w(o,E,g))}function v(o,E,g){return o=="string"?s:o=="word"&&K.allowUnquoted?(b="string",w):(b="error",w(o,E,g))}function s(o,E,g){return o=="string"?s:w(o,E,g)}return{startState:function(o){var E={tokenize:p,state:c,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(E.baseIndent=o),E},token:function(o,E){if(!E.tagName&&o.sol()&&(E.indented=o.indentation()),o.eatSpace())return null;P=null;var g=E.tokenize(o,E);return(g||P)&&g!="comment"&&(b=null,E.state=E.state(P||g,o,E),b&&(g=b=="error"?g+" error":b)),g},indent:function(o,E,g){var C=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+B;if(C&&C.noIndent)return de.Pass;if(o.tokenize!=_&&o.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(o.tagName)return K.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+B*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var N=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(N&&N[1])for(;C;)if(C.tagName==N[2]){C=C.prev;break}else if(K.implicitlyClosed.hasOwnProperty(C.tagName))C=C.prev;else break;else if(N)for(;C;){var U=K.contextGrabbers[C.tagName];if(U&&U.hasOwnProperty(N[2]))C=C.prev;else break}for(;C&&C.prev&&!C.startOfLine;)C=C.prev;return C?C.indent+B:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(o){o.state==v&&(o.state=w)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var E=[],g=o.context;g;g=g.prev)g.tagName&&E.push(g.tagName);return E.reverse()}}}),de.defineMIME("text/xml","xml"),de.defineMIME("application/xml","xml"),de.mimeModes.hasOwnProperty("text/html")||de.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(ft,Xe,G){ft.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"55Ip":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return u});var de=G("Ty5D"),Z=G("dI71"),M=G("q1tI"),V=G.n(M),I=G("YS25"),B=G("17x9"),K=G.n(B),W=G("wx14"),L=G("zLVn"),P=G("9R94"),b=function(v){Object(Z.a)(s,v);function s(){for(var E,g=arguments.length,C=new Array(g),N=0;N<g;N++)C[N]=arguments[N];return E=v.call.apply(v,[this].concat(C))||this,E.history=Object(I.a)(E.props),E}var o=s.prototype;return o.render=function(){return V.a.createElement(de.c,{history:this.history,children:this.props.children})},s}(V.a.Component),p=function(v){Object(Z.a)(s,v);function s(){for(var E,g=arguments.length,C=new Array(g),N=0;N<g;N++)C[N]=arguments[N];return E=v.call.apply(v,[this].concat(C))||this,E.history=Object(I.b)(E.props),E}var o=s.prototype;return o.render=function(){return V.a.createElement(de.c,{history:this.history,children:this.props.children})},s}(V.a.Component),_=function(s,o){return typeof s=="function"?s(o):s},h=function(s,o){return typeof s=="string"?Object(I.c)(s,null,null,o):s},r=function(s){return s},d=V.a.forwardRef;typeof d=="undefined"&&(d=r);function l(v){return!!(v.metaKey||v.altKey||v.ctrlKey||v.shiftKey)}var a=d(function(v,s){var o=v.innerRef,E=v.navigate,g=v.onClick,C=Object(L.a)(v,["innerRef","navigate","onClick"]),N=C.target,U=Object(W.a)({},C,{onClick:function(H){try{g&&g(H)}catch(y){throw H.preventDefault(),y}!H.defaultPrevented&&H.button===0&&(!N||N==="_self")&&!l(H)&&(H.preventDefault(),E())}});return r!==d?U.ref=s||o:U.ref=o,V.a.createElement("a",U)}),u=d(function(v,s){var o=v.component,E=o===void 0?a:o,g=v.replace,C=v.to,N=v.innerRef,U=Object(L.a)(v,["component","replace","to","innerRef"]);return V.a.createElement(de.e.Consumer,null,function(j){j||Object(P.a)(!1);var H=j.history,y=h(_(C,j.location),j.location),x=y?H.createHref(y):"",F=Object(W.a)({},U,{href:x,navigate:function(){var q=_(C,j.location),ie=g?H.replace:H.push;ie(q)}});return r!==d?F.ref=s||N:F.innerRef=N,V.a.createElement(E,F)})});if(!1)var c,R;var O=function(s){return s},T=V.a.forwardRef;typeof T=="undefined"&&(T=O);function A(){for(var v=arguments.length,s=new Array(v),o=0;o<v;o++)s[o]=arguments[o];return s.filter(function(E){return E}).join(" ")}var w=T(function(v,s){var o=v["aria-current"],E=o===void 0?"page":o,g=v.activeClassName,C=g===void 0?"active":g,N=v.activeStyle,U=v.className,j=v.exact,H=v.isActive,y=v.location,x=v.sensitive,F=v.strict,Q=v.style,q=v.to,ie=v.innerRef,ge=Object(L.a)(v,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(de.e.Consumer,null,function(fe){fe||Object(P.a)(!1);var ue=y||fe.location,he=h(_(q,ue),ue),_e=he.pathname,le=_e&&_e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ne=le?Object(de.f)(ue.pathname,{path:le,exact:j,sensitive:x,strict:F}):null,Te=!!(H?H(ne,ue):ne),Fe=Te?A(U,C):U,Ke=Te?Object(W.a)({},Q,{},N):Q,Ue=Object(W.a)({"aria-current":Te&&E||null,className:Fe,style:Ke,to:he},ge);return O!==T?Ue.ref=s||ie:Ue.innerRef=ie,V.a.createElement(u,Ue)})});if(!1)var m},"5VLF":function(ft,Xe,G){"use strict";var de,Z;function M(V,I,B){var K=function(W,L){return V.js_beautify(W,L)};return K.js=V.js_beautify,K.css=I.css_beautify,K.html=B.html_beautify,K.js_beautify=V.js_beautify,K.css_beautify=I.css_beautify,K.html_beautify=B.html_beautify,K}!(de=[G("6UM0"),G("TXwP"),G("psGv")],Z=function(V,I,B){return M(V,I,B)}.apply(Xe,de),Z!==void 0&&(ft.exports=Z))},"6+eU":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return T});var de=G("wx14"),Z=G("rePB"),M=G("VTBJ"),V=G("1OyB"),I=G("vuIU"),B=G("Ji7U"),K=G("LK+K"),W=G("q1tI"),L=G.n(W),P=G("TSYQ"),b=G.n(P),p=function(w){var m,v="".concat(w.rootPrefixCls,"-item"),s=b()(v,"".concat(v,"-").concat(w.page),(m={},Object(Z.a)(m,"".concat(v,"-active"),w.active),Object(Z.a)(m,w.className,!!w.className),Object(Z.a)(m,"".concat(v,"-disabled"),!w.page),m)),o=function(){w.onClick(w.page)},E=function(C){w.onKeyPress(C,w.onClick,w.page)};return L.a.createElement("li",{title:w.showTitle?w.page:null,className:s,onClick:o,onKeyPress:E,tabIndex:"0"},w.itemRender(w.page,"page",L.a.createElement("a",{rel:"nofollow"},w.page)))},_=p,h={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},r=function(A){Object(B.a)(m,A);var w=Object(K.a)(m);function m(){var v;Object(V.a)(this,m);for(var s=arguments.length,o=new Array(s),E=0;E<s;E++)o[E]=arguments[E];return v=w.call.apply(w,[this].concat(o)),v.state={goInputText:""},v.buildOptionText=function(g){return"".concat(g," ").concat(v.props.locale.items_per_page)},v.changeSize=function(g){v.props.changeSize(Number(g))},v.handleChange=function(g){v.setState({goInputText:g.target.value})},v.handleBlur=function(g){var C=v.props,N=C.goButton,U=C.quickGo,j=C.rootPrefixCls,H=v.state.goInputText;if(N||H==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(j,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(j,"-next"))>=0))return;v.setState({goInputText:""}),U(v.getValidValue())},v.go=function(g){var C=v.state.goInputText;if(C==="")return;(g.keyCode===h.ENTER||g.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(I.a)(m,[{key:"getValidValue",value:function(){var s=this.state,o=s.goInputText,E=s.current;return!o||isNaN(o)?E:Number(o)}},{key:"getPageSizeOptions",value:function(){var s=this.props,o=s.pageSize,E=s.pageSizeOptions;return E.some(function(g){return g.toString()===o.toString()})?E:E.concat([o.toString()]).sort(function(g,C){var N=isNaN(Number(g))?0:Number(g),U=isNaN(Number(C))?0:Number(C);return N-U})}},{key:"render",value:function(){var s=this,o=this.props,E=o.pageSize,g=o.locale,C=o.rootPrefixCls,N=o.changeSize,U=o.quickGo,j=o.goButton,H=o.selectComponentClass,y=o.buildOptionText,x=o.selectPrefixCls,F=o.disabled,Q=this.state.goInputText,q="".concat(C,"-options"),ie=H,ge=null,fe=null,ue=null;if(!N&&!U)return null;var he=this.getPageSizeOptions();if(N&&ie){var _e=he.map(function(le,ne){return L.a.createElement(ie.Option,{key:ne,value:le.toString()},(y||s.buildOptionText)(le))});ge=L.a.createElement(ie,{disabled:F,prefixCls:x,showSearch:!1,className:"".concat(q,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||he[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ne){return ne.parentNode}},_e)}return U&&(j&&(ue=typeof j=="boolean"?L.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:F,className:"".concat(q,"-quick-jumper-button")},g.jump_to_confirm):L.a.createElement("span",{onClick:this.go,onKeyUp:this.go},j)),fe=L.a.createElement("div",{className:"".concat(q,"-quick-jumper")},g.jump_to,L.a.createElement("input",{disabled:F,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,ue)),L.a.createElement("li",{className:"".concat(q)},ge,fe)}}]),m}(L.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=r,l=G("N2Kk");function a(){}function u(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function c(A,w,m){return m}function R(A,w,m){var v=typeof A=="undefined"?w.pageSize:A;return Math.floor((m.total-1)/v)+1}var O=function(A){Object(B.a)(m,A);var w=Object(K.a)(m);function m(v){var s;Object(V.a)(this,m),s=w.call(this,v),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(R(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(N,U){var j=s.props.prefixCls,H=N||L.a.createElement("button",{type:"button","aria-label":U,className:"".concat(j,"-item-link")});return typeof N=="function"&&(H=L.a.createElement(N,Object(M.a)({},s.props))),H},s.savePaginationNode=function(N){s.paginationNode=N},s.isValid=function(N){return u(N)&&N!==s.state.current},s.shouldDisplayQuickJumper=function(){var N=s.props,U=N.showQuickJumper,j=N.pageSize,H=N.total;return H<=j?!1:U},s.handleKeyDown=function(N){(N.keyCode===h.ARROW_UP||N.keyCode===h.ARROW_DOWN)&&N.preventDefault()},s.handleKeyUp=function(N){var U=s.getValidValue(N),j=s.state.currentInputValue;U!==j&&s.setState({currentInputValue:U}),N.keyCode===h.ENTER?s.handleChange(U):N.keyCode===h.ARROW_UP?s.handleChange(U-1):N.keyCode===h.ARROW_DOWN&&s.handleChange(U+1)},s.changePageSize=function(N){var U=s.state.current,j=R(N,s.state,s.props);U=U>j?j:U,j===0&&(U=s.state.current),typeof N=="number"&&("pageSize"in s.props||s.setState({pageSize:N}),"current"in s.props||s.setState({current:U,currentInputValue:U})),s.props.onShowSizeChange(U,N),"onChange"in s.props&&s.props.onChange&&s.props.onChange(U,N)},s.handleChange=function(N){var U=s.props.disabled,j=N;if(s.isValid(j)&&!U){var H=R(void 0,s.state,s.props);j>H?j=H:j<1&&(j=1),"current"in s.props||s.setState({current:j,currentInputValue:j});var y=s.state.pageSize;return s.props.onChange(j,y),j}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current<R(void 0,s.state,s.props)},s.runIfEnter=function(N,U){if(N.key==="Enter"||N.charCode===13){for(var j=arguments.length,H=new Array(j>2?j-2:0),y=2;y<j;y++)H[y-2]=arguments[y];U.apply(void 0,H)}},s.runIfEnterPrev=function(N){s.runIfEnter(N,s.prev)},s.runIfEnterNext=function(N){s.runIfEnter(N,s.next)},s.runIfEnterJumpPrev=function(N){s.runIfEnter(N,s.jumpPrev)},s.runIfEnterJumpNext=function(N){s.runIfEnter(N,s.jumpNext)},s.handleGoTO=function(N){(N.keyCode===h.ENTER||N.type==="click")&&s.handleChange(s.state.currentInputValue)};var o=v.onChange!==a,E="current"in v;E&&!o&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var g=v.defaultCurrent;"current"in v&&(g=v.current);var C=v.defaultPageSize;return"pageSize"in v&&(C=v.pageSize),g=Math.min(g,R(C,void 0,v)),s.state={current:g,currentInputValue:g,pageSize:C},s}return Object(I.a)(m,[{key:"componentDidUpdate",value:function(s,o){var E=this.props.prefixCls;if(o.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(E,"-item-").concat(o.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(s){var o=s.target.value,E=R(void 0,this.state,this.props),g=this.state.currentInputValue,C;return o===""?C=o:isNaN(Number(o))?C=g:o>=E?C=E:C=Number(o),C}},{key:"getShowSizeChanger",value:function(){var s=this.props,o=s.showSizeChanger,E=s.total,g=s.totalBoundaryShowSizeChanger;return typeof o!="undefined"?o:E>g}},{key:"renderPrev",value:function(s){var o=this.props,E=o.prevIcon,g=o.itemRender,C=g(s,"prev",this.getItemIcon(E,"prev page")),N=!this.hasPrev();return Object(W.isValidElement)(C)?Object(W.cloneElement)(C,{disabled:N}):C}},{key:"renderNext",value:function(s){var o=this.props,E=o.nextIcon,g=o.itemRender,C=g(s,"next",this.getItemIcon(E,"next page")),N=!this.hasNext();return Object(W.isValidElement)(C)?Object(W.cloneElement)(C,{disabled:N}):C}},{key:"render",value:function(){var s=this,o=this.props,E=o.prefixCls,g=o.className,C=o.style,N=o.disabled,U=o.hideOnSinglePage,j=o.total,H=o.locale,y=o.showQuickJumper,x=o.showLessItems,F=o.showTitle,Q=o.showTotal,q=o.simple,ie=o.itemRender,ge=o.showPrevNextJumpers,fe=o.jumpPrevIcon,ue=o.jumpNextIcon,he=o.selectComponentClass,_e=o.selectPrefixCls,le=o.pageSizeOptions,ne=this.state,Te=ne.current,Fe=ne.pageSize,Ke=ne.currentInputValue;if(U===!0&&j<=Fe)return null;var Ue=R(void 0,this.state,this.props),He=[],Ne=null,Be=null,Je=null,tt=null,it=null,rt=y&&y.goButton,qe=x?1:2,gt=Te-1>0?Te-1:0,pt=Te+1<Ue?Te+1:Ue,vt=Object.keys(this.props).reduce(function(se,ce){return(ce.substr(0,5)==="data-"||ce.substr(0,5)==="aria-"||ce==="role")&&(se[ce]=s.props[ce]),se},{});if(q)return rt&&(typeof rt=="boolean"?it=L.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):it=L.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},rt),it=L.a.createElement("li",{title:F?"".concat(H.jump_to).concat(Te,"/").concat(Ue):null,className:"".concat(E,"-simple-pager")},it)),L.a.createElement("ul",Object(de.a)({className:b()(E,"".concat(E,"-simple"),Object(Z.a)({},"".concat(E,"-disabled"),N),g),style:C,ref:this.savePaginationNode},vt),L.a.createElement("li",{title:F?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(E,"-prev"),Object(Z.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(gt)),L.a.createElement("li",{title:F?"".concat(Te,"/").concat(Ue):null,className:"".concat(E,"-simple-pager")},L.a.createElement("input",{type:"text",value:Ke,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),L.a.createElement("span",{className:"".concat(E,"-slash")},"/"),Ue),L.a.createElement("li",{title:F?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(E,"-next"),Object(Z.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(pt)),it);if(Ue<=3+qe*2){var at={locale:H,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:F,itemRender:ie};Ue||He.push(L.a.createElement(_,Object(de.a)({},at,{key:"noPager",page:Ue,className:"".concat(E,"-disabled")})));for(var Rt=1;Rt<=Ue;Rt+=1){var xt=Te===Rt;He.push(L.a.createElement(_,Object(de.a)({},at,{key:Rt,page:Rt,active:xt})))}}else{var Tt=x?H.prev_3:H.prev_5,Ye=x?H.next_3:H.next_5;ge&&(Ne=L.a.createElement("li",{title:F?Tt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(E,"-jump-prev"),Object(Z.a)({},"".concat(E,"-jump-prev-custom-icon"),!!fe))},ie(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(fe,"prev page"))),Be=L.a.createElement("li",{title:F?Ye:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(E,"-jump-next"),Object(Z.a)({},"".concat(E,"-jump-next-custom-icon"),!!ue))},ie(this.getJumpNextPage(),"jump-next",this.getItemIcon(ue,"next page")))),tt=L.a.createElement(_,{locale:H,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ue,page:Ue,active:!1,showTitle:F,itemRender:ie}),Je=L.a.createElement(_,{locale:H,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:F,itemRender:ie});var Mt=Math.max(1,Te-qe),St=Math.min(Te+qe,Ue);Te-1<=qe&&(St=1+qe*2),Ue-Te<=qe&&(Mt=Ue-qe*2);for(var ze=Mt;ze<=St;ze+=1){var ut=Te===ze;He.push(L.a.createElement(_,{locale:H,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ze,page:ze,active:ut,showTitle:F,itemRender:ie}))}Te-1>=qe*2&&Te!==1+2&&(He[0]=Object(W.cloneElement)(He[0],{className:"".concat(E,"-item-after-jump-prev")}),He.unshift(Ne)),Ue-Te>=qe*2&&Te!==Ue-2&&(He[He.length-1]=Object(W.cloneElement)(He[He.length-1],{className:"".concat(E,"-item-before-jump-next")}),He.push(Be)),Mt!==1&&He.unshift(Je),St!==Ue&&He.push(tt)}var be=null;Q&&(be=L.a.createElement("li",{className:"".concat(E,"-total-text")},Q(j,[j===0?0:(Te-1)*Fe+1,Te*Fe>j?j:Te*Fe])));var xe=!this.hasPrev()||!Ue,pe=!this.hasNext()||!Ue;return L.a.createElement("ul",Object(de.a)({className:b()(E,g,Object(Z.a)({},"".concat(E,"-disabled"),N)),style:C,unselectable:"unselectable",ref:this.savePaginationNode},vt),be,L.a.createElement("li",{title:F?H.prev_page:null,onClick:this.prev,tabIndex:xe?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(E,"-prev"),Object(Z.a)({},"".concat(E,"-disabled"),xe)),"aria-disabled":xe},this.renderPrev(gt)),He,L.a.createElement("li",{title:F?H.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(E,"-next"),Object(Z.a)({},"".concat(E,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(pt)),L.a.createElement(d,{disabled:N,locale:H,rootPrefixCls:E,selectComponentClass:he,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Te,pageSize:Fe,pageSizeOptions:le,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:rt}))}}],[{key:"getDerivedStateFromProps",value:function(s,o){var E={};if("current"in s&&(E.current=s.current,s.current!==o.current&&(E.currentInputValue=E.current)),"pageSize"in s&&s.pageSize!==o.pageSize){var g=o.current,C=R(s.pageSize,o,s);g=g>C?C:g,"current"in s||(E.current=g,E.currentInputValue=g),E.pageSize=s.pageSize}return E}}]),m}(L.a.Component);O.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:l.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var T=O},"6UM0":function(ft,Xe,G){var de,Z;(function(){var M;(function(){"use strict";var I=[function(L,P,b){var p=b(1).Beautifier,_=b(5).Options;function h(r,d){var l=new p(r,d);return l.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new _}},function(L,P,b){var p=b(2).Output,_=b(3).Token,h=b(4),r=b(5).Options,d=b(7).Tokenizer,l=b(7).line_starters,a=b(7).positionable_operators,u=b(7).TOKEN;function c(x,F){return F.indexOf(x)!==-1}function R(x){return x.replace(/^\s+/g,"")}function O(x){for(var F={},Q=0;Q<x.length;Q++)F[x[Q].replace(/-/g,"_")]=x[Q];return F}function T(x,F){return x&&x.type===u.RESERVED&&x.text===F}function A(x,F){return x&&x.type===u.RESERVED&&c(x.text,F)}var w=["case","return","do","if","throw","else","await","break","continue","async"],m=["before-newline","after-newline","preserve-newline"],v=O(m),s=[v.before_newline,v.preserve_newline],o={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(x,F){if(F.multiline_frame||F.mode===o.ForInitializer||F.mode===o.Conditional)return;x.remove_indent(F.start_line_index)}function g(x){x=x.replace(h.allLineBreaks,`
`);for(var F=[],Q=x.indexOf(`
`);Q!==-1;)F.push(x.substring(0,Q)),x=x.substring(Q+1),Q=x.indexOf(`
`);return x.length&&F.push(x),F}function C(x){return x===o.ArrayLiteral}function N(x){return c(x,[o.Expression,o.ForInitializer,o.Conditional])}function U(x,F){for(var Q=0;Q<x.length;Q++){var q=x[Q].trim();if(q.charAt(0)!==F)return!1}return!0}function j(x,F){for(var Q=0,q=x.length,ie;Q<q;Q++)if(ie=x[Q],ie&&ie.indexOf(F)!==0)return!1;return!0}function H(x,F){F=F||{},this._source_text=x||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(F)}H.prototype.create_flags=function(x,F){var Q=0;x&&(Q=x.indentation_level,!this._output.just_added_newline()&&x.line_indent_level>Q&&(Q=x.line_indent_level));var q={mode:F,parent:x,last_token:x?x.last_token:new _(u.START_BLOCK,""),last_word:x?x.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Q,alignment:0,line_indent_level:x?x.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return q},H.prototype._reset=function(x){var F=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,F),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(o.BlockStatement);var Q=new d(x,this._options);return this._tokens=Q.tokenize(),x},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,F=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
`,F&&h.lineBreak.test(F||"")&&(Q=F.match(h.lineBreak)[0]));for(var q=this._tokens.next();q;)this.handle_token(q),this._last_last_text=this._flags.last_token.text,this._flags.last_token=q,q=this._tokens.next();return x=this._output.get_code(Q),x},H.prototype.handle_token=function(x,F){x.type===u.START_EXPR?this.handle_start_expr(x):x.type===u.END_EXPR?this.handle_end_expr(x):x.type===u.START_BLOCK?this.handle_start_block(x):x.type===u.END_BLOCK?this.handle_end_block(x):x.type===u.WORD?this.handle_word(x):x.type===u.RESERVED?this.handle_word(x):x.type===u.SEMICOLON?this.handle_semicolon(x):x.type===u.STRING?this.handle_string(x):x.type===u.EQUALS?this.handle_equals(x):x.type===u.OPERATOR?this.handle_operator(x):x.type===u.COMMA?this.handle_comma(x):x.type===u.BLOCK_COMMENT?this.handle_block_comment(x,F):x.type===u.COMMENT?this.handle_comment(x,F):x.type===u.DOT?this.handle_dot(x):x.type===u.EOF?this.handle_eof(x):x.type===u.UNKNOWN?this.handle_unknown(x,F):this.handle_unknown(x,F)},H.prototype.handle_whitespace_and_comments=function(x,F){var Q=x.newlines,q=this._options.keep_array_indentation&&C(this._flags.mode);if(x.comments_before)for(var ie=x.comments_before.next();ie;)this.handle_whitespace_and_comments(ie,F),this.handle_token(ie,F),ie=x.comments_before.next();if(q)for(var ge=0;ge<Q;ge+=1)this.print_newline(ge>0,F);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,F);for(var fe=1;fe<Q;fe+=1)this.print_newline(!0,F)}};var y=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(x,F){if(F=F===void 0?!1:F,this._output.just_added_newline())return;var Q=this._options.preserve_newlines&&x.newlines||F,q=c(this._flags.last_token.text,a)||c(x.text,a);if(q){var ie=c(this._flags.last_token.text,a)&&c(this._options.operator_position,s)||c(x.text,a);Q=Q&&ie}if(Q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(A(this._flags.last_token,y))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(x,F){if(!F&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Q=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&T(Q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(x)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(x){this._output.just_added_newline()&&(this._options.keep_array_indentation&&x.newlines&&(x.text==="["||C(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(x.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},H.prototype.print_token=function(x){if(this._output.raw){this._output.add_raw_token(x);return}if(this._options.comma_first&&x.previous&&x.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var F=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(F),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(x),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(x),this._output.non_breaking_space=!0,this._output.add_token(x.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.set_mode=function(x){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,x),this._flags=this.create_flags(this._previous_flags,x),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===o.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(x){var F=!1;return F=F||A(this._flags.last_token,["var","let","const"])&&x.type===u.WORD,F=F||T(this._flags.last_token,"do"),F=F||!(this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement)&&A(this._flags.last_token,y)&&!x.newlines,F=F||T(this._flags.last_token,"else")&&!(T(x,"if")&&!x.comments_before),F=F||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===o.ForInitializer||this._previous_flags.mode===o.Conditional),F=F||this._flags.last_token.type===u.WORD&&this._flags.mode===o.BlockStatement&&!this._flags.in_case&&!(x.text==="--"||x.text==="++")&&this._last_last_text!=="function"&&x.type!==u.WORD&&x.type!==u.RESERVED,F=F||this._flags.mode===o.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),F?(this.set_mode(o.Statement),this.indent(),this.handle_whitespace_and_comments(x,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x,A(x,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var F=o.Expression;if(x.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(F),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}F=o.ArrayLiteral,C(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),c(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,F=o.ForInitializer):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,F=o.Conditional):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&x.whitespace_before===""?this._output.space_before_token=!1:(c(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var q=this._tokens.peek(-4);A(Q,["async","function"])||Q.text==="*"&&A(q,["async","function"])?this._output.space_before_token=!0:this._flags.mode===o.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(q.text==="{"||q.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(x);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(x,x.newlines),this.print_token(x),this.set_mode(F),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(x){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(x,x.text==="]"&&C(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(x),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===o.Conditional&&(this._previous_flags.mode=o.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var F=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(o.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(o.BlockStatement):Q&&(c(Q.text,[":",","])&&c(F.type,[u.STRING,u.WORD,u.RESERVED])||c(F.text,["get","set","..."])&&c(Q.type,[u.WORD,u.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(Q.text,[":",","])?this.set_mode(o.BlockStatement):this.set_mode(o.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(o.BlockStatement):c(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(o.ObjectLiteral):this.set_mode(o.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var q=!F.comments_before&&F.text==="}",ie=q&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var ge=0,fe=null;this._flags.inline_frame=!0;do if(ge+=1,fe=this._tokens.peek(ge-1),fe.newlines){this._flags.inline_frame=!1;break}while(fe.type!==u.EOF&&!(fe.type===u.END_BLOCK&&fe.opened===x))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(ie||this._flags.last_token.type===u.EQUALS||A(this._flags.last_token,w)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(C(this._previous_flags.mode)&&(this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(x),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(x),this.indent(),!q&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===o.Statement;)this.restore_mode();var F=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!F?this._output.space_before_token=!0:this._options.brace_style==="expand"?F||this.print_newline():F||(C(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(x)},H.prototype.handle_word=function(x){if(x.type===u.RESERVED){if(c(x.text,["set","get"])&&this._flags.mode!==o.ObjectLiteral)x.type=u.WORD;else if(x.text==="import"&&c(this._tokens.peek().text,["(","."]))x.type=u.WORD;else if(c(x.text,["as","from"])&&!this._flags.import_block)x.type=u.WORD;else if(this._flags.mode===o.ObjectLiteral){var F=this._tokens.peek();F.text===":"&&(x.type=u.WORD)}}if(this.start_of_statement(x)?A(this._flags.last_token,["var","let","const"])&&x.type===u.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(x),this.print_newline()):this.handle_whitespace_and_comments(x),this._flags.do_block&&!this._flags.do_while)if(T(x,"while")){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(x,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===o.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(x,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(x),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x)),T(x,"function")){(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(c(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!x.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,y)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||C(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var Q="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":A(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===o.BlockStatement?Q="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&N(this._flags.mode)?Q="SPACE":this._flags.last_token.type===u.STRING?Q="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&c(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),A(x,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),A(x,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===o.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var q=this._output.current_line;q.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?A(this._flags.last_token,w)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(x,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!A(x,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(x,"if")&&T(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(x,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&C(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);x.previous&&(x.previous.type===u.WORD||x.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(x),this._flags.last_word=x.text,x.type===u.RESERVED&&(x.text==="do"?this._flags.do_block=!0:x.text==="if"?this._flags.if_block=!0:x.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(x,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var F=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&T(F,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},H.prototype.handle_string=function(x){x.text.startsWith("`")&&x.newlines===0&&x.whitespace_before===""&&(x.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(x)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(x),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x):x.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(x.previous.text==="]"||x.previous.text===")")&&x.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(x)},H.prototype.handle_equals=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0},H.prototype.handle_comma=function(x){this.handle_whitespace_and_comments(x,!0),this.print_token(x),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)):this._flags.mode===o.ObjectLiteral||this._flags.mode===o.Statement&&this._flags.parent.mode===o.ObjectLiteral?(this._flags.mode===o.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)},H.prototype.handle_operator=function(x){var F=x.text==="*"&&(A(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),Q=c(x.text,["-","+"])&&(c(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||c(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var q=!F;this.handle_whitespace_and_comments(x,q)}if(x.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(x);return}if(x.text==="::"){this.print_token(x);return}if(this._flags.last_token.type===u.OPERATOR&&c(this._options.operator_position,s)&&this.allow_wrap_or_preserved_newline(x),x.text===":"&&this._flags.in_case){this.print_token(x),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ie=!0,ge=!0,fe=!1;if(x.text===":"?this._flags.ternary_depth===0?ie=!1:(this._flags.ternary_depth-=1,fe=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!F&&this._options.preserve_newlines&&c(x.text,a)){var ue=x.text===":",he=ue&&fe,_e=ue&&!fe;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!_e,this.print_token(x),(!ue||he)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!ue||he?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(x):this._output.space_before_token=!1,this.print_token(x),this._output.space_before_token=!0;return;case v.preserve_newline:_e||this.allow_wrap_or_preserved_newline(x),ie=!(this._output.just_added_newline()||_e),this._output.space_before_token=ie,this.print_token(x),this._output.space_before_token=!0;return}}if(F){this.allow_wrap_or_preserved_newline(x),ie=!1;var le=this._tokens.peek();ge=le&&c(le.type,[u.WORD,u.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),ie=this._flags.last_token.type===u.START_BLOCK,ge=!1;else if(c(x.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),ie=!1,ge=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var ne=A(this._flags.last_token,w)&&x.newlines;ne&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ne,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(ie=!0),this._flags.last_token.type===u.RESERVED?ie=!0:this._flags.last_token.type===u.END_EXPR?ie=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===u.OPERATOR&&(ie=c(x.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(x.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(ge=!0)),(this._flags.mode===o.BlockStatement&&!this._flags.inline_frame||this._flags.mode===o.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ie,this.print_token(x),this._output.space_before_token=ge},H.prototype.handle_block_comment=function(x,F){if(this._output.raw){this._output.add_raw_token(x),x.directives&&x.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(x.directives){this.print_newline(!1,F),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(x.text)&&!x.newlines){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0;return}else this.print_block_commment(x,F)},H.prototype.print_block_commment=function(x,F){var Q=g(x.text),q,ie=!1,ge=!1,fe=x.whitespace_before,ue=fe.length;if(this.print_newline(!1,F),this.print_token_line_indentation(x),this._output.add_token(Q[0]),this.print_newline(!1,F),Q.length>1){for(Q=Q.slice(1),ie=U(Q,"*"),ge=j(Q,fe),ie&&(this._flags.alignment=1),q=0;q<Q.length;q++)ie?(this.print_token_line_indentation(x),this._output.add_token(R(Q[q]))):ge&&Q[q]?(this.print_token_line_indentation(x),this._output.add_token(Q[q].substring(ue))):(this._output.current_line.set_indent(-1),this._output.add_token(Q[q])),this.print_newline(!1,F);this._flags.alignment=0}},H.prototype.handle_comment=function(x,F){x.newlines?this.print_newline(!1,F):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(x),this.print_newline(!1,F)},H.prototype.handle_dot=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),A(this._flags.last_token,w)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(x,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(x)},H.prototype.handle_unknown=function(x,F){this.print_token(x),x.text[x.text.length-1]===`
`&&this.print_newline(!1,F)},H.prototype.handle_eof=function(x){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x)},L.exports.Beautifier=H},function(L){function P(_){this.__parent=_,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}P.prototype.clone_empty=function(){var _=new P(this.__parent);return _.set_indent(this.__indent_count,this.__alignment_count),_},P.prototype.item=function(_){return _<0?this.__items[this.__items.length+_]:this.__items[_]},P.prototype.has_match=function(_){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(_))return!0;return!1},P.prototype.set_indent=function(_,h){this.is_empty()&&(this.__indent_count=_||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},P.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},P.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},P.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var _=this.__parent.current_line;return _.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),_.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),_.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,_.__items[0]===" "&&(_.__items.splice(0,1),_.__character_count-=1),!0}return!1},P.prototype.is_empty=function(){return this.__items.length===0},P.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},P.prototype.push=function(_){this.__items.push(_);var h=_.lastIndexOf(`
`);h!==-1?this.__character_count=_.length-h:this.__character_count+=_.length},P.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},P.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},P.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},P.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},P.prototype.toString=function(){var _="";return this.is_empty()?this.__parent.indent_empty_lines&&(_=this.__parent.get_indent_string(this.__indent_count)):(_=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),_+=this.__items.join("")),_};function b(_,h){this.__cache=[""],this.__indent_size=_.indent_size,this.__indent_string=_.indent_char,_.indent_with_tabs||(this.__indent_string=new Array(_.indent_size+1).join(_.indent_char)),h=h||"",_.indent_level>0&&(h=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}b.prototype.get_indent_size=function(_,h){var r=this.__base_string_length;return h=h||0,_<0&&(r=0),r+=_*this.__indent_size,r+=h,r},b.prototype.get_indent_string=function(_,h){var r=this.__base_string;return h=h||0,_<0&&(_=0,r=""),h+=_*this.__indent_size,this.__ensure_cache(h),r+=this.__cache[h],r},b.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var _=this.__cache.length,h=0,r="";this.__indent_size&&_>=this.__indent_size&&(h=Math.floor(_/this.__indent_size),_-=h*this.__indent_size,r=new Array(h+1).join(this.__indent_string)),_&&(r+=new Array(_+1).join(" ")),this.__cache.push(r)};function p(_,h){this.__indent_cache=new b(_,h),this.raw=!1,this._end_with_newline=_.end_with_newline,this.indent_size=_.indent_size,this.wrap_line_length=_.wrap_line_length,this.indent_empty_lines=_.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new P(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(_,h){return this.__indent_cache.get_indent_string(_,h)},p.prototype.get_indent_size=function(_,h){return this.__indent_cache.get_indent_size(_,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(_){return this.is_empty()||!_&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(_){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return _!==`
`&&(r=r.replace(/[\n]/g,_)),r},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,h){return _=_||0,h=h||0,this.next_line.set_indent(_,h),this.__lines.length>1?(this.current_line.set_indent(_,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var h=0;h<_.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(_.whitespace_before),this.current_line.push(_.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(_){this.__add_space_before_token(),this.current_line.push(_),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(_){for(var h=this.__lines.length;_<h;)this.__lines[_]._remove_indent(),_++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(_){for(_=_===void 0?!1:_,this.current_line.trim();_&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(_,h){for(var r=this.__lines.length-2;r>=0;){var d=this.__lines[r];if(d.is_empty())break;if(d.item(0).indexOf(_)!==0&&d.item(-1)!==h){this.__lines.splice(r+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},L.exports.Output=p},function(L){function P(b,p,_,h){this.type=b,this.text=p,this.comments_before=null,this.newlines=_||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=P},function(L,P){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",_="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",r="(?:\\\\u[0-9a-fA-F]{4}|["+b+_+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+_+h+"])*";P.identifier=new RegExp(r+d,"g"),P.identifierStart=new RegExp(r),P.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+_+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;P.newline=/[\n\r\u2028\u2029]/,P.lineBreak=new RegExp(`\r
|`+P.newline.source),P.allLineBreaks=new RegExp(P.lineBreak.source,"g")},function(L,P,b){var p=b(6).Options,_=["before-newline","after-newline","preserve-newline"];function h(r){p.call(this,r,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<l.length;a++)l[a]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",_),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}h.prototype=new p,L.exports.Options=h},function(L){function P(_,h){this.raw_options=b(_,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}P.prototype._get_array=function(_,h){var r=this.raw_options[_],d=h||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(d=r.concat()):typeof r=="string"&&(d=r.split(/[^a-zA-Z0-9_\/\-]+/)),d},P.prototype._get_boolean=function(_,h){var r=this.raw_options[_],d=r===void 0?!!h:!!r;return d},P.prototype._get_characters=function(_,h){var r=this.raw_options[_],d=h||"";return typeof r=="string"&&(d=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},P.prototype._get_number=function(_,h){var r=this.raw_options[_];h=parseInt(h,10),isNaN(h)&&(h=0);var d=parseInt(r,10);return isNaN(d)&&(d=h),d},P.prototype._get_selection=function(_,h,r){var d=this._get_selection_list(_,h,r);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+_+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[_]+"'");return d[0]},P.prototype._get_selection_list=function(_,h,r){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[h[0]],!this._is_valid_selection(r,h))throw new Error("Invalid Default Value!");var d=this._get_array(_,r);if(!this._is_valid_selection(d,h))throw new Error("Invalid Option Value: The option '"+_+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[_]+"'");return d},P.prototype._is_valid_selection=function(_,h){return _.length&&h.length&&!_.some(function(r){return h.indexOf(r)===-1})};function b(_,h){var r={};_=p(_);var d;for(d in _)d!==h&&(r[d]=_[d]);if(h&&_[h])for(d in _[h])r[d]=_[h][d];return r}function p(_){var h={},r;for(r in _){var d=r.replace(/-/g,"_");h[d]=_[r]}return h}L.exports.Options=P,L.exports.normalizeOpts=p,L.exports.mergeOpts=b},function(L,P,b){var p=b(8).InputScanner,_=b(9).Tokenizer,h=b(9).TOKEN,r=b(13).Directives,d=b(4),l=b(12).Pattern,a=b(14).TemplatablePattern;function u(U,j){return j.indexOf(U)!==-1}var c={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:h.START,RAW:h.RAW,EOF:h.EOF},R=new r(/\/\*/,/\*\//),O=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,A=/[^\d\.]/,w=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),m="\\?\\.(?!\\d) "+m,m=m.replace(/ /g,"|");var v=new RegExp(m),s="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),o=s.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+o.join("|")+")$"),g,C=function(U,j){_.call(this,U,j),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new l(this._input),y=new a(this._input).read_options(this._options);this.__patterns={template:y,identifier:y.starting_with(d.identifier).matching(d.identifierMatch),number:H.matching(O),punct:H.matching(v),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(d.lineBreak),shebang:H.starting_with(/#!/).until_after(d.lineBreak),xml:H.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:y.until(/['\\\n\r\u2028\u2029]/),double_quote:y.until(/["\\\n\r\u2028\u2029]/),template_text:y.until(/[`\\$]/),template_expression:y.until(/[`}\\]/)}};C.prototype=new _,C.prototype._is_comment=function(U){return U.type===c.COMMENT||U.type===c.BLOCK_COMMENT||U.type===c.UNKNOWN},C.prototype._is_opening=function(U){return U.type===c.START_BLOCK||U.type===c.START_EXPR},C.prototype._is_closing=function(U,j){return(U.type===c.END_BLOCK||U.type===c.END_EXPR)&&j&&(U.text==="]"&&j.text==="["||U.text===")"&&j.text==="("||U.text==="}"&&j.text==="{")},C.prototype._reset=function(){g=!1},C.prototype._get_next_token=function(U,j){var H=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(c.EOF,""):(H=H||this._read_non_javascript(y),H=H||this._read_string(y),H=H||this._read_word(U),H=H||this._read_singles(y),H=H||this._read_comment(y),H=H||this._read_regexp(y,U),H=H||this._read_xml(y,U),H=H||this._read_punctuation(),H=H||this._create_token(c.UNKNOWN,this._input.next()),H)},C.prototype._read_word=function(U){var j;if(j=this.__patterns.identifier.read(),j!=="")return j=j.replace(d.allLineBreaks,`
`),!(U.type===c.DOT||U.type===c.RESERVED&&(U.text==="set"||U.text==="get"))&&E.test(j)?(j==="in"||j==="of")&&(U.type===c.WORD||U.type===c.STRING)?this._create_token(c.OPERATOR,j):this._create_token(c.RESERVED,j):this._create_token(c.WORD,j);if(j=this.__patterns.number.read(),j!=="")return this._create_token(c.WORD,j)},C.prototype._read_singles=function(U){var j=null;return U==="("||U==="["?j=this._create_token(c.START_EXPR,U):U===")"||U==="]"?j=this._create_token(c.END_EXPR,U):U==="{"?j=this._create_token(c.START_BLOCK,U):U==="}"?j=this._create_token(c.END_BLOCK,U):U===";"?j=this._create_token(c.SEMICOLON,U):U==="."&&A.test(this._input.peek(1))?j=this._create_token(c.DOT,U):U===","&&(j=this._create_token(c.COMMA,U)),j&&this._input.next(),j},C.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(c.EQUALS,U):U==="?."?this._create_token(c.DOT,U):this._create_token(c.OPERATOR,U)},C.prototype._read_non_javascript=function(U){var j="";if(U==="#"){if(this._is_first_token()&&(j=this.__patterns.shebang.read(),j))return this._create_token(c.UNKNOWN,j.trim()+`
`);if(j=this.__patterns.include.read(),j)return this._create_token(c.UNKNOWN,j.trim()+`
`);U=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(T)){do U=this._input.next(),H+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,H)}this._input.back()}else if(U==="<"&&this._is_first_token()){if(j=this.__patterns.html_comment_start.read(),j){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)j+=this._input.next();return g=!0,this._create_token(c.COMMENT,j)}}else if(g&&U==="-"&&(j=this.__patterns.html_comment_end.read(),j))return g=!1,this._create_token(c.COMMENT,j);return null},C.prototype._read_comment=function(U){var j=null;if(U==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var y=R.get_directives(H);y&&y.ignore==="start"&&(H+=R.readIgnored(this._input)),H=H.replace(d.allLineBreaks,`
`),j=this._create_token(c.BLOCK_COMMENT,H),j.directives=y}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),j=this._create_token(c.COMMENT,H))}return j},C.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var j=this._input.next();return this.has_char_escapes=!1,U==="`"?j+=this._read_string_recursive("`",!0,"${"):j+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(j=N(j)),this._input.peek()===U&&(j+=this._input.next()),j=j.replace(d.allLineBreaks,`
`),this._create_token(c.STRING,j)}return null},C.prototype._allow_regexp_or_xml=function(U){return U.type===c.RESERVED&&u(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===c.END_EXPR&&U.text===")"&&U.opened.previous.type===c.RESERVED&&u(U.opened.previous.text,["if","while","for"])||u(U.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},C.prototype._read_regexp=function(U,j){if(U==="/"&&this._allow_regexp_or_xml(j)){for(var H=this._input.next(),y=!1,x=!1;this._input.hasNext()&&(y||x||this._input.peek()!==U)&&!this._input.testChar(d.newline);)H+=this._input.peek(),y?y=!1:(y=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===U&&(H+=this._input.next(),H+=this._input.read(d.identifier)),this._create_token(c.STRING,H)}return null},C.prototype._read_xml=function(U,j){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(j)){var H="",y=this.__patterns.xml.read_match();if(y){for(var x=y[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),F=x.indexOf("{")===0,Q=0;y;){var q=!!y[1],ie=y[2],ge=!!y[y.length-1]||ie.slice(0,8)==="![CDATA[";if(!ge&&(ie===x||F&&ie.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(q?--Q:++Q),H+=y[0],Q<=0)break;y=this.__patterns.xml.read_match()}return y||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(d.allLineBreaks,`
`),this._create_token(c.STRING,H)}}return null};function N(U){for(var j="",H=0,y=new p(U),x=null;y.hasNext();)if(x=y.match(/([\s]|[^\\]|\\\\)+/g),x&&(j+=x[0]),y.peek()==="\\"){if(y.next(),y.peek()==="x")x=y.match(/x([0-9A-Fa-f]{2})/g);else if(y.peek()==="u")x=y.match(/u([0-9A-Fa-f]{4})/g);else{j+="\\",y.hasNext()&&(j+=y.next());continue}if(!x)return U;if(H=parseInt(x[1],16),H>126&&H<=255&&x[0].indexOf("x")===0)return U;if(H>=0&&H<32){j+="\\"+x[0];continue}else H===34||H===39||H===92?j+="\\"+String.fromCharCode(H):j+=String.fromCharCode(H)}return j}C.prototype._read_string_recursive=function(U,j,H){var y,x;U==="'"?x=this.__patterns.single_quote:U==='"'?x=this.__patterns.double_quote:U==="`"?x=this.__patterns.template_text:U==="}"&&(x=this.__patterns.template_expression);for(var F=x.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===U||!j&&d.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(y=this._input.peek(),y==="x"||y==="u"?this.has_char_escapes=!0:y==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Q+=this._input.next()):H&&(H==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),H===Q&&(U==="`"?Q+=this._read_string_recursive("}",j,"`"):Q+=this._read_string_recursive("`",j,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=x.read(),F+=Q}return F},L.exports.Tokenizer=C,L.exports.TOKEN=c,L.exports.positionable_operators=w.slice(),L.exports.line_starters=s.slice()},function(L){var P=RegExp.prototype.hasOwnProperty("sticky");function b(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},b.prototype.peek=function(p){var _=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(_=this.__input.charAt(p)),_},b.prototype.__match=function(p,_){p.lastIndex=_;var h=p.exec(this.__input);return h&&!(P&&p.sticky)&&(h.index!==_&&(h=null)),h},b.prototype.test=function(p,_){return _=_||0,_+=this.__position,_>=0&&_<this.__input_length?!!this.__match(p,_):!1},b.prototype.testChar=function(p,_){var h=this.peek(_);return p.lastIndex=0,h!==null&&p.test(h)},b.prototype.match=function(p){var _=this.__match(p,this.__position);return _?this.__position+=_[0].length:_=null,_},b.prototype.read=function(p,_,h){var r="",d;return p&&(d=this.match(p),d&&(r+=d[0])),_&&(d||!p)&&(r+=this.readUntil(_,h)),r},b.prototype.readUntil=function(p,_){var h="",r=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(r=d.index,_&&(r+=d[0].length)):r=this.__input_length,h=this.__input.substring(this.__position,r),this.__position=r,h},b.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},b.prototype.get_regexp=function(p,_){var h=null,r="g";return _&&P&&(r="y"),typeof p=="string"&&p!==""?h=new RegExp(p,r):p&&(h=new RegExp(p.source,r)),h},b.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(p){var _=this.__position,h=this.readUntilAfter(p);return this.__position=_,h},b.prototype.lookBack=function(p){var _=this.__position-1;return _>=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},L.exports.InputScanner=b},function(L,P,b){var p=b(8).InputScanner,_=b(3).Token,h=b(10).TokenStream,r=b(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(a,u){this._input=new p(a),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var a,u=new _(d.START,""),c=null,R=[],O=new h;u.type!==d.EOF;){for(a=this._get_next_token(u,c);this._is_comment(a);)O.add(a),a=this._get_next_token(u,c);O.isEmpty()||(a.comments_before=O,O=new h),a.parent=c,this._is_opening(a)?(R.push(c),c=a):c&&this._is_closing(a,c)&&(a.opened=c,c.closed=a,c=R.pop(),a.parent=c),a.previous=u,u.next=a,this.__tokens.add(a),u=a}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(a,u){this._readWhitespace();var c=this._input.read(/.+/g);return c?this._create_token(d.RAW,c):this._create_token(d.EOF,"")},l.prototype._is_comment=function(a){return!1},l.prototype._is_opening=function(a){return!1},l.prototype._is_closing=function(a,u){return!1},l.prototype._create_token=function(a,u){var c=new _(a,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return c},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=l,L.exports.TOKEN=d},function(L){function P(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}P.prototype.restart=function(){this.__position=0},P.prototype.isEmpty=function(){return this.__tokens_length===0},P.prototype.hasNext=function(){return this.__position<this.__tokens_length},P.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},P.prototype.peek=function(b){var p=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(p=this.__tokens[b]),p},P.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},L.exports.TokenStream=P},function(L,P,b){var p=b(12).Pattern;function _(h,r){p.call(this,h,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}_.prototype=new p,_.prototype.__set_whitespace_patterns=function(h,r){h+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},_.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var r=this.__split(this._newline_regexp,h);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return h},_.prototype.matching=function(h,r){var d=this._create();return d.__set_whitespace_patterns(h,r),d._update(),d},_.prototype._create=function(){return new _(this._input,this)},_.prototype.__split=function(h,r){h.lastIndex=0;for(var d=0,l=[],a=h.exec(r);a;)l.push(r.substring(d,a.index)),d=a.index+a[0].length,a=h.exec(r);return d<r.length?l.push(r.substring(d,r.length)):l.push(""),l},L.exports.WhitespacePattern=_},function(L){function P(b,p){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}P.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},P.prototype.read_match=function(){return this._input.match(this._match_pattern)},P.prototype.until_after=function(b){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(b),p._update(),p},P.prototype.until=function(b){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(b),p._update(),p},P.prototype.starting_with=function(b){var p=this._create();return p._starting_pattern=this._input.get_regexp(b,!0),p._update(),p},P.prototype.matching=function(b){var p=this._create();return p._match_pattern=this._input.get_regexp(b,!0),p._update(),p},P.prototype._create=function(){return new P(this._input,this)},P.prototype._update=function(){},L.exports.Pattern=P},function(L){function P(b,p){b=typeof b=="string"?b:b.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+p,"g")}P.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var _=this.__directive_pattern.exec(b);_;)p[_[1]]=_[2],_=this.__directive_pattern.exec(b);return p},P.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=P},function(L,P,b){var p=b(12).Pattern,_={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(r,d){p.call(this,r,d),this.__template_pattern=null,this._disabled=Object.assign({},_),this._excluded=Object.assign({},_),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var l=new p(r);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new p,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(r){var d=this._create();return d._disabled[r]=!0,d._update(),d},h.prototype.read_options=function(r){var d=this._create();for(var l in _)d._disabled[l]=r.templating.indexOf(l)===-1;return d._update(),d},h.prototype.exclude=function(r){var d=this._create();return d._excluded[r]=!0,d._update(),d},h.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),r+=d,d=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},h.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},h.prototype._read_template=function(){var r="",d=this._input.peek();if(d==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(r=r||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},L.exports.TemplatablePattern=h}],B={};function K(L){var P=B[L];if(P!==void 0)return P.exports;var b=B[L]={exports:{}};return I[L](b,b.exports,K),b.exports}var W=K(0);M=W})();var V=M;!(de=[],Z=function(){return{js_beautify:V}}.apply(Xe,de),Z!==void 0&&(ft.exports=Z))})()},"7Cbv":function(ft,Xe,G){"use strict";var de=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Z=new Uint8Array(16);function M(){if(!de)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return de(Z)}var V=/^(?:[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(_){return typeof _=="string"&&V.test(_)}for(var B=I,K=[],W=0;W<256;++W)K.push((W+256).toString(16).substr(1));function L(_){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(K[_[h+0]]+K[_[h+1]]+K[_[h+2]]+K[_[h+3]]+"-"+K[_[h+4]]+K[_[h+5]]+"-"+K[_[h+6]]+K[_[h+7]]+"-"+K[_[h+8]]+K[_[h+9]]+"-"+K[_[h+10]]+K[_[h+11]]+K[_[h+12]]+K[_[h+13]]+K[_[h+14]]+K[_[h+15]]).toLowerCase();if(!B(r))throw TypeError("Stringified UUID is invalid");return r}var P=L;function b(_,h,r){_=_||{};var d=_.random||(_.rng||M)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,h){r=r||0;for(var l=0;l<16;++l)h[r+l]=d[l];return h}return P(d)}var p=Xe.a=b},"7ahc":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return R});var de=G("k1fw"),Z=G("0Owb"),M=G("+L6B"),V=G("2/Rp"),I=G("y8nQ"),B=G("Vl3Y"),K=G("tJVT"),W=G("OaEy"),L=G("2fM7"),P=G("q1tI"),b=G.n(P),p=G("VrN/"),_=G.n(p),h=G("p77/"),r=G.n(h),d=G("c5Ni"),l=G.n(d),a=L.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},c={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(O){var T=O.callback,A=O.onCancel,w=Object(P.useState)("python"),m=Object(K.a)(w,2),v=m[0],s=m[1];function o(g){s(c[g][1])}function E(g){T(g)}return b.a.createElement(B.a,Object(Z.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),b.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(L.a,{onChange:o},Object.keys(c).map(function(g){return b.a.createElement(a,{key:g,value:g},c[g][0])}))),b.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(R,{mode:v})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(V.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function R(O){var T=O.value,A=O.onChange,w=O.mode,m=O.options,v=m===void 0?{}:m,s=Object(P.useRef)(),o=Object(P.useState)(),E=Object(K.a)(o,2),g=E[0],C=E[1];return Object(P.useEffect)(function(){if(g){function N(U){var j=U.getValue();A&&A(j)}return g.on("change",N),function(){g.off("change",N)}}},[g,A]),Object(P.useEffect)(function(){g&&g.setOption("mode",w)},[g,w]),Object(P.useEffect)(function(){g&&((T!==g.getValue()||T==="")&&setTimeout(function(){g.setValue(T||" ")},300))},[g,T]),Object(P.useEffect)(function(){if(s.current&&!g){var N=_.a.fromTextArea(s.current,Object(de.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));C(N)}},[s.current,g]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:s}))}},"815F":function(ft,Xe,G){"use strict";G.d(Xe,"e",function(){return K}),G.d(Xe,"c",function(){return L}),G.d(Xe,"d",function(){return P}),G.d(Xe,"a",function(){return p}),G.d(Xe,"f",function(){return _}),G.d(Xe,"b",function(){return h});var de=G("KQm4"),Z=G("VTBJ"),M=G("Ff2n"),V=G("Zm9Q"),I=G("Kwbf"),B=G("OZM5");function K(r,d){return r!=null?r:d}function W(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function l(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(c){var R=c.key,O=c.children;Object(I.a)(R!=null,"Tree node must have a certain key: [".concat(u).concat(R,"]"));var T=String(R);Object(I.a)(!d.has(T)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(T)),d.set(T,!0),l(O,"".concat(u).concat(T," > "))})}l(r)}function L(r){function d(l){var a=Object(V.a)(l);return a.map(function(u){if(!Object(B.i)(u))return Object(I.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var c=u.key,R=u.props,O=R.children,T=Object(M.a)(R,["children"]),A=Object(Z.a)({key:c},T),w=d(O);return w.length&&(A.children=w),A}).filter(function(u){return u})}return d(r)}function P(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(d===!0?[]:d),a=[];function u(c){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(O,T){var A=Object(B.h)(R?R.pos:"0",T),w=K(O.key,A),m=Object(Z.a)(Object(Z.a)({},O),{},{parent:R,pos:A,children:null,data:O,isStart:[].concat(Object(de.a)(R?R.isStart:[]),[T===0]),isEnd:[].concat(Object(de.a)(R?R.isEnd:[]),[T===c.length-1])});return a.push(m),d===!0||l.has(w)?m.children=u(O.children||[],m):m.children=[],m})}return u(r),a}function b(r,d,l){var a;l?typeof l=="string"?a=function(R){return R[l]}:typeof l=="function"&&(a=function(R){return l(R)}):a=function(R,O){return K(R.key,O)};function u(c,R,O){var T=c?c.children:r,A=c?Object(B.h)(O.pos,R):"0";if(c){var w=a(c,A),m={node:c,index:R,pos:A,key:w,parentPos:O.node?O.pos:null,level:O.level+1};d(m)}T&&T.forEach(function(v,s){u(v,s,{node:c,pos:A,level:O?O.level+1:-1})})}u(null)}function p(r){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=d.initWrapper,a=d.processEntity,u=d.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,R={},O={},T={posEntities:R,keyEntities:O};return l&&(T=l(T)||T),b(r,function(A){var w=A.node,m=A.index,v=A.pos,s=A.key,o=A.parentPos,E=A.level,g={node:w,index:m,key:s,pos:v,level:E},C=K(s,v);R[v]=g,O[C]=g,g.parent=R[o],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),a&&a(g,T)},c),u&&u(T),T}function _(r,d){var l=d.expandedKeys,a=d.selectedKeys,u=d.loadedKeys,c=d.loadingKeys,R=d.checkedKeys,O=d.halfCheckedKeys,T=d.dragOverNodeKey,A=d.dropPosition,w=d.keyEntities,m=w[r],v={eventKey:r,expanded:l.indexOf(r)!==-1,selected:a.indexOf(r)!==-1,loaded:u.indexOf(r)!==-1,loading:c.indexOf(r)!==-1,checked:R.indexOf(r)!==-1,halfChecked:O.indexOf(r)!==-1,pos:String(m?m.pos:""),dragOver:T===r&&A===0,dragOverGapTop:T===r&&A===-1,dragOverGapBottom:T===r&&A===1};return v}function h(r){var d=r.data,l=r.expanded,a=r.selected,u=r.checked,c=r.loaded,R=r.loading,O=r.halfChecked,T=r.dragOver,A=r.dragOverGapTop,w=r.dragOverGapBottom,m=r.pos,v=r.active,s=Object(Z.a)(Object(Z.a)({},d),{},{expanded:l,selected:a,checked:u,loaded:c,loading:R,halfChecked:O,dragOver:T,dragOverGapTop:A,dragOverGapBottom:w,pos:m,active:v});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`."),r}}),s}},"8EBN":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";de.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 Z=0;Z<de.modeInfo.length;Z++){var M=de.modeInfo[Z];M.mimes&&(M.mime=M.mimes[0])}de.findModeByMIME=function(V){V=V.toLowerCase();for(var I=0;I<de.modeInfo.length;I++){var B=de.modeInfo[I];if(B.mime==V)return B;if(B.mimes){for(var K=0;K<B.mimes.length;K++)if(B.mimes[K]==V)return B}}if(/\+xml$/.test(V))return de.findModeByMIME("application/xml");if(/\+json$/.test(V))return de.findModeByMIME("application/json")},de.findModeByExtension=function(V){V=V.toLowerCase();for(var I=0;I<de.modeInfo.length;I++){var B=de.modeInfo[I];if(B.ext){for(var K=0;K<B.ext.length;K++)if(B.ext[K]==V)return B}}},de.findModeByFileName=function(V){for(var I=0;I<de.modeInfo.length;I++){var B=de.modeInfo[I];if(B.file&&B.file.test(V))return B}var K=V.lastIndexOf("."),W=K>-1&&V.substring(K+1,V.length);if(W)return de.findModeByExtension(W)},de.findModeByName=function(V){V=V.toLowerCase();for(var I=0;I<de.modeInfo.length;I++){var B=de.modeInfo[I];if(B.name.toLowerCase()==V)return B;if(B.alias){for(var K=0;K<B.alias.length;K++)if(B.alias[K].toLowerCase()==V)return B}}}})},"8hTe":function(ft,Xe,G){ft.exports={button:"button___1wy9m"}},"9Bee":function(ft,Xe,G){"use strict";var de=G("DYRE"),Z=G("zeV3"),M=G("+L6B"),V=G("2/Rp"),I=G("k1fw"),B=G("9og8"),K=G("tJVT"),W=G("WmNS"),L=G.n(W),P=G("q1tI"),b=G.n(P),p=G("vg9a"),_=G("DlQD"),h=G.n(_),r=G("rUJ1");function d($,S){var D=$.match(/^(\s+)(?:```)/);if(D===null)return S;var z=D[1];return S.split(`
`).map(function(te){var Y=te.match(/^\s+/);if(Y===null)return te;var Le=Object(K.a)(Y,1),ct=Le[0];return ct.length>=z.length?te.slice(z.length):te}).join(`
`)}var l=[],a=["<ul>"],u=new h.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){l.length=0,a=["<ul>"]}var O={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T($,S,D,z){if(S>=$.length||$[S].level<=D)return S;var te=$[S];z.push("<li><a href='#"+te.anchor+"'>"+te.text+"</a>"),S++;var Y=[];return S=T($,S,te.level,Y),Y.length>0&&(z.push("<ul>"),Y.forEach(function(Le){z.push(Le)}),z.push("</ul>")),z.push("</li>"),S=T($,S,D,z),S}function A(){return T(l,0,0,a),a.push("</ul>"),a.join("")}var w={heading:function(S){var D=c.exec(S);if(D)return{type:"heading",raw:D[0],depth:D[1].length,text:D[2]}},fences:function(S){var D=this.rules.block.fences.exec(S);if(D){var z=D[0],te=d(z,D[3]||""),Y=D[2]?D[2].trim():D[2];if(["latex","katex","math"].indexOf(Y)>=0){var Le=s(),ct=te;te=Le,o[Le]={type:"block",expression:ct}}return{type:"code",raw:z,lang:Y,text:te}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,s=function(){return"__special_katext_id_".concat(v++,"__")},o={};function E(){return o}function g(){v=0,o={}}function C($){return $=$.replace(m,function(S,D){var z=s();return o[z]={type:"inline",expression:D},z}),$}var N=u.listitem;u.listitem=function($){return N(C($))};var U=u.paragraph;u.paragraph=function($){return U(C($))};var j=u.tablecell;u.tablecell=function($,S){return j(C($),S)},u.code=function($,S,D){var z=(S||"").match(/\S*/)[0];return z?["latex","katex","math"].indexOf(z)>=0?"<p class='editormd-tex'>".concat($,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(S,'">').concat(D?$:Object(r.escape)($,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(D?$:Object(r.escape)($,!0))+"</code></pre>"},u.heading=function($,S,D){var z=this.options.headerPrefix+D.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:z,level:S,text:$}),"<h"+S+' id="'+z+'">'+$+"</h"+S+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:w,renderer:u});var H=h.a,y=G("SJMd"),x=G("ulZh"),F=G.n(x),Q=G("m3rI"),q=G("Oy/b"),ie=G("p5ED"),ge=G("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var fe=function($,S){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,z){D.__proto__=z}||function(D,z){for(var te in z)Object.prototype.hasOwnProperty.call(z,te)&&(D[te]=z[te])})($,S)};function ue($,S){function D(){this.constructor=$}fe($,S),$.prototype=S===null?Object.create(S):(D.prototype=S.prototype,new D)}function he($,S,D,z){return new(D||(D=Promise))(function(te,Y){function Le(rn){try{Pt(z.next(rn))}catch(ht){Y(ht)}}function ct(rn){try{Pt(z.throw(rn))}catch(ht){Y(ht)}}function Pt(rn){var ht;rn.done?te(rn.value):(ht=rn.value,ht instanceof D?ht:new D(function(Vt){Vt(ht)})).then(Le,ct)}Pt((z=z.apply($,S||[])).next())})}function _e($,S){var D,z,te,Y,Le={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return Y={next:ct(0),throw:ct(1),return:ct(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function ct(Pt){return function(rn){return function(ht){if(D)throw new TypeError("Generator is already executing.");for(;Le;)try{if(D=1,z&&(te=2&ht[0]?z.return:ht[0]?z.throw||((te=z.return)&&te.call(z),0):z.next)&&!(te=te.call(z,ht[1])).done)return te;switch(z=0,te&&(ht=[2&ht[0],te.value]),ht[0]){case 0:case 1:te=ht;break;case 4:return Le.label++,{value:ht[1],done:!1};case 5:Le.label++,z=ht[1],ht=[0];continue;case 7:ht=Le.ops.pop(),Le.trys.pop();continue;default:if(!(te=Le.trys,(te=te.length>0&&te[te.length-1])||ht[0]!==6&&ht[0]!==2)){Le=0;continue}if(ht[0]===3&&(!te||ht[1]>te[0]&&ht[1]<te[3])){Le.label=ht[1];break}if(ht[0]===6&&Le.label<te[1]){Le.label=te[1],te=ht;break}if(te&&Le.label<te[2]){Le.label=te[2],Le.ops.push(ht);break}te[2]&&Le.ops.pop(),Le.trys.pop();continue}ht=S.call($,Le)}catch(Vt){ht=[6,Vt],z=0}finally{D=te=0}if(5&ht[0])throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}([Pt,rn])}}}function le(){for(var $=0,S=0,D=arguments.length;S<D;S++)$+=arguments[S].length;var z=Array($),te=0;for(S=0;S<D;S++)for(var Y=arguments[S],Le=0,ct=Y.length;Le<ct;Le++,te++)z[te]=Y[Le];return z}var ne=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(S,D){for(var z=0,te=D;z<te.length;z++){var Y=te[z],Le=Y[0],ct=Y[1];S.setAttribute(Le,ct)}},$.createRect=function(S,D,z){var te=document.createElementNS("http://www.w3.org/2000/svg","rect");return te.setAttribute("width",S.toString()),te.setAttribute("height",D.toString()),z&&$.setAttributes(te,z),te},$.createLine=function(S,D,z,te,Y){var Le=document.createElementNS("http://www.w3.org/2000/svg","line");return Le.setAttribute("x1",S.toString()),Le.setAttribute("y1",D.toString()),Le.setAttribute("x2",z.toString()),Le.setAttribute("y2",te.toString()),Y&&$.setAttributes(Le,Y),Le},$.createPolygon=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",S),D&&$.setAttributes(z,D),z},$.createCircle=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(S/2).toString()),z.setAttribute("cy",(S/2).toString()),z.setAttribute("r",S.toString()),D&&$.setAttributes(z,D),z},$.createEllipse=function(S,D,z){var te=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return te.setAttribute("cx",(S/2).toString()),te.setAttribute("cy",(D/2).toString()),te.setAttribute("rx",(S/2).toString()),te.setAttribute("ry",(D/2).toString()),z&&$.setAttributes(te,z),te},$.createGroup=function(S){var D=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&$.setAttributes(D,S),D},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(S,D,z,te,Y,Le,ct){var Pt=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(Pt,[["id",S],["orient",D],["markerWidth",z.toString()],["markerHeight",te.toString()],["refX",Y.toString()],["refY",Le.toString()]]),Pt.appendChild(ct),Pt},$.createText=function(S){var D=document.createElementNS("http://www.w3.org/2000/svg","text");return D.setAttribute("x","0"),D.setAttribute("y","0"),S&&$.setAttributes(D,S),D},$.createTSpan=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=S,D&&$.setAttributes(z,D),z},$.createImage=function(S){var D=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&$.setAttributes(D,S),D},$.createPoint=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=S,z.y=D,z},$.createPath=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",S),D&&$.setAttributes(z,D),z},$}(),Te=function(){function $(){}return $.addKey=function(S){$.key=S},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),Fe=function(){function $(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return $.prototype.rasterize=function(S,D,z){var te=this;return new Promise(function(Y){var Le=z!==void 0?z:document.createElement("canvas");S===null&&(te.markersOnly=!0,te.naturalSize=!1);var ct=document.createElementNS("http://www.w3.org/2000/svg","svg");ct.setAttribute("xmlns","http://www.w3.org/2000/svg"),ct.setAttribute("width",D.width.baseVal.valueAsString),ct.setAttribute("height",D.height.baseVal.valueAsString),ct.setAttribute("viewBox","0 0 "+D.viewBox.baseVal.width.toString()+" "+D.viewBox.baseVal.height.toString()),ct.innerHTML=D.innerHTML,te.naturalSize===!0?(ct.width.baseVal.value=S.naturalWidth,ct.height.baseVal.value=S.naturalHeight):te.width!==void 0&&te.height!==void 0&&(ct.width.baseVal.value=te.width,ct.height.baseVal.value=te.height),Le.width=ct.width.baseVal.value,Le.height=ct.height.baseVal.value;var Pt=ct.outerHTML,rn=Le.getContext("2d");te.markersOnly!==!0&&rn.drawImage(S,0,0,Le.width,Le.height);var ht=window.URL,Vt=new Image(Le.width,Le.height);Vt.setAttribute("crossOrigin","anonymous");var hi=new Blob([Pt],{type:"image/svg+xml"}),Li=ht.createObjectURL(hi);Vt.onload=function(){rn.drawImage(Vt,0,0),ht.revokeObjectURL(Li);var Zt=Le.toDataURL(te.imageType,te.imageQuality);Y(Zt)},Vt.src=Li})},$}(),Ke=function(){},Ue=function(){function $(S){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},$.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new He("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new He("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ne("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ne("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},$.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),He=function($,S){this.selector=$,this.style=S},Ne=function($,S){this.localName=$,this.style=S},Be=function(){function $(S,D,z,te,Y){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=S,this.displayMode=D,this.markerItems=z,this.uiStyleSettings=te,this.styles=Y,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return $.prototype.show=function(S){var D=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Y){var Le=document.createElement("div");Le.className=""+D.toolbarButtonStyleClass.name,Le.setAttribute("data-type-name",Y.typeName),Le.innerHTML=Y.icon,Le.addEventListener("click",function(){D.markerToolbarButtonClicked(Le,Y)}),D.buttons.push(Le),D.markerButtons.push(Le)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var te=document.createElement("div");te.className=this.toolbarBlockStyleClass.name,te.style.whiteSpace="nowrap",te.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(te),this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(te,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},$.prototype.addButtonClickListener=function(S){this.buttonClickListeners.push(S)},$.prototype.removeButtonClickListener=function(S){this.buttonClickListeners.indexOf(S)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(S),1)},$.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},$.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var S=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var D=0;D<this.markerButtons.length;D++)D<S||D===S&&this.markerButtons.length-1===S?this.markerButtonBlock.appendChild(this.markerButtons[D]):(D===S&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[D]))}},$.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},$.prototype.resetButtonStyles=function(){var S=this;this.buttons.forEach(function(D){D.className=D.className.replace(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name,"").trim(),D.className=D.className.replace(S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:S.toolbarActiveButtonStyleColorsClass.name,"").trim(),D.className+=" "+(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name)})},$.prototype.addActionButton=function(S,D,z){var te=this,Y=document.createElement("div");switch(Y.className=""+this.toolbarButtonStyleClass.name,Y.innerHTML=D,Y.setAttribute("data-action",z),Y.addEventListener("click",function(){te.actionToolbarButtonClicked(Y,z)}),z){case"select":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Y.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Y.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Y.style.fill=this.uiStyleSettings.closeButtonColor}S.appendChild(Y),this.buttons.push(Y)},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ne("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ne("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ne("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ne("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Ne("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var S=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ne("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
padding: `+S+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ne("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ne("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new He("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},$.prototype.markerToolbarButtonClicked=function(S,D){this.setActiveButton(S),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",D)}),this.markerButtonOverflowBlock.style.display="none"},$.prototype.actionToolbarButtonClicked=function(S,D){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",D)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},$.prototype.setActiveButton=function(S){this.resetButtonStyles(),S.className=S.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),S.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},$.prototype.setActiveMarkerButton=function(S){var D=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===S});D&&this.setActiveButton(D)},$.prototype.setCurrentMarker=function(S){var D=this;this.currentMarker=S,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){D.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},$}(),Je=function(){function $(S,D,z,te){this.panels=[],this.panelButtons=[],this.markerjsContainer=S,this.displayMode=D,this.uiStyleSettings=z,this.styles=te,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return $.prototype.addStyles=function(){var S;this.toolboxStyleClass=this.styles.addClass(new Ne("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Ne("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var D=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ne("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ne("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ne("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Ne("toolbox-panel-row_colors",`
background-color: `+((S=this.uiStyleSettings.toolboxBackgroundColor)!==null&&S!==void 0?S:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ne("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
padding: `+D+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ne("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ne("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},$.prototype.show=function(S){var D;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolboxStyleClass.name+" "+((D=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},$.prototype.setPanelButtons=function(S){var D,z,te=this;this.panels=S,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Y){var Le;Y.uiStyleSettings=te.uiStyleSettings;var ct=document.createElement("div");ct.className=te.toolboxButtonStyleClass.name+" "+((Le=te.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Le!==void 0?Le:te.toolboxButtonStyleColorsClass.name),ct.innerHTML=Y.icon,ct.title=Y.title,ct.addEventListener("click",function(){te.panelButtonClick(Y)}),te.panelButtons.push(ct),te.buttonRow.appendChild(ct)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},$.prototype.panelButtonClick=function(S){var D=this,z=-1;if(S!==this.activePanel){z=this.panels.indexOf(S),this.panelRow.innerHTML="";var te=S.getUi();te.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(te),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=S}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){D.displayMode==="inline"?D.panelRow.style.display="none":D.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Y,Le){var ct,Pt;Y.className=D.toolboxButtonStyleClass.name+" "+(Le===z?""+((ct=D.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ct!==void 0?ct:D.toolboxActiveButtonStyleColorsClass.name):""+((Pt=D.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pt!==void 0?Pt:D.toolboxButtonStyleColorsClass.name))})},$}(),tt=function($,S){this.title=$,this.icon=S},it=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Le.colors=[],Le.addTransparent=!1,Le.colorBoxes=[],Le.colors=z,Le.currentColor=te,Le.setCurrentColor=Le.setCurrentColor.bind(Le),Le.getColorBox=Le.getColorBox.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(te){var Y=D.getColorBox(te);z.appendChild(Y),D.colorBoxes.push(Y)}),z},S.prototype.getColorBox=function(D){var z=this,te=this.uiStyleSettings.toolbarHeight/4,Y=this.uiStyleSettings.toolbarHeight-te,Le=document.createElement("div");Le.style.display="inline-block",Le.style.boxSizing="content-box",Le.style.width=Y-2+"px",Le.style.height=Y-2+"px",Le.style.padding="1px",Le.style.marginRight="2px",Le.style.marginBottom="2px",Le.style.borderWidth="2px",Le.style.borderStyle="solid",Le.style.borderRadius=(Y+2)/2+"px",Le.style.borderColor=D===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Le.addEventListener("click",function(){z.setCurrentColor(D,Le)});var ct=document.createElement("div");return ct.style.display="inline-block",ct.style.width=Y-2+"px",ct.style.height=Y-2+"px",ct.style.backgroundColor=D,ct.style.borderRadius=Y/2+"px",D==="transparent"&&(ct.style.fill=this.uiStyleSettings.toolboxAccentColor,ct.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Le.appendChild(ct),Le},S.prototype.setCurrentColor=function(D,z){var te=this;this.currentColor=D,this.colorBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(D)},S}(tt),rt=function(){function $(S,D,z){this._state="new",this._isSelected=!1,this._container=S,this._overlayContainer=D,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty($.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),$.prototype.ownsTarget=function(S){return!1},Object.defineProperty($.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),$.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},$.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},$.prototype.pointerDown=function(S,D){},$.prototype.dblClick=function(S,D){},$.prototype.manipulate=function(S){},$.prototype.pointerUp=function(S){this.stateChanged()},$.prototype.dispose=function(){},$.prototype.addMarkerVisualToContainer=function(S){this.container.childNodes.length>0?this.container.insertBefore(S,this.container.childNodes[0]):this.container.appendChild(S)},$.prototype.getState=function(){return{typeName:$.typeName,state:this.state,notes:this.notes}},$.prototype.restoreState=function(S){this._state=S.state,this.notes=S.notes},$.prototype.scale=function(S,D){},$.prototype.colorChanged=function(S){this.onColorChanged&&this.onColorChanged(S),this.stateChanged()},$.prototype.fillColorChanged=function(S){this.onFillColorChanged&&this.onFillColorChanged(S),this.stateChanged()},$.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var S=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),S.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(S)&&this.onStateChanged(this)}},$.typeName="MarkerBase",$}(),qe=function(){function $(){this.findGripByVisual=this.findGripByVisual.bind(this)}return $.prototype.findGripByVisual=function(S){return this.topLeft.ownsTarget(S)?this.topLeft:this.topCenter.ownsTarget(S)?this.topCenter:this.topRight.ownsTarget(S)?this.topRight:this.centerLeft.ownsTarget(S)?this.centerLeft:this.centerRight.ownsTarget(S)?this.centerRight:this.bottomLeft.ownsTarget(S)?this.bottomLeft:this.bottomCenter.ownsTarget(S)?this.bottomCenter:this.bottomRight.ownsTarget(S)?this.bottomRight:void 0},$}(),gt=function(){function $(){this.GRIP_SIZE=10,this.visual=ne.createGroup(),this.visual.appendChild(ne.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ne.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},$}(),pt=function(){function $(){}return $.toITransformMatrix=function(S){return{a:S.a,b:S.b,c:S.c,d:S.d,e:S.e,f:S.f}},$.toSVGMatrix=function(S,D){return S.a=D.a,S.b=D.b,S.c=D.c,S.d=D.d,S.e=D.e,S.f=D.f,S},$}(),vt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.left=0,Y.top=0,Y.width=0,Y.height=0,Y.defaultSize={x:50,y:20},Y.offsetX=0,Y.offsetY=0,Y.rotationAngle=0,Y.CB_DISTANCE=10,Y._suppressMarkerCreateEvent=!1,Y.container.transform.baseVal.appendItem(ne.createTransform()),Y.setupControlBox(),Y}return ue(S,$),Object.defineProperty(S.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"visual",{get:function(){return this._visual},set:function(D){this._visual=D;var z=ne.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!!(this.controlGrips.findGripByVisual(D)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D))},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="new"&&(this.left=D.x,this.top=D.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var te=this.unrotatePoint(D);if(this.manipulationStartX=te.x,this.manipulationStartY=te.y,this.offsetX=te.x-this.left,this.offsetY=te.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var Y=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Y.x-this.width/2,this.top=Y.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Le=this.container.transform.baseVal.getItem(0);Le.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Le,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},S.prototype.pointerUp=function(D){var z=this.state;$.prototype.pointerUp.call(this,D),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(D),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},S.prototype.moveVisual=function(D){this.visual.style.transform="translate("+D.x+"px, "+D.y+"px)"},S.prototype.manipulate=function(D){var z=this.unrotatePoint(D);this.state==="creating"?this.resize(D):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(D)},S.prototype.resize=function(D){var z=this.manipulationStartLeft,te=this.manipulationStartWidth,Y=this.manipulationStartTop,Le=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+D.x-this.manipulationStartX,te=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:te=this.manipulationStartWidth+D.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Y=this.manipulationStartTop+D.y-this.manipulationStartY,Le=this.manipulationStartHeight+this.manipulationStartTop-Y;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Le=this.manipulationStartHeight+D.y-this.manipulationStartY}te>=0?(this.left=z,this.width=te):(this.left=z+te,this.width=-te),Le>=0?(this.top=Y,this.height=Le):(this.top=Y+Le,this.height=-Le),this.setSize()},S.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},S.prototype.rotate=function(D){if(Math.abs(D.x-this.centerX)>.1){var z=Math.sign(D.x-this.centerX);this.rotationAngle=180*Math.atan((D.y-this.centerY)/(D.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},S.prototype.applyRotation=function(){var D=this.container.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(D,0)},S.prototype.rotatePoint=function(D){if(this.rotationAngle===0)return D;var z=this.container.getCTM(),te=ne.createPoint(D.x,D.y);return{x:(te=te.matrixTransform(z)).x,y:te.y}},S.prototype.unrotatePoint=function(D){if(this.rotationAngle===0)return D;var z=this.container.getCTM();z=z.inverse();var te=ne.createPoint(D.x,D.y);return{x:(te=te.matrixTransform(z)).x,y:te.y}},S.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=ne.createGroup();var D=ne.createTransform();D.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(D),this.container.appendChild(this.controlBox),this.controlRect=ne.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ne.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new qe,this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){var D=this.controlBox.transform.baseVal.getItem(0);D.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(D,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},S.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},S.prototype.createGrip=function(){var D=new gt;return D.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(D.visual),D},S.prototype.positionGrips=function(){var D=this.controlGrips.topLeft.GRIP_SIZE,z=-D/2,te=z,Y=(this.width+this.CB_DISTANCE)/2-D/2,Le=(this.height+this.CB_DISTANCE)/2-D/2,ct=this.height+this.CB_DISTANCE-D/2,Pt=this.width+this.CB_DISTANCE-D/2;this.positionGrip(this.controlGrips.topLeft.visual,z,te),this.positionGrip(this.controlGrips.topCenter.visual,Y,te),this.positionGrip(this.controlGrips.topRight.visual,Pt,te),this.positionGrip(this.controlGrips.centerLeft.visual,z,Le),this.positionGrip(this.controlGrips.centerRight.visual,Pt,Le),this.positionGrip(this.controlGrips.bottomLeft.visual,z,ct),this.positionGrip(this.controlGrips.bottomCenter.visual,Y,ct),this.positionGrip(this.controlGrips.bottomRight.visual,Pt,ct),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Y,te-3*this.CB_DISTANCE)},S.prototype.positionGrip=function(D,z,te){var Y=D.transform.baseVal.getItem(0);Y.setTranslate(z,te),D.transform.baseVal.replaceItem(Y,0)},S.prototype.hideControlBox=function(){this.controlBox.style.display="none"},S.prototype.showControlBox=function(){this.controlBox.style.display=""},S.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},$.prototype.getState.call(this))},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z);var te=this.rotatePoint({x:this.left,y:this.top}),Y=this.unrotatePoint({x:te.x*D,y:te.y*z});this.left=Y.x,this.top=Y.y,this.width=this.width*D,this.height=this.height*z,this.adjustControlBox()},S}(rt),at=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual)},S.prototype.createVisual=function(){this.visual=ne.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},S.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D)},S.prototype.resize=function(D){$.prototype.resize.call(this,D),this.setSize()},S.prototype.setSize=function(){$.prototype.setSize.call(this),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(D){$.prototype.pointerUp.call(this,D),this.setSize()},S.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ne.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},S.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ne.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},S.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ne.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ne.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this))},S.prototype.restoreState=function(D){var z=D;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.setSize()},S.title="Rectangle marker",S}(vt),Rt=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Le.widths=[],Le.widthBoxes=[],Le.widths=z,Le.currentWidth=te,Le.setCurrentWidth=Le.setCurrentWidth.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(te){var Y=document.createElement("div");Y.style.display="flex",Y.style.flexGrow="2",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=te===D.currentWidth?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentWidth(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.innerText=te.toString(),Le.style.marginRight="5px",Y.appendChild(Le);var ct=document.createElement("div");ct.style.minHeight="20px",ct.style.flexGrow="2",ct.style.display="flex",ct.style.alignItems="center";var Pt=document.createElement("hr");Pt.style.minWidth="20px",Pt.style.border="0px",Pt.style.borderTop=te+"px solid "+D.uiStyleSettings.toolboxColor,Pt.style.flexGrow="2",ct.appendChild(Pt),Y.appendChild(ct),D.widthBoxes.push(Y)}),z},S.prototype.setCurrentWidth=function(D,z){var te=this;this.currentWidth=D,this.widthBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},S}(tt),xt=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Le.styles=[],Le.styleBoxes=[],Le.styles=z,Le.currentStyle=te,Le.setCurrentStyle=Le.setCurrentStyle.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(te){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/D.styles.length-5+"%",Y.style.borderColor=te===D.currentStyle?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentStyle(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.overflow="hidden";var ct=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+D.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(te!==""?'stroke-dasharray="'+te+'"':"")+` />
</svg>`;Le.innerHTML=ct,Y.appendChild(Le),D.styleBoxes.push(Y)}),z},S.prototype.setCurrentStyle=function(D,z){var te=this;this.currentStyle=D,this.styleBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},S}(tt),Tt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokeColor=te.defaultColor,Y.strokeWidth=te.defaultStrokeWidth,Y.strokeDasharray=te.defaultStrokeDasharray,Y.strokePanel=new it("Line color",te.defaultColorSet,te.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ue(S,$),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="FrameMarker",S.title="Frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',S}(at),Ye=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Mt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.x1=0,Y.y1=0,Y.x2=0,Y.y2=0,Y.defaultLength=50,Y.manipulationStartX=0,Y.manipulationStartY=0,Y.manipulationStartX1=0,Y.manipulationStartY1=0,Y.manipulationStartX2=0,Y.manipulationStartY2=0,Y.setupControlBox(),Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!(!this.grip1.ownsTarget(D)&&!this.grip2.ownsTarget(D))},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.manipulationStartX=D.x,this.manipulationStartY=D.y,this.state==="new"&&(this.x1=D.x,this.y1=D.y,this.x2=D.x,this.y2=D.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},S.prototype.pointerUp=function(D){var z=this.state;$.prototype.pointerUp.call(this,D),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(D),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},S.prototype.adjustVisual=function(){},S.prototype.manipulate=function(D){this.state==="creating"?this.resize(D):this.state==="move"?(this.x1=this.manipulationStartX1+D.x-this.manipulationStartX,this.y1=this.manipulationStartY1+D.y-this.manipulationStartY,this.x2=this.manipulationStartX2+D.x-this.manipulationStartX,this.y2=this.manipulationStartY2+D.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(D)},S.prototype.resize=function(D){switch(this.activeGrip){case this.grip1:this.x1=D.x,this.y1=D.y;break;case this.grip2:case void 0:this.x2=D.x,this.y2=D.y}this.adjustVisual(),this.adjustControlBox()},S.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=ne.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){this.positionGrips()},S.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},S.prototype.createGrip=function(){var D=new gt;return D.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(D.visual),D},S.prototype.positionGrips=function(){var D=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-D/2,this.y1-D/2),this.positionGrip(this.grip2.visual,this.x2-D/2,this.y2-D/2)},S.prototype.positionGrip=function(D,z,te){var Y=D.transform.baseVal.getItem(0);Y.setTranslate(z,te),D.transform.baseVal.replaceItem(Y,0)},S.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},$.prototype.getState.call(this))},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.x1=this.x1*D,this.y1=this.y1*z,this.x2=this.x2*D,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},S}(rt),St=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.strokeColor=te.defaultColor,Y.strokeWidth=te.defaultStrokeWidth,Y.strokeDasharray=te.defaultStrokeDasharray,Y.strokePanel=new it("Line color",te.defaultColorSet,te.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorLine&&D!==this.visibleLine)},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorLine=ne.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ne.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},S.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ne.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},S.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},S.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},S.typeName="LineMarker",S.title="Line marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',S}(Mt),ze=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Le.fonts=[],Le.fontBoxes=[],Le.fonts=z,Le.currentFont=te,Le.setCurrentFont=Le.setCurrentFont.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(te){var Y=document.createElement("div");Y.style.display="inline-block",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/D.fonts.length-5+"%",Y.style.borderColor=te===D.currentFont?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentFont(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.style.display="flex",Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.fontFamily=te,Le.style.overflow="hidden";var ct=document.createElement("div");ct.style.whiteSpace="nowrap",ct.style.overflow="hidden",ct.style.textOverflow="ellipsis",ct.innerHTML="The quick brown fox jumps over the lazy dog",Le.appendChild(ct),Y.appendChild(Le),D.fontBoxes.push(Y)}),z},S.prototype.setCurrentFont=function(D,z){var te=this;this.currentFont=D,this.fontBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},S}(tt),ut=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.color="transparent",Y.padding=5,Y.DEFAULT_TEXT="your text here",Y.text=Y.DEFAULT_TEXT,Y.isMoved=!1,Y.color=te.defaultColor,Y.fontFamily=te.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setColor=Y.setColor.bind(Y),Y.setFont=Y.setFont.bind(Y),Y.renderText=Y.renderText.bind(Y),Y.sizeText=Y.sizeText.bind(Y),Y.textEditDivClicked=Y.textEditDivClicked.bind(Y),Y.showTextEditor=Y.showTextEditor.bind(Y),Y.setSize=Y.setSize.bind(Y),Y.positionTextEditor=Y.positionTextEditor.bind(Y),Y.colorPanel=new it("Color",te.defaultColorSet,te.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.fontFamilyPanel=new ze("Font",te.defaultFontFamilies,te.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y}return ue(S,$),S.prototype.ownsTarget=function(D){if($.prototype.ownsTarget.call(this,D)||D===this.visual||D===this.textElement||D===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(te){te===D&&(z=!0)}),z},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.bgRectangle=ne.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ne.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.isMoved=!1,this.pointerDownPoint=D,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},S.prototype.renderText=function(){var D=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(z){D.textElement.appendChild(ne.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},S.prototype.getTextScale=function(){var D=this.textElement.getBBox(),z=1;if(D.width>0&&D.height>0){var te=(1*this.width-this.width*this.padding*2/100)/D.width,Y=(1*this.height-this.height*this.padding*2/100)/D.height;z=Math.min(te,Y)}return z},S.prototype.getTextPosition=function(D){var z=this.textElement.getBBox(),te=0,Y=0;return z.width>0&&z.height>0&&(te=(this.width-z.width*D)/2,Y=this.height/2-z.height*D/2),{x:te,y:Y}},S.prototype.sizeText=function(){var D=this.textElement.getBBox(),z=this.getTextScale(),te=this.getTextPosition(z);te.y-=D.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+te.x+"px, "+te.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(te.x,te.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},S.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(D.x-this.pointerDownPoint.x)>5||Math.abs(D.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(D){$.prototype.resize.call(this,D),this.isMoved=!0,this.setSize(),this.sizeText()},S.prototype.setSize=function(){$.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},S.prototype.pointerUp=function(D){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),$.prototype.pointerUp.call(this,D),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.showTextEditor=function(){var D=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(D.textEditor.style.fontSize);D.textEditor.clientWidth>=Number.parseInt(D.textEditor.style.maxWidth)&&z>.9;)z-=.1,D.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var te=z.clipboardData.getData("text"),Y=window.getSelection();if(!Y.rangeCount)return!1;Y.deleteFromDocument(),Y.getRangeAt(0).insertNode(document.createTextNode(te)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){D.textEditDivClicked(D.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},S.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var D=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),te=this.textElement.getBBox(),Y={x:te.width*D,y:te.height*D};z.x-=Y.x/2,z.y-=Y.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*D,12)+"px",this.textElement.style.display="none"}},S.prototype.textEditDivClicked=function(D){this.text=D.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},S.prototype.select=function(){$.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},S.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),$.prototype.deselect.call(this)},S.prototype.dblClick=function(D,z){$.prototype.dblClick.call(this,D,z),this.showTextEditor()},S.prototype.setColor=function(D){this.textElement&&ne.setAttributes(this.textElement,[["fill",D]]),this.color=D,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(D)},S.prototype.setFont=function(D){this.textElement&&ne.setAttributes(this.textElement,[["font-family",D]]),this.fontFamily=D,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},S.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},S.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){var z=D;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.setSize(),this.sizeText(),this.positionTextEditor()},S.typeName="TextMarker",S.title="Text marker",S.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',S}(vt),be=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.color="transparent",Y.lineWidth=3,Y.drawing=!1,Y.pixelRatio=1,Y.color=te.defaultColor,Y.lineWidth=te.defaultStrokeWidth,Y.pixelRatio=te.freehandPixelRatio,Y.setColor=Y.setColor.bind(Y),Y.addCanvas=Y.addCanvas.bind(Y),Y.finishCreation=Y.finishCreation.bind(Y),Y.setLineWidth=Y.setLineWidth.bind(Y),Y.colorPanel=new it("Color",te.defaultColorSet,te.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.lineWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.lineWidthPanel.onWidthChanged=Y.setLineWidth,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.drawingImage)},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.drawingImage=ne.createImage(),this.visual.appendChild(this.drawingImage);var D=ne.createTransform();this.visual.transform.baseVal.appendItem(D),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(D.x,D.y),this.drawing=!0):$.prototype.pointerDown.call(this,D,z)},S.prototype.manipulate=function(D){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(D.x,D.y),this.canvasContext.stroke()):$.prototype.manipulate.call(this,D)},S.prototype.resize=function(D){$.prototype.resize.call(this,D),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(D){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):$.prototype.pointerUp.call(this,D)},S.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},S.prototype.select=function(){this.state==="creating"&&this.finishCreation(),$.prototype.select.call(this)},S.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),$.prototype.deselect.call(this)},S.prototype.finishCreation=function(){for(var D=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],te=z[0],Y=z[1],Le=z[2],ct=z[3],Pt=!1,rn=0;rn<this.canvasElement.height;rn++)for(var ht=0;ht<this.canvasElement.width;ht++)D.data[rn*this.canvasElement.width*4+4*ht+3]>0&&(Pt=!0,rn<Y&&(Y=rn),ht<te&&(te=ht),rn>ct&&(ct=rn),ht>Le&&(Le=ht));if(Pt){this.left=te/this.pixelRatio,this.top=Y/this.pixelRatio,this.width=(Le-te)/this.pixelRatio,this.height=(ct-Y)/this.pixelRatio;var Vt=document.createElement("canvas");Vt.width=Le-te,Vt.height=ct-Y,Vt.getContext("2d").putImageData(this.canvasContext.getImageData(te,Y,Le-te,ct-Y),0,0),this.drawingImgUrl=Vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},S.prototype.setDrawingImage=function(){ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},S.prototype.setColor=function(D){this.color=D,this.colorChanged(D)},S.prototype.setLineWidth=function(D){this.lineWidth=D},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({drawingImgUrl:this.drawingImgUrl},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){this.createVisual(),$.prototype.restoreState.call(this,D),this.drawingImgUrl=D.drawingImgUrl,this.setDrawingImage()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.setDrawingImage()},S.typeName="FreehandMarker",S.title="Freehand marker",S.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',S}(vt),xe=function($){function S(D,z,te){var Y=$.call(this,D,te||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Y.typeBoxes=[],Y.currentType=z,Y.setCurrentType=Y.setCurrentType.bind(Y),Y}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var te=function(ct){var Pt="both";switch(ct){case 0:Pt="both";break;case 1:Pt="start";break;case 2:Pt="end";break;case 3:Pt="none"}var rn=document.createElement("div");if(rn.style.display="flex",rn.style.flexGrow="2",rn.style.alignItems="center",rn.style.justifyContent="space-between",rn.style.padding="5px",rn.style.borderWidth="2px",rn.style.borderStyle="solid",rn.style.borderColor=Pt===Y.currentType?Y.uiStyleSettings.toolboxAccentColor:"transparent",rn.addEventListener("click",function(){D.setCurrentType(Pt,rn)}),z.appendChild(rn),Pt==="both"||Pt==="start"){var ht=document.createElement("div");ht.style.display="flex",ht.style.alignItems="center",ht.style.minHeight="20px",ht.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ht.style.marginLeft="5px",rn.appendChild(ht)}var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.style.flexGrow="2";var hi=document.createElement("hr");if(hi.style.minWidth="20px",hi.style.border="0px",hi.style.borderTop="3px solid "+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee"),hi.style.flexGrow="2",Vt.appendChild(hi),rn.appendChild(Vt),Pt==="both"||Pt==="end"){var Li=document.createElement("div");Li.style.display="flex",Li.style.alignItems="center",Li.style.minHeight="20px",Li.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Li.style.marginRight="5px",rn.appendChild(Li)}Y.typeBoxes.push(rn)},Y=this,Le=0;Le<4;Le++)te(Le);return z},S.prototype.setCurrentType=function(D,z){var te=this;this.currentType=D,this.typeBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings!==void 0?te.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},S}(tt),pe=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.arrowType="end",Y.arrowBaseHeight=10,Y.arrowBaseWidth=10,Y.getArrowPoints=Y.getArrowPoints.bind(Y),Y.setArrowType=Y.setArrowType.bind(Y),Y.arrowTypePanel=new xe("Arrow type","end"),Y.arrowTypePanel.onArrowTypeChanged=Y.setArrowType,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.arrow1&&D!==this.arrow2)},S.prototype.getArrowPoints=function(D,z){var te=this.arrowBaseWidth+2*this.strokeWidth,Y=this.arrowBaseHeight+2*this.strokeWidth;return D-te/2+","+(z+Y/2)+" "+D+","+(z-Y/2)+" "+(D+te/2)+","+(z+Y/2)},S.prototype.createTips=function(){this.arrow1=ne.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ne.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow2)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ne.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ne.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(D,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var te=this.arrow2.transform.baseVal.getItem(0);te.setRotate(D+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(te,0)}},S.prototype.setArrowType=function(D){this.arrowType=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({arrowType:this.arrowType},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},S.typeName="ArrowMarker",S.title="Arrow marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',S}(St),se=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.fillColor=te.defaultFillColor,Y.strokeWidth=0,Y.fillPanel=new it("Color",te.defaultColorSet,te.defaultFillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y}return ue(S,$),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="CoverMarker",S.title="Cover marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',S}(at),ce=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Le.opacities=[],Le.opacityBoxes=[],Le.opacities=z,Le.currentOpacity=te,Le.setCurrentOpacity=Le.setCurrentOpacity.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(te){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=te===D.currentOpacity?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentOpacity(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.innerText=100*te+"%",Y.appendChild(Le),D.opacityBoxes.push(Y)}),z},S.prototype.setCurrentOpacity=function(D,z){var te=this;this.currentOpacity=D,this.opacityBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},S}(tt),Ee=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.setOpacity=Y.setOpacity.bind(Y),Y.fillColor=te.defaultHighlightColor,Y.strokeWidth=0,Y.opacity=te.defaultHighlightOpacity,Y.fillPanel=new it("Color",te.defaultColorSet,Y.fillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y.opacityPanel=new ce("Opacity",te.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return ue(S,$),S.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ne.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="HighlightMarker",S.title="Highlight marker",S.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',S}(se),Ae='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',De=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.bgColor="transparent",Y.tipPosition={x:0,y:0},Y.tipBase1Position={x:0,y:0},Y.tipBase2Position={x:0,y:0},Y.tipMoving=!1,Y.color=te.defaultStrokeColor,Y.bgColor=te.defaultFillColor,Y.fontFamily=te.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setBgColor=Y.setBgColor.bind(Y),Y.getTipPoints=Y.getTipPoints.bind(Y),Y.positionTip=Y.positionTip.bind(Y),Y.setTipPoints=Y.setTipPoints.bind(Y),Y.colorPanel=new it("Text color",te.defaultColorSet,Y.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),Y.colorPanel.onColorChanged=Y.setColor,Y.bgColorPanel=new it("Fill color",te.defaultColorSet,Y.bgColor,Ae),Y.bgColorPanel.onColorChanged=Y.setBgColor,Y.fontFamilyPanel=new ze("Font",te.defaultFontFamilies,te.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y.tipGrip=new gt,Y.tipGrip.visual.transform.baseVal.appendItem(ne.createTransform()),Y.controlBox.appendChild(Y.tipGrip.visual),Y}return ue(S,$),S.prototype.ownsTarget=function(D){return $.prototype.ownsTarget.call(this,D)||this.tipGrip.ownsTarget(D)||this.tip===D},S.prototype.createTip=function(){ne.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ne.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},S.prototype.pointerDown=function(D,z){this.state==="new"&&$.prototype.pointerDown.call(this,D,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):$.prototype.pointerDown.call(this,D,z)},S.prototype.pointerUp=function(D){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,$.prototype.pointerUp.call(this,D);else{var z=this.state==="creating";$.prototype.pointerUp.call(this,D),this.setTipPoints(z),this.positionTip()}},S.prototype.manipulate=function(D){if(this.tipMoving){var z=this.unrotatePoint(D);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else $.prototype.manipulate.call(this,D)},S.prototype.setBgColor=function(D){this.bgRectangle&&this.tip&&(ne.setAttributes(this.bgRectangle,[["fill",D]]),ne.setAttributes(this.tip,[["fill",D]])),this.bgColor=D,this.fillColorChanged(D)},S.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},S.prototype.setTipPoints=function(D){D===void 0&&(D=!1);var z=Math.min(this.height/2,15),te=this.height/5;D&&(this.tipPosition={x:z+te/2,y:this.height+20});var Y=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(te=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+te,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+te}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(te=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-te,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+te}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Y<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(te=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-te,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-te},this.tipBase2Position={x:this.width,y:this.height-z}):Y<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(te=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+te,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-te})},S.prototype.resize=function(D){$.prototype.resize.call(this,D),this.positionTip()},S.prototype.positionTip=function(){ne.setAttributes(this.tip,[["points",this.getTipPoints()]]);var D=this.tipGrip.visual.transform.baseVal.getItem(0);D.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(D,0)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.select=function(){this.positionTip(),$.prototype.select.call(this)},S.prototype.getState=function(){var D=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){var z=D;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,$.prototype.restoreState.call(this,D),this.createTip(),this.setTipPoints()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.tipPosition={x:this.tipPosition.x*D,y:this.tipPosition.y*z},this.positionTip()},S.typeName="CalloutMarker",S.title="Callout marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',S}(ut),$e=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.strokeColor=te.defaultColor,Y.strokeWidth=te.defaultStrokeWidth,Y.strokeDasharray=te.defaultStrokeDasharray,Y.fillColor=te.defaultFillColor,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.setOpacity=Y.setOpacity.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y.strokePanel=new it("Line color",le(te.defaultColorSet,["transparent"]),te.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.fillPanel=new it("Fill color",le(te.defaultColorSet,["transparent"]),Y.fillColor,Ae),Y.fillPanel.onColorChanged=Y.setFillColor,Y.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y.opacityPanel=new ce("Opacity",te.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual)},S.prototype.createVisual=function(){this.visual=ne.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},S.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D)},S.prototype.resize=function(D){$.prototype.resize.call(this,D),this.setSize()},S.prototype.setSize=function(){$.prototype.setSize.call(this),ne.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},S.prototype.pointerUp=function(D){$.prototype.pointerUp.call(this,D),this.setSize()},S.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ne.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},S.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ne.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(D),this.stateChanged()},S.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ne.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ne.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ne.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){var z=D;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.setSize()},S.typeName="EllipseMarker",S.title="Ellipse marker",S.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',S}(vt),lt=function($){function S(D,z,te){return $.call(this,D,z,te)||this}return ue(S,$),Object.defineProperty(S.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.tip1&&D!==this.tip2)},S.prototype.createTips=function(){this.tip1=ne.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ne.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.tip2)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ne.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(D,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var te=this.tip2.transform.baseVal.getItem(0);te.setRotate(D+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(te,0)}},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D),this.createTips(),this.adjustVisual()},S.typeName="MeasurementMarker",S.title="Measurement marker",S.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',S}(St),Bt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokePanel.colors=te.defaultColorSet,Y.fillColor="transparent",Y}return ue(S,$),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="EllipseFrameMarker",S.title="Ellipse frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',S}($e),tn=function(){function $(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),$.prototype.addUndoStep=function(S){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(S)||(this.undoStack.push(S),JSON.stringify(this.lastRedoStep)!==JSON.stringify(S)&&this.redoStack.splice(0,this.redoStack.length))},$.prototype.replaceLastUndoStep=function(S){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=S)},$.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},$.prototype.undo=function(){if(this.undoStack.length>1){var S=this.undoStack.pop();return S!==void 0&&this.redoStack.push(S),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},$.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},$}(),nn=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.curveX=0,Y.curveY=0,Y.manipulationStartCurveX=0,Y.manipulationStartCurveY=0,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.positionGrips=Y.positionGrips.bind(Y),Y.addControlGrips=Y.addControlGrips.bind(Y),Y.adjustVisual=Y.adjustVisual.bind(Y),Y.setupControlBox=Y.setupControlBox.bind(Y),Y.resize=Y.resize.bind(Y),Y.strokeColor=te.defaultColor,Y.strokeWidth=te.defaultStrokeWidth,Y.strokeDasharray=te.defaultStrokeDasharray,Y.strokePanel=new it("Line color",te.defaultColorSet,te.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorCurve&&D!==this.visibleCurve&&!this.curveGrip.ownsTarget(D))},S.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorCurve=ne.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ne.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=D.x,this.curveY=D.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},S.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ne.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setupControlBox=function(){$.prototype.setupControlBox.call(this),this.curveControlLine1=ne.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ne.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},S.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,$.prototype.addControlGrips.call(this)},S.prototype.positionGrips=function(){$.prototype.positionGrips.call(this);var D=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-D/2,this.curveY-D/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},S.prototype.manipulate=function(D){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+D.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+D.y-this.manipulationStartY),$.prototype.manipulate.call(this,D)},S.prototype.resize=function(D){this.activeGrip===this.curveGrip&&(this.curveX=D.x,this.curveY=D.y),$.prototype.resize.call(this,D),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},S.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},S.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},S.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual()},S.prototype.scale=function(D,z){this.curveX=this.curveX*D,this.curveY=this.curveY*z,$.prototype.scale.call(this,D,z)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},S.typeName="CurveMarker",S.title="Curve marker",S.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',S}(Mt),_n=function(){function $(S,D){D===void 0&&(D=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=S,this.cancelable=D}return Object.defineProperty($.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),$.prototype.preventDefault=function(){this._defaultPrevented=!0},$}(),yn=function($){function S(D,z,te){var Y=$.call(this,D,!1)||this;return Y.dataUrl=z,Y.state=te,Y}return ue(S,$),S}(_n),Gt=function($){function S(D,z,te){te===void 0&&(te=!1);var Y=$.call(this,D,te)||this;return Y.marker=z,Y}return ue(S,$),S}(_n),ii=function(){function $(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return $.prototype.addEventListener=function(S,D){this[S].push(D)},$.prototype.removeEventListener=function(S,D){var z=this[S].indexOf(D);z>-1&&this[S].splice(z,1)},$}(),Dn=function(){function $(S){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ye,this._isOpen=!1,this.undoRedoManager=new tn,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new ii,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=$.instanceCounter++,this.styles=new Ue(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=S,this.targetRoot=document.body,this.width=S.clientWidth,this.height=S.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty($.prototype,"ALL_MARKER_TYPES",{get:function(){return[Tt,be,pe,ut,Bt,$e,Ee,De,lt,se,St,nn]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Tt,be,pe,ut,$e,Ee,De]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Tt,be,pe,ut,Ee]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(S){var D=this;this._availableMarkerTypes.splice(0),S.forEach(function(z){if(typeof z=="string"){var te=D.ALL_MARKER_TYPES.find(function(Y){return Y.typeName===z});te!==void 0&&D._availableMarkerTypes.push(te)}else D._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(S){this._zoomLevel=S,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},$.prototype.show=function(){var S=this;this.styles.styleSheetRoot===void 0&&Ke.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ke.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(D){return D(new _n(S))})},$.prototype.render=function(){return he(this,void 0,void 0,function(){var S;return _e(this,function(D){switch(D.label){case 0:return this.setCurrentMarker(),(S=new Fe).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.markersOnly=this.renderMarkersOnly,S.width=this.renderWidth,S.height=this.renderHeight,[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return D.sent(),[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,D.sent()]}})})},$.prototype.close=function(S){var D=this;if(S===void 0&&(S=!1),this.isOpen){var z=!1;S||this.eventListeners.beforeclose.forEach(function(te){var Y=new _n(D,!0);te(Y),Y.defaultPrevented&&(z=!0)}),z||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(te){return te(new _n(D))}),this.detachEvents(),this._isOpen=!1)}},$.prototype.addMarkersToToolbar=function(){for(var S,D=[],z=0;z<arguments.length;z++)D[z]=arguments[z];(S=this._availableMarkerTypes).push.apply(S,D)},$.prototype.addRenderEventListener=function(S){this.addEventListener("render",function(D){S(D.dataUrl,D.state)})},$.prototype.removeRenderEventListener=function(S){},$.prototype.addCloseEventListener=function(S){this.addEventListener("close",function(){S()})},$.prototype.removeCloseEventListener=function(S){},$.prototype.setupResizeObserver=function(){var S=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return S.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupTargetResize=function(){var S=1*this.target.clientWidth/this.target.clientHeight,D=this.editorCanvas.clientWidth/S>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*S:this.editorCanvas.clientWidth,z=D<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/S;this.resize(D,z)},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.resize=function(S,D){this._isResizing=!0;var z=S/this.imageWidth,te=D/this.imageHeight;this.imageWidth=Math.round(S),this.imageHeight=Math.round(D),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(z,te),this._isResizing=!1},$.prototype.scaleMarkers=function(S,D){var z,te=this;this._currentMarker&&this._currentMarker instanceof ut?this._currentMarker.scale(S,D):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Y){Y!==te._currentMarker&&Y.scale(S,D)}),z!==void 0&&this.setCurrentMarker(z)},$.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},$.prototype.setTopLeft=function(){var S=this.editingTarget.getBoundingClientRect(),D=this.editorCanvas.getBoundingClientRect();this.left=S.left-D.left,this.top=S.top-D.top},$.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},$.prototype.addDefs=function(){for(var S,D=[],z=0;z<arguments.length;z++)D[z]=arguments[z];this.defs=ne.createDefs(),this.addDefsToImage(),(S=this.defs).append.apply(S,D)},$.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},$.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},$.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},$.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},$.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},$.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},$.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},$.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var S=document.createElement("a");S.href="https://markerjs.com/",S.target="_blank",S.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',S.title="Powered by marker.js",S.style.display="grid",S.style.alignItems="center",S.style.justifyItems="center",S.style.padding="3px",S.style.width="20px",S.style.height="20px",this.logoUI.appendChild(S),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},$.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},$.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Be(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},$.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.removeMarker=function(S){this.markerImage.removeChild(S.container),this.markers.indexOf(S)>-1&&this.markers.splice(this.markers.indexOf(S),1),S.dispose()},$.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},$.prototype.toolbarButtonClicked=function(S,D){if(S==="marker"&&D!==void 0)this.createNewMarker(D);else if(S==="action")switch(D){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},$.prototype.deleteSelectedMarker=function(){var S=this;if(this._currentMarker!==void 0){var D=!1;if(this.eventListeners.markerbeforedelete.forEach(function(te){var Y=new Gt(S,S._currentMarker,!0);te(Y),Y.defaultPrevented&&(D=!0)}),!D){var z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(te){return te(new Gt(S,z))})}}},$.prototype.clear=function(){var S=this,D=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Le){var ct=new Gt(S,void 0,!0);Le(ct),ct.defaultPrevented&&(D=!0)}),!D)){this.setCurrentMarker();for(var z=function(Le){var ct=te.markers[Le];te.setCurrentMarker(te.markers[Le]),te._currentMarker.dispose(),te.markerImage.removeChild(te._currentMarker.container),te.markers.splice(te.markers.indexOf(te._currentMarker),1),te.eventListeners.markerdelete.forEach(function(Pt){return Pt(new Gt(S,ct))})},te=this,Y=this.markers.length-1;Y>=0;Y--)z(Y);this.addUndoStep()}},Object.defineProperty($.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),$.prototype.showNotesEditor=function(){var S;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(S=this._currentMarker.notes)!==null&&S!==void 0?S:"",this.overlayContainer.appendChild(this.notesArea))},$.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},$.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},$.prototype.addUndoStep=function(){var S=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var D=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===D.width&&z.height===D.height){var te=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(D),te<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Y){return Y(new _n(S))})}else this.undoRedoManager.replaceLastUndoStep(D),this.eventListeners.statechange.forEach(function(Y){return Y(new _n(S))})}},$.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},$.prototype.undoStep=function(){var S=this,D=this.undoRedoManager.undo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new _n(S))}))},$.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},$.prototype.redoStep=function(){var S=this,D=this.undoRedoManager.redo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new _n(S))}))},$.prototype.stepZoom=function(){var S=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=S<this.zoomSteps.length-1?this.zoomSteps[S+1]:this.zoomSteps[0]},$.prototype.panTo=function(S){this.contentDiv.scrollBy({left:this.prevPanPoint.x-S.x,top:this.prevPanPoint.y-S.y}),this.prevPanPoint=S},$.prototype.startRenderAndClose=function(){return he(this,void 0,void 0,function(){var S,D,z=this;return _e(this,function(te){switch(te.label){case 0:return[4,this.render()];case 1:return S=te.sent(),D=this.getState(),this.eventListeners.render.forEach(function(Y){return Y(new yn(z,S,D))}),this.close(!0),[2]}})})},$.prototype.getState=function(S){S===!0&&this.setCurrentMarker();var D={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return D.markers.push(z.getState())}),D},$.prototype.restoreState=function(S){var D=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);S.markers.forEach(function(z){var te=D._availableMarkerTypes.find(function(Le){return Le.typeName===z.typeName});if(te!==void 0){var Y=D.addNewMarker(te);Y.restoreState(z),D.markers.push(Y)}}),S.width&&S.height&&(S.width!==this.imageWidth||S.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/S.width,this.imageHeight/S.height),this.eventListeners.restorestate.forEach(function(z){return z(new _n(D))})},$.prototype.addNewMarker=function(S){var D=ne.createGroup();return this.markerImage.appendChild(D),new S(D,this.overlayContainer,this.settings)},$.prototype.createNewMarker=function(S){var D,z=this;(D=typeof S=="string"?this._availableMarkerTypes.find(function(te){return te.typeName===S}):S)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(D),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(D.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(te){return te(new Gt(z,z._currentMarker))}))},$.prototype.markerCreated=function(S){var D=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(S),this.setCurrentMarker(S),S instanceof be&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(be):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new Gt(D,D._currentMarker))})},$.prototype.colorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=S,this.settings.defaultStrokeColor=S)},$.prototype.fillColorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=S)},$.prototype.markerStateChanged=function(S){var D=this;this.eventListeners.markerchange.forEach(function(z){return z(new Gt(D,S))})},$.prototype.setCurrentMarker=function(S){var D=this;this._currentMarker!==S&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new Gt(D,D._currentMarker))})),this._currentMarker=S,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(z){return z(new Gt(D,D._currentMarker))}))},$.prototype.onPointerDown=function(S){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||S.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var D=this.markers.find(function(z){return z.ownsTarget(S.target)});D!==void 0?(this.setCurrentMarker(D),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:S.clientX,y:S.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY))},$.prototype.onDblClick=function(S){if(this._isFocused||this.focus(),this.mode==="select"){var D=this.markers.find(function(z){return z.ownsTarget(S.target)});D!==void 0&&D!==this._currentMarker&&this.setCurrentMarker(D),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target):this.setCurrentMarker()}},$.prototype.onPointerMove=function(S){this.touchPoints!==1&&S.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||S.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(S.clientX,S.clientY)):this.zoomLevel>1&&this.panTo({x:S.clientX,y:S.clientY}))},$.prototype.onPointerUp=function(S){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(S.clientX,S.clientY)),this.isDragging=!1,this.addUndoStep()},$.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},$.prototype.onKeyUp=function(S){this._currentMarker===void 0||this.notesArea!==void 0||S.key!=="Delete"&&S.key!=="Backspace"||this.deleteSelectedMarker()},$.prototype.clientToLocalCoordinates=function(S,D){var z=this.markerImage.getBoundingClientRect();return{x:(S-z.left)/this.zoomLevel,y:(D-z.top)/this.zoomLevel}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},$.prototype.addLicenseKey=function(S){Te.addKey(S)},$.prototype.addEventListener=function(S,D){this.eventListeners.addEventListener(S,D)},$.prototype.removeEventListener=function(S,D){this.eventListeners.removeEventListener(S,D)},$.prototype.renderState=function(S){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty($.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),$.prototype.focus=function(){var S=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(D){return D(new _n(S))}))},$.prototype.blur=function(){var S=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(D){return D(new _n(S))}))},$.instanceCounter=0,$}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ci=function($,S){return(Ci=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,z){D.__proto__=z}||function(D,z){for(var te in z)Object.prototype.hasOwnProperty.call(z,te)&&(D[te]=z[te])})($,S)};function fi($,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function D(){this.constructor=$}Ci($,S),$.prototype=S===null?Object.create(S):(D.prototype=S.prototype,new D)}function In($,S,D,z){return new(D||(D=Promise))(function(te,Y){function Le(rn){try{Pt(z.next(rn))}catch(ht){Y(ht)}}function ct(rn){try{Pt(z.throw(rn))}catch(ht){Y(ht)}}function Pt(rn){var ht;rn.done?te(rn.value):(ht=rn.value,ht instanceof D?ht:new D(function(Vt){Vt(ht)})).then(Le,ct)}Pt((z=z.apply($,S||[])).next())})}function Ri($,S){var D,z,te,Y,Le={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return Y={next:ct(0),throw:ct(1),return:ct(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function ct(Pt){return function(rn){return function(ht){if(D)throw new TypeError("Generator is already executing.");for(;Le;)try{if(D=1,z&&(te=2&ht[0]?z.return:ht[0]?z.throw||((te=z.return)&&te.call(z),0):z.next)&&!(te=te.call(z,ht[1])).done)return te;switch(z=0,te&&(ht=[2&ht[0],te.value]),ht[0]){case 0:case 1:te=ht;break;case 4:return Le.label++,{value:ht[1],done:!1};case 5:Le.label++,z=ht[1],ht=[0];continue;case 7:ht=Le.ops.pop(),Le.trys.pop();continue;default:if(!(te=Le.trys,(te=te.length>0&&te[te.length-1])||ht[0]!==6&&ht[0]!==2)){Le=0;continue}if(ht[0]===3&&(!te||ht[1]>te[0]&&ht[1]<te[3])){Le.label=ht[1];break}if(ht[0]===6&&Le.label<te[1]){Le.label=te[1],te=ht;break}if(te&&Le.label<te[2]){Le.label=te[2],Le.ops.push(ht);break}te[2]&&Le.ops.pop(),Le.trys.pop();continue}ht=S.call($,Le)}catch(Vt){ht=[6,Vt],z=0}finally{D=te=0}if(5&ht[0])throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}([Pt,rn])}}}var Si=function(){function $(){}return $.addKey=function(S){$.key=S},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),Ot=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(S,D){for(var z=0,te=D;z<te.length;z++){var Y=te[z],Le=Y[0],ct=Y[1];S.setAttribute(Le,ct)}},$.createRect=function(S,D,z){var te=document.createElementNS("http://www.w3.org/2000/svg","rect");return te.setAttribute("width",S.toString()),te.setAttribute("height",D.toString()),z&&$.setAttributes(te,z),te},$.createLine=function(S,D,z,te,Y){var Le=document.createElementNS("http://www.w3.org/2000/svg","line");return Le.setAttribute("x1",S.toString()),Le.setAttribute("y1",D.toString()),Le.setAttribute("x2",z.toString()),Le.setAttribute("y2",te.toString()),Y&&$.setAttributes(Le,Y),Le},$.createPolygon=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",S),D&&$.setAttributes(z,D),z},$.createCircle=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(S/2).toString()),z.setAttribute("cy",(S/2).toString()),z.setAttribute("r",S.toString()),D&&$.setAttributes(z,D),z},$.createEllipse=function(S,D,z){var te=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return te.setAttribute("cx",(S/2).toString()),te.setAttribute("cy",(D/2).toString()),te.setAttribute("rx",(S/2).toString()),te.setAttribute("ry",(D/2).toString()),z&&$.setAttributes(te,z),te},$.createGroup=function(S){var D=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&$.setAttributes(D,S),D},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(S,D,z,te,Y,Le,ct){var Pt=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(Pt,[["id",S],["orient",D],["markerWidth",z.toString()],["markerHeight",te.toString()],["refX",Y.toString()],["refY",Le.toString()]]),Pt.appendChild(ct),Pt},$.createText=function(S){var D=document.createElementNS("http://www.w3.org/2000/svg","text");return D.setAttribute("x","0"),D.setAttribute("y","0"),S&&$.setAttributes(D,S),D},$.createTSpan=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=S,D&&$.setAttributes(z,D),z},$.createImage=function(S){var D=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&$.setAttributes(D,S),D},$.createPoint=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=S,z.y=D,z},$.createPath=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",S),D&&$.setAttributes(z,D),z},$.createElement=function(S,D){var z=document.createElementNS("http://www.w3.org/2000/svg",S);return D&&$.setAttributes(z,D),z},$.getHollowRectanglePath=function(S,D,z,te,Y,Le,ct,Pt){return"M"+S+","+D+"V"+(D+te)+"H"+(S+z)+"V"+D+"H"+Y+"V"+Le+"H"+(Y+ct)+"V"+(Le+Pt)+"H"+Y+"V"+D+"Z"},$}(),bn=function(){function $(S){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},$.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new Cn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Cn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Cn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new kn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new kn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},$.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),Cn=function($,S){this.selector=$,this.style=S},kn=function($,S){this.localName=$,this.style=S},Ai=function(){function $(){this.blocks=[],this.display=""}return $.prototype.addButtonBlock=function(S){S.className=this.blockClassName,S.buttonClassName=this.buttonClassName,S.buttonColorsClassName=this.buttonColorsClassName,S.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(S)},$.prototype.addElementBlock=function(S){S.className===void 0&&(S.className=this.blockClassName),this.blocks.push(S)},$.prototype.getUI=function(){var S=document.createElement("div");return S.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,S.style.display=this.display,this.blocks.forEach(function(D){return S.appendChild(D.getUI())}),S},$}(),Ui=function(){function $(){}return $.prototype.getUI=function(){var S=document.createElement("div");if(S.className=this.className,this.minWidth!==void 0&&(S.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":S.style.justifyContent="flex-start";break;case"center":S.style.justifyContent="center";break;case"end":S.style.justifyContent="flex-end"}return S.style.whiteSpace="nowrap",S},$}(),dr=function($){function S(){var D=$!==null&&$.apply(this,arguments)||this;return D.buttons=[],D}return fi(S,$),S.prototype.addButton=function(D){D.className=this.buttonClassName,D.colorsClassName=this.buttonColorsClassName,D.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(D)},S.prototype.getUI=function(){var D=$.prototype.getUI.call(this);return this.buttons.forEach(function(z){return D.appendChild(z.getUI())}),D},S}(Ui),mn=function(){function $(S,D){this._isActive=!1,this._isHidden=!1,this._icon=S,this.title=D,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty($.prototype,"icon",{get:function(){return this._icon},set:function(S){this._icon=S,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isActive",{get:function(){return this._isActive},set:function(S){this._isActive=S,this.adjustClassName()},enumerable:!1,configurable:!0}),$.prototype.getUI=function(){var S=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return S.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},$.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},$.prototype.hide=function(){this._isHidden=!0},$}(),Jt=function($){function S(){var D=$!==null&&$.apply(this,arguments)||this;return D.elements=[],D}return fi(S,$),S.prototype.addElement=function(D){this.elements.push(D)},S.prototype.getUI=function(){var D=$.prototype.getUI.call(this);return this.elements.forEach(function(z){return D.appendChild(z)}),D},S}(Ui),qi=function(){function $(S,D){this.horizontal=S,this.vertical=D}return Object.defineProperty($.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),$.prototype.getVerticalLength=function(S){return S/this.ratio},$.prototype.getHorizontalLength=function(S){return S*this.ratio},$}(),hr=function(){function $(){}return $.getIcon=function(S,D){if(S>0&&D>0){var z=new qi(S,D),te=z.ratio>=1?20:z.getHorizontalLength(20),Y=z.ratio<1?20:z.getVerticalLength(20),Le=document.createElementNS("http://www.w3.org/2000/svg","svg");Le.setAttribute("xmlns","http://www.w3.org/2000/svg"),Le.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Le);var ct=Ot.createDefs();Le.appendChild(ct);var Pt=Ot.createElement("clipPath",[["id","text-bg-clip"]]);ct.appendChild(Pt);var rn=Ot.createPath(Ot.getHollowRectanglePath((24-te)/2,(24-Y)/2,te,Y,(24-te)/2+2,(24-Y)/2+2,te-4,Y-4));Le.appendChild(rn);var ht=Ot.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ht.appendChild(Ot.createTSpan(S+":"+D)),Le.appendChild(ht);var Vt=ht.getBBox();Ot.setAttributes(ht,[["x",((24-Vt.width)/2).toString()],["y",((24-Vt.height)/2-Vt.y).toString()]]);var hi=Ot.createPath(Ot.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Vt.width))/2,(24-Math.ceil(Vt.height))/2,Math.ceil(Vt.width),Math.ceil(Vt.height)));return Pt.appendChild(hi),Ot.setAttributes(rn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Le),Le.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},$}(),sr=function($){function S(D,z,te){var Y=$.call(this,D,z)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=te,Y}return fi(S,$),S.prototype.setupDropdown=function(){var D=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(z){z.className=D.className,z.colorsClassName=D.colorsClassName,D.dropdownBlock.appendChild(z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},S.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},S.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},S.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},S.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},S.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},S}(mn),Fn=function(){function $(S,D){this.GRIP_SIZE=10,this.color=S,this.fillColor=D,this.visual=Ot.createGroup(),this.visual.appendChild(Ot.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ot.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},$.prototype.setCenter=function(S,D){this.visual.childNodes.forEach(function(z){return Ot.setAttributes(z,[["cx",S.toString()],["cy",D.toString()]])})},$}(),er=function(){function $(S,D,z,te){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=S,this.canvasHeight=D,this.margin=z,this.container=te,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty($.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(S){this._aspectRatio=S,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.gridContainer&&Ot.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(S){this._zoomFactor=S,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),$.prototype.open=function(){var S=this;this.cropShadeElement=Ot.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ot.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var D=0;D<this.numberOfGridLines;D++)this.horizontalGridLines.push(Ot.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ot.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(z){return S.gridContainer.appendChild(z)}),this.verticalGridLines.forEach(function(z){return S.gridContainer.appendChild(z)}),this.cropRectElement=Ot.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Fn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Fn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Fn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Fn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},$.prototype.setCropRectangle=function(S){this.cropRect=S;var D=Object.assign({},this.cropRect);this.zoomFactor!==1&&(D.width=this.cropRect.width*this.zoomFactor,D.height=this.cropRect.height*this.zoomFactor,D.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-D.width/2,D.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-D.height/2),Ot.setAttributes(this.cropRectElement,[["x",D.x.toString()],["y",D.y.toString()],["width",D.width.toString()],["height",D.height.toString()]]);var z=D.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Le){var ct=D.y+z*(Le+1);Ot.setAttributes(Y,[["x1",""+D.x],["y1",""+ct],["x2",""+(D.x+D.width)],["y2",""+ct]])});var te=D.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Le){var ct=D.x+te*(Le+1);Ot.setAttributes(Y,[["x1",""+ct],["y1",""+D.y],["x2",""+ct],["y2",""+(D.y+D.height)]])}),Ot.setAttributes(this.cropShadeElement,[["d",Ot.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,D.x,D.y,D.width,D.height)]]),this.topLeftGrip.setCenter(D.x,D.y),this.topRightGrip.setCenter(D.x+D.width,D.y),this.bottomLeftGrip.setCenter(D.x,D.y+D.height),this.bottomRightGrip.setCenter(D.x+D.width,D.y+D.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},$.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},$.prototype.clientToLocalCoordinates=function(S,D){var z=this.container.getBoundingClientRect();return{x:S-z.left+this.margin,y:D-z.top+this.margin}},$.prototype.onPointerDown=function(S){this.container.setPointerCapture(S.pointerId),this.previousPoint=this.clientToLocalCoordinates(S.clientX,S.clientY),this.cropRectElement===S.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(S.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(S.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(S.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(S.target)&&(this.activeGrip=this.bottomRightGrip)},$.prototype.onPointerMove=function(S){if(this.isMoving)this.move(this.clientToLocalCoordinates(S.clientX,S.clientY));else if(this.activeGrip){var D=this.clientToLocalCoordinates(S.clientX,S.clientY);this.resize(D)}S.preventDefault()},$.prototype.onPointerUp=function(S){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(S.pointerId)},$.prototype.move=function(S){var D=S.x-this.previousPoint.x,z=S.y-this.previousPoint.y;this.zoomFactor!==1&&(D=-D/this.zoomFactor,z=-z/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+D),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=S},$.prototype.resize=function(S){var D=Object.assign({},this.cropRect),z=S.x-this.previousPoint.x,te=S.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:D.x+z<this.margin&&(z=this.margin-D.x),D.x+=z,D.width=this.cropRect.x+this.cropRect.width-D.x;break;case this.bottomRightGrip:case this.topRightGrip:D.width+z>this.canvasWidth*this.zoomFactor&&(z=this.canvasWidth*this.zoomFactor-D.width),D.width+=z}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(D.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(z),D.height=this.aspectRatio.getVerticalLength(D.width)):(D.y+=te,D.height=this.cropRect.y+this.cropRect.height-D.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?D.height=this.aspectRatio.getVerticalLength(D.width):D.height+=te}D.width<10&&(D.x=this.cropRect.x,D.width=10),D.height<10&&(D.y=this.cropRect.y,D.height=10),this.previousPoint=S,D.x>=this.margin&&D.y>=this.margin&&D.x-this.margin+D.width<=this.canvasWidth&&D.y-this.margin+D.height<=this.canvasHeight&&(this.cropRect=D,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},$.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var S=this.cropRect.x+this.cropRect.width/2,D=this.cropRect.y+this.cropRect.height/2,z=this.aspectRatio.getHorizontalLength(this.cropRect.height),te=this.aspectRatio.getVerticalLength(this.cropRect.width);z/this.canvasWidth<te/this.canvasHeight?this.cropRect.width=z:this.cropRect.height=te,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=S-this.cropRect.width/2,this.cropRect.y=D-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},$.prototype.getRescaledRect=function(S,D,z,te,Y,Le){var ct=z/S,Pt=te/D;return{x:(Y.x-Le)*ct+Le,y:(Y.y-Le)*Pt+Le,width:Y.width*ct,height:Y.height*Pt}},$.prototype.scaleCanvas=function(S,D){var z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,S,D,this.cropRect,this.margin);this.canvasWidth=S,this.canvasHeight=D,this.onCropChange&&this.onCropChange(z),this.setCropRectangle(z)},$}(),kr=function(){function $(S){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=S,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty($.prototype,"angle",{get:function(){return this._angle},set:function(S){this._angle=S,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),$.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},$.prototype.onPointerDown=function(S){this.controlContainer.setPointerCapture(S.pointerId),this.isDragging=!0,this.previousPoint={x:S.clientX,y:S.clientY}},$.prototype.onPointerMove=function(S){this.isDragging&&(this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.previousPoint.x=S.clientX)},$.prototype.onPointerUp=function(S){this.isDragging&&this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(S.pointerId)},$.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var S=this.angleLabelText.getBBox();Ot.setAttributes(this.angleLabelElement,[["x",((this.width-S.width)/2).toString()],["y",(this.height/2).toString()]])}},$.prototype.positionScaleShape=function(){if(this.scaleShape){var S=this.scaleShape.transform.baseVal.getItem(0);S.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(S,0)}},$.prototype.getVisual=function(){var S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("width",this.width+"px"),S.setAttribute("height",this.height+"px"),S.setAttribute("viewBox","0 0 "+this.width+" "+this.height),S.style.flexShrink="0",document.body.appendChild(S);for(var D="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,z=1;z<=this.width/5+10;z++){var te=z%5==0?this.height/3:this.height/6;D+="h4v"+-te+"h1v"+te}D+="v1H0Z",this.scaleShape=Ot.createPath(D);var Y=Ot.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),S.appendChild(this.scaleShape),this.angleLabelElement=Ot.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ot.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Le=Ot.createTSpan("");return Le.innerHTML="&deg;",this.angleLabelElement.appendChild(Le),S.appendChild(this.angleLabelElement),document.body.removeChild(S),S},$}(),Qr=function(){function $(){this.naturalSize=!1,this.imageType="image/png"}return $.prototype.rasterize=function(S,D,z,te,Y,Le,ct){var Pt=this;return new Promise(function(rn){var ht=document.createElement("canvas");ht.width=S.width.baseVal.value-2*te,ht.height=S.height.baseVal.value-2*te;var Vt=1,hi=1;Pt.naturalSize===!0?(Vt=D.naturalWidth/(S.width.baseVal.value-2*te)/Le,hi=D.naturalHeight/(S.height.baseVal.value-2*te)/ct,ht.width=D.naturalWidth/Le,ht.height=D.naturalHeight/ct):Pt.width!==void 0&&Pt.height!==void 0&&(Vt=Pt.width/z.width,hi=Pt.height/z.height,ht.width*=Vt,ht.height*=hi);var Li=ht.getContext("2d");Li.translate(ht.width/2,ht.height/2),Li.rotate(Y*Math.PI/180),Li.scale(Le,ct),Li.translate(-ht.width/2,-ht.height/2),Li.drawImage(D,0,0,ht.width,ht.height);var Zt=document.createElement("canvas");Zt.width=z.width*Vt,Zt.height=z.height*hi,Zt.getContext("2d").putImageData(Li.getImageData((z.x-te)*Vt,(z.y-te)*hi,z.width*Vt,z.height*hi),0,0),rn(Zt.toDataURL(Pt.imageType,Pt.imageQuality))})},$}(),yt=function(){function $(S){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=$.instanceCounter++,this.styles=new bn(this.instanceNo),this.target=S,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(S){this._zoomToCropEnabled=S,S?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"gridLines",{get:function(){return this._gridLines},set:function(S){this._gridLines=S,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(S){this._rotationAngle=S,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"aspectRatio",{get:function(){var S;return(S=this._aspectRatio)!==null&&S!==void 0?S:this.aspectRatios[0]},set:function(S){this._aspectRatio=S},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},$.prototype.show=function(){this.showUI(),this.open()},$.prototype.close=function(S){S===void 0&&(S=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),S||this.closeEventListeners.forEach(function(D){return D()}),this._isOpen=!1)},$.prototype.addRenderEventListener=function(S){this.renderEventListeners.push(S)},$.prototype.removeRenderEventListener=function(S){this.renderEventListeners.indexOf(S)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(S),1)},$.prototype.addCloseEventListener=function(S){this.closeEventListeners.push(S)},$.prototype.removeCloseEventListener=function(S){this.closeEventListeners.indexOf(S)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(S),1)},$.prototype.setupResizeObserver=function(){var S=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var S=1*this.target.clientWidth/this.target.clientHeight,D=this.contentDiv.clientWidth/S>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*S:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,z=D+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/S;this.resize(D,z)}},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Ot.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},$.prototype.resize=function(S,D){this.imageWidth=Math.round(S),this.imageHeight=Math.round(D),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},$.prototype.setEditingTarget=function(){var S=document.createElement("canvas");S.width=this.target.naturalWidth,S.height=this.target.naturalHeight,S.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var D=S.toDataURL();Ot.setAttributes(this.editingTarget,[["href",D]]),this.setEditingTargetSize()},$.prototype.setTopLeft=function(){var S=this.target.getBoundingClientRect(),D=this.editorCanvas.getBoundingClientRect();this.left=S.left-D.left-this.CANVAS_MARGIN,this.top=S.top-D.top-this.CANVAS_MARGIN},$.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Ot.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ot.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ot.createGroup(),this.editingTargetRotationScaleContainer=Ot.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var S=Ot.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(S);var D=Ot.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(D),this.editingTargetContainer=Ot.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},$.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},$.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ot.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new er(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},$.prototype.zoomToCrop=function(){if(this.cropRect){var S=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,D=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=S+"px "+D+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-S+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-D+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},$.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},$.prototype.cropRectChanged=function(S){this.cropRect=S,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},$.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},$.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var S=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,D=this.target.offsetTop>S+this.CANVAS_MARGIN?this.target.offsetTop-(S+this.CANVAS_MARGIN):0;this.coverDiv.style.top=D+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},$.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},$.prototype.addTopToolbar=function(){var S=this;this.topToolbar=new Ai,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var D=new dr;D.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(D);var z=[];this.aspectRatios.forEach(function(hi){var Li=new mn(hr.getIcon(hi.horizontal,hi.vertical),hi.horizontal===0&&hi.vertical===0?"FREE":hi.horizontal+":"+hi.vertical);Li.onClick=function(){return S.ratioButtonClicked(hi)},z.push(Li)}),this.aspectRatioButton=new sr(hr.getIcon(0,0),"Aspect ratio",z),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,D.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var te=new mn('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");te.isActive=this.isGridVisible,te.onClick=function(){S.isGridVisible=!S.isGridVisible,te.isActive=S.isGridVisible},D.addButton(te);var Y=new mn('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){S.zoomToCropEnabled=!S.zoomToCropEnabled,Y.isActive=S.zoomToCropEnabled},D.addButton(Y),!Si.isLicensed){var Le=new Jt;this.topToolbar.addElementBlock(Le);var ct=document.createElement("div");ct.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Pt=document.createElement("a");Pt.style.color="currentColor",Pt.href="https://markerjs.com/products/cropro",Pt.target="_blank",Pt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ct.appendChild(Pt),Le.addElement(ct)}var rn=new dr;rn.minWidth=3*this.toolbarHeight+"px",rn.contentAlign="end",this.topToolbar.addButtonBlock(rn);var ht=new mn('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ht.onClick=this.startRenderAndClose,rn.addButton(ht),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ht.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Vt=new mn('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Vt.onClick=this.close,rn.addButton(Vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},$.prototype.addBottomToolbar=function(){var S=this;this.bottomToolbar=new Ai,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var D=new dr;D.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(D);var z=new mn('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");z.onClick=this.rotateLeftButtonClicked,D.addButton(z);var te=new mn('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");te.onClick=this.rotateRightButtonClicked,D.addButton(te);var Y=new Jt;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new kr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(rn){S.rotateBy(rn),S.straightener.angle=S.rotationAngle},Y.addElement(this.straightener.getUI());var Le=new dr;Le.minWidth=2*this.toolbarHeight+"px",Le.contentAlign="end",this.bottomToolbar.addButtonBlock(Le);var ct=new mn('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ct.onClick=this.flipHorizontallyButtonClicked,Le.addButton(ct);var Pt=new mn('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Pt.onClick=this.flipVerticallyButtonClicked,Le.addButton(Pt)},$.prototype.ratioButtonClicked=function(S){this.aspectRatio=S,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},$.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=hr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},$.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new qi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},$.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},$.prototype.restoreState=function(S){if(S){var D=this.cropLayer.getRescaledRect(S.width,S.height,this.imageWidth,this.imageHeight,S.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(D),this.cropRectChanged(D),this.flippedHorizontally=S.flippedHorizontally,this.flippedVertically=S.flippedVertically,this.applyFlip(),this.rotationAngle=S.rotationAngle,this.applyRotation()}},$.prototype.clientToLocalCoordinates=function(S,D){var z=this.cropImage.getBoundingClientRect();return{x:S-z.left,y:D-z.top}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var S=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},$.prototype.rotateLeftButtonClicked=function(){var S=this.rotationAngle-90;this.rotationAngle%90!=0&&(S+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(S)},$.prototype.rotateRightButtonClicked=function(){var S=this.rotationAngle+90;this.rotationAngle%90!=0&&(S-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(S)},$.prototype.rotateTo=function(S){S=(S=S>180?S-360:S)<=-180?S+360:S,this.rotationAngle=S,this.applyRotation()},$.prototype.rotateBy=function(S){this.rotateTo((this.rotationAngle+S)%360)},$.prototype.applyRotation=function(){var S=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var D=this.editingTargetRotationContainer.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(D,0);var z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/z.width,this.imageHeight/z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=S},$.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},$.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},$.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},$.prototype.startRenderAndClose=function(){return In(this,void 0,void 0,function(){var S,D;return Ri(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return S=z.sent(),D=this.getState(),this.renderEventListeners.forEach(function(te){return te(S,D)}),this.close(!0),[2]}})})},$.prototype.render=function(){return In(this,void 0,void 0,function(){var S;return Ri(this,function(D){switch(D.label){case 0:return(S=new Qr).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.width=this.renderWidth,S.height=this.renderHeight,this.unzoomFromCrop(),Ot.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return D.sent(),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,D.sent()]}})})},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new kn("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new kn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new kn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var S=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new kn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*S)+`px;
height: `+(this.toolbarHeight-2*S)+`px;
padding: `+S+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new kn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new kn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Cn("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Cn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new kn("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new kn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new kn("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new kn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*S)+`px;
padding: `+S+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new kn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},$.instanceCounter=0,$}(),cn=G("8hTe"),Kr=G.n(cn),zr=/<pre[^>]*>/g;function na($){var S=document.createElement("div");return S.innerHTML=$,S.childNodes.length===0?"":S.childNodes[0].nodeValue}var Gr=Xe.a=function($){var S=$.value,D=S===void 0?"":S,z=$.edit,te=z===void 0?!1:z,Y=$.className,Le=$.showTextOnly,ct=$.showLines,Pt=$.replaces,rn=$.zoomImg,ht=$.hasMask,Vt=$.style,hi=Vt===void 0?{}:Vt,Li=$.stylesPrev,Zt=Li===void 0?{}:Li,dt=String(D),kt=Object(P.useRef)(),Lt=Object(P.useRef)(),Kt=Object(P.useState)(""),sn=Object(K.a)(Kt,2),En=sn[0],wn=sn[1],hn=Object(P.useState)("office"),Ln=Object(K.a)(hn,2),zn=Ln[0],un=Ln[1],Sn=function(){var jt=new yt(Lt.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var pn=Object(B.a)(L.a.mark(function Ct(Nt){var Dt;return L.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return kt.current.style.display="none",Yt.next=3,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Nt}});case 3:Dt=Yt.sent,Dt!=null&&Dt.id&&Pt(Lt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 5:case"end":return Yt.stop()}},Ct)}));return function(Ct){return pn.apply(this,arguments)}}()),jt.show()},di=function(){var jt=new Dn(Lt.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var pn=Object(B.a)(L.a.mark(function Ct(Nt){var Dt;return L.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(kt.current.style.display="none",!Lt.current){Yt.next=6;break}return Yt.next=4,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Nt.dataUrl}});case 4:Dt=Yt.sent,Dt!=null&&Dt.id&&Pt(Lt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 6:case"end":return Yt.stop()}},Ct)}));return function(Ct){return pn.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},Nn=Object(P.useMemo)(function(){kt.current&&(kt.current.style.zIndex=-1);try{var Xt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;dt=dt.replace(Xt,"("+Q.a.API_SERVER+"/api/attachments/").replace(jt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(pn,'"'+Q.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(Pe){}var Ct=H(dt),Nt=E();if(dt.match(/\[TOC\]/)&&(Ct=Ct.replace("<p>[TOC]</p>",A()),R()),Ct=Ct.replace(/(__special_katext_id_\d+__)/g,function(Pe,Yt){var xn=Nt[Yt],pi=xn.type,On=xn.expression;return Object(q.renderToString)(na(On)||"",{displayMode:pi==="block",throwOnError:!1,output:"html"})}),Ct=Ct.replace(/▁/g,"\u2581\u2581\u2581"),g(),Le){var Dt=document.createElement("div");return Dt.innerHTML=Ct,Dt.innerText}return setTimeout(function(){return si()},500),Ct},[dt]),zt=Object(P.useRef)();O.WebkitLineClamp=ct,ct&&(hi=Object(I.a)(Object(I.a)({},hi),O));function An(Xt){var jt=Xt.target;if(jt.tagName.toUpperCase()==="IMG"){if(rn){var pn=jt.getAttribute("src");wn(pn),un("image")}}else if(jt.tagName.toUpperCase()==="A"){var Ct=jt.getAttribute("href");if(Ct.indexOf("office")>-1)Xt.preventDefault(),wn(Ct),un("office");else if(Ct.indexOf("application/pdf")>-1)Xt.preventDefault(),wn(Ct),un("pdf");else if(Ct.indexOf("text/html")>-1)Xt.preventDefault(),wn(Ct),un("html");else if(Ct.startsWith("#")){Xt.preventDefault();var Nt=document.getElementById(Ct.replace("#",""));Nt&&Nt.scrollIntoView(!0)}}}var si=function(){var jt,pn=(jt=zt.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");pn==null||pn.forEach(function(Ct){if(Ct.oncontextmenu=function(){return!1},Ct.src.indexOf(".m3u8")>-1&&!Ct.canPlayType("application/vnd.apple.mpegurl")){if(F.a.isSupported()){var Nt=new F.a;Nt.loadSource(Ct.src),Nt.attachMedia(Ct)}}})};Object(P.useEffect)(function(){if(zt.current&&Nn&&(Nn.match(zr)&&window.PR.prettyPrint()),zt.current)return zt.current.addEventListener("click",An),function(){zt.current.removeEventListener("click",An),g(),R()}},[Nn,zt.current,An]);var Un=function(jt){if(!te)return;jt.target.nodeName==="IMG"?(kt.current.style.zIndex=1,kt.current.style.display="flex",kt.current.style.width=jt.target.clientWidth+"px",kt.current.style.height=jt.target.clientHeight+"px",kt.current.style.top=jt.target.offsetTop+"px",kt.current.style.left=jt.target.offsetLeft+"px",Lt.current.src=jt.target.getAttribute("src")):kt.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:zt,style:Object(I.a)({},hi),className:"".concat(Y||""," markdown-body ").concat(Kr.a.mdBody),onMouseOver:Un,dangerouslySetInnerHTML:{__html:Nn}}),b.a.createElement("div",{ref:kt,className:Kr.a.button},b.a.createElement(Z.a,null,b.a.createElement(V.a,{onClick:function(){return Sn()}},"\u88C1\u526A"),b.a.createElement(V.a,{onClick:function(){return di()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Lt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(ie.a,{close:!0,data:En,type:En!=null&&En.length?zn:"",style:Object(I.a)({},Zt),onClose:function(){return wn("")}}))}},"9VGf":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return M});var de=G("q1tI"),Z=G.n(de);function M(V,I){var B=Object(de.useRef)();Object(de.useEffect)(function(){B.current=V}),Object(de.useEffect)(function(){function K(){B.current()}if(I!==null){var W=setInterval(K,I);return function(){return clearInterval(W)}}},[I])}},"A60/":function(ft,Xe,G){ft.exports={wrap:"wrap___37dvp",right20:"right20___2yZBe",right180:"right180___14fSn",basket:"basket___32ZdA",count:"count___2ydNT",iconWrap:"iconWrap___2cEp5",icon:"icon___3fYs3",name:"name___7IPYm"}},BU3w:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return B});var de=G("MNnm"),Z="rc-util-key";function M(K){if(K.attachTo)return K.attachTo;var W=document.querySelector("head");return W||document.body}function V(K){var W,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(de.a)())return null;var P=document.createElement("style");if((W=L.csp)===null||W===void 0?void 0:W.nonce){var b;P.nonce=(b=L.csp)===null||b===void 0?void 0:b.nonce}P.innerHTML=K;var p=M(L),_=p.firstChild;return L.prepend&&p.prepend?p.prepend(P):L.prepend&&_?p.insertBefore(P,_):p.appendChild(P),P}var I=new Map;function B(K,W){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=M(L);if(!I.has(P)){var b=V("",L),p=b.parentNode;I.set(P,p),p.removeChild(b)}var _=Array.from(I.get(P).children).find(function(a){return a.tagName==="STYLE"&&a[Z]===W});if(_){var h,r;if(((h=L.csp)===null||h===void 0?void 0:h.nonce)&&_.nonce!==((r=L.csp)===null||r===void 0?void 0:r.nonce)){var d;_.nonce=(d=L.csp)===null||d===void 0?void 0:d.nonce}return _.innerHTML!==K&&(_.innerHTML=K),_}var l=V(K,L);return l[Z]=W,l}},Bd2K:function(ft,Xe,G){(function(de){de(G("VrN/"),G("osHv"))})(function(de){de.defineOption("autoCloseTags",!1,function(L,P,b){if(b!=de.Init&&b&&L.removeKeyMap("autoCloseTags"),!P)return;var p={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(p["'/'"]=function(_){return B(_)}),(typeof P!="object"||P.whenOpening!==!1)&&(p["'>'"]=function(_){return V(_)}),L.addKeyMap(p)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 V(L){if(L.getOption("disableInput"))return de.Pass;for(var P=L.listSelections(),b=[],p=L.getOption("autoCloseTags"),_=0;_<P.length;_++){if(!P[_].empty())return de.Pass;var h=P[_].head,r=L.getTokenAt(h),d=de.innerMode(L.getMode(),r.state),l=d.state,a=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(l),u=a&&a.name;if(!u)return de.Pass;var c=d.mode.configuration=="html",R=typeof p=="object"&&p.dontCloseTags||c&&Z,O=typeof p=="object"&&p.indentTags||c&&M;r.end>h.ch&&(u=u.slice(0,u.length-r.end+h.ch));var T=u.toLowerCase();if(!u||r.type=="string"&&(r.end!=h.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&a.close||r.string.indexOf("/")==h.ch-r.start-1||R&&K(R,T)>-1||W(L,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(l)||[],u,h,!0))return de.Pass;var A=typeof p=="object"&&p.emptyTags;if(A&&K(A,u)>-1){b[_]={text:"/>",newPos:de.Pos(h.line,h.ch+2)};continue}var w=O&&K(O,T)>-1;b[_]={indent:w,text:">"+(w?`
`:"")+"</"+u+">",newPos:w?de.Pos(h.line+1,0):de.Pos(h.line,h.ch+1)}}for(var m=typeof p=="object"&&p.dontIndentOnAutoClose,_=P.length-1;_>=0;_--){var v=b[_];L.replaceRange(v.text,P[_].head,P[_].anchor,"+insert");var s=L.listSelections().slice(0);s[_]={head:v.newPos,anchor:v.newPos},L.setSelections(s),!m&&v.indent&&(L.indentLine(v.newPos.line,null,!0),L.indentLine(v.newPos.line+1,null,!0))}}function I(L,P){for(var b=L.listSelections(),p=[],_=P?"/":"</",h=L.getOption("autoCloseTags"),r=typeof h=="object"&&h.dontIndentOnSlash,d=0;d<b.length;d++){if(!b[d].empty())return de.Pass;var l=b[d].head,a=L.getTokenAt(l),u=de.innerMode(L.getMode(),a.state),c=u.state;if(P&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=l.ch-1))return de.Pass;var R,O=u.mode.name!="xml"&&L.getMode().name=="htmlmixed";if(O&&u.mode.name=="javascript")R=_+"script";else if(O&&u.mode.name=="css")R=_+"style";else{var T=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(c);if(!T||T.length&&W(L,T,T[T.length-1],l))return de.Pass;R=_+T[T.length-1]}L.getLine(l.line).charAt(a.end)!=">"&&(R+=">"),p[d]=R}if(L.replaceSelections(p),b=L.listSelections(),!r)for(var d=0;d<b.length;d++)(d==b.length-1||b[d].head.line<b[d+1].head.line)&&L.indentLine(b[d].head.line)}function B(L){return L.getOption("disableInput")?de.Pass:I(L,!0)}de.commands.closeTag=function(L){return I(L)};function K(L,P){if(L.indexOf)return L.indexOf(P);for(var b=0,p=L.length;b<p;++b)if(L[b]==P)return b;return-1}function W(L,P,b,p,_){if(!de.scanForClosingTag)return!1;var h=Math.min(L.lastLine()+1,p.line+500),r=de.scanForClosingTag(L,p,null,h);if(!r||r.tag!=b)return!1;for(var d=_?1:0,l=P.length-1;l>=0&&P[l]==b;l--)++d;p=r.to;for(var l=1;l<d;l++){var a=de.scanForClosingTag(L,p,null,h);if(!a||a.tag!=b)return!1;p=a.to}return!0}})},BdwD:function(ft,Xe,G){"use strict";var de=G("+L6B"),Z=G("2/Rp"),M=G("0Owb"),V=G("k1fw"),I=G("q1tI"),B=G.n(I),K=G("FOrL"),W=G.n(K),L=function(b){var p=b.buttonProps,_=p===void 0?{}:p,h=b.styles,r=h===void 0?{}:h,d=b.customText,l=b.ButtonText,a=b.ButtonClick,u=b.Buttonclass,c=b.ButtonTwo;return B.a.createElement("section",{className:"tc animated fadeIn",style:Object(V.a)(Object(V.a)({},{color:"#999",margin:"200px auto"}),r)},B.a.createElement("img",{src:W.a}),B.a.createElement("p",{className:"mt20 font14"},d||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&B.a.createElement(Z.a,Object(M.a)({className:u,onClick:a},_),l),c&&c)};Xe.a=L},BjJ7:function(ft,Xe,G){"use strict";G.d(Xe,"d",function(){return Z}),G.d(Xe,"c",function(){return M}),G.d(Xe,"e",function(){return V}),G.d(Xe,"b",function(){return I}),G.d(Xe,"a",function(){return K});var de=G("m3rI");function Z(W){var L=!0;if(W.length>0){for(var P=0;P<W.length;P++)if(W[P].compile_success==0||!W[P].compile_success){L=!1;break}}else L=!1;return L}function M(W){for(var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],b=0;b<W.length;b++){var p=W[b],_=L?"".concat(L,"/").concat(p.name):"".concat(p.name);P.push({title:p.name,isLeaf:!(p.type==="tree"),key:_})}return P}function V(W,L,P){for(var b=0;b<W.length;b++){var p=W[b];if(p.key===L){p.children=P;break}p.children&&V(p.children,L,P)}return W}function I(W,L,P){var b;return function(){var p=this,_=arguments,h=function(){b=null,P||W.apply(p,_)},r=P&&!b;clearTimeout(b),b=setTimeout(h,L),r&&W.apply(p,_)}}var B=!0,K=de.a.API_SERVER},"C+DQ":function(ft,Xe,G){},DlQD:function(ft,Xe,G){(function(de,Z){ft.exports=Z()})(this,function(){"use strict";function de(be,xe){for(var pe=0;pe<xe.length;pe++){var se=xe[pe];se.enumerable=se.enumerable||!1,se.configurable=!0,"value"in se&&(se.writable=!0),Object.defineProperty(be,se.key,se)}}function Z(be,xe,pe){return xe&&de(be.prototype,xe),pe&&de(be,pe),be}function M(be,xe){if(!be)return;if(typeof be=="string")return V(be,xe);var pe=Object.prototype.toString.call(be).slice(8,-1);if(pe==="Object"&&be.constructor&&(pe=be.constructor.name),pe==="Map"||pe==="Set")return Array.from(be);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return V(be,xe)}function V(be,xe){(xe==null||xe>be.length)&&(xe=be.length);for(var pe=0,se=new Array(xe);pe<xe;pe++)se[pe]=be[pe];return se}function I(be,xe){var pe;if(typeof Symbol=="undefined"||be[Symbol.iterator]==null){if(Array.isArray(be)||(pe=M(be))||xe&&be&&typeof be.length=="number"){pe&&(be=pe);var se=0;return function(){return se>=be.length?{done:!0}:{done:!1,value:be[se++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return pe=be[Symbol.iterator](),pe.next.bind(pe)}function B(be,xe){return xe={exports:{}},be(xe,xe.exports),xe.exports}var K=B(function(be){function xe(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function pe(se){be.exports.defaults=se}be.exports={defaults:xe(),getDefaults:xe,changeDefaults:pe}}),W=K.defaults,L=K.getDefaults,P=K.changeDefaults,b=/[&<>"']/,p=/[&<>"']/g,_=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(xe){return r[xe]};function l(be,xe){if(xe){if(b.test(be))return be.replace(p,d)}else if(_.test(be))return be.replace(h,d);return be}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(be){return be.replace(a,function(xe,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var c=/(^|[^\[])\^/g;function R(be,xe){be=be.source||be,xe=xe||"";var pe={replace:function(ce,Ee){return Ee=Ee.source||Ee,Ee=Ee.replace(c,"$1"),be=be.replace(ce,Ee),pe},getRegex:function(){return new RegExp(be,xe)}};return pe}var O=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(be,xe,pe){if(be){var se;try{se=decodeURIComponent(u(pe)).replace(O,"").toLowerCase()}catch(ce){return null}if(se.indexOf("javascript:")===0||se.indexOf("vbscript:")===0||se.indexOf("data:")===0)return null}xe&&!T.test(pe)&&(pe=o(xe,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(ce){return null}return pe}var w={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(be,xe){w[" "+be]||(m.test(be)?w[" "+be]=be+"/":w[" "+be]=N(be,"/",!0)),be=w[" "+be];var pe=be.indexOf(":")===-1;return xe.substring(0,2)==="//"?pe?xe:be.replace(v,"$1")+xe:xe.charAt(0)==="/"?pe?xe:be.replace(s,"$1")+xe:be+xe}var E={exec:function(){}};function g(be){for(var xe=1,pe,se;xe<arguments.length;xe++){pe=arguments[xe];for(se in pe)Object.prototype.hasOwnProperty.call(pe,se)&&(be[se]=pe[se])}return be}function C(be,xe){var pe=be.replace(/\|/g,function(Ee,Ae,De){for(var $e=!1,lt=Ae;--lt>=0&&De[lt]==="\\";)$e=!$e;return $e?"|":" |"}),se=pe.split(/ \|/),ce=0;if(se.length>xe)se.splice(xe);else for(;se.length<xe;)se.push("");for(;ce<se.length;ce++)se[ce]=se[ce].trim().replace(/\\\|/g,"|");return se}function N(be,xe,pe){var se=be.length;if(se===0)return"";for(var ce=0;ce<se;){var Ee=be.charAt(se-ce-1);if(Ee===xe&&!pe)ce++;else if(Ee!==xe&&pe)ce++;else break}return be.substr(0,se-ce)}function U(be,xe){if(be.indexOf(xe[1])===-1)return-1;for(var pe=be.length,se=0,ce=0;ce<pe;ce++)if(be[ce]==="\\")ce++;else if(be[ce]===xe[0])se++;else if(be[ce]===xe[1]&&(se--,se<0))return ce;return-1}function j(be){be&&be.sanitize&&!be.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var H={escape:l,unescape:u,edit:R,cleanUrl:A,resolveUrl:o,noopTest:E,merge:g,splitCells:C,rtrim:N,findClosingBracket:U,checkSanitizeDeprecation:j},y=K.defaults,x=H.rtrim,F=H.splitCells,Q=H.escape,q=H.findClosingBracket;function ie(be,xe,pe){var se=xe.href,ce=xe.title?Q(xe.title):null,Ee=be[1].replace(/\\([\[\]])/g,"$1");return be[0].charAt(0)!=="!"?{type:"link",raw:pe,href:se,title:ce,text:Ee}:{type:"image",raw:pe,href:se,title:ce,text:Q(Ee)}}function ge(be,xe){var pe=be.match(/^(\s+)(?:```)/);if(pe===null)return xe;var se=pe[1];return xe.split(`
`).map(function(ce){var Ee=ce.match(/^\s+/);if(Ee===null)return ce;var Ae=Ee[0];return Ae.length>=se.length?ce.slice(se.length):ce}).join(`
`)}var fe=function(){function be(pe){this.options=pe||y}var xe=be.prototype;return xe.space=function(se){var ce=this.rules.block.newline.exec(se);if(ce)return ce[0].length>1?{type:"space",raw:ce[0]}:{raw:`
`}},xe.code=function(se,ce){var Ee=this.rules.block.code.exec(se);if(Ee){var Ae=ce[ce.length-1];if(Ae&&Ae.type==="paragraph")return{raw:Ee[0],text:Ee[0].trimRight()};var De=Ee[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ee[0],codeBlockStyle:"indented",text:this.options.pedantic?De:x(De,`
`)}}},xe.fences=function(se){var ce=this.rules.block.fences.exec(se);if(ce){var Ee=ce[0],Ae=ge(Ee,ce[3]||"");return{type:"code",raw:Ee,lang:ce[2]?ce[2].trim():ce[2],text:Ae}}},xe.heading=function(se){var ce=this.rules.block.heading.exec(se);if(ce)return{type:"heading",raw:ce[0],depth:ce[1].length,text:ce[2]}},xe.nptable=function(se){var ce=this.rules.block.nptable.exec(se);if(ce){var Ee={type:"table",header:F(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(`
`):[],raw:ce[0]};if(Ee.header.length===Ee.align.length){var Ae=Ee.align.length,De;for(De=0;De<Ae;De++)/^ *-+: *$/.test(Ee.align[De])?Ee.align[De]="right":/^ *:-+: *$/.test(Ee.align[De])?Ee.align[De]="center":/^ *:-+ *$/.test(Ee.align[De])?Ee.align[De]="left":Ee.align[De]=null;for(Ae=Ee.cells.length,De=0;De<Ae;De++)Ee.cells[De]=F(Ee.cells[De],Ee.header.length);return Ee}}},xe.hr=function(se){var ce=this.rules.block.hr.exec(se);if(ce)return{type:"hr",raw:ce[0]}},xe.blockquote=function(se){var ce=this.rules.block.blockquote.exec(se);if(ce){var Ee=ce[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ce[0],text:Ee}}},xe.list=function(se){var ce=this.rules.block.list.exec(se);if(ce){for(var Ee=ce[0],Ae=ce[2],De=Ae.length>1,$e=Ae[Ae.length-1]===")",lt={type:"list",raw:Ee,ordered:De,start:De?+Ae.slice(0,-1):"",loose:!1,items:[]},Bt=ce[0].match(this.rules.block.item),tn=!1,nn,_n,yn,Gt,ii,Dn,Ci,fi=Bt.length,In=0;In<fi;In++)nn=Bt[In],Ee=nn,_n=nn.length,nn=nn.replace(/^ *([*+-]|\d+[.)]) */,""),~nn.indexOf(`
`)&&(_n-=nn.length,nn=this.options.pedantic?nn.replace(/^ {1,4}/gm,""):nn.replace(new RegExp("^ {1,"+_n+"}","gm"),"")),In!==fi-1&&(yn=this.rules.block.bullet.exec(Bt[In+1])[0],(De?yn.length===1||!$e&&yn[yn.length-1]===")":yn.length>1||this.options.smartLists&&yn!==Ae)&&(Gt=Bt.slice(In+1).join(`
`),lt.raw=lt.raw.substring(0,lt.raw.length-Gt.length),In=fi-1)),ii=tn||/\n\n(?!\s*$)/.test(nn),In!==fi-1&&(tn=nn.charAt(nn.length-1)===`
`,ii||(ii=tn)),ii&&(lt.loose=!0),Dn=/^\[[ xX]\] /.test(nn),Ci=void 0,Dn&&(Ci=nn[1]!==" ",nn=nn.replace(/^\[[ xX]\] +/,"")),lt.items.push({type:"list_item",raw:Ee,task:Dn,checked:Ci,loose:ii,text:nn});return lt}},xe.html=function(se){var ce=this.rules.block.html.exec(se);if(ce)return{type:this.options.sanitize?"paragraph":"html",raw:ce[0],pre:!this.options.sanitizer&&(ce[1]==="pre"||ce[1]==="script"||ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Q(ce[0]):ce[0]}},xe.def=function(se){var ce=this.rules.block.def.exec(se);if(ce){ce[3]&&(ce[3]=ce[3].substring(1,ce[3].length-1));var Ee=ce[1].toLowerCase().replace(/\s+/g," ");return{tag:Ee,raw:ce[0],href:ce[2],title:ce[3]}}},xe.table=function(se){var ce=this.rules.block.table.exec(se);if(ce){var Ee={type:"table",header:F(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(`
`):[]};if(Ee.header.length===Ee.align.length){Ee.raw=ce[0];var Ae=Ee.align.length,De;for(De=0;De<Ae;De++)/^ *-+: *$/.test(Ee.align[De])?Ee.align[De]="right":/^ *:-+: *$/.test(Ee.align[De])?Ee.align[De]="center":/^ *:-+ *$/.test(Ee.align[De])?Ee.align[De]="left":Ee.align[De]=null;for(Ae=Ee.cells.length,De=0;De<Ae;De++)Ee.cells[De]=F(Ee.cells[De].replace(/^ *\| *| *\| *$/g,""),Ee.header.length);return Ee}}},xe.lheading=function(se){var ce=this.rules.block.lheading.exec(se);if(ce)return{type:"heading",raw:ce[0],depth:ce[2].charAt(0)==="="?1:2,text:ce[1]}},xe.paragraph=function(se){var ce=this.rules.block.paragraph.exec(se);if(ce)return{type:"paragraph",raw:ce[0],text:ce[1].charAt(ce[1].length-1)===`
`?ce[1].slice(0,-1):ce[1]}},xe.text=function(se,ce){var Ee=this.rules.block.text.exec(se);if(Ee){var Ae=ce[ce.length-1];return Ae&&Ae.type==="text"?{raw:Ee[0],text:Ee[0]}:{type:"text",raw:Ee[0],text:Ee[0]}}},xe.escape=function(se){var ce=this.rules.inline.escape.exec(se);if(ce)return{type:"escape",raw:ce[0],text:Q(ce[1])}},xe.tag=function(se,ce,Ee){var Ae=this.rules.inline.tag.exec(se);if(Ae)return!ce&&/^<a /i.test(Ae[0])?ce=!0:ce&&/^<\/a>/i.test(Ae[0])&&(ce=!1),!Ee&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ae[0])?Ee=!0:Ee&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ae[0])&&(Ee=!1),{type:this.options.sanitize?"text":"html",raw:Ae[0],inLink:ce,inRawBlock:Ee,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):Q(Ae[0]):Ae[0]}},xe.link=function(se){var ce=this.rules.inline.link.exec(se);if(ce){var Ee=q(ce[2],"()");if(Ee>-1){var Ae=ce[0].indexOf("!")===0?5:4,De=Ae+ce[1].length+Ee;ce[2]=ce[2].substring(0,Ee),ce[0]=ce[0].substring(0,De).trim(),ce[3]=""}var $e=ce[2],lt="";if(this.options.pedantic){var Bt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec($e);Bt?($e=Bt[1],lt=Bt[3]):lt=""}else lt=ce[3]?ce[3].slice(1,-1):"";$e=$e.trim().replace(/^<([\s\S]*)>$/,"$1");var tn=ie(ce,{href:$e&&$e.replace(this.rules.inline._escapes,"$1"),title:lt&&lt.replace(this.rules.inline._escapes,"$1")},ce[0]);return tn}},xe.reflink=function(se,ce){var Ee;if((Ee=this.rules.inline.reflink.exec(se))||(Ee=this.rules.inline.nolink.exec(se))){var Ae=(Ee[2]||Ee[1]).replace(/\s+/g," ");if(Ae=ce[Ae.toLowerCase()],!Ae||!Ae.href){var De=Ee[0].charAt(0);return{type:"text",raw:De,text:De}}var $e=ie(Ee,Ae,Ee[0]);return $e}},xe.strong=function(se,ce,Ee){Ee===void 0&&(Ee="");var Ae=this.rules.inline.strong.start.exec(se);if(Ae&&(!Ae[1]||Ae[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){ce=ce.slice(-1*se.length);var De=Ae[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;De.lastIndex=0;for(var $e;(Ae=De.exec(ce))!=null;)if($e=this.rules.inline.strong.middle.exec(ce.slice(0,Ae.index+3)),$e)return{type:"strong",raw:se.slice(0,$e[0].length),text:se.slice(2,$e[0].length-2)}}},xe.em=function(se,ce,Ee){Ee===void 0&&(Ee="");var Ae=this.rules.inline.em.start.exec(se);if(Ae&&(!Ae[1]||Ae[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){ce=ce.slice(-1*se.length);var De=Ae[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;De.lastIndex=0;for(var $e;(Ae=De.exec(ce))!=null;)if($e=this.rules.inline.em.middle.exec(ce.slice(0,Ae.index+2)),$e)return{type:"em",raw:se.slice(0,$e[0].length),text:se.slice(1,$e[0].length-1)}}},xe.codespan=function(se){var ce=this.rules.inline.code.exec(se);if(ce){var Ee=ce[2].replace(/\n/g," "),Ae=/[^ ]/.test(Ee),De=Ee.startsWith(" ")&&Ee.endsWith(" ");return Ae&&De&&(Ee=Ee.substring(1,Ee.length-1)),Ee=Q(Ee,!0),{type:"codespan",raw:ce[0],text:Ee}}},xe.br=function(se){var ce=this.rules.inline.br.exec(se);if(ce)return{type:"br",raw:ce[0]}},xe.del=function(se){var ce=this.rules.inline.del.exec(se);if(ce)return{type:"del",raw:ce[0],text:ce[1]}},xe.autolink=function(se,ce){var Ee=this.rules.inline.autolink.exec(se);if(Ee){var Ae,De;return Ee[2]==="@"?(Ae=Q(this.options.mangle?ce(Ee[1]):Ee[1]),De="mailto:"+Ae):(Ae=Q(Ee[1]),De=Ae),{type:"link",raw:Ee[0],text:Ae,href:De,tokens:[{type:"text",raw:Ae,text:Ae}]}}},xe.url=function(se,ce){var Ee;if(Ee=this.rules.inline.url.exec(se)){var Ae,De;if(Ee[2]==="@")Ae=Q(this.options.mangle?ce(Ee[0]):Ee[0]),De="mailto:"+Ae;else{var $e;do $e=Ee[0],Ee[0]=this.rules.inline._backpedal.exec(Ee[0])[0];while($e!==Ee[0]);Ae=Q(Ee[0]),Ee[1]==="www."?De="http://"+Ae:De=Ae}return{type:"link",raw:Ee[0],text:Ae,href:De,tokens:[{type:"text",raw:Ae,text:Ae}]}}},xe.inlineText=function(se,ce,Ee){var Ae=this.rules.inline.text.exec(se);if(Ae){var De;return ce?De=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):Q(Ae[0]):Ae[0]:De=Q(this.options.smartypants?Ee(Ae[0]):Ae[0]),{type:"text",raw:Ae[0],text:De}}},be}(),ue=H.noopTest,he=H.edit,_e=H.merge,le={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:ue,table:ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};le._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,le._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,le.def=he(le.def).replace("label",le._label).replace("title",le._title).getRegex(),le.bullet=/(?:[*+-]|\d{1,9}[.)])/,le.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,le.item=he(le.item,"gm").replace(/bull/g,le.bullet).getRegex(),le.list=he(le.list).replace(/bull/g,le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+le.def.source+")").getRegex(),le._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",le._comment=/<!--(?!-?>)[\s\S]*?-->/,le.html=he(le.html,"i").replace("comment",le._comment).replace("tag",le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),le.paragraph=he(le._paragraph).replace("hr",le.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",le._tag).getRegex(),le.blockquote=he(le.blockquote).replace("paragraph",le.paragraph).getRegex(),le.normal=_e({},le),le.gfm=_e({},le.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*|$)"}),le.gfm.nptable=he(le.gfm.nptable).replace("hr",le.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",le._tag).getRegex(),le.gfm.table=he(le.gfm.table).replace("hr",le.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",le._tag).getRegex(),le.pedantic=_e({},le.normal,{html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",le._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:ue,paragraph:he(le.normal._paragraph).replace("hr",le.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ue,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:ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ne._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ne.punctuation=he(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex(),ne._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ne._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ne.em.start=he(ne.em.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.middle=he(ne.em.middle).replace(/punctuation/g,ne._punctuation).replace(/overlapSkip/g,ne._overlapSkip).getRegex(),ne.em.endAst=he(ne.em.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.endUnd=he(ne.em.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.start=he(ne.strong.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.middle=he(ne.strong.middle).replace(/punctuation/g,ne._punctuation).replace(/blockSkip/g,ne._blockSkip).getRegex(),ne.strong.endAst=he(ne.strong.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.endUnd=he(ne.strong.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.blockSkip=he(ne._blockSkip,"g").getRegex(),ne.overlapSkip=he(ne._overlapSkip,"g").getRegex(),ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ne._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])?)+(?![-_])/,ne.autolink=he(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex(),ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ne.tag=he(ne.tag).replace("comment",le._comment).replace("attribute",ne._attribute).getRegex(),ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ne._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ne.link=he(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex(),ne.reflink=he(ne.reflink).replace("label",ne._label).getRegex(),ne.reflinkSearch=he(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex(),ne.normal=_e({},ne),ne.pedantic=_e({},ne.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()}),ne.gfm=_e({},ne.normal,{escape:he(ne.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ne.gfm.url=he(ne.gfm.url,"i").replace("email",ne.gfm._extended_email).getRegex(),ne.breaks=_e({},ne.gfm,{br:he(ne.br).replace("{2,}","*").getRegex(),text:he(ne.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Te={block:le,inline:ne},Fe=K.defaults,Ke=Te.block,Ue=Te.inline;function He(be){return be.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 Ne(be){var xe="",pe,se,ce=be.length;for(pe=0;pe<ce;pe++)se=be.charCodeAt(pe),Math.random()>.5&&(se="x"+se.toString(16)),xe+="&#"+se+";";return xe}var Be=function(){function be(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||Fe,this.options.tokenizer=this.options.tokenizer||new fe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var se={block:Ke.normal,inline:Ue.normal};this.options.pedantic?(se.block=Ke.pedantic,se.inline=Ue.pedantic):this.options.gfm&&(se.block=Ke.gfm,this.options.breaks?se.inline=Ue.breaks:se.inline=Ue.gfm),this.tokenizer.rules=se}be.lex=function(se,ce){var Ee=new be(ce);return Ee.lex(se)};var xe=be.prototype;return xe.lex=function(se){return se=se.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(se,this.tokens,!0),this.inline(this.tokens),this.tokens},xe.blockTokens=function(se,ce,Ee){ce===void 0&&(ce=[]),Ee===void 0&&(Ee=!0),se=se.replace(/^ +$/gm,"");for(var Ae,De,$e,lt;se;){if(Ae=this.tokenizer.space(se)){se=se.substring(Ae.raw.length),Ae.type&&ce.push(Ae);continue}if(Ae=this.tokenizer.code(se,ce)){se=se.substring(Ae.raw.length),Ae.type?ce.push(Ae):(lt=ce[ce.length-1],lt.raw+=`
`+Ae.raw,lt.text+=`
`+Ae.text);continue}if(Ae=this.tokenizer.fences(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.heading(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.nptable(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.hr(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.blockquote(se)){se=se.substring(Ae.raw.length),Ae.tokens=this.blockTokens(Ae.text,[],Ee),ce.push(Ae);continue}if(Ae=this.tokenizer.list(se)){for(se=se.substring(Ae.raw.length),$e=Ae.items.length,De=0;De<$e;De++)Ae.items[De].tokens=this.blockTokens(Ae.items[De].text,[],!1);ce.push(Ae);continue}if(Ae=this.tokenizer.html(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ee&&(Ae=this.tokenizer.def(se))){se=se.substring(Ae.raw.length),this.tokens.links[Ae.tag]||(this.tokens.links[Ae.tag]={href:Ae.href,title:Ae.title});continue}if(Ae=this.tokenizer.table(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.lheading(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ee&&(Ae=this.tokenizer.paragraph(se))){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.text(se,ce)){se=se.substring(Ae.raw.length),Ae.type?ce.push(Ae):(lt=ce[ce.length-1],lt.raw+=`
`+Ae.raw,lt.text+=`
`+Ae.text);continue}if(se){var Bt="Infinite loop on byte: "+se.charCodeAt(0);if(this.options.silent){console.error(Bt);break}else throw new Error(Bt)}}return ce},xe.inline=function(se){var ce,Ee,Ae,De,$e,lt,Bt=se.length;for(ce=0;ce<Bt;ce++){lt=se[ce];switch(lt.type){case"paragraph":case"text":case"heading":{lt.tokens=[],this.inlineTokens(lt.text,lt.tokens);break}case"table":{for(lt.tokens={header:[],cells:[]},De=lt.header.length,Ee=0;Ee<De;Ee++)lt.tokens.header[Ee]=[],this.inlineTokens(lt.header[Ee],lt.tokens.header[Ee]);for(De=lt.cells.length,Ee=0;Ee<De;Ee++)for($e=lt.cells[Ee],lt.tokens.cells[Ee]=[],Ae=0;Ae<$e.length;Ae++)lt.tokens.cells[Ee][Ae]=[],this.inlineTokens($e[Ae],lt.tokens.cells[Ee][Ae]);break}case"blockquote":{this.inline(lt.tokens);break}case"list":{for(De=lt.items.length,Ee=0;Ee<De;Ee++)this.inline(lt.items[Ee].tokens);break}}}return se},xe.inlineTokens=function(se,ce,Ee,Ae,De){ce===void 0&&(ce=[]),Ee===void 0&&(Ee=!1),Ae===void 0&&(Ae=!1),De===void 0&&(De="");var $e,lt=se,Bt;if(this.tokens.links){var tn=Object.keys(this.tokens.links);if(tn.length>0)for(;(Bt=this.tokenizer.rules.inline.reflinkSearch.exec(lt))!=null;)tn.includes(Bt[0].slice(Bt[0].lastIndexOf("[")+1,-1))&&(lt=lt.slice(0,Bt.index)+"["+"a".repeat(Bt[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Bt=this.tokenizer.rules.inline.blockSkip.exec(lt))!=null;)lt=lt.slice(0,Bt.index)+"["+"a".repeat(Bt[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;se;){if($e=this.tokenizer.escape(se)){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.tag(se,Ee,Ae)){se=se.substring($e.raw.length),Ee=$e.inLink,Ae=$e.inRawBlock,ce.push($e);continue}if($e=this.tokenizer.link(se)){se=se.substring($e.raw.length),$e.type==="link"&&($e.tokens=this.inlineTokens($e.text,[],!0,Ae)),ce.push($e);continue}if($e=this.tokenizer.reflink(se,this.tokens.links)){se=se.substring($e.raw.length),$e.type==="link"&&($e.tokens=this.inlineTokens($e.text,[],!0,Ae)),ce.push($e);continue}if($e=this.tokenizer.strong(se,lt,De)){se=se.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],Ee,Ae),ce.push($e);continue}if($e=this.tokenizer.em(se,lt,De)){se=se.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],Ee,Ae),ce.push($e);continue}if($e=this.tokenizer.codespan(se)){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.br(se)){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.del(se)){se=se.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],Ee,Ae),ce.push($e);continue}if($e=this.tokenizer.autolink(se,Ne)){se=se.substring($e.raw.length),ce.push($e);continue}if(!Ee&&($e=this.tokenizer.url(se,Ne))){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.inlineText(se,Ae,He)){se=se.substring($e.raw.length),De=$e.raw.slice(-1),ce.push($e);continue}if(se){var nn="Infinite loop on byte: "+se.charCodeAt(0);if(this.options.silent){console.error(nn);break}else throw new Error(nn)}}return ce},Z(be,null,[{key:"rules",get:function(){return{block:Ke,inline:Ue}}}]),be}(),Je=K.defaults,tt=H.cleanUrl,it=H.escape,rt=function(){function be(pe){this.options=pe||Je}var xe=be.prototype;return xe.code=function(se,ce,Ee){var Ae=(ce||"").match(/\S*/)[0];if(this.options.highlight){var De=this.options.highlight(se,Ae);De!=null&&De!==se&&(Ee=!0,se=De)}return Ae?'<pre><code class="'+this.options.langPrefix+it(Ae,!0)+'">'+(Ee?se:it(se,!0))+`</code></pre>
`:"<pre><code>"+(Ee?se:it(se,!0))+`</code></pre>
`},xe.blockquote=function(se){return`<blockquote>
`+se+`</blockquote>
`},xe.html=function(se){return se},xe.heading=function(se,ce,Ee,Ae){return this.options.headerIds?"<h"+ce+' id="'+this.options.headerPrefix+Ae.slug(Ee)+'">'+se+"</h"+ce+`>
`:"<h"+ce+">"+se+"</h"+ce+`>
`},xe.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},xe.list=function(se,ce,Ee){var Ae=ce?"ol":"ul",De=ce&&Ee!==1?' start="'+Ee+'"':"";return"<"+Ae+De+`>
`+se+"</"+Ae+`>
`},xe.listitem=function(se){return"<li>"+se+`</li>
`},xe.checkbox=function(se){return"<input "+(se?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},xe.paragraph=function(se){return"<p>"+se+`</p>
`},xe.table=function(se,ce){return ce&&(ce="<tbody>"+ce+"</tbody>"),`<table>
<thead>
`+se+`</thead>
`+ce+`</table>
`},xe.tablerow=function(se){return`<tr>
`+se+`</tr>
`},xe.tablecell=function(se,ce){var Ee=ce.header?"th":"td",Ae=ce.align?"<"+Ee+' align="'+ce.align+'">':"<"+Ee+">";return Ae+se+"</"+Ee+`>
`},xe.strong=function(se){return"<strong>"+se+"</strong>"},xe.em=function(se){return"<em>"+se+"</em>"},xe.codespan=function(se){return"<code>"+se+"</code>"},xe.br=function(){return this.options.xhtml?"<br/>":"<br>"},xe.del=function(se){return"<del>"+se+"</del>"},xe.link=function(se,ce,Ee){if(se=tt(this.options.sanitize,this.options.baseUrl,se),se===null)return Ee;var Ae='<a href="'+it(se)+'"';return ce&&(Ae+=' title="'+ce+'"'),Ae+=">"+Ee+"</a>",Ae},xe.image=function(se,ce,Ee){if(se=tt(this.options.sanitize,this.options.baseUrl,se),se===null)return Ee;var Ae='<img src="'+se+'" alt="'+Ee+'"';return ce&&(Ae+=' title="'+ce+'"'),Ae+=this.options.xhtml?"/>":">",Ae},xe.text=function(se){return se},be}(),qe=function(){function be(){}var xe=be.prototype;return xe.strong=function(se){return se},xe.em=function(se){return se},xe.codespan=function(se){return se},xe.del=function(se){return se},xe.html=function(se){return se},xe.text=function(se){return se},xe.link=function(se,ce,Ee){return""+Ee},xe.image=function(se,ce,Ee){return""+Ee},xe.br=function(){return""},be}(),gt=function(){function be(){this.seen={}}var xe=be.prototype;return xe.slug=function(se){var ce=se.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ce)){var Ee=ce;do this.seen[Ee]++,ce=Ee+"-"+this.seen[Ee];while(this.seen.hasOwnProperty(ce))}return this.seen[ce]=0,ce},be}(),pt=K.defaults,vt=H.unescape,at=function(){function be(pe){this.options=pe||pt,this.options.renderer=this.options.renderer||new rt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qe,this.slugger=new gt}be.parse=function(se,ce){var Ee=new be(ce);return Ee.parse(se)};var xe=be.prototype;return xe.parse=function(se,ce){ce===void 0&&(ce=!0);var Ee="",Ae,De,$e,lt,Bt,tn,nn,_n,yn,Gt,ii,Dn,Ci,fi,In,Ri,Si,Ot,bn=se.length;for(Ae=0;Ae<bn;Ae++){Gt=se[Ae];switch(Gt.type){case"space":continue;case"hr":{Ee+=this.renderer.hr();continue}case"heading":{Ee+=this.renderer.heading(this.parseInline(Gt.tokens),Gt.depth,vt(this.parseInline(Gt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ee+=this.renderer.code(Gt.text,Gt.lang,Gt.escaped);continue}case"table":{for(_n="",nn="",lt=Gt.header.length,De=0;De<lt;De++)nn+=this.renderer.tablecell(this.parseInline(Gt.tokens.header[De]),{header:!0,align:Gt.align[De]});for(_n+=this.renderer.tablerow(nn),yn="",lt=Gt.cells.length,De=0;De<lt;De++){for(tn=Gt.tokens.cells[De],nn="",Bt=tn.length,$e=0;$e<Bt;$e++)nn+=this.renderer.tablecell(this.parseInline(tn[$e]),{header:!1,align:Gt.align[$e]});yn+=this.renderer.tablerow(nn)}Ee+=this.renderer.table(_n,yn);continue}case"blockquote":{yn=this.parse(Gt.tokens),Ee+=this.renderer.blockquote(yn);continue}case"list":{for(ii=Gt.ordered,Dn=Gt.start,Ci=Gt.loose,lt=Gt.items.length,yn="",De=0;De<lt;De++)In=Gt.items[De],Ri=In.checked,Si=In.task,fi="",In.task&&(Ot=this.renderer.checkbox(Ri),Ci?In.tokens.length>0&&In.tokens[0].type==="text"?(In.tokens[0].text=Ot+" "+In.tokens[0].text,In.tokens[0].tokens&&In.tokens[0].tokens.length>0&&In.tokens[0].tokens[0].type==="text"&&(In.tokens[0].tokens[0].text=Ot+" "+In.tokens[0].tokens[0].text)):In.tokens.unshift({type:"text",text:Ot}):fi+=Ot),fi+=this.parse(In.tokens,Ci),yn+=this.renderer.listitem(fi,Si,Ri);Ee+=this.renderer.list(yn,ii,Dn);continue}case"html":{Ee+=this.renderer.html(Gt.text);continue}case"paragraph":{Ee+=this.renderer.paragraph(this.parseInline(Gt.tokens));continue}case"text":{for(yn=Gt.tokens?this.parseInline(Gt.tokens):Gt.text;Ae+1<bn&&se[Ae+1].type==="text";)Gt=se[++Ae],yn+=`
`+(Gt.tokens?this.parseInline(Gt.tokens):Gt.text);Ee+=ce?this.renderer.paragraph(yn):yn;continue}default:{var Cn='Token with "'+Gt.type+'" type was not found.';if(this.options.silent){console.error(Cn);return}else throw new Error(Cn)}}}return Ee},xe.parseInline=function(se,ce){ce=ce||this.renderer;var Ee="",Ae,De,$e=se.length;for(Ae=0;Ae<$e;Ae++){De=se[Ae];switch(De.type){case"escape":{Ee+=ce.text(De.text);break}case"html":{Ee+=ce.html(De.text);break}case"link":{Ee+=ce.link(De.href,De.title,this.parseInline(De.tokens,ce));break}case"image":{Ee+=ce.image(De.href,De.title,De.text);break}case"strong":{Ee+=ce.strong(this.parseInline(De.tokens,ce));break}case"em":{Ee+=ce.em(this.parseInline(De.tokens,ce));break}case"codespan":{Ee+=ce.codespan(De.text);break}case"br":{Ee+=ce.br();break}case"del":{Ee+=ce.del(this.parseInline(De.tokens,ce));break}case"text":{Ee+=ce.text(De.text);break}default:{var lt='Token with "'+De.type+'" type was not found.';if(this.options.silent){console.error(lt);return}else throw new Error(lt)}}}return Ee},be}(),Rt=H.merge,xt=H.checkSanitizeDeprecation,Tt=H.escape,Ye=K.getDefaults,Mt=K.changeDefaults,St=K.defaults;function ze(be,xe,pe){if(typeof be=="undefined"||be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");if(typeof xe=="function"&&(pe=xe,xe=null),xe=Rt({},ze.defaults,xe||{}),xt(xe),pe){var se=xe.highlight,ce;try{ce=Be.lex(be,xe)}catch($e){return pe($e)}var Ee=function(lt){var Bt;if(!lt)try{Bt=at.parse(ce,xe)}catch(tn){lt=tn}return xe.highlight=se,lt?pe(lt):pe(null,Bt)};if(!se||se.length<3)return Ee();if(delete xe.highlight,!ce.length)return Ee();var Ae=0;ze.walkTokens(ce,function($e){$e.type==="code"&&(Ae++,setTimeout(function(){se($e.text,$e.lang,function(lt,Bt){if(lt)return Ee(lt);Bt!=null&&Bt!==$e.text&&($e.text=Bt,$e.escaped=!0),Ae--,Ae===0&&Ee()})},0))}),Ae===0&&Ee();return}try{var De=Be.lex(be,xe);return xe.walkTokens&&ze.walkTokens(De,xe.walkTokens),at.parse(De,xe)}catch($e){if($e.message+=`
Please report this to https://github.com/markedjs/marked.`,xe.silent)return"<p>An error occurred:</p><pre>"+Tt($e.message+"",!0)+"</pre>";throw $e}}ze.options=ze.setOptions=function(be){return Rt(ze.defaults,be),Mt(ze.defaults),ze},ze.getDefaults=Ye,ze.defaults=St,ze.use=function(be){var xe=Rt({},be);if(be.renderer&&function(){var se=ze.defaults.renderer||new rt,ce=function(De){var $e=se[De];se[De]=function(){for(var lt=arguments.length,Bt=new Array(lt),tn=0;tn<lt;tn++)Bt[tn]=arguments[tn];var nn=be.renderer[De].apply(se,Bt);return nn===!1&&(nn=$e.apply(se,Bt)),nn}};for(var Ee in be.renderer)ce(Ee);xe.renderer=se}(),be.tokenizer&&function(){var se=ze.defaults.tokenizer||new fe,ce=function(De){var $e=se[De];se[De]=function(){for(var lt=arguments.length,Bt=new Array(lt),tn=0;tn<lt;tn++)Bt[tn]=arguments[tn];var nn=be.tokenizer[De].apply(se,Bt);return nn===!1&&(nn=$e.apply(se,Bt)),nn}};for(var Ee in be.tokenizer)ce(Ee);xe.tokenizer=se}(),be.walkTokens){var pe=ze.defaults.walkTokens;xe.walkTokens=function(se){be.walkTokens(se),pe&&pe(se)}}ze.setOptions(xe)},ze.walkTokens=function(be,xe){for(var pe=I(be),se;!(se=pe()).done;){var ce=se.value;xe(ce);switch(ce.type){case"table":{for(var Ee=I(ce.tokens.header),Ae;!(Ae=Ee()).done;){var De=Ae.value;ze.walkTokens(De,xe)}for(var $e=I(ce.tokens.cells),lt;!(lt=$e()).done;)for(var Bt=lt.value,tn=I(Bt),nn;!(nn=tn()).done;){var _n=nn.value;ze.walkTokens(_n,xe)}break}case"list":{ze.walkTokens(ce.items,xe);break}default:ce.tokens&&ze.walkTokens(ce.tokens,xe)}}},ze.Parser=at,ze.parser=at.parse,ze.Renderer=rt,ze.TextRenderer=qe,ze.Lexer=Be,ze.lexer=Be.lex,ze.Tokenizer=fe,ze.Slugger=gt,ze.parse=ze;var ut=ze;return ut})},EJTS:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return O});var de=G("qVdP"),Z=G("jsC+"),M=G("lUTK"),V=G("BvKs"),I=G("sRBo"),B=G("kaz8"),K=G("oBTY"),W=G("7Kak"),L=G("9yH6"),P=G("tJVT"),b=G("q1tI"),p=G.n(b),_=G("9Bee"),h=G("+vTd"),r=G.n(h),d=G("xKgJ"),l=G("Is5a"),a=G.n(l),u=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],c=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],R=function(A){var w,m=A.data,v=A.selectIds,s=A.onSelectCheckBox,o=s===void 0?function(){}:s,E=A.showCheckbox,g=E===void 0?!0:E,C=Object(b.useState)(!1),N=Object(P.a)(C,2),U=N[0],j=N[1],H=function(){if(m.item_type==="JUDGMENT")return p.a.createElement("div",{className:r.a.judgmentContent},m.choices.map(function(ge,fe){return p.a.createElement(L.a,{key:fe,disabled:!0},ge.choice_text)}));if(m.item_type==="PROGRAM"){var q;return p.a.createElement("div",{className:r.a.programContent},p.a.createElement(_.a,{value:(q=m.program_attr)===null||q===void 0?void 0:q.description}))}if(m.item_type==="COMBINATION"){var ie;return p.a.createElement("div",{className:r.a.combinationContent},m==null||((ie=m.sub_item_banks)===null||ie===void 0)?void 0:ie.map(function(ge,fe){var ue,he="(\u9898\u76EE".concat(fe+1,"-\u5355\u9009\u9898) ");return p.a.createElement(b.Fragment,null,p.a.createElement("div",{style:{marginTop:10,marginBottom:10}},p.a.createElement(_.a,{value:he+ge.name})),ge.choices.map(function(_e,le){return p.a.createElement("div",{key:le,className:r.a.otherContentItem},p.a.createElement("p",null,u[le]),p.a.createElement(_.a,{className:r.a.otehrContentHtml,value:_e.choice_text}))}),p.a.createElement("div",{className:r.a.con},p.a.createElement("b",{className:"c-grey-333 font14"}," \u7B54\u6848\uFF1A",c==null?void 0:c[ge==null||((ue=ge.choices)===null||ue===void 0)?void 0:ue.findIndex(function(_e){return _e==null?void 0:_e.is_answer})]," "),p.a.createElement("div",null,p.a.createElement("span",null,"\u89E3\u6790\uFF1A"),p.a.createElement(_.a,{className:r.a.parseAnswerHtml,value:ge.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return p.a.createElement("div",{className:r.a.otherContent},m.choices.map(function(ge,fe){return p.a.createElement("div",{key:fe,className:r.a.otherContentItem},p.a.createElement("p",null,u[fe]),p.a.createElement(_.a,{className:r.a.otehrContentHtml,value:ge.choice_text}))}))},y=function(){var q;return p.a.createElement("div",null,(q=m.standard_answer)===null||q===void 0?void 0:q.map(function(ie,ge){return p.a.createElement(_.a,{key:ge,className:r.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(ie.position,"\uFF09\uFF1A").concat(ie.answer_text.join("\u3001"))})}))},x=function(){var q,ie,ge,fe={SUBJECTIVE:(q=m.answer_texts)===null||q===void 0?void 0:q[0],JUDGMENT:(ie=m.choices)===null||ie===void 0||((ge=ie.find(function(Fe){return Fe.is_answer}))===null||ge===void 0)?void 0:ge.choice_text},ue=m.choices.map(function(Fe){return Fe.is_answer}).findIndex(function(Fe){return Fe}),he=ue>-1?c[ue]:"",_e="";m.choices.map(function(Fe,Ke){Fe.is_answer&&(_e+=c[Ke])});var le=fe[m.item_type],ne={SINGLE:p.a.createElement(_.a,{className:r.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(he||"\u65E0")}),MULTIPLE:p.a.createElement(_.a,{className:r.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(_e||"\u65E0")}),COMPLETION:y()},Te=p.a.createElement(_.a,{className:r.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(le||"\u65E0")});return ne[m.item_type]||Te},F=function(q){var ie=Object(K.a)(v);q.target.checked?ie.push(m.id):ie=ie.filter(function(ge){return ge!==m.id}),o(ie)};return p.a.createElement("div",{className:r.a.itemWrap},p.a.createElement("div",{className:r.a.list},g&&p.a.createElement(B.a,{className:"mr10",onChange:F,checked:v.includes(m.id)}),p.a.createElement("div",{className:r.a.title},p.a.createElement(_.a,{key:1,showLines:1,showTextOnly:!0,className:r.a.topicTitleContent,value:m.name})),p.a.createElement("div",{className:r.a.line},p.a.createElement("b",{className:r.a.b1}),p.a.createElement("b",{className:r.a.b2})),p.a.createElement("div",{onClick:function(){return j(!U)},className:r.a.tr},U?"\u6536\u8D77":"\u5C55\u5F00",p.a.createElement("i",{style:{transform:U?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),p.a.createElement("aside",{style:U?{display:"block"}:{display:"none"},className:r.a.itemDetail},p.a.createElement("div",{style:{marginBottom:44}},p.a.createElement(_.a,{key:2,className:r.a.topicTitleContent,value:m.name}),p.a.createElement("div",{className:"".concat(r.a.row," mt15")},H()),p.a.createElement("div",{className:r.a.row},p.a.createElement("div",{className:r.a.updateTimeRow},p.a.createElement("div",{className:r.a.updateTimeWrap},m.item_type==="PROGRAM"&&p.a.createElement("p",{className:r.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(w=m.program_attr)===null||w===void 0?void 0:w.language))))),m.item_type!=="PROGRAM"&&m.item_type!=="COMBINATION"&&p.a.createElement("div",{className:r.a.answerWrapper},p.a.createElement("img",{src:a.a,alt:"",className:r.a.decoration}),p.a.createElement("div",{className:r.a.answer},x()),p.a.createElement("div",{className:r.a.parse},p.a.createElement("div",{className:r.a.parseText},"\u89E3\u6790\uFF1A"),p.a.createElement("div",{className:r.a.parseAnswer},m.analysis?p.a.createElement(_.a,{className:r.a.parseAnswerHtml,value:m.analysis}):"\u6682\u65E0\u89E3\u6790")))))},O=function(A){var w,m,v,s,o,E,g,C,N,U,j,H,y,x,F,Q,q=A.isProblemset,ie=A.data,ge=A.user,fe=A.activeTabsKey,ue=A.onPublicReview,he=ue===void 0?function(){}:ue,_e=A.onStartExperience,le=_e===void 0?function(){}:_e,ne=A.onSetPrivate,Te=ne===void 0?function(){}:ne,Fe=A.onCorrection,Ke=Fe===void 0?function(){}:Fe,Ue=A.onCollect,He=Ue===void 0?function(){}:Ue,Ne=A.onSetPublic,Be=Ne===void 0?function(){}:Ne,Je=A.onDelete,tt=Je===void 0?function(){}:Je,it=A.onCancel,rt=it===void 0?function(){}:it,qe=A.onSelect,gt=qe===void 0?function(){}:qe,pt=A.onMoveTo,vt=pt===void 0?function(){}:pt,at=A.onSetShare,Rt=at===void 0?function(){}:at,xt=A.onCancelShare,Tt=xt===void 0?function(){}:xt,Ye=A.onPublish,Mt=Ye===void 0?function(){}:Ye,St=A.onCancelPublish,ze=St===void 0?function(){}:St,ut=ie.item_type==="PROGRAM"?"/problems/".concat((w=ie.program_attr)===null||w===void 0?void 0:w.identifier,"/edit"):"/problemset/edit/".concat(ie.id),be=fe==="0"&&!ie.public&&!ie.apply&&(ie.item_type==="PROGRAM"&&((m=ie.program_attr)===null||m===void 0?void 0:m.status)!==0||ie.item_type!=="PROGRAM"),xe=p.a.createElement(V.a,{forceSubMenuRender:!0,className:r.a.menu},fe==="0"&&!ie.public&&p.a.createElement(V.a.Item,{key:"-1"},p.a.createElement("a",{className:r.a.actionLink,target:"_blank",href:ut},"\u7F16\u8F91")),(fe==="0"||fe==="3")&&ie.item_type==="PROGRAM"&&((v=ie.program_attr)===null||v===void 0?void 0:v.status)!==0&&!ie.public&&((s=ie.author)===null||s===void 0?void 0:s.login)===((o=ge.userInfo)===null||o===void 0?void 0:o.login)&&p.a.createElement(V.a.Item,{key:"0"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){var Ee;return ze(ie==null||((Ee=ie.program_attr)===null||Ee===void 0)?void 0:Ee.identifier)}},"\u64A4\u9500\u53D1\u5E03")),fe==="0"&&p.a.createElement(V.a.Item,{key:"1"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return vt(ie.id)}},"\u79FB\u52A8\u5230")),fe==="0"&&!(ie!=null&&ie.is_share)&&p.a.createElement(V.a.Item,{key:"3"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Rt(ie.id)}},"\u5171\u4EAB")),(fe==="0"&&(ie==null?void 0:ie.is_share)||fe==="3"&&((E=ie.author)===null||E===void 0?void 0:E.login)===((g=ge.userInfo)===null||g===void 0?void 0:g.login))&&p.a.createElement(V.a.Item,{key:"3"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Tt(ie.id)}},"\u64A4\u9500\u5171\u4EAB")),be&&p.a.createElement(V.a.Item,{key:"4"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Be(ie.id)}},"\u516C\u5F00")),fe==="0"&&!ie.public&&ie.apply&&(ie.item_type==="PROGRAM"&&ie.program_attr.status!==0||ie.item_type!=="PROGRAM")&&p.a.createElement(V.a.Item,{key:"5"},p.a.createElement("a",{className:r.a.reviewFlag,onClick:he},"\u5BA1\u6838\u4E2D")),(fe==="0"||fe==="1")&&ie.public&&((C=ie.author)===null||C===void 0?void 0:C.login)===((N=ge.userInfo)===null||N===void 0?void 0:N.login)&&p.a.createElement(V.a.Item,{key:"6"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Te(ie.id)}},"\u64A4\u9500\u516C\u5F00")),fe==="2"&&p.a.createElement(V.a.Item,{key:"7"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return He(ie.id,ie.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(fe==="0"||fe==="3")&&ie.item_type==="PROGRAM"&&((U=ie.program_attr)===null||U===void 0?void 0:U.status)===0&&!ie.public&&((j=ie.author)===null||j===void 0?void 0:j.login)===((H=ge.userInfo)===null||H===void 0?void 0:H.login)&&p.a.createElement(V.a.Item,{key:"8"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){var Ee;return Mt(ie==null||((Ee=ie.program_attr)===null||Ee===void 0)?void 0:Ee.identifier)}},"\u53D1\u5E03")),(fe==="1"||fe==="3")&&!Object(d.o)()&&!Object(d.m)()&&((y=ie.author)===null||y===void 0?void 0:y.login)!==((x=ge.userInfo)===null||x===void 0?void 0:x.login)&&p.a.createElement(V.a.Item,{key:"9"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return He(ie.id,ie.is_collected)}},ie.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),fe!=="0"&&!Object(d.o)()&&!Object(d.m)()&&p.a.createElement(V.a.Item,{key:"10"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Ke(ie.id)}},"\u7EA0\u9519")),(fe==="0"&&!ie.public||fe==="1"&&Object(d.o)()&&((F=ie.author)===null||F===void 0?void 0:F.login)!==((Q=ge.userInfo)===null||Q===void 0?void 0:Q.login))&&p.a.createElement(V.a.Item,{key:"11"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return tt(ie.id)}},"\u5220\u9664"))),pe=p.a.createElement(V.a,{forceSubMenuRender:!0,className:r.a.menu},p.a.createElement(V.a.Item,{key:"10"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Ke(ie.id)}},"\u7EA0\u9519"))),se=fe!=="0"&&!Object(d.o)()&&!Object(d.m)();return p.a.createElement(p.a.Fragment,null,q?p.a.createElement(p.a.Fragment,null,ie.item_type!=="SUBJECTIVE"&&ie.item_type!=="COMBINATION"&&p.a.createElement("span",{className:r.a.textBtn,style:{cursor:"pointer"},onClick:function(){return le(ie)}},"\u4F53\u9A8C"),p.a.createElement(Z.a,{overlay:xe},p.a.createElement("span",{style:{cursor:"default"},onClick:function(Ee){return Ee.preventDefault()}},p.a.createElement("span",{className:r.a.textBtn},"\u66F4\u591A")))):se?p.a.createElement(Z.a,{className:"ml40",overlay:pe},p.a.createElement("span",{style:{cursor:"default"},onClick:function(Ee){return Ee.preventDefault()}},p.a.createElement("span",null,"\u66F4\u591A"))):p.a.createElement("span",null))};Xe.b=R},ELLl:function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){var Z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=de.Pos;de.defineOption("autoCloseBrackets",!1,function(r,d,l){l&&l!=de.Init&&(r.removeKeyMap(I),r.state.closeBrackets=null),d&&(B(V(d,"pairs")),r.state.closeBrackets=d,r.addKeyMap(I))});function V(r,d){return d=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[d]!=null?r[d]:Z[d]}var I={Backspace:L,Enter:P};function B(r){for(var d=0;d<r.length;d++){var l=r.charAt(d),a="'"+l+"'";I[a]||(I[a]=K(l))}}B(Z.pairs+"`");function K(r){return function(d){return p(d,r)}}function W(r){var d=r.state.closeBrackets;if(!d||d.override)return d;var l=r.getModeAt(r.getCursor());return l.closeBrackets||d}function L(r){var d=W(r);if(!d||r.getOption("disableInput"))return de.Pass;for(var l=V(d,"pairs"),a=r.listSelections(),u=0;u<a.length;u++){if(!a[u].empty())return de.Pass;var c=_(r,a[u].head);if(!c||l.indexOf(c)%2!=0)return de.Pass}for(var u=a.length-1;u>=0;u--){var R=a[u].head;r.replaceRange("",M(R.line,R.ch-1),M(R.line,R.ch+1),"+delete")}}function P(r){var d=W(r),l=d&&V(d,"explode");if(!l||r.getOption("disableInput"))return de.Pass;for(var a=r.listSelections(),u=0;u<a.length;u++){if(!a[u].empty())return de.Pass;var c=_(r,a[u].head);if(!c||l.indexOf(c)%2!=0)return de.Pass}r.operation(function(){var R=r.lineSeparator()||`
`;r.replaceSelection(R+R,null),r.execCommand("goCharLeft"),a=r.listSelections();for(var O=0;O<a.length;O++){var T=a[O].head.line;r.indentLine(T,null,!0),r.indentLine(T+1,null,!0)}})}function b(r){var d=de.cmpPos(r.anchor,r.head)>0;return{anchor:new M(r.anchor.line,r.anchor.ch+(d?-1:1)),head:new M(r.head.line,r.head.ch+(d?1:-1))}}function p(r,d){var l=W(r);if(!l||r.getOption("disableInput"))return de.Pass;var a=V(l,"pairs"),u=a.indexOf(d);if(u==-1)return de.Pass;for(var c=V(l,"closeBefore"),R=V(l,"triples"),O=a.charAt(u+1)==d,T=r.listSelections(),A=u%2==0,w,m=0;m<T.length;m++){var v=T[m],s=v.head,o,E=r.getRange(s,M(s.line,s.ch+1));if(A&&!v.empty())o="surround";else if((O||!A)&&E==d)O&&h(r,s)?o="both":R.indexOf(d)>=0&&r.getRange(s,M(s.line,s.ch+3))==d+d+d?o="skipThree":o="skip";else if(O&&s.ch>1&&R.indexOf(d)>=0&&r.getRange(M(s.line,s.ch-2),s)==d+d){if(s.ch>2&&/\bstring/.test(r.getTokenTypeAt(M(s.line,s.ch-2))))return de.Pass;o="addFour"}else if(O){var g=s.ch==0?" ":r.getRange(M(s.line,s.ch-1),s);if(!de.isWordChar(E)&&g!=d&&!de.isWordChar(g))o="both";else return de.Pass}else if(A&&(E.length===0||/\s/.test(E)||c.indexOf(E)>-1))o="both";else return de.Pass;if(!w)w=o;else if(w!=o)return de.Pass}var C=u%2?a.charAt(u-1):d,N=u%2?d:a.charAt(u+1);r.operation(function(){if(w=="skip")r.execCommand("goCharRight");else if(w=="skipThree")for(var U=0;U<3;U++)r.execCommand("goCharRight");else if(w=="surround"){for(var j=r.getSelections(),U=0;U<j.length;U++)j[U]=C+j[U]+N;r.replaceSelections(j,"around"),j=r.listSelections().slice();for(var U=0;U<j.length;U++)j[U]=b(j[U]);r.setSelections(j)}else w=="both"?(r.replaceSelection(C+N,null),r.triggerElectric(C+N),r.execCommand("goCharLeft")):w=="addFour"&&(r.replaceSelection(C+C+C+C,"before"),r.execCommand("goCharRight"))})}function _(r,d){var l=r.getRange(M(d.line,d.ch-1),M(d.line,d.ch+1));return l.length==2?l:null}function h(r,d){var l=r.getTokenAt(M(d.line,d.ch+1));return/\bstring/.test(l.type)&&l.start==d.ch&&(d.ch==0||!/\bstring/.test(r.getTokenTypeAt(d)))}})},FOrL:function(ft,Xe,G){ft.exports=G.p+"static/nodata.a6b3f948.png"},HmJG:function(ft,Xe,G){},IPdS:function(ft,Xe,G){ft.exports={drawerWrap:"drawerWrap___nRvfD",title:"title___e_1lX",problemset:"problemset___1u9oP",content:"content___1WwQ5",delete:"delete___3Q7nc",deleteIcon:"deleteIcon___ObOyh",previewWrap:"previewWrap___25lTY",preview:"preview___3uiyE"}},Is5a:function(ft,Xe){ft.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(ft,Xe){ft.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JUtD:function(ft,Xe,G){"use strict";G.r(Xe);var de=G("14J3"),Z=G("BMrR"),M=G("DjyN"),V=G("NUBc"),I=G("qVdP"),B=G("jsC+"),K=G("T2oS"),W=G("W9HT"),L=G("+L6B"),P=G("2/Rp"),b=G("sPJy"),p=G("bE4q"),_=G("5Dmo"),h=G("3S7+"),r=G("lUTK"),d=G("BvKs"),l=G("sRBo"),a=G("kaz8"),u=G("miYZ"),c=G("tsqr"),R=G("7Kak"),O=G("9yH6"),T=G("2qtc"),A=G("kLXV"),w=G("oBTY"),m=G("k1fw"),v=G("9og8"),s=G("tJVT"),o=G("PpiC"),E=G("5NDa"),g=G("5rEg"),C=G("Znn+"),N=G("ZTPi"),U=G("WmNS"),j=G.n(U),H=G("q1tI"),y=G.n(H),x=G("9kvl"),F=G("55Ip"),Q=G("iris"),q=G("jcZT"),ie=G("BdwD"),ge=G("iNYN"),fe=G.n(ge),ue=function(dt){var kt=dt.problemset,Lt=dt.globalSetting,Kt=dt.loading,sn=dt.dispatch,En=Object(o.a)(dt,["problemset","globalSetting","loading","dispatch"]);return y.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:kt.actionTabs.key==="Problemset-PublicReview",title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",cancelText:"",width:"442px",onOk:function(){sn({type:"problemset/setActionTabs",payload:{}})},onCancel:function(){sn({type:"problemset/setActionTabs",payload:{}})}},y.a.createElement("div",{className:fe.a.modalContent},"\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"),y.a.createElement("div",{className:fe.a.modalContent},"\u6211\u4EEC\u5C06\u57281-2\u4E2A\u5DE5\u4F5C\u65E5\u5185\u5B8C\u6210\u5BA1\u6838"))},he=Object(x.a)(function(Zt){var dt=Zt.problemset,kt=Zt.loading,Lt=Zt.globalSetting;return{problemset:dt,globalSetting:Lt,loading:kt.effects}})(ue),_e=G("xlxt"),le=G.n(_e),ne=G("P/tu"),Te=G("wd/R"),Fe=G.n(Te),Ke=function(dt){var kt=dt.problemset,Lt=dt.dispatch,Kt=Object(H.useState)([]),sn=Object(s.a)(Kt,2),En=sn[0],wn=sn[1],hn=function(){Lt({type:"problemset/setActionTabs",payload:{}})};Object(H.useEffect)(function(){if(kt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898"){var un,Sn;wn([(un=kt.actionTabs)===null||un===void 0||((Sn=un.params)===null||Sn===void 0)?void 0:Sn.group_id])}},[kt.actionTabs.key]);var Ln=function(){if(En.length===0){c.b.warn("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");return}console.log(En[0],22),zn({},"/api/item_banks/export.xlsx?group_id=".concat(En[0]),function(Sn,di){var Nn;if(((Nn=Sn.target.response)===null||Nn===void 0?void 0:Nn.type)==="application/json"){var zt=new FileReader;zt.readAsText(Sn.target.response,"utf-8"),zt.addEventListener("loadend",function(){var jt=JSON.parse(zt.result);c.b.warn((jt==null?void 0:jt.message)||"\u4E0B\u8F7D\u51FA\u9519, \u8BF7\u8054\u7CFB\u7BA1\u7406\u5458")});return}var An=new Blob([Sn.target.response],{type:"application/vnd.ms-excel;charset=utf-8"}),si="item_bank_template_".concat(Fe()().format("YYYY-MM-DD HH:mm:ss"),".xlsx");if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(An,si);else{var Un=URL.createObjectURL(An),Xt=document.createElement("a");Xt.href=Un,Xt.setAttribute("download",si),document.body.appendChild(Xt),Xt.click(),window.URL.revokeObjectURL(Xt.href)}hn()})},zn=function(Sn,di,Nn,zt){var An=di,si=new window.XMLHttpRequest;return si.withCredentials=!0,si.addEventListener("load",function(Un){Nn(Un,si)},!1),si.addEventListener("error",function(Un){zt&&zt(Un)},!1),si.responseType="blob",si.open("GET",An),si.send(null),si};return y.a.createElement(A.a,{centered:!0,title:"\u5BFC\u51FA\u8BD5\u9898",visible:kt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898",width:718,destroyOnClose:!0,wrapClassName:le.a.customModal,onCancel:hn,onOk:Ln},y.a.createElement("aside",{className:le.a.exportModal},y.a.createElement(ne.a,{value:En,onChange:function(Sn){return wn(Sn)}})))},Ue=Object(x.a)(function(Zt){var dt=Zt.problemset;return{problemset:dt}})(Ke),He=G("i8i3"),Ne=G.n(He),Be=G("WCUW"),Je=G("Ty5D"),tt=function(dt){var kt,Lt,Kt=dt.problemset,sn=dt.dispatch,En=dt.onOk,wn=Object(Je.i)(),hn=Object(H.useState)([]),Ln=Object(s.a)(hn,2),zn=Ln[0],un=Ln[1],Sn=Object(H.useState)(1),di=Object(s.a)(Sn,2),Nn=di[0],zt=di[1],An=Object(H.useState)([]),si=Object(s.a)(An,2),Un=si[0],Xt=si[1],jt=Object(H.useState)([]),pn=Object(s.a)(jt,2),Ct=pn[0],Nt=pn[1],Dt=Object(H.useState)(!0),Pe=Object(s.a)(Dt,2),Yt=Pe[0],xn=Pe[1],pi=Object(H.useState)(!1),On=Object(s.a)(pi,2),tr=On[0],nr=On[1],Fi=Object(H.useState)(!1),Bn=Object(s.a)(Fi,2),Ft=Bn[0],yi=Bn[1];Object(H.useEffect)(function(){if(Kt.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898"){var qt,$t;li(),Xt([(qt=Kt.actionTabs)===null||qt===void 0||(($t=qt.params)===null||$t===void 0)?void 0:$t.group_id])}},[Kt.actionTabs.key]);var li=function(){var qt=Object(v.a)(j.a.mark(function $t(){var dn,Gn,Mn;return j.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return xn(!0),mi.next=3,Object(Be.y)({type:0,page:1,per_page:10,order_by:"new"});case 3:dn=mi.sent,dn!=null&&dn.item_banks_group&&(Gn={id:-1,item_banks_count:(dn==null?void 0:dn.no_group_count)||0,name:{name:"\u672A\u52A0\u5165\u5206\u7EC4"}},Mn=[Gn].concat((dn==null?void 0:dn.item_banks_group)||[]),un(Mn)),xn(!1);case 6:case"end":return mi.stop()}},$t)}));return function(){return qt.apply(this,arguments)}}(),$n=function(){sn({type:"problemset/setActionTabs",payload:{}})},ir=function(){var qt=Object(v.a)(j.a.mark(function $t(){var dn;return j.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(!(Un.length===0)){Mn.next=3;break}return c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u7684\u6587\u4EF6\u5939"),Mn.abrupt("return");case 3:if(!(Nn===1)){Mn.next=6;break}return zt(2),Mn.abrupt("return");case 6:return nr(!0),Mn.next=9,Object(Be.l)({item_banks_group_ids:Un,clazz:"ItemBank",group_ids:Ct});case 9:dn=Mn.sent,(dn==null?void 0:dn.status)===0&&(En(),$n()),nr(!1);case 12:case"end":return Mn.stop()}},$t)}));return function(){return qt.apply(this,arguments)}}(),Qt=function($t){Xt($t),yi($t.length===zn.length)};return y.a.createElement(A.a,{centered:!0,afterClose:function(){Nt([]),zt(1),yi(!1),un([])},title:"\u5171\u4EAB\u8BD5\u9898".concat(Nn,"/2"),visible:Kt.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898",footer:null,width:718,destroyOnClose:!0,wrapClassName:Ne.a.customModal,onCancel:$n},y.a.createElement("aside",{className:Ne.a.shareModal},y.a.createElement(W.a,{spinning:Yt},y.a.createElement("div",{className:Ne.a.content},Nn===1&&y.a.createElement("div",{className:Ne.a.group},y.a.createElement(ne.a,{value:Un,onChange:function($t){return Xt($t)}})),Nn===2&&y.a.createElement("div",{className:Ne.a.teachGroup},y.a.createElement("p",null,"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),y.a.createElement(a.a.Group,{value:Ct,onChange:function($t){return Nt($t)}},Kt==null||((kt=Kt.teachGroupData)===null||kt===void 0||((Lt=kt.groups)===null||Lt===void 0))?void 0:Lt.map(function(qt){return y.a.createElement(a.a,{key:qt.group_id,value:qt.group_id},qt==null?void 0:qt.name)})))),y.a.createElement("div",{className:Ne.a.footer},y.a.createElement(P.a,{onClick:$n},"\u53D6\u6D88"),y.a.createElement(P.a,{loading:tr,onClick:ir,type:"primary"},Nn===1?"\u4E0B\u4E00\u6B65":"\u786E\u8BA4\u5171\u4EAB")))))},it=Object(x.a)(function(Zt){var dt=Zt.problemset;return{problemset:dt}})(tt),rt=function(dt){var kt=dt.problemset,Lt=dt.globalSetting,Kt=dt.loading,sn=dt.dispatch,En=dt.onReloadData,wn=En===void 0?function(){}:En,hn=Object(o.a)(dt,["problemset","globalSetting","loading","dispatch","onReloadData"]),Ln=Object(H.useRef)(!1),zn=Object(H.useState)(!1),un=Object(s.a)(zn,2),Sn=un[0],di=un[1];Object(H.useEffect)(function(){kt.actionTabs.key==="Problemset-SetPrivate"?window.localStorage.getItem("problemset-set-private-hint-flag")==="1"?Nn():di(!0):di(!1)},[kt.actionTabs.key]);var Nn=function(){var zt=Object(v.a)(j.a.mark(function An(){var si;return j.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Ln.current&&window.localStorage.setItem("problemset-set-private-hint-flag","1"),Xt.next=3,sn({type:"problemset/setPrivate",payload:kt.actionTabs.params});case 3:si=Xt.sent,sn({type:"problemset/setActionTabs",payload:{}}),Ln.current=!1,si.status===0&&wn();case 7:case"end":return Xt.stop()}},An)}));return function(){return zt.apply(this,arguments)}}();return y.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Sn,title:"\u64A4\u9500\u516C\u5F00\u544A\u77E5",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Kt["problemset/setPrivate"],width:"442px",onOk:Nn,onCancel:function(){sn({type:"problemset/setActionTabs",payload:{}}),Ln.current=!1}},y.a.createElement("div",{className:fe.a.modalContentLeft},"\u672C\u9898\u5DF2\u516C\u5F00\uFF0C\u64A4\u9500\u516C\u5F00\u53EF\u80FD\u5BFC\u81F4\u90E8\u5206\u7528\u6237\u5BF9\u672C\u9898\u7684\u4F7F\u7528\u53D7\u635F\u3002"),y.a.createElement("div",{className:fe.a.modalContentLeft},"\u786E\u8BA4\u64A4\u9500\u516C\u5F00\u56DE\u5230\u81EA\u6709\u72B6\u6001\u5417\uFF1F"),y.a.createElement("div",null,y.a.createElement(a.a,{className:"mt10",defaultChecked:!1,onChange:function(An){return Ln.current=An.target.checked}},"\u4E0D\u518D\u63D0\u793A")))},qe=Object(x.a)(function(Zt){var dt=Zt.problemset,kt=Zt.loading,Lt=Zt.globalSetting;return{problemset:dt,globalSetting:Lt,loading:kt.effects}})(rt),gt=function(dt){var kt=dt.problemset,Lt=dt.globalSetting,Kt=dt.loading,sn=dt.dispatch,En=dt.onReloadData,wn=En===void 0?function(){}:En,hn=Object(o.a)(dt,["problemset","globalSetting","loading","dispatch","onReloadData"]),Ln=function(){var zn=Object(v.a)(j.a.mark(function un(){var Sn;return j.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,sn({type:"problemset/handleDelete",payload:kt.actionTabs.params});case 2:Sn=Nn.sent,sn({type:"problemset/setActionTabs",payload:{}}),Sn.status===0&&wn();case 5:case"end":return Nn.stop()}},un)}));return function(){return zn.apply(this,arguments)}}();return y.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:kt.actionTabs.key==="Problemset-Delete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Kt["problemset/handleDelete"],width:"442px",onOk:Ln,onCancel:function(){sn({type:"problemset/setActionTabs",payload:{}})}},y.a.createElement("div",{className:fe.a.modalContent},"\u786E\u8BA4\u5220\u9664\u540E\uFF0C\u65E0\u6CD5\u64A4\u9500"),y.a.createElement("div",{className:fe.a.modalContent},"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"))},pt=Object(x.a)(function(Zt){var dt=Zt.problemset,kt=Zt.loading,Lt=Zt.globalSetting;return{problemset:dt,globalSetting:Lt,loading:kt.effects}})(gt),vt=G("LvDl"),at=G("9Bee"),Rt=function(dt){var kt,Lt=dt.problemset,Kt=dt.dispatch,sn=Object(H.useState)({}),En=Object(s.a)(sn,2),wn=En[0],hn=En[1],Ln=Object(H.useState)([]),zn=Object(s.a)(Ln,2),un=zn[0],Sn=zn[1],di=Object(H.useState)(!1),Nn=Object(s.a)(di,2),zt=Nn[0],An=Nn[1],si=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(H.useEffect)(function(){var pn;if((Lt==null||((pn=Lt.actionTabs)===null||pn===void 0)?void 0:pn.key)==="SINGLE"){var Ct,Nt=Object(vt.cloneDeep)(Lt==null||((Ct=Lt.actionTabs)===null||Ct===void 0)?void 0:Ct.params);hn(Nt),Sn(Nt.choices)}},[Lt==null||((kt=Lt.actionTabs)===null||kt===void 0)?void 0:kt.key]);var Un=function(){var pn=Object(v.a)(j.a.mark(function Ct(){var Nt,Dt;return j.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(un.some(function(xn){return xn==null?void 0:xn.checked})){Yt.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Yt.abrupt("return");case 3:zt&&(Dt=Object(vt.cloneDeep)(Lt==null||((Nt=Lt.actionTabs)===null||Nt===void 0)?void 0:Nt.params),Sn(Dt.choices)),An(!zt);case 5:case"end":return Yt.stop()}},Ct)}));return function(){return pn.apply(this,arguments)}}(),Xt=function(Ct,Nt){console.log(Ct.target.checked);var Dt=un.map(function(Pe,Yt){return Object(m.a)(Object(m.a)({},Pe),{},{checked:Yt===Nt?Ct.target.checked:!1})});Sn(Dt)},jt=function(){hn({}),Sn([]),An(!1),Kt({type:"problemset/setActionTabs",payload:{}})};return y.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Lt.actionTabs.key==="SINGLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:zt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Un,onCancel:jt},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),y.a.createElement(at.a,{value:wn==null?void 0:wn.name}),un==null?void 0:un.map(function(pn,Ct){var Nt=pn.is_answer,Dt=pn.checked,Pe=pn.choice_text,Yt="";return zt&&Nt&&(Yt=fe.a.green),zt&&!Nt&&Dt&&(Yt=fe.a.red),y.a.createElement("div",{key:Ct,style:{pointerEvents:zt?"none":"auto"},className:"".concat(fe.a.row," ").concat(Yt)},y.a.createElement(O.a,{onChange:function(pi){return Xt(pi,Ct)},checked:Dt}),y.a.createElement("span",null,si[Ct],".\xA0"),y.a.createElement(at.a,{className:fe.a.html,value:Pe}),zt&&Nt&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),zt&&!Nt&&Dt&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),zt&&y.a.createElement(H.Fragment,null,y.a.createElement("div",{className:fe.a.line}),y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),si[un.findIndex(function(pn){return pn.is_answer})]),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(wn==null?void 0:wn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},xt=Object(x.a)(function(Zt){var dt=Zt.problemset;return{problemset:dt}})(Rt),Tt=function(dt){var kt,Lt=dt.problemset,Kt=dt.dispatch,sn=Object(H.useState)({}),En=Object(s.a)(sn,2),wn=En[0],hn=En[1],Ln=Object(H.useState)([]),zn=Object(s.a)(Ln,2),un=zn[0],Sn=zn[1],di=Object(H.useState)(!1),Nn=Object(s.a)(di,2),zt=Nn[0],An=Nn[1],si=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(H.useEffect)(function(){var Ct;if((Lt==null||((Ct=Lt.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="MULTIPLE"){var Nt,Dt=Object(vt.cloneDeep)(Lt==null||((Nt=Lt.actionTabs)===null||Nt===void 0)?void 0:Nt.params);hn(Dt),Sn(Dt.choices)}},[Lt==null||((kt=Lt.actionTabs)===null||kt===void 0)?void 0:kt.key]);var Un=function(){var Ct=Object(v.a)(j.a.mark(function Nt(){var Dt,Pe;return j.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:if(un.some(function(pi){return pi==null?void 0:pi.checked})){xn.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),xn.abrupt("return");case 3:zt&&(Pe=Object(vt.cloneDeep)(Lt==null||((Dt=Lt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),Sn(Pe.choices)),An(!zt);case 5:case"end":return xn.stop()}},Nt)}));return function(){return Ct.apply(this,arguments)}}(),Xt=function(Nt,Dt){console.log(Nt.target.checked);var Pe=un.map(function(Yt,xn){return Object(m.a)(Object(m.a)({},Yt),{},{checked:xn===Dt?Nt.target.checked:Yt.checked})});Sn(Pe)},jt=function(){hn({}),Sn([]),An(!1),Kt({type:"problemset/setActionTabs",payload:{}})},pn=function(){var Nt="";return un.forEach(function(Dt,Pe){Dt.is_answer&&(Nt=Nt+si[Pe])}),Nt};return y.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Lt.actionTabs.key==="MULTIPLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:zt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Un,onCancel:jt},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),y.a.createElement(at.a,{value:wn==null?void 0:wn.name}),un==null?void 0:un.map(function(Ct,Nt){var Dt=Ct.is_answer,Pe=Ct.checked,Yt=Ct.choice_text,xn="";return zt&&Dt&&(xn=fe.a.green),zt&&!Dt&&Pe&&(xn=fe.a.red),y.a.createElement("div",{key:Nt,style:{pointerEvents:zt?"none":"auto"},className:"".concat(fe.a.row," ").concat(xn)},y.a.createElement(a.a,{style:{padding:3},onChange:function(On){return Xt(On,Nt)},checked:Pe}),y.a.createElement("span",null,si[Nt],".\xA0"),y.a.createElement(at.a,{className:fe.a.html,value:Yt}),zt&&Dt&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),zt&&!Dt&&Pe&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),zt&&y.a.createElement(H.Fragment,null,y.a.createElement("div",{className:fe.a.line}),y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),pn()),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(wn==null?void 0:wn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Ye=Object(x.a)(function(Zt){var dt=Zt.problemset;return{problemset:dt}})(Tt),Mt=function(dt){var kt,Lt,Kt=dt.problemset,sn=dt.dispatch,En=Object(H.useState)({}),wn=Object(s.a)(En,2),hn=wn[0],Ln=wn[1],zn=Object(H.useState)([]),un=Object(s.a)(zn,2),Sn=un[0],di=un[1],Nn=Object(H.useState)(!1),zt=Object(s.a)(Nn,2),An=zt[0],si=zt[1],Un=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(H.useEffect)(function(){var Ct;if((Kt==null||((Ct=Kt.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="JUDGMENT"){var Nt,Dt=Object(vt.cloneDeep)(Kt==null||((Nt=Kt.actionTabs)===null||Nt===void 0)?void 0:Nt.params);Ln(Dt),di(Dt.choices)}},[Kt==null||((kt=Kt.actionTabs)===null||kt===void 0)?void 0:kt.key]);var Xt=function(){var Ct=Object(v.a)(j.a.mark(function Nt(){var Dt,Pe;return j.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:if(Sn.some(function(pi){return pi==null?void 0:pi.checked})){xn.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),xn.abrupt("return");case 3:An&&(Pe=Object(vt.cloneDeep)(Kt==null||((Dt=Kt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),di(Pe.choices)),si(!An);case 5:case"end":return xn.stop()}},Nt)}));return function(){return Ct.apply(this,arguments)}}(),jt=function(Nt,Dt){console.log(Nt.target.checked);var Pe=Sn.map(function(Yt,xn){return Object(m.a)(Object(m.a)({},Yt),{},{checked:xn===Dt?Nt.target.checked:!1})});di(Pe)},pn=function(){Ln({}),di([]),si(!1),sn({type:"problemset/setActionTabs",payload:{}})};return y.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Kt.actionTabs.key==="JUDGMENT",title:"\u8BD5\u9898\u4F53\u9A8C",okText:An?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Xt,onCancel:pn},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),y.a.createElement(at.a,{value:hn==null?void 0:hn.name}),Sn==null?void 0:Sn.map(function(Ct,Nt){var Dt=Ct.is_answer,Pe=Ct.checked,Yt=Ct.choice_text,xn="";return An&&Dt&&(xn=fe.a.green),An&&!Dt&&Pe&&(xn=fe.a.red),y.a.createElement("div",{key:Nt,style:{pointerEvents:An?"none":"auto"},className:"".concat(fe.a.row," ").concat(xn)},y.a.createElement(O.a,{onChange:function(On){return jt(On,Nt)},checked:Pe}),y.a.createElement(at.a,{className:fe.a.html,value:Yt}),An&&Dt&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),An&&!Dt&&Pe&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),An&&y.a.createElement(H.Fragment,null,y.a.createElement("div",{className:fe.a.line}),y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(Lt=Sn.find(function(Ct){return Ct.is_answer}))===null||Lt===void 0?void 0:Lt.choice_text),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(hn==null?void 0:hn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},St=Object(x.a)(function(Zt){var dt=Zt.problemset;return{problemset:dt}})(Mt),ze=function(dt){var kt,Lt,Kt=dt.problemset,sn=dt.dispatch,En=Object(H.useState)({}),wn=Object(s.a)(En,2),hn=wn[0],Ln=wn[1],zn=Object(H.useState)([]),un=Object(s.a)(zn,2),Sn=un[0],di=un[1],Nn=Object(H.useState)(!1),zt=Object(s.a)(Nn,2),An=zt[0],si=zt[1],Un=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(H.useEffect)(function(){var Ct;if((Kt==null||((Ct=Kt.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="COMPLETION"){var Nt,Dt,Pe=Object(vt.cloneDeep)(Kt==null||((Nt=Kt.actionTabs)===null||Nt===void 0)?void 0:Nt.params);Ln(Pe),di(Pe==null||((Dt=Pe.standard_answer)===null||Dt===void 0)?void 0:Dt.map(function(Yt){return{value:"",answer:(Yt==null?void 0:Yt.answer_text)||[]}}))}},[Kt==null||((kt=Kt.actionTabs)===null||kt===void 0)?void 0:kt.key]);var Xt=function(){var Ct=Object(v.a)(j.a.mark(function Nt(){var Dt,Pe,Yt;return j.a.wrap(function(pi){for(;;)switch(pi.prev=pi.next){case 0:if(!Sn.some(function(On){return(On==null?void 0:On.value)===""})){pi.next=3;break}return c.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),pi.abrupt("return");case 3:An&&(Yt=Object(vt.cloneDeep)(Kt==null||((Dt=Kt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),di(Yt==null||((Pe=Yt.standard_answer)===null||Pe===void 0)?void 0:Pe.map(function(On){return{value:"",answer:(On==null?void 0:On.answer_text)||[]}}))),si(!An);case 5:case"end":return pi.stop()}},Nt)}));return function(){return Ct.apply(this,arguments)}}(),jt=function(Nt,Dt){var Pe=Sn.map(function(Yt,xn){return Object(m.a)(Object(m.a)({},Yt),{},{value:xn===Dt?Nt.target.value:Yt.value})});di(Pe)},pn=function(){Ln({}),di([]),si(!1),sn({type:"problemset/setActionTabs",payload:{}})};return y.a.createElement(A.a,{centered:!0,destroyOnClose:!0,visible:Kt.actionTabs.key==="COMPLETION",title:"\u8BD5\u9898\u4F53\u9A8C",okText:An?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Xt,onCancel:pn},y.a.createElement("div",null,y.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u586B\u7A7A\u9898"),y.a.createElement(at.a,{value:hn==null?void 0:hn.name}),Sn==null?void 0:Sn.map(function(Ct,Nt){var Dt=Ct.value,Pe=Ct.answer,Yt="";return An&&Pe!==null&&Pe!==void 0&&Pe.includes(Dt)&&(Yt=fe.a.green),An&&!(Pe!=null&&Pe.includes(Dt))&&(Yt=fe.a.red),y.a.createElement("div",{key:Nt,style:{pointerEvents:An?"none":"auto",marginTop:10},className:"".concat(fe.a.row," ").concat(Yt)},y.a.createElement("div",{style:{minWidth:80}},"\u586B\u7A7A",Nt+1,"\u7B54\u6848:"),y.a.createElement(g.a.TextArea,{className:fe.a.textArea,style:{width:610,marginRight:10},onChange:function(pi){return jt(pi,Nt)},value:Dt}),An&&(Pe==null?void 0:Pe.includes(Dt))&&y.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),An&&!(Pe!=null&&Pe.includes(Dt))&&y.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),An&&y.a.createElement(H.Fragment,null,y.a.createElement("div",{className:fe.a.line}),hn==null||((Lt=hn.standard_answer)===null||Lt===void 0)?void 0:Lt.map(function(Ct,Nt){var Dt;return y.a.createElement("div",{className:"c-grey-333 mb5"},y.a.createElement("b",null,"\u586B\u7A7A",Nt+1,"\u7B54\u6848:\xA0"),(Ct==null||((Dt=Ct.answer_text)===null||Dt===void 0)?void 0:Dt.join("\u3001"))||"")}),y.a.createElement("div",{className:"c-grey-333 mb10"},y.a.createElement("b",null,"\u89E3\u6790:\xA0"),(hn==null?void 0:hn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},ut=Object(x.a)(function(Zt){var dt=Zt.problemset;return{problemset:dt}})(ze),be=G("SAoR"),xe=G("tK3L"),pe=G.n(xe),se=G("bbsP"),ce=G("/wGt"),Ee=G("IPdS"),Ae=G.n(Ee),De=[],$e=function(dt){De.forEach(function(kt){if(dt.target===kt.element||lt.isParent(dt.target,kt.element))return;kt.callbacks.forEach(function(Lt){return Lt()})})};window.document.body?window.document.body.addEventListener("click",$e):window.addEventListener("DOMContentLoaded",function(){window.document.body.addEventListener("click",$e)});var lt={isParent:function(dt,kt){for(var Lt=dt;Lt&&Lt.tagName&&Lt.tagName.toLowerCase()!=="body";){if(Lt===kt)return!0;Lt=Lt.parentNode}return!1},init:function(dt,kt){var Lt=De.filter(function(Kt){return Kt.element===dt});return Lt.length>0?Lt[0].callbacks.push(kt):De.push({element:dt,callbacks:[kt]}),{clear:function(){De=De.filter(function(sn){return sn.element!==dt})}}}},Bt=lt,tn=[{stateName:"single_questions_count",type:"SINGLE",typeName:"\u5355\u9009\u9898"},{stateName:"multiple_questions_count",type:"MULTIPLE",typeName:"\u591A\u9009\u9898"},{stateName:"judgement_questions_count",type:"JUDGMENT",typeName:"\u5224\u65AD\u9898"},{stateName:"completion_questions_count",type:"COMPLETION",typeName:"\u586B\u7A7A\u9898"},{stateName:"subjective_questions_count",type:"SUBJECTIVE",typeName:"\u7B80\u7B54\u9898"},{stateName:"program_questions_count",type:"PROGRAM",typeName:"\u7F16\u7A0B\u9898"},{stateName:"practical_questions_count",type:"PRACTICAL",typeName:"\u5B9E\u8BAD\u9898"},{stateName:"combination_questions_count",type:"COMBINATION",typeName:"\u7EC4\u5408\u9898"}],nn=function(dt){var kt=dt.visible,Lt=dt.basketData,Kt=dt.basketTotal,sn=dt.onClose,En=sn===void 0?function(){}:sn,wn=dt.onDelete,hn=wn===void 0?function(){}:wn,Ln=Object(H.useRef)(),zn=Object(H.useRef)();return Object(H.useEffect)(function(){return zn.current?(Kt>=0&&!Ln.current&&(Ln.current=Bt.init(zn.current,function(){En()})),function(){Ln.current&&Ln.current.clear()}):void 0},[zn.current]),y.a.createElement(ce.a,{className:Ae.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:kt,forceRender:!0,onClose:En},Kt>0?y.a.createElement("div",{style:{height:"100%"},ref:zn},y.a.createElement("div",{className:Ae.a.title},"\u8BD5\u9898\u7BEE"),tn.map(function(un){return Lt[un.stateName]>0&&y.a.createElement("div",{className:Ae.a.problemset,key:un.type},y.a.createElement("div",{className:Ae.a.content},un.typeName,"(",Lt[un.stateName],")"),y.a.createElement("div",{className:Ae.a.delete,onClick:function(){return hn(un.type)}},y.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(Ae.a.deleteIcon)})))}),y.a.createElement("div",{className:Ae.a.previewWrap},y.a.createElement("div",{className:Ae.a.preview,onClick:function(){return x.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):y.a.createElement("div",{ref:zn},y.a.createElement(ie.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},_n={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",COMBINATION:"\u7EC4\u5408\u9898"},yn=function(dt){var kt,Lt,Kt=dt.problemset,sn=dt.globalSetting,En=dt.loading,wn=dt.dispatch,hn=dt.onReloadData,Ln=hn===void 0?function(){}:hn,zn=dt.onReloadBasketData,un=zn===void 0?function(){}:zn,Sn=Object(o.a)(dt,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),di=function(){var Nn=Object(v.a)(j.a.mark(function zt(){var An;return j.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,wn({type:"problemset/basketDelete",payload:Kt.actionTabs.params});case 2:An=Un.sent,wn({type:"problemset/setActionTabs",payload:{}}),An.status===0&&(Ln(),un());case 5:case"end":return Un.stop()}},zt)}));return function(){return Nn.apply(this,arguments)}}();return y.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Kt.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:En["problemset/handleDelete"],width:"442px",onOk:di,onCancel:function(){wn({type:"problemset/setActionTabs",payload:{}})}},y.a.createElement("div",{className:fe.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",_n[(kt=Kt.actionTabs)===null||kt===void 0||((Lt=kt.params)===null||Lt===void 0)?void 0:Lt.type]))},Gt=Object(x.a)(function(Zt){var dt=Zt.problemset,kt=Zt.loading,Lt=Zt.globalSetting;return{problemset:dt,globalSetting:Lt,loading:kt.effects}})(yn),ii=G("A60/"),Dn=G.n(ii),Ci=function(dt){var kt=dt.count,Lt=dt.visibleBasket,Kt=dt.onToggleVisible,sn=Kt===void 0?function(){}:Kt;return y.a.createElement("div",{className:"".concat(Lt?Dn.a.right180:Dn.a.right20," ").concat(Dn.a.wrap)},y.a.createElement(h.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},y.a.createElement("div",{className:Dn.a.basket,onClick:sn},kt>0&&y.a.createElement("div",{className:Dn.a.count},kt),y.a.createElement("span",{className:Dn.a.iconWrap},y.a.createElement("i",{className:"".concat(Dn.a.icon," iconfont icon-shitilan")})),y.a.createElement("p",{className:Dn.a.name},"\u8BD5\u9898\u7BEE"))))},fi=G("EJTS"),In=G("LE3n"),Ri=G("1vsH"),Si=G("xKgJ"),Ot=G("/zsF"),bn=G("PArb"),Cn=G("jCWc"),kn=G("kPKH"),Ai=G("y8nQ"),Ui=G("Vl3Y"),dr=G("nSDg"),mn=G.n(dr),Jt=G("HBuW"),qi=G("NLgs"),hr=G("vkP9"),sr=g.a.Search,Fn={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},er={id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]},kr=function(dt){var kt,Lt,Kt,sn,En=dt.classroomList,wn=dt.loading,hn=dt.dispatch,Ln=dt.cb,zn=dt.shixunIds,un=zn===void 0?[]:zn,Sn=Object(Je.i)(),di=Object(Je.h)(),Nn=En.actionTabs,zt=Ui.a.useForm(),An=Object(s.a)(zt,1),si=An[0],Un=En.shixunLists,Xt=Object(H.useState)([]),jt=Object(s.a)(Xt,2),pn=jt[0],Ct=jt[1],Nt=Object(H.useState)([]),Dt=Object(s.a)(Nt,2),Pe=Dt[0],Yt=Dt[1],xn=Object(H.useState)({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null}),pi=Object(s.a)(xn,2),On=pi[0],tr=pi[1];Object(H.useEffect)(function(){En.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})},[En.actionTabs.key]),Object(H.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(H.useEffect)(function(){nr()},[Sn]);var nr=function(){var Ft=Object(v.a)(j.a.mark(function yi(){var li;return j.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:return ir.next=2,Object(Jt.pb)({});case 2:li=ir.sent,Yt((li==null?void 0:li.disciplines)||[]);case 4:case"end":return ir.stop()}},yi)}));return function(){return Ft.apply(this,arguments)}}(),Fi=function(yi,li,$n){On.tag_level=yi,On.sub_discipline_id=li,On.discipline_id=$n,tr(Object(m.a)({},On)),hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})},Bn=function(){hn({type:"classroomList/setActionTabs",payload:{}}),tr({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null})};return En.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:y.a.createElement(ce.a,{placement:"bottom",height:"100%",closable:!0,onClose:Bn,visible:En.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:mn.a.drawer,footer:y.a.createElement("div",{className:"tc"},y.a.createElement(P.a,{size:"large",onClick:function(){Bn(),Ct([])},style:{marginRight:8}},"\u53D6\u6D88"),y.a.createElement(P.a,{size:"large",onClick:Object(v.a)(j.a.mark(function Ft(){var yi,li,$n;return j.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:yi=function($t){var dn=pn[$t];if(un.includes(dn)){var Gn,Mn;return c.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(Un==null||((Gn=Un.shixun_list)===null||Gn===void 0||((Mn=Gn.find(function(qn){return qn.id===dn}))===null||Mn===void 0))?void 0:Mn.title)),{v:void 0}}},li=0;case 2:if(!(li<(pn==null?void 0:pn.length))){Qt.next=9;break}if($n=yi(li),!(typeof $n=="object")){Qt.next=6;break}return Qt.abrupt("return",$n.v);case 6:li++,Qt.next=2;break;case 9:Bn(),Ln(pn),Ct([]);case 12:case"end":return Qt.stop()}},Ft)})),type:"primary"},"\u786E\u5B9A"))},y.a.createElement("section",{className:"tc"},y.a.createElement(hr.a,{onChange:function(yi){tr(Object(m.a)(Object(m.a)(Object(m.a)({},On),yi),{},{page:1})),hn({type:"classroomList/getShixunLists",payload:Object(m.a)(Object(m.a)(Object(m.a)({},On),yi),{},{page:1})})}})),y.a.createElement("section",{className:"edu-container"},y.a.createElement("ul",{className:mn.a.menu},y.a.createElement("li",null,Fn.name),Fn==null||((kt=Fn.children)===null||kt===void 0)?void 0:kt.map(function(Ft,yi){return y.a.createElement("li",{className:On[Fn.id]==Ft.id?mn.a.actived:"",key:Ft.id,onClick:function(){On[Fn.id]=Ft.id,tr(Object(m.a)({},On)),hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})}},y.a.createElement("strong",null,Ft.name))})),y.a.createElement("ul",{className:mn.a.menuDirection},y.a.createElement("li",{className:mn.a.directionName},"\u65B9\u5411"),y.a.createElement("li",{className:On.discipline_id?"":mn.a.actived,onClick:function(){Fi(null,null,null)}},y.a.createElement("strong",null,"\u5168\u90E8")),Pe==null?void 0:Pe.map(function(Ft,yi){return y.a.createElement("li",{key:yi,className:On.discipline_id==Ft.id?mn.a.actived:""},y.a.createElement("strong",{onClick:function(){Fi(1,null,Ft.id)}},Ft.name),y.a.createElement("div",null,Ft.sub_disciplines.map(function(li,$n){return y.a.createElement("div",{key:$n,className:"mt5"},y.a.createElement("div",{className:On.sub_discipline_id==li.id?"".concat(mn.a.actived2," ").concat(mn.a.subTag):mn.a.subTag,onClick:function(){Fi(2,li.id,Ft.id)}},li.name),y.a.createElement("ul",{className:"mt5"},li.tags&&li.tags.map(function(ir,Qt){return y.a.createElement("li",{key:Qt,className:On.sub_discipline_id==ir.id&&On.tag_level===3?mn.a.actived2:"",onClick:function(){Fi(3,ir.id,Ft.id)}},ir.name)})))})))})),y.a.createElement("ul",{className:mn.a.menu},y.a.createElement("li",null,er.name),er==null||((Lt=er.children)===null||Lt===void 0)?void 0:Lt.map(function(Ft,yi){return y.a.createElement("li",{className:On[er.id]==Ft.id?mn.a.actived:"",key:Ft.name,onClick:function(){On[er.id]=Ft.id,tr(Object(m.a)({},On)),hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})}},y.a.createElement("strong",null,Ft.name))})),y.a.createElement(Z.a,null,y.a.createElement(kn.a,{flex:"1"},y.a.createElement("div",{className:mn.a.menuCourse,style:{margin:"0px 15px"}},y.a.createElement("ul",null,y.a.createElement("li",null,"\u5DF2\u9009",y.a.createElement("span",{className:"c-blue"},pn.length),"\u4E2A\u5B9E\u8BAD"),y.a.createElement("li",null,"\u5171",y.a.createElement("span",{className:"c-blue"},Un.shixuns_count),"\u4E2A\u8BFE\u7A0B"),y.a.createElement("li",{className:"current",onClick:function(){var yi=Object(m.a)(Object(m.a)({},On),{},{order:On.order==="asc"?"desc":"asc"});tr(yi),hn({type:"classroomList/getShixunLists",payload:yi})}},"\u5B66\u4E60\u4EBA\u6570",y.a.createElement("p",{className:"edu-sorter current ".concat(On.order)},On.order==="asc"?y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),y.a.createElement(kn.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),Un==null||((Kt=Un.shixun_list)===null||Kt===void 0)?void 0:Kt.map(function(Ft,yi){return y.a.createElement("div",{className:mn.a.listItem,key:yi},y.a.createElement(a.a,{checked:pn.includes(Ft.id),value:Ft.id,disabled:Ft==null?void 0:Ft.need_authorize,onChange:function($n){var ir=pn.indexOf(Ft.id);pn.indexOf(Ft.id)>-1?Ct(pn.filter(function(Qt){return Qt!==Ft.id})):Ct(pn.concat(Ft.id))}}),y.a.createElement("div",{className:mn.a.info},y.a.createElement("div",{className:mn.a.title},y.a.createElement("div",{className:mn.a.titleLeft},y.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(Ft==null?void 0:Ft.identifier,"/challenges"),target:"_blank"},y.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:Ft.title}})),(Ft==null?void 0:Ft.need_authorize)&&y.a.createElement("span",{onClick:function(){Object(qi.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(Si.v)()&&(Ft==null?void 0:Ft.mark_status)===1&&y.a.createElement(h.a,{title:Ft==null?void 0:Ft.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(Si.v)()&&(Ft==null?void 0:Ft.mark_status)===2&&y.a.createElement(h.a,{title:Ft==null?void 0:Ft.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(Si.v)()&&(Ft==null?void 0:Ft.mark_status)===3&&y.a.createElement(h.a,{title:Ft==null?void 0:Ft.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),y.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},y.a.createElement("span",{className:mn.a.description,dangerouslySetInnerHTML:{__html:Ft.description}})),y.a.createElement("div",{className:" mt15"},Ft.challenge_names.map(function(li,$n){return y.a.createElement("span",{key:$n,className:"mr30 font12"},"\u7B2C",$n+1,"\u5173 ",li," ")})),y.a.createElement(bn.a,{dashed:!0}),y.a.createElement("div",{className:"c-light-black mt20 font12"},y.a.createElement("span",null,Ft.author_name),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,Ft.author_school_name),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",Ft.level),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),y.a.createElement("span",null,Ft.study_count))))}),(Un==null||((sn=Un.shixun_list)===null||sn===void 0)?void 0:sn.length)===0&&y.a.createElement(ie.a,null),y.a.createElement("p",null)),y.a.createElement("div",{className:"tc mt20"},y.a.createElement(V.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:On.page||1,showQuickJumper:!0,total:Un==null?void 0:Un.shixuns_count,onChange:function(yi){var li=Object(m.a)(Object(m.a)({},On),{},{page:yi});tr(li),hn({type:"classroomList/getShixunLists",payload:li})}})))},Qr=Object(x.a)(function(Zt){var dt=Zt.classroomList,kt=Zt.loading;return{classroomList:dt,loading:kt}})(kr),yt=G("mgmH"),cn=G("ErOA"),Kr=G("ORt/"),zr=G.n(Kr),na=G("Ot1p"),Gr=function(dt,kt){var Lt,Kt=dt.data,sn=Ui.a.useForm(),En=Object(s.a)(sn,1),wn=En[0],hn=Object(H.useState)({}),Ln=Object(s.a)(hn,2),zn=Ln[0],un=Ln[1];return Object(H.useEffect)(function(){Kt&&(un(Kt),wn.setFieldsValue(Object(m.a)({},Kt)))},[Kt]),Object(H.useImperativeHandle)(kt,function(){return{form:wn}}),y.a.createElement("div",{className:zr.a.operating},y.a.createElement(Ui.a,{form:wn,scrollToFirstError:!0,onValuesChange:function(){un(Object(m.a)({},wn.getFieldsValue()))}},y.a.createElement(Ui.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"},{max:30,message:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},y.a.createElement(g.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26",suffix:"".concat(((Lt=zn.name)===null||Lt===void 0?void 0:Lt.length)||0,"/30")})),y.a.createElement(Ui.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},y.a.createElement(a.a.Group,null,y.a.createElement(a.a,{value:"c"},"C"),y.a.createElement(a.a,{value:"c++"},"C++"),y.a.createElement(a.a,{value:"java"},"Java"),y.a.createElement(a.a,{value:"python"},"Python"))),y.a.createElement("div",{className:zr.a.tip},"\u9009\u62E9\u652F\u6301\u4EE5\u4E0B\u7F16\u7A0B\u8BD5\u9898\u8FDB\u884C\u7F16\u8BD1\u7684\u8BED\u8A00"),y.a.createElement("div",{style:{margin:"20px 0 12px 0px"}},"\u8BF4\u660E"),y.a.createElement(Ui.a.Item,{name:"description"},y.a.createElement(na.a,{defaultValue:zn.description||"",watch:!0}))))},$=Object(H.forwardRef)(Gr),S=G("SVaM"),D=G("sesT"),z=G.n(D),te=G("wNkr"),Y=G.n(te),Le=G("xTzM"),ct=G.n(Le),Pt=N.a.TabPane,rn=g.a.Search,ht=g.a.TextArea,Vt;(function(Zt){Zt.Mine="0",Zt.Public="1",Zt.Collection="2",Zt.TeachGroupShare="3"})(Vt||(Vt={}));var hi=function(dt){var kt,Lt,Kt,sn,En,wn,hn,Ln,zn,un,Sn,di,Nn=dt.classroomList,zt=dt.problemset,An=dt.user,si=dt.globalSetting,Un=dt.loading,Xt=dt.dispatch,jt=dt.match,pn=dt.shixunHomeworks,Ct=Object(o.a)(dt,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Nt=Object(H.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:null,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((kt=Ct.location)===null||kt===void 0||((Lt=kt.query)===null||Lt===void 0)?void 0:Lt.id)||null,exam_id:(jt==null||((Kt=jt.params)===null||Kt===void 0)?void 0:Kt.id)||null,exercise_id:(jt==null||((sn=jt.params)===null||sn===void 0)?void 0:sn.categoryId)||null}),Dt=Object(s.a)(Nt,2),Pe=Dt[0],Yt=Dt[1],xn=Object(H.useState)(0),pi=Object(s.a)(xn,2),On=pi[0],tr=pi[1],nr=Object(H.useState)([]),Fi=Object(s.a)(nr,2),Bn=Fi[0],Ft=Fi[1],yi=Object(H.useState)(Vt.Mine),li=Object(s.a)(yi,2),$n=li[0],ir=li[1],Qt=Object(H.useState)(0),qt=Object(s.a)(Qt,2),$t=qt[0],dn=qt[1],Gn=Object(H.useState)(-1),Mn=Object(s.a)(Gn,2),qn=Mn[0],mi=Mn[1],Tr=Object(H.useState)([]),Zn=Object(s.a)(Tr,2),$r=Zn[0],gi=Zn[1],fr=Object(H.useState)(!1),rr=Object(s.a)(fr,2),Mr=rr[0],ka=rr[1],Do=Object(H.useState)([]),ua=Object(s.a)(Do,2),Wi=ua[0],lo=ua[1],uo=Object(H.useState)(0),va=Object(s.a)(uo,2),_a=va[0],Qa=va[1],co=Object(H.useState)(!1),Ma=Object(s.a)(co,2),wa=Ma[0],ho=Ma[1],fo=Object(H.useState)(!1),Na=Object(s.a)(fo,2),po=Na[0],$a=Na[1],ya=Object(H.useRef)(!1),ia=Object(H.useRef)(""),ba=Object(H.useRef)(),ye=Object(H.useRef)(),Oe=Object(H.useRef)(),Me=Object(H.useState)(),Ce=Object(s.a)(Me,2),re=Ce[0],me=Ce[1],oe=Object(H.useState)([]),we=Object(s.a)(oe,2),ve=we[0],ke=we[1],Ie=Object(H.useRef)(!1),je=(jt==null?void 0:jt.url)==="/problemset",Ze=jt==null||((En=jt.url)===null||En===void 0)?void 0:En.includes("program_homework"),mt=Ze&&jt!==null&&jt!==void 0&&(wn=jt.params)!==null&&wn!==void 0&&wn.categoryId&&jt!==null&&jt!==void 0&&(hn=jt.url)!==null&&hn!==void 0&&hn.includes("edit")?jt==null||((Ln=jt.params)===null||Ln===void 0)?void 0:Ln.categoryId:"",bt=mt?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Ut=Object(H.useState)({}),Rn=Object(s.a)(Ut,2),Qn=Rn[0],jn=Rn[1],Vn=Object(H.useState)(!1),Yn=Object(s.a)(Vn,2),Xn=Yn[0],Wn=Yn[1],Jn=An.userInfo||{},ei=Jn.admin,ki=Jn.business,ti=Jn.is_shixun_marker,gn=Jn.is_teacher,fn=Jn.user_identity,Hn=ei||ki||ti||gn||fn!=="\u5B66\u751F",ui=Object(H.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),an=Object(s.a)(ui,2),ci=an[0],Mi=an[1],ri=pn.commonHomeWorkAddDefaultData,wi=Object(H.useState)([]),bi=Object(s.a)(wi,2),Hi=bi[0],Gi=bi[1],Bi=Object(H.useRef)(null),vr=Object(H.useState)(!1),Lr=Object(s.a)(vr,2),Cr=Lr[0],Vi=Lr[1],Di=Object(H.useState)([]),Ei=Object(s.a)(Di,2),Tn=Ei[0],xi=Ei[1],Nr=Object(H.useState)(""),Zr=Object(s.a)(Nr,2),ra=Zr[0],Ti=Zr[1],Vr=Object(H.useState)(!1),Jr=Object(s.a)(Vr,2),Oi=Jr[0],vi=Jr[1],ji=Object(H.useRef)(null),Ua=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(H.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Za=function(){var et=Object(v.a)(j.a.mark(function Qe(){var Ge,nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Be.q)({id:mt});case 2:Ge=wt.sent,Ge!=null&&Ge.name&&(ot={description:Ge.description,languages:Ge.languages,name:Ge.name},ji.current.form.setFieldsValue(ot),jn(Object(m.a)({},ot)),xi(Object(w.a)(Ge.data)),ke((nt=Ge.data)===null||nt===void 0?void 0:nt.map(function(Et){return Et.id})));case 4:case"end":return wt.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}();Object(H.useEffect)(function(){mt&&Za()},[mt]),Object(H.useEffect)(function(){var et;Xt({type:"problemset/getDisciplines",payload:{source:"question"}});var Qe=((et=Ct.location.query)===null||et===void 0?void 0:et.group_id)||0;Pe.group_id=Number(Qe),Yt(Pe),$i(Pe).then(function(Ge){Ge!=null&&Ge.status||Gi(Ge==null?void 0:Ge.item_banks_group),Vi(!1)}),Xr(),Ea()},[]),Object(H.useEffect)(function(){return Xt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Xt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Xt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Xt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(H.useEffect)(function(){return Xt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Xt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(H.useEffect)(function(){return Xt({type:"globalSetting/headerFooterToggle",payload:je}),function(){Xt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(H.useEffect)(function(){Object(Ri.X)(Ze?bt:"\u8BD5\u9898\u5E93")},[Ze,bt]);var ca=function(Qe,Ge){var nt=[];if(!Qe){var ot,At;zt==null||((ot=zt.disciplinesData)===null||ot===void 0||((At=ot.disciplines)===null||At===void 0))||At.forEach(function(Ki){var Ur;Ki==null||((Ur=Ki.sub_disciplines)===null||Ur===void 0)||Ur.forEach(function(ta){var Da;ta==null||((Da=ta.tag_disciplines)===null||Da===void 0)||Da.forEach(function(Br){Br.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&nt.push(Br)})})})}if(Qe&&!Ge){var wt,Et,ln,ni=zt==null||((wt=zt.disciplinesData)===null||wt===void 0||((Et=wt.disciplines)===null||Et===void 0))?void 0:Et.find(function(Ki){return Ki.id===Qe});ni==null||((ln=ni.sub_disciplines)===null||ln===void 0)||ln.forEach(function(Ki){var Ur;Ki==null||((Ur=Ki.tag_disciplines)===null||Ur===void 0)||Ur.forEach(function(ta){ta.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&nt.push(ta)})})}if(Qe&&Ge){var Sr,Kn,yr,br,mr=zt==null||((Sr=zt.disciplinesData)===null||Sr===void 0||((Kn=Sr.disciplines)===null||Kn===void 0))?void 0:Kn.find(function(Ki){return Ki.id===Qe}),Ar=mr==null||((yr=mr.sub_disciplines)===null||yr===void 0)?void 0:yr.find(function(Ki){return Ki.id===Ge});Ar==null||((br=Ar.tag_disciplines)===null||br===void 0)||br.forEach(function(Ki){Ki.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&nt.push(Ki)})}return nt},Ea=function(){var et=Object(v.a)(j.a.mark(function Qe(){return j.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:Xt({type:"problemset/getTeachGroupData"});case 1:case"end":return nt.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}();Object(H.useEffect)(function(){var et=zt.basketData||{},Qe=et.completion_questions_count,Ge=Qe===void 0?0:Qe,nt=et.judgement_questions_count,ot=nt===void 0?0:nt,At=et.multiple_questions_count,wt=At===void 0?0:At,Et=et.practical_questions_count,ln=Et===void 0?0:Et,ni=et.program_questions_count,Sr=ni===void 0?0:ni,Kn=et.single_questions_count,yr=Kn===void 0?0:Kn,br=et.subjective_questions_count,mr=br===void 0?0:br,Ar=et.combination_questions_count,Ki=Ar===void 0?0:Ar,Ur=Ge+ot+wt+ln+Sr+yr+mr+Ki;Qa(Ur)},[zt.basketData]);var $i=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return nt=Object(m.a)({},Ge),nt.item_type=Ze?"PROGRAM":Ge.item_type,Vi(!0),nt.keyword=encodeURIComponent(Ge.keyword||""),wt.next=6,Xt({type:"problemset/getItemBanks",payload:nt});case 6:if(ot=wt.sent,!(ot&&ot.status!==403&&ot.status!==401&&ot.status!==500)){wt.next=18;break}return tr(ot.items_count||0),Ft(ot.items||[]),gi(ot.tag_disciplines||[]),me(ot.used_shixun_ids||[]),Ba(ot.items||[]),Ze||ke([]),lo((ot==null?void 0:ot.navigation)||[]),dn((ot==null?void 0:ot.added_num)||0),Vi(!1),wt.abrupt("return",ot);case 18:case"end":return wt.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Xr=function(){Xt({type:"problemset/getBasketList",payload:{}})},Ba=function(Qe){var Ge=Qe.every(function(nt){var ot;return((ot=nt.program_attr)===null||ot===void 0?void 0:ot.status)===0});ya.current=Ge},Po=function(Qe,Ge){if(Pe.discipline_id=Qe||"",Pe.sub_discipline_id=Ge||"",Pe.tag_discipline_id="",Pe.page=1,Pe.per_page=20,delete Pe.id,mi(Qe===null?-1:null),Yt(Pe),$i(Pe),Qe===null)return},Io=function(Qe){Pe.item_type=Qe||"",Pe.page=1,Pe.per_page=20,Yt(Pe),$i(Pe)},mo=function(Qe){Pe.difficulty=Qe||"",Pe.page=1,Pe.per_page=20,delete Pe.id,Yt(Pe),$i(Pe)},Ja=function(Qe){Pe.tag_discipline_id=Qe,Pe.page=1,Pe.per_page=20,delete Pe.id,Qe===-1&&(Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id=""),mi(Qe),Yt(Pe),$i(Pe)},qa=Object(H.useState)(!1),da=Object(s.a)(qa,2),xa=da[0],go=da[1],ja=function(Qe){Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:Qe}}),Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.item_type=null,Pe.difficulty=null,Pe.type=Qe,Qe==="0"?Pe.group_id=0:Pe.group_id=null,Qe==="3"&&Ze?Pe.only_published=!0:Pe.only_published=null,Qe==="3"?go(!0):go(!1),Pe.page=1,Pe.per_page=20,delete Pe.id,mi(-1),ir(Qe),Yt(Pe),$i(Pe)},Ta=function(Qe,Ge){Pe.page=Qe,Pe.per_page=Ge,Yt(Pe),$i(Pe)},ha=function(Qe){Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.item_type=null,Pe.difficulty=null,Pe.page=1,Pe.keyword=Qe,delete Pe.id,Qe?($a(!0),Object(S.a)({name:Qe,copywriting:Qe,position:Ze?"Practice":"ItemBank"})):$a(!1),mi(-1),Yt(Pe),$i(Pe)},Pi=function(){Pe.per_page=20,Yt(Pe),$i(Pe)},Dr=function(Qe){var Ge=Qe.length===Bn.length&&Pe.page>1?Pe.page-1:Pe.page;Pe.page=Ge,Pe.per_page=20,Xr(),Yt(Pe),$i(Pe)},fa=function(){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},aa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge,nt){var ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!nt){wt.next=6;break}return wt.next=3,Object(Be.n)({id:Ge});case 3:wt.t0=wt.sent,wt.next=9;break;case 6:return wt.next=8,Object(Be.G)({id:Ge});case 8:wt.t0=wt.sent;case 9:ot=wt.t0,(ot==null?void 0:ot.status)===0&&Pi();case 11:case"end":return wt.stop()}},Qe)}));return function(Ge,nt){return et.apply(this,arguments)}}(),Sa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Ka(Ge);case 1:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),pa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Ha([Ge]);case 1:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Fa=function(Qe){ye.current="",ba.current="",A.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:y.a.createElement("div",{className:"font14"},y.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),y.a.createElement(O.a.Group,{className:"mt10",onChange:function(nt){return ba.current=nt.target.value}},y.a.createElement(O.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),y.a.createElement(O.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),y.a.createElement(O.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),y.a.createElement(O.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),y.a.createElement(O.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),y.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),y.a.createElement(ht,{className:"mt10",rows:4,defaultValue:ye.current,onChange:function(nt){return ye.current=nt.target.value}})),onOk:function(){return new Promise(function(){var nt=Object(v.a)(j.a.mark(function ot(At,wt){var Et;return j.a.wrap(function(ni){for(;;)switch(ni.prev=ni.next){case 0:if(ba.current&&ye.current){ni.next=3;break}return c.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),ni.abrupt("return",wt());case 3:return ni.next=5,Object(Be.o)({id:Qe,clazz:ba.current,description:ye.current});case 5:Et=ni.sent,Et.status===0&&c.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),At();case 8:case"end":return ni.stop()}},ot)}));return function(ot,At){return nt.apply(this,arguments)}}())}})},eo=function(Qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:Qe}}})},Wa=function(Qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:Qe}}})},to=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot,At,wt;return j.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:if(nt=Ge.item_type,!(nt==="PROGRAM")){ln.next=12;break}return ot=Ge.program_attr.identifier,ln.next=5,Xt({type:"problemset/startExperience",payload:{id:ot}});case 5:if(At=ln.sent,!(At.status===0)){ln.next=10;break}return wt=At.identifier,Object(Ri.S)("/myproblems/".concat(wt)),ln.abrupt("return");case 10:return c.b.warn(At.message),ln.abrupt("return");case 12:Xt({type:"problemset/setActionTabs",payload:{key:nt,params:Ge}});case 13:case"end":return ln.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),qr=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot,At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(!Pe.exam_id){Et.next=6;break}return Et.next=3,Object(Be.M)({item_id:Ge,id:Pe.exam_id});case 3:return nt=Et.sent,nt.status===0&&Pi(),Et.abrupt("return");case 6:if(!(Pe!=null&&Pe.exercise_id)){Et.next=12;break}return Et.next=9,Object(cn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Pe==null?void 0:Pe.exercise_id,item_bank_ids:[Ge]}});case 9:return ot=Et.sent,ot.status===0&&Pi(),Et.abrupt("return");case 12:return Et.next=14,Xt({type:"problemset/cancel",payload:{id:Ge,item_bank:1}});case 14:At=Et.sent,At.status===0&&(Pi(),Xr());case 16:case"end":return Et.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),oa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(Ge),group_type:Vt.Mine}}),Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.page=1,Pe.per_page=20,Pe.group_id=Math.abs(Ge),mi(-1),Yt(Pe),$i(Pe).then(function(At){return Gi(At==null?void 0:At.item_banks_group)});case 10:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),no=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot,At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(!Pe.exam_id){Et.next=6;break}return Et.next=3,Object(Be.t)({exam_id:Pe.exam_id,item_bank_ids:[Ge]});case 3:return nt=Et.sent,nt.status===0&&Pi(),Et.abrupt("return");case 6:if(!(Pe!=null&&Pe.exercise_id)){Et.next=12;break}return Et.next=9,Object(cn.a)("/api/exercises/".concat(Pe==null?void 0:Pe.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[Ge]}});case 9:return ot=Et.sent,ot.status===0&&Pi(),Et.abrupt("return");case 12:if(!(_a===200)){Et.next=15;break}return c.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),Et.abrupt("return");case 15:return Et.next=17,Xt({type:"problemset/select",payload:{item_bank_ids:[Ge]}});case 17:At=Et.sent,At.status===0&&(Pi(),Xr());case 19:case"end":return Et.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),io=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:if(Ge){ot.next=3;break}if(ve!=null&&ve.length){ot.next=3;break}return ot.abrupt("return",c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Oe.current=[0],A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u79FB\u52A8\u5230",maskClosable:!0,className:"custom-modal-divider",icon:null,content:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow),style:{maxHeight:500,overflow:"auto"}},y.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),y.a.createElement(ne.a,{defaultValue:!0,value:Oe.current,onChange:function(wt){return Oe.current=wt}})),onOk:function(){var At=Object(v.a)(j.a.mark(function Et(){var ln,ni;return j.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(Be.f)({ids:Ge?[Ge]:ve,groups_ids:(ln=Oe.current)===null||ln===void 0?void 0:ln[0]});case 2:ni=Kn.sent,Oe.current=[],(ni==null?void 0:ni.status)===0&&Pi();case 5:case"end":return Kn.stop()}},Et)}));function wt(){return At.apply(this,arguments)}return wt}()});case 5:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),ko=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Be.D)({clazz:"ItemBank",id:Ge});case 2:nt=wt.sent,ot=(nt==null?void 0:nt.groups)||[],Oe.current=[],A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A\u64A4\u9500",cancelText:"\u53D6\u6D88",title:"\u672C\u9898\u5DF2\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow)},y.a.createElement("p",{className:"c-grey-999"},"\u9009\u4E2D\u5E76\u786E\u5B9A\uFF0C\u5373\u64A4\u9500\u672C\u9898\u5BF9\u9009\u4E2D\u6559\u7814\u56E2\u961F\u7684\u5206\u4EAB"),y.a.createElement(a.a.Group,{className:pe.a.checkbox,defaultValue:Oe.current,onChange:function(ln){return Oe.current=ln}},ot==null?void 0:ot.map(function(Et){return y.a.createElement(a.a,{key:Et.group_id,value:Et.group_id},Et.name)}))),onOk:function(){var Et=Object(v.a)(j.a.mark(function ni(){return j.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.abrupt("return",new Promise(function(){var yr=Object(v.a)(j.a.mark(function br(mr,Ar){var Ki,Ur,ta;return j.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:if(Oe.current.length){Br.next=3;break}return c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Br.abrupt("return",Ar());case 3:return Ur=ot==null||((Ki=ot.map(function(yo){return yo.group_id}))===null||Ki===void 0)?void 0:Ki.filter(function(yo){return!Oe.current.includes(yo)}),Br.next=6,Object(Be.l)({ids:[Ge],clazz:"ItemBank",group_ids:Ur});case 6:return ta=Br.sent,Oe.current=[],(ta==null?void 0:ta.status)===0&&(c.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),Pi()),Br.abrupt("return",mr());case 10:case"end":return Br.stop()}},br)}));return function(br,mr){return yr.apply(this,arguments)}}()));case 1:case"end":return Kn.stop()}},ni)}));function ln(){return Et.apply(this,arguments)}return ln}()});case 6:case"end":return wt.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Mo=function(Qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:Qe}}})},ro=function(){Xt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Pe}});return},No=function(){var Qe={discipline_id:"&discipline_id=".concat(Pe.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(Pe.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(Pe.tag_discipline_id),difficulty:"&difficulty=".concat(Pe.difficulty),item_type:"&item_type=".concat(Pe.item_type),group_id:"&group_id=".concat(Pe.group_id||0)},Ge="/problemset/newitem?pages=".concat(Pe.page);Object.keys(Qe).forEach(function(nt){Pe[nt]&&(Ge=Ge+Qe[nt])}),x.d===null||x.d===void 0||x.d.push(Ge)},Zi=function(Qe){var Ge=ve;if(!(Ge!=null&&Ge.length))return c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(_a+Ge.length>200&&Qe&&je){c.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-_a,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat(Ge.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}Qe?Xi(Ge):pr(Ge)},Xi=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt;return j.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:nt=Object(w.a)(Ge),Bn.forEach(function(wt){if(nt.includes(wt.id)){var Et;wt.item_type==="PROGRAM"&&((Et=wt.program_attr)===null||Et===void 0?void 0:Et.status)===0&&Object(vt.remove)(nt,function(ln){return ln===wt.id})}}),A.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:y.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",Ge.length,"\u9053\u8BD5\u9898\uFF0C\u5DF2\u52A0\u5165\u8FC7\u7684\u8BD5\u9898\u6216\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u5C06\u4E0D\u4F1A\u91CD\u590D\u52A0\u5165 "),onOk:function(){var wt=Object(v.a)(j.a.mark(function ln(){var ni;return j.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:if(!Pe.exam_id){Kn.next=6;break}return Kn.next=3,Object(Be.t)({exam_id:Pe.exam_id,item_bank_ids:nt});case 3:ni=Kn.sent,Kn.next=15;break;case 6:if(!(Pe!=null&&Pe.exercise_id)){Kn.next=12;break}return Kn.next=9,Object(cn.a)("/api/exercises/".concat(Pe==null?void 0:Pe.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:nt}});case 9:ni=Kn.sent,Kn.next=15;break;case 12:return Kn.next=14,Xt({type:"problemset/select",payload:{item_bank_ids:nt}});case 14:ni=Kn.sent;case 15:ni.status===0&&(Pi(),Xr());case 16:case"end":return Kn.stop()}},ln)}));function Et(){return wt.apply(this,arguments)}return Et}()});case 3:case"end":return At.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),pr=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt;return j.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!Pe.exam_id){At.next=6;break}return At.next=3,Object(cn.a)("/api/examination_banks/".concat(Pe.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:Ge}});case 3:nt=At.sent,At.next=15;break;case 6:if(!(Pe!=null&&Pe.exercise_id)){At.next=12;break}return At.next=9,Object(cn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Pe==null?void 0:Pe.exercise_id,item_bank_ids:Ge}});case 9:nt=At.sent,At.next=15;break;case 12:return At.next=14,Xt({type:"problemset/unselectAll",payload:{item_ids:Ge}});case 14:nt=At.sent;case 15:nt.status===0&&(Pi(),Xr());case 16:case"end":return At.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Yi=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt;return j.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(je&&_a===200)){At.next=3;break}return c.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),At.abrupt("return");case 3:if(!Pe.exam_id){At.next=10;break}return At.next=6,Object(Be.t)({exam_id:Pe.exam_id,shixun_ids:Ge});case 6:nt=At.sent,nt.status===0&&Pi(),At.next=14;break;case 10:return At.next=12,Xt({type:"problemset/select",payload:{shixun_ids:Ge}});case 12:nt=At.sent,nt.status===0&&(Xr(),Pi());case 14:case"end":return At.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Aa=function(){Xt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Ha=function(Qe){var Ge,nt,ot,At;if(!((Ge=zt.teachGroupData)!==null&&Ge!==void 0&&(nt=Ge.groups)!==null&&nt!==void 0&&nt.length))return c.b.info("\u60A8\u6682\u672A\u521B\u5EFA\u6216\u52A0\u5165\u4EFB\u4F55\u6559\u7814\u56E2\u961F\uFF0C\u8BF7\u524D\u5F80\u201C\u6211\u7684\u4E2A\u4EBA\u4E2D\u5FC3-\u6559\u7814\u56E2\u961F\u201D\u67E5\u770B");A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow)},y.a.createElement(a.a.Group,{className:pe.a.checkbox,defaultValue:Oe.current,onChange:function(Et){return Oe.current=Et}},(ot=zt.teachGroupData)===null||ot===void 0||((At=ot.groups)===null||At===void 0)?void 0:At.map(function(wt){return y.a.createElement(a.a,{key:wt.group_id,value:wt.group_id},wt.name)}))),onOk:function(){return new Promise(function(){var Et=Object(v.a)(j.a.mark(function ln(ni,Sr){var Kn,yr;return j.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if((Kn=Oe.current)!==null&&Kn!==void 0&&Kn.length){mr.next=3;break}return c.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),mr.abrupt("return",Sr());case 3:return mr.next=5,Object(Be.l)({ids:Qe||ve,clazz:"ItemBank",group_ids:Oe.current});case 5:yr=mr.sent,(yr==null?void 0:yr.status)===0&&(c.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),Oe.current=[],ke([]),Pi(),ni());case 7:case"end":return mr.stop()}},ln)}));return function(ln,ni){return Et.apply(this,arguments)}}())}})},Pr=function(){var Qe=function(){var Ge=Object(v.a)(j.a.mark(function nt(){var ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return ka(!0),wt.next=3,Object(Be.j)({ids:ve});case 3:ot=wt.sent,ka(!1),(ot==null?void 0:ot.status)===0&&A.a.info({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u5220\u9664\u7ED3\u679C",maskClosable:!1,keyboard:!1,icon:null,content:"\u672C\u6B21\u6210\u529F\u5220\u9664".concat(ot.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(ot.fail,"\u6761\u8BD5\u9898\u56E0\u4E3A\u516C\u5F00\u65E0\u6CD5\u5220\u9664\uFF0C\u8BF7\u64A4\u9500\u540E\u518D\u8FDB\u884C\u5220\u9664\u3002"),onOk:function(){Dr(new Array(ot.success))}});case 6:case"end":return wt.stop()}},nt)}));return function(){return Ge.apply(this,arguments)}}();if(ve!=null&&ve.length){A.a.confirm({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u63D0\u793A",cancelText:"\u53D6\u6D88",icon:null,content:"\u672C\u6B21\u9009\u4E2D\u4E86".concat(ve==null?void 0:ve.length,"\u6761\u8BD5\u9898\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF0C\u5220\u9664\u540E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\uFF1F"),onOk:Qe});return}c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},ao=function(){var Qe,Ge;if(!(ve!=null&&ve.length))return c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(Bn!=null&&(Qe=Bn.filter(function(nt){return ve.includes(nt.id)}))!==null&&Qe!==void 0&&Qe.every(function(nt){return nt.public}))return c.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(Bn!=null&&(Ge=Bn.filter(function(nt){return ve.includes(nt.id)}))!==null&&Ge!==void 0&&Ge.find(function(nt){var ot;return nt.item_type==="PROGRAM"&&((ot=nt.program_attr)===null||ot===void 0?void 0:ot.status)===0}))return c.b.info("\u5DF2\u9009\u9898\u4E2D\u5B58\u5728\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898");window.localStorage.getItem("problemset-set-public-hint-flag")==="1"||An.userInfo.professional_certification?Ka():A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u516C\u5F00\u89C4\u5219\u544A\u77E5",maskClosable:!0,icon:null,content:y.a.createElement("div",{className:"font16 c-grey-333"},"\u516C\u5F00\u5E76\u7ECF\u5E73\u53F0\u5BA1\u6838\u540E\uFF0C\u8BE5\u9898\u5C06\u5728\u516C\u5171\u8BD5\u9898\u5E93\u53EF\u89C1\uFF0CEducoder\u6240\u6709\u7528\u6237\u5747\u53EF\u4F7F\u7528\u8BE5\u9898\u3002",y.a.createElement("br",null),"\u516C\u5F00\u540E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u4F46\u53EF\u4EE5\u64A4\u9500\uFF1B\u64A4\u9500\u516C\u5F00\u540E\u53EF\u4EE5\u4FEE\u6539\u3002",y.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",y.a.createElement("br",null),y.a.createElement(a.a,{className:"mt10",defaultChecked:!1,onChange:function(ot){return Ie.current=ot.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Ka()}})},Ka=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return nt=$n===Vt.TeachGroupShare?1:2,wt.next=3,Object(Be.g)({ids:Ge?[Ge]:ve,source:nt});case 3:ot=wt.sent,ot.status===0&&(Ie.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),Ie.current=!1,ke([]),Pi());case 5:case"end":return wt.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),vo=function(Qe){A.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{className:pe.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),y.a.createElement("div",{className:pe.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ge=Object(v.a)(j.a.mark(function ot(){var At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(Be.L)({identifier:Qe});case 2:At=Et.sent,(At==null?void 0:At.status)===0&&(c.b.success("\u53D1\u5E03\u6210\u529F"),Pi());case 4:case"end":return Et.stop()}},ot)}));function nt(){return Ge.apply(this,arguments)}return nt}()})},ma=function(Qe){A.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:y.a.createElement("p",{className:pe.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ge=Object(v.a)(j.a.mark(function ot(){var At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(Be.K)({identifier:Qe});case 2:At=Et.sent,(At==null?void 0:At.status)===0&&(c.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),Pi());case 4:case"end":return Et.stop()}},ot)}));function nt(){return Ge.apply(this,arguments)}return nt}()})},za=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Ge,group_type:Vt.TeachGroupShare}}),Pe.page=1,Pe.group_id=Ge||null,delete Pe.id,Yt(Object(m.a)({},Pe)),$i(Pe);case 6:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Oa=function(Qe){Pe.sort_by=Qe.type,Pe.sort_direction=Qe.direction,Pe.page=1,Pe.per_page=20,Mi(Qe.name),Yt(Pe),$i(Pe)},_o=function(){Pe.page=1,Yt(Pe),$i(Pe)},Ga=function(Qe){Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.item_type=null,Pe.difficulty=null,Pe.page=1,Pe.per_page=20,Pe.group_id=Qe,mi(-1),Yt(Pe),$i(Pe).then(function(Ge){return Gi(Ge==null?void 0:Ge.item_banks_group)})},_i=function(){if(!(ve!=null&&ve.length)){Xt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:Pe}});return}A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow)},"\u5DF2\u9009\u4E2D",ve==null?void 0:ve.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(yt.k)({ids:ve})}})},oi=function(){var et=Object(v.a)(j.a.mark(function Qe(){var Ge,nt,ot,At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(Be.i)({ids:ve});case 2:Ge=Et.sent,nt=Ge.data||{},ot=nt.unpublish_program_question_count,At=nt.total_item_banks,ot===0?A.a.error({title:"\u9519\u8BEF",content:y.a.createElement("span",null,"\u53D1\u5E03\u9519\u8BEF\uFF01\u8BF7\u9009\u62E9\u5C1A\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u8FDB\u884C\u53D1\u5E03"),centered:!0,okText:"\u786E\u8BA4"}):A.a.confirm({title:"\u63D0\u793A",content:y.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",At,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",ot,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var ln=Object(v.a)(j.a.mark(function Sr(){var Kn;return j.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,Object(Be.h)({ids:ve});case 2:Kn=br.sent,Kn.status===0&&(c.b.success("\u53D1\u5E03\u6210\u529F"),Pi());case 4:case"end":return br.stop()}},Sr)}));function ni(){return ln.apply(this,arguments)}return ni}()});case 5:case"end":return Et.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}(),lr=y.a.createElement(d.a,null,Hn&&y.a.createElement(d.a.Item,{onClick:function(){return Zi(!0)}},"\u6279\u91CF\u52A0\u5165"),Hn&&y.a.createElement(d.a.Item,{onClick:function(){return Zi(!1)}},"\u6279\u91CF\u79FB\u51FA"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:function(){return io()}},"\u79FB\u52A8\u5230"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:ao},"\u6279\u91CF\u516C\u5F00"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:function(){return Ha()}},"\u6279\u91CF\u5171\u4EAB"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:Pr},"\u6279\u91CF\u5220\u9664")),_r=function(Qe){if(Ze)if((Tn==null?void 0:Tn.length)<=0){var Ge=Bn.filter(function(ln){return Qe.includes(ln.id)});xi(Object(w.a)(Ge)),ke(Ge==null?void 0:Ge.map(function(ln){return ln.id}))}else if(Qe.length>Tn.length){var nt,ot=Bn.filter(function(ln){return Qe.includes(ln.id)}),At=Tn.map(function(ln){return ln.id}),wt=ot.filter(function(ln){return!At.includes(ln.id)});xi([].concat(Object(w.a)(Tn),Object(w.a)(wt))),ke((nt=[].concat(Object(w.a)(Tn),Object(w.a)(wt)))===null||nt===void 0?void 0:nt.map(function(ln){return ln.id}))}else{var Et=Tn.filter(function(ln){return Qe.includes(ln.id)});xi(Object(w.a)(Et)),ke(Et==null?void 0:Et.map(function(ln){return ln.id}))}else ke(Qe)},sa=function(Qe){if(Ze)if(Qe){var Ge,nt=Tn==null?void 0:Tn.map(function(Et){return Et.id}),ot=Bn.filter(function(Et){return!nt.includes(Et.id)});xi([].concat(Object(w.a)(Tn),Object(w.a)(ot))),ke((Ge=[].concat(Object(w.a)(Tn),Object(w.a)(ot)))===null||Ge===void 0?void 0:Ge.map(function(Et){return Et.id}))}else{var At=Bn==null?void 0:Bn.map(function(Et){return Et.id}),wt=Tn.filter(function(Et){return!At.includes(Et.id)});xi(Object(w.a)(wt)),ke(wt==null?void 0:wt.map(function(Et){return Et.id}))}else ke(Qe?Bn==null?void 0:Bn.map(function(Et){return Et.id}):[])},ea=function(){var Qe="/problemset/preview";if(Pe.exam_id&&(Qe="/paperlibrary/edit/".concat(Pe.exam_id)),Pe!=null&&Pe.exercise_id){var Ge;Qe="/classrooms/".concat(jt==null||((Ge=jt.params)===null||Ge===void 0)?void 0:Ge.coursesId,"/exercise/").concat(Pe==null?void 0:Pe.exercise_id,"/edit")}x.d.push(Qe)},Ra=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],la={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},ar=function(Qe,Ge){var nt,ot=Ge.id<0?"--":Hn?Ge[Pe.exercise_id?"added":"choosed"]?y.a.createElement("span",{key:1,className:pe.a.btnAdd,onClick:function(Et){Et.target.style.pointerEvents="none",qr(Ge.id)}},je?"\u79FB\u51FA\u8BD5\u9898\u7BEE":y.a.createElement("span",null,y.a.createElement("b",{className:"iconfont icon-yichu ".concat(pe.a.cancelC)}),"\u79FB\u51FA")):Ge.item_type==="PROGRAM"&&((nt=Ge.program_attr)===null||nt===void 0?void 0:nt.status)===0?y.a.createElement(h.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},y.a.createElement("span",{className:pe.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",je?"\u52A0\u5165\u8BD5\u9898\u7BEE":y.a.createElement("span",{style:{padding:"0 3px"}},y.a.createElement("b",{className:"iconfont icon-jiaru ".concat(pe.a.addC)}),"\u52A0\u5165")," ")):y.a.createElement("span",{className:pe.a.btnAdd,onClick:function(){return no(Ge.id)}},je?"\u52A0\u5165\u8BD5\u9898\u7BEE":y.a.createElement("span",{style:{padding:"0 3px"}},y.a.createElement("b",{className:"iconfont icon-jiaru ".concat(pe.a.addC)}),"\u52A0\u5165")):y.a.createElement(y.a.Fragment,null),At=y.a.createElement("span",{className:pe.a.actonBtn},Ge.id>0&&y.a.createElement(fi.a,{isProblemset:je,user:An,key:Ge.id,data:Ge,activeTabsKey:$n,selectIds:ve,onCollect:aa,onSetPublic:Sa,onStartExperience:to,onCorrection:Fa,onPublicReview:fa,onSetPrivate:eo,onDelete:Wa,onCancel:qr,onSelect:no,onMoveTo:io,onSetShare:pa,onCancelShare:ko,onPublish:vo,onCancelPublish:ma}),ot);return At};Object(H.useEffect)(function(){if(Ze){var et=jt.params,Qe=et.coursesId,Ge=et.categoryId;Xt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:Ge,coursesId:Qe,type:5}})}},[Ze]);var La=function(){var et=Object(v.a)(j.a.mark(function Qe(){var Ge,nt,ot,At,wt;return j.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ji.current.form.validateFields().catch(function(ni){document.body.scrollIntoView()}),ln.next=3,ji.current.form.validateFields();case 3:if(Ge=ji.current.form.getFieldsValue(),console.log(Ge,"value"),!((Tn==null?void 0:Tn.length)<=0)){ln.next=8;break}return c.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),ln.abrupt("return");case 8:return Wn(!0),nt=jt.params,ot=nt.coursesId,At=nt.categoryId,ln.next=12,Object(cn.a)(mt?"/api/homework_commons/".concat(At,"/update_hack.json"):"/api/courses/".concat(ot,"/homework_commons.json"),{method:mt?"put":"post",body:Object(m.a)(Object(m.a)({},Ge),{},{coursesId:ot,category:At,type:5,hack_ids:Tn==null?void 0:Tn.map(function(ni){return ni.id})})});case 12:wt=ln.sent,(wt==null?void 0:wt.status)===0&&x.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework/").concat(mt?At:wt.homework_id,"/detail?tabs=1")),Wn(!1);case 15:case"end":return ln.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}();return y.a.createElement("div",{className:pe.a.page},y.a.createElement("section",null,y.a.createElement("div",{className:pe.a.wrap},ri.course_name&&Ze&&y.a.createElement("section",{className:"animated fadeIn"},y.a.createElement("aside",{className:"mt10"},ri.category&&y.a.createElement(p.a,{separator:">"},y.a.createElement(p.a.Item,null,y.a.createElement(F.a,{to:"/classrooms/".concat(ri.course_id,"/program_homework")},ri.course_name)),y.a.createElement(p.a.Item,null,y.a.createElement(F.a,{to:"/classrooms/".concat(ri.course_id,"/program_homework")},ri.category.category_name)),y.a.createElement(p.a.Item,null,bt)))),y.a.createElement("div",{className:pe.a.title},Ze?bt:"\u8BD5\u9898\u5E93"),Ze&&y.a.createElement($,{data:Qn,ref:ji}),y.a.createElement("div",{className:pe.a.headerWrapper},y.a.createElement("div",{className:pe.a.tabsWrap},y.a.createElement(N.a,{activeKey:$n,onChange:ja,tabBarExtraContent:y.a.createElement("div",{className:pe.a.searchWrap},$n===Vt.Mine&&je&&y.a.createElement(P.a,{className:pe.a.addQuestionBtn,onClick:No},y.a.createElement("img",{src:z.a,className:pe.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),y.a.createElement(rn,{allowClear:!0,suffix:y.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(pe.a.searchIcon),onClick:function(){return ha(Pe.keyword)}}),className:pe.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function(Qe){Pe.keyword=Qe.target.value,Yt(Object(m.a)({},Pe))},onSearch:ha}))},y.a.createElement(Pt,{tab:"\u516C\u5171",key:"1"}),((zn=zt.teachGroupData)===null||zn===void 0||((un=zn.groups)===null||un===void 0)?void 0:un.length)&&y.a.createElement(Pt,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(Si.o)()&&!Object(Si.m)()&&!Ze&&y.a.createElement(Pt,{tab:"\u6536\u85CF\u5939",key:"2"}),y.a.createElement(Pt,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),y.a.createElement(Q.a,{showSelectAll:!1,className:pe.a.select,disciplinesData:(Sn=zt.disciplinesData)===null||Sn===void 0?void 0:Sn.disciplines,knowledgeData:$r,directionValue:Pe.discipline_id,subDisciplineValue:Pe.sub_discipline_id,typeValue:Pe.item_type,isprogram_homework:Ze,showKnowledge:!0,name:ra,setname:Ti,difficultyValue:Pe.difficulty,showShixun:!Object(Si.m)()&&!Pe.exercise_id&&$n!==Vt.TeachGroupShare&&$n!==Vt.Public,onShixunChange:Aa,onDirectionChange:Po,onTypeChange:Io,onDifficultyChange:mo,knowledgeValue:qn,onKnowledgeChange:Ja,teachGroupData:(di=zt.teachGroupData)===null||di===void 0?void 0:di.groups,onTeachGroupChange:za,teachGroupValue:Pe.group_id,showTeachGroup:xa})),y.a.createElement("div",{className:pe.a.treeWrapper,style:{display:$n===Vt.Mine?"block":"none"}},y.a.createElement("div",{className:pe.a.treeHeader},y.a.createElement(be.a,{data:Wi,onClick:oa}),y.a.createElement(P.a,{type:"link",onClick:ro,className:pe.a.exportBtn},y.a.createElement("img",{src:ct.a,alt:"",className:pe.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),y.a.createElement(W.a,{spinning:Cr},y.a.createElement("div",{ref:Bi,className:pe.a.treeContent},y.a.createElement(In.a,{isProblemset:je,reloadData:Pi,data:Hi,onShare:Ha,onOpen:oa})))),y.a.createElement("div",{className:pe.a.contentWrap},y.a.createElement("div",{className:pe.a.batchWrap},y.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!Ze&&y.a.createElement("div",{className:"font14"},y.a.createElement(B.a,{overlay:y.a.createElement(d.a,{selectedKeys:[ci]},Ua==null?void 0:Ua.map(function(et,Qe){return y.a.createElement(d.a.Item,{key:et.name,onClick:function(){return Oa(et)}},et.name)}))},y.a.createElement("span",{style:{color:"#464F66"}},y.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),ci))),Ze&&y.a.createElement("div",null,y.a.createElement(a.a,{checked:(Bn==null?void 0:Bn.filter(function(et){return Tn==null?void 0:Tn.map(function(Qe){return Qe.id}).includes(et.id)}).length)===Bn.length,onChange:function(Qe){return sa(Qe.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",ve==null?void 0:ve.length,")"))),Ze&&y.a.createElement(A.a,{visible:Oi,centered:!0,width:700,okText:"\u786E\u8BA4".concat(mt?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return vi(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:La,confirmLoading:Xn,title:"\u67E5\u770B\u5DF2\u9009"},y.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",Tn==null?void 0:Tn.length,"\u4E2A"),y.a.createElement("div",{style:{height:400,overflow:"auto"}},Tn==null?void 0:Tn.map(function(et,Qe){var Ge,nt,ot,At,wt,Et;return y.a.createElement("div",{key:Qe,className:pe.a.sendModal},y.a.createElement("div",{className:pe.a.li},y.a.createElement("p",null,et==null?void 0:et.name),y.a.createElement("div",{className:pe.a.bottom},y.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),y.a.createElement("i",{className:pe.a.line}),y.a.createElement("span",{className:"c-grey-333"},et.difficulty===1&&"\u7B80\u5355",et.difficulty===2&&"\u9002\u4E2D",et.difficulty===3&&"\u56F0\u96BE"),y.a.createElement("i",{className:pe.a.line}),y.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",y.a.createElement(h.a,{title:et==null||((Ge=et.author)===null||Ge===void 0)?void 0:Ge.name},y.a.createElement("span",{className:"c-grey-333"},(et==null||((nt=et.author)===null||nt===void 0||((ot=nt.name)===null||ot===void 0))?void 0:ot.length)>6?(et==null||((At=et.author)===null||At===void 0||((wt=At.name)===null||wt===void 0))?void 0:wt.substr(0,3))+"...":et==null||((Et=et.author)===null||Et===void 0)?void 0:Et.name))),y.a.createElement("i",{className:pe.a.line}),y.a.createElement("span",{className:pe.a.des},"\u66F4\u65B0\xA0",y.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.updated_at)))),y.a.createElement("div",{className:pe.a.del,onClick:function(){_r(Tn.filter(function(ni){return ni.id!==et.id}).map(function(ni){return ni.id}))}},"\u5220\u9664"))})))),y.a.createElement("div",null,$n===Vt.Mine&&je&&y.a.createElement(P.a,{onClick:_i,type:"link",className:pe.a.exportBtn},y.a.createElement("img",{src:Y.a,className:pe.a.pngIcon}),y.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),po?y.a.createElement("div",null,y.a.createElement(P.a,{style:{paddingLeft:0},onClick:function(){Pe.page=1,Pe.keyword=null,delete Pe.id,Yt(Pe),$a(!1),$i(Pe)},type:"link"}," ",y.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),y.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",decodeURIComponent(Pe.keyword),"\u201D")):null,y.a.createElement("div",{className:pe.a.contentListWrap},On!==0?y.a.createElement(W.a,{size:"large",spinning:Un["problemset/getItemBanks"]},Bn.map(function(et,Qe){var Ge,nt;return y.a.createElement("div",{className:pe.a.li},y.a.createElement("div",{className:pe.a.top},y.a.createElement(fi.b,{key:et.id,data:et,selectIds:ve,onSelectCheckBox:_r})),y.a.createElement("div",{className:pe.a.bottom},y.a.createElement("p",{className:"".concat(pe.a.actionLeftItem," ").concat(pe.a.questionTypeName)},(Ge=Ra.find(function(ot){return ot.type===et.item_type}))===null||Ge===void 0?void 0:Ge.name),y.a.createElement("p",{className:pe.a.actionLeftItem},la[et.difficulty]),y.a.createElement("p",{className:pe.a.actionLeftItem},"\u521B\u5EFA\u8005",y.a.createElement("span",{className:"c-grey-333"},et==null||((nt=et.author)===null||nt===void 0)?void 0:nt.name)),y.a.createElement("p",{className:pe.a.actionLeftItem},"\u66F4\u65B0",y.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.updated_at)),y.a.createElement("p",{className:pe.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",y.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.quotes)),!Ze&&y.a.createElement("div",{className:pe.a.more},ar({},et))))})):y.a.createElement(W.a,{size:"large",spinning:Un["problemset/getItemBanks"]},y.a.createElement(ie.a,null))),On!==0&&!Ze&&y.a.createElement(V.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:Pe==null?void 0:Pe.per_page,current:Pe.page||1,total:On,showTotal:function(Qe){return y.a.createElement("span",{className:"mr10"},"\u5171",y.a.createElement("span",{className:"c-light-primary"},Qe),"\u6761\u6570\u636E")}}),Ze&&y.a.createElement("div",{style:{height:20}})),je&&y.a.createElement(nn,{basketData:zt.basketData,visible:wa,basketTotal:_a,onClose:function(){return ho(!1)},onDelete:Mo}),!Object(Si.m)()&&je&&y.a.createElement(Ci,{visibleBasket:wa,onToggleVisible:function(){return ho(!wa)},count:_a})),y.a.createElement(he,null),y.a.createElement(qe,{onReloadData:Pi}),y.a.createElement(pt,{onReloadData:function(){return Dr([null])}}),y.a.createElement(Gt,{onReloadData:Pi,onReloadBasketData:Xr}),Nn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?y.a.createElement(Qr,{shixunIds:re,cb:Yi}):null,y.a.createElement(xt,null),y.a.createElement(Ye,null),y.a.createElement(St,null),y.a.createElement(ut,null),y.a.createElement(Ue,null),y.a.createElement(it,{onOk:_o}),y.a.createElement(q.a,{onOk:Ga})),je?y.a.createElement(H.Fragment,null,!!(ve!=null&&ve.length)&&y.a.createElement("div",{className:pe.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(a.a,{className:"font14",checked:Bn!=null&&Bn.length?ve.length===(Bn==null?void 0:Bn.length):!1,onChange:function(Qe){return sa(Qe.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",ve==null?void 0:ve.length,")"))),y.a.createElement("div",{className:pe.a.btns},Hn&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!0)}},y.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Hn&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!1)}},y.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return io()}},y.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:ao}," ",y.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Ha()}}," ",y.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:Pr}," ",y.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:oi}," ",y.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),y.a.createElement("div",{onClick:function(){return ke([])},style:{marginLeft:"auto"},className:pe.a.btn}," ",y.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):Ze?"":y.a.createElement("div",{className:pe.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(a.a,{className:"font14",checked:Bn!=null&&Bn.length?ve.length===(Bn==null?void 0:Bn.length):!1,onChange:function(Qe){return sa(Qe.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",ve==null?void 0:ve.length,")"))),y.a.createElement("div",{className:pe.a.btns},Hn&&!!(ve!=null&&ve.length)&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!0)}},y.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Hn&&!!(ve!=null&&ve.length)&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!1)}},y.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),y.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",$t,"\u9898"),y.a.createElement("div",{onClick:ea,className:pe.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),Ze&&y.a.createElement("div",{className:pe.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(V.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:Pe==null?void 0:Pe.per_page,current:Pe.page||1,hideOnSinglePage:!0,total:On,showTotal:function(Qe){return y.a.createElement("span",{className:"mr10"},"\u5171",y.a.createElement("span",{className:"c-light-primary"},Qe),"\u6761\u6570\u636E")}})),y.a.createElement("div",{className:pe.a.btns},y.a.createElement(Z.a,{align:"middle",style:{marginLeft:"auto"}},y.a.createElement(Z.a,{onClick:function(){if((Tn==null?void 0:Tn.length)<=0){c.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}vi(!0)},align:"middle",className:"current"},y.a.createElement("i",{className:"iconfont icon-yixuan mr10 c-light-primary font20"}),y.a.createElement("span",null,"\u5DF2\u9009",y.a.createElement("span",{className:"c-light-primary"},ve.length),"\u4E2A")),y.a.createElement(P.a,{className:"mr20 ml40",onClick:function(){if(mt){var Qe;x.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework/").concat(jt==null||((Qe=jt.params)===null||Qe===void 0)?void 0:Qe.categoryId,"/detail?tabs=1"));return}x.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),y.a.createElement(P.a,{loading:Xn,onClick:La,type:"primary"},"\u786E\u8BA4",mt?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},Li=Xe.default=Object(x.a)(function(Zt){var dt=Zt.classroomList,kt=Zt.problemset,Lt=Zt.user,Kt=Zt.loading,sn=Zt.globalSetting,En=Zt.shixunHomeworks;return{classroomList:dt,problemset:kt,user:Lt,globalSetting:sn,loading:Kt.effects,shixunHomeworks:En}})(hi)},LE3n:function(ft,Xe,G){"use strict";var de=G("ozfa"),Z=G("MJZm"),M=G("k1fw"),V=G("+L6B"),I=G("2/Rp"),B=G("5NDa"),K=G("5rEg"),W=G("2qtc"),L=G("kLXV"),P=G("miYZ"),b=G("tsqr"),p=G("9og8"),_=G("tJVT"),h=G("WmNS"),r=G.n(h),d=G("q1tI"),l=G.n(d),a=G("1vnw"),u=G.n(a),c=G("ErOA"),R=G("Ix/O"),O=G.n(R),T=G("xTzM"),A=G.n(T),w=G("WCUW"),m=G("LvDl"),v=G.n(m),s=function(g){var C=g.isProblemset,N=g.name,U=g.id,j=g.itemBanksCount,H=g.onOpen,y=H===void 0?function(){}:H,x=g.onShare,F=x===void 0?function(){}:x,Q=g.onMove,q=Q===void 0?function(){}:Q,ie=g.onDeleteOk,ge=ie===void 0?function(){}:ie,fe=Object(d.useState)(!1),ue=Object(_.a)(fe,2),he=ue[0],_e=ue[1],le=Object(d.useState)(N),ne=Object(_.a)(le,2),Te=ne[0],Fe=ne[1],Ke=Object(d.useState)(N),Ue=Object(_.a)(Ke,2),He=Ue[0],Ne=Ue[1],Be=function(){var tt=Object(p.a)(r.a.mark(function it(rt){var qe,gt,pt;return r.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(qe=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],He.trim()){at.next=4;break}return b.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),at.abrupt("return");case 4:if(!(He.charAt(0)===" ")){at.next=7;break}return b.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),at.abrupt("return");case 7:gt=0;case 8:if(!(gt<He.length)){at.next=15;break}if(!qe.includes(He.charAt(gt))){at.next=12;break}return b.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),at.abrupt("return",!1);case 12:gt++,at.next=8;break;case 15:return at.next=17,Object(c.a)("/api/item_banks_groups/".concat(Math.abs(rt),".json"),{method:"put",body:{name:He}});case 17:pt=at.sent,pt.status===0&&(_e(!1),Fe(He));case 19:case"end":return at.stop()}},it)}));return function(rt){return tt.apply(this,arguments)}}(),Je=function(it){L.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:l.a.createElement("div",null,l.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),l.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var rt=Object(p.a)(r.a.mark(function gt(){var pt;return r.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return at.next=2,Object(c.a)("/api/item_banks_groups/".concat(Math.abs(it),".json"),{method:"delete",body:{}});case 2:pt=at.sent,pt.status===0&&ge(it);case 4:case"end":return at.stop()}},gt)}));function qe(){return rt.apply(this,arguments)}return qe}()})};return l.a.createElement("div",{className:u.a.list},he?l.a.createElement(K.a,{style:{maxWidth:780},value:He,onChange:function(it){return Ne(it.target.value)}}):l.a.createElement("div",{title:Te,onClick:function(){return y(U)},className:u.a.name},Te),C&&l.a.createElement("div",{className:u.a.btns},he?l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{style:{height:16},onClick:function(){return Be(U)},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),l.a.createElement("div",{style:{height:16},onClick:function(){Ne(Te),_e(!1)},className:"ml10"},l.a.createElement("i",{className:"iconfont icon-qingchu"}))):l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{onClick:function(){return q(U,"up")},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),l.a.createElement("div",{onClick:function(){return q(U,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},l.a.createElement("i",{className:"iconfont icon-shangyi3"}))),l.a.createElement(I.a,{className:"ml10",onClick:function(){if(!j){b.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}F(Math.abs(U))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),l.a.createElement(I.a,{className:"ml10",onClick:function(){return _e(!0)},type:"link"},"\u91CD\u547D\u540D"),l.a.createElement(I.a,{onClick:function(){return Je(U)},type:"link",danger:!0},"\u5220\u9664")))},o=function(g){var C=g.isProblemset,N=g.data,U=g.onOpen,j=U===void 0?function(){}:U,H=g.onShare,y=H===void 0?function(){}:H,x=g.reloadData,F=Object(d.useState)(),Q=Object(_.a)(F,2),q=Q[0],ie=Q[1];Object(d.useEffect)(function(){ie(N==null?void 0:N.map(function(Te){return{title:l.a.createElement(s,{isProblemset:C,name:Te.name,id:Te.id,itemBanksCount:Te.item_banks_count,onMove:fe,onOpen:j,onShare:y,onDeleteOk:he}),key:Te.id,icon:l.a.createElement("img",{src:O.a,className:u.a.folderIcon}),isLeaf:!1}}))},[N]);var ge=function Te(Fe,Ke,Ue){for(var He=Object(m.cloneDeep)(Fe),Ne=0;Ne<He.length;Ne++){if(He[Ne].key===Ke){if(Ue==="up"){var Be=[He[Ne],He[Ne-1]];He[Ne-1]=Be[0],He[Ne]=Be[1]}else{var Je=[He[Ne+1],He[Ne]];He[Ne]=Je[0],He[Ne+1]=Je[1]}break}He[Ne].children&&(He[Ne].children=Te(He[Ne].children,Ke,Ue))}return He},fe=function(){var Te=Object(p.a)(r.a.mark(function Fe(Ke,Ue){var He;return r.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(!(Ue==="up")){Be.next=6;break}return Be.next=3,Object(w.I)({id:Math.abs(Ke)});case 3:Be.t0=Be.sent,Be.next=9;break;case 6:return Be.next=8,Object(w.H)({id:Math.abs(Ke)});case 8:Be.t0=Be.sent;case 9:He=Be.t0,He.status===0&&ie(function(Je){return ge(Je,Ke,Ue)});case 11:case"end":return Be.stop()}},Fe)}));return function(Ke,Ue){return Te.apply(this,arguments)}}(),ue=function Te(Fe,Ke){return Fe.filter(function(Ue){return Ue.key===Ke?!1:(Ue.children&&(Ue.children=Te(Ue.children,Ke)),!0)})},he=function(Fe){ie(function(Ke){return ue(Ke,Fe)}),x()},_e=function Te(Fe,Ke,Ue){return Fe.map(function(He){return He.key===Ke?Object(M.a)(Object(M.a)({},He),Ue):He.children?Object(M.a)(Object(M.a)({},He),{},{children:Te(He.children,Ke,Ue)}):He})},le=function(){var Te=Object(p.a)(r.a.mark(function Fe(Ke){var Ue,He,Ne,Be,Je;return r.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return Ue=Ke.key,it.next=3,Object(w.B)({group_id:Math.abs(Ue)});case 3:He=it.sent,Ne=He||{},Be=Ne.item_banks_group,Je=Ne.item_banks_group_count,Je>0?ie(function(rt){return _e(rt,Ue,{children:Be.map(function(qe){return{title:l.a.createElement(s,{isProblemset:C,name:qe.name,id:qe.id,itemBanksCount:qe.item_banks_count,onMove:fe,onOpen:j,onShare:y,onDeleteOk:he}),key:qe.id,icon:l.a.createElement("img",{src:O.a,className:u.a.folderIcon}),isLeaf:!1}})})}):ie(function(rt){return _e(rt,Ue,{isLeaf:!0})});case 6:case"end":return it.stop()}},Fe)}));return function(Ke){return Te.apply(this,arguments)}}(),ne=function(Fe,Ke){var Ue=Ke.node,He=Ke.expanded;ie(function(Ne){return _e(Ne,Ue.key,{icon:He?l.a.createElement("img",{src:A.a,className:u.a.folderIcon}):l.a.createElement("img",{src:O.a,className:u.a.folderIcon})})})};return(q==null?void 0:q.length)>0&&l.a.createElement(Z.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:q,loadData:le,onExpand:ne,className:u.a.folderWrapper,selectable:!1})};Xe.a=o},LdHM:function(ft,Xe,G){"use strict";G.d(Xe,"b",function(){return c}),G.d(Xe,"a",function(){return O});var de=G("1OyB"),Z=G("vuIU"),M=G("Ji7U"),V=G("LK+K"),I=G("q1tI"),B=G("rePB"),K=G("Ff2n"),W=G("ODXe"),L=G("4IlW"),P=G("bX4T"),b=G("YrtM"),p=G("TSYQ"),_=G.n(p),h=G("+nKL"),r=G("8OUc"),d=function(F,Q){var q=F.prefixCls,ie=F.id,ge=F.flattenOptions,fe=F.childrenAsData,ue=F.values,he=F.searchValue,_e=F.multiple,le=F.defaultActiveFirstOption,ne=F.height,Te=F.itemHeight,Fe=F.notFoundContent,Ke=F.open,Ue=F.menuItemSelectedIcon,He=F.virtual,Ne=F.onSelect,Be=F.onToggleOpen,Je=F.onActiveValue,tt=F.onScroll,it=F.onMouseEnter,rt="".concat(q,"-item"),qe=Object(b.a)(function(){return ge},[Ke,ge],function(ut,be){return be[0]&&ut[1]!==be[1]}),gt=I.useRef(null),pt=function(be){be.preventDefault()},vt=function(be){gt.current&&gt.current.scrollTo({index:be})},at=function(be){for(var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=qe.length,se=0;se<pe;se+=1){var ce=(be+se*xe+pe)%pe,Ee=qe[ce],Ae=Ee.group,De=Ee.data;if(!Ae&&!De.disabled)return ce}return-1},Rt=I.useState(function(){return at(0)}),xt=Object(W.a)(Rt,2),Tt=xt[0],Ye=xt[1],Mt=function(be){Ye(be);var xe=qe[be];if(!xe){Je(null,-1);return}Je(xe.data.value,be)};I.useEffect(function(){Mt(le!==!1?at(0):-1)},[qe.length,he]),I.useEffect(function(){var ut=setTimeout(function(){if(!_e&&Ke&&ue.size===1){var be=Array.from(ue)[0],xe=qe.findIndex(function(pe){var se=pe.data;return se.value===be});Mt(xe),vt(xe)}});return function(){return clearTimeout(ut)}},[Ke]);var St=function(be){be!==void 0&&Ne(be,{selected:!ue.has(be)}),_e||Be(!1)};if(I.useImperativeHandle(Q,function(){return{onKeyDown:function(be){var xe=be.which;switch(xe){case L.a.UP:case L.a.DOWN:{var pe=0;if(xe===L.a.UP?pe=-1:xe===L.a.DOWN&&(pe=1),pe!==0){var se=at(Tt+pe,pe);vt(se),Mt(se)}break}case L.a.ENTER:{var ce=qe[Tt];ce&&!ce.data.disabled?St(ce.data.value):St(void 0),Ke&&be.preventDefault();break}case L.a.ESC:Be(!1)}},onKeyUp:function(){},scrollTo:function(be){vt(be)}}}),qe.length===0)return I.createElement("div",{role:"listbox",id:"".concat(ie,"_list"),className:"".concat(rt,"-empty"),onMouseDown:pt},Fe);function ze(ut){var be=qe[ut];if(!be)return null;var xe=be.data||{},pe=xe.value,se=xe.label,ce=xe.children,Ee=Object(P.a)(xe,!0),Ae=fe?ce:se;return be?I.createElement("div",Object.assign({"aria-label":typeof Ae=="string"?Ae:null},Ee,{key:ut,role:"option",id:"".concat(ie,"_list_").concat(ut),"aria-selected":ue.has(pe)}),pe):null}return I.createElement(I.Fragment,null,I.createElement("div",{role:"listbox",id:"".concat(ie,"_list"),style:{height:0,width:0,overflow:"hidden"}},ze(Tt-1),ze(Tt),ze(Tt+1)),I.createElement(h.a,{itemKey:"key",ref:gt,data:qe,height:ne,itemHeight:Te,fullHeight:!1,onMouseDown:pt,onScroll:tt,virtual:He,onMouseEnter:it},function(ut,be){var xe,pe=ut.group,se=ut.groupOption,ce=ut.data,Ee=ce.label,Ae=ce.key;if(pe)return I.createElement("div",{className:_()(rt,"".concat(rt,"-group"))},Ee!==void 0?Ee:Ae);var De=ce.disabled,$e=ce.value,lt=ce.title,Bt=ce.children,tn=ce.style,nn=ce.className,_n=Object(K.a)(ce,["disabled","value","title","children","style","className"]),yn=ue.has($e),Gt="".concat(rt,"-option"),ii=_()(rt,Gt,nn,(xe={},Object(B.a)(xe,"".concat(Gt,"-grouped"),se),Object(B.a)(xe,"".concat(Gt,"-active"),Tt===be&&!De),Object(B.a)(xe,"".concat(Gt,"-disabled"),De),Object(B.a)(xe,"".concat(Gt,"-selected"),yn),xe)),Dn=fe?Bt:Ee,Ci=!Ue||typeof Ue=="function"||yn;return I.createElement("div",Object.assign({},_n,{"aria-selected":yn,className:ii,title:lt,onMouseMove:function(){if(Tt===be||De)return;Mt(be)},onClick:function(){De||St($e)},style:tn}),I.createElement("div",{className:"".concat(Gt,"-content")},Dn||$e),I.isValidElement(Ue)||yn,Ci&&I.createElement(r.a,{className:"".concat(rt,"-option-state"),customizeIcon:Ue,customizeIconProps:{isSelected:yn}},yn?"\u2713":null))}))},l=I.forwardRef(d);l.displayName="OptionList";var a=l,u=function(){return null};u.isSelectOption=!0;var c=u,R=function(){return null};R.isSelectOptGroup=!0;var O=R,T=G("VTBJ"),A=G("Zm9Q");function w(x){var F=x.key,Q=x.props,q=Q.children,ie=Q.value,ge=Object(K.a)(Q,["children","value"]);return Object(T.a)({key:F,value:ie!==void 0?ie:F,children:q},ge)}function m(x){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(x).map(function(Q,q){if(!I.isValidElement(Q)||!Q.type)return null;var ie=Q.type.isSelectOptGroup,ge=Q.key,fe=Q.props,ue=fe.children,he=Object(K.a)(fe,["children"]);return F||!ie?w(Q):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(ge===null?q:ge,"__"),label:ge},he),{},{options:m(ue)})}).filter(function(Q){return Q})}var v=G("2Qr1"),s=G("qNPg"),o=G("U8pU"),E=G("Kwbf"),g=G("WKfj");function C(x){var F=x.mode,Q=x.options,q=x.children,ie=x.backfill,ge=x.allowClear,fe=x.placeholder,ue=x.getInputElement,he=x.showSearch,_e=x.onSearch,le=x.defaultOpen,ne=x.autoFocus,Te=x.labelInValue,Fe=x.value,Ke=x.inputValue,Ue=x.optionLabelProp,He=F==="multiple"||F==="tags",Ne=he!==void 0?he:He||F==="combobox",Be=Q||m(q);if(Object(E.a)(F!=="tags"||Be.every(function(rt){return!rt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),F==="tags"||F==="combobox"){var Je=Be.some(function(rt){return rt.options?rt.options.some(function(qe){return typeof("value"in qe?qe.value:qe.key)=="number"}):typeof("value"in rt?rt.value:rt.key)=="number"});Object(E.a)(!Je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(F!=="combobox"||!Ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(F==="combobox"||!ie,"`backfill` only works with `combobox` mode."),Object(E.a)(F==="combobox"||!ue,"`getInputElement` only work with `combobox` mode."),Object(E.b)(F!=="combobox"||!ue||!ge||!fe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!Ne&&F!=="combobox"&&F!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!le||ne,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Fe!=null){var tt=Object(g.d)(Fe);Object(E.a)(!Te||tt.every(function(rt){return Object(o.a)(rt)==="object"&&("key"in rt||"value"in rt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!He||Array.isArray(Fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(q){var it=null;Object(A.a)(q).some(function(rt){if(!I.isValidElement(rt)||!rt.type)return!1;var qe=rt.type;if(qe.isSelectOption)return!1;if(qe.isSelectOptGroup){var gt=Object(A.a)(rt.props.children).every(function(pt){return!I.isValidElement(pt)||!rt.type||pt.type.isSelectOption?!0:(it=pt.type,!1)});return!gt}return it=qe,!0}),it&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(it.displayName||it.name||it,"`.")),Object(E.a)(Ke===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=C,U=Object(s.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:m,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:N,fillOptionsWithMissingValue:v.a}),j=function(x){Object(M.a)(Q,x);var F=Object(V.a)(Q);function Q(){var q;return Object(de.a)(this,Q),q=F.apply(this,arguments),q.selectRef=I.createRef(),q.focus=function(){q.selectRef.current.focus()},q.blur=function(){q.selectRef.current.blur()},q}return Object(Z.a)(Q,[{key:"render",value:function(){return I.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),Q}(I.Component);j.Option=c,j.OptGroup=O;var H=j,y=Xe.c=H},M8RZ:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return L});var de=G("fWQN"),Z=G("mtLc"),M=G("yKVA"),V=G("879j"),I=G("q1tI"),B=G.n(I),K=G("i8i4"),W=G.n(K),L=function(P){Object(M.a)(p,P);var b=Object(V.a)(p);function p(_){var h;Object(de.a)(this,p),h=b.call(this,_);var r=window.document;return h.node=r.createElement("div"),r.body.appendChild(h.node),h}return Object(Z.a)(p,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(B.a.Component)},NLgs:function(ft,Xe,G){"use strict";G.d(Xe,"e",function(){return c}),G.d(Xe,"f",function(){return R}),G.d(Xe,"d",function(){return T}),G.d(Xe,"c",function(){return A}),G.d(Xe,"a",function(){return w}),G.d(Xe,"b",function(){return m});var de=G("miYZ"),Z=G("tsqr"),M=G("9og8"),V=G("2qtc"),I=G("kLXV"),B=G("WmNS"),K=G.n(B),W=G("q1tI"),L=G.n(W),P=G("9kvl"),b=G("xKgJ"),p=G("1vsH"),_=G("RCxd"),h=G("yTi+"),r=G.n(h),d=G("1ZF9"),l=G.n(d),a=G("NoGO"),u=G.n(a),c=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(R(s)&&O(o))},R=function(s){return Object(b.p)()?!0:(s({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},O=function(){var s,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(P.c)()._store.getState(),g=E.user;return(s=g.userInfo)!==null&&s!==void 0&&s.profile_completed?!0:(I.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:o?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){P.d.push("/account/profile/edit")}}),!1)},T=function(){var s,o=Object(P.c)()._store.getState(),E=o.user;return(s=E.userInfo)!==null&&s!==void 0&&s.professional_certification?!0:(I.a.confirm({title:"\u63D0\u793A",centered:!0,content:L.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(p.S)("/account/certification")}}),!1)},A=function(){return Object(b.a)()?!0:(I.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),L.a.createElement("img",{src:u.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},w=function(s,o){return s?!0:(I.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",null,L.a.createElement("p",null,o||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),L.a.createElement("div",{style:{marginLeft:"110px"}},L.a.createElement("img",{src:l.a,width:200}),L.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(p.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},m=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(P.c)()._store.getState(),g=E.shixunsDetail.detail;return(g==null?void 0:g.public)===2||(g==null?void 0:g.public)===1||(g==null?void 0:g.shixun_status)===3?(I.a.info({centered:!0,icon:L.a.createElement(_.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(g==null?void 0:g.public)===2?"\u5DF2\u516C\u5F00":(g==null?void 0:g.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",o,"\u3002"),L.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),L.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:r.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(g==null?void 0:g.shixun_status)===2?(I.a.confirm({centered:!0,icon:L.a.createElement(_.a,null),title:"\u63D0\u793A",content:L.a.createElement("div",null,L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",o,"\u3002"),L.a.createElement("br",null),L.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){I.a.confirm({width:440,centered:!0,icon:L.a.createElement(_.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var N=Object(M.a)(K.a.mark(function j(){var H;return K.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,s({type:"shixunsDetail/cancelRelease",payload:{id:g==null?void 0:g.identifier}});case 2:H=x.sent,H.status!==401&&(Z.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),s({type:"shixunsDetail/getShixunsDetail",payload:{id:g==null?void 0:g.identifier}}),s({type:"practiceSetting/getCommonData",payload:{id:g==null?void 0:g.identifier}}));case 4:case"end":return x.stop()}},j)}));function U(){return N.apply(this,arguments)}return U}()})}}),!0):!1}},NoGO:function(ft,Xe,G){ft.exports=G.p+"static/newqrcode.d852fdfc.png"},NvD2:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return B});var de=G("Kwbf");function Z(K,W){var L=new Set;return K.forEach(function(P){W.has(P)||L.add(P)}),L}function M(K){var W=K||{},L=W.disabled,P=W.disableCheckbox,b=W.checkable;return!!(L||P)||b===!1}function V(K,W,L,P){for(var b=new Set(K),p=new Set,_=0;_<=L;_+=1){var h=W.get(_)||new Set;h.forEach(function(a){var u=a.key,c=a.node,R=a.children,O=R===void 0?[]:R;b.has(u)&&!P(c)&&O.filter(function(T){return!P(T.node)}).forEach(function(T){b.add(T.key)})})}for(var r=new Set,d=L;d>=0;d-=1){var l=W.get(d)||new Set;l.forEach(function(a){var u=a.parent,c=a.node;if(P(c)||!a.parent||r.has(a.parent.key))return;if(P(a.parent.node)){r.add(u.key);return}var R=!0,O=!1;(u.children||[]).filter(function(T){return!P(T.node)}).forEach(function(T){var A=T.key,w=b.has(A);R&&!w&&(R=!1),!O&&(w||p.has(A))&&(O=!0)}),R&&b.add(u.key),O&&p.add(u.key),r.add(u.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(Z(p,b))}}function I(K,W,L,P,b){for(var p=new Set(K),_=new Set(W),h=0;h<=P;h+=1){var r=L.get(h)||new Set;r.forEach(function(u){var c=u.key,R=u.node,O=u.children,T=O===void 0?[]:O;!p.has(c)&&!_.has(c)&&!b(R)&&T.filter(function(A){return!b(A.node)}).forEach(function(A){p.delete(A.key)})})}_=new Set;for(var d=new Set,l=P;l>=0;l-=1){var a=L.get(l)||new Set;a.forEach(function(u){var c=u.parent,R=u.node;if(b(R)||!u.parent||d.has(u.parent.key))return;if(b(u.parent.node)){d.add(c.key);return}var O=!0,T=!1;(c.children||[]).filter(function(A){return!b(A.node)}).forEach(function(A){var w=A.key,m=p.has(w);O&&!m&&(O=!1),!T&&(m||_.has(w))&&(T=!0)}),O||p.delete(c.key),T&&_.add(c.key),d.add(c.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Z(_,p))}}function B(K,W,L,P){var b=[],p;P?p=P:p=M;var _=new Set(K.filter(function(l){var a=!!L[l];return a||b.push(l),a})),h=new Map,r=0;Object.keys(L).forEach(function(l){var a=L[l],u=a.level,c=h.get(u);c||(c=new Set,h.set(u,c)),c.add(a),r=Math.max(r,u)}),Object(de.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var d;return W===!0?d=V(_,h,r,p):d=I(_,W.halfCheckedKeys,h,r,p),d}},"ORt/":function(ft,Xe,G){ft.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(ft,Xe,G){"use strict";G.d(Xe,"b",function(){return P}),G.d(Xe,"a",function(){return b}),G.d(Xe,"k",function(){return p}),G.d(Xe,"h",function(){return _}),G.d(Xe,"i",function(){return h}),G.d(Xe,"g",function(){return r}),G.d(Xe,"c",function(){return d}),G.d(Xe,"d",function(){return l}),G.d(Xe,"j",function(){return c}),G.d(Xe,"e",function(){return R}),G.d(Xe,"f",function(){return O});var de=G("KQm4"),Z=G("U8pU"),M=G("Ff2n"),V=G("q1tI"),I=G.n(V),B=G("Kwbf"),K=G("WaYH"),W=.25,L=2;function P(T,A){var w=T.slice(),m=w.indexOf(A);return m>=0&&w.splice(m,1),w}function b(T,A){var w=T.slice();return w.indexOf(A)===-1&&w.push(A),w}function p(T){return T.split("-")}function _(T,A){return"".concat(T,"-").concat(A)}function h(T){return T&&T.type&&T.type.isTreeNode}function r(T,A){var w=[T],m=A[T];function v(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(o){var E=o.key,g=o.children;w.push(E),v(g)})}return v(m.children),w}function d(T,A){var w=T.clientY,m=A.selectHandle.getBoundingClientRect(),v=m.top,s=m.bottom,o=m.height,E=Math.max(o*W,L);return w<=v+E?-1:w>=s-E?1:0}function l(T,A){if(!T)return;var w=A.multiple;return w?T.slice():T.length?[T[0]]:T}var a=function(A){return A};function u(T,A){if(!T)return[];var w=A||{},m=w.processProps,v=m===void 0?a:m,s=Array.isArray(T)?T:[T];return s.map(function(o){var E=o.children,g=Object(M.a)(o,["children"]),C=u(E,A);return I.a.createElement(K.a,Object.assign({},v(g)),C)})}function c(T){if(!T)return null;var A;if(Array.isArray(T))A={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(Z.a)(T)==="object")A={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(B.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function R(T,A){var w=new Set;function m(v){if(w.has(v))return;var s=A[v];if(!s)return;w.add(v);var o=s.parent,E=s.node;if(E.disabled)return;o&&m(o.key)}return(T||[]).forEach(function(v){m(v)}),Object(de.a)(w)}function O(T){var A={};return Object.keys(T).forEach(function(w){(w.startsWith("data-")||w.startsWith("aria-"))&&(A[w]=T[w])}),A}},Ot1p:function(ft,Xe,G){"use strict";var de=G("2qtc"),Z=G("kLXV"),M=G("rAM+"),V=G("miYZ"),I=G("tsqr"),B=G("9og8"),K=G("tJVT"),W=G("jrin"),L=G("WmNS"),P=G.n(L),b=G("q1tI"),p=G.n(b),_=G("VrN/"),h=G.n(_),r=G("bdgK"),d=G("p77/"),l=G("Bd2K"),a=G("ELLl"),u=G("19Vz"),c=G("lZu9"),R=G("+NIl"),O=G("kSUc"),T=G("9Bee"),A=function(De){var $e=De.value,lt=$e===void 0?"":$e,Bt=De.className,tn=De.showTextOnly,nn=De.showLines,_n=De.style,yn=_n===void 0?{}:_n,Gt=Object(b.useMemo)(function(){return""},[lt]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Gt}}))},w=G("0Owb"),m=G("dejd"),v=G("C+DQ"),s=G("1vsH"),o=G("m3rI"),E=[{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 g(De){var $e=De.onActionCallback,lt=De.title,Bt=De.icon,tn=De.actionName,nn=De.className,_n=nn===void 0?"":nn,yn=De.children;function Gt(){$e(tn)}return p.a.createElement("a",{title:lt,className:_n,onClick:Gt},p.a.createElement("i",{className:"md-iconfont ".concat(Bt)}),yn)}var C=function(De){var $e=De.watch,lt=De.showNullButton,Bt=De.onActionCallback,tn=De.fullScreen,nn=De.insertTemp,_n=De.hidetoolBar,yn=De.uuid,Gt=De.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(yn,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var ii=[].concat(E,[{title:"".concat($e?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat($e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!_n&&ii.map(function(Dn,Ci){return p.a.createElement("li",{key:Ci},Dn.actionName?p.a.createElement(g,Object(w.a)({},Dn,{onActionCallback:Bt})):p.a.createElement("span",{className:"v-line"}))}),lt?p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Bt},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,nn&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(nn),onActionCallback:Bt},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(g,{icon:"".concat(tn?"icon-shrink":"icon-enlarge"),title:tn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Bt})))},N=G("M8RZ"),U=G("+L6B"),j=G("2/Rp"),H=G("y8nQ"),y=G("Vl3Y"),x=G("5NDa"),F=G("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},q=function(De){var $e=De.callback,lt=De.onCancel;function Bt(tn){$e(tn)}return p.a.createElement(y.a,Object(w.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Bt}),p.a.createElement(y.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(F.a,null)),p.a.createElement(y.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(F.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},ie=G("7ahc"),ge=G("HmJG"),fe=G("BjJ7"),ue=y.a.useForm,he={width:280,marginRight:10},_e={labelCol:{span:5},wrapperCol:{span:19}},le=function(De){var $e=De.callback,lt=De.onCancel,Bt=ue(),tn=Object(K.a)(Bt,1),nn=tn[0];function _n(ii){$e(ii)}function yn(ii,Dn){if(ii.status===-1){I.b.error(ii.message);return}nn.setFieldsValue({src:"/api/attachments/".concat(ii.id),type:Dn.type})}function Gt(ii){var Dn=ii.target.files[0];Te(Dn,yn)}return p.a.createElement(y.a,Object(w.a)({form:nn},_e,{className:"upload-image-panel",onFinish:_n}),p.a.createElement(y.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(y.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(F.a,{style:he})),p.a.createElement(ne,{onFileChange:Gt}))),p.a.createElement(y.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(F.a,{style:{width:264}})),p.a.createElement(y.a.Item,{style:{textAlign:"right"}},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))};function ne(De){var $e=De.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:$e}))}function Te(De,$e){if(!De)throw new String("\u6CA1\u6709\u6587\u4EF6");var lt=new FormData;lt.append("editormd-image-file",De),lt.append("file_param_name","editormd-image-file"),lt.append("byxhr","true");var Bt=new window.XMLHttpRequest;Bt.withCredentials=!0,Bt.addEventListener("load",function(tn){$e(JSON.parse(tn.target.responseText),De)},!1),Bt.addEventListener("error",function(tn){console.error(tn)},!1),Bt.open("POST","".concat(fe.a,"/api/attachments.json")),Bt.send(lt)}var Fe=G("giR+"),Ke=G("fyUT"),Ue=G("7Kak"),He=G("9yH6"),Ne=He.a.Group,Be={margin:"0 8px"},Je=function(De){var $e=De.callback,lt=De.onCancel;function Bt(tn){$e(tn)}return p.a.createElement(y.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Bt},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Be},"\u884C\u6570"),p.a.createElement(y.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Ke.a,null)),p.a.createElement("span",{style:Be},"\u5217\u6570"),p.a.createElement(y.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Ke.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(y.a.Item,{name:"align"},p.a.createElement(Ne,null,p.a.createElement(He.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(He.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(He.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(He.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},tt=G("ErOA"),it=G("7Cbv"),rt="link",qe="upload-image",gt="code-block",pt="add-table",vt="------------",at={default:vt,left:":".concat(vt),center:":".concat(vt,":"),right:"".concat(vt,":")},Rt=G("9VGf"),xt,Tt;function Ye(){}var Mt=0,St=1e4,ze="\u2581",ut=`
**\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 be(De){return/^\d+$/.test(De)?"".concat(De,"px"):De}var xe=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=xe?"Cmd":"Ctrl",se=["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"],ce=(xt={},Object(W.a)(xt,pe+"-B","bold"),Object(W.a)(xt,pe+"-I","italic"),xt),Ee=(Tt={},Object(W.a)(Tt,rt,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Tt,gt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Tt,qe,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Tt,pt,"\u6DFB\u52A0\u8868\u683C"),Tt),Ae=Xe.a=function(De){var $e=De.defaultValue,lt=$e===void 0?"":$e,Bt=De.onChange,tn=De.width,nn=tn===void 0?"100%":tn,_n=De.height,yn=_n===void 0?400:_n,Gt=De.miniToolbar,ii=Gt===void 0?!1:Gt,Dn=De.isFocus,Ci=Dn===void 0?!1:Dn,fi=De.watch,In=De.insertTemp,Ri=De.mode,Si=Ri===void 0?"markdown":Ri,Ot=De.id,bn=Ot===void 0?"markdown-editor-id":Ot,Cn=De.showResizeBar,kn=Cn===void 0?!1:Cn,Ai=De.noStorage,Ui=Ai===void 0?!1:Ai,dr=De.showNullButton,mn=dr===void 0?!1:dr,Jt=De.hidetoolBar,qi=Jt===void 0?!1:Jt,hr=De.fullScreen,sr=hr===void 0?!1:hr,Fn=De.onBlur,er=De.onCMBeforeChange,kr=De.onFullScreen,Qr=De.className,yt=Qr===void 0?"":Qr,cn=De.disablePaste,Kr=cn===void 0?!1:cn,zr=De.placeholder,na=zr===void 0?"":zr,Gr=De.values,$=Gr===void 0?"":Gr,S=Object(b.useState)(null),D=Object(K.a)(S,2),z=D[0],te=D[1],Y=Object(b.useState)(lt),Le=Object(K.a)(Y,2),ct=Le[0],Pt=Le[1],rn=Object(b.useState)(fi),ht=Object(K.a)(rn,2),Vt=ht[0],hi=ht[1],Li=Object(b.useState)(sr),Zt=Object(K.a)(Li,2),dt=Zt[0],kt=Zt[1],Lt=Object(b.useState)(""),Kt=Object(K.a)(Lt,2),sn=Kt[0],En=Kt[1],wn=Object(b.useState)(0),hn=Object(K.a)(wn,2),Ln=hn[0],zn=hn[1],un=Object(b.useState)(yn),Sn=Object(K.a)(un,2),di=Sn[0],Nn=Sn[1],zt=Object(b.useState)(!1),An=Object(K.a)(zt,2),si=An[0],Un=An[1],Xt=Object(b.useRef)(Object(it.a)()),jt=Object(b.useRef)(!1),pn=Object(b.useRef)(),Ct=Object(b.useRef)(),Nt=Object(b.useRef)(),Dt=Object(b.useRef)(),Pe=Object(b.useRef)(),Yt=function(){var Qt=Object(B.a)(P.a.mark(function qt(){var $t,dn;return P.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Mn.next=2,Object(tt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:dn=Mn.sent,dn!=null&&($t=dn.attachments)!==null&&$t!==void 0&&$t.length&&(console.log("cm:",z,Ct),dn.attachments.map(function(qn){qn.content_type.indexOf("image")>-1?z.replaceSelection("![,](/api/attachments/".concat(qn.id,"?type=").concat(qn.content_type,")")):qn.content_type.indexOf("video")>-1?z.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):qn.content_type.indexOf("pdf")>-1?z.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(qn.id,"?type=").concat(qn.content_type,'&disposition=inline" target="_blank">').concat(qn.name,"</a>")):z.replaceSelection("[".concat(qn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(qn.id,"?type=").concat(qn.content_type,")"))}));case 4:case"end":return Mn.stop()}},qt)}));return function(){return Qt.apply(this,arguments)}}();Object(b.useEffect)(function(){Pt($),z==null||z.setValue($)},[$]),Object(b.useEffect)(function(){kr==null||kr(dt)},[dt]),Object(b.useEffect)(function(){if(Ct.current){var Qt=h.a.fromTextArea(Ct.current,{mode:Si,lineNumbers:!ii,lineWrapping:!0,value:lt,autoCloseTags:!0,autoCloseBrackets:!0});Ci&&Qt.focus();function qt($t,dn){if(Kr){dn.preventDefault();return}var Gn=dn.clipboardData;if(Gn){var Mn=Gn.types.toString(),qn=Gn.items;if(Mn==="Files"||Gn.types.indexOf("Files")>-1){if(dn.preventDefault(),Si=="stex")return;try{var mi,Tr=qn[1];((mi=qn[0])===null||mi===void 0?void 0:mi.kind)==="file"&&(Tr=qn[0]);var Zn=Tr.getAsFile(),$r=Zn.name.split(".").pop();Te(Zn,function(gi){if(gi.id){var fr,rr,Mr;(Zn==null||((fr=Zn.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?Qt.replaceSelection("![,](/api/attachments/".concat(gi.id,"?type=").concat(gi.content_type,")")):(Zn==null||((rr=Zn.type)===null||rr===void 0)?void 0:rr.indexOf("video"))>-1?Qt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,'"></video>')):(Zn==null||((Mr=Zn.type)===null||Mr===void 0)?void 0:Mr.indexOf("pdf"))>-1?Qt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,"?type=").concat(Zn.type,'&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):se.includes($r)?Qt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,'?type=office&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):Qt.replaceSelection("[".concat(Zn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,"?type=").concat(gi.content_type,")"))}else(gi==null?void 0:gi.status)===401&&(document.location.href="/user/login")})}catch(gi){I.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Qt.on("paste",qt),Qt.on("dragleave",function($t,dn){Nt.current.classList.remove("mouse-hover-md")}),Qt.on("dragover",function($t,dn){Nt.current.classList.add("mouse-hover-md")}),Qt.on("drop",function($t,dn){Nt.current.classList.add("mouse-hover-md");var Gn;if(Gn=dn.dataTransfer.files,Gn.length>0){dn.preventDefault(),dn.stopPropagation();for(var Mn=function(Tr){var Zn=Gn[Tr],$r=Zn.name.split(".").pop();Te(Zn,function(gi){if(gi.id){var fr,rr,Mr;(Zn==null||((fr=Zn.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?Qt.replaceSelection("![,](/api/attachments/".concat(gi.id,"?type=").concat(gi.content_type,")")):(Zn==null||((rr=Zn.type)===null||rr===void 0)?void 0:rr.indexOf("video"))>-1?Qt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,'"></video>')):(Zn==null||((Mr=Zn.type)===null||Mr===void 0)?void 0:Mr.indexOf("pdf"))>-1?Qt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,"?type=").concat(Zn.type,'&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):se.includes($r)?Qt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,'?type=office&disposition=inline" target="_blank">').concat(Zn.name,"</a>")):Qt.replaceSelection("[".concat(Zn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,"?type=").concat(gi.content_type,")"))}else(gi==null?void 0:gi.status)===401&&(document.location.href="/user/login")})},qn=0;qn<Gn.length;qn++)Mn(qn)}}),te(Qt),function(){Qt.off("paste",qt)}}},[]);var xn=Object(b.useCallback)(function(){if(Nt.current)try{}catch(Qt){console.log(Qt,"---- to set md editor body height")}},[di,Nt,dt]);Object(b.useEffect)(function(){function Qt(){var $t=new r.default(function(dn){var Gn=Object(M.a)(dn),Mn;try{for(Gn.s();!(Mn=Gn.n()).done;){var qn=Mn.value;(qn.target.offsetHeight>0||qn.target.offsetWidth>0)&&(xn(),z.setSize("100%","100%"),z.refresh())}}catch(mi){Gn.e(mi)}finally{Gn.f()}});return $t.observe(Ct.current.parentElement),$t}if(z){var qt=Qt();return function(){qt.unobserve(Ct.current.parentElement)}}},[z,xn]),Object(b.useEffect)(function(){if(z){for(var Qt=[],qt=function(){var qn=dn[$t];Gn=Object(K.a)(qn,2);var mi=Gn[0],Tr=Gn[1],Zn=Object(W.a)({},mi,function(){pi(Tr)});Qt.push(Zn),z.addKeyMap(Zn)},$t=0,dn=Object.entries(ce);$t<dn.length;$t++){var Gn;qt()}return pn.current=setInterval(function(){jt.current&&Yt()},4e3),function(){clearInterval(pn.current);var Mn=Object(M.a)(Qt),qn;try{for(Mn.s();!(qn=Mn.n()).done;){var mi=qn.value;z.removeKeyMap(mi)}}catch(Tr){Mn.e(Tr)}finally{Mn.f()}}}},[z]),Object(b.useEffect)(function(){sr!==dt&&kt(sr)},[sr]),Object(Rt.a)(function(){if(!Ui&&Ln>0){var Qt=new Date().getTime(),qt=window.sessionStorage.getItem(bn);Qt>=Ln+St&&(!qt||qt!==ct)&&(window.sessionStorage.setItem(bn,ct),Un(!0))}},St),Object(b.useEffect)(function(){hi(fi)},[z,fi]),Object(b.useEffect)(function(){z&&(Ci&&z.focus())},[z,Ci]),Object(b.useEffect)(function(){if(Vt&&z){var Qt=z.getScrollerElement();function qt($t){var dn=$t.target;if(Pe.current){var Gn=dn.scrollTop/dn.scrollHeight;Pe.current.scrollTop=Pe.current.scrollHeight*Gn}}return Qt.addEventListener("scroll",qt),function(){Qt.removeEventListener("scroll",qt)}}},[z,Vt]),Object(b.useEffect)(function(){if(z&&er){function Qt(qt,$t){er(qt,$t)}return z.on("beforeChange",Qt),function(){z.off("beforeChange",Qt)}}},[z,er]),Object(b.useEffect)(function(){if(z&&Fn){function Qt(){Fn(z.getValue())}return z.on("blur",Qt),function(){z.off("blur",Qt)}}},[z,Fn]),Object(b.useEffect)(function(){if(z){function Qt(qt){var $t=qt.getValue();Pt($t),zn(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Bt&&Bt($t)}return z.on("change",Qt),function(){z.off("change",Qt)}}},[z,Bt]),Object(b.useEffect)(function(){z&&(lt==null?(z.setValue(""),Pt("")):lt!==z.getValue()&&(z.setValue(lt),Pt(lt),z.setCursor(z.lineCount(),0)))},[z,lt]);var pi=Object(b.useCallback)(function(Qt){var qt=z.getCursor(),$t=z.getSelection(),dn=$t.split(`
`);switch(Qt){case"bold":return z.replaceSelection("**"+$t+"**"),$t===""&&z.setCursor(qt.line,qt.ch+2),z.focus();case"italic":return z.replaceSelection("*"+$t+"*"),$t===""&&z.setCursor(qt.line,qt.ch+1),z.focus();case"code":return z.replaceSelection("`"+$t+"`"),$t===""&&z.setCursor(qt.line,qt.ch+1),z.focus();case"inline-latex":return z.replaceSelection("`$$"+$t+"$$`"),$t===""&&z.setCursor(qt.line,qt.ch+3),z.focus();case"latex":return z.replaceSelection("```latex\n"+$t+"\n```"),z.setCursor(qt.line+1,$t.length+1),z.focus();case"line-break":return z.replaceSelection(`<br/>
`),z.focus();case"list-ul":return $t===""?z.replaceSelection("- "+$t):z.replaceSelection(dn.map(function(Gn){return Gn===""?"":"- ".concat(Gn)}).join(`
`)),z.focus();case"list-ol":return $t===""?z.replaceSelection("1. "+$t):z.replaceSelection(dn.map(function(Gn,Mn){return Gn===""?"":"".concat(Mn+1,". ").concat(Gn)}).join(`
`)),z.focus();case"add-null-ch":return $t===""&&z.setCursor(qt.line,qt.ch+1),z.replaceSelection(ze),z.focus();case"inster-template-1":return $t===""&&z.setCursor(qt.line,qt.ch),z.replaceSelection(ut),z.focus();case"eraser":return z.setValue(""),z.focus();case"trigger-watch":return hi(!Vt),z.focus();case"trigger-full-screen":return kt(!dt),z.focus();case rt:En(rt);return;case gt:En(gt);return;case qe:En(qe);return;case pt:En(pt);return;default:throw new Error}},[z,Vt,dt]),On=Object(b.useCallback)(function(Qt){En("");switch(sn){case rt:var qt=Qt.title,$t=Qt.link;return z.replaceSelection("[".concat(qt,"](").concat($t,")")),z.focus();case gt:var dn=Qt.language,Gn=Qt.content;return z.replaceSelection(["```"+dn,Gn,"```"].join(`
`)),z.focus();case qe:var Mn=Qt.src,qn=Qt.alt;return qn?z.replaceSelection("![ ".concat(qn," ]( ").concat(Mn,' "').concat(qn,'" )')):z.replaceSelection("![,](".concat(Mn,")")),z.focus();case pt:for(var mi=Qt.row,Tr=Qt.col,Zn=Qt.align,$r=`
`,gi=0;gi<mi;gi++){for(var fr=[],rr=[],Mr=0;Mr<Tr;Mr++)gi===1&&rr.push(at[Zn]),fr.push(" ");gi===1&&($r+="| ".concat(rr.join(" | "),` |
`)),$r+="| ".concat(fr.join(Tr===1?"":" | "),` |
`)}return z.replaceSelection($r+`
`),z.focus();default:throw new Error}},[z,sn]),tr=Object(b.useMemo)(function(){switch(sn){case rt:return p.a.createElement(q,{callback:On,onCancel:nr});case gt:return p.a.createElement(ie.b,{callback:On,onCancel:nr});case qe:return p.a.createElement(le,{callback:On,onCancel:nr});case pt:return p.a.createElement(Je,{callback:On,onCancel:nr});default:return null}},[sn]);function nr(){En("")}Object(b.useEffect)(function(){if(Dt.current){var Qt=Dt.current,qt=!1,$t=0;function dn(qn){qt=!0,$t=qn.pageY}function Gn(){qt=!1}function Mn(qn){if(qt){var mi=qn.pageY-$t;mi<0&&(mi=0),mi>300&&(mi=300);var Tr=yn+mi+"px";Nn(Tr)}}return Qt.addEventListener("mousedown",dn),document.addEventListener("mousemove",Mn),document.addEventListener("mouseup",Gn),function(){Qt.removeEventListener("mousedown",dn),document.removeEventListener("mousemove",Mn),document.removeEventListener("mouseup",Gn)}}},[z,Dt]),Object(b.useEffect)(function(){Nn(yn)},[yn]);var Fi=be(nn),Bn=be(di),Ft={width:Fi,height:Bn},yi=Object(b.useMemo)(function(){if(Ln){var Qt=new Date(Ln),qt=Qt.getHours(),$t=Qt.getMinutes(),dn=Qt.getSeconds();return qt=qt<10?"0"+qt:qt,$t=$t<10?"0"+$t:$t,dn=dn<10?"0"+dn:dn,"".concat(qt,":").concat($t,":").concat(dn)}return 0},[Ln]);function li(){window.sessionStorage.removeItem(bn),Un(!1),zn(0)}function $n(){Un(!1),zn(0),z.setValue(window.sessionStorage.getItem(bn))}function ir(Qt,qt){var $t=z.getValue();$t=$t.replace(Qt,qt),Pt($t),z==null||z.setValue($t)}return p.a.createElement(b.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Nt},p.a.createElement("div",{className:"markdown-editor-container ".concat(yt," ").concat(Vt?"on-preview":""," ").concat(ii?"mini":""," ").concat(dt?"full-screen":""),style:Ft},p.a.createElement(C,{insertTemp:In,watch:Vt,fullScreen:dt,showNullButton:mn,onActionCallback:pi,hidetoolBar:qi,uuid:Xt.current,setOpenPhones:function(){jt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Ct,placeholder:na})),Vt?p.a.createElement("div",{ref:Pe,className:"preview-container"},Si==="stex"&&p.a.createElement(A,{value:ct}),Si!=="stex"&&p.a.createElement(T.a,{edit:!0,value:ct,replaces:ir})):null))),kn?p.a.createElement("a",{ref:Dt,className:"editor-resize"}):null,p.a.createElement(N.a,null,Ee[sn]?p.a.createElement(Z.a,{centered:!0,title:Ee[sn],visible:!0,onCancel:nr,footer:null,className:"markdown-popup-form"},tr):null))}},"P/tu":function(ft,Xe,G){"use strict";var de=G("ozfa"),Z=G("MJZm"),M=G("0Owb"),V=G("9og8"),I=G("tJVT"),B=G("PpiC"),K=G("WmNS"),W=G.n(K),L=G("q1tI"),P=G.n(L),b=G("WCUW"),p=G("spXi"),_=G.n(p),h=function(d){var l=d.value,a=d.onChange,u=d.defaultValue,c=d.disabled,R=Object(B.a)(d,["value","onChange","defaultValue","disabled"]),O=Object(L.useState)([]),T=Object(I.a)(O,2),A=T[0],w=T[1],m=Object(L.useState)("1"),v=Object(I.a)(m,2),s=v[0],o=v[1];Object(L.useEffect)(function(){E()},[]);var E=function(){var N=Object(V.a)(W.a.mark(function U(){var j,H;return W.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,Object(b.A)({});case 2:j=x.sent,j!=null&&j.data&&(H=[{title:P.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:_.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:g(j.data||[])}],w(H),o("2"));case 4:case"end":return x.stop()}},U)}));return function(){return N.apply(this,arguments)}}(),g=function(U){function j(H){var y=H.children,x=Array.isArray(y)&&y.length>0,F=H==null?void 0:H.group_id;return{title:P.a.createElement("div",{title:H==null?void 0:H.name,className:_.a.name},H==null?void 0:H.name),value:F,key:F,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:x?y==null?void 0:y.map(function(Q){return j(Q)}):[]}}return U==null?void 0:U.map(function(H){return j(H)})},C=u?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return P.a.createElement("div",{className:_.a.customTree},P.a.createElement(Z.a,Object(M.a)({key:s},C,{showIcon:!0,treeData:A,onSelect:a,disabled:c},R)))};Xe.a=h},Q0Vu:function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___3fHaw",flex_space_between:"flex_space_between___1tu3K",flex_box_vertical_center:"flex_box_vertical_center___3kmTT",flex_box_center_end:"flex_box_center_end___19OcD",flex_box_column:"flex_box_column___1aMoy",main:"main___JkLSb",wrap:"wrap___1k_Ib",content:"content___1by-P",programName:"programName___1mMSD",name:"name___2mlTd",directionContentWrap:"directionContentWrap___3qsxQ",directionItem:"directionItem___2aAvu",active:"active___ACZqb",subActive:"subActive___2RkoB",subItem:"subItem___3tJgX",subMenu:"subMenu___Y_7S_",action:"action___xqgFs"}},SAoR:function(ft,Xe,G){"use strict";var de=G("Q9mQ"),Z=G("diRs"),M=G("q1tI"),V=G.n(M),I=G("+z73"),B=G.n(I),K=function(L){var P=L.data,b=P===void 0?[]:P,p=L.onClick,_=function(){return b.map(function(d,l){return V.a.createElement("div",{key:l,className:B.a.few},V.a.createElement("b",{title:d.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return p(d.id)}},d.name),l<b.length-1&&V.a.createElement("span",null,"/"))})},h=function(){var d=!0,l=b.slice(2,-2),a=V.a.createElement("div",{className:B.a.pWrap},l.map(function(u){return V.a.createElement("span",{title:u.name,onClick:function(){return p(u.id)},key:u.id},u.name)}));return b.map(function(u,c){var R=null;return c>1&&c<b.length-2?d&&(R=V.a.createElement(Z.a,{key:c,placement:"bottom",content:a},V.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),d=!1):R=V.a.createElement("div",{key:c,className:B.a.few},V.a.createElement("b",{title:u.name,style:{color:c===0?"#333333":"#999999"},onClick:function(){return p(u.id)}},u.name),c<b.length-1&&V.a.createElement("span",null,"/")),R})};return V.a.createElement("aside",{style:{overflowX:"auto"}},(b==null?void 0:b.length)>5?h():_())};Xe.a=K},SJMd:function(ft,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 G,de,Z,M=!1,V,I;window.PR_SHOULD_USE_CONTINUATION=!0;var B,K;(function(){var W=window,L=["break,continue,do,else,for,if,return,while"],P=[L,"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"],b=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[b,"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"],_=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[b,"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"],r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",d=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[L,"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=[L,"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"],c=[L,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[p,h,_,d,l,a,u,c],O=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",A="kwd",w="com",m="typ",v="lit",s="pun",o="pln",E="tag",g="dec",C="src",N="atn",U="atv",j="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function y(Ne){for(var Be=0,Je=!1,tt=!1,it=0,rt=Ne.length;it<rt;++it){var qe=Ne[it];if(qe.ignoreCase)tt=!0;else if(/[a-z]/i.test(qe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Je=!0,tt=!1;break}}var gt={b:8,t:9,n:10,v:11,f:12,r:13};function pt(Tt){var Ye=Tt.charCodeAt(0);if(Ye!==92)return Ye;var Mt=Tt.charAt(1);return Ye=gt[Mt],Ye||("0"<=Mt&&Mt<="7"?parseInt(Tt.substring(1),8):Mt==="u"||Mt==="x"?parseInt(Tt.substring(2),16):Tt.charCodeAt(1))}function vt(Tt){if(Tt<32)return(Tt<16?"\\x0":"\\x")+Tt.toString(16);var Ye=String.fromCharCode(Tt);return Ye==="\\"||Ye==="-"||Ye==="]"||Ye==="^"?"\\"+Ye:Ye}function at(Tt){var Ye=Tt.substring(1,Tt.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")),Mt=[],St=Ye[0]==="^",ze=["["];St&&ze.push("^");for(var ut=St?1:0,be=Ye.length;ut<be;++ut){var xe=Ye[ut];if(/\\[bdsw]/i.test(xe))ze.push(xe);else{var pe=pt(xe),se;ut+2<be&&Ye[ut+1]==="-"?(se=pt(Ye[ut+2]),ut+=2):se=pe,Mt.push([pe,se]),se<65||pe>122||(se<65||pe>90||Mt.push([Math.max(65,pe)|32,Math.min(se,90)|32]),se<97||pe>122||Mt.push([Math.max(97,pe)&~32,Math.min(se,122)&~32]))}}Mt.sort(function(De,$e){return De[0]-$e[0]||$e[1]-De[1]});for(var ce=[],Ee=[],ut=0;ut<Mt.length;++ut){var Ae=Mt[ut];Ae[0]<=Ee[1]+1?Ee[1]=Math.max(Ee[1],Ae[1]):ce.push(Ee=Ae)}for(var ut=0;ut<ce.length;++ut){var Ae=ce[ut];ze.push(vt(Ae[0])),Ae[1]>Ae[0]&&(Ae[1]+1>Ae[0]&&ze.push("-"),ze.push(vt(Ae[1])))}return ze.push("]"),ze.join("")}function Rt(Tt){for(var Ye=Tt.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")),Mt=Ye.length,St=[],ze=0,ut=0;ze<Mt;++ze){var be=Ye[ze];if(be==="(")++ut;else if(be.charAt(0)==="\\"){var xe=+be.substring(1);xe&&(xe<=ut?St[xe]=-1:Ye[ze]=vt(xe))}}for(var ze=1;ze<St.length;++ze)St[ze]===-1&&(St[ze]=++Be);for(var ze=0,ut=0;ze<Mt;++ze){var be=Ye[ze];if(be==="(")++ut,St[ut]||(Ye[ze]="(?:");else if(be.charAt(0)==="\\"){var xe=+be.substring(1);xe&&xe<=ut&&(Ye[ze]="\\"+St[xe])}}for(var ze=0;ze<Mt;++ze)Ye[ze]==="^"&&Ye[ze+1]!=="^"&&(Ye[ze]="");if(Tt.ignoreCase&&Je)for(var ze=0;ze<Mt;++ze){var be=Ye[ze],pe=be.charAt(0);be.length>=2&&pe==="["?Ye[ze]=at(be):pe!=="\\"&&(Ye[ze]=be.replace(/[a-zA-Z]/g,function(Ee){var Ae=Ee.charCodeAt(0);return"["+String.fromCharCode(Ae&~32,Ae|32)+"]"}))}return Ye.join("")}for(var xt=[],it=0,rt=Ne.length;it<rt;++it){var qe=Ne[it];if(qe.global||qe.multiline)throw new Error(""+qe);xt.push("(?:"+Rt(qe)+")")}return new RegExp(xt.join("|"),tt?"gi":"g")}function x(Ne,Be){var Je=/(?:^|\s)nocode(?:\s|$)/,tt=[],it=0,rt=[],qe=0;function gt(pt){var vt=pt.nodeType;if(vt==1){if(Je.test(pt.className))return;for(var at=pt.firstChild;at;at=at.nextSibling)gt(at);var Rt=pt.nodeName.toLowerCase();(Rt==="br"||Rt==="li")&&(tt[qe]=`
`,rt[qe<<1]=it++,rt[qe++<<1|1]=pt)}else if(vt==3||vt==4){var xt=pt.nodeValue;xt.length&&(Be?xt=xt.replace(/\r\n?/g,`
`):xt=xt.replace(/[ \t\r\n]+/g," "),tt[qe]=xt,rt[qe<<1]=it,it+=xt.length,rt[qe++<<1|1]=pt)}}return gt(Ne),{sourceCode:tt.join("").replace(/\n$/,""),spans:rt}}function F(Ne,Be,Je,tt,it){if(!Je)return;var rt={sourceNode:Ne,pre:1,langExtension:null,numberLines:null,sourceCode:Je,spans:null,basePos:Be,decorations:null};tt(rt),it.push.apply(it,rt.decorations)}var Q=/\S/;function q(Ne){for(var Be=void 0,Je=Ne.firstChild;Je;Je=Je.nextSibling){var tt=Je.nodeType;Be=tt===1?Be?Ne:Je:tt===3&&Q.test(Je.nodeValue)?Ne:Be}return Be===Ne?void 0:Be}function ie(Ne,Be){var Je={},tt;(function(){for(var qe=Ne.concat(Be),gt=[],pt={},vt=0,at=qe.length;vt<at;++vt){var Rt=qe[vt],xt=Rt[3];if(xt)for(var Tt=xt.length;--Tt>=0;)Je[xt.charAt(Tt)]=Rt;var Ye=Rt[1],Mt=""+Ye;pt.hasOwnProperty(Mt)||(gt.push(Ye),pt[Mt]=null)}gt.push(/[\0-\uffff]/),tt=y(gt)})();var it=Be.length,rt=function(qe){for(var gt=qe.sourceCode,pt=qe.basePos,vt=qe.sourceNode,at=[pt,o],Rt=0,xt=gt.match(tt)||[],Tt={},Ye=0,Mt=xt.length;Ye<Mt;++Ye){var St=xt[Ye],ze=Tt[St],ut=void 0,be;if(typeof ze=="string")be=!1;else{var xe=Je[St.charAt(0)];if(xe)ut=St.match(xe[1]),ze=xe[0];else{for(var pe=0;pe<it;++pe)if(xe=Be[pe],ut=St.match(xe[1]),ut){ze=xe[0];break}ut||(ze=o)}be=ze.length>=5&&ze.substring(0,5)==="lang-",be&&!(ut&&typeof ut[1]=="string")&&(be=!1,ze=C),be||(Tt[St]=ze)}var se=Rt;if(Rt+=St.length,!be)at.push(pt+se,ze);else{var ce=ut[1],Ee=St.indexOf(ce),Ae=Ee+ce.length;ut[2]&&(Ae=St.length-ut[2].length,Ee=Ae-ce.length);var De=ze.substring(5);F(vt,pt+se,St.substring(0,Ee),rt,at),F(vt,pt+se+Ee,ce,ne(De,ce),at),F(vt,pt+se+Ae,St.substring(Ae),rt,at)}}qe.decorations=at};return rt}function ge(Ne){var Be=[],Je=[];Ne.tripleQuotedStrings?Be.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ne.multiLineStrings?Be.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Be.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ne.verbatimStrings&&Je.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var tt=Ne.hashComments;tt&&(Ne.cStyleComments?(tt>1?Be.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Be.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Je.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Be.push([w,/^#[^\r\n]*/,null,"#"])),Ne.cStyleComments&&(Je.push([w,/^\/\/[^\r\n]*/,null]),Je.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var it=Ne.regexLiterals;if(it){var rt=it>1?"":`
\r`,qe=rt?".":"[\\S\\s]",gt="/(?=[^/*"+rt+"])(?:[^/\\x5B\\x5C"+rt+"]|\\x5C"+qe+"|\\x5B(?:[^\\x5C\\x5D"+rt+"]|\\x5C"+qe+")*(?:\\x5D|$))+/";Je.push(["lang-regex",RegExp("^"+H+"("+gt+")")])}var pt=Ne.types;pt&&Je.push([m,pt]);var vt=(""+Ne.keywords).replace(/^ | $/g,"");vt.length&&Je.push([A,new RegExp("^(?:"+vt.replace(/[\s,]+/g,"|")+")\\b"),null]),Be.push([o,/^\s+/,null,` \r
\xA0`]);var at="^.[^\\s\\w.$@'\"`/\\\\]*";return Ne.regexLiterals&&(at+="(?!s*/)"),Je.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[s,new RegExp(at),null]),ie(Be,Je)}var fe=ge({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ue(Ne,Be,Je){for(var tt=/(?:^|\s)nocode(?:\s|$)/,it=/\r\n?|\n/,rt=Ne.ownerDocument,qe=rt.createElement("li");Ne.firstChild;)qe.appendChild(Ne.firstChild);var gt=[qe];function pt(Ye){var Mt=Ye.nodeType;if(Mt==1&&!tt.test(Ye.className))if(Ye.nodeName==="br")vt(Ye),Ye.parentNode&&Ye.parentNode.removeChild(Ye);else for(var St=Ye.firstChild;St;St=St.nextSibling)pt(St);else if((Mt==3||Mt==4)&&Je){var ze=Ye.nodeValue,ut=ze.match(it);if(ut){var be=ze.substring(0,ut.index);Ye.nodeValue=be;var xe=ze.substring(ut.index+ut[0].length);if(xe){var pe=Ye.parentNode;pe.insertBefore(rt.createTextNode(xe),Ye.nextSibling)}vt(Ye),be||Ye.parentNode.removeChild(Ye)}}}function vt(Ye){for(;!Ye.nextSibling;)if(Ye=Ye.parentNode,!Ye)return;function Mt(ut,be){var xe=be?ut.cloneNode(!1):ut,pe=ut.parentNode;if(pe){var se=Mt(pe,1),ce=ut.nextSibling;se.appendChild(xe);for(var Ee=ce;Ee;Ee=ce)ce=Ee.nextSibling,se.appendChild(Ee)}return xe}for(var St=Mt(Ye.nextSibling,0),ze;(ze=St.parentNode)&&ze.nodeType===1;)St=ze;gt.push(St)}for(var at=0;at<gt.length;++at)pt(gt[at]);Be===(Be|0)&&gt[0].setAttribute("value",Be);var Rt=rt.createElement("ol");Rt.className="linenums";for(var xt=Math.max(0,Be-1|0)||0,at=0,Tt=gt.length;at<Tt;++at)qe=gt[at],qe.className="L"+(at+xt)%10,qe.firstChild||qe.appendChild(rt.createTextNode("\xA0")),Rt.appendChild(qe);Ne.appendChild(Rt)}function he(Ne){var Be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Be=Be&&+Be[1]<=8;var Je=/\n/g,tt=Ne.sourceCode,it=tt.length,rt=0,qe=Ne.spans,gt=qe.length,pt=0,vt=Ne.decorations,at=vt.length,Rt=0;vt[at]=it;var xt,Tt;for(Tt=xt=0;Tt<at;)vt[Tt]!==vt[Tt+2]?(vt[xt++]=vt[Tt++],vt[xt++]=vt[Tt++]):Tt+=2;for(at=xt,Tt=xt=0;Tt<at;){for(var Ye=vt[Tt],Mt=vt[Tt+1],St=Tt+2;St+2<=at&&vt[St+1]===Mt;)St+=2;vt[xt++]=Ye,vt[xt++]=Mt,Tt=St}at=vt.length=xt;var ze=Ne.sourceNode,ut="";ze&&(ut=ze.style.display,ze.style.display="none");try{for(var be=null;pt<gt;){var xe=qe[pt],pe=qe[pt+2]||it,se=vt[Rt+2]||it,St=Math.min(pe,se),ce=qe[pt+1],Ee;if(ce.nodeType!==1&&(Ee=tt.substring(rt,St))){Be&&(Ee=Ee.replace(Je,"\r")),ce.nodeValue=Ee;var Ae=ce.ownerDocument,De=Ae.createElement("span");De.className=vt[Rt+1];var $e=ce.parentNode;$e.replaceChild(De,ce),De.appendChild(ce),rt<pe&&(qe[pt+1]=ce=Ae.createTextNode(tt.substring(St,pe)),$e.insertBefore(ce,De.nextSibling))}rt=St,rt>=pe&&(pt+=2),rt>=se&&(Rt+=2)}}finally{ze&&(ze.style.display=ut)}}var _e={};function le(Ne,Be){for(var Je=Be.length;--Je>=0;){var tt=Be[Je];_e.hasOwnProperty(tt)?W.console&&console.warn("cannot override language handler %s",tt):_e[tt]=Ne}}function ne(Ne,Be){return Ne&&_e.hasOwnProperty(Ne)||(Ne=/^\s*</.test(Be)?"default-markup":"default-code"),_e[Ne]}le(fe,["default-code"]),le(ie([],[[o,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[w,/^<\!--[\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"]),le(ie([[o,/^[\s]+/,null,` \r
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!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"]),le(ie([],[[U,/^[\s\S]+/]]),["uq.val"]),le(ge({keywords:p,hashComments:!0,cStyleComments:!0,types:O}),["c","cc","cpp","cxx","cyc","m"]),le(ge({keywords:"null,true,false"}),["json"]),le(ge({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:O}),["cs"]),le(ge({keywords:_,cStyleComments:!0}),["java"]),le(ge({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),le(ge({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),le(ge({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),le(ge({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),le(ge({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),le(ge({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),le(ie([],[[T,/^[\s\S]+/]]),["regex"]);function Te(Ne){var Be=Ne.langExtension;try{var Je=x(Ne.sourceNode,Ne.pre),tt=Je.sourceCode;Ne.sourceCode=tt,Ne.spans=Je.spans,Ne.basePos=0,ne(Be,tt)(Ne),he(Ne)}catch(it){W.console&&console.log(it&&it.stack||it)}}function Fe(Ne,Be,Je){var tt=Je||!1,it=Be||null,rt=document.createElement("div");rt.innerHTML="<pre>"+Ne+"</pre>",rt=rt.firstChild,tt&&ue(rt,tt,!0);var qe={langExtension:it,numberLines:tt,sourceNode:rt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Te(qe),rt.innerHTML}function Ke(Ne,Be){var Je=Be||document.body,tt=Je.ownerDocument||document;function it(xe){return Je.getElementsByTagName(xe)}for(var rt=[it("pre"),it("code"),it("xmp")],qe=[],gt=0;gt<rt.length;++gt)for(var pt=0,vt=rt[gt].length;pt<vt;++pt)qe.push(rt[gt][pt]);rt=null;var at=Date;at.now||(at={now:function(){return+new Date}});var Rt=0,xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Tt=/\bprettyprint\b/,Ye=/\bprettyprinted\b/,Mt=/pre|xmp/i,St=/^code$/i,ze=/^(?:pre|code|xmp)$/i,ut={};function be(){for(var xe=W.PR_SHOULD_USE_CONTINUATION?at.now()+250:Infinity;Rt<qe.length&&at.now()<xe;Rt++){for(var pe=qe[Rt],se=ut,ce=pe;ce=ce.previousSibling;){var Ee=ce.nodeType,Ae=(Ee===7||Ee===8)&&ce.nodeValue;if(Ae?!/^\??prettify\b/.test(Ae):Ee!==3||/\S/.test(ce.nodeValue))break;if(Ae){se={},Ae.replace(/\b(\w+)=([\w:.%+-]+)/g,function(fi,In,Ri){se[In]=Ri});break}}var De=pe.className;if((se!==ut||Tt.test(De))&&!Ye.test(De)){for(var $e=!1,lt=pe.parentNode;lt;lt=lt.parentNode){var Bt=lt.tagName;if(ze.test(Bt)&&lt.className&&Tt.test(lt.className)){$e=!0;break}}if(!$e){pe.className+=" prettyprinted";var tn=se.lang;if(!tn){tn=De.match(xt);var nn;!tn&&(nn=q(pe))&&St.test(nn.tagName)&&(tn=nn.className.match(xt)),tn&&(tn=tn[1])}var _n;if(Mt.test(pe.tagName))_n=1;else{var yn=pe.currentStyle,Gt=tt.defaultView,ii=yn?yn.whiteSpace:Gt&&Gt.getComputedStyle?Gt.getComputedStyle(pe,null).getPropertyValue("white-space"):0;_n=ii&&ii.substring(0,3)==="pre"}var Dn=se.linenums;(Dn=Dn==="true"||+Dn)||(Dn=De.match(/\blinenums\b(?::(\d+))?/),Dn=Dn?Dn[1]&&Dn[1].length?+Dn[1]:!0:!1),Dn&&ue(pe,Dn,_n);var Ci={langExtension:tn,sourceNode:pe,numberLines:Dn,pre:_n,sourceCode:null,basePos:null,spans:null,decorations:null};Te(Ci)}}}Rt<qe.length?W.setTimeout(be,250):typeof Ne=="function"&&Ne()}be()}var Ue=W.PR={createSimpleLexer:ie,registerLangHandler:le,sourceDecorator:ge,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:U,PR_COMMENT:w,PR_DECLARATION:g,PR_KEYWORD:A,PR_LITERAL:v,PR_NOCODE:j,PR_PLAIN:o,PR_PUNCTUATION:s,PR_SOURCE:C,PR_STRING:T,PR_TAG:E,PR_TYPE:m,prettyPrintOne:M?W.prettyPrintOne=Fe:B=Fe,prettyPrint:K=M?W.prettyPrint=Ke:K=Ke},He=W.define;typeof He=="function"&&He.amd&&He("google-code-prettify",[],function(){return Ue})})()},TXwP:function(ft,Xe,G){var de,Z;(function(){var M;(function(){"use strict";var I=[,,function(L){function P(_){this.__parent=_,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}P.prototype.clone_empty=function(){var _=new P(this.__parent);return _.set_indent(this.__indent_count,this.__alignment_count),_},P.prototype.item=function(_){return _<0?this.__items[this.__items.length+_]:this.__items[_]},P.prototype.has_match=function(_){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(_))return!0;return!1},P.prototype.set_indent=function(_,h){this.is_empty()&&(this.__indent_count=_||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},P.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},P.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},P.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var _=this.__parent.current_line;return _.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),_.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),_.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,_.__items[0]===" "&&(_.__items.splice(0,1),_.__character_count-=1),!0}return!1},P.prototype.is_empty=function(){return this.__items.length===0},P.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},P.prototype.push=function(_){this.__items.push(_);var h=_.lastIndexOf(`
`);h!==-1?this.__character_count=_.length-h:this.__character_count+=_.length},P.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},P.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},P.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},P.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},P.prototype.toString=function(){var _="";return this.is_empty()?this.__parent.indent_empty_lines&&(_=this.__parent.get_indent_string(this.__indent_count)):(_=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),_+=this.__items.join("")),_};function b(_,h){this.__cache=[""],this.__indent_size=_.indent_size,this.__indent_string=_.indent_char,_.indent_with_tabs||(this.__indent_string=new Array(_.indent_size+1).join(_.indent_char)),h=h||"",_.indent_level>0&&(h=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}b.prototype.get_indent_size=function(_,h){var r=this.__base_string_length;return h=h||0,_<0&&(r=0),r+=_*this.__indent_size,r+=h,r},b.prototype.get_indent_string=function(_,h){var r=this.__base_string;return h=h||0,_<0&&(_=0,r=""),h+=_*this.__indent_size,this.__ensure_cache(h),r+=this.__cache[h],r},b.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var _=this.__cache.length,h=0,r="";this.__indent_size&&_>=this.__indent_size&&(h=Math.floor(_/this.__indent_size),_-=h*this.__indent_size,r=new Array(h+1).join(this.__indent_string)),_&&(r+=new Array(_+1).join(" ")),this.__cache.push(r)};function p(_,h){this.__indent_cache=new b(_,h),this.raw=!1,this._end_with_newline=_.end_with_newline,this.indent_size=_.indent_size,this.wrap_line_length=_.wrap_line_length,this.indent_empty_lines=_.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new P(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(_,h){return this.__indent_cache.get_indent_string(_,h)},p.prototype.get_indent_size=function(_,h){return this.__indent_cache.get_indent_size(_,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(_){return this.is_empty()||!_&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(_){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return _!==`
`&&(r=r.replace(/[\n]/g,_)),r},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,h){return _=_||0,h=h||0,this.next_line.set_indent(_,h),this.__lines.length>1?(this.current_line.set_indent(_,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var h=0;h<_.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(_.whitespace_before),this.current_line.push(_.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(_){this.__add_space_before_token(),this.current_line.push(_),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(_){for(var h=this.__lines.length;_<h;)this.__lines[_]._remove_indent(),_++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(_){for(_=_===void 0?!1:_,this.current_line.trim();_&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(_,h){for(var r=this.__lines.length-2;r>=0;){var d=this.__lines[r];if(d.is_empty())break;if(d.item(0).indexOf(_)!==0&&d.item(-1)!==h){this.__lines.splice(r+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},L.exports.Output=p},,,,function(L){function P(_,h){this.raw_options=b(_,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}P.prototype._get_array=function(_,h){var r=this.raw_options[_],d=h||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(d=r.concat()):typeof r=="string"&&(d=r.split(/[^a-zA-Z0-9_\/\-]+/)),d},P.prototype._get_boolean=function(_,h){var r=this.raw_options[_],d=r===void 0?!!h:!!r;return d},P.prototype._get_characters=function(_,h){var r=this.raw_options[_],d=h||"";return typeof r=="string"&&(d=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},P.prototype._get_number=function(_,h){var r=this.raw_options[_];h=parseInt(h,10),isNaN(h)&&(h=0);var d=parseInt(r,10);return isNaN(d)&&(d=h),d},P.prototype._get_selection=function(_,h,r){var d=this._get_selection_list(_,h,r);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+_+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[_]+"'");return d[0]},P.prototype._get_selection_list=function(_,h,r){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[h[0]],!this._is_valid_selection(r,h))throw new Error("Invalid Default Value!");var d=this._get_array(_,r);if(!this._is_valid_selection(d,h))throw new Error("Invalid Option Value: The option '"+_+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[_]+"'");return d},P.prototype._is_valid_selection=function(_,h){return _.length&&h.length&&!_.some(function(r){return h.indexOf(r)===-1})};function b(_,h){var r={};_=p(_);var d;for(d in _)d!==h&&(r[d]=_[d]);if(h&&_[h])for(d in _[h])r[d]=_[h][d];return r}function p(_){var h={},r;for(r in _){var d=r.replace(/-/g,"_");h[d]=_[r]}return h}L.exports.Options=P,L.exports.normalizeOpts=p,L.exports.mergeOpts=b},,function(L){var P=RegExp.prototype.hasOwnProperty("sticky");function b(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},b.prototype.peek=function(p){var _=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(_=this.__input.charAt(p)),_},b.prototype.__match=function(p,_){p.lastIndex=_;var h=p.exec(this.__input);return h&&!(P&&p.sticky)&&(h.index!==_&&(h=null)),h},b.prototype.test=function(p,_){return _=_||0,_+=this.__position,_>=0&&_<this.__input_length?!!this.__match(p,_):!1},b.prototype.testChar=function(p,_){var h=this.peek(_);return p.lastIndex=0,h!==null&&p.test(h)},b.prototype.match=function(p){var _=this.__match(p,this.__position);return _?this.__position+=_[0].length:_=null,_},b.prototype.read=function(p,_,h){var r="",d;return p&&(d=this.match(p),d&&(r+=d[0])),_&&(d||!p)&&(r+=this.readUntil(_,h)),r},b.prototype.readUntil=function(p,_){var h="",r=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(r=d.index,_&&(r+=d[0].length)):r=this.__input_length,h=this.__input.substring(this.__position,r),this.__position=r,h},b.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},b.prototype.get_regexp=function(p,_){var h=null,r="g";return _&&P&&(r="y"),typeof p=="string"&&p!==""?h=new RegExp(p,r):p&&(h=new RegExp(p.source,r)),h},b.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(p){var _=this.__position,h=this.readUntilAfter(p);return this.__position=_,h},b.prototype.lookBack=function(p){var _=this.__position-1;return _>=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},L.exports.InputScanner=b},,,,,function(L){function P(b,p){b=typeof b=="string"?b:b.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+p,"g")}P.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var _=this.__directive_pattern.exec(b);_;)p[_[1]]=_[2],_=this.__directive_pattern.exec(b);return p},P.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=P},,function(L,P,b){var p=b(16).Beautifier,_=b(17).Options;function h(r,d){var l=new p(r,d);return l.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new _}},function(L,P,b){var p=b(17).Options,_=b(2).Output,h=b(8).InputScanner,r=b(13).Directives,d=new r(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,u=/\s/,c=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,O=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(A,w){this._source_text=A||"",this._options=new p(w),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(A){var w="";for(this._ch=this._input.next();this._ch;){if(w+=this._ch,this._ch==="\\")w+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return w},T.prototype.eatWhitespace=function(A){for(var w=u.test(this._input.peek()),m=0;u.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===`
`&&((m===0||m<this._options.max_preserve_newlines)&&(m++,this._output.add_new_line(!0)));return w},T.prototype.foundNestedPseudoClass=function(){for(var A=0,w=1,m=this._input.peek(w);m;){if(m==="{")return!0;if(m==="(")A+=1;else if(m===")"){if(A===0)return!1;A-=1}else if(m===";"||m==="}")return!1;w++,m=this._input.peek(w)}return!1},T.prototype.print_string=function(A){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(A)},T.prototype.preserveSingleSpace=function(A){A&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,w=this._options.eol;w==="auto"&&(w=`
`,A&&l.test(A||"")&&(w=A.match(l)[0])),A=A.replace(a,`
`);var m=A.match(/^[\t ]*/)[0];this._output=new _(this._options,m),this._input=new h(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var v=0,s=!1,o=!1,E=!1,g=!1,C=!1,N=!1,U=this._ch,j=!1,H,y,x;H=this._input.read(c),y=H!=="",x=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var F=this._input.read(R),Q=d.get_directives(F);Q&&Q.ignore==="start"&&(F+=d.readIgnored(this._input)),this.print_string(F),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(O)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(y),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var q=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);q.match(/[ :]$/)&&(q=this.eatString(": ").replace(/\s$/,""),this.print_string(q),this._output.space_before_token=!0),q=q.replace(/\s$/,""),q==="extend"?g=!0:q==="import"&&(C=!0),q in this.NESTED_AT_RULE?(this._nestedLevel+=1,q in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!s&&v===0&&q.indexOf(":")!==-1&&(o=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(y),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")o&&(o=!1,this.outdent()),E?(E=!1,s=this._indentLevel>=this._nestedLevel):s=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&s&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(x==="("?this._output.space_before_token=!1:x!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),x==="{"&&this._output.trim(!0),C=!1,g=!1,o&&(this.outdent(),o=!1),this.print_string(this._ch),s=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ie=0;ie<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ie++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ie])){j=!0;break}(s||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&v===0?(this.print_string(":"),o||(o=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ge=x==='"'||x==="'";this.preserveSingleSpace(ge||y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")j=!1,v===0?(o&&(this.outdent(),o=!1),g=!1,C=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),v++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),v&&(v--,this.outdent()));else{var fe=!1;this._input.lookBack("with")&&(fe=!0),this.preserveSingleSpace(y||fe),this.print_string(this._ch),o&&x==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),v++,this.indent())}else if(this._ch===")")v&&(v--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!o||N)&&v===0&&!C&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!o&&v===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(y),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),u.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ue=x==='"'||x==="'";this.preserveSingleSpace(ue||y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&j&&this._output.add_new_line()}var he=this._output.get_code(w);return he},L.exports.Beautifier=T},function(L,P,b){var p=b(6).Options;function _(h){p.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<d.length;l++)d[l]!=="expand"?this.brace_style="collapse":this.brace_style=d[l]}_.prototype=new p,L.exports.Options=_}],B={};function K(L){var P=B[L];if(P!==void 0)return P.exports;var b=B[L]={exports:{}};return I[L](b,b.exports,K),b.exports}var W=K(15);M=W})();var V=M;!(de=[],Z=function(){return{css_beautify:V}}.apply(Xe,de),Z!==void 0&&(ft.exports=Z))})()},"VrN/":function(ft,Xe,G){(function(de,Z){ft.exports=Z()})(this,function(){"use strict";var de=navigator.userAgent,Z=navigator.platform,M=/gecko\/\d/i.test(de),V=/MSIE \d/.test(de),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(de),B=/Edge\/(\d+)/.exec(de),K=V||I||B,W=K&&(V?document.documentMode||6:+(B||I)[1]),L=!B&&/WebKit\//.test(de),P=L&&/Qt\/\d+\.\d+/.test(de),b=!B&&/Chrome\//.test(de),p=/Opera\//.test(de),_=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(de),r=/PhantomJS/.test(de),d=!B&&/AppleWebKit/.test(de)&&/Mobile\/\w+/.test(de),l=/Android/.test(de),a=d||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(de),u=d||/Mac/.test(Z),c=/\bCrOS\b/.test(de),R=/win/i.test(Z),O=p&&de.match(/Version\/(\d*\.\d*)/);O&&(O=Number(O[1])),O&&O>=15&&(p=!1,L=!0);var T=u&&(P||p&&(O==null||O<12.11)),A=M||K&&W>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var i=e.className,n=w(t).exec(i);if(n){var f=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(f?n[1]+f:"")}};function v(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return v(e).appendChild(t)}function o(e,t,i,n){var f=document.createElement(e);if(i&&(f.className=i),n&&(f.style.cssText=n),typeof t=="string")f.appendChild(document.createTextNode(t));else if(t)for(var k=0;k<t.length;++k)f.appendChild(t[k]);return f}function E(e,t,i,n){var f=o(e,t,i,n);return f.setAttribute("role","presentation"),f}var g;document.createRange?g=function(e,t,i,n){var f=document.createRange();return f.setEnd(n||e,i),f.setStart(e,t),f}:g=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(f){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function C(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function U(e,t){var i=e.className;w(t).test(i)||(e.className+=(i?" ":"")+t)}function j(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!w(i[n]).test(t)&&(t+=" "+i[n]);return t}var H=function(e){e.select()};d?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(H=function(e){try{e.select()}catch(t){}});function y(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function x(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function F(e,t,i,n,f){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var k=n||0,X=f||0;;){var J=e.indexOf(" ",k);if(J<0||J>=t)return X+(t-k);X+=J-k,X+=i-X%i,k=J+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=y(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function q(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ie=50,ge={toString:function(){return"CodeMirror.Pass"}},fe={scroll:!1},ue={origin:"*mouse"},he={origin:"+move"};function _e(e,t,i){for(var n=0,f=0;;){var k=e.indexOf(" ",n);k==-1&&(k=e.length);var X=k-n;if(k==e.length||f+X>=t)return n+Math.min(X,t-f);if(f+=k-n,f+=i-f%i,n=k+1,f>=t)return n}}var le=[""];function ne(e){for(;le.length<=e;)le.push(Te(le)+" ");return le[e]}function Te(e){return e[e.length-1]}function Fe(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function Ke(e,t,i){for(var n=0,f=i(t);n<e.length&&i(e[n])<=f;)n++;e.splice(n,0,t)}function Ue(){}function He(e,t){var i;return Object.create?i=Object.create(e):(Ue.prototype=e,i=new Ue),t&&x(t,i),i}var Ne=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Be(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ne.test(e))}function Je(e,t){return t?t.source.indexOf("\\w")>-1&&Be(e)?!0:t.test(e):Be(e)}function tt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var it=/[\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 rt(e){return e.charCodeAt(0)>=768&&it.test(e)}function qe(e,t,i){for(;(i<0?t>0:t<e.length)&&rt(e.charAt(t));)t+=i;return t}function gt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var f=(t+i)/2,k=n<0?Math.ceil(f):Math.floor(f);if(k==t)return e(k)?t:i;e(k)?i=k:t=k+n}}function pt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var f=!1,k=0;k<e.length;++k){var X=e[k];(X.from<i&&X.to>t||t==i&&X.to==t)&&(n(Math.max(X.from,t),Math.min(X.to,i),X.level==1?"rtl":"ltr",k),f=!0)}f||n(t,i,"ltr")}var vt=null;function at(e,t,i){var n;vt=null;for(var f=0;f<e.length;++f){var k=e[f];if(k.from<t&&k.to>t)return f;k.to==t&&(k.from!=k.to&&i=="before"?n=f:vt=f),k.from==t&&(k.from!=k.to&&i!="before"?n=f:vt=f)}return n!=null?n:vt}var Rt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ae){return ae<=247?e.charAt(ae):1424<=ae&&ae<=1524?"R":1536<=ae&&ae<=1785?t.charAt(ae-1536):1774<=ae&&ae<=2220?"r":8192<=ae&&ae<=8203?"w":ae==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,k=/[LRr]/,X=/[Lb1n]/,J=/[1n]/;function ee(ae,Se,Re){this.level=ae,this.from=Se,this.to=Re}return function(ae,Se){var Re=Se=="ltr"?"L":"R";if(ae.length==0||Se=="ltr"&&!n.test(ae))return!1;for(var Ve=ae.length,We=[],st=0;st<Ve;++st)We.push(i(ae.charCodeAt(st)));for(var _t=0,It=Re;_t<Ve;++_t){var Wt=We[_t];Wt=="m"?We[_t]=It:It=Wt}for(var en=0,Ht=Re;en<Ve;++en){var on=We[en];on=="1"&&Ht=="r"?We[en]="n":k.test(on)&&(Ht=on,on=="r"&&(We[en]="R"))}for(var Pn=1,vn=We[0];Pn<Ve-1;++Pn){var ai=We[Pn];ai=="+"&&vn=="1"&&We[Pn+1]=="1"?We[Pn]="1":ai==","&&vn==We[Pn+1]&&(vn=="1"||vn=="n")&&(We[Pn]=vn),vn=ai}for(var Ni=0;Ni<Ve;++Ni){var Er=We[Ni];if(Er==",")We[Ni]="N";else if(Er=="%"){var Qi=void 0;for(Qi=Ni+1;Qi<Ve&&We[Qi]=="%";++Qi);for(var Yr=Ni&&We[Ni-1]=="!"||Qi<Ve&&We[Qi]=="1"?"1":"N",Fr=Ni;Fr<Qi;++Fr)We[Fr]=Yr;Ni=Qi-1}}for(var ur=0,Wr=Re;ur<Ve;++ur){var wr=We[ur];Wr=="L"&&wr=="1"?We[ur]="L":k.test(wr)&&(Wr=wr)}for(var gr=0;gr<Ve;++gr)if(f.test(We[gr])){var cr=void 0;for(cr=gr+1;cr<Ve&&f.test(We[cr]);++cr);for(var Ji=(gr?We[gr-1]:Re)=="L",Hr=(cr<Ve?We[cr]:Re)=="L",Ro=Ji==Hr?Ji?"L":"R":Re,Ya=gr;Ya<cr;++Ya)We[Ya]=Ro;gr=cr-1}for(var Rr=[],Ca,xr=0;xr<Ve;)if(X.test(We[xr])){var ys=xr;for(++xr;xr<Ve&&X.test(We[xr]);++xr);Rr.push(new ee(0,ys,xr))}else{var Ia=xr,oo=Rr.length,so=Se=="rtl"?1:0;for(++xr;xr<Ve&&We[xr]!="L";++xr);for(var Ir=Ia;Ir<xr;)if(J.test(We[Ir])){Ia<Ir&&(Rr.splice(oo,0,new ee(1,Ia,Ir)),oo+=so);var Lo=Ir;for(++Ir;Ir<xr&&J.test(We[Ir]);++Ir);Rr.splice(oo,0,new ee(2,Lo,Ir)),oo+=so,Ia=Ir}else++Ir;Ia<xr&&Rr.splice(oo,0,new ee(1,Ia,xr))}return Se=="ltr"&&(Rr[0].level==1&&(Ca=ae.match(/^\s+/))&&(Rr[0].from=Ca[0].length,Rr.unshift(new ee(0,0,Ca[0].length))),Te(Rr).level==1&&(Ca=ae.match(/\s+$/))&&(Te(Rr).to-=Ca[0].length,Rr.push(new ee(0,Ve-Ca[0].length,Ve)))),Se=="rtl"?Rr.reverse():Rr}}();function xt(e,t){var i=e.order;return i==null&&(i=e.order=Rt(e.text,t)),i}var Tt=[],Ye=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Tt).concat(i)}};function Mt(e,t){return e._handlers&&e._handlers[t]||Tt}function St(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,f=n&&n[t];if(f){var k=q(f,i);k>-1&&(n[t]=f.slice(0,k).concat(f.slice(k+1)))}}}function ze(e,t){var i=Mt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),f=0;f<i.length;++f)i[f].apply(null,n)}function ut(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ze(e,i||t.type,e,t),Ee(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)q(i,t[n])==-1&&i.push(t[n])}function xe(e,t){return Mt(e,t).length>0}function pe(e){e.prototype.on=function(t,i){Ye(this,t,i)},e.prototype.off=function(t,i){St(this,t,i)}}function se(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ae(e){se(e),ce(e)}function De(e){return e.target||e.srcElement}function $e(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 lt=function(){if(K&&W<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),Bt;function tn(e){if(Bt==null){var t=o("span","\u200B");s(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Bt=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&W<8))}var i=Bt?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var nn;function _n(e){if(nn!=null)return nn;var t=s(e,document.createTextNode("A\u062EA")),i=g(t,0,1).getBoundingClientRect(),n=g(t,1,2).getBoundingClientRect();return v(e),!i||i.left==i.right?!1:nn=n.right-i.right<3}var yn=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var f=e.indexOf(`
`,t);f==-1&&(f=e.length);var k=e.slice(t,e.charAt(f-1)=="\r"?f-1:f),X=k.indexOf("\r");X!=-1?(i.push(k.slice(0,X)),t+=X+1):(i.push(k),t=f+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Gt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ii=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Dn=null;function Ci(e){if(Dn!=null)return Dn;var t=s(e,o("span","x")),i=t.getBoundingClientRect(),n=g(t,0,1).getBoundingClientRect();return Dn=Math.abs(i.left-n.left)>1}var fi={},In={};function Ri(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),fi[e]=t}function Si(e,t){In[e]=t}function Ot(e){if(typeof e=="string"&&In.hasOwnProperty(e))e=In[e];else if(e&&typeof e.name=="string"&&In.hasOwnProperty(e.name)){var t=In[e.name];typeof t=="string"&&(t={name:t}),e=He(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ot("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ot("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function bn(e,t){t=Ot(t);var i=fi[t.name];if(!i)return bn(e,"text/plain");var n=i(e,t);if(Cn.hasOwnProperty(t.name)){var f=Cn[t.name];for(var k in f){if(!f.hasOwnProperty(k))continue;n.hasOwnProperty(k)&&(n["_"+k]=n[k]),n[k]=f[k]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var X in t.modeProps)n[X]=t.modeProps[X];return n}var Cn={};function kn(e,t){var i=Cn.hasOwnProperty(e)?Cn[e]:Cn[e]={};x(t,i)}function Ai(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var f=t[n];f instanceof Array&&(f=f.concat([])),i[n]=f}return i}function Ui(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function dr(e,t,i){return e.startState?e.startState(t,i):!0}var mn=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};mn.prototype.eol=function(){return this.pos>=this.string.length},mn.prototype.sol=function(){return this.pos==this.lineStart},mn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mn.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},mn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},mn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mn.prototype.skipToEnd=function(){this.pos=this.string.length},mn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mn.prototype.backUp=function(e){this.pos-=e},mn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},mn.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},mn.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(X){return i?X.toLowerCase():X},f=this.string.substr(this.pos,e.length);if(n(f)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var k=this.string.slice(this.pos).match(e);return k&&k.index>0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},mn.prototype.current=function(){return this.string.slice(this.start,this.pos)},mn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Jt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var f=i.children[n],k=f.chunkSize();if(t<k){i=f;break}t-=k}return i.lines[t]}function qi(e,t,i){var n=[],f=t.line;return e.iter(t.line,i.line+1,function(k){var X=k.text;f==i.line&&(X=X.slice(0,i.ch)),f==t.line&&(X=X.slice(t.ch)),n.push(X),++f}),n}function hr(e,t,i){var n=[];return e.iter(t,i,function(f){n.push(f.text)}),n}function sr(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Fn(e){if(e.parent==null)return null;for(var t=e.parent,i=q(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var f=0;!(n.children[f]==t);++f)i+=n.children[f].chunkSize();return i+t.first}function er(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var f=e.children[n],k=f.height;if(t<k){e=f;continue e}t-=k,i+=f.chunkSize()}return i}while(!e.lines);for(var X=0;X<e.lines.length;++X){var J=e.lines[X],ee=J.height;if(t<ee)break;t-=ee}return i+X}function kr(e,t){return t>=e.first&&t<e.first+e.size}function Qr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function yt(e,t,i){if(i===void 0&&(i=null),!(this instanceof yt))return new yt(e,t,i);this.line=e,this.ch=t,this.sticky=i}function cn(e,t){return e.line-t.line||e.ch-t.ch}function Kr(e,t){return e.sticky==t.sticky&&cn(e,t)==0}function zr(e){return yt(e.line,e.ch)}function na(e,t){return cn(e,t)<0?t:e}function Gr(e,t){return cn(e,t)<0?e:t}function $(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function S(e,t){if(t.line<e.first)return yt(e.first,0);var i=e.first+e.size-1;return t.line>i?yt(i,Jt(e,i).text.length):D(t,Jt(e,t.line).text.length)}function D(e,t){var i=e.ch;return i==null||i>t?yt(e.line,t):i<0?yt(e.line,0):e}function z(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=S(e,t[n]);return i}var te=function(e,t){this.state=e,this.lookAhead=t},Y=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Y.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Y.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Y.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Y.fromSaved=function(e,t,i){return t instanceof te?new Y(e,Ai(e.mode,t.state),i,t.lookAhead):new Y(e,Ai(e.mode,t),i)},Y.prototype.save=function(e){var t=e!==!1?Ai(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new te(t,this.maxLookAhead):t};function Le(e,t,i,n){var f=[e.state.modeGen],k={};dt(e,t.text,e.doc.mode,i,function(ae,Se){return f.push(ae,Se)},k,n);for(var X=i.state,J=function(ae){i.baseTokens=f;var Se=e.state.overlays[ae],Re=1,Ve=0;i.state=!0,dt(e,t.text,Se.mode,i,function(We,st){for(var _t=Re;Ve<We;){var It=f[Re];It>We&&f.splice(Re,1,We,f[Re+1],It),Re+=2,Ve=Math.min(We,It)}if(!st)return;if(Se.opaque)f.splice(_t,Re-_t,We,"overlay "+st),Re=_t+2;else for(;_t<Re;_t+=2){var Wt=f[_t+1];f[_t+1]=(Wt?Wt+" ":"")+"overlay "+st}},k),i.state=X,i.baseTokens=null,i.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)J(ee);return{styles:f,classes:k.bgClass||k.textClass?k:null}}function ct(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Pt(e,Fn(t)),f=t.text.length>e.options.maxHighlightLength&&Ai(e.doc.mode,n.state),k=Le(e,t,n);f&&(n.state=f),t.stateAfter=n.save(!f),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Pt(e,t,i){var n=e.doc,f=e.display;if(!n.mode.startState)return new Y(n,!0,t);var k=kt(e,t,i),X=k>n.first&&Jt(n,k-1).stateAfter,J=X?Y.fromSaved(n,X,k):new Y(n,dr(n.mode),k);return n.iter(k,t,function(ee){rn(e,ee.text,J);var ae=J.line;ee.stateAfter=ae==t-1||ae%5==0||ae>=f.viewFrom&&ae<f.viewTo?J.save():null,J.nextLine()}),i&&(n.modeFrontier=J.line),J}function rn(e,t,i,n){var f=e.doc.mode,k=new mn(t,e.options.tabSize,i);for(k.start=k.pos=n||0,t==""&&ht(f,i.state);!k.eol();)Vt(f,k,i.state),k.start=k.pos}function ht(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Ui(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Vt(e,t,i,n){for(var f=0;f<10;f++){n&&(n[0]=Ui(e,i).mode);var k=e.token(t,i);if(t.pos>t.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var hi=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Li(e,t,i,n){var f=e.doc,k=f.mode,X;t=S(f,t);var J=Jt(f,t.line),ee=Pt(e,t.line,i),ae=new mn(J.text,e.options.tabSize,ee),Se;for(n&&(Se=[]);(n||ae.pos<t.ch)&&!ae.eol();)ae.start=ae.pos,X=Vt(k,ae,ee.state),n&&Se.push(new hi(ae,X,Ai(f.mode,ee.state)));return n?Se:new hi(ae,X,ee.state)}function Zt(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function dt(e,t,i,n,f,k,X){var J=i.flattenSpans;J==null&&(J=e.options.flattenSpans);var ee=0,ae=null,Se=new mn(t,e.options.tabSize,n),Re,Ve=e.options.addModeClass&&[null];for(t==""&&Zt(ht(i,n.state),k);!Se.eol();){if(Se.pos>e.options.maxHighlightLength?(J=!1,X&&rn(e,t,n,Se.pos),Se.pos=t.length,Re=null):Re=Zt(Vt(i,Se,n.state,Ve),k),Ve){var We=Ve[0].name;We&&(Re="m-"+(Re?We+" "+Re:We))}if(!J||ae!=Re){for(;ee<Se.start;)ee=Math.min(Se.start,ee+5e3),f(ee,ae);ae=Re}Se.start=Se.pos}for(;ee<Se.pos;){var st=Math.min(Se.pos,ee+5e3);f(st,ae),ee=st}}function kt(e,t,i){for(var n,f,k=e.doc,X=i?-1:t-(e.doc.mode.innerMode?1e3:100),J=t;J>X;--J){if(J<=k.first)return k.first;var ee=Jt(k,J-1),ae=ee.stateAfter;if(ae&&(!i||J+(ae instanceof te?ae.lookAhead:0)<=k.modeFrontier))return J;var Se=F(ee.text,null,e.options.tabSize);(f==null||n>Se)&&(f=J-1,n=Se)}return f}function Lt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var f=Jt(e,n).stateAfter;if(f&&(!(f instanceof te)||n+f.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Kt=!1,sn=!1;function En(){Kt=!0}function wn(){sn=!0}function hn(e,t,i){this.marker=e,this.from=t,this.to=i}function Ln(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function zn(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function un(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Sn(e,t,i){var n;if(e)for(var f=0;f<e.length;++f){var k=e[f],X=k.marker,J=k.from==null||(X.inclusiveLeft?k.from<=t:k.from<t);if(J||k.from==t&&X.type=="bookmark"&&(!i||!k.marker.insertLeft)){var ee=k.to==null||(X.inclusiveRight?k.to>=t:k.to>t);(n||(n=[])).push(new hn(X,k.from,ee?null:k.to))}}return n}function di(e,t,i){var n;if(e)for(var f=0;f<e.length;++f){var k=e[f],X=k.marker,J=k.to==null||(X.inclusiveRight?k.to>=t:k.to>t);if(J||k.from==t&&X.type=="bookmark"&&(!i||k.marker.insertLeft)){var ee=k.from==null||(X.inclusiveLeft?k.from<=t:k.from<t);(n||(n=[])).push(new hn(X,ee?null:k.from-t,k.to==null?null:k.to-t))}}return n}function Nn(e,t){if(t.full)return null;var i=kr(e,t.from.line)&&Jt(e,t.from.line).markedSpans,n=kr(e,t.to.line)&&Jt(e,t.to.line).markedSpans;if(!i&&!n)return null;var f=t.from.ch,k=t.to.ch,X=cn(t.from,t.to)==0,J=Sn(i,f,X),ee=di(n,k,X),ae=t.text.length==1,Se=Te(t.text).length+(ae?f:0);if(J)for(var Re=0;Re<J.length;++Re){var Ve=J[Re];if(Ve.to==null){var We=Ln(ee,Ve.marker);We?ae&&(Ve.to=We.to==null?null:We.to+Se):Ve.to=f}}if(ee)for(var st=0;st<ee.length;++st){var _t=ee[st];if(_t.to!=null&&(_t.to+=Se),_t.from==null){var It=Ln(J,_t.marker);It||(_t.from=Se,ae&&(J||(J=[])).push(_t))}else _t.from+=Se,ae&&(J||(J=[])).push(_t)}J&&(J=zt(J)),ee&&ee!=J&&(ee=zt(ee));var Wt=[J];if(!ae){var en=t.text.length-2,Ht;if(en>0&&J)for(var on=0;on<J.length;++on)J[on].to==null&&(Ht||(Ht=[])).push(new hn(J[on].marker,null,null));for(var Pn=0;Pn<en;++Pn)Wt.push(Ht);Wt.push(ee)}return Wt}function zt(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function An(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(We){if(We.markedSpans)for(var st=0;st<We.markedSpans.length;++st){var _t=We.markedSpans[st].marker;_t.readOnly&&(!n||q(n,_t)==-1)&&(n||(n=[])).push(_t)}}),!n)return null;for(var f=[{from:t,to:i}],k=0;k<n.length;++k)for(var X=n[k],J=X.find(0),ee=0;ee<f.length;++ee){var ae=f[ee];if(cn(ae.to,J.from)<0||cn(ae.from,J.to)>0)continue;var Se=[ee,1],Re=cn(ae.from,J.from),Ve=cn(ae.to,J.to);(Re<0||!X.inclusiveLeft&&!Re)&&Se.push({from:ae.from,to:J.from}),(Ve>0||!X.inclusiveRight&&!Ve)&&Se.push({from:J.to,to:ae.to}),f.splice.apply(f,Se),ee+=Se.length-3}return f}function si(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Un(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Xt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function pn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),f=t.find(),k=cn(n.from,f.from)||Xt(e)-Xt(t);if(k)return-k;var X=cn(n.to,f.to)||jt(e)-jt(t);return X||t.id-e.id}function Ct(e,t){var i=sn&&e.markedSpans,n;if(i)for(var f=void 0,k=0;k<i.length;++k)f=i[k],f.marker.collapsed&&(t?f.from:f.to)==null&&(!n||pn(n,f.marker)<0)&&(n=f.marker);return n}function Nt(e){return Ct(e,!0)}function Dt(e){return Ct(e,!1)}function Pe(e,t){var i=sn&&e.markedSpans,n;if(i)for(var f=0;f<i.length;++f){var k=i[f];k.marker.collapsed&&(k.from==null||k.from<t)&&(k.to==null||k.to>t)&&(!n||pn(n,k.marker)<0)&&(n=k.marker)}return n}function Yt(e,t,i,n,f){var k=Jt(e,t),X=sn&&k.markedSpans;if(X)for(var J=0;J<X.length;++J){var ee=X[J];if(!ee.marker.collapsed)continue;var ae=ee.marker.find(0),Se=cn(ae.from,i)||Xt(ee.marker)-Xt(f),Re=cn(ae.to,n)||jt(ee.marker)-jt(f);if(Se>=0&&Re<=0||Se<=0&&Re>=0)continue;if(Se<=0&&(ee.marker.inclusiveRight&&f.inclusiveLeft?cn(ae.to,i)>=0:cn(ae.to,i)>0)||Se>=0&&(ee.marker.inclusiveRight&&f.inclusiveLeft?cn(ae.from,n)<=0:cn(ae.from,n)<0))return!0}}function xn(e){for(var t;t=Nt(e);)e=t.find(-1,!0).line;return e}function pi(e){for(var t;t=Dt(e);)e=t.find(1,!0).line;return e}function On(e){for(var t,i;t=Dt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function tr(e,t){var i=Jt(e,t),n=xn(i);return i==n?t:Fn(n)}function nr(e,t){if(t>e.lastLine())return t;var i=Jt(e,t),n;if(!Fi(e,i))return t;for(;n=Dt(i);)i=n.find(1,!0).line;return Fn(i)+1}function Fi(e,t){var i=sn&&t.markedSpans;if(i)for(var n=void 0,f=0;f<i.length;++f){if(n=i[f],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Bn(e,t,n))return!0}}function Bn(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Bn(e,n.line,Ln(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var f=void 0,k=0;k<t.markedSpans.length;++k)if(f=t.markedSpans[k],f.marker.collapsed&&!f.marker.widgetNode&&f.from==i.to&&(f.to==null||f.to!=i.from)&&(f.marker.inclusiveLeft||i.marker.inclusiveRight)&&Bn(e,t,f))return!0}function Ft(e){e=xn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var f=i.lines[n];if(f==e)break;t+=f.height}for(var k=i.parent;k;i=k,k=i.parent)for(var X=0;X<k.children.length;++X){var J=k.children[X];if(J==i)break;t+=J.height}return t}function yi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=Nt(n);){var f=i.find(0,!0);n=f.from.line,t+=f.from.ch-f.to.ch}for(n=e;i=Dt(n);){var k=i.find(0,!0);t-=n.text.length-k.from.ch,n=k.to.line,t+=n.text.length-k.to.ch}return t}function li(e){var t=e.display,i=e.doc;t.maxLine=Jt(i,i.first),t.maxLineLength=yi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var f=yi(n);f>t.maxLineLength&&(t.maxLineLength=f,t.maxLine=n)})}var $n=function(e,t,i){this.text=e,Un(this,t),this.height=i?i(this):1};$n.prototype.lineNo=function(){return Fn(this)},pe($n);function ir(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),si(e),Un(e,i);var f=n?n(e):1;f!=e.height&&sr(e,f)}function Qt(e){e.parent=null,si(e)}var qt={},$t={};function dn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?$t:qt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Gn(e,t){var i=E("span",null,null,L?"padding-right: .1px":null),n={pre:E("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var f=0;f<=(t.rest?t.rest.length:0);f++){var k=f?t.rest[f-1]:t.line,X=void 0;n.pos=0,n.addToken=qn,_n(e.display.measure)&&(X=xt(k,e.doc.direction))&&(n.addToken=Tr(n.addToken,X)),n.map=[];var J=t!=e.display.externalMeasured&&Fn(k);$r(k,n,ct(e,k,J)),k.styleClasses&&(k.styleClasses.bgClass&&(n.bgClass=j(k.styleClasses.bgClass,n.bgClass||"")),k.styleClasses.textClass&&(n.textClass=j(k.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(tn(e.display.measure))),f==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(L){var ee=n.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=j(n.pre.className,n.textClass||"")),n}function Mn(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function qn(e,t,i,n,f,k,X){if(!t)return;var J=e.splitSpaces?mi(t,e.trailingSpace):t,ee=e.cm.state.specialChars,ae=!1,Se;if(!ee.test(t))e.col+=t.length,Se=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,Se),K&&W<9&&(ae=!0),e.pos+=t.length;else{Se=document.createDocumentFragment();for(var Re=0;;){ee.lastIndex=Re;var Ve=ee.exec(t),We=Ve?Ve.index-Re:t.length-Re;if(We){var st=document.createTextNode(J.slice(Re,Re+We));K&&W<9?Se.appendChild(o("span",[st])):Se.appendChild(st),e.map.push(e.pos,e.pos+We,st),e.col+=We,e.pos+=We}if(!Ve)break;Re+=We+1;var _t=void 0;if(Ve[0]==" "){var It=e.cm.options.tabSize,Wt=It-e.col%It;_t=Se.appendChild(o("span",ne(Wt),"cm-tab")),_t.setAttribute("role","presentation"),_t.setAttribute("cm-text"," "),e.col+=Wt}else Ve[0]=="\r"||Ve[0]==`
`?(_t=Se.appendChild(o("span",Ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_t.setAttribute("cm-text",Ve[0]),e.col+=1):(_t=e.cm.options.specialCharPlaceholder(Ve[0]),_t.setAttribute("cm-text",Ve[0]),K&&W<9?Se.appendChild(o("span",[_t])):Se.appendChild(_t),e.col+=1);e.map.push(e.pos,e.pos+1,_t),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,i||n||f||ae||k||X){var en=i||"";n&&(en+=n),f&&(en+=f);var Ht=o("span",[Se],en,k);if(X)for(var on in X)X.hasOwnProperty(on)&&on!="style"&&on!="class"&&Ht.setAttribute(on,X[on]);return e.content.appendChild(Ht)}e.content.appendChild(Se)}function mi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",f=0;f<e.length;f++){var k=e.charAt(f);k==" "&&i&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(k="\xA0"),n+=k,i=k==" "}return n}function Tr(e,t){return function(i,n,f,k,X,J,ee){f=f?f+" cm-force-border":"cm-force-border";for(var ae=i.pos,Se=ae+n.length;;){for(var Re=void 0,Ve=0;Ve<t.length&&!(Re=t[Ve],Re.to>ae&&Re.from<=ae);Ve++);if(Re.to>=Se)return e(i,n,f,k,X,J,ee);e(i,n.slice(0,Re.to-ae),f,k,null,J,ee),k=null,n=n.slice(Re.to-ae),ae=Re.to}}}function Zn(e,t,i,n){var f=!n&&i.widgetNode;f&&e.map.push(e.pos,e.pos+t,f),!n&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",i.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=t,e.trailingSpace=!1}function $r(e,t,i){var n=e.markedSpans,f=e.text,k=0;if(!n){for(var X=1;X<i.length;X+=2)t.addToken(t,f.slice(k,k=i[X]),dn(i[X+1],t.cm.options));return}for(var J=f.length,ee=0,ae=1,Se="",Re,Ve,We=0,st,_t,It,Wt,en;;){if(We==ee){st=_t=It=Ve="",en=null,Wt=null,We=Infinity;for(var Ht=[],on=void 0,Pn=0;Pn<n.length;++Pn){var vn=n[Pn],ai=vn.marker;if(ai.type=="bookmark"&&vn.from==ee&&ai.widgetNode)Ht.push(ai);else if(vn.from<=ee&&(vn.to==null||vn.to>ee||ai.collapsed&&vn.to==ee&&vn.from==ee)){if(vn.to!=null&&vn.to!=ee&&We>vn.to&&(We=vn.to,_t=""),ai.className&&(st+=" "+ai.className),ai.css&&(Ve=(Ve?Ve+";":"")+ai.css),ai.startStyle&&vn.from==ee&&(It+=" "+ai.startStyle),ai.endStyle&&vn.to==We&&(on||(on=[])).push(ai.endStyle,vn.to),ai.title&&((en||(en={})).title=ai.title),ai.attributes)for(var Ni in ai.attributes)(en||(en={}))[Ni]=ai.attributes[Ni];ai.collapsed&&(!Wt||pn(Wt.marker,ai)<0)&&(Wt=vn)}else vn.from>ee&&We>vn.from&&(We=vn.from)}if(on)for(var Er=0;Er<on.length;Er+=2)on[Er+1]==We&&(_t+=" "+on[Er]);if(!Wt||Wt.from==ee)for(var Qi=0;Qi<Ht.length;++Qi)Zn(t,0,Ht[Qi]);if(Wt&&(Wt.from||0)==ee){if(Zn(t,(Wt.to==null?J+1:Wt.to)-ee,Wt.marker,Wt.from==null),Wt.to==null)return;Wt.to==ee&&(Wt=!1)}}if(ee>=J)break;for(var Yr=Math.min(J,We);;){if(Se){var Fr=ee+Se.length;if(!Wt){var ur=Fr>Yr?Se.slice(0,Yr-ee):Se;t.addToken(t,ur,Re?Re+st:st,It,ee+ur.length==We?_t:"",Ve,en)}if(Fr>=Yr){Se=Se.slice(Yr-ee),ee=Yr;break}ee=Fr,It=""}Se=f.slice(k,k=i[ae++]),Re=dn(i[ae++],t.cm.options)}}}function gi(e,t,i){this.line=t,this.rest=On(t),this.size=this.rest?Fn(Te(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Fi(e,t)}function fr(e,t,i){for(var n=[],f,k=t;k<i;k=f){var X=new gi(e.doc,Jt(e.doc,k),k);f=k+X.size,n.push(X)}return n}var rr=null;function Mr(e){rr?rr.ops.push(e):e.ownsGroup=rr={ops:[e],delayedCallbacks:[]}}function ka(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var f=e.ops[n];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(i<t.length)}function Do(e,t){var i=e.ownsGroup;if(!i)return;try{ka(i)}finally{rr=null,t(i)}}var ua=null;function Wi(e,t){var i=Mt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),f;rr?f=rr.delayedCallbacks:ua?f=ua:(f=ua=[],setTimeout(lo,0));for(var k=function(J){f.push(function(){return i[J].apply(null,n)})},X=0;X<i.length;++X)k(X)}function lo(){var e=ua;ua=null;for(var t=0;t<e.length;++t)e[t]()}function uo(e,t,i,n){for(var f=0;f<t.changes.length;f++){var k=t.changes[f];k=="text"?co(e,t):k=="gutter"?wa(e,t,i,n):k=="class"?Ma(e,t):k=="widget"&&ho(e,t,n)}t.changes=null}function va(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&W<8&&(e.node.style.zIndex=2)),e.node}function _a(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=va(t);t.background=n.insertBefore(o("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Qa(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Gn(e,t)}function co(e,t){var i=t.text.className,n=Qa(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Ma(e,t)):i&&(t.text.className=i)}function Ma(e,t){_a(e,t),t.line.wrapClass?va(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function wa(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var f=va(t);t.gutterBackground=o("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),f.insertBefore(t.gutterBackground,t.text)}var k=t.line.gutterMarkers;if(e.options.lineNumbers||k){var X=va(t),J=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(J),X.insertBefore(J,t.text),t.line.gutterClass&&(J.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!k||!k["CodeMirror-linenumbers"])&&(t.lineNumber=J.appendChild(o("div",Qr(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),k)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var ae=e.display.gutterSpecs[ee].className,Se=k.hasOwnProperty(ae)&&k[ae];Se&&J.appendChild(o("div",[Se],"CodeMirror-gutter-elt","left: "+n.gutterLeft[ae]+"px; width: "+n.gutterWidth[ae]+"px"))}}}function ho(e,t,i){t.alignable&&(t.alignable=null);for(var n=w("CodeMirror-linewidget"),f=t.node.firstChild,k=void 0;f;f=k)k=f.nextSibling,n.test(f.className)&&t.node.removeChild(f);Na(e,t,i)}function fo(e,t,i,n){var f=Qa(e,t);return t.text=t.node=f.pre,f.bgClass&&(t.bgClass=f.bgClass),f.textClass&&(t.textClass=f.textClass),Ma(e,t),wa(e,t,i,n),Na(e,t,n),t.node}function Na(e,t,i){if(po(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)po(e,t.rest[n],t,i,!1)}function po(e,t,i,n,f){if(!t.widgets)return;for(var k=va(i),X=0,J=t.widgets;X<J.length;++X){var ee=J[X],ae=o("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||ae.setAttribute("cm-ignore-events","true"),$a(ee,ae,i,n),e.display.input.setUneditable(ae),f&&ee.above?k.insertBefore(ae,i.gutter||i.text):k.appendChild(ae),Wi(ee,"redraw")}}function $a(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var f=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(f-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=f+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function ya(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!C(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,o("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function ia(e,t){for(var i=De(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function ba(e){return e.lineSpace.offsetTop}function ye(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Oe(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,o("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Me(e){return ie-e.display.nativeBarWidth}function Ce(e){return e.display.scroller.clientWidth-Me(e)-e.display.barWidth}function re(e){return e.display.scroller.clientHeight-Me(e)-e.display.barHeight}function me(e,t,i){var n=e.options.lineWrapping,f=n&&Ce(e);if(!t.measure.heights||n&&t.measure.width!=f){var k=t.measure.heights=[];if(n){t.measure.width=f;for(var X=t.text.firstChild.getClientRects(),J=0;J<X.length-1;J++){var ee=X[J],ae=X[J+1];Math.abs(ee.bottom-ae.bottom)>2&&k.push((ee.bottom+ae.top)/2-i.top)}}k.push(i.bottom-i.top)}}function oe(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var f=0;f<e.rest.length;f++)if(Fn(e.rest[f])>i)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}function we(e,t){t=xn(t);var i=Fn(t),n=e.display.externalMeasured=new gi(e.doc,t,i);n.lineN=i;var f=n.built=Gn(e,n);return n.text=f.pre,s(e.display.lineMeasure,f.pre),n}function ve(e,t,i,n){return je(e,Ie(e,t),i,n)}function ke(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Di(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Ie(e,t){var i=Fn(t),n=ke(e,i);n&&!n.text?n=null:n&&n.changes&&(uo(e,n,i,Bi(e)),e.curOp.forceUpdate=!0),n||(n=we(e,t));var f=oe(n,t,i);return{line:t,view:n,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function je(e,t,i,n,f){t.before&&(i=-1);var k=i+(n||""),X;return t.cache.hasOwnProperty(k)?X=t.cache[k]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(me(e,t.view,t.rect),t.hasHeights=!0),X=Ut(e,t,i,n),X.bogus||(t.cache[k]=X)),{left:X.left,right:X.right,top:f?X.rtop:X.top,bottom:f?X.rbottom:X.bottom}}var Ze={left:0,right:0,top:0,bottom:0};function mt(e,t,i){for(var n,f,k,X,J,ee,ae=0;ae<e.length;ae+=3)if(J=e[ae],ee=e[ae+1],t<J?(f=0,k=1,X="left"):t<ee?(f=t-J,k=f+1):(ae==e.length-3||t==ee&&e[ae+3]>t)&&(k=ee-J,f=k-1,t>=ee&&(X="right")),f!=null){if(n=e[ae+2],J==ee&&i==(n.insertLeft?"left":"right")&&(X=i),i=="left"&&f==0)for(;ae&&e[ae-2]==e[ae-3]&&e[ae-1].insertLeft;)n=e[(ae-=3)+2],X="left";if(i=="right"&&f==ee-J)for(;ae<e.length-3&&e[ae+3]==e[ae+4]&&!e[ae+5].insertLeft;)n=e[(ae+=3)+2],X="right";break}return{node:n,start:f,end:k,collapse:X,coverStart:J,coverEnd:ee}}function bt(e,t){var i=Ze;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var f=e.length-1;f>=0&&!((i=e[f]).left!=i.right);f--);return i}function Ut(e,t,i,n){var f=mt(t.map,i,n),k=f.node,X=f.start,J=f.end,ee=f.collapse,ae;if(k.nodeType==3){for(var Se=0;Se<4;Se++){for(;X&&rt(t.line.text.charAt(f.coverStart+X));)--X;for(;f.coverStart+J<f.coverEnd&&rt(t.line.text.charAt(f.coverStart+J));)++J;if(K&&W<9&&X==0&&J==f.coverEnd-f.coverStart?ae=k.parentNode.getBoundingClientRect():ae=bt(g(k,X,J).getClientRects(),n),ae.left||ae.right||X==0)break;J=X,X=X-1,ee="right"}K&&W<11&&(ae=Rn(e.display.measure,ae))}else{X>0&&(ee=n="right");var Re;e.options.lineWrapping&&(Re=k.getClientRects()).length>1?ae=Re[n=="right"?Re.length-1:0]:ae=k.getBoundingClientRect()}if(K&&W<9&&!X&&(!ae||!ae.left&&!ae.right)){var Ve=k.parentNode.getClientRects()[0];Ve?ae={left:Ve.left,right:Ve.left+Gi(e.display),top:Ve.top,bottom:Ve.bottom}:ae=Ze}for(var We=ae.top-t.rect.top,st=ae.bottom-t.rect.top,_t=(We+st)/2,It=t.view.measure.heights,Wt=0;Wt<It.length-1&&!(_t<It[Wt]);Wt++);var en=Wt?It[Wt-1]:0,Ht=It[Wt],on={left:(ee=="right"?ae.right:ae.left)-t.rect.left,right:(ee=="left"?ae.left:ae.right)-t.rect.left,top:en,bottom:Ht};return!ae.left&&!ae.right&&(on.bogus=!0),e.options.singleCursorHeightPerLine||(on.rtop=We,on.rbottom=st),on}function Rn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ci(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function Qn(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 jn(e){e.display.externalMeasure=null,v(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Qn(e.display.view[t])}function Vn(e){jn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Yn(){return b&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Xn(){return b&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Wn(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ya(e.widgets[i]));return t}function Jn(e,t,i,n,f){if(!f){var k=Wn(t);i.top+=k,i.bottom+=k}if(n=="line")return i;n||(n="local");var X=Ft(t);if(n=="local"?X+=ba(e.display):X-=e.display.viewOffset,n=="page"||n=="window"){var J=e.display.lineSpace.getBoundingClientRect();X+=J.top+(n=="window"?0:Xn());var ee=J.left+(n=="window"?0:Yn());i.left+=ee,i.right+=ee}return i.top+=X,i.bottom+=X,i}function ei(e,t,i){if(i=="div")return t;var n=t.left,f=t.top;if(i=="page")n-=Yn(),f-=Xn();else if(i=="local"||!i){var k=e.display.sizer.getBoundingClientRect();n+=k.left,f+=k.top}var X=e.display.lineSpace.getBoundingClientRect();return{left:n-X.left,top:f-X.top}}function ki(e,t,i,n,f){return n||(n=Jt(e.doc,t.line)),Jn(e,n,ve(e,n,t.ch,f),i)}function ti(e,t,i,n,f,k){n=n||Jt(e.doc,t.line),f||(f=Ie(e,n));function X(st,_t){var It=je(e,f,st,_t?"right":"left",k);return _t?It.left=It.right:It.right=It.left,Jn(e,n,It,i)}var J=xt(n,e.doc.direction),ee=t.ch,ae=t.sticky;if(ee>=n.text.length?(ee=n.text.length,ae="before"):ee<=0&&(ee=0,ae="after"),!J)return X(ae=="before"?ee-1:ee,ae=="before");function Se(st,_t,It){var Wt=J[_t],en=Wt.level==1;return X(It?st-1:st,en!=It)}var Re=at(J,ee,ae),Ve=vt,We=Se(ee,Re,ae=="before");return Ve!=null&&(We.other=Se(ee,Ve,ae!="before")),We}function gn(e,t){var i=0;t=S(e.doc,t),e.options.lineWrapping||(i=Gi(e.display)*t.ch);var n=Jt(e.doc,t.line),f=Ft(n)+ba(e.display);return{left:i,right:i,top:f,bottom:f+n.height}}function fn(e,t,i,n,f){var k=yt(e,t,i);return k.xRel=f,n&&(k.outside=n),k}function Hn(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return fn(n.first,0,null,-1,-1);var f=er(n,i),k=n.first+n.size-1;if(f>k)return fn(n.first+n.size-1,Jt(n,k).text.length,null,1,1);t<0&&(t=0);for(var X=Jt(n,f);;){var J=Mi(e,X,f,t,i),ee=Pe(X,J.ch+(J.xRel>0||J.outside>0?1:0));if(!ee)return J;var ae=ee.find(1);if(ae.line==f)return ae;X=Jt(n,f=ae.line)}}function ui(e,t,i,n){n-=Wn(t);var f=t.text.length,k=gt(function(X){return je(e,i,X-1).bottom<=n},f,0);return f=gt(function(X){return je(e,i,X).top>n},k,f),{begin:k,end:f}}function an(e,t,i,n){i||(i=Ie(e,t));var f=Jn(e,t,je(e,i,n),"line").top;return ui(e,t,i,f)}function ci(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Mi(e,t,i,n,f){f-=Ft(t);var k=Ie(e,t),X=Wn(t),J=0,ee=t.text.length,ae=!0,Se=xt(t,e.doc.direction);if(Se){var Re=(e.options.lineWrapping?wi:ri)(e,t,i,k,Se,n,f);ae=Re.level!=1,J=ae?Re.from:Re.to-1,ee=ae?Re.to:Re.from-1}var Ve=null,We=null,st=gt(function(Pn){var vn=je(e,k,Pn);return vn.top+=X,vn.bottom+=X,ci(vn,n,f,!1)?(vn.top<=f&&vn.left<=n&&(Ve=Pn,We=vn),!0):!1},J,ee),_t,It,Wt=!1;if(We){var en=n-We.left<We.right-n,Ht=en==ae;st=Ve+(Ht?0:1),It=Ht?"after":"before",_t=en?We.left:We.right}else{!ae&&(st==ee||st==J)&&st++,It=st==0?"after":st==t.text.length?"before":je(e,k,st-(ae?1:0)).bottom+X<=f==ae?"after":"before";var on=ti(e,yt(i,st,It),"line",t,k);_t=on.left,Wt=f<on.top?-1:f>=on.bottom?1:0}return st=qe(t.text,st,1),fn(i,st,It,Wt,n-_t)}function ri(e,t,i,n,f,k,X){var J=gt(function(Re){var Ve=f[Re],We=Ve.level!=1;return ci(ti(e,yt(i,We?Ve.to:Ve.from,We?"before":"after"),"line",t,n),k,X,!0)},0,f.length-1),ee=f[J];if(J>0){var ae=ee.level!=1,Se=ti(e,yt(i,ae?ee.from:ee.to,ae?"after":"before"),"line",t,n);ci(Se,k,X,!0)&&Se.top>X&&(ee=f[J-1])}return ee}function wi(e,t,i,n,f,k,X){var J=ui(e,t,n,X),ee=J.begin,ae=J.end;/\s/.test(t.text.charAt(ae-1))&&ae--;for(var Se=null,Re=null,Ve=0;Ve<f.length;Ve++){var We=f[Ve];if(We.from>=ae||We.to<=ee)continue;var st=We.level!=1,_t=je(e,n,st?Math.min(ae,We.to)-1:Math.max(ee,We.from)).right,It=_t<k?k-_t+1e9:_t-k;(!Se||Re>It)&&(Se=We,Re=It)}return Se||(Se=f[f.length-1]),Se.from<ee&&(Se={from:ee,to:Se.to,level:Se.level}),Se.to>ae&&(Se={from:Se.from,to:ae,level:Se.level}),Se}var bi;function Hi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(bi==null){bi=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)bi.appendChild(document.createTextNode("x")),bi.appendChild(o("br"));bi.appendChild(document.createTextNode("x"))}s(e.measure,bi);var i=bi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),v(e.measure),i||1}function Gi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),i=o("pre",[t],"CodeMirror-line-like");s(e.measure,i);var n=t.getBoundingClientRect(),f=(n.right-n.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Bi(e){for(var t=e.display,i={},n={},f=t.gutters.clientLeft,k=t.gutters.firstChild,X=0;k;k=k.nextSibling,++X){var J=e.display.gutterSpecs[X].className;i[J]=k.offsetLeft+k.clientLeft+f,n[J]=k.clientWidth}return{fixedPos:vr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function vr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Lr(e){var t=Hi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Gi(e.display)-3);return function(f){if(Fi(e.doc,f))return 0;var k=0;if(f.widgets)for(var X=0;X<f.widgets.length;X++)f.widgets[X].height&&(k+=f.widgets[X].height);return i?k+(Math.ceil(f.text.length/n)||1)*t:k+t}}function Cr(e){var t=e.doc,i=Lr(e);t.iter(function(n){var f=i(n);f!=n.height&&sr(n,f)})}function Vi(e,t,i,n){var f=e.display;if(!i&&De(t).getAttribute("cm-not-content")=="true")return null;var k,X,J=f.lineSpace.getBoundingClientRect();try{k=t.clientX-J.left,X=t.clientY-J.top}catch(Re){return null}var ee=Hn(e,k,X),ae;if(n&&ee.xRel>0&&(ae=Jt(e.doc,ee.line).text).length==ee.ch){var Se=F(ae,ae.length,e.options.tabSize)-ae.length;ee=yt(ee.line,Math.max(0,Math.round((k-Oe(e.display).left)/Gi(e.display))-Se))}return ee}function Di(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Ei(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var f=e.display;if(n&&i<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>t)&&(f.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=f.viewTo)sn&&tr(e.doc,t)<f.viewTo&&xi(e);else if(i<=f.viewFrom)sn&&nr(e.doc,i+n)>f.viewFrom?xi(e):(f.viewFrom+=n,f.viewTo+=n);else if(t<=f.viewFrom&&i>=f.viewTo)xi(e);else if(t<=f.viewFrom){var k=Nr(e,i,i+n,1);k?(f.view=f.view.slice(k.index),f.viewFrom=k.lineN,f.viewTo+=n):xi(e)}else if(i>=f.viewTo){var X=Nr(e,t,t,-1);X?(f.view=f.view.slice(0,X.index),f.viewTo=X.lineN):xi(e)}else{var J=Nr(e,t,t,-1),ee=Nr(e,i,i+n,1);J&&ee?(f.view=f.view.slice(0,J.index).concat(fr(e,J.lineN,ee.lineN)).concat(f.view.slice(ee.index)),f.viewTo+=n):xi(e)}var ae=f.externalMeasured;ae&&(i<ae.lineN?ae.lineN+=n:t<ae.lineN+ae.size&&(f.externalMeasured=null))}function Tn(e,t,i){e.curOp.viewChanged=!0;var n=e.display,f=e.display.externalMeasured;if(f&&t>=f.lineN&&t<f.lineN+f.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var k=n.view[Di(e,t)];if(k.node==null)return;var X=k.changes||(k.changes=[]);q(X,i)==-1&&X.push(i)}function xi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Nr(e,t,i,n){var f=Di(e,t),k,X=e.display.view;if(!sn||i==e.doc.first+e.doc.size)return{index:f,lineN:i};for(var J=e.display.viewFrom,ee=0;ee<f;ee++)J+=X[ee].size;if(J!=t){if(n>0){if(f==X.length-1)return null;k=J+X[f].size-t,f++}else k=J-t;t+=k,i+=k}for(;tr(e.doc,i)!=i;){if(f==(n<0?0:X.length-1))return null;i+=n*X[f-(n<0?1:0)].size,f+=n}return{index:f,lineN:i}}function Zr(e,t,i){var n=e.display,f=n.view;f.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=fr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=fr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Di(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(fr(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Di(e,i)))),n.viewTo=i}function ra(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var f=t[n];!f.hidden&&(!f.node||f.changes)&&++i}return i}function Ti(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Vr(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},f=n.cursors=document.createDocumentFragment(),k=n.selection=document.createDocumentFragment(),X=0;X<i.sel.ranges.length;X++){if(!t&&X==i.sel.primIndex)continue;var J=i.sel.ranges[X];if(J.from().line>=e.display.viewTo||J.to().line<e.display.viewFrom)continue;var ee=J.empty();(ee||e.options.showCursorWhenSelecting)&&Jr(e,J.head,f),ee||vi(e,J,k)}return n}function Jr(e,t,i){var n=ti(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),f=i.appendChild(o("div","\xA0","CodeMirror-cursor"));if(f.style.left=n.left+"px",f.style.top=n.top+"px",f.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var k=i.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));k.style.display="",k.style.left=n.other.left+"px",k.style.top=n.other.top+"px",k.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Oi(e,t){return e.top-t.top||e.left-t.left}function vi(e,t,i){var n=e.display,f=e.doc,k=document.createDocumentFragment(),X=Oe(e.display),J=X.left,ee=Math.max(n.sizerWidth,Ce(e)-n.sizer.offsetLeft)-X.right,ae=f.direction=="ltr";function Se(Ht,on,Pn,vn){on<0&&(on=0),on=Math.round(on),vn=Math.round(vn),k.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+Ht+`px;
top: `+on+"px; width: "+(Pn==null?ee-Ht:Pn)+`px;
height: `+(vn-on)+"px"))}function Re(Ht,on,Pn){var vn=Jt(f,Ht),ai=vn.text.length,Ni,Er;function Qi(ur,Wr){return ki(e,yt(Ht,ur),"div",vn,Wr)}function Yr(ur,Wr,wr){var gr=an(e,vn,null,ur),cr=Wr=="ltr"==(wr=="after")?"left":"right",Ji=wr=="after"?gr.begin:gr.end-(/\s/.test(vn.text.charAt(gr.end-1))?2:1);return Qi(Ji,cr)[cr]}var Fr=xt(vn,f.direction);return pt(Fr,on||0,Pn==null?ai:Pn,function(ur,Wr,wr,gr){var cr=wr=="ltr",Ji=Qi(ur,cr?"left":"right"),Hr=Qi(Wr-1,cr?"right":"left"),Ro=on==null&&ur==0,Ya=Pn==null&&Wr==ai,Rr=gr==0,Ca=!Fr||gr==Fr.length-1;if(Hr.top-Ji.top<=3){var xr=(ae?Ro:Ya)&&Rr,ys=(ae?Ya:Ro)&&Ca,Ia=xr?J:(cr?Ji:Hr).left,oo=ys?ee:(cr?Hr:Ji).right;Se(Ia,Ji.top,oo-Ia,Ji.bottom)}else{var so,Ir,Lo,bs;cr?(so=ae&&Ro&&Rr?J:Ji.left,Ir=ae?ee:Yr(ur,wr,"before"),Lo=ae?J:Yr(Wr,wr,"after"),bs=ae&&Ya&&Ca?ee:Hr.right):(so=ae?Yr(ur,wr,"before"):J,Ir=!ae&&Ro&&Rr?ee:Ji.right,Lo=!ae&&Ya&&Ca?J:Hr.left,bs=ae?Yr(Wr,wr,"after"):ee),Se(so,Ji.top,Ir-so,Ji.bottom),Ji.bottom<Hr.top&&Se(J,Ji.bottom,null,Hr.top),Se(Lo,Hr.top,bs-Lo,Hr.bottom)}(!Ni||Oi(Ji,Ni)<0)&&(Ni=Ji),Oi(Hr,Ni)<0&&(Ni=Hr),(!Er||Oi(Ji,Er)<0)&&(Er=Ji),Oi(Hr,Er)<0&&(Er=Hr)}),{start:Ni,end:Er}}var Ve=t.from(),We=t.to();if(Ve.line==We.line)Re(Ve.line,Ve.ch,We.ch);else{var st=Jt(f,Ve.line),_t=Jt(f,We.line),It=xn(st)==xn(_t),Wt=Re(Ve.line,Ve.ch,It?st.text.length+1:null).end,en=Re(We.line,It?0:null,We.ch).start;It&&(Wt.top<en.top-2?(Se(Wt.right,Wt.top,null,Wt.bottom),Se(J,en.top,en.left,en.bottom)):Se(Wt.right,Wt.top,en.left-Wt.right,Wt.bottom)),Wt.bottom<en.top&&Se(J,Wt.bottom,null,en.top)}i.appendChild(k)}function ji(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ea(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ua(e){e.state.focused||(e.display.input.focus(),ca(e))}function Za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ea(e))},100)}function ca(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ze(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(),L&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ji(e)}function Ea(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ze(e,"blur",e,t),e.state.focused=!1,m(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function $i(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var f=t.view[n],k=e.options.lineWrapping,X=void 0,J=0;if(f.hidden)continue;if(K&&W<8){var ee=f.node.offsetTop+f.node.offsetHeight;X=ee-i,i=ee}else{var ae=f.node.getBoundingClientRect();X=ae.bottom-ae.top,!k&&f.text.firstChild&&(J=f.text.firstChild.getBoundingClientRect().right-ae.left-1)}var Se=f.line.height-X;if((Se>.005||Se<-.005)&&(sr(f.line,X),Xr(f.line),f.rest))for(var Re=0;Re<f.rest.length;Re++)Xr(f.rest[Re]);if(J>e.display.sizerWidth){var Ve=Math.ceil(J/Gi(e.display));Ve>e.display.maxLineLength&&(e.display.maxLineLength=Ve,e.display.maxLine=f.line,e.display.maxLineChanged=!0)}}}function Xr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Ba(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-ba(e));var f=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,k=er(t,n),X=er(t,f);if(i&&i.ensure){var J=i.ensure.from.line,ee=i.ensure.to.line;J<k?(k=J,X=er(t,Ft(Jt(t,J))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=X&&(k=er(t,Ft(Jt(t,ee))-e.wrapper.clientHeight),X=ee)}return{from:k,to:Math.max(X,k+1)}}function Po(e,t){if(ut(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),f=null;if(t.top+n.top<0?f=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!r){var k=o("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-ba(e.display))+`px;
height: `+(t.bottom-t.top+Me(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(f),e.display.lineSpace.removeChild(k)}}function Io(e,t,i,n){n==null&&(n=0);var f;!e.options.lineWrapping&&t==i&&(t=t.ch?yt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?yt(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var X=!1,J=ti(e,t),ee=!i||i==t?J:ti(e,i);f={left:Math.min(J.left,ee.left),top:Math.min(J.top,ee.top)-n,right:Math.max(J.left,ee.left),bottom:Math.max(J.bottom,ee.bottom)+n};var ae=Ja(e,f),Se=e.doc.scrollTop,Re=e.doc.scrollLeft;if(ae.scrollTop!=null&&(ha(e,ae.scrollTop),Math.abs(e.doc.scrollTop-Se)>1&&(X=!0)),ae.scrollLeft!=null&&(Dr(e,ae.scrollLeft),Math.abs(e.doc.scrollLeft-Re)>1&&(X=!0)),!X)break}return f}function mo(e,t){var i=Ja(e,t);i.scrollTop!=null&&ha(e,i.scrollTop),i.scrollLeft!=null&&Dr(e,i.scrollLeft)}function Ja(e,t){var i=e.display,n=Hi(e.display);t.top<0&&(t.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,k=re(e),X={};t.bottom-t.top>k&&(t.bottom=t.top+k);var J=e.doc.height+ye(i),ee=t.top<n,ae=t.bottom>J-n;if(t.top<f)X.scrollTop=ee?0:t.top;else if(t.bottom>f+k){var Se=Math.min(t.top,(ae?J:t.bottom)-k);Se!=f&&(X.scrollTop=Se)}var Re=e.options.fixedGutter?0:i.gutters.offsetWidth,Ve=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Re,We=Ce(e)-i.gutters.offsetWidth,st=t.right-t.left>We;return st&&(t.right=t.left+We),t.left<10?X.scrollLeft=0:t.left<Ve?X.scrollLeft=Math.max(0,t.left+Re-(st?0:10)):t.right>We+Ve-3&&(X.scrollLeft=t.right+(st?0:10)-We),X}function qa(e,t){if(t==null)return;ja(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function da(e){ja(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xa(e,t,i){(t!=null||i!=null)&&ja(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function go(e,t){ja(e),e.curOp.scrollToPos=t}function ja(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=gn(e,t.from),n=gn(e,t.to);Ta(e,i,n,t.margin)}}function Ta(e,t,i,n){var f=Ja(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});xa(e,f.scrollLeft,f.scrollTop)}function ha(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||Oa(e,{top:t}),Pi(e,t,!0),M&&Oa(e),Aa(e,100)}function Pi(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Dr(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,oi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+ye(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Me(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var aa=function(e,t,i){this.cm=i;var n=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=f.tabIndex=-1,e(n),e(f),Ye(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ye(f,"scroll",function(){f.clientWidth&&t(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};aa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var f=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},aa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},aa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},aa.prototype.zeroWidthHack=function(){var e=u&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Q,this.disableVert=new Q},aa.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var f=e.getBoundingClientRect(),k=i=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},aa.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 pa(e,t){t||(t=fa(e));var i=e.display.barWidth,n=e.display.barHeight;Fa(e,t);for(var f=0;f<4&&i!=e.display.barWidth||n!=e.display.barHeight;f++)i!=e.display.barWidth&&e.options.lineWrapping&&$i(e),Fa(e,fa(e)),i=e.display.barWidth,n=e.display.barHeight}function Fa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var eo={native:aa,null:Sa};function Wa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&m(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ye(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Dr(e,t):ha(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function qr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++to},Mr(e.curOp)}function oa(e){var t=e.curOp;t&&Do(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;no(i)})}function no(e){for(var t=e.ops,i=0;i<t.length;i++)io(t[i]);for(var n=0;n<t.length;n++)ko(t[n]);for(var f=0;f<t.length;f++)Mo(t[f]);for(var k=0;k<t.length;k++)ro(t[k]);for(var X=0;X<t.length;X++)No(t[X])}function io(e){var t=e.cm,i=t.display;ao(t),e.updateMaxLine&&li(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Pr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ko(e){e.updatedDisplay=e.mustUpdate&&ma(e.cm,e.update)}function Mo(e){var t=e.cm,i=t.display;e.updatedDisplay&&$i(t),e.barMeasure=fa(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ve(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Me(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ce(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ro(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Dr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&pa(t,e.barMeasure),e.updatedDisplay&&_i(t,e.barMeasure),e.selectionChanged&&ji(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ua(e.cm)}function No(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&za(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Pi(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Dr(t,e.scrollLeft,!0,!0),e.scrollToPos){var f=Io(t,S(n,e.scrollToPos.from),S(n,e.scrollToPos.to),e.scrollToPos.margin);Po(t,f)}var k=e.maybeHiddenMarkers,X=e.maybeUnhiddenMarkers;if(k)for(var J=0;J<k.length;++J)k[J].lines.length||ze(k[J],"hide");if(X)for(var ee=0;ee<X.length;++ee)X[ee].lines.length&&ze(X[ee],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ze(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zi(e,t){if(e.curOp)return t();qr(e);try{return t()}finally{oa(e)}}function Xi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);qr(e);try{return t.apply(e,arguments)}finally{oa(e)}}}function pr(e){return function(){if(this.curOp)return e.apply(this,arguments);qr(this);try{return e.apply(this,arguments)}finally{oa(this)}}}function Yi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);qr(t);try{return e.apply(this,arguments)}finally{oa(t)}}}function Aa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,y(Ha,e))}function Ha(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Pt(e,t.highlightFrontier),f=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(n.line>=e.display.viewFrom){var X=k.styles,J=k.text.length>e.options.maxHighlightLength?Ai(t.mode,n.state):null,ee=Le(e,k,n,!0);J&&(n.state=J),k.styles=ee.styles;var ae=k.styleClasses,Se=ee.classes;Se?k.styleClasses=Se:ae&&(k.styleClasses=null);for(var Re=!X||X.length!=k.styles.length||ae!=Se&&(!ae||!Se||ae.bgClass!=Se.bgClass||ae.textClass!=Se.textClass),Ve=0;!Re&&Ve<X.length;++Ve)Re=X[Ve]!=k.styles[Ve];Re&&f.push(n.line),k.stateAfter=n.save(),n.nextLine()}else k.text.length<=e.options.maxHighlightLength&&rn(e,k.text,n),k.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Aa(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),f.length&&Zi(e,function(){for(var k=0;k<f.length;k++)Tn(e,f[k],"text")})}var Pr=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Ba(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ce(e),this.force=i,this.dims=Bi(e),this.events=[]};Pr.prototype.signal=function(e,t){xe(e,t)&&this.events.push(arguments)},Pr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ze.apply(null,this.events[e])};function ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Me(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Me(e)+"px",t.scrollbarsClipped=!0)}function Ka(e){if(e.hasFocus())return null;var t=N();if(!t||!C(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&C(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function vo(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&C(document.body,e.anchorNode)&&C(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function ma(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return xi(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&ra(e)==0)return!1;lr(e)&&(xi(e),t.dims=Bi(e));var f=n.first+n.size,k=Math.max(t.visible.from-e.options.viewportMargin,n.first),X=Math.min(f,t.visible.to+e.options.viewportMargin);i.viewFrom<k&&k-i.viewFrom<20&&(k=Math.max(n.first,i.viewFrom)),i.viewTo>X&&i.viewTo-X<20&&(X=Math.min(f,i.viewTo)),sn&&(k=tr(e.doc,k),X=nr(e.doc,X));var J=k!=i.viewFrom||X!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Zr(e,k,X),i.viewOffset=Ft(Jt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var ee=ra(e);if(!J&&ee==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ae=Ka(e);return ee>4&&(i.lineDiv.style.display="none"),_o(e,i.updateLineNumbers,t.dims),ee>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,vo(ae),v(i.cursorDiv),v(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,J&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Aa(e,400)),i.updateLineNumbers=null,!0}function za(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ce(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ye(e.display)-re(e),i.top)}),t.visible=Ba(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Ba(e.display,e.doc,i));if(!ma(e,t))break;$i(e);var f=fa(e);Ti(e),pa(e,f),_i(e,f),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Oa(e,t){var i=new Pr(e,t);if(ma(e,i)){$i(e),za(e,i);var n=fa(e);Ti(e),pa(e,n),_i(e,n),i.finish()}}function _o(e,t,i){var n=e.display,f=e.options.lineNumbers,k=n.lineDiv,X=k.firstChild;function J(st){var _t=st.nextSibling;return L&&u&&e.display.currentWheelTarget==st?st.style.display="none":st.parentNode.removeChild(st),_t}for(var ee=n.view,ae=n.viewFrom,Se=0;Se<ee.length;Se++){var Re=ee[Se];if(!Re.hidden)if(!Re.node||Re.node.parentNode!=k){var Ve=fo(e,Re,ae,i);k.insertBefore(Ve,X)}else{for(;X!=Re.node;)X=J(X);var We=f&&t!=null&&t<=ae&&Re.lineNumber;Re.changes&&(q(Re.changes,"gutter")>-1&&(We=!1),uo(e,Re,ae,i)),We&&(v(Re.lineNumber),Re.lineNumber.appendChild(document.createTextNode(Qr(e.options,ae)))),X=Re.node.nextSibling}ae+=Re.size}for(;X;)X=J(X)}function Ga(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function _i(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+Me(e)+"px"}function oi(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=vr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,f=t.gutters.offsetWidth,k=n+"px",X=0;X<i.length;X++)if(!i[X].hidden){e.options.fixedGutter&&(i[X].gutter&&(i[X].gutter.style.left=k),i[X].gutterBackground&&(i[X].gutterBackground.style.left=k));var J=i[X].alignable;if(J)for(var ee=0;ee<J.length;ee++)J[ee].style.left=k}e.options.fixedGutter&&(t.gutters.style.left=n+f+"px")}function lr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Qr(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var f=n.measure.appendChild(o("div",[o("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),k=f.firstChild.offsetWidth,X=f.offsetWidth-k;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(k,n.lineGutter.offsetWidth-X)+1,n.lineNumWidth=n.lineNumInnerWidth+X,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Ga(e.display),!0}return!1}function _r(e,t){for(var i=[],n=!1,f=0;f<e.length;f++){var k=e[f],X=null;if(typeof k!="string"&&(X=k.style,k=k.className),k=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:k,style:X})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function sa(e){var t=e.gutters,i=e.gutterSpecs;v(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var f=i[n],k=f.className,X=f.style,J=t.appendChild(o("div",null,"CodeMirror-gutter "+k));X&&(J.style.cssText=X),k=="CodeMirror-linenumbers"&&(e.lineGutter=J,J.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ga(e)}function ea(e){sa(e.display),Ei(e),oi(e)}function Ra(e,t,i,n){var f=this;this.input=i,f.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=E("div",null,"CodeMirror-code"),f.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=o("div",null,"CodeMirror-cursors"),f.measure=o("div",null,"CodeMirror-measure"),f.lineMeasure=o("div",null,"CodeMirror-measure"),f.lineSpace=E("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var k=E("div",[f.lineSpace],"CodeMirror-lines");f.mover=o("div",[k],null,"position: relative"),f.sizer=o("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=o("div",null,null,"position: absolute; height: "+ie+"px; width: 1px;"),f.gutters=o("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=o("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=o("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),K&&W<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!L&&!(M&&a)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=t.first,f.reportedViewFrom=f.reportedViewTo=t.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=_r(n.gutters,n.lineNumbers),sa(f),i.init(f)}var la=0,ar=null;K?ar=-.53:M?ar=15:b?ar=-.7:_&&(ar=-1/3);function La(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function et(e){var t=La(e);return t.x*=ar,t.y*=ar,t}function Qe(e,t){var i=La(t),n=i.x,f=i.y,k=e.display,X=k.scroller,J=X.scrollWidth>X.clientWidth,ee=X.scrollHeight>X.clientHeight;if(!(n&&J||f&&ee))return;if(f&&u&&L){e:for(var ae=t.target,Se=k.view;ae!=X;ae=ae.parentNode)for(var Re=0;Re<Se.length;Re++)if(Se[Re].node==ae){e.display.currentWheelTarget=ae;break e}}if(n&&!M&&!p&&ar!=null){f&&ee&&ha(e,Math.max(0,X.scrollTop+f*ar)),Dr(e,Math.max(0,X.scrollLeft+n*ar)),(!f||f&&ee)&&se(t),k.wheelStartX=null;return}if(f&&ar!=null){var Ve=f*ar,We=e.doc.scrollTop,st=We+k.wrapper.clientHeight;Ve<0?We=Math.max(0,We+Ve-50):st=Math.min(e.doc.height,st+Ve+50),Oa(e,{top:We,bottom:st})}la<20&&(k.wheelStartX==null?(k.wheelStartX=X.scrollLeft,k.wheelStartY=X.scrollTop,k.wheelDX=n,k.wheelDY=f,setTimeout(function(){if(k.wheelStartX==null)return;var _t=X.scrollLeft-k.wheelStartX,It=X.scrollTop-k.wheelStartY,Wt=It&&k.wheelDY&&It/k.wheelDY||_t&&k.wheelDX&&_t/k.wheelDX;if(k.wheelStartX=k.wheelStartY=null,!Wt)return;ar=(ar*la+Wt)/(la+1),++la},200)):(k.wheelDX+=n,k.wheelDY+=f))}var Ge=function(e,t){this.ranges=e,this.primIndex=t};Ge.prototype.primary=function(){return this.ranges[this.primIndex]},Ge.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!Kr(i.anchor,n.anchor)||!Kr(i.head,n.head))return!1}return!0},Ge.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new nt(zr(this.ranges[t].anchor),zr(this.ranges[t].head));return new Ge(e,this.primIndex)},Ge.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ge.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(cn(t,n.from())>=0&&cn(e,n.to())<=0)return i}return-1};var nt=function(e,t){this.anchor=e,this.head=t};nt.prototype.from=function(){return Gr(this.anchor,this.head)},nt.prototype.to=function(){return na(this.anchor,this.head)},nt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ot(e,t,i){var n=e&&e.options.selectionsMayTouch,f=t[i];t.sort(function(Ve,We){return cn(Ve.from(),We.from())}),i=q(t,f);for(var k=1;k<t.length;k++){var X=t[k],J=t[k-1],ee=cn(J.to(),X.from());if(n&&!X.empty()?ee>0:ee>=0){var ae=Gr(J.from(),X.from()),Se=na(J.to(),X.to()),Re=J.empty()?X.from()==X.head:J.from()==J.head;k<=i&&--i,t.splice(--k,2,new nt(Re?Se:ae,Re?ae:Se))}}return new Ge(t,i)}function At(e,t){return new Ge([new nt(e,t||e)],0)}function wt(e){return e.text?yt(e.from.line+e.text.length-1,Te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Et(e,t){if(cn(e,t.from)<0)return e;if(cn(e,t.to)<=0)return wt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=wt(t).ch-t.to.ch),yt(i,n)}function ln(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var f=e.sel.ranges[n];i.push(new nt(Et(f.anchor,t),Et(f.head,t)))}return ot(e.cm,i,e.sel.primIndex)}function ni(e,t,i){return e.line==t.line?yt(i.line,e.ch-t.ch+i.ch):yt(i.line+(e.line-t.line),e.ch)}function Sr(e,t,i){for(var n=[],f=yt(e.first,0),k=f,X=0;X<t.length;X++){var J=t[X],ee=ni(J.from,f,k),ae=ni(wt(J),f,k);if(f=J.to,k=ae,i=="around"){var Se=e.sel.ranges[X],Re=cn(Se.head,Se.anchor)<0;n[X]=new nt(Re?ae:ee,Re?ee:ae)}else n[X]=new nt(ee,ee)}return new Ge(n,e.sel.primIndex)}function Kn(e){e.doc.mode=bn(e.options,e.doc.modeOption),yr(e)}function yr(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,Aa(e,100),e.state.modeGen++,e.curOp&&Ei(e)}function br(e,t){return t.from.ch==0&&t.to.ch==0&&Te(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function mr(e,t,i,n){function f(en){return i?i[en]:null}function k(en,Ht,on){ir(en,Ht,on,n),Wi(en,"change",en,t)}function X(en,Ht){for(var on=[],Pn=en;Pn<Ht;++Pn)on.push(new $n(ae[Pn],f(Pn),n));return on}var J=t.from,ee=t.to,ae=t.text,Se=Jt(e,J.line),Re=Jt(e,ee.line),Ve=Te(ae),We=f(ae.length-1),st=ee.line-J.line;if(t.full)e.insert(0,X(0,ae.length)),e.remove(ae.length,e.size-ae.length);else if(br(e,t)){var _t=X(0,ae.length-1);k(Re,Re.text,We),st&&e.remove(J.line,st),_t.length&&e.insert(J.line,_t)}else if(Se==Re)if(ae.length==1)k(Se,Se.text.slice(0,J.ch)+Ve+Se.text.slice(ee.ch),We);else{var It=X(1,ae.length-1);It.push(new $n(Ve+Se.text.slice(ee.ch),We,n)),k(Se,Se.text.slice(0,J.ch)+ae[0],f(0)),e.insert(J.line+1,It)}else if(ae.length==1)k(Se,Se.text.slice(0,J.ch)+ae[0]+Re.text.slice(ee.ch),f(0)),e.remove(J.line+1,st);else{k(Se,Se.text.slice(0,J.ch)+ae[0],f(0)),k(Re,Ve+Re.text.slice(ee.ch),We);var Wt=X(1,ae.length-1);st>1&&e.remove(J.line+1,st-1),e.insert(J.line+1,Wt)}Wi(e,"change",e,t)}function Ar(e,t,i){function n(f,k,X){if(f.linked)for(var J=0;J<f.linked.length;++J){var ee=f.linked[J];if(ee.doc==k)continue;var ae=X&&ee.sharedHist;if(i&&!ae)continue;t(ee.doc,ae),n(ee.doc,f,ae)}}n(e,null,!0)}function Ki(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Cr(e),Kn(e),Ur(e),e.options.lineWrapping||li(e),e.options.mode=t.modeOption,Ei(e)}function Ur(e){(e.doc.direction=="rtl"?U:m)(e.display.lineDiv,"CodeMirror-rtl")}function ta(e){Zi(e,function(){Ur(e),Ei(e)})}function Da(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 Br(e,t){var i={from:zr(t.from),to:wt(t),text:qi(e,t.from,t.to)};return xs(e,i,t.from.line,t.to.line+1),Ar(e,function(n){return xs(n,i,t.from.line,t.to.line+1)},!0),i}function yo(e){for(;e.length;){var t=Te(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return yo(e.done),Te(e.done);if(e.done.length&&!Te(e.done).ranges)return Te(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Te(e.done)}function Es(e,t,i,n){var f=e.history;f.undone.length=0;var k=+new Date,X,J;if((f.lastOp==n||f.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&f.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(X=pl(f,f.lastOp==n)))J=Te(X.changes),cn(t.from,t.to)==0&&cn(t.from,J.to)==0?J.to=wt(t):X.changes.push(Br(e,t));else{var ee=Te(f.done);for((!ee||!ee.ranges)&&$o(e.sel,f.done),X={changes:[Br(e,t)],generation:f.generation},f.done.push(X);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(i),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=k,f.lastOp=f.lastSelOp=n,f.lastOrigin=f.lastSelOrigin=t.origin,J||ze(e,"historyAdded")}function ml(e,t,i,n){var f=t.charAt(0);return f=="*"||f=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var f=e.history,k=n&&n.origin;i==f.lastSelOp||k&&f.lastSelOrigin==k&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==k||ml(e,k,Te(f.done),t))?f.done[f.done.length-1]=t:$o(t,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=k,f.lastSelOp=i,n&&n.clearRedo!==!1&&yo(f.undone)}function $o(e,t){var i=Te(t);i&&i.ranges&&i.equals(e)||t.push(e)}function xs(e,t,i,n){var f=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(X){X.markedSpans&&((f||(f=t["spans_"+e.id]={}))[k]=X.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function _l(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],f=0;f<t.text.length;++f)n.push(vl(i[f]));return n}function Ts(e,t){var i=_l(e,t),n=Nn(e,t);if(!i)return n;if(!n)return i;for(var f=0;f<i.length;++f){var k=i[f],X=n[f];if(k&&X){e:for(var J=0;J<X.length;++J){for(var ee=X[J],ae=0;ae<k.length;++ae)if(k[ae].marker==ee.marker)continue e;k.push(ee)}}else X&&(i[f]=X)}return i}function bo(e,t,i){for(var n=[],f=0;f<e.length;++f){var k=e[f];if(k.ranges){n.push(i?Ge.prototype.deepCopy.call(k):k);continue}var X=k.changes,J=[];n.push({changes:J});for(var ee=0;ee<X.length;++ee){var ae=X[ee],Se=void 0;if(J.push({from:ae.from,to:ae.to,text:ae.text}),t)for(var Re in ae)(Se=Re.match(/^spans_(\d+)$/))&&(q(t,Number(Se[1]))>-1&&(Te(J)[Re]=ae[Re],delete ae[Re]))}}return n}function ls(e,t,i,n){if(n){var f=e.anchor;if(i){var k=cn(t,f)<0;k!=cn(i,f)<0?(f=t,t=i):k!=cn(t,i)<0&&(t=i)}return new nt(f,t)}else return new nt(i||t,t)}function Zo(e,t,i,n,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Or(e,new Ge([ls(e.sel.primary(),t,i,f)],0),n)}function Cs(e,t,i){for(var n=[],f=e.cm&&(e.cm.display.shift||e.extend),k=0;k<e.sel.ranges.length;k++)n[k]=ls(e.sel.ranges[k],t[k],null,f);var X=ot(e.cm,n,e.sel.primIndex);Or(e,X,i)}function us(e,t,i,n){var f=e.sel.ranges.slice(0);f[t]=i,Or(e,ot(e.cm,f,e.sel.primIndex),n)}function ws(e,t,i,n){Or(e,At(t,i),n)}function yl(e,t,i){var n={ranges:t.ranges,update:function(f){this.ranges=[];for(var k=0;k<f.length;k++)this.ranges[k]=new nt(S(e,f[k].anchor),S(e,f[k].head))},origin:i&&i.origin};return ze(e,"beforeSelectionChange",e,n),e.cm&&ze(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ot(e.cm,n.ranges,n.ranges.length-1):t}function Ss(e,t,i){var n=e.history.done,f=Te(n);f&&f.ranges?(n[n.length-1]=t,Jo(e,t,i)):Or(e,t,i)}function Or(e,t,i){Jo(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Jo(e,t,i){(xe(e,"beforeSelectionChange")||e.cm&&xe(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,i));var n=i&&i.bias||(cn(t.primary().head,e.sel.primary().head)<0?-1:1);As(e,Rs(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&da(e.cm)}function As(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),Wi(e,"cursorActivity",e)}function Os(e){As(e,Rs(e,e.sel,null,!1))}function Rs(e,t,i,n){for(var f,k=0;k<t.ranges.length;k++){var X=t.ranges[k],J=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[k],ee=qo(e,X.anchor,J&&J.anchor,i,n),ae=qo(e,X.head,J&&J.head,i,n);(f||ee!=X.anchor||ae!=X.head)&&(f||(f=t.ranges.slice(0,k)),f[k]=new nt(ee,ae))}return f?ot(e.cm,f,t.primIndex):t}function Eo(e,t,i,n,f){var k=Jt(e,t.line);if(k.markedSpans)for(var X=0;X<k.markedSpans.length;++X){var J=k.markedSpans[X],ee=J.marker,ae="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,Se="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((J.from==null||(ae?J.from<=t.ch:J.from<t.ch))&&(J.to==null||(Se?J.to>=t.ch:J.to>t.ch))){if(f&&(ze(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(k.markedSpans){--X;continue}else break;if(!ee.atomic)continue;if(i){var Re=ee.find(n<0?1:-1),Ve=void 0;if((n<0?Se:ae)&&(Re=Ls(e,Re,-n,Re&&Re.line==t.line?k:null)),Re&&Re.line==t.line&&(Ve=cn(Re,i))&&(n<0?Ve<0:Ve>0))return Eo(e,Re,t,n,f)}var We=ee.find(n<0?-1:1);return(n<0?ae:Se)&&(We=Ls(e,We,n,We.line==t.line?k:null)),We?Eo(e,We,t,n,f):null}}return t}function qo(e,t,i,n,f){var k=n||1,X=Eo(e,t,i,k,f)||!f&&Eo(e,t,i,k,!0)||Eo(e,t,i,-k,f)||!f&&Eo(e,t,i,-k,!0);return X||(e.cantEdit=!0,yt(e.first,0))}function Ls(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?S(e,yt(t.line-1)):null:i>0&&t.ch==(n||Jt(e,t.line)).text.length?t.line<e.first+e.size-1?yt(t.line+1,0):null:new yt(t.line,t.ch+i)}function Ds(e){e.setSelection(yt(e.firstLine(),0),yt(e.lastLine()),fe)}function Ps(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(f,k,X,J){f&&(n.from=S(e,f)),k&&(n.to=S(e,k)),X&&(n.text=X),J!==void 0&&(n.origin=J)}),ze(e,"beforeChange",e,n),e.cm&&ze(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function xo(e,t,i){if(e.cm){if(!e.cm.curOp)return Xi(e.cm,xo)(e,t,i);if(e.cm.state.suppressEdits)return}if((xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"))&&(t=Ps(e,t,!0),!t))return;var n=Kt&&!i&&An(e,t.from,t.to);if(n)for(var f=n.length-1;f>=0;--f)Is(e,{from:n[f].from,to:n[f].to,text:f?[""]:t.text,origin:t.origin});else Is(e,t)}function Is(e,t){if(t.text.length==1&&t.text[0]==""&&cn(t.from,t.to)==0)return;var i=ln(e,t);Es(e,t,i,e.cm?e.cm.curOp.id:NaN),Uo(e,t,i,Nn(e,t));var n=[];Ar(e,function(f,k){!k&&q(n,f.history)==-1&&(Us(f.history,t),n.push(f.history)),Uo(f,t,null,Nn(f,t))})}function es(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var f=e.history,k,X=e.sel,J=t=="undo"?f.done:f.undone,ee=t=="undo"?f.undone:f.done,ae=0;ae<J.length&&!(k=J[ae],i?k.ranges&&!k.equals(e.sel):!k.ranges);ae++);if(ae==J.length)return;for(f.lastOrigin=f.lastSelOrigin=null;;)if(k=J.pop(),k.ranges){if($o(k,ee),i&&!k.equals(e.sel)){Or(e,k,{clearRedo:!1});return}X=k}else if(n){J.push(k);return}else break;var Se=[];$o(X,ee),ee.push({changes:Se,generation:f.generation}),f.generation=k.generation||++f.maxGeneration;for(var Re=xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"),Ve=function(_t){var It=k.changes[_t];if(It.origin=t,Re&&!Ps(e,It,!1))return J.length=0,{};Se.push(Br(e,It));var Wt=_t?ln(e,It):Te(J);Uo(e,It,Wt,Ts(e,It)),!_t&&e.cm&&e.cm.scrollIntoView({from:It.from,to:wt(It)});var en=[];Ar(e,function(Ht,on){!on&&q(en,Ht.history)==-1&&(Us(Ht.history,It),en.push(Ht.history)),Uo(Ht,It,null,Ts(Ht,It))})},We=k.changes.length-1;We>=0;--We){var st=Ve(We);if(st)return st.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ge(Fe(e.sel.ranges,function(f){return new nt(yt(f.anchor.line+t,f.anchor.ch),yt(f.head.line+t,f.head.ch))}),e.sel.primIndex),e.cm){Ei(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Tn(e.cm,n,"gutter")}}function Uo(e,t,i,n){if(e.cm&&!e.cm.curOp)return Xi(e.cm,Uo)(e,t,i,n);if(t.to.line<e.first){ks(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var f=t.text.length-1-(e.first-t.from.line);ks(e,f),t={from:yt(e.first,0),to:yt(t.to.line+f,t.to.ch),text:[Te(t.text)],origin:t.origin}}var k=e.lastLine();t.to.line>k&&(t={from:t.from,to:yt(k,Jt(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qi(e,t.from,t.to),i||(i=ln(e,t)),e.cm?bl(e.cm,t,n):mr(e,t,n),Jo(e,i,fe),e.cantEdit&&qo(e,yt(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,i){var n=e.doc,f=e.display,k=t.from,X=t.to,J=!1,ee=k.line;e.options.lineWrapping||(ee=Fn(xn(Jt(n,k.line))),n.iter(ee,X.line+1,function(We){if(We==f.maxLine)return J=!0,!0})),n.sel.contains(t.from,t.to)>-1&&be(e),mr(n,t,i,Lr(e)),e.options.lineWrapping||(n.iter(ee,k.line+t.text.length,function(We){var st=yi(We);st>f.maxLineLength&&(f.maxLine=We,f.maxLineLength=st,f.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),Lt(n,k.line),Aa(e,400);var ae=t.text.length-(X.line-k.line)-1;t.full?Ei(e):k.line==X.line&&t.text.length==1&&!br(e.doc,t)?Tn(e,k.line,"text"):Ei(e,k.line,X.line+1,ae);var Se=xe(e,"changes"),Re=xe(e,"change");if(Re||Se){var Ve={from:k,to:X,text:t.text,removed:t.removed,origin:t.origin};Re&&Wi(e,"change",e,Ve),Se&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ve)}e.display.selForContextMenu=null}function To(e,t,i,n,f){var k;n||(n=i),cn(n,i)<0&&(k=[n,i],i=k[0],n=k[1]),typeof t=="string"&&(t=e.splitLines(t)),xo(e,{from:i,to:n,text:t,origin:f})}function Ms(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ns(e,t,i,n){for(var f=0;f<e.length;++f){var k=e[f],X=!0;if(k.ranges){k.copied||(k=e[f]=k.deepCopy(),k.copied=!0);for(var J=0;J<k.ranges.length;J++)Ms(k.ranges[J].anchor,t,i,n),Ms(k.ranges[J].head,t,i,n);continue}for(var ee=0;ee<k.changes.length;++ee){var ae=k.changes[ee];if(i<ae.from.line)ae.from=yt(ae.from.line+n,ae.from.ch),ae.to=yt(ae.to.line+n,ae.to.ch);else if(t<=ae.to.line){X=!1;break}}X||(e.splice(0,f+1),f=0)}}function Us(e,t){var i=t.from.line,n=t.to.line,f=t.text.length-(n-i)-1;Ns(e.done,i,n,f),Ns(e.undone,i,n,f)}function Bo(e,t,i,n){var f=t,k=t;return typeof t=="number"?k=Jt(e,$(e,t)):f=Fn(t),f==null?null:(n(k,f)&&e.cm&&Tn(e.cm,f,i),k)}function jo(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}jo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var f=this.lines[i];this.height-=f.height,Qt(f),Wi(f,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Fo(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var f=e[n];t+=f.chunkSize(),i+=f.height,f.parent=this}this.size=t,this.height=i,this.parent=null}Fo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],f=n.chunkSize();if(e<f){var k=Math.min(t,f-e),X=n.height;if(n.removeInner(e,k),this.height-=X-n.height,f==k&&(this.children.splice(i--,1),n.parent=null),(t-=k)==0)break;e=0}else e-=f}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof jo))){var J=[];this.collapse(J),this.children=[new jo(J)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var f=this.children[n],k=f.chunkSize();if(e<=k){if(f.insertInner(e,t,i),f.lines&&f.lines.length>50){for(var X=f.lines.length%25+25,J=X;J<f.lines.length;){var ee=new jo(f.lines.slice(J,J+=25));f.height-=ee.height,this.children.splice(++n,0,ee),ee.parent=this}f.lines=f.lines.slice(0,X),this.maybeSpill()}break}e-=k}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Fo(t);if(e.parent){e.size-=i.size,e.height-=i.height;var f=q(e.parent.children,e);e.parent.children.splice(f+1,0,i)}else{var n=new Fo(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var f=this.children[n],k=f.chunkSize();if(e<k){var X=Math.min(t,k-e);if(f.iterN(e,X,i))return!0;if((t-=X)==0)break;e=0}else e-=k}}};var Wo=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Wo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Fn(i);if(n==null||!t)return;for(var f=0;f<t.length;++f)t[f]==this&&t.splice(f--,1);t.length||(i.widgets=null);var k=ya(this);sr(i,Math.max(0,i.height-k)),e&&(Zi(e,function(){Bs(e,i,-k),Tn(e,n,"widget")}),Wi(e,"lineWidgetCleared",e,this,n))},Wo.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var f=ya(this)-t;if(!f)return;Fi(this.doc,n)||sr(n,n.height+f),i&&Zi(i,function(){i.curOp.forceUpdate=!0,Bs(i,n,f),Wi(i,"lineWidgetChanged",i,e,Fn(n))})},pe(Wo);function Bs(e,t,i){Ft(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,i)}function El(e,t,i,n){var f=new Wo(e,i,n),k=e.cm;return k&&f.noHScroll&&(k.display.alignWidgets=!0),Bo(e,t,"widget",function(X){var J=X.widgets||(X.widgets=[]);if(f.insertAt==null?J.push(f):J.splice(Math.min(J.length-1,Math.max(0,f.insertAt)),0,f),f.line=X,k&&!Fi(e,X)){var ee=Ft(X)<e.scrollTop;sr(X,X.height+ya(f)),ee&&qa(k,f.height),k.curOp.forceUpdate=!0}return!0}),k&&Wi(k,"lineWidgetAdded",k,f,typeof t=="number"?t:Fn(t)),f}var js=0,Va=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};Va.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&qr(e),xe(this,"clear")){var i=this.find();i&&Wi(this,"clear",i.from,i.to)}for(var n=null,f=null,k=0;k<this.lines.length;++k){var X=this.lines[k],J=Ln(X.markedSpans,this);e&&!this.collapsed?Tn(e,Fn(X),"text"):e&&(J.to!=null&&(f=Fn(X)),J.from!=null&&(n=Fn(X))),X.markedSpans=zn(X.markedSpans,J),J.from==null&&this.collapsed&&!Fi(this.doc,X)&&e&&sr(X,Hi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var ae=xn(this.lines[ee]),Se=yi(ae);Se>e.display.maxLineLength&&(e.display.maxLine=ae,e.display.maxLineLength=Se,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ei(e,n,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Wi(e,"markerCleared",e,this,n,f),t&&oa(e),this.parent&&this.parent.clear()},Va.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,f=0;f<this.lines.length;++f){var k=this.lines[f],X=Ln(k.markedSpans,this);if(X.from!=null&&(i=yt(t?k:Fn(k),X.from),e==-1))return i;if(X.to!=null&&(n=yt(t?k:Fn(k),X.to),e==1))return n}return i&&{from:i,to:n}},Va.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Zi(n,function(){var f=t.line,k=Fn(t.line),X=ke(n,k);if(X&&(Qn(X),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Fi(i.doc,f)&&i.height!=null){var J=i.height;i.height=null;var ee=ya(i)-J;ee&&sr(f,f.height+ee)}Wi(n,"markerChanged",n,e)})},Va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||q(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Va.prototype.detachLine=function(e){if(this.lines.splice(q(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},pe(Va);function Co(e,t,i,n,f){if(n&&n.shared)return xl(e,t,i,n,f);if(e.cm&&!e.cm.curOp)return Xi(e.cm,Co)(e,t,i,n,f);var k=new Va(e,f),X=cn(t,i);if(n&&x(n,k,!1),X>0||X==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=E("span",[k.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(Yt(e,t.line,t,i,k)||t.line!=i.line&&Yt(e,i.line,t,i,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");wn()}k.addToHistory&&Es(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var J=t.line,ee=e.cm,ae;if(e.iter(J,i.line+1,function(Re){ee&&k.collapsed&&!ee.options.lineWrapping&&xn(Re)==ee.display.maxLine&&(ae=!0),k.collapsed&&J!=t.line&&sr(Re,0),un(Re,new hn(k,J==t.line?t.ch:null,J==i.line?i.ch:null)),++J}),k.collapsed&&e.iter(t.line,i.line+1,function(Re){Fi(e,Re)&&sr(Re,0)}),k.clearOnEnter&&Ye(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(En(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++js,k.atomic=!0),ee){if(ae&&(ee.curOp.updateMaxLine=!0),k.collapsed)Ei(ee,t.line,i.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var Se=t.line;Se<=i.line;Se++)Tn(ee,Se,"text");k.atomic&&Os(ee.doc),Wi(ee,"markerAdded",ee,k)}return k}var Ho=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Ho.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Wi(this,"clear")},Ho.prototype.find=function(e,t){return this.primary.find(e,t)},pe(Ho);function xl(e,t,i,n,f){n=x(n),n.shared=!1;var k=[Co(e,t,i,n,f)],X=k[0],J=n.widgetNode;return Ar(e,function(ee){J&&(n.widgetNode=J.cloneNode(!0)),k.push(Co(ee,S(ee,t),S(ee,i),n,f));for(var ae=0;ae<ee.linked.length;++ae)if(ee.linked[ae].isParent)return;X=Te(k)}),new Ho(k,X)}function Fs(e){return e.findMarks(yt(e.first,0),e.clipPos(yt(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],f=n.find(),k=e.clipPos(f.from),X=e.clipPos(f.to);if(cn(k,X)){var J=Co(e,k,X,n.primary,n.primary.type);n.markers.push(J),J.parent=n}}}function Cl(e){for(var t=function(n){var f=e[n],k=[f.primary.doc];Ar(f.primary.doc,function(ee){return k.push(ee)});for(var X=0;X<f.markers.length;X++){var J=f.markers[X];q(k,J.doc)==-1&&(J.parent=null,f.markers.splice(X--,1))}},i=0;i<e.length;i++)t(i)}var wl=0,jr=function(e,t,i,n,f){if(!(this instanceof jr))return new jr(e,t,i,n,f);i==null&&(i=0),Fo.call(this,[new jo([new $n("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var k=yt(i,0);this.sel=At(k),this.history=new Da(null),this.id=++wl,this.modeOption=t,this.lineSep=n,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),mr(this,{from:k,to:k,text:e}),Or(this,At(k),fe)};jr.prototype=He(Fo.prototype,{constructor:jr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=hr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Yi(function(e){var t=yt(this.first,0),i=this.first+this.size-1;xo(this,{from:t,to:yt(i,Jt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&xa(this.cm,0,0),Or(this,At(t),fe)}),replaceRange:function(e,t,i,n){t=S(this,t),i=i?S(this,i):t,To(this,e,t,i,n)},getRange:function(e,t,i){var n=qi(this,S(this,e),S(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(kr(this,e))return Jt(this,e)},getLineNumber:function(e){return Fn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Jt(this,e)),xn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return S(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yi(function(e,t,i){ws(this,S(this,typeof e=="number"?yt(e,t||0):e),null,i)}),setSelection:Yi(function(e,t,i){ws(this,S(this,e),S(this,t||e),i)}),extendSelection:Yi(function(e,t,i){Zo(this,S(this,e),t&&S(this,t),i)}),extendSelections:Yi(function(e,t){Cs(this,z(this,e),t)}),extendSelectionsBy:Yi(function(e,t){var i=Fe(this.sel.ranges,e);Cs(this,z(this,i),t)}),setSelections:Yi(function(e,t,i){if(!e.length)return;for(var n=[],f=0;f<e.length;f++)n[f]=new nt(S(this,e[f].anchor),S(this,e[f].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Or(this,ot(this.cm,n,t),i)}),addSelection:Yi(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new nt(S(this,e),S(this,t||e))),Or(this,ot(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var f=qi(this,t[n].from(),t[n].to());i=i?i.concat(f):f}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var f=qi(this,i[n].from(),i[n].to());e!==!1&&(f=f.join(e||this.lineSeparator())),t[n]=f}return t},replaceSelection:function(e,t,i){for(var n=[],f=0;f<this.sel.ranges.length;f++)n[f]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:Yi(function(e,t,i){for(var n=[],f=this.sel,k=0;k<f.ranges.length;k++){var X=f.ranges[k];n[k]={from:X.from(),to:X.to(),text:this.splitLines(e[k]),origin:i}}for(var J=t&&t!="end"&&Sr(this,n,t),ee=n.length-1;ee>=0;ee--)xo(this,n[ee]);J?Ss(this,J):this.cm&&da(this.cm)}),undo:Yi(function(){es(this,"undo")}),redo:Yi(function(){es(this,"redo")}),undoSelection:Yi(function(){es(this,"undo",!0)}),redoSelection:Yi(function(){es(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Da(this.history.maxGeneration),Ar(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:bo(this.history.done),undone:bo(this.history.undone)}},setHistory:function(e){var t=this.history=new Da(this.history.maxGeneration);t.done=bo(e.done.slice(0),null,!0),t.undone=bo(e.undone.slice(0),null,!0)},setGutterMarker:Yi(function(e,t,i){return Bo(this,e,"gutter",function(n){var f=n.gutterMarkers||(n.gutterMarkers={});return f[t]=i,!i&&tt(f)&&(n.gutterMarkers=null),!0})}),clearGutter:Yi(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Bo(t,i,"gutter",function(){return i.gutterMarkers[e]=null,tt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!kr(this,e))return null;if(t=e,e=Jt(this,e),!e)return null}else if(t=Fn(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:Yi(function(e,t,i){return Bo(this,e,t=="gutter"?"gutter":"class",function(n){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[f])n[f]=i;else{if(w(i).test(n[f]))return!1;n[f]+=" "+i}return!0})}),removeLineClass:Yi(function(e,t,i){return Bo(this,e,t=="gutter"?"gutter":"class",function(n){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",k=n[f];if(k)if(i==null)n[f]=null;else{var X=k.match(w(i));if(!X)return!1;var J=X.index+X[0].length;n[f]=k.slice(0,X.index)+(!X.index||J==k.length?"":" ")+k.slice(J)||null}else return!1;return!0})}),addLineWidget:Yi(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Co(this,S(this,e),S(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=S(this,e),Co(this,e,e,i,"bookmark")},findMarksAt:function(e){e=S(this,e);var t=[],i=Jt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var f=i[n];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&t.push(f.marker.parent||f.marker)}return t},findMarks:function(e,t,i){e=S(this,e),t=S(this,t);var n=[],f=e.line;return this.iter(e.line,t.line+1,function(k){var X=k.markedSpans;if(X)for(var J=0;J<X.length;J++){var ee=X[J];!(ee.to!=null&&f==e.line&&e.ch>=ee.to||ee.from==null&&f!=e.line||ee.from!=null&&f==t.line&&ee.from>=t.ch)&&(!i||i(ee.marker))&&n.push(ee.marker.parent||ee.marker)}++f}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(f){var k=f.text.length+n;if(k>e)return t=e,!0;e-=k,++i}),S(this,yt(i,t))},indexFromPos:function(e){e=S(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new jr(hr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new jr(hr(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,Fs(this)),n},unlinkDoc:function(e){if(e instanceof zi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(Fs(this));break}if(e.history==this.history){var n=[e.id];Ar(e,function(f){return n.push(f.id)},!0),e.history=new Da(null),e.history.done=bo(this.history.done,n),e.history.undone=bo(this.history.undone,n)}},iterLinkedDocs:function(e){Ar(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):yn(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Yi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&ta(this.cm)})}),jr.prototype.eachLine=jr.prototype.iter;var Ws=0;function Sl(e){var t=this;if(Hs(t),ut(t,e)||ia(t.display,e))return;se(e),K&&(Ws=+new Date);var i=Vi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var f=n.length,k=Array(f),X=0,J=function(){++X==f&&Xi(t,function(){i=S(t.doc,i);var We={from:i,to:i,text:t.doc.splitLines(k.filter(function(st){return st!=null}).join(t.doc.lineSeparator())),origin:"paste"};xo(t.doc,We),Ss(t.doc,At(S(t.doc,i),S(t.doc,wt(We))))})()},ee=function(We,st){if(t.options.allowDropFileTypes&&q(t.options.allowDropFileTypes,We.type)==-1){J();return}var _t=new FileReader;_t.onerror=function(){return J()},_t.onload=function(){var It=_t.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(It)){J();return}k[st]=It,J()},_t.readAsText(We)},ae=0;ae<n.length;ae++)ee(n[ae],ae);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Se=e.dataTransfer.getData("Text");if(Se){var Re;if(t.state.draggingText&&!t.state.draggingText.copy&&(Re=t.listSelections()),Jo(t.doc,At(i,i)),Re)for(var Ve=0;Ve<Re.length;++Ve)To(t.doc,"",Re[Ve].anchor,Re[Ve].head,"drag");t.replaceSelection(Se,"around","paste"),t.display.input.focus()}}catch(We){}}}function Al(e,t){if(K&&(!e.state.draggingText||+new Date-Ws<100)){Ae(t);return}if(ut(e,t)||ia(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!_){var i=o("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),p&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Vi(e,t);if(!i)return;var n=document.createDocumentFragment();Jr(e,i,n),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,n)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ks(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var f=t[n].CodeMirror;f&&i.push(f)}i.length&&i[0].operation(function(){for(var k=0;k<i.length;k++)e(i[k])})}var zs=!1;function Rl(){if(zs)return;Ll(),zs=!0}function Ll(){var e;Ye(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ks(Dl)},100))}),Ye(window,"blur",function(){return Ks(Ea)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Xa={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"},Ko=0;Ko<10;Ko++)Xa[Ko+48]=Xa[Ko+96]=String(Ko);for(var ts=65;ts<=90;ts++)Xa[ts]=String.fromCharCode(ts);for(var zo=1;zo<=12;zo++)Xa[zo+111]=Xa[zo+63235]="F"+zo;var Pa={};Pa.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"},Pa.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"},Pa.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"},Pa.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"]},Pa.default=u?Pa.macDefault:Pa.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,f,k,X=0;X<t.length-1;X++){var J=t[X];if(/^(cmd|meta|m)$/i.test(J))k=!0;else if(/^a(lt)?$/i.test(J))i=!0;else if(/^(c|ctrl|control)$/i.test(J))n=!0;else if(/^s(hift)?$/i.test(J))f=!0;else throw new Error("Unrecognized modifier name: "+J)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),k&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function Il(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var f=Fe(i.split(" "),Pl),k=0;k<f.length;k++){var X=void 0,J=void 0;k==f.length-1?(J=f.join(" "),X=n):(J=f.slice(0,k+1).join(" "),X="...");var ee=t[J];if(!ee)t[J]=X;else if(ee!=X)throw new Error("Inconsistent bindings for "+J)}delete e[i]}for(var ae in t)e[ae]=t[ae];return e}function wo(e,t,i,n){t=ns(t);var f=t.call?t.call(e,n):t[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&i(f))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return wo(e,t.fallthrough,i,n);for(var k=0;k<t.fallthrough.length;k++){var X=wo(e,t.fallthrough[k],i,n);if(X)return X}}}function Gs(e){var t=typeof e=="string"?e:Xa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Vs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Xs(e,t){if(p&&e.keyCode==34&&e.char)return!1;var i=Xa[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Vs(i,e,t))}function ns(e){return typeof e=="string"?Pa[e]:e}function So(e,t){for(var i=e.doc.sel.ranges,n=[],f=0;f<i.length;f++){for(var k=t(i[f]);n.length&&cn(k.from,Te(n).to)<=0;){var X=n.pop();if(cn(X.from,k.from)<0){k.from=X.from;break}}n.push(k)}Zi(e,function(){for(var J=n.length-1;J>=0;J--)To(e.doc,"",n[J].from,n[J].to,"+delete");da(e)})}function cs(e,t,i){var n=qe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function ds(e,t,i){var n=cs(e,t.ch,i);return n==null?null:new yt(t.line,n,i<0?"after":"before")}function hs(e,t,i,n,f){if(e){t.doc.direction=="rtl"&&(f=-f);var k=xt(i,t.doc.direction);if(k){var X=f<0?Te(k):k[0],J=f<0==(X.level==1),ee=J?"after":"before",ae;if(X.level>0||t.doc.direction=="rtl"){var Se=Ie(t,i);ae=f<0?i.text.length-1:0;var Re=je(t,Se,ae).top;ae=gt(function(Ve){return je(t,Se,Ve).top==Re},f<0==(X.level==1)?X.from:X.to-1,ae),ee=="before"&&(ae=cs(i,ae,1))}else ae=f<0?X.to:X.from;return new yt(n,ae,ee)}}return new yt(n,f<0?i.text.length:0,f<0?"before":"after")}function kl(e,t,i,n){var f=xt(t,e.doc.direction);if(!f)return ds(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var k=at(f,i.ch,i.sticky),X=f[k];if(e.doc.direction=="ltr"&&X.level%2==0&&(n>0?X.to>i.ch:X.from<i.ch))return ds(t,i,n);var J=function(Wt,en){return cs(t,Wt instanceof yt?Wt.ch:Wt,en)},ee,ae=function(Wt){return e.options.lineWrapping?(ee=ee||Ie(e,t),an(e,t,ee,Wt)):{begin:0,end:t.text.length}},Se=ae(i.sticky=="before"?J(i,-1):i.ch);if(e.doc.direction=="rtl"||X.level==1){var Re=X.level==1==n<0,Ve=J(i,Re?1:-1);if(Ve!=null&&(Re?Ve<=X.to&&Ve<=Se.end:Ve>=X.from&&Ve>=Se.begin)){var We=Re?"before":"after";return new yt(i.line,Ve,We)}}var st=function(Wt,en,Ht){for(var on=function(Ni,Er){return Er?new yt(i.line,J(Ni,1),"before"):new yt(i.line,Ni,"after")};Wt>=0&&Wt<f.length;Wt+=en){var Pn=f[Wt],vn=en>0==(Pn.level!=1),ai=vn?Ht.begin:J(Ht.end,-1);if(Pn.from<=ai&&ai<Pn.to)return on(ai,vn);if(ai=vn?Pn.from:J(Pn.to,-1),Ht.begin<=ai&&ai<Ht.end)return on(ai,vn)}},_t=st(k+n,n,Se);if(_t)return _t;var It=n>0?Se.end:J(Se.begin,-1);return It!=null&&!(n>0&&It==t.text.length)&&(_t=st(n>0?0:f.length-1,n,ae(It)),_t)?_t:null}var Go={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),fe)},killLine:function(e){return So(e,function(t){if(t.empty()){var i=Jt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:yt(t.head.line+1,0)}:{from:t.head,to:yt(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return So(e,function(t){return{from:yt(t.from().line,0),to:S(e.doc,yt(t.to().line+1,0))}})},delLineLeft:function(e){return So(e,function(t){return{from:yt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return So(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return So(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(yt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(yt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Qs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},he)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},he)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Qs(e,t.head):n},he)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,f=0;f<i.length;f++){var k=i[f].from(),X=F(e.getLine(k.line),k.ch,n);t.push(ne(n-X%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zi(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var f=t[n].head,k=Jt(e.doc,f.line).text;if(k){if(f.ch==k.length&&(f=new yt(f.line,f.ch-1)),f.ch>0)f=new yt(f.line,f.ch+1),e.replaceRange(k.charAt(f.ch-1)+k.charAt(f.ch-2),yt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var X=Jt(e.doc,f.line-1).text;X&&(f=new yt(f.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),yt(f.line-1,X.length-1),f,"+transpose"))}}i.push(new nt(f,f))}e.setSelections(i)})},newlineAndIndent:function(e){return Zi(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);da(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var i=Jt(e.doc,t),n=xn(i);return n!=i&&(t=Fn(n)),hs(!0,e,n,t,1)}function Ml(e,t){var i=Jt(e.doc,t),n=pi(i);return n!=i&&(t=Fn(n)),hs(!0,e,i,t,-1)}function Qs(e,t){var i=Ys(e,t.line),n=Jt(e.doc,i.line),f=xt(n,e.doc.direction);if(!f||f[0].level==0){var k=Math.max(i.ch,n.text.search(/\S/)),X=t.line==i.line&&t.ch<=k&&t.ch;return yt(i.line,X?0:k,i.sticky)}return i}function is(e,t,i){if(typeof t=="string"&&(t=Go[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),f=t(e)!=ge}finally{e.display.shift=n,e.state.suppressEdits=!1}return f}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var f=wo(t,e.state.keyMaps[n],i,e);if(f)return f}return e.options.extraKeys&&wo(t,e.options.extraKeys,i,e)||wo(t,e.options.keyMap,i,e)}var Ul=new Q;function Vo(e,t,i,n){var f=e.state.keySeq;if(f){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,f+" "+t,i,n))return!0}return $s(e,t,i,n)}function $s(e,t,i,n){var f=Nl(e,t,n);return f=="multi"&&(e.state.keySeq=t),f=="handled"&&Wi(e,"keyHandled",e,t,i),(f=="handled"||f=="multi")&&(se(i),ji(e)),!!f}function Zs(e,t){var i=Xs(t,!0);return i?t.shiftKey&&!e.state.keySeq?Vo(e,"Shift-"+i,t,function(n){return is(e,n,!0)})||Vo(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return is(e,n)}):Vo(e,i,t,function(n){return is(e,n)}):!1}function Bl(e,t,i){return Vo(e,"'"+i+"'",t,function(n){return is(e,n,!0)})}var fs=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),ut(t,e))return;K&&W<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Zs(t,e);p&&(fs=n?i:null,!n&&i==88&&!ii&&(u?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!u&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(m(t,"CodeMirror-crosshair"),St(document,"keyup",i),St(document,"mouseover",i))}Ye(document,"keyup",i),Ye(document,"mouseover",i)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ut(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ia(t.display,e)||ut(t,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(p&&i==fs){fs=null,se(e);return}if(p&&(!e.which||e.which<10)&&Zs(t,e))return;var f=String.fromCharCode(n==null?i:n);if(f=="\b")return;if(Bl(t,e,f))return;t.display.input.onKeyPress(e)}var Fl=400,ps=function(e,t,i){this.time=e,this.pos=t,this.button=i};ps.prototype.compare=function(e,t,i){return this.time+Fl>e&&cn(t,this.pos)==0&&i==this.button};var Xo,Yo;function Wl(e,t){var i=+new Date;return Yo&&Yo.compare(i,e,t)?(Xo=Yo=null,"triple"):Xo&&Xo.compare(i,e,t)?(Yo=new ps(i,e,t),Xo=null,"double"):(Xo=new ps(i,e,t),Yo=null,"single")}function tl(e){var t=this,i=t.display;if(ut(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,ia(i,e)){L||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(ms(t,e))return;var n=Vi(t,e),f=$e(e),k=n?Wl(n,f):"single";if(window.focus(),f==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,f,n,k,e))return;f==1?n?zl(t,n,k,e):De(e)==i.scroller&&se(e):f==2?(n&&Zo(t.doc,n),setTimeout(function(){return i.input.focus()},20)):f==3&&(A?t.display.input.onContextMenu(e):Za(t))}function Hl(e,t,i,n,f){var k="Click";return n=="double"?k="Double"+k:n=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Vo(e,Vs(k,f),f,function(X){if(typeof X=="string"&&(X=Go[X]),!X)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=X(e,i)!=ge}finally{e.state.suppressEdits=!1}return J})}function Kl(e,t,i){var n=e.getOption("configureMouse"),f=n?n(e,t,i):{};if(f.unit==null){var k=c?i.shiftKey&&i.metaKey:i.altKey;f.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||i.shiftKey),f.addNew==null&&(f.addNew=u?i.metaKey:i.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(u?i.altKey:i.ctrlKey)),f}function zl(e,t,i,n){K?setTimeout(y(Ua,e),0):e.curOp.focus=N();var f=Kl(e,i,n),k=e.doc.sel,X;e.options.dragDrop&&lt&&!e.isReadOnly()&&i=="single"&&(X=k.contains(t))>-1&&(cn((X=k.ranges[X]).from(),t)<0||t.xRel>0)&&(cn(X.to(),t)>0||t.xRel<0)?Gl(e,n,t,f):Vl(e,n,t,f)}function Gl(e,t,i,n){var f=e.display,k=!1,X=Xi(e,function(ae){L&&(f.scroller.draggable=!1),e.state.draggingText=!1,St(f.wrapper.ownerDocument,"mouseup",X),St(f.wrapper.ownerDocument,"mousemove",J),St(f.scroller,"dragstart",ee),St(f.scroller,"drop",X),k||(se(ae),n.addNew||Zo(e.doc,i,null,null,n.extend),L&&!_||K&&W==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),J=function(ae){k=k||Math.abs(t.clientX-ae.clientX)+Math.abs(t.clientY-ae.clientY)>=10},ee=function(){return k=!0};L&&(f.scroller.draggable=!0),e.state.draggingText=X,X.copy=!n.moveOnDrag,f.scroller.dragDrop&&f.scroller.dragDrop(),Ye(f.wrapper.ownerDocument,"mouseup",X),Ye(f.wrapper.ownerDocument,"mousemove",J),Ye(f.scroller,"dragstart",ee),Ye(f.scroller,"drop",X),Za(e),setTimeout(function(){return f.input.focus()},20)}function nl(e,t,i){if(i=="char")return new nt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new nt(yt(t.line,0),S(e.doc,yt(t.line+1,0)));var n=i(e,t);return new nt(n.from,n.to)}function Vl(e,t,i,n){var f=e.display,k=e.doc;se(t);var X,J,ee=k.sel,ae=ee.ranges;if(n.addNew&&!n.extend?(J=k.sel.contains(i),J>-1?X=ae[J]:X=new nt(i,i)):(X=k.sel.primary(),J=k.sel.primIndex),n.unit=="rectangle")n.addNew||(X=new nt(i,i)),i=Vi(e,t,!0,!0),J=-1;else{var Se=nl(e,i,n.unit);n.extend?X=ls(X,Se.anchor,Se.head,n.extend):X=Se}n.addNew?J==-1?(J=ae.length,Or(k,ot(e,ae.concat([X]),J),{scroll:!1,origin:"*mouse"})):ae.length>1&&ae[J].empty()&&n.unit=="char"&&!n.extend?(Or(k,ot(e,ae.slice(0,J).concat(ae.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),ee=k.sel):us(k,J,X,ue):(J=0,Or(k,new Ge([X],0),ue),ee=k.sel);var Re=i;function Ve(Ht){if(cn(Re,Ht)==0)return;if(Re=Ht,n.unit=="rectangle"){for(var on=[],Pn=e.options.tabSize,vn=F(Jt(k,i.line).text,i.ch,Pn),ai=F(Jt(k,Ht.line).text,Ht.ch,Pn),Ni=Math.min(vn,ai),Er=Math.max(vn,ai),Qi=Math.min(i.line,Ht.line),Yr=Math.min(e.lastLine(),Math.max(i.line,Ht.line));Qi<=Yr;Qi++){var Fr=Jt(k,Qi).text,ur=_e(Fr,Ni,Pn);Ni==Er?on.push(new nt(yt(Qi,ur),yt(Qi,ur))):Fr.length>ur&&on.push(new nt(yt(Qi,ur),yt(Qi,_e(Fr,Er,Pn))))}on.length||on.push(new nt(i,i)),Or(k,ot(e,ee.ranges.slice(0,J).concat(on),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ht)}else{var Wr=X,wr=nl(e,Ht,n.unit),gr=Wr.anchor,cr;cn(wr.anchor,gr)>0?(cr=wr.head,gr=Gr(Wr.from(),wr.anchor)):(cr=wr.anchor,gr=na(Wr.to(),wr.head));var Ji=ee.ranges.slice(0);Ji[J]=Xl(e,new nt(S(k,gr),cr)),Or(k,ot(e,Ji,J),ue)}}var We=f.wrapper.getBoundingClientRect(),st=0;function _t(Ht){var on=++st,Pn=Vi(e,Ht,!0,n.unit=="rectangle");if(!Pn)return;if(cn(Pn,Re)!=0){e.curOp.focus=N(),Ve(Pn);var vn=Ba(f,k);(Pn.line>=vn.to||Pn.line<vn.from)&&setTimeout(Xi(e,function(){st==on&&_t(Ht)}),150)}else{var ai=Ht.clientY<We.top?-20:Ht.clientY>We.bottom?20:0;ai&&setTimeout(Xi(e,function(){if(st!=on)return;f.scroller.scrollTop+=ai,_t(Ht)}),50)}}function It(Ht){e.state.selectingText=!1,st=Infinity,Ht&&(se(Ht),f.input.focus()),St(f.wrapper.ownerDocument,"mousemove",Wt),St(f.wrapper.ownerDocument,"mouseup",en),k.history.lastSelOrigin=null}var Wt=Xi(e,function(Ht){Ht.buttons===0||!$e(Ht)?It(Ht):_t(Ht)}),en=Xi(e,It);e.state.selectingText=en,Ye(f.wrapper.ownerDocument,"mousemove",Wt),Ye(f.wrapper.ownerDocument,"mouseup",en)}function Xl(e,t){var i=t.anchor,n=t.head,f=Jt(e.doc,i.line);if(cn(i,n)==0&&i.sticky==n.sticky)return t;var k=xt(f);if(!k)return t;var X=at(k,i.ch,i.sticky),J=k[X];if(J.from!=i.ch&&J.to!=i.ch)return t;var ee=X+(J.from==i.ch==(J.level!=1)?0:1);if(ee==0||ee==k.length)return t;var ae;if(n.line!=i.line)ae=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Se=at(k,n.ch,n.sticky),Re=Se-X||(n.ch-i.ch)*(J.level==1?-1:1);Se==ee-1||Se==ee?ae=Re<0:ae=Re>0}var Ve=k[ee+(ae?-1:0)],We=ae==(Ve.level==1),st=We?Ve.from:Ve.to,_t=We?"after":"before";return i.ch==st&&i.sticky==_t?t:new nt(new yt(i.line,st,_t),n)}function il(e,t,i,n){var f,k;if(t.touches)f=t.touches[0].clientX,k=t.touches[0].clientY;else try{f=t.clientX,k=t.clientY}catch(Ve){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&se(t);var X=e.display,J=X.lineDiv.getBoundingClientRect();if(k>J.bottom||!xe(e,i))return Ee(t);k-=J.top-X.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var ae=X.gutters.childNodes[ee];if(ae&&ae.getBoundingClientRect().right>=f){var Se=er(e.doc,k),Re=e.display.gutterSpecs[ee];return ze(e,i,e,Se,Re.className,t),Ee(t)}}}function ms(e,t){return il(e,t,"gutterClick",!0)}function rl(e,t){if(ia(e.display,t)||Yl(e,t))return;if(ut(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return xe(e,"gutterContextMenu")?il(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vn(e)}var Ao={toString:function(){return"CodeMirror.Init"}},ol={},rs={};function Ql(e){var t=e.optionHandlers;function i(n,f,k,X){e.defaults[n]=f,k&&(t[n]=X?function(J,ee,ae){ae!=Ao&&k(J,ee,ae)}:k)}e.defineOption=i,e.Init=Ao,i("value","",function(n,f){return n.setValue(f)},!0),i("mode",null,function(n,f){n.doc.modeOption=f,Kn(n)},!0),i("indentUnit",2,Kn,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){yr(n),Vn(n),Ei(n)},!0),i("lineSeparator",null,function(n,f){if(n.doc.lineSep=f,!f)return;var k=[],X=n.doc.first;n.doc.iter(function(ee){for(var ae=0;;){var Se=ee.text.indexOf(f,ae);if(Se==-1)break;ae=Se+f.length,k.push(yt(X,Se))}X++});for(var J=k.length-1;J>=0;J--)To(n.doc,f,k[J],yt(k[J].line,k[J].ch+f.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,f,k){n.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),k!=Ao&&n.refresh()}),i("specialCharPlaceholder",Mn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,f){return n.getInputField().spellcheck=f},!0),i("autocorrect",!1,function(n,f){return n.getInputField().autocorrect=f},!0),i("autocapitalize",!1,function(n,f){return n.getInputField().autocapitalize=f},!0),i("rtlMoveVisually",!R),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){al(n),ea(n)},!0),i("keyMap","default",function(n,f,k){var X=ns(f),J=k!=Ao&&ns(k);J&&J.detach&&J.detach(n,X),X.attach&&X.attach(n,J||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,f){n.display.gutterSpecs=_r(f,n.options.lineNumbers),ea(n)},!0),i("fixedGutter",!0,function(n,f){n.display.gutters.style.left=f?vr(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return pa(n)},!0),i("scrollbarStyle","native",function(n){Wa(n),pa(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,f){n.display.gutterSpecs=_r(n.options.gutters,f),ea(n)},!0),i("firstLineNumber",1,ea,!0),i("lineNumberFormatter",function(n){return n},ea,!0),i("showCursorWhenSelecting",!1,Ti,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,f){f=="nocursor"&&(Ea(n),n.display.input.blur()),n.display.input.readOnlyChanged(f)}),i("screenReaderLabel",null,function(n,f){f=f===""?null:f,n.display.input.screenReaderLabelChanged(f)}),i("disableInput",!1,function(n,f){f||n.display.input.reset()},!0),i("dragDrop",!0,$l),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Ti,!0),i("singleCursorHeightPerLine",!0,Ti,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,yr,!0),i("addModeClass",!1,yr,!0),i("pollInterval",100),i("undoDepth",200,function(n,f){return n.doc.history.undoDepth=f}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,yr,!0),i("moveInputWithCursor",!0,function(n,f){f||n.display.input.resetPosition()}),i("tabindex",null,function(n,f){return n.display.input.getField().tabIndex=f||""}),i("autofocus",null),i("direction","ltr",function(n,f){return n.doc.setDirection(f)},!0),i("phrases",null)}function $l(e,t,i){var n=i&&i!=Ao;if(!t!=!n){var f=e.display.dragFunctions,k=t?Ye:St;k(e.display.scroller,"dragstart",f.start),k(e.display.scroller,"dragenter",f.enter),k(e.display.scroller,"dragover",f.over),k(e.display.scroller,"dragleave",f.leave),k(e.display.scroller,"drop",f.drop)}}function Zl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),li(e)),Cr(e),Ei(e),Vn(e),setTimeout(function(){return pa(e)},100)}function zi(e,t){var i=this;if(!(this instanceof zi))return new zi(e,t);this.options=t=t?x(t):{},x(ol,t,!1);var n=t.value;typeof n=="string"?n=new jr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var f=new zi.inputStyles[t.inputStyle](this),k=this.display=new Ra(e,n,f,t);k.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wa(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 Q,keySeq:null,specialChars:null},t.autofocus&&!a&&k.input.focus(),K&&W<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Jl(this),Rl(),qr(this),this.curOp.forceUpdate=!0,Ki(this,n),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ca(i)},20):Ea(this);for(var X in rs)rs.hasOwnProperty(X)&&rs[X](this,t[X],Ao);lr(this),t.finishInit&&t.finishInit(this);for(var J=0;J<gs.length;++J)gs[J](this);oa(this),L&&t.lineWrapping&&getComputedStyle(k.lineDiv).textRendering=="optimizelegibility"&&(k.lineDiv.style.textRendering="auto")}zi.defaults=ol,zi.optionHandlers=rs;function Jl(e){var t=e.display;Ye(t.scroller,"mousedown",Xi(e,tl)),K&&W<11?Ye(t.scroller,"dblclick",Xi(e,function(ee){if(ut(e,ee))return;var ae=Vi(e,ee);if(!ae||ms(e,ee)||ia(e.display,ee))return;se(ee);var Se=e.findWordAt(ae);Zo(e.doc,Se.anchor,Se.head)})):Ye(t.scroller,"dblclick",function(ee){return ut(e,ee)||se(ee)}),Ye(t.scroller,"contextmenu",function(ee){return rl(e,ee)}),Ye(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||rl(e,ee)});var i,n={end:0};function f(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function k(ee){if(ee.touches.length!=1)return!1;var ae=ee.touches[0];return ae.radiusX<=1&&ae.radiusY<=1}function X(ee,ae){if(ae.left==null)return!0;var Se=ae.left-ee.left,Re=ae.top-ee.top;return Se*Se+Re*Re>20*20}Ye(t.scroller,"touchstart",function(ee){if(!ut(e,ee)&&!k(ee)&&!ms(e,ee)){t.input.ensurePolled(),clearTimeout(i);var ae=+new Date;t.activeTouch={start:ae,moved:!1,prev:ae-n.end<=300?n:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Ye(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ye(t.scroller,"touchend",function(ee){var ae=t.activeTouch;if(ae&&!ia(t,ee)&&ae.left!=null&&!ae.moved&&new Date-ae.start<300){var Se=e.coordsChar(t.activeTouch,"page"),Re;!ae.prev||X(ae,ae.prev)?Re=new nt(Se,Se):!ae.prev.prev||X(ae,ae.prev.prev)?Re=e.findWordAt(Se):Re=new nt(yt(Se.line,0),S(e.doc,yt(Se.line+1,0))),e.setSelection(Re.anchor,Re.head),e.focus(),se(ee)}f()}),Ye(t.scroller,"touchcancel",f),Ye(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ha(e,t.scroller.scrollTop),Dr(e,t.scroller.scrollLeft,!0),ze(e,"scroll",e))}),Ye(t.scroller,"mousewheel",function(ee){return Qe(e,ee)}),Ye(t.scroller,"DOMMouseScroll",function(ee){return Qe(e,ee)}),Ye(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){ut(e,ee)||Ae(ee)},over:function(ee){ut(e,ee)||(Ol(e,ee),Ae(ee))},start:function(ee){return Al(e,ee)},drop:Xi(e,Sl),leave:function(ee){ut(e,ee)||Hs(e)}};var J=t.input.getField();Ye(J,"keyup",function(ee){return qs.call(e,ee)}),Ye(J,"keydown",Xi(e,Js)),Ye(J,"keypress",Xi(e,el)),Ye(J,"focus",function(ee){return ca(e,ee)}),Ye(J,"blur",function(ee){return Ea(e,ee)})}var gs=[];zi.defineInitHook=function(e){return gs.push(e)};function Qo(e,t,i,n){var f=e.doc,k;i==null&&(i="add"),i=="smart"&&(f.mode.indent?k=Pt(e,t).state:i="prev");var X=e.options.tabSize,J=Jt(f,t),ee=F(J.text,null,X);J.stateAfter&&(J.stateAfter=null);var ae=J.text.match(/^\s*/)[0],Se;if(!n&&!/\S/.test(J.text))Se=0,i="not";else if(i=="smart"&&(Se=f.mode.indent(k,J.text.slice(ae.length),J.text),Se==ge||Se>150)){if(!n)return;i="prev"}i=="prev"?t>f.first?Se=F(Jt(f,t-1).text,null,X):Se=0:i=="add"?Se=ee+e.options.indentUnit:i=="subtract"?Se=ee-e.options.indentUnit:typeof i=="number"&&(Se=ee+i),Se=Math.max(0,Se);var Re="",Ve=0;if(e.options.indentWithTabs)for(var We=Math.floor(Se/X);We;--We)Ve+=X,Re+=" ";if(Ve<Se&&(Re+=ne(Se-Ve)),Re!=ae)return To(f,Re,yt(t,0),yt(t,ae.length),"+input"),J.stateAfter=null,!0;for(var st=0;st<f.sel.ranges.length;st++){var _t=f.sel.ranges[st];if(_t.head.line==t&&_t.head.ch<ae.length){var It=yt(t,ae.length);us(f,st,new nt(It,It));break}}}var ga=null;function as(e){ga=e}function vs(e,t,i,n,f){var k=e.doc;e.display.shift=!1,n||(n=k.sel);var X=+new Date-200,J=f=="paste"||e.state.pasteIncoming>X,ee=yn(t),ae=null;if(J&&n.ranges.length>1)if(ga&&ga.text.join(`
`)==t){if(n.ranges.length%ga.text.length==0){ae=[];for(var Se=0;Se<ga.text.length;Se++)ae.push(k.splitLines(ga.text[Se]))}}else ee.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(ae=Fe(ee,function(Wt){return[Wt]}));for(var Re=e.curOp.updateInput,Ve=n.ranges.length-1;Ve>=0;Ve--){var We=n.ranges[Ve],st=We.from(),_t=We.to();We.empty()&&(i&&i>0?st=yt(st.line,st.ch-i):e.state.overwrite&&!J?_t=yt(_t.line,Math.min(Jt(k,_t.line).text.length,_t.ch+Te(ee).length)):J&&ga&&ga.lineWise&&ga.text.join(`
`)==ee.join(`
`)&&(st=_t=yt(st.line,0)));var It={from:st,to:_t,text:ae?ae[Ve%ae.length]:ee,origin:f||(J?"paste":e.state.cutIncoming>X?"cut":"+input")};xo(e.doc,It),Wi(e,"inputRead",e,It)}t&&!J&&ll(e,t),da(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Re),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Zi(t,function(){return vs(t,i,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var f=i.ranges[n];if(f.head.ch>100||n&&i.ranges[n-1].head.line==f.head.line)continue;var k=e.getModeAt(f.head),X=!1;if(k.electricChars){for(var J=0;J<k.electricChars.length;J++)if(t.indexOf(k.electricChars.charAt(J))>-1){X=Qo(e,f.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(Jt(e.doc,f.head.line).text.slice(0,f.head.ch))&&(X=Qo(e,f.head.line,"smart")));X&&Wi(e,"electricInput",e,f.head.line)}}function ul(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var f=e.doc.sel.ranges[n].head.line,k={anchor:yt(f,0),head:yt(f+1,0)};i.push(k),t.push(e.getRange(k.anchor,k.head))}return{text:t,ranges:i}}function cl(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return L?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),cl(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,f){var k=this.options,X=k[n];if(k[n]==f&&n!="mode")return;k[n]=f,t.hasOwnProperty(n)&&Xi(this,t[n])(this,f,X),ze(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,f){this.state.keyMaps[f?"push":"unshift"](ns(n))},removeKeyMap:function(n){for(var f=this.state.keyMaps,k=0;k<f.length;++k)if(f[k]==n||f[k].name==n)return f.splice(k,1),!0},addOverlay:pr(function(n,f){var k=n.token?n:e.getMode(this.options,n);if(k.startState)throw new Error("Overlays may not be stateful.");Ke(this.state.overlays,{mode:k,modeSpec:n,opaque:f&&f.opaque,priority:f&&f.priority||0},function(X){return X.priority}),this.state.modeGen++,Ei(this)}),removeOverlay:pr(function(n){for(var f=this.state.overlays,k=0;k<f.length;++k){var X=f[k].modeSpec;if(X==n||typeof n=="string"&&X.name==n){f.splice(k,1),this.state.modeGen++,Ei(this);return}}}),indentLine:pr(function(n,f,k){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),kr(this.doc,n)&&Qo(this,n,f,k)}),indentSelection:pr(function(n){for(var f=this.doc.sel.ranges,k=-1,X=0;X<f.length;X++){var J=f[X];if(J.empty())J.head.line>k&&(Qo(this,J.head.line,n,!0),k=J.head.line,X==this.doc.sel.primIndex&&da(this));else{var ee=J.from(),ae=J.to(),Se=Math.max(k,ee.line);k=Math.min(this.lastLine(),ae.line-(ae.ch?0:1))+1;for(var Re=Se;Re<k;++Re)Qo(this,Re,n);var Ve=this.doc.sel.ranges;ee.ch==0&&f.length==Ve.length&&Ve[X].from().ch>0&&us(this.doc,X,new nt(ee,Ve[X].to()),fe)}}}),getTokenAt:function(n,f){return Li(this,n,f)},getLineTokens:function(n,f){return Li(this,yt(n),f,!0)},getTokenTypeAt:function(n){n=S(this.doc,n);var f=ct(this,Jt(this.doc,n.line)),k=0,X=(f.length-1)/2,J=n.ch,ee;if(J==0)ee=f[2];else for(;;){var ae=k+X>>1;if((ae?f[ae*2-1]:0)>=J)X=ae;else if(f[ae*2+1]<J)k=ae+1;else{ee=f[ae*2+2];break}}var Se=ee?ee.indexOf("overlay "):-1;return Se<0?ee:Se==0?null:ee.slice(0,Se-1)},getModeAt:function(n){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(n).state).mode:f},getHelper:function(n,f){return this.getHelpers(n,f)[0]},getHelpers:function(n,f){var k=[];if(!i.hasOwnProperty(f))return k;var X=i[f],J=this.getModeAt(n);if(typeof J[f]=="string")X[J[f]]&&k.push(X[J[f]]);else if(J[f])for(var ee=0;ee<J[f].length;ee++){var ae=X[J[f][ee]];ae&&k.push(ae)}else J.helperType&&X[J.helperType]?k.push(X[J.helperType]):X[J.name]&&k.push(X[J.name]);for(var Se=0;Se<X._global.length;Se++){var Re=X._global[Se];Re.pred(J,this)&&q(k,Re.val)==-1&&k.push(Re.val)}return k},getStateAfter:function(n,f){var k=this.doc;return n=$(k,n==null?k.first+k.size-1:n),Pt(this,n+1,f).state},cursorCoords:function(n,f){var k,X=this.doc.sel.primary();return n==null?k=X.head:typeof n=="object"?k=S(this.doc,n):k=n?X.from():X.to(),ti(this,k,f||"page")},charCoords:function(n,f){return ki(this,S(this.doc,n),f||"page")},coordsChar:function(n,f){return n=ei(this,n,f||"page"),Hn(this,n.left,n.top)},lineAtHeight:function(n,f){return n=ei(this,{top:n,left:0},f||"page").top,er(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,f,k){var X=!1,J;if(typeof n=="number"){var ee=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>ee&&(n=ee,X=!0),J=Jt(this.doc,n)}else J=n;return Jn(this,J,{top:0,left:0},f||"page",k||X).top+(X?this.doc.height-Ft(J):0)},defaultTextHeight:function(){return Hi(this.display)},defaultCharWidth:function(){return Gi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,f,k,X,J){var ee=this.display;n=ti(this,S(this.doc,n));var ae=n.bottom,Se=n.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),ee.sizer.appendChild(f),X=="over")ae=n.top;else if(X=="above"||X=="near"){var Re=Math.max(ee.wrapper.clientHeight,this.doc.height),Ve=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(X=="above"||n.bottom+f.offsetHeight>Re)&&n.top>f.offsetHeight?ae=n.top-f.offsetHeight:n.bottom+f.offsetHeight<=Re&&(ae=n.bottom),Se+f.offsetWidth>Ve&&(Se=Ve-f.offsetWidth)}f.style.top=ae+"px",f.style.left=f.style.right="",J=="right"?(Se=ee.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(J=="left"?Se=0:J=="middle"&&(Se=(ee.sizer.clientWidth-f.offsetWidth)/2),f.style.left=Se+"px"),k&&mo(this,{left:Se,top:ae,right:Se+f.offsetWidth,bottom:ae+f.offsetHeight})},triggerOnKeyDown:pr(Js),triggerOnKeyPress:pr(el),triggerOnKeyUp:qs,triggerOnMouseDown:pr(tl),execCommand:function(n){if(Go.hasOwnProperty(n))return Go[n].call(null,this)},triggerElectric:pr(function(n){ll(this,n)}),findPosH:function(n,f,k,X){var J=1;f<0&&(J=-1,f=-f);for(var ee=S(this.doc,n),ae=0;ae<f&&!(ee=_s(this.doc,ee,J,k,X),ee.hitSide);++ae);return ee},moveH:pr(function(n,f){var k=this;this.extendSelectionsBy(function(X){return k.display.shift||k.doc.extend||X.empty()?_s(k.doc,X.head,n,f,k.options.rtlMoveVisually):n<0?X.from():X.to()},he)}),deleteH:pr(function(n,f){var k=this.doc.sel,X=this.doc;k.somethingSelected()?X.replaceSelection("",null,"+delete"):So(this,function(J){var ee=_s(X,J.head,n,f,!1);return n<0?{from:ee,to:J.head}:{from:J.head,to:ee}})}),findPosV:function(n,f,k,X){var J=1,ee=X;f<0&&(J=-1,f=-f);for(var ae=S(this.doc,n),Se=0;Se<f;++Se){var Re=ti(this,ae,"div");if(ee==null?ee=Re.left:Re.left=ee,ae=hl(this,Re,J,k),ae.hitSide)break}return ae},moveV:pr(function(n,f){var k=this,X=this.doc,J=[],ee=!this.display.shift&&!X.extend&&X.sel.somethingSelected();if(X.extendSelectionsBy(function(Se){if(ee)return n<0?Se.from():Se.to();var Re=ti(k,Se.head,"div");Se.goalColumn!=null&&(Re.left=Se.goalColumn),J.push(Re.left);var Ve=hl(k,Re,n,f);return f=="page"&&Se==X.sel.primary()&&qa(k,ki(k,Ve,"div").top-Re.top),Ve},he),J.length)for(var ae=0;ae<X.sel.ranges.length;ae++)X.sel.ranges[ae].goalColumn=J[ae]}),findWordAt:function(n){var f=this.doc,k=Jt(f,n.line).text,X=n.ch,J=n.ch;if(k){var ee=this.getHelper(n,"wordChars");(n.sticky=="before"||J==k.length)&&X?--X:++J;for(var ae=k.charAt(X),Se=Je(ae,ee)?function(Re){return Je(Re,ee)}:/\s/.test(ae)?function(Re){return/\s/.test(Re)}:function(Re){return!/\s/.test(Re)&&!Je(Re)};X>0&&Se(k.charAt(X-1));)--X;for(;J<k.length&&Se(k.charAt(J));)++J}return new nt(yt(n.line,X),yt(n.line,J))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):m(this.display.cursorDiv,"CodeMirror-overwrite"),ze(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:pr(function(n,f){xa(this,n,f)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Me(this)-this.display.barHeight,width:n.scrollWidth-Me(this)-this.display.barWidth,clientHeight:re(this),clientWidth:Ce(this)}},scrollIntoView:pr(function(n,f){n==null?(n={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof n=="number"?n={from:yt(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=f||0,n.from.line!=null?go(this,n):Ta(this,n.from,n.to,n.margin)}),setSize:pr(function(n,f){var k=this,X=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};n!=null&&(this.display.wrapper.style.width=X(n)),f!=null&&(this.display.wrapper.style.height=X(f)),this.options.lineWrapping&&jn(this);var J=this.display.viewFrom;this.doc.iter(J,this.display.viewTo,function(ee){if(ee.widgets){for(var ae=0;ae<ee.widgets.length;ae++)if(ee.widgets[ae].noHScroll){Tn(k,J,"widget");break}}++J}),this.curOp.forceUpdate=!0,ze(this,"refresh",this)}),operation:function(n){return Zi(this,n)},startOperation:function(){return qr(this)},endOperation:function(){return oa(this)},refresh:pr(function(){var n=this.display.cachedTextHeight;Ei(this),this.curOp.forceUpdate=!0,Vn(this),xa(this,this.doc.scrollLeft,this.doc.scrollTop),Ga(this.display),(n==null||Math.abs(n-Hi(this.display))>.5||this.options.lineWrapping)&&Cr(this),ze(this,"refresh",this)}),swapDoc:pr(function(n){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Ki(this,n),Vn(this),this.display.input.reset(),xa(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Wi(this,"swapDoc",this,f),f}),phrase:function(n){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,n)?f[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},pe(e),e.registerHelper=function(n,f,k){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][f]=k},e.registerGlobalHelper=function(n,f,k,X){e.registerHelper(n,f,X),i[n]._global.push({pred:k,val:X})}}function _s(e,t,i,n,f){var k=t,X=i,J=Jt(e,t.line),ee=f&&e.direction=="rtl"?-i:i;function ae(){var en=t.line+ee;return en<e.first||en>=e.first+e.size?!1:(t=new yt(en,t.ch,t.sticky),J=Jt(e,en))}function Se(en){var Ht;if(n=="codepoint"){var on=J.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(on)?Ht=null:Ht=new yt(t.line,Math.max(0,Math.min(J.text.length,t.ch+i*(on>=55296&&on<56320?2:1))),-i)}else f?Ht=kl(e.cm,J,t,i):Ht=ds(J,t,i);if(Ht==null)if(!en&&ae())t=hs(f,e.cm,J,t.line,ee);else return!1;else t=Ht;return!0}if(n=="char"||n=="codepoint")Se();else if(n=="column")Se(!0);else if(n=="word"||n=="group")for(var Re=null,Ve=n=="group",We=e.cm&&e.cm.getHelper(t,"wordChars"),st=!0;!(i<0&&!Se(!st));st=!1){var _t=J.text.charAt(t.ch)||`
`,It=Je(_t,We)?"w":Ve&&_t==`
`?"n":!Ve||/\s/.test(_t)?null:"p";if(Ve&&!st&&!It&&(It="s"),Re&&Re!=It){i<0&&(i=1,Se(),t.sticky="after");break}if(It&&(Re=It),i>0&&!Se(!st))break}var Wt=qo(e,t,k,X,!0);return Kr(k,Wt)&&(Wt.hitSide=!0),Wt}function hl(e,t,i,n){var f=e.doc,k=t.left,X;if(n=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(J-.5*Hi(e.display),3);X=(i>0?t.bottom:t.top)+i*ee}else n=="line"&&(X=i>0?t.bottom+3:t.top-3);for(var ae;!(ae=Hn(e,k,X),!ae.outside);){if(i<0?X<=0:X>=f.height){ae.hitSide=!0;break}X+=i*5}return ae}var Ii=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ii.prototype.init=function(e){var t=this,i=this,n=i.cm,f=i.div=e.lineDiv;cl(f,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function k(J){for(var ee=J.target;ee;ee=ee.parentNode){if(ee==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Ye(f,"paste",function(J){if(!k(J)||ut(n,J)||sl(J,n))return;W<=11&&setTimeout(Xi(n,function(){return t.updateFromDOM()}),20)}),Ye(f,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Ye(f,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Ye(f,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ye(f,"touchstart",function(){return i.forceCompositionEnd()}),Ye(f,"input",function(){t.composing||t.readFromDOMSoon()});function X(J){if(!k(J)||ut(n,J))return;if(n.somethingSelected())as({lineWise:!1,text:n.getSelections()}),J.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var ee=ul(n);as({lineWise:!0,text:ee.text}),J.type=="cut"&&n.operation(function(){n.setSelections(ee.ranges,0,fe),n.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var ae=ga.text.join(`
`);if(J.clipboardData.setData("Text",ae),J.clipboardData.getData("Text")==ae){J.preventDefault();return}}var Se=dl(),Re=Se.firstChild;n.display.lineSpace.insertBefore(Se,n.display.lineSpace.firstChild),Re.value=ga.text.join(`
`);var Ve=document.activeElement;H(Re),setTimeout(function(){n.display.lineSpace.removeChild(Se),Ve.focus(),Ve==f&&i.showPrimarySelection()},50)}Ye(f,"copy",X),Ye(f,"cut",X)},Ii.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ii.prototype.prepareSelection=function(){var e=Vr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ii.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ii.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ii.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),f=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||f.line<t.display.viewFrom){e.removeAllRanges();return}var k=os(t,e.anchorNode,e.anchorOffset),X=os(t,e.focusNode,e.focusOffset);if(k&&!k.bad&&X&&!X.bad&&cn(Gr(k,X),n)==0&&cn(na(k,X),f)==0)return;var J=t.display.view,ee=n.line>=t.display.viewFrom&&fl(t,n)||{node:J[0].measure.map[2],offset:0},ae=f.line<t.display.viewTo&&fl(t,f);if(!ae){var Se=J[J.length-1].measure,Re=Se.maps?Se.maps[Se.maps.length-1]:Se.map;ae={node:Re[Re.length-1],offset:Re[Re.length-2]-Re[Re.length-3]}}if(!ee||!ae){e.removeAllRanges();return}var Ve=e.rangeCount&&e.getRangeAt(0),We;try{We=g(ee.node,ee.offset,ae.offset,ae.node)}catch(st){}We&&(!M&&t.state.focused?(e.collapse(ee.node,ee.offset),We.collapsed||(e.removeAllRanges(),e.addRange(We))):(e.removeAllRanges(),e.addRange(We)),Ve&&e.anchorNode==null?e.addRange(Ve):M&&this.startGracePeriod()),this.rememberSelection()},Ii.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)},Ii.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},Ii.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ii.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return C(this.div,t)},Ii.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ii.prototype.blur=function(){this.div.blur()},Ii.prototype.getField=function(){return this.div},Ii.prototype.supportsTouch=function(){return!0},Ii.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zi(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)},Ii.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ii.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&b&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=os(t,e.anchorNode,e.anchorOffset),n=os(t,e.focusNode,e.focusOffset);i&&n&&Zi(t,function(){Or(t.doc,At(i,n),fe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Ii.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),f=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=yt(n.line-1,Jt(e.doc,n.line-1).length)),f.ch==Jt(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=yt(f.line+1,0)),n.line<t.viewFrom||f.line>t.viewTo-1)return!1;var k,X,J;n.line==t.viewFrom||(k=Di(e,n.line))==0?(X=Fn(t.view[0].line),J=t.view[0].node):(X=Fn(t.view[k].line),J=t.view[k-1].node.nextSibling);var ee=Di(e,f.line),ae,Se;if(ee==t.view.length-1?(ae=t.viewTo-1,Se=t.lineDiv.lastChild):(ae=Fn(t.view[ee+1].line)-1,Se=t.view[ee+1].node.previousSibling),!J)return!1;for(var Re=e.doc.splitLines(tu(e,J,Se,X,ae)),Ve=qi(e.doc,yt(X,0),yt(ae,Jt(e.doc,ae).text.length));Re.length>1&&Ve.length>1;)if(Te(Re)==Te(Ve))Re.pop(),Ve.pop(),ae--;else if(Re[0]==Ve[0])Re.shift(),Ve.shift(),X++;else break;for(var We=0,st=0,_t=Re[0],It=Ve[0],Wt=Math.min(_t.length,It.length);We<Wt&&_t.charCodeAt(We)==It.charCodeAt(We);)++We;for(var en=Te(Re),Ht=Te(Ve),on=Math.min(en.length-(Re.length==1?We:0),Ht.length-(Ve.length==1?We:0));st<on&&en.charCodeAt(en.length-st-1)==Ht.charCodeAt(Ht.length-st-1);)++st;if(Re.length==1&&Ve.length==1&&X==n.line)for(;We&&We>n.ch&&en.charCodeAt(en.length-st-1)==Ht.charCodeAt(Ht.length-st-1);)We--,st++;Re[Re.length-1]=en.slice(0,en.length-st).replace(/^\u200b+/,""),Re[0]=Re[0].slice(We).replace(/\u200b+$/,"");var Pn=yt(X,We),vn=yt(ae,Ve.length?Te(Ve).length-st:0);if(Re.length>1||Re[0]||cn(Pn,vn))return To(e.doc,Re,Pn,vn,"+input"),!0},Ii.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ii.prototype.reset=function(){this.forceCompositionEnd()},Ii.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ii.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)},Ii.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Zi(this.cm,function(){return Ei(e.cm)})},Ii.prototype.setUneditable=function(e){e.contentEditable="false"},Ii.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Xi(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ii.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ii.prototype.onContextMenu=function(){},Ii.prototype.resetPosition=function(){},Ii.prototype.needsContentAttribute=!0;function fl(e,t){var i=ke(e,t.line);if(!i||i.hidden)return null;var n=Jt(e.doc,t.line),f=oe(i,n,t.line),k=xt(n,e.doc.direction),X="left";if(k){var J=at(k,t.ch);X=J%2?"right":"left"}var ee=mt(f.map,t.ch,X);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Oo(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,f){var k="",X=!1,J=e.doc.lineSeparator(),ee=!1;function ae(We){return function(st){return st.id==We}}function Se(){X&&(k+=J,ee&&(k+=J),X=ee=!1)}function Re(We){We&&(Se(),k+=We)}function Ve(We){if(We.nodeType==1){var st=We.getAttribute("cm-text");if(st){Re(st);return}var _t=We.getAttribute("cm-marker"),It;if(_t){var Wt=e.findMarks(yt(n,0),yt(f+1,0),ae(+_t));Wt.length&&(It=Wt[0].find(0))&&Re(qi(e.doc,It.from,It.to).join(J));return}if(We.getAttribute("contenteditable")=="false")return;var en=/^(pre|div|p|li|table|br)$/i.test(We.nodeName);if(!/^br$/i.test(We.nodeName)&&We.textContent.length==0)return;en&&Se();for(var Ht=0;Ht<We.childNodes.length;Ht++)Ve(We.childNodes[Ht]);/^(pre|p)$/i.test(We.nodeName)&&(ee=!0),en&&(X=!0)}else We.nodeType==3&&Re(We.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ve(t),t==i);)t=t.nextSibling,ee=!1;return k}function os(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Oo(e.clipPos(yt(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var f=0;f<e.display.view.length;f++){var k=e.display.view[f];if(k.node==n)return nu(k,t,i)}}function nu(e,t,i){var n=e.text.firstChild,f=!1;if(!t||!C(n,t))return Oo(yt(Fn(e.line),0),!0);if(t==n&&(f=!0,t=n.childNodes[i],i=0,!t)){var k=e.rest?Te(e.rest):e.line;return Oo(yt(Fn(k),k.text.length),f)}var X=t.nodeType==3?t:null,J=t;for(!X&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(X=t.firstChild,i&&(i=X.nodeValue.length));J.parentNode!=n;)J=J.parentNode;var ee=e.measure,ae=ee.maps;function Se(It,Wt,en){for(var Ht=-1;Ht<(ae?ae.length:0);Ht++)for(var on=Ht<0?ee.map:ae[Ht],Pn=0;Pn<on.length;Pn+=3){var vn=on[Pn+2];if(vn==It||vn==Wt){var ai=Fn(Ht<0?e.line:e.rest[Ht]),Ni=on[Pn]+en;return(en<0||vn!=It)&&(Ni=on[Pn+(en?1:0)]),yt(ai,Ni)}}}var Re=Se(X,J,i);if(Re)return Oo(Re,f);for(var Ve=J.nextSibling,We=X?X.nodeValue.length-i:0;Ve;Ve=Ve.nextSibling){if(Re=Se(Ve,Ve.firstChild,0),Re)return Oo(yt(Re.line,Re.ch-We),f);We+=Ve.textContent.length}for(var st=J.previousSibling,_t=i;st;st=st.previousSibling){if(Re=Se(st,st.firstChild,-1),Re)return Oo(yt(Re.line,Re.ch+_t),f);_t+=st.textContent.length}}var or=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};or.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(f.style.width="0px"),Ye(f,"input",function(){K&&W>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ye(f,"paste",function(X){if(ut(n,X)||sl(X,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function k(X){if(ut(n,X))return;if(n.somethingSelected())as({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var J=ul(n);as({lineWise:!0,text:J.text}),X.type=="cut"?n.setSelections(J.ranges,null,fe):(i.prevInput="",f.value=J.text.join(`
`),H(f))}else return;X.type=="cut"&&(n.state.cutIncoming=+new Date)}Ye(f,"cut",k),Ye(f,"copy",k),Ye(e.scroller,"paste",function(X){if(ia(e,X)||ut(n,X))return;if(!f.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var J=new Event("paste");J.clipboardData=X.clipboardData,f.dispatchEvent(J)}),Ye(e.lineSpace,"selectstart",function(X){ia(e,X)||se(X)}),Ye(f,"compositionstart",function(){var X=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:X,range:n.markText(X,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ye(f,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},or.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},or.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},or.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Vr(e);if(e.options.moveInputWithCursor){var f=ti(e,i.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),X=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,f.top+X.top-k.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,f.left+X.left-k.left))}return n},or.prototype.showSelection=function(e){var t=this.cm,i=t.display;s(i.cursorDiv,e.cursors),s(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},or.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&H(this.textarea),K&&W>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&W>=9&&(this.hasSelection=null))},or.prototype.getField=function(){return this.textarea},or.prototype.supportsTouch=function(){return!1},or.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},or.prototype.blur=function(){this.textarea.blur()},or.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},or.prototype.receivedFocus=function(){this.slowPoll()},or.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()})},or.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},or.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Gt(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var f=i.value;if(f==n&&!t.somethingSelected())return!1;if(K&&W>=9&&this.hasSelection===f||u&&/[\uf700-\uf7ff]/.test(f))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=f.charCodeAt(0);if(k==8203&&!n&&(n="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var X=0,J=Math.min(n.length,f.length);X<J&&n.charCodeAt(X)==f.charCodeAt(X);)++X;return Zi(t,function(){vs(t,f.slice(X),n.length-X,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=f,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},or.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},or.prototype.onKeyPress=function(){K&&W>=9&&(this.hasSelection=null),this.fastPoll()},or.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,f=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=Vi(i,e),X=n.scroller.scrollTop;if(!k||p)return;var J=i.options.resetSelectionOnContextMenu;J&&i.doc.sel.contains(k)==-1&&Xi(i,Or)(i.doc,At(k),fe);var ee=f.style.cssText,ae=t.wrapper.style.cssText,Se=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Se.top-5)+"px; left: "+(e.clientX-Se.left-5)+`px;
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Re;L&&(Re=window.scrollY),n.input.focus(),L&&window.scrollTo(null,Re),n.input.reset(),i.somethingSelected()||(f.value=t.prevInput=" "),t.contextMenuPending=We,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Ve(){if(f.selectionStart!=null){var _t=i.somethingSelected(),It="\u200B"+(_t?f.value:"");f.value="\u21DA",f.value=It,t.prevInput=_t?"":"\u200B",f.selectionStart=1,f.selectionEnd=It.length,n.selForContextMenu=i.doc.sel}}function We(){if(t.contextMenuPending!=We)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ae,f.style.cssText=ee,K&&W<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=X),f.selectionStart!=null){(!K||K&&W<9)&&Ve();var _t=0,It=function(){n.selForContextMenu==i.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&t.prevInput=="\u200B"?Xi(i,Ds)(i):_t++<10?n.detectingSelectAll=setTimeout(It,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(It,200)}}if(K&&W>=9&&Ve(),A){Ae(e);var st=function(){St(window,"mouseup",st),setTimeout(We,20)};Ye(window,"mouseup",st)}else setTimeout(We,50)},or.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},or.prototype.setUneditable=function(){},or.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?x(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=N();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=J.getValue()}var f;if(e.form&&(Ye(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var k=e.form;f=k.submit;try{var X=k.submit=function(){n(),k.submit=f,k.submit(),k.submit=X}}catch(ee){}}t.finishInit=function(ee){ee.save=n,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,n(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(St(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var J=zi(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return J}function ru(e){e.off=St,e.on=Ye,e.wheelEventPixels=et,e.Doc=jr,e.splitLines=yn,e.countColumn=F,e.findColumn=_e,e.isWordChar=Be,e.Pass=ge,e.signal=ze,e.Line=$n,e.changeEnd=wt,e.scrollbarModel=eo,e.Pos=yt,e.cmpPos=cn,e.modes=fi,e.mimeModes=In,e.resolveMode=Ot,e.getMode=bn,e.modeExtensions=Cn,e.extendMode=kn,e.copyState=Ai,e.startState=dr,e.innerMode=Ui,e.commands=Go,e.keyMap=Pa,e.keyName=Xs,e.isModifierKey=Gs,e.lookupKey=wo,e.normalizeKeyMap=Il,e.StringStream=mn,e.SharedTextMarker=Ho,e.TextMarker=Va,e.LineWidget=Wo,e.e_preventDefault=se,e.e_stopPropagation=ce,e.e_stop=Ae,e.addClass=U,e.contains=C,e.rmClass=m,e.keyNames=Xa}Ql(zi),ql(zi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ss in jr.prototype)jr.prototype.hasOwnProperty(ss)&&q(au,ss)<0&&(zi.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(jr.prototype[ss]));return pe(jr),zi.inputStyles={textarea:or,contenteditable:Ii},zi.defineMode=function(e){!zi.defaults.mode&&e!="null"&&(zi.defaults.mode=e),Ri.apply(this,arguments)},zi.defineMIME=Si,zi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),zi.defineMIME("text/plain","null"),zi.defineExtension=function(e,t){zi.prototype[e]=t},zi.defineDocExtension=function(e,t){jr.prototype[e]=t},zi.fromTextArea=iu,ru(zi),zi.version="5.58.2",zi})},WaYH:function(ft,Xe,G){"use strict";var de=G("rePB"),Z=G("Ff2n"),M=G("VTBJ"),V=G("1OyB"),I=G("vuIU"),B=G("JX7q"),K=G("Ji7U"),W=G("LK+K"),L=G("q1tI"),P=G("TSYQ"),b=G.n(P),p=G("sboe"),_=G("OZM5"),h=function(A){var w=A.prefixCls,m=A.level,v=A.isStart,s=A.isEnd;if(!m)return null;for(var o="".concat(w,"-indent-unit"),E=[],g=0;g<m;g+=1){var C;E.push(L.createElement("span",{key:g,className:b()(o,(C={},Object(de.a)(C,"".concat(o,"-start"),v[g+1]),Object(de.a)(C,"".concat(o,"-end"),s[g+1]),Object(de.a)(C,"".concat(o,"-end-first-level"),!g&&s[0]),C))}))}return L.createElement("span",{"aria-hidden":"true",className:"".concat(w,"-indent")},E)},r=h,d=G("815F"),l="open",a="close",u="---",c=function(T){Object(K.a)(w,T);var A=Object(W.a)(w);function w(){var m;return Object(V.a)(this,w),m=A.apply(this,arguments),m.state={dragNodeHighlight:!1},m.onSelectorClick=function(v){var s=m.props.context.onNodeClick;s(v,Object(d.b)(m.props)),m.isSelectable()?m.onSelect(v):m.onCheck(v)},m.onSelectorDoubleClick=function(v){var s=m.props.context.onNodeDoubleClick;s(v,Object(d.b)(m.props))},m.onSelect=function(v){if(m.isDisabled())return;var s=m.props.context.onNodeSelect;v.preventDefault(),s(v,Object(d.b)(m.props))},m.onCheck=function(v){if(m.isDisabled())return;var s=m.props,o=s.disableCheckbox,E=s.checked,g=m.props.context.onNodeCheck;if(!m.isCheckable()||o)return;v.preventDefault();var C=!E;g(v,Object(d.b)(m.props),C)},m.onMouseEnter=function(v){var s=m.props.context.onNodeMouseEnter;s(v,Object(d.b)(m.props))},m.onMouseLeave=function(v){var s=m.props.context.onNodeMouseLeave;s(v,Object(d.b)(m.props))},m.onContextMenu=function(v){var s=m.props.context.onNodeContextMenu;s(v,Object(d.b)(m.props))},m.onDragStart=function(v){var s=m.props.context.onNodeDragStart;v.stopPropagation(),m.setState({dragNodeHighlight:!0}),s(v,Object(B.a)(m));try{v.dataTransfer.setData("text/plain","")}catch(o){}},m.onDragEnter=function(v){var s=m.props.context.onNodeDragEnter;v.preventDefault(),v.stopPropagation(),s(v,Object(B.a)(m))},m.onDragOver=function(v){var s=m.props.context.onNodeDragOver;v.preventDefault(),v.stopPropagation(),s(v,Object(B.a)(m))},m.onDragLeave=function(v){var s=m.props.context.onNodeDragLeave;v.stopPropagation(),s(v,Object(B.a)(m))},m.onDragEnd=function(v){var s=m.props.context.onNodeDragEnd;v.stopPropagation(),m.setState({dragNodeHighlight:!1}),s(v,Object(B.a)(m))},m.onDrop=function(v){var s=m.props.context.onNodeDrop;v.preventDefault(),v.stopPropagation(),m.setState({dragNodeHighlight:!1}),s(v,Object(B.a)(m))},m.onExpand=function(v){var s=m.props.context.onNodeExpand;s(v,Object(d.b)(m.props))},m.setSelectHandle=function(v){m.selectHandle=v},m.getNodeState=function(){var v=m.props.expanded;return m.isLeaf()?null:v?l:a},m.hasChildren=function(){var v=m.props.eventKey,s=m.props.context.keyEntities,o=s[v]||{},E=o.children;return!!(E||[]).length},m.isLeaf=function(){var v=m.props,s=v.isLeaf,o=v.loaded,E=m.props.context.loadData,g=m.hasChildren();return s===!1?!1:s||!E&&!g||E&&o&&!g},m.isDisabled=function(){var v=m.props.disabled,s=m.props.context.disabled;return!!(s||v)},m.isCheckable=function(){var v=m.props.checkable,s=m.props.context.checkable;return!s||v===!1?!1:s},m.syncLoadData=function(v){var s=v.expanded,o=v.loading,E=v.loaded,g=m.props.context,C=g.loadData,N=g.onNodeLoad;if(o)return;C&&s&&!m.isLeaf()&&(!m.hasChildren()&&!E&&N(Object(d.b)(m.props)))},m.renderSwitcher=function(){var v=m.props,s=v.expanded,o=v.switcherIcon,E=m.props.context,g=E.prefixCls,C=E.switcherIcon,N=o||C;if(m.isLeaf())return L.createElement("span",{className:b()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof N=="function"?N(Object(M.a)(Object(M.a)({},m.props),{},{isLeaf:!0})):N);var U=b()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(s?l:a));return L.createElement("span",{onClick:m.onExpand,className:U},typeof N=="function"?N(Object(M.a)(Object(M.a)({},m.props),{},{isLeaf:!1})):N)},m.renderCheckbox=function(){var v=m.props,s=v.checked,o=v.halfChecked,E=v.disableCheckbox,g=m.props.context.prefixCls,C=m.isDisabled(),N=m.isCheckable();if(!N)return null;var U=typeof N!="boolean"?N:null;return L.createElement("span",{className:b()("".concat(g,"-checkbox"),s&&"".concat(g,"-checkbox-checked"),!s&&o&&"".concat(g,"-checkbox-indeterminate"),(C||E)&&"".concat(g,"-checkbox-disabled")),onClick:m.onCheck},U)},m.renderIcon=function(){var v=m.props.loading,s=m.props.context.prefixCls;return L.createElement("span",{className:b()("".concat(s,"-iconEle"),"".concat(s,"-icon__").concat(m.getNodeState()||"docu"),v&&"".concat(s,"-icon_loading"))})},m.renderSelector=function(){var v=m.state.dragNodeHighlight,s=m.props,o=s.title,E=s.selected,g=s.icon,C=s.loading,N=s.data,U=m.props.context,j=U.prefixCls,H=U.showIcon,y=U.icon,x=U.draggable,F=U.loadData,Q=U.titleRender,q=m.isDisabled(),ie="".concat(j,"-node-content-wrapper"),ge;if(H){var fe=g||y;ge=fe?L.createElement("span",{className:b()("".concat(j,"-iconEle"),"".concat(j,"-icon__customize"))},typeof fe=="function"?fe(m.props):fe):m.renderIcon()}else F&&C&&(ge=m.renderIcon());var ue;typeof o=="function"?ue=o(N):Q?ue=Q(N):ue=o;var he=L.createElement("span",{className:"".concat(j,"-title")},ue);return L.createElement("span",{ref:m.setSelectHandle,title:typeof o=="string"?o:"",className:b()("".concat(ie),"".concat(ie,"-").concat(m.getNodeState()||"normal"),!q&&(E||v)&&"".concat(j,"-node-selected"),!q&&x&&"draggable"),draggable:!q&&x||void 0,"aria-grabbed":!q&&x||void 0,onMouseEnter:m.onMouseEnter,onMouseLeave:m.onMouseLeave,onContextMenu:m.onContextMenu,onClick:m.onSelectorClick,onDoubleClick:m.onSelectorDoubleClick,onDragStart:x?m.onDragStart:void 0},ge,he)},m}return Object(I.a)(w,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var v=this.props.selectable,s=this.props.context.selectable;return typeof v=="boolean"?v:s}},{key:"render",value:function(){var v,s=this.props,o=s.eventKey,E=s.className,g=s.style,C=s.dragOver,N=s.dragOverGapTop,U=s.dragOverGapBottom,j=s.isLeaf,H=s.isStart,y=s.isEnd,x=s.expanded,F=s.selected,Q=s.checked,q=s.halfChecked,ie=s.loading,ge=s.domRef,fe=s.active,ue=s.onMouseMove,he=Object(Z.a)(s,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),_e=this.props.context,le=_e.prefixCls,ne=_e.filterTreeNode,Te=_e.draggable,Fe=_e.keyEntities,Ke=this.isDisabled(),Ue=Object(_.f)(he),He=Fe[o]||{},Ne=He.level,Be=y[y.length-1];return L.createElement("div",Object.assign({ref:ge,className:b()(E,"".concat(le,"-treenode"),(v={},Object(de.a)(v,"".concat(le,"-treenode-disabled"),Ke),Object(de.a)(v,"".concat(le,"-treenode-switcher-").concat(x?"open":"close"),!j),Object(de.a)(v,"".concat(le,"-treenode-checkbox-checked"),Q),Object(de.a)(v,"".concat(le,"-treenode-checkbox-indeterminate"),q),Object(de.a)(v,"".concat(le,"-treenode-selected"),F),Object(de.a)(v,"".concat(le,"-treenode-loading"),ie),Object(de.a)(v,"".concat(le,"-treenode-active"),fe),Object(de.a)(v,"".concat(le,"-treenode-leaf-last"),Be),Object(de.a)(v,"drag-over",!Ke&&C),Object(de.a)(v,"drag-over-gap-top",!Ke&&N),Object(de.a)(v,"drag-over-gap-bottom",!Ke&&U),Object(de.a)(v,"filter-node",ne&&ne(Object(d.b)(this.props))),v)),style:g,onDragEnter:Te?this.onDragEnter:void 0,onDragOver:Te?this.onDragOver:void 0,onDragLeave:Te?this.onDragLeave:void 0,onDrop:Te?this.onDrop:void 0,onDragEnd:Te?this.onDragEnd:void 0,onMouseMove:ue},Ue),L.createElement(r,{prefixCls:le,level:Ne,isStart:H,isEnd:y}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),w}(L.Component),R=function(A){return L.createElement(p.a.Consumer,null,function(w){return L.createElement(c,Object.assign({},A,{context:w}))})};R.displayName="TreeNode",R.defaultProps={title:u},R.isTreeNode=1;var O=Xe.a=R},Y1PL:function(ft,Xe,G){"use strict";G.r(Xe),G.d(Xe,"ResizableTextArea",function(){return q});var de=G("wx14"),Z=G("1OyB"),M=G("vuIU"),V=G("Ji7U"),I=G("LK+K"),B=G("q1tI"),K=G("VTBJ"),W=G("rePB"),L=G("Zm9Q"),P=G("Kwbf"),b=G("c+Xe"),p=G("m+aA"),_=G("bdgK"),h=new Map;function r(fe){fe.forEach(function(ue){var he,_e=ue.target;(he=h.get(_e))===null||he===void 0||he.forEach(function(le){return le(_e)})})}var d=new _.default(r),l=null,a=null;function u(fe,ue){h.has(fe)||(h.set(fe,new Set),d.observe(fe)),h.get(fe).add(ue)}function c(fe,ue){h.has(fe)&&(h.get(fe).delete(ue),h.get(fe).size||(d.unobserve(fe),h.delete(fe)))}var R=function(fe){Object(V.a)(he,fe);var ue=Object(I.a)(he);function he(){return Object(Z.a)(this,he),ue.apply(this,arguments)}return Object(M.a)(he,[{key:"render",value:function(){return this.props.children}}]),he}(B.Component),O=B.createContext(null);function T(fe){var ue=fe.children,he=fe.onBatchResize,_e=B.useRef(0),le=B.useRef([]),ne=B.useContext(O),Te=B.useCallback(function(Fe,Ke,Ue){_e.current+=1;var He=_e.current;le.current.push({size:Fe,element:Ke,data:Ue}),Promise.resolve().then(function(){He===_e.current&&(he==null||he(le.current),le.current=[])}),ne==null||ne(Fe,Ke,Ue)},[he,ne]);return B.createElement(O.Provider,{value:Te},ue)}function A(fe){var ue=fe.children,he=fe.disabled,_e=B.useRef(null),le=B.useRef(null),ne=B.useContext(O),Te=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Fe=B.isValidElement(ue)&&Object(b.c)(ue),Ke=Fe?ue.ref:null,Ue=B.useMemo(function(){return Object(b.a)(Ke,_e)},[Ke,_e]),He=B.useRef(fe);He.current=fe;var Ne=B.useCallback(function(Be){var Je=He.current,tt=Je.onResize,it=Je.data,rt=Be.getBoundingClientRect(),qe=rt.width,gt=rt.height,pt=Be.offsetWidth,vt=Be.offsetHeight,at=Math.floor(qe),Rt=Math.floor(gt);if(Te.current.width!==at||Te.current.height!==Rt||Te.current.offsetWidth!==pt||Te.current.offsetHeight!==vt){var xt={width:at,height:Rt,offsetWidth:pt,offsetHeight:vt};Te.current=xt;var Tt=pt===Math.round(qe)?qe:pt,Ye=vt===Math.round(gt)?gt:vt,Mt=Object(K.a)(Object(K.a)({},xt),{},{offsetWidth:Tt,offsetHeight:Ye});ne==null||ne(Mt,Be,it),tt&&Promise.resolve().then(function(){tt(Mt,Be)})}},[]);return B.useEffect(function(){var Be=Object(p.a)(_e.current)||Object(p.a)(le.current);return Be&&!he&&u(Be,Ne),function(){return c(Be,Ne)}},[_e.current,he]),B.createElement(R,{ref:le},Fe?B.cloneElement(ue,{ref:Ue}):ue)}var w="rc-observer-key";function m(fe){var ue=fe.children,he=Object(L.a)(ue);return he.map(function(_e,le){var ne=(_e==null?void 0:_e.key)||"".concat(w,"-").concat(le);return B.createElement(A,Object(de.a)({},fe,{key:ne}),_e)})}m.Collection=T;var v=m,s=G("bT9E"),o=G("TSYQ"),E=G.n(o),g=`
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
`,C=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},U;function j(fe){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=fe.getAttribute("id")||fe.getAttribute("data-reactid")||fe.getAttribute("name");if(ue&&N[he])return N[he];var _e=window.getComputedStyle(fe),le=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),ne=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),Te=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),Fe=C.map(function(Ue){return"".concat(Ue,":").concat(_e.getPropertyValue(Ue))}).join(";"),Ke={sizingStyle:Fe,paddingSize:ne,borderSize:Te,boxSizing:le};return ue&&he&&(N[he]=Ke),Ke}function H(fe){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=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)),fe.getAttribute("wrap")?U.setAttribute("wrap",fe.getAttribute("wrap")):U.removeAttribute("wrap");var le=j(fe,ue),ne=le.paddingSize,Te=le.borderSize,Fe=le.boxSizing,Ke=le.sizingStyle;U.setAttribute("style","".concat(Ke,";").concat(g)),U.value=fe.value||fe.placeholder||"";var Ue=Number.MIN_SAFE_INTEGER,He=Number.MAX_SAFE_INTEGER,Ne=U.scrollHeight,Be;if(Fe==="border-box"?Ne+=Te:Fe==="content-box"&&(Ne-=ne),he!==null||_e!==null){U.value=" ";var Je=U.scrollHeight-ne;he!==null&&(Ue=Je*he,Fe==="border-box"&&(Ue=Ue+ne+Te),Ne=Math.max(Ue,Ne)),_e!==null&&(He=Je*_e,Fe==="border-box"&&(He=He+ne+Te),Be=Ne>He?"":"hidden",Ne=Math.min(He,Ne))}return{height:Ne,minHeight:Ue,maxHeight:He,overflowY:Be,resize:"none"}}var y=G("Gytx"),x=G.n(y),F;(function(fe){fe[fe.NONE=0]="NONE",fe[fe.RESIZING=1]="RESIZING",fe[fe.RESIZED=2]="RESIZED"})(F||(F={}));var Q=function(fe){Object(V.a)(he,fe);var ue=Object(I.a)(he);function he(_e){var le;return Object(Z.a)(this,he),le=ue.call(this,_e),le.nextFrameActionId=void 0,le.resizeFrameId=void 0,le.textArea=void 0,le.saveTextArea=function(ne){le.textArea=ne},le.handleResize=function(ne){var Te=le.state.resizeStatus,Fe=le.props,Ke=Fe.autoSize,Ue=Fe.onResize;if(Te!==F.NONE)return;typeof Ue=="function"&&Ue(ne),Ke&&le.resizeOnNextFrame()},le.resizeOnNextFrame=function(){cancelAnimationFrame(le.nextFrameActionId),le.nextFrameActionId=requestAnimationFrame(le.resizeTextarea)},le.resizeTextarea=function(){var ne=le.props.autoSize;if(!ne||!le.textArea)return;var Te=ne.minRows,Fe=ne.maxRows,Ke=H(le.textArea,!1,Te,Fe);le.setState({textareaStyles:Ke,resizeStatus:F.RESIZING},function(){cancelAnimationFrame(le.resizeFrameId),le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:F.RESIZED},function(){le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:F.NONE}),le.fixFirefoxAutoScroll()})})})})},le.renderTextArea=function(){var ne=le.props,Te=ne.prefixCls,Fe=Te===void 0?"rc-textarea":Te,Ke=ne.autoSize,Ue=ne.onResize,He=ne.className,Ne=ne.disabled,Be=le.state,Je=Be.textareaStyles,tt=Be.resizeStatus,it=Object(s.a)(le.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),rt=E()(Fe,He,Object(W.a)({},"".concat(Fe,"-disabled"),Ne));"value"in it&&(it.value=it.value||"");var qe=Object(K.a)(Object(K.a)(Object(K.a)({},le.props.style),Je),tt===F.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(v,{onResize:le.handleResize,disabled:!(Ke||Ue)},B.createElement("textarea",Object(de.a)({},it,{className:rt,style:qe,ref:le.saveTextArea})))},le.state={textareaStyles:{},resizeStatus:F.NONE},le}return Object(M.a)(he,[{key:"componentDidUpdate",value:function(le){(le.value!==this.props.value||!x()(le.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 le=this.textArea.selectionStart,ne=this.textArea.selectionEnd;this.textArea.setSelectionRange(le,ne)}}catch(Te){}}},{key:"render",value:function(){return this.renderTextArea()}}]),he}(B.Component),q=Q,ie=function(fe){Object(V.a)(he,fe);var ue=Object(I.a)(he);function he(_e){var le;Object(Z.a)(this,he),le=ue.call(this,_e),le.resizableTextArea=void 0,le.focus=function(){le.resizableTextArea.textArea.focus()},le.saveTextArea=function(Te){le.resizableTextArea=Te},le.handleChange=function(Te){var Fe=le.props.onChange;le.setValue(Te.target.value,function(){le.resizableTextArea.resizeTextarea()}),Fe&&Fe(Te)},le.handleKeyDown=function(Te){var Fe=le.props,Ke=Fe.onPressEnter,Ue=Fe.onKeyDown;Te.keyCode===13&&Ke&&Ke(Te),Ue&&Ue(Te)};var ne=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return le.state={value:ne},le}return Object(M.a)(he,[{key:"setValue",value:function(le,ne){"value"in this.props||this.setState({value:le},ne)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(q,Object(de.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(le){return"value"in le?{value:le.value}:null}}]),he}(B.Component),ge=Xe.default=ie},ZW9T:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return H});var de=G("k1fw"),Z=G("miYZ"),M=G("tsqr"),V=G("rAM+"),I=G("tJVT"),B=G("PpiC"),K=G("q1tI"),W=G.n(K),L=G("bdgK"),P=G("oBTY"),b=G("9og8"),p=G("WmNS"),_=G.n(p),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},r={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},d={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},l={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},a=G("5VLF"),u=G.n(a),c={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(x,F){return F.map(function(Q){return{label:Q,kind:x.languages.CompletionItemKind.Keyword,insertText:Q}})},O=function(x){return Object.keys(c.tables).map(function(F){return{label:F,kind:x.languages.CompletionItemKind.Variable,insertText:F}})},T=function(x,F){var Q=c.tables[x];return Q?Q.map(function(q){return{label:q,kind:F.languages.CompletionItemKind.Field,insertText:q}}):[]};function A(y,x,F,Q,q){var ie=x.getWordUntilPosition(F),ge={startLineNumber:F.lineNumber,endLineNumber:F.lineNumber,startColumn:ie.startColumn,endColumn:ie.endColumn},fe=Q.map(function(ue){return{label:ue,kind:y.languages.CompletionItemKind.Keyword,insertText:ue,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}});return q.map(function(ue){fe.push(Object(de.a)(Object(de.a)({},ue),{},{range:ge}))}),fe}var w=function(y){c.languages.map(function(q){return y.languages.registerDocumentFormattingEditProvider(q,{provideDocumentFormattingEdits:function(ge,fe,ue){return Object(b.a)(_.a.mark(function he(){var _e;return _.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return _e=u()(ge.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ne.abrupt("return",[{range:ge.getFullModelRange(),text:_e}]);case 2:case"end":return ne.stop()}},he)}))()}}),q});var x=d.quickKey.map(function(q){return{label:q.label,kind:y.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),F=l.quickKey.map(function(q){return{label:q.label,kind:y.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=r.quickKey.map(function(q){return{label:q.label,kind:y.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(P.a)(d.keywords),Object(P.a)(d.quickKey.map(function(q){return q.label}))),provideCompletionItems:function(ie,ge){var fe=ie.getValueInRange({startLineNumber:ge.lineNumber,startColumn:1,endLineNumber:ge.lineNumber,endColumn:ge.column}),ue=fe.match(/cu/gim);console.log("match:",ue,ge,fe,ie);var he=[],_e=ge.lineNumber,le=ge.column,ne=ie.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:le}),Te=ne.trim().split(/\s+/),Fe=Te[Te.length-1];if(Fe.endsWith(".")){var Ke=Fe.slice(0,Fe.length-1);Object.keys(c.tables).includes(Ke)&&(he=Object(P.a)(T(Ke,y)))}else Fe==="."?he=[]:he=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,d.keywords)),Object(P.a)(x));return{suggestions:he}}}),y.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(P.a)(h.keywords)),provideCompletionItems:function(ie,ge){var fe=ie.getValueInRange({startLineNumber:ge.lineNumber,startColumn:1,endLineNumber:ge.lineNumber,endColumn:ge.column}),ue=fe.match(/cu/gim);console.log("match:",ue,ge,fe,ie);var he=[],_e=ge.lineNumber,le=ge.column,ne=ie.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:le}),Te=ne.trim().split(/\s+/),Fe=Te[Te.length-1];if(Fe.endsWith(".")){var Ke=Fe.slice(0,Fe.length-1);Object.keys(c.tables).includes(Ke)&&(he=Object(P.a)(T(Ke,y)))}else Fe==="."?he=[]:he=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,h.keywords)));return{suggestions:he}}}),y.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(P.a)(r.keywords)),provideCompletionItems:function(ie,ge){var fe=[],ue=ge.lineNumber,he=ge.column,_e=ie.getValueInRange({startLineNumber:ue,startColumn:0,endLineNumber:ue,endColumn:he}),le=_e.trim().split(/\s+/),ne=le[le.length-1];if(ne.endsWith(".")){var Te=ne.slice(0,ne.length-1);Object.keys(c.tables).includes(Te)&&(fe=Object(P.a)(T(Te,y)))}else ne==="."?fe=[]:fe=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,r.keywords)),Object(P.a)(Q));return{suggestions:fe}}}),y.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(P.a)(l.keywords)),provideCompletionItems:function(ie,ge){var fe=[],ue=ge.lineNumber,he=ge.column,_e=ie.getValueInRange({startLineNumber:ue,startColumn:0,endLineNumber:ue,endColumn:he}),le=_e.trim().split(/\s+/),ne=le[le.length-1];if(ne.endsWith(".")){var Te=ne.slice(0,ne.length-1);Object.keys(c.tables).includes(Te)&&(fe=Object(P.a)(T(Te,y)))}else ne==="."?fe=[]:fe=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,l.keywords)),Object(P.a)(F));return{suggestions:fe}}})},m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=G("LvDl"),s=G("+ua5");function o(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function E(){}var g=!1,C={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function N(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],x=y;if(Array.isArray(y)){for(var F=0;F<y.length;F++){var Q=C[y[F]];if(Q)return Q}return x[0]}return C[x]||x}var U=null,j=Xe.b=function(y){var x=y.width,F=x===void 0?"100%":x,Q=y.height,q=Q===void 0?"100%":Q,ie=y.value,ge=y.language,fe=ge===void 0?"javascript":ge,ue=y.style,he=ue===void 0?{}:ue,_e=y.options,le=_e===void 0?{}:_e,ne=y.overrideServices,Te=ne===void 0?{}:ne,Fe=y.theme,Ke=Fe===void 0?"vs-dark":Fe,Ue=y.onEditBlur,He=y.onSave,Ne=y.autoHeight,Be=Ne===void 0?!1:Ne,Je=y.forbidCopy,tt=Je===void 0?!1:Je,it=y.onChange,rt=it===void 0?E:it,qe=y.editorDidMount,gt=qe===void 0?E:qe,pt=y.onFocus,vt=pt===void 0?E:pt,at=y.filename,Rt=at===void 0?"educoder.txt":at,xt=y.errorLine,Tt=y.errorContent,Ye=Tt===void 0?"":Tt,Mt=Object(B.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),St=Object(K.useRef)(),ze=Object(K.useRef)({}),ut=Object(K.useRef)(),be=Object(K.useRef)(!1),xe=Object(K.useRef)(),pe=Object(K.useState)(!1),se=Object(I.a)(pe,2),ce=se[0],Ee=se[1];function Ae(){var Ot;return St.current&&(Ot=new L.default(function(bn){var Cn=Object(V.a)(bn),kn;try{for(Cn.s();!(kn=Cn.n()).done;){var Ai=kn.value;(Ai.target.offsetHeight>0||Ai.target.offsetWidth>0)&&ze.current.instance.layout()}}catch(Ui){Cn.e(Ui)}finally{Cn.f()}}),Ot.observe(St.current)),Ot}function De(){M.b.warn(decodeURIComponent(m))}var $e=function(){var bn=ze.current.instance;if(ie!=null&&bn&&ce){var Cn=bn.getModel();Cn&&ie!==Cn.getValue()&&(g=!0,Cn.setValue(ie),bn.layout(),g=!1)}};Object(K.useEffect)(function(){ut.current&&clearTimeout(ut.current),ut.current=setTimeout(function(){$e()},500)},[ie,ce,ze.current]),Object(K.useEffect)(function(){if(xt&&ze.current&&ze.current.instance){var Ot=ze.current.instance;Ot.changeViewZones(function(Cn){var kn=document.createElement("div");kn.style.padding="10px 20px",kn.style.width="calc(100% - 20px)",kn.className="my-error-line-wrp",kn.innerHTML=Ye,Cn.addZone({afterLineNumber:xt||11,heightInLines:3,domNode:kn})});var bn={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ot.addOverlayWidget(bn),Ot.revealPositionInCenter({lineNumber:20,column:1})}},[xt,ze.current,ce]);function lt(){var Ot=ze.current.instance;if(Ot){var bn=Ot.getSelection(),Cn=ze.current.pastePos||{},kn=new U.Range(Cn.startLineNumber||bn.endLineNumber,Cn.startColumn||bn.endColumn,Cn.endLineNumber||bn.endLineNumber,Cn.endColumn||bn.endColumn);setTimeout(function(){Ot.executeEdits("",[{range:kn,text:""}])},300)}}function Bt(Ot){(window.navigator.platform.match("Mac")?Ot.metaKey:Ot.ctrlKey)&&Ot.keyCode==83&&(Ot.preventDefault(),He())}var tn=function(){if(Be&&ze.current.instance){var bn=ze.current.instance.getContentHeight();Ri(bn<q?q:bn)}else Ri(q)};function nn(Ot){var bn=document.createEvent("MouseEvents");bn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ot.dispatchEvent(bn)}function _n(Ot,bn){var Cn=window.URL||window.webkitURL||window,kn=new Blob([bn]),Ai=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ai.href=Cn.createObjectURL(kn),Ai.download=Ot,nn(Ai)}Object(K.useEffect)(function(){tn()},[tn]),Object(K.useEffect)(function(){St.current&&!ce&&G.e(27).then(G.t.bind(null,"M/lh",7)).then(function(Ot){try{U=Ot,ze.current.instance=U.editor.create(St.current,{value:ie,language:N(fe),theme:Ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Te);var bn=ze.current.instance;if(gt(bn,U),setTimeout(function(){tn(),ze.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){_n(Rt||"educoder.txt",bn.getValue())}})},500),ze.current.subscription=bn.onDidChangeModelContent(function(kn){be.current?clearTimeout(xe.current):(tn(),rt(bn.getValue(),kn)),xe.current=setTimeout(function(){be.current=!1},500)}),window.Monaco||w(U),tt&&(bn.addCommand(U.KeyMod.CtrlCmd|U.KeyMod.Shift|U.KeyCode.KEY_V,function(){return De(),null}),bn.addCommand(U.KeyMod.CtrlCmd|U.KeyCode.KEY_C,function(){return De(),null})),window.Monaco=U,Ue&&bn.onDidBlurEditorWidget(function(){Ue(bn.getValue())}),vt&&bn.onDidFocusEditorText(function(){vt(bn.getValue())}),tt){bn.addCommand(U.KeyMod.CtrlCmd|U.KeyCode.KEY_V,function(){return De(),null}),bn.onDidPaste(function(kn){ze.current.pastePos=kn});try{window.addEventListener("paste",lt)}catch(kn){}}var Cn=Ae();return Ee(!0),function(){var kn=ze.current.instance;kn.dispose();var Ai=kn.getModel();Ai&&Ai.dispose(),ze.current.subscription&&ze.current.subscription.dispose(),tt&&window.removeEventListener("paste",lt),Cn.unobserve(St.current)}}catch(kn){}})},[]),Object(K.useEffect)(function(){var Ot=ze.current.instance;if(Ot&&ce)return document.addEventListener("keydown",Bt,!1),function(){document.removeEventListener("keydown",Bt)}},[He,ce]),Object(K.useEffect)(function(){var Ot=ze.current.instance;if(Ot&&ce){var bn=N(fe);U.editor.setModelLanguage(Ot.getModel(),bn),console.log("language:",fe,Ot.getModel(),bn)}},[fe,ce]),Object(K.useEffect)(function(){var Ot=ze.current.instance;Ot&&ce&&U.editor.setTheme(Ke)},[Ke,ce]),Object(K.useEffect)(function(){var Ot=ze.current.instance;Ot&&ce&&(Ot.updateOptions(Object(de.a)({},le)),setTimeout(function(){Ot.getModel().updateOptions(Object(de.a)({},le))},200))},[JSON.stringify(le),ce]),Object(K.useEffect)(function(){var Ot=ze.current.instance;Ot&&ce&&Ot.layout()},[F,q,ce]);var yn=Object(K.useState)(o(F)),Gt=Object(I.a)(yn,2),ii=Gt[0],Dn=Gt[1],Ci=Object(K.useState)(o(q)),fi=Object(I.a)(Ci,2),In=fi[0],Ri=fi[1],Si=Object(de.a)(Object(de.a)({},he),{},{width:ii,height:In});return W.a.createElement("div",{className:"my-monaco-editor",ref:St,style:Si})};function H(y){var x=y.width,F=x===void 0?"100%":x,Q=y.height,q=Q===void 0?"100%":Q,ie=y.original,ge=y.modified,fe=y.language,ue=y.options,he=ue===void 0?{}:ue,_e=Object(K.useRef)(),le=Object(K.useState)(null),ne=Object(I.a)(le,2),Te=ne[0],Fe=ne[1];function Ke(Be){var Je;return _e.current&&(Je=new L.default(function(tt){var it=Object(V.a)(tt),rt;try{for(it.s();!(rt=it.n()).done;){var qe=rt.value;(qe.target.offsetHeight>0||qe.target.offsetWidth>0)&&Be.layout()}}catch(gt){it.e(gt)}finally{it.f()}}),Je.observe(_e.current)),Je}Object(K.useEffect)(function(){_e.current&&G.e(27).then(G.t.bind(null,"M/lh",7)).then(function(Be){U=Be;var Je=U.editor.createDiffEditor(_e.current,Object(de.a)(Object(de.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},he),{},{wordWrap:!0}));Fe(Je);var tt=Ke(Je);return function(){Je.dispose();var it=Je.getModel();it&&it.dispose(),tt.unobserve(_e.current)}})},[]),Object(K.useEffect)(function(){Te&&Te.setModel({original:U.editor.createModel(ie,fe),modified:U.editor.createModel(ge,fe)})},[ie,ge,fe,Te]);var Ue=o(F),He=o(q),Ne={width:Ue,height:He};return W.a.createElement("div",{className:"my-diff-editor",ref:_e,style:Ne})}},ZpRC:function(ft,Xe,G){"use strict";function de(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function Z(b,p){return(!p||b!=="hidden")&&b!=="visible"&&b!=="clip"}function M(b,p){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var _=getComputedStyle(b,null);return Z(_.overflowY,p)||Z(_.overflowX,p)||function(h){var r=function(d){if(!d.ownerDocument||!d.ownerDocument.defaultView)return null;try{return d.ownerDocument.defaultView.frameElement}catch(l){return null}}(h);return!!r&&(r.clientHeight<h.scrollHeight||r.clientWidth<h.scrollWidth)}(b)}return!1}function V(b,p,_,h,r,d,l,a){return d<b&&l>p||d>b&&l<p?0:d<=b&&a<=_||l>=p&&a>=_?d-b-h:l>p&&a<_||d<b&&a>_?l-p+r:0}var I=function(b,p){var _=window,h=p.scrollMode,r=p.block,d=p.inline,l=p.boundary,a=p.skipOverflowHiddenElements,u=typeof l=="function"?l:function(Je){return Je!==l};if(!de(b))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,R=[],O=b;de(O)&&u(O);){if((O=O.parentElement)===c){R.push(O);break}O!=null&&O===document.body&&M(O)&&!M(document.documentElement)||O!=null&&M(O,a)&&R.push(O)}for(var T=_.visualViewport?_.visualViewport.width:innerWidth,A=_.visualViewport?_.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,v=b.getBoundingClientRect(),s=v.height,o=v.width,E=v.top,g=v.right,C=v.bottom,N=v.left,U=r==="start"||r==="nearest"?E:r==="end"?C:E+s/2,j=d==="center"?N+o/2:d==="end"?g:N,H=[],y=0;y<R.length;y++){var x=R[y],F=x.getBoundingClientRect(),Q=F.height,q=F.width,ie=F.top,ge=F.right,fe=F.bottom,ue=F.left;if(h==="if-needed"&&E>=0&&N>=0&&C<=A&&g<=T&&E>=ie&&C<=fe&&N>=ue&&g<=ge)return H;var he=getComputedStyle(x),_e=parseInt(he.borderLeftWidth,10),le=parseInt(he.borderTopWidth,10),ne=parseInt(he.borderRightWidth,10),Te=parseInt(he.borderBottomWidth,10),Fe=0,Ke=0,Ue="offsetWidth"in x?x.offsetWidth-x.clientWidth-_e-ne:0,He="offsetHeight"in x?x.offsetHeight-x.clientHeight-le-Te:0;if(c===x)Fe=r==="start"?U:r==="end"?U-A:r==="nearest"?V(m,m+A,A,le,Te,m+U,m+U+s,s):U-A/2,Ke=d==="start"?j:d==="center"?j-T/2:d==="end"?j-T:V(w,w+T,T,_e,ne,w+j,w+j+o,o),Fe=Math.max(0,Fe+m),Ke=Math.max(0,Ke+w);else{Fe=r==="start"?U-ie-le:r==="end"?U-fe+Te+He:r==="nearest"?V(ie,fe,Q,le,Te+He,U,U+s,s):U-(ie+Q/2)+He/2,Ke=d==="start"?j-ue-_e:d==="center"?j-(ue+q/2)+Ue/2:d==="end"?j-ge+ne+Ue:V(ue,ge,q,_e,ne+Ue,j,j+o,o);var Ne=x.scrollLeft,Be=x.scrollTop;U+=Be-(Fe=Math.max(0,Math.min(Be+Fe,x.scrollHeight-Q+He))),j+=Ne-(Ke=Math.max(0,Math.min(Ne+Ke,x.scrollWidth-q+Ue)))}H.push({el:x,top:Fe,left:Ke})}return H};function B(b){return b===Object(b)&&Object.keys(b).length!==0}function K(b,p){p===void 0&&(p="auto");var _="scrollBehavior"in document.body.style;b.forEach(function(h){var r=h.el,d=h.top,l=h.left;r.scroll&&_?r.scroll({top:d,left:l,behavior:p}):(r.scrollTop=d,r.scrollLeft=l)})}function W(b){return b===!1?{block:"end",inline:"nearest"}:B(b)?b:{block:"start",inline:"nearest"}}function L(b,p){var _=!b.ownerDocument.documentElement.contains(b);if(B(p)&&typeof p.behavior=="function")return p.behavior(_?[]:I(b,p));if(_)return;var h=W(p);return K(I(b,h),h.behavior)}var P=Xe.a=L},"a+yL":function(ft,Xe,G){ft.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return Z});var de=G("VTBJ");function Z(M,V){var I=Object(de.a)({},M);return Array.isArray(V)&&V.forEach(function(B){delete I[B]}),I}},c5Ni:function(ft,Xe,G){},d5o6:function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___2-Tej",flex_space_between:"flex_space_between___1Q3vH",flex_box_vertical_center:"flex_box_vertical_center___2x9ha",flex_box_center_end:"flex_box_center_end___1fvRI",flex_box_column:"flex_box_column___2RmOE",addModal:"addModal___2Pv06",row:"row___2XmSi",label:"label___1L8pt"}},dejd:function(ft,Xe,G){},dmUQ:function(ft,Xe,G){"use strict";var de=G("Ff2n"),Z=G("rePB"),M=G("1OyB"),V=G("vuIU"),I=G("Ji7U"),B=G("md7G"),K=G("foSv"),W=G("q1tI"),L=G.n(W),P=G("TSYQ"),b=G.n(P),p=G("4IlW");function _(s,o){var E=Object.keys(s);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(s);o&&(g=g.filter(function(C){return Object.getOwnPropertyDescriptor(s,C).enumerable})),E.push.apply(E,g)}return E}function h(s){for(var o=1;o<arguments.length;o++){var E=arguments[o]!=null?arguments[o]:{};o%2?_(Object(E),!0).forEach(function(g){Object(Z.a)(s,g,E[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(E)):_(Object(E)).forEach(function(g){Object.defineProperty(s,g,Object.getOwnPropertyDescriptor(E,g))})}return s}function r(s){var o=d();return function(){var g=Object(K.a)(s),C;if(o){var N=Object(K.a)(this).constructor;C=Reflect.construct(g,arguments,N)}else C=g.apply(this,arguments);return Object(B.a)(this,C)}}function d(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(s){return!1}}function l(){}function a(s){s.preventDefault()}var u=function(o){return o.replace(/[^\w.-]+/g,"")},c=200,R=600,O=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(o){return o!=null},A=function(o,E){return E===o||typeof E=="number"&&typeof o=="number"&&isNaN(E)&&isNaN(o)},w=function(s){Object(I.a)(E,s);var o=r(E);function E(g){var C;Object(M.a)(this,E),C=o.call(this,g),C.onKeyDown=function(j){var H=C.props,y=H.onKeyDown,x=H.onPressEnter;if(j.keyCode===p.a.UP){var F=C.getRatio(j);C.up(j,F,null),C.stop()}else if(j.keyCode===p.a.DOWN){var Q=C.getRatio(j);C.down(j,Q,null),C.stop()}else j.keyCode===p.a.ENTER&&x&&x(j);if(C.recordCursorPosition(),C.lastKeyCode=j.keyCode,y){for(var q=arguments.length,ie=new Array(q>1?q-1:0),ge=1;ge<q;ge++)ie[ge-1]=arguments[ge];y.apply(void 0,[j].concat(ie))}},C.onKeyUp=function(j){var H=C.props.onKeyUp;if(C.stop(),C.recordCursorPosition(),H){for(var y=arguments.length,x=new Array(y>1?y-1:0),F=1;F<y;F++)x[F-1]=arguments[F];H.apply(void 0,[j].concat(x))}},C.onChange=function(j){var H=C.props.onChange;C.state.focused&&(C.inputting=!0),C.rawInput=C.props.parser(C.getValueFromEvent(j)),C.setState({inputValue:C.rawInput}),H(C.toNumber(C.rawInput))},C.onMouseUp=function(){var j=C.props.onMouseUp;C.recordCursorPosition(),j&&j.apply(void 0,arguments)},C.onFocus=function(){var j;C.setState({focused:!0}),(j=C.props).onFocus.apply(j,arguments)},C.onBlur=function(){var j=C.props.onBlur;C.inputting=!1,C.setState({focused:!1});var H=C.getCurrentValidValue(C.state.inputValue),y=C.setValue(H,l);if(j){var x=C.input.value,F=C.getInputDisplayValue({focus:!1,value:y});C.input.value=F&&Number(F),j.apply(void 0,arguments),C.input.value=x}},C.getRatio=function(j){var H=1;return j.metaKey||j.ctrlKey?H=.1:j.shiftKey&&(H=10),H},C.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},C.getPrecision=function(j){if(T(C.props.precision))return C.props.precision;var H=String(j);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var y=0;return H.indexOf(".")>=0&&(y=H.length-H.indexOf(".")-1),y},C.getInputDisplayValue=function(j){var H=j||C.state,y=H.focused,x=H.inputValue,F=H.value,Q;y?Q=x:Q=C.toPrecisionAsStep(F),Q==null&&(Q="");var q=C.formatWrapper(Q);return T(C.props.decimalSeparator)&&(q=q.toString().replace(".",C.props.decimalSeparator)),q},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(j){}},C.restoreByAfter=function(j){if(j===void 0)return!1;var H=C.input.value,y=H.lastIndexOf(j);if(y===-1)return!1;var x=C.cursorBefore.length;return C.lastKeyCode===p.a.DELETE&&C.cursorBefore.charAt(x-1)===j[0]?(C.fixCaret(x,x),!0):y+j.length===H.length?(C.fixCaret(y,y),!0):!1},C.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(H,y){var x=j.substring(y);return C.restoreByAfter(x)})},C.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(j,H,y){C.pressingUpOrDown=!0,C.step("down",j,H,y)},C.up=function(j,H,y){C.pressingUpOrDown=!0,C.step("up",j,H,y)},C.saveInput=function(j){C.input=j};var N=g.value;N===void 0&&(N=g.defaultValue),C.state={focused:g.autoFocus};var U=C.getValidValue(C.toNumber(N));return C.state=h(h({},C.state),{},{inputValue:C.toPrecisionAsStep(U),value:U}),C}return Object(V.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var N=this.props,U=N.value,j=N.onChange,H=N.max,y=N.min,x=this.state.focused;if(C){if(!A(C.value,U)||!A(C.max,H)||!A(C.min,y)){var F=x?U:this.getValidValue(U),Q;this.pressingUpOrDown?Q=F:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(F),this.setState({value:F,inputValue:Q})}var q="value"in this.props?U:this.state.value;"max"in this.props&&C.max!==H&&typeof q=="number"&&q>H&&j&&j(H),"min"in this.props&&C.min!==y&&typeof q=="number"&&q<y&&j&&j(y)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ie=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?ie=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(ie=this.cursorStart):ie=this.input.value.length,this.fixCaret(ie,ie)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ge){}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(C){var N=C;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(C){var N=C.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(C){var N=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(C);return isNaN(j)?C:(j<N&&(j=N),j>U&&(j=U),j)}},{key:"setValue",value:function(C,N){var U=this.props.precision,j=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),H=this.state.value,y=H===void 0?null:H,x=this.state.inputValue,F=x===void 0?null:x,Q=typeof j=="number"?j.toFixed(U):"".concat(j),q=j!==y||Q!=="".concat(F);return"value"in this.props?(F=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:F},N)):this.setState({value:j,inputValue:this.toPrecisionAsStep(C)},N),q&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,j=U.precision,H=U.step;if(T(j))return j;var y=this.getPrecision(N),x=this.getPrecision(H),F=this.getPrecision(C);return C?Math.max(F,y+x):y+x}},{key:"getPrecisionFactor",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(C,N);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(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var N=Math.abs(this.getMaxPrecision(C));return isNaN(N)?C.toString():Number(C).toFixed(N)}},{key:"toNumber",value:function(C){var N=this.props.precision,U=this.state.focused,j=C&&C.length>16&&U;return this.isNotCompleteNumber(C)||j?C:T(N)?Math.round(C*Math.pow(10,N))/Math.pow(10,N):Number(C)}},{key:"upStep",value:function(C,N){var U=this.props.step,j=this.getPrecisionFactor(C,N),H=Math.abs(this.getMaxPrecision(C,N)),y=((j*C+j*U*N)/j).toFixed(H);return this.toNumber(y)}},{key:"downStep",value:function(C,N){var U=this.props.step,j=this.getPrecisionFactor(C,N),H=Math.abs(this.getMaxPrecision(C,N)),y=((j*C-j*U*N)/j).toFixed(H);return this.toNumber(y)}},{key:"step",value:function(C,N){var U=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var y=this.props;if(y.disabled)return;var x=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(x))return;var F=this["".concat(C,"Step")](x,j),Q=F>y.max||F<y.min;if(F>y.max?F=y.max:F<y.min&&(F=y.min),this.setValue(F,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),Q)return;this.autoStepTimer=setTimeout(function(){U[C](N,j,!0)},H?c:R)}},{key:"fixCaret",value:function(C,N){if(C===void 0||N===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,j=this.input.selectionEnd;(C!==U||N!==j)&&this.input.setSelectionRange(C,N)}catch(H){}}},{key:"render",value:function(){var C,N=this.props,U=N.prefixCls,j=N.disabled,H=N.readOnly,y=N.useTouch,x=N.autoComplete,F=N.upHandler,Q=N.downHandler,q=N.className,ie=N.max,ge=N.min,fe=N.style,ue=N.title,he=N.onMouseEnter,_e=N.onMouseLeave,le=N.onMouseOver,ne=N.onMouseOut,Te=N.required,Fe=N.onClick,Ke=N.tabIndex,Ue=N.type,He=N.placeholder,Ne=N.id,Be=N.inputMode,Je=N.pattern,tt=N.step,it=N.maxLength,rt=N.autoFocus,qe=N.name,gt=N.onPaste,pt=N.onInput,vt=Object(de.a)(N,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),at=this.state,Rt=at.value,xt=at.focused,Tt=b()(U,(C={},Object(Z.a)(C,q,!!q),Object(Z.a)(C,"".concat(U,"-disabled"),j),Object(Z.a)(C,"".concat(U,"-focused"),xt),C)),Ye={};Object.keys(vt).forEach(function(Ae){(Ae.substr(0,5)==="data-"||Ae.substr(0,5)==="aria-"||Ae==="role")&&(Ye[Ae]=vt[Ae])});var Mt=!H&&!j,St=this.getInputDisplayValue(null),ze=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)>=ie),ut=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)<=ge),be=ze||j||H,xe=ut||j||H,pe=b()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(Z.a)({},"".concat(U,"-handler-up-disabled"),be)),se=b()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(Z.a)({},"".concat(U,"-handler-down-disabled"),xe)),ce=y?{onTouchStart:be?l:this.up,onTouchEnd:this.stop}:{onMouseDown:be?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ee=y?{onTouchStart:xe?l:this.down,onTouchEnd:this.stop}:{onMouseDown:xe?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return L.a.createElement("div",{className:Tt,style:fe,title:ue,onMouseEnter:he,onMouseLeave:_e,onMouseOver:le,onMouseOut:ne,onFocus:function(){return null},onBlur:function(){return null}},L.a.createElement("div",{className:"".concat(U,"-handler-wrap")},L.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Increase Value","aria-disabled":be,className:pe}),F||L.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:a})),L.a.createElement("span",Object.assign({unselectable:"on"},Ee,{role:"button","aria-label":"Decrease Value","aria-disabled":xe,className:se}),Q||L.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:a}))),L.a.createElement("div",{className:"".concat(U,"-input-wrap")},L.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ge,"aria-valuemax":ie,"aria-valuenow":Rt,required:Te,type:Ue,placeholder:He,onPaste:gt,onClick:Fe,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:Ke,autoComplete:x,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Mt?this.onKeyDown:l,onKeyUp:Mt?this.onKeyUp:l,autoFocus:rt,maxLength:it,readOnly:H,disabled:j,max:ie,min:ge,step:tt,name:qe,title:ue,id:Ne,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(St),pattern:Je,inputMode:Be,onInput:pt},Ye))))}}]),E}(L.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:O,min:-O,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:u,required:!1,autoComplete:"off"};var m=w,v=Xe.a=m},fAei:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return c.a});var de=G("rePB"),Z=G("VTBJ"),M=G("KQm4"),V=G("1OyB"),I=G("vuIU"),B=G("Ji7U"),K=G("LK+K"),W=G("q1tI"),L=G("4IlW"),P=G("Kwbf"),b=G("TSYQ"),p=G.n(b),_=G("sboe"),h=G("OZM5"),r=G("815F"),d=G("ODXe"),l=G("Ff2n"),a=G("+nKL"),u=G("8XRh"),c=G("WaYH"),R=function(ge,fe){var ue=ge.className,he=ge.style,_e=ge.motion,le=ge.motionNodes,ne=ge.motionType,Te=ge.onMotionStart,Fe=ge.onMotionEnd,Ke=ge.active,Ue=ge.treeNodeRequiredProps,He=Object(l.a)(ge,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Ne=W.useState(!0),Be=Object(d.a)(Ne,2),Je=Be[0],tt=Be[1],it=W.useContext(_.a),rt=it.prefixCls,qe=W.useRef(!1),gt=function(){qe.current||Fe(),qe.current=!0};return Object(W.useEffect)(function(){le&&ne==="hide"&&Je&&tt(!1)},[le]),Object(W.useEffect)(function(){return le&&Te(),function(){le&&gt()}},[]),le?W.createElement(u.default,Object.assign({ref:fe,visible:Je},_e,{motionAppear:ne==="show",onAppearEnd:gt,onLeaveEnd:gt}),function(pt,vt){var at=pt.className,Rt=pt.style;return W.createElement("div",{ref:vt,className:p()("".concat(rt,"-treenode-motion"),at),style:Rt},le.map(function(xt){var Tt=xt.data,Ye=Tt.key,Mt=Object(l.a)(Tt,["key"]),St=xt.isStart,ze=xt.isEnd;delete Mt.children;var ut=Object(r.f)(Ye,Ue);return W.createElement(c.a,Object.assign({},Mt,ut,{active:Ke,data:xt.data,key:Ye,isStart:St,isEnd:ze}))}))}):W.createElement(c.a,Object.assign({domRef:fe,className:ue,style:he},He,{active:Ke}))};R.displayName="MotionTreeNode";var O=W.forwardRef(R),T=O;function A(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],fe=ie.length,ue=ge.length;if(Math.abs(fe-ue)!==1)return{add:!1,key:null};function he(_e,le){var ne=new Map;_e.forEach(function(Fe){ne.set(Fe,!0)});var Te=le.filter(function(Fe){return!ne.has(Fe)});return Te.length===1?Te[0]:null}return fe<ue?{add:!0,key:he(ie,ge)}:{add:!1,key:he(ge,ie)}}function w(ie,ge,fe){var ue=ie.findIndex(function(ne){var Te=ne.data;return Te.key===fe}),he=ie[ue+1],_e=ge.findIndex(function(ne){var Te=ne.data;return Te.key===fe});if(he){var le=ge.findIndex(function(ne){var Te=ne.data;return Te.key===he.data.key});return ge.slice(_e+1,le)}return ge.slice(_e+1)}var m={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},v=function(){},s="RC_TREE_MOTION_".concat(Math.random()),o={key:s},E={key:s,level:0,index:0,pos:"0",node:o},g={parent:null,children:[],pos:E.pos,data:o,isStart:[],isEnd:[]};function C(ie,ge,fe,ue){return ge===!1||!fe?ie:ie.slice(0,Math.ceil(fe/ue)+1)}function N(ie){var ge=ie.data.key,fe=ie.pos;return Object(r.e)(ge,fe)}function U(ie){for(var ge=String(ie.data.key),fe=ie;fe.parent;)fe=fe.parent,ge="".concat(fe.data.key," > ").concat(ge);return ge}var j=function(ge,fe){var ue=ge.prefixCls,he=ge.data,_e=ge.selectable,le=ge.checkable,ne=ge.expandedKeys,Te=ge.selectedKeys,Fe=ge.checkedKeys,Ke=ge.loadedKeys,Ue=ge.loadingKeys,He=ge.halfCheckedKeys,Ne=ge.keyEntities,Be=ge.disabled,Je=ge.dragging,tt=ge.dragOverNodeKey,it=ge.dropPosition,rt=ge.motion,qe=ge.height,gt=ge.itemHeight,pt=ge.virtual,vt=ge.focusable,at=ge.activeItem,Rt=ge.focused,xt=ge.tabIndex,Tt=ge.onKeyDown,Ye=ge.onFocus,Mt=ge.onBlur,St=ge.onActiveChange,ze=ge.onListChangeStart,ut=ge.onListChangeEnd,be=Object(l.a)(ge,["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"]),xe=W.useRef(null);W.useImperativeHandle(fe,function(){return{scrollTo:function(kn){xe.current.scrollTo(kn)}}});var pe=W.useState(ne),se=Object(d.a)(pe,2),ce=se[0],Ee=se[1],Ae=W.useState(he),De=Object(d.a)(Ae,2),$e=De[0],lt=De[1],Bt=W.useState(he),tn=Object(d.a)(Bt,2),nn=tn[0],_n=tn[1],yn=W.useState([]),Gt=Object(d.a)(yn,2),ii=Gt[0],Dn=Gt[1],Ci=W.useState(null),fi=Object(d.a)(Ci,2),In=fi[0],Ri=fi[1];function Si(){lt(he),_n(he),Dn([]),Ri(null),ut()}W.useEffect(function(){Ee(ne);var Cn=A(ce,ne);if(Cn.key!==null)if(Cn.add){var kn=$e.findIndex(function(qi){var hr=qi.data.key;return hr===Cn.key}),Ai=C(w($e,he,Cn.key),pt,qe,gt),Ui=$e.slice();Ui.splice(kn+1,0,g),_n(Ui),Dn(Ai),Ri("show")}else{var dr=he.findIndex(function(qi){var hr=qi.data.key;return hr===Cn.key}),mn=C(w(he,$e,Cn.key),pt,qe,gt),Jt=he.slice();Jt.splice(dr+1,0,g),_n(Jt),Dn(mn),Ri("hide")}else $e!==he&&(lt(he),_n(he))},[ne,he]),W.useEffect(function(){Je||Si()},[Je]);var Ot=rt?nn:he,bn={expandedKeys:ne,selectedKeys:Te,loadedKeys:Ke,loadingKeys:Ue,checkedKeys:Fe,halfCheckedKeys:He,dragOverNodeKey:tt,dropPosition:it,keyEntities:Ne};return W.createElement(W.Fragment,null,Rt&&at&&W.createElement("span",{style:m,"aria-live":"assertive"},U(at)),W.createElement("div",{role:"tree"},W.createElement("input",{style:m,disabled:vt===!1||Be,tabIndex:vt!==!1?xt:null,onKeyDown:Tt,onFocus:Ye,onBlur:Mt,value:"",onChange:v})),W.createElement(a.a,Object.assign({},be,{data:Ot,itemKey:N,height:qe,fullHeight:!1,virtual:pt,itemHeight:gt,prefixCls:"".concat(ue,"-list"),ref:xe}),function(Cn){var kn=Cn.pos,Ai=Cn.data,Ui=Ai.key,dr=Object(l.a)(Ai,["key"]),mn=Cn.isStart,Jt=Cn.isEnd,qi=Object(r.e)(Ui,kn);delete dr.children;var hr=Object(r.f)(qi,bn);return W.createElement(T,Object.assign({},dr,hr,{active:at&&Ui===at.data.key,pos:kn,data:Cn.data,isStart:mn,isEnd:Jt,motion:rt,motionNodes:Ui===s?ii:null,motionType:In,onMotionStart:ze,onMotionEnd:Si,treeNodeRequiredProps:bn,onMouseMove:function(){St(null)}}))}))},H=W.forwardRef(j);H.displayName="NodeList";var y=H,x=G("NvD2"),F=function(ie){Object(B.a)(fe,ie);var ge=Object(K.a)(fe);function fe(){var ue;return Object(V.a)(this,fe),ue=ge.apply(this,arguments),ue.destroyed=!1,ue.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},ue.listRef=W.createRef(),ue.onNodeDragStart=function(he,_e){var le=ue.state,ne=le.expandedKeys,Te=le.keyEntities,Fe=ue.props.onDragStart,Ke=_e.props.eventKey;ue.dragNode=_e;var Ue=Object(h.b)(ne,Ke);ue.setState({dragging:!0,dragNodesKeys:Object(h.g)(Ke,Te)}),ue.setExpandedKeys(Ue),Fe&&Fe({event:he,node:Object(r.b)(_e.props)})},ue.onNodeDragEnter=function(he,_e){var le=ue.state,ne=le.expandedKeys,Te=le.keyEntities,Fe=le.dragNodesKeys,Ke=ue.props.onDragEnter,Ue=_e.props,He=Ue.pos,Ne=Ue.eventKey;if(!ue.dragNode||Fe.indexOf(Ne)!==-1)return;var Be=Object(h.c)(he,_e);if(ue.dragNode.props.eventKey===Ne&&Be===0){ue.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ue.setState({dragOverNodeKey:Ne,dropPosition:Be}),ue.delayedDragEnterLogic||(ue.delayedDragEnterLogic={}),Object.keys(ue.delayedDragEnterLogic).forEach(function(Je){clearTimeout(ue.delayedDragEnterLogic[Je])}),ue.delayedDragEnterLogic[He]=window.setTimeout(function(){if(!ue.state.dragging)return;var Je=Object(M.a)(ne),tt=Te[Ne];tt&&(tt.children||[]).length&&(Je=Object(h.a)(ne,Ne)),"expandedKeys"in ue.props||ue.setExpandedKeys(Je),Ke&&Ke({event:he,node:Object(r.b)(_e.props),expandedKeys:Je})},400)},0)},ue.onNodeDragOver=function(he,_e){var le=ue.state.dragNodesKeys,ne=ue.props.onDragOver,Te=_e.props.eventKey;if(le.indexOf(Te)!==-1)return;if(ue.dragNode&&Te===ue.state.dragOverNodeKey){var Fe=Object(h.c)(he,_e);if(Fe===ue.state.dropPosition)return;ue.setState({dropPosition:Fe})}ne&&ne({event:he,node:Object(r.b)(_e.props)})},ue.onNodeDragLeave=function(he,_e){var le=ue.props.onDragLeave;ue.setState({dragOverNodeKey:""}),le&&le({event:he,node:Object(r.b)(_e.props)})},ue.onNodeDragEnd=function(he,_e){var le=ue.props.onDragEnd;ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),le&&le({event:he,node:Object(r.b)(_e.props)}),ue.dragNode=null},ue.onNodeDrop=function(he,_e){var le=ue.state,ne=le.dragNodesKeys,Te=ne===void 0?[]:ne,Fe=le.dropPosition,Ke=ue.props.onDrop,Ue=_e.props,He=Ue.eventKey,Ne=Ue.pos;if(ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),Te.indexOf(He)!==-1){Object(P.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Be=Object(h.k)(Ne),Je={event:he,node:Object(r.b)(_e.props),dragNode:ue.dragNode?Object(r.b)(ue.dragNode.props):null,dragNodesKeys:Te.slice(),dropPosition:Fe+Number(Be[Be.length-1]),dropToGap:!1};Fe!==0&&(Je.dropToGap=!0),Ke&&Ke(Je),ue.dragNode=null},ue.cleanDragState=function(){var he=ue.state.dragging;he&&ue.setState({dragging:!1})},ue.onNodeClick=function(he,_e){var le=ue.props.onClick;le&&le(he,_e)},ue.onNodeDoubleClick=function(he,_e){var le=ue.props.onDoubleClick;le&&le(he,_e)},ue.onNodeSelect=function(he,_e){var le=ue.state.selectedKeys,ne=ue.state.keyEntities,Te=ue.props,Fe=Te.onSelect,Ke=Te.multiple,Ue=_e.selected,He=_e.key,Ne=!Ue;Ne?Ke?le=Object(h.a)(le,He):le=[He]:le=Object(h.b)(le,He);var Be=le.map(function(Je){var tt=ne[Je];return tt?tt.node:null}).filter(function(Je){return Je});ue.setUncontrolledState({selectedKeys:le}),Fe&&Fe(le,{event:"select",selected:Ne,node:_e,selectedNodes:Be,nativeEvent:he.nativeEvent})},ue.onNodeCheck=function(he,_e,le){var ne=ue.state,Te=ne.keyEntities,Fe=ne.checkedKeys,Ke=ne.halfCheckedKeys,Ue=ue.props,He=Ue.checkStrictly,Ne=Ue.onCheck,Be=_e.key,Je,tt={event:"check",node:_e,checked:le,nativeEvent:he.nativeEvent};if(He){var it=le?Object(h.a)(Fe,Be):Object(h.b)(Fe,Be),rt=Object(h.b)(Ke,Be);Je={checked:it,halfChecked:rt},tt.checkedNodes=it.map(function(Rt){return Te[Rt]}).filter(function(Rt){return Rt}).map(function(Rt){return Rt.node}),ue.setUncontrolledState({checkedKeys:it})}else{var qe=Object(x.a)([].concat(Object(M.a)(Fe),[Be]),!0,Te),gt=qe.checkedKeys,pt=qe.halfCheckedKeys;if(!le){var vt=new Set(gt);vt.delete(Be);var at=Object(x.a)(Array.from(vt),{checked:!1,halfCheckedKeys:pt},Te);gt=at.checkedKeys,pt=at.halfCheckedKeys}Je=gt,tt.checkedNodes=[],tt.checkedNodesPositions=[],tt.halfCheckedKeys=pt,gt.forEach(function(Rt){var xt=Te[Rt];if(!xt)return;var Tt=xt.node,Ye=xt.pos;tt.checkedNodes.push(Tt),tt.checkedNodesPositions.push({node:Tt,pos:Ye})}),ue.setUncontrolledState({checkedKeys:gt},!1,{halfCheckedKeys:pt})}Ne&&Ne(Je,tt)},ue.onNodeLoad=function(he){return new Promise(function(_e){ue.setState(function(le){var ne=le.loadedKeys,Te=ne===void 0?[]:ne,Fe=le.loadingKeys,Ke=Fe===void 0?[]:Fe,Ue=ue.props,He=Ue.loadData,Ne=Ue.onLoad,Be=he.key;if(!He||Te.indexOf(Be)!==-1||Ke.indexOf(Be)!==-1)return{};var Je=He(he);return Je.then(function(){var tt=ue.state,it=tt.loadedKeys,rt=tt.loadingKeys,qe=Object(h.a)(it,Be),gt=Object(h.b)(rt,Be);Ne&&Ne(qe,{event:"load",node:he}),ue.setUncontrolledState({loadedKeys:qe}),ue.setState({loadingKeys:gt}),_e()}),{loadingKeys:Object(h.a)(Ke,Be)}})})},ue.onNodeMouseEnter=function(he,_e){var le=ue.props.onMouseEnter;le&&le({event:he,node:_e})},ue.onNodeMouseLeave=function(he,_e){var le=ue.props.onMouseLeave;le&&le({event:he,node:_e})},ue.onNodeContextMenu=function(he,_e){var le=ue.props.onRightClick;le&&(he.preventDefault(),le({event:he,node:_e}))},ue.onFocus=function(){var he=ue.props.onFocus;ue.setState({focused:!0}),he&&he.apply(void 0,arguments)},ue.onBlur=function(){var he=ue.props.onBlur;ue.setState({focused:!1}),ue.onActiveChange(null),he&&he.apply(void 0,arguments)},ue.getTreeNodeRequiredProps=function(){var he=ue.state,_e=he.expandedKeys,le=he.selectedKeys,ne=he.loadedKeys,Te=he.loadingKeys,Fe=he.checkedKeys,Ke=he.halfCheckedKeys,Ue=he.dragOverNodeKey,He=he.dropPosition,Ne=he.keyEntities;return{expandedKeys:_e||[],selectedKeys:le||[],loadedKeys:ne||[],loadingKeys:Te||[],checkedKeys:Fe||[],halfCheckedKeys:Ke||[],dragOverNodeKey:Ue,dropPosition:He,keyEntities:Ne}},ue.setExpandedKeys=function(he){var _e=ue.state.treeData,le=Object(r.d)(_e,he);ue.setUncontrolledState({expandedKeys:he,flattenNodes:le},!0)},ue.onNodeExpand=function(he,_e){var le=ue.state.expandedKeys,ne=ue.state.listChanging,Te=ue.props,Fe=Te.onExpand,Ke=Te.loadData,Ue=_e.key,He=_e.expanded;if(ne)return;var Ne=le.indexOf(Ue),Be=!He;if(Object(P.a)(He&&Ne!==-1||!He&&Ne===-1,"Expand state not sync with index check"),Be?le=Object(h.a)(le,Ue):le=Object(h.b)(le,Ue),ue.setExpandedKeys(le),Fe&&Fe(le,{node:_e,expanded:Be,nativeEvent:he.nativeEvent}),Be&&Ke){var Je=ue.onNodeLoad(_e);Je&&Je.then(function(){var tt=Object(r.d)(ue.state.treeData,le);ue.setUncontrolledState({flattenNodes:tt})})}},ue.onListChangeStart=function(){ue.setUncontrolledState({listChanging:!0})},ue.onListChangeEnd=function(){setTimeout(function(){ue.setUncontrolledState({listChanging:!1})})},ue.onActiveChange=function(he){var _e=ue.state.activeKey,le=ue.props.onActiveChange;if(_e===he)return;ue.setState({activeKey:he}),he!==null&&ue.scrollTo({key:he}),le&&le(he)},ue.getActiveItem=function(){var he=ue.state,_e=he.activeKey,le=he.flattenNodes;return _e===null?null:le.find(function(ne){var Te=ne.data.key;return Te===_e})||null},ue.offsetActiveKey=function(he){var _e=ue.state,le=_e.flattenNodes,ne=_e.activeKey,Te=le.findIndex(function(Ue){var He=Ue.data.key;return He===ne});Te===-1&&he<0&&(Te=le.length),Te=(Te+he+le.length)%le.length;var Fe=le[Te];if(Fe){var Ke=Fe.data.key;ue.onActiveChange(Ke)}else ue.onActiveChange(null)},ue.onKeyDown=function(he){var _e=ue.state,le=_e.activeKey,ne=_e.expandedKeys,Te=_e.checkedKeys,Fe=ue.props,Ke=Fe.onKeyDown,Ue=Fe.checkable,He=Fe.selectable;switch(he.which){case L.a.UP:{ue.offsetActiveKey(-1),he.preventDefault();break}case L.a.DOWN:{ue.offsetActiveKey(1),he.preventDefault();break}}var Ne=ue.getActiveItem();if(Ne&&Ne.data){var Be=ue.getTreeNodeRequiredProps(),Je=Ne.data.isLeaf===!1||!!(Ne.data.children||[]).length,tt=Object(r.b)(Object(Z.a)(Object(Z.a)({},Object(r.f)(le,Be)),{},{data:Ne.data,active:!0}));switch(he.which){case L.a.LEFT:{Je&&ne.includes(le)?ue.onNodeExpand({},tt):Ne.parent&&ue.onActiveChange(Ne.parent.data.key),he.preventDefault();break}case L.a.RIGHT:{Je&&!ne.includes(le)?ue.onNodeExpand({},tt):Ne.children&&Ne.children.length&&ue.onActiveChange(Ne.children[0].data.key),he.preventDefault();break}case L.a.ENTER:case L.a.SPACE:{Ue&&!tt.disabled&&tt.checkable!==!1&&!tt.disableCheckbox?ue.onNodeCheck({},tt,!Te.includes(le)):!Ue&&He&&!tt.disabled&&tt.selectable!==!1&&ue.onNodeSelect({},tt);break}}}Ke&&Ke(he)},ue.setUncontrolledState=function(he){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ue.destroyed)return;var ne=!1,Te=!0,Fe={};Object.keys(he).forEach(function(Ke){if(Ke in ue.props){Te=!1;return}ne=!0,Fe[Ke]=he[Ke]}),ne&&(!_e||Te)&&ue.setState(Object(Z.a)(Object(Z.a)({},Fe),le))},ue.scrollTo=function(he){ue.listRef.current.scrollTo(he)},ue}return Object(I.a)(fe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var he,_e=this.state,le=_e.focused,ne=_e.flattenNodes,Te=_e.keyEntities,Fe=_e.dragging,Ke=_e.activeKey,Ue=this.props,He=Ue.prefixCls,Ne=Ue.className,Be=Ue.style,Je=Ue.showLine,tt=Ue.focusable,it=Ue.tabIndex,rt=it===void 0?0:it,qe=Ue.selectable,gt=Ue.showIcon,pt=Ue.icon,vt=Ue.switcherIcon,at=Ue.draggable,Rt=Ue.checkable,xt=Ue.checkStrictly,Tt=Ue.disabled,Ye=Ue.motion,Mt=Ue.loadData,St=Ue.filterTreeNode,ze=Ue.height,ut=Ue.itemHeight,be=Ue.virtual,xe=Ue.titleRender,pe=Ue.onContextMenu,se=Object(h.f)(this.props);return W.createElement(_.a.Provider,{value:{prefixCls:He,selectable:qe,showIcon:gt,icon:pt,switcherIcon:vt,draggable:at,checkable:Rt,checkStrictly:xt,disabled:Tt,keyEntities:Te,loadData:Mt,filterTreeNode:St,titleRender:xe,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}},W.createElement("div",{className:p()(He,Ne,(he={},Object(de.a)(he,"".concat(He,"-show-line"),Je),Object(de.a)(he,"".concat(He,"-focused"),le),Object(de.a)(he,"".concat(He,"-active-focused"),Ke!==null),he))},W.createElement(y,Object.assign({ref:this.listRef,prefixCls:He,style:Be,data:ne,disabled:Tt,selectable:qe,checkable:!!Rt,motion:Ye,dragging:Fe,height:ze,itemHeight:ut,virtual:be,focusable:tt,focused:le,tabIndex:rt,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:pe},this.getTreeNodeRequiredProps(),se))))}}],[{key:"getDerivedStateFromProps",value:function(he,_e){var le=_e.prevProps,ne={prevProps:he};function Te(pt){return!le&&pt in he||le&&le[pt]!==he[pt]}var Fe;if(Te("treeData")?Fe=he.treeData:Te("children")&&(Object(P.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Fe=Object(r.c)(he.children)),Fe){ne.treeData=Fe;var Ke=Object(r.a)(Fe);ne.keyEntities=Object(Z.a)(Object(de.a)({},s,E),Ke.keyEntities)}var Ue=ne.keyEntities||_e.keyEntities;if(Te("expandedKeys")||le&&Te("autoExpandParent"))ne.expandedKeys=he.autoExpandParent||!le&&he.defaultExpandParent?Object(h.e)(he.expandedKeys,Ue):he.expandedKeys;else if(!le&&he.defaultExpandAll){var He=Object(Z.a)({},Ue);delete He[s],ne.expandedKeys=Object.keys(He).map(function(pt){return He[pt].key})}else!le&&he.defaultExpandedKeys&&(ne.expandedKeys=he.autoExpandParent||he.defaultExpandParent?Object(h.e)(he.defaultExpandedKeys,Ue):he.defaultExpandedKeys);if(ne.expandedKeys||delete ne.expandedKeys,Fe||ne.expandedKeys){var Ne=Object(r.d)(Fe||_e.treeData,ne.expandedKeys||_e.expandedKeys);ne.flattenNodes=Ne}if(he.selectable&&(Te("selectedKeys")?ne.selectedKeys=Object(h.d)(he.selectedKeys,he):!le&&he.defaultSelectedKeys&&(ne.selectedKeys=Object(h.d)(he.defaultSelectedKeys,he))),he.checkable){var Be;if(Te("checkedKeys")?Be=Object(h.j)(he.checkedKeys)||{}:!le&&he.defaultCheckedKeys?Be=Object(h.j)(he.defaultCheckedKeys)||{}:Fe&&(Be=Object(h.j)(he.checkedKeys)||{checkedKeys:_e.checkedKeys,halfCheckedKeys:_e.halfCheckedKeys}),Be){var Je=Be,tt=Je.checkedKeys,it=tt===void 0?[]:tt,rt=Je.halfCheckedKeys,qe=rt===void 0?[]:rt;if(!he.checkStrictly){var gt=Object(x.a)(it,!0,Ue);it=gt.checkedKeys,qe=gt.halfCheckedKeys}ne.checkedKeys=it,ne.halfCheckedKeys=qe}}return Te("loadedKeys")&&(ne.loadedKeys=he.loadedKeys),ne}}]),fe}(W.Component);F.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:[]},F.TreeNode=c.a;var Q=F,q=Xe.b=Q},fcSX:function(ft,Xe,G){"use strict";var de=G("Ff2n"),Z=G("1OyB"),M=G("vuIU"),V=G("Ji7U"),I=G("md7G"),B=G("foSv"),K=G("1W/9"),W=G("q1tI"),L=G("rePB"),P=G("JX7q"),b=G("TSYQ"),p=G.n(b),_=G("qx4F"),h=G("4IlW");function r(j){return Array.isArray(j)?j:[j]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(d).filter(function(j){if(typeof document=="undefined")return!1;var H=document.getElementsByTagName("html")[0];return j in(H?H.style:{})})[0],a=d[l];function u(j,H,y,x){j.addEventListener?j.addEventListener(H,y,x):j.attachEvent&&j.attachEvent("on".concat(H),y)}function c(j,H,y,x){j.removeEventListener?j.removeEventListener(H,y,x):j.attachEvent&&j.detachEvent("on".concat(H),y)}function R(j,H){var y=typeof j=="function"?j(H):j;return Array.isArray(y)?y.length===2?y:[y[0],y[1]]:[y]}var O=function(H){return!isNaN(parseFloat(H))&&isFinite(H)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function j(H,y,x,F){if(!y||y===document||y instanceof Document)return!1;if(y===H.parentNode)return!0;var Q=Math.max(Math.abs(x),Math.abs(F))===Math.abs(F),q=Math.max(Math.abs(x),Math.abs(F))===Math.abs(x),ie=y.scrollHeight-y.clientHeight,ge=y.scrollWidth-y.clientWidth,fe=document.defaultView.getComputedStyle(y),ue=fe.overflowY==="auto"||fe.overflowY==="scroll",he=fe.overflowX==="auto"||fe.overflowX==="scroll",_e=ie&&ue,le=ge&&he;return Q&&(!_e||_e&&(y.scrollTop>=ie&&F<0||y.scrollTop<=0&&F>0))||q&&(!le||le&&(y.scrollLeft>=ge&&x<0||y.scrollLeft<=0&&x>0))?j(H,y.parentNode,x,F):!1};function w(j){var H=m();return function(){var x=Object(B.a)(j),F;if(H){var Q=Object(B.a)(this).constructor;F=Reflect.construct(x,arguments,Q)}else F=x.apply(this,arguments);return Object(I.a)(this,F)}}function m(){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(j){return!1}}var v={},s=function(j){Object(V.a)(y,j);var H=w(y);function y(x){var F;return Object(Z.a)(this,y),F=H.call(this,x),F.domFocus=function(){F.dom&&F.dom.focus()},F.removeStartHandler=function(Q){if(Q.touches.length>1)return;F.startPos={x:Q.touches[0].clientX,y:Q.touches[0].clientY}},F.removeMoveHandler=function(Q){if(Q.changedTouches.length>1)return;var q=Q.currentTarget,ie=Q.changedTouches[0].clientX-F.startPos.x,ge=Q.changedTouches[0].clientY-F.startPos.y;(q===F.maskDom||q===F.handlerDom||q===F.contentDom&&A(q,Q.target,ie,ge))&&Q.cancelable&&Q.preventDefault()},F.transitionEnd=function(Q){var q=Q.target;c(q,a,F.transitionEnd),q.style.transition=""},F.onKeyDown=function(Q){if(Q.keyCode===h.a.ESC){var q=F.props.onClose;Q.stopPropagation(),q&&q(Q)}},F.onWrapperTransitionEnd=function(Q){var q=F.props,ie=q.open,ge=q.afterVisibleChange;Q.target===F.contentWrapper&&Q.propertyName.match(/transform$/)&&(F.dom.style.transition="",!ie&&F.getCurrentDrawerSome()&&(document.body.style.overflowX="",F.maskDom&&(F.maskDom.style.left="",F.maskDom.style.width="")),ge&&ge(!!ie))},F.openLevelTransition=function(){var Q=F.props,q=Q.open,ie=Q.width,ge=Q.height,fe=F.getHorizontalBoolAndPlacementName(),ue=fe.isHorizontal,he=fe.placementName,_e=F.contentDom?F.contentDom.getBoundingClientRect()[ue?"width":"height"]:0,le=(ue?ie:ge)||_e;F.setLevelAndScrolling(q,he,le)},F.setLevelTransform=function(Q,q,ie,ge){var fe=F.props,ue=fe.placement,he=fe.levelMove,_e=fe.duration,le=fe.ease,ne=fe.showMask;F.levelDom.forEach(function(Te){Te.style.transition="transform ".concat(_e," ").concat(le),u(Te,a,F.transitionEnd);var Fe=Q?ie:0;if(he){var Ke=R(he,{target:Te,open:Q});Fe=Q?Ke[0]:Ke[1]||0}var Ue=typeof Fe=="number"?"".concat(Fe,"px"):Fe,He=ue==="left"||ue==="top"?Ue:"-".concat(Ue);He=ne&&ue==="right"&&ge?"calc(".concat(He," + ").concat(ge,"px)"):He,Te.style.transform=Fe?"".concat(q,"(").concat(He,")"):""})},F.setLevelAndScrolling=function(Q,q,ie){var ge=F.props.onChange;if(!T){var fe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(_.a)(!0):0;F.setLevelTransform(Q,q,ie,fe),F.toggleScrollingToDrawerAndBody(fe)}ge&&ge(Q)},F.toggleScrollingToDrawerAndBody=function(Q){var q=F.props,ie=q.getOpenCount,ge=q.getContainer,fe=q.showMask,ue=q.open,he=ge&&ge(),_e=ie&&ie();if(he&&he.parentNode===document.body&&fe){var le=["touchstart"],ne=[document.body,F.maskDom,F.handlerDom,F.contentDom];ue&&document.body.style.overflow!=="hidden"?(Q&&F.addScrollingEffect(Q),_e===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ne.forEach(function(Te,Fe){if(!Te)return;u(Te,le[Fe]||"touchmove",Fe?F.removeMoveHandler:F.removeStartHandler,F.passive)})):F.getCurrentDrawerSome()&&(_e||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&F.remScrollingEffect(Q),ne.forEach(function(Te,Fe){if(!Te)return;c(Te,le[Fe]||"touchmove",Fe?F.removeMoveHandler:F.removeStartHandler,F.passive)}))}},F.addScrollingEffect=function(Q){var q=F.props,ie=q.placement,ge=q.duration,fe=q.ease,ue=q.getOpenCount,he=q.switchScrollingEffect,_e=ue&&ue();_e===1&&he();var le="width ".concat(ge," ").concat(fe),ne="transform ".concat(ge," ").concat(fe);F.dom.style.transition="none";switch(ie){case"right":F.dom.style.transform="translateX(-".concat(Q,"px)");break;case"top":case"bottom":F.dom.style.width="calc(100% - ".concat(Q,"px)"),F.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(F.timeout),F.timeout=setTimeout(function(){F.dom&&(F.dom.style.transition="".concat(ne,",").concat(le),F.dom.style.width="",F.dom.style.transform="")})},F.remScrollingEffect=function(Q){var q=F.props,ie=q.placement,ge=q.duration,fe=q.ease,ue=q.getOpenCount,he=q.switchScrollingEffect,_e=ue&&ue();_e||he(!0),l&&(document.body.style.overflowX="hidden"),F.dom.style.transition="none";var le,ne="width ".concat(ge," ").concat(fe),Te="transform ".concat(ge," ").concat(fe);switch(ie){case"left":{F.dom.style.width="100%",ne="width 0s ".concat(fe," ").concat(ge);break}case"right":{F.dom.style.transform="translateX(".concat(Q,"px)"),F.dom.style.width="100%",ne="width 0s ".concat(fe," ").concat(ge),F.maskDom&&(F.maskDom.style.left="-".concat(Q,"px"),F.maskDom.style.width="calc(100% + ".concat(Q,"px)"));break}case"top":case"bottom":{F.dom.style.width="calc(100% + ".concat(Q,"px)"),F.dom.style.height="100%",F.dom.style.transform="translateZ(0)",le="height 0s ".concat(fe," ").concat(ge);break}default:break}clearTimeout(F.timeout),F.timeout=setTimeout(function(){F.dom&&(F.dom.style.transition="".concat(Te,",").concat(le?"".concat(le,","):"").concat(ne),F.dom.style.transform="",F.dom.style.width="",F.dom.style.height="")})},F.getCurrentDrawerSome=function(){return!Object.keys(v).some(function(Q){return v[Q]})},F.getLevelDom=function(Q){var q=Q.level,ie=Q.getContainer;if(T)return;var ge=ie&&ie(),fe=ge?ge.parentNode:null;if(F.levelDom=[],q==="all"){var ue=fe?Array.prototype.slice.call(fe.children):[];ue.forEach(function(he){he.nodeName!=="SCRIPT"&&he.nodeName!=="STYLE"&&he.nodeName!=="LINK"&&he!==ge&&F.levelDom.push(he)})}else q&&r(q).forEach(function(he){document.querySelectorAll(he).forEach(function(_e){F.levelDom.push(_e)})})},F.getHorizontalBoolAndPlacementName=function(){var Q=F.props.placement,q=Q==="left"||Q==="right",ie="translate".concat(q?"X":"Y");return{isHorizontal:q,placementName:ie}},F.state={_self:Object(P.a)(F)},F}return Object(M.a)(y,[{key:"componentDidMount",value:function(){var F=this;if(!T){var Q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Q=!0,null}}))}catch(ue){}this.passive=Q?{passive:!1}:!1}var q=this.props,ie=q.open,ge=q.getContainer,fe=ge&&ge();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ie&&(fe&&fe.parentNode===document.body&&(v[this.drawerId]=ie),this.openLevelTransition(),this.forceUpdate(function(){F.domFocus()}))}},{key:"componentDidUpdate",value:function(F){var Q=this.props,q=Q.open,ie=Q.getContainer,ge=ie&&ie();q!==F.open&&(q&&this.domFocus(),ge&&ge.parentNode===document.body&&(v[this.drawerId]=!!q),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var F=this.props,Q=F.getOpenCount,q=F.open,ie=F.switchScrollingEffect,ge=typeof Q=="function"&&Q();delete v[this.drawerId],q&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ge||(document.body.style.overflow="",ie(!0))}},{key:"render",value:function(){var F,Q=this,q=this.props,ie=q.className,ge=q.children,fe=q.style,ue=q.width,he=q.height,_e=q.defaultOpen,le=q.open,ne=q.prefixCls,Te=q.placement,Fe=q.level,Ke=q.levelMove,Ue=q.ease,He=q.duration,Ne=q.getContainer,Be=q.handler,Je=q.onChange,tt=q.afterVisibleChange,it=q.showMask,rt=q.maskClosable,qe=q.maskStyle,gt=q.onClose,pt=q.onHandleClick,vt=q.keyboard,at=q.getOpenCount,Rt=q.switchScrollingEffect,xt=Object(de.a)(q,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Tt=this.dom?le:!1,Ye=p()(ne,(F={},Object(L.a)(F,"".concat(ne,"-").concat(Te),!0),Object(L.a)(F,"".concat(ne,"-open"),Tt),Object(L.a)(F,ie||"",!!ie),Object(L.a)(F,"no-mask",!it),F)),Mt=this.getHorizontalBoolAndPlacementName(),St=Mt.placementName,ze=Te==="left"||Te==="top"?"-100%":"100%",ut=Tt?"":"".concat(St,"(").concat(ze,")"),be=Be&&W.cloneElement(Be,{onClick:function(pe){Be.props.onClick&&Be.props.onClick(),pt&&pt(pe)},ref:function(pe){Q.handlerDom=pe}});return W.createElement("div",Object.assign({},xt,{tabIndex:-1,className:Ye,style:fe,ref:function(pe){Q.dom=pe},onKeyDown:Tt&&vt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),it&&W.createElement("div",{className:"".concat(ne,"-mask"),onClick:rt?gt:void 0,style:qe,ref:function(pe){Q.maskDom=pe}}),W.createElement("div",{className:"".concat(ne,"-content-wrapper"),style:{transform:ut,msTransform:ut,width:O(ue)?"".concat(ue,"px"):ue,height:O(he)?"".concat(he,"px"):he},ref:function(pe){Q.contentWrapper=pe}},W.createElement("div",{className:"".concat(ne,"-content"),ref:function(pe){Q.contentDom=pe},onTouchStart:Tt&&it?this.removeStartHandler:void 0,onTouchMove:Tt&&it?this.removeMoveHandler:void 0},ge),be))}}],[{key:"getDerivedStateFromProps",value:function(F,Q){var q=Q.prevProps,ie=Q._self,ge={prevProps:F};if(q!==void 0){var fe=F.placement,ue=F.level;fe!==q.placement&&(ie.contentDom=null),ue!==q.level&&ie.getLevelDom(F)}return ge}}]),y}(W.Component);s.defaultProps={switchScrollingEffect:function(){}};var o=s;function E(j){var H=g();return function(){var x=Object(B.a)(j),F;if(H){var Q=Object(B.a)(this).constructor;F=Reflect.construct(x,arguments,Q)}else F=x.apply(this,arguments);return Object(I.a)(this,F)}}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(j){return!1}}var C=function(j){Object(V.a)(y,j);var H=E(y);function y(x){var F;Object(Z.a)(this,y),F=H.call(this,x),F.onHandleClick=function(q){var ie=F.props,ge=ie.onHandleClick,fe=ie.open;if(ge&&ge(q),typeof fe=="undefined"){var ue=F.state.open;F.setState({open:!ue})}},F.onClose=function(q){var ie=F.props,ge=ie.onClose,fe=ie.open;ge&&ge(q),typeof fe=="undefined"&&F.setState({open:!1})};var Q=typeof x.open!="undefined"?x.open:!!x.defaultOpen;return F.state={open:Q},"onMaskClick"in x&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),F}return Object(M.a)(y,[{key:"render",value:function(){var F=this,Q=this.props,q=Q.defaultOpen,ie=Q.getContainer,ge=Q.wrapperClassName,fe=Q.forceRender,ue=Q.handler,he=Object(de.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),_e=this.state.open;if(!ie)return W.createElement("div",{className:ge,ref:function(Te){F.dom=Te}},W.createElement(o,Object.assign({},he,{open:_e,handler:ue,getContainer:function(){return F.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var le=!!ue||fe;return W.createElement(K.a,{visible:_e,forceRender:le,getContainer:ie,wrapperClassName:ge},function(ne){var Te=ne.visible,Fe=ne.afterClose,Ke=Object(de.a)(ne,["visible","afterClose"]);return W.createElement(o,Object.assign({},he,Ke,{open:Te!==void 0?Te:_e,afterVisibleChange:Fe!==void 0?Fe:he.afterVisibleChange,handler:ue,onClose:F.onClose,onHandleClick:F.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(F,Q){var q=Q.prevProps,ie={prevProps:F};return typeof q!="undefined"&&F.open!==q.open&&(ie.open=F.open),ie}}]),y}(W.Component);C.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:W.createElement("div",{className:"drawer-handle"},W.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=C,U=Xe.a=N},i8i3:function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___3Vf6o",flex_space_between:"flex_space_between___3kR1x",flex_box_vertical_center:"flex_box_vertical_center___25a0b",flex_box_center_end:"flex_box_center_end___3k_KQ",flex_box_column:"flex_box_column___38BD-",customModal:"customModal___2JXW3",shareModal:"shareModal___1xuLw",content:"content___1yjOV",group:"group___2tJcj",teachGroup:"teachGroup___VMxNc",footer:"footer___1OQG5"}},iNYN:function(ft,Xe,G){ft.exports={modalContent:"modalContent___3NP2x",modalContentLeft:"modalContentLeft___ycFEY",green:"green___2njFR",textArea:"textArea___28pXQ",red:"red___2bPlD",row:"row___tW7CE",html:"html___30ord",line:"line___1f3U7"}},iris:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return _});var de=G("qVdP"),Z=G("jsC+"),M=G("lUTK"),V=G("BvKs"),I=G("tJVT"),B=G("q1tI"),K=G.n(B),W=G("Q0Vu"),L=G.n(W),P=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],b=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],p=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],_=function(r){var d=r.showSelectAll,l=d===void 0?!1:d,a=r.disciplinesData,u=a===void 0?[]:a,c=r.knowledgeData,R=c===void 0?[]:c,O=r.directionValue,T=r.subDisciplineValue,A=r.typeValue,w=r.knowledgeValue,m=r.showKnowledge,v=m===void 0?!1:m,s=r.showRandomType,o=s===void 0?!1:s,E=r.difficultyValue,g=r.randomValue,C=r.selectAll,N=r.languagesvalue,U=r.className,j=r.languages,H=j===void 0?[]:j,y=r.isprogram_homework,x=r.showShixun,F=x===void 0?!1:x,Q=r.showItemType,q=Q===void 0?!0:Q,ie=r.onShixunChange,ge=ie===void 0?function(){}:ie,fe=r.onDirectionChange,ue=fe===void 0?function(){}:fe,he=r.onTypeChange,_e=he===void 0?function(){}:he,le=r.onDifficultyChange,ne=le===void 0?function(){}:le,Te=r.handlelanguagesChange,Fe=Te===void 0?function(){}:Te,Ke=r.onKnowledgeChange,Ue=Ke===void 0?function(){}:Ke,He=r.onRandomChange,Ne=He===void 0?function(){}:He,Be=r.showTeachGroup,Je=Be===void 0?!1:Be,tt=r.teachGroupData,it=tt===void 0?[]:tt,rt=r.onTeachGroupChange,qe=rt===void 0?function(){}:rt,gt=r.teachGroupValue,pt=Object(B.useState)(0),vt=Object(I.a)(pt,2),at=vt[0],Rt=vt[1],xt=Object(B.useRef)(null),Tt=Object(B.useState)(0),Ye=Object(I.a)(Tt,2),Mt=Ye[0],St=Ye[1],ze=Object(B.useRef)(null);Object(B.useEffect)(function(){if(u.length!==0){var be;(xt==null||((be=xt.current)===null||be===void 0)?void 0:be.clientHeight)>108?Rt(1):Rt(0)}u.length===0&&Rt(0)},[u]),Object(B.useEffect)(function(){if(console.log(R.length===0,"\u6570\u91CF"),R.length!==0){var be,xe;console.log(ze==null||((be=ze.current)===null||be===void 0)?void 0:be.clientHeight,"\u9AD8\u5EA6"),(ze==null||((xe=ze.current)===null||xe===void 0)?void 0:xe.clientHeight)>108?St(1):St(0)}R.length===0&&St(0)},[R]);var ut=function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],pe=arguments.length>1?arguments[1]:void 0;return K.a.createElement(V.a,{className:L.a.subMenu},xe.map(function(se){return K.a.createElement(V.a.Item,{key:se.id},K.a.createElement("a",{className:"".concat(L.a.subItem," ").concat(T===se.id?L.a.subActive:""),onClick:function(){return ue(pe,se.id)}},se.name))}))};return K.a.createElement("aside",{className:U?"".concat(L.a.main," ").concat(U):L.a.main},K.a.createElement("div",{className:L.a.wrap},y&&K.a.createElement("div",{className:L.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Je&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u56E2\u961F"),K.a.createElement("div",{className:L.a.directionContentWrap},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(gt?"":L.a.active," "),onClick:function(){return qe(null)}},"\u5168\u90E8"),it==null?void 0:it.map(function(be){return K.a.createElement("li",{key:be.group_id,className:"".concat(L.a.directionItem," ").concat(gt===be.group_id?L.a.active:""," "),onClick:function(){return qe(be.group_id)}},be.name)}))),K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u65B9\u5411"),K.a.createElement("span",null),K.a.createElement("div",{className:L.a.directionContentWrap,style:{overflow:"hidden",height:at===1?88:"auto"}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O?"":L.a.active," "),onClick:function(){return ue(null)}},"\u5168\u90E8"),u.map(function(be){var xe;return K.a.createElement(K.a.Fragment,{key:be.id},((xe=be.sub_disciplines)===null||xe===void 0?void 0:xe.length)>0?K.a.createElement(Z.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(se){return se.parentNode},overlay:function(){return ut(be.sub_disciplines,be.id)}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name)):K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name))})),K.a.createElement("div",{className:L.a.directionContentWrap,ref:xt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},u.map(function(be){var xe;return K.a.createElement(K.a.Fragment,{key:be.id},((xe=be.sub_disciplines)===null||xe===void 0?void 0:xe.length)>0?K.a.createElement(Z.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(se){return se.parentNode},overlay:function(){return ut(be.sub_disciplines,be.id)}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name)):K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name))})),!!at&&K.a.createElement("div",{className:L.a.action},at===1&&K.a.createElement("span",{onClick:function(){return Rt(2)}},"\u5C55\u5F00",K.a.createElement("i",{className:"iconfont icon-xiala"})),at===2&&K.a.createElement("span",{onClick:function(){return Rt(1)}},"\u6536\u8D77",K.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),v&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u77E5\u8BC6\u70B9"),K.a.createElement("div",{className:L.a.directionContentWrap,style:{overflow:"hidden",height:Mt===1?106:"auto"}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(w===-1?L.a.active:""," "),onClick:function(){return Ue(-1)}},"\u5168\u90E8"),R.map(function(be){return K.a.createElement("li",{key:be.id,className:"".concat(L.a.directionItem," ").concat(w===be.id?L.a.active:""," "),onClick:function(){return Ue(be.id)}},be.name)})),K.a.createElement("div",{ref:ze,className:L.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},R.map(function(be){return K.a.createElement("li",{key:be.id,className:"".concat(L.a.directionItem," ").concat(w===be.id?L.a.active:""," "),onClick:function(){return Ue(be.id)}},be.name)})),!!Mt&&K.a.createElement("div",{className:L.a.action},Mt===1&&K.a.createElement("span",{onClick:function(){return St(2)}},"\u5C55\u5F00",K.a.createElement("i",{className:"iconfont icon-xiala"})),Mt===2&&K.a.createElement("span",{onClick:function(){return St(1)}},"\u6536\u8D77",K.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),q&&!y&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u9898\u578B"),K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(A?"":L.a.active," "),onClick:function(){return _e(null)}},"\u5168\u90E8"),K.a.createElement("div",{className:L.a.directionContentWrap},P.map(function(be){return K.a.createElement("li",{key:be.name,className:"".concat(L.a.directionItem," ").concat(A===be.value?L.a.active:""," "),onClick:function(){return _e(be.value)}},be.name)}),F&&K.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:L.a.directionItem,onClick:function(){return ge()}},"\u5B9E\u8BAD\u9898"))),K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u96BE\u5EA6"),K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(E?"":L.a.active," "),onClick:function(){return ne(null)}},"\u5168\u90E8"),K.a.createElement("div",{className:L.a.directionContentWrap},b.map(function(be){return K.a.createElement("li",{key:be.name,className:"".concat(L.a.directionItem," ").concat(E===be.value?L.a.active:""," "),onClick:function(){return ne(be.value)}},be.name)}))),o&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u7C7B\u578B"),K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(g?"":L.a.active," "),onClick:function(){return Ne(null)}},"\u5168\u90E8"),K.a.createElement("div",{className:L.a.directionContentWrap},p.map(function(be){return K.a.createElement("li",{key:be.name,className:"".concat(L.a.directionItem," ").concat(g===be.value?L.a.active:""," "),onClick:function(){return Ne(be.value)}},be.name)})))))}},jcZT:function(ft,Xe,G){"use strict";var de=G("2qtc"),Z=G("kLXV"),M=G("5NDa"),V=G("5rEg"),I=G("miYZ"),B=G("tsqr"),K=G("9og8"),W=G("tJVT"),L=G("WmNS"),P=G.n(L),b=G("q1tI"),p=G.n(b),_=G("d5o6"),h=G.n(_),r=G("P/tu"),d=G("WCUW"),l=G("9kvl"),a=function(c){var R=c.problemset,O=c.dispatch,T=c.onOk,A=Object(b.useState)(""),w=Object(W.a)(A,2),m=w[0],v=w[1],s=Object(b.useState)([0]),o=Object(W.a)(s,2),E=o[0],g=o[1],C=function(){O({type:"problemset/setActionTabs",payload:{}})};Object(b.useEffect)(function(){if(R.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var U,j;g([(U=R.actionTabs)===null||U===void 0||((j=U.params)===null||j===void 0)?void 0:j.group_id]),v("")}},[R.actionTabs.key]);var N=function(){var U=Object(K.a)(P.a.mark(function j(){var H,y,x;return P.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(H=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],m.trim()){Q.next=4;break}return B.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Q.abrupt("return");case 4:if(!(m.charAt(0)===" ")){Q.next=7;break}return B.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Q.abrupt("return");case 7:y=0;case 8:if(!(y<m.length)){Q.next=15;break}if(!H.includes(m.charAt(y))){Q.next=12;break}return B.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Q.abrupt("return",!1);case 12:y++,Q.next=8;break;case 15:return Q.next=17,Object(d.p)({parent_id:E.length>0?E[0]:0,name:m});case 17:x=Q.sent,x.status===0&&(C(),T(x==null?void 0:x.id));case 19:case"end":return Q.stop()}},j)}));return function(){return U.apply(this,arguments)}}();return p.a.createElement(Z.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:R.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:C,onOk:N,destroyOnClose:!0},p.a.createElement("div",{className:h.a.addModal},p.a.createElement("div",{className:h.a.row},p.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),p.a.createElement(V.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:m,onChange:function(j){return v(j.target.value)}})),p.a.createElement("div",{className:h.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},p.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),p.a.createElement(r.a,{value:E,onChange:function(j){return g(j)}}))))};Xe.a=Object(l.a)(function(u){var c=u.problemset;return{problemset:c}})(a)},k3GJ:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return fo});var de=G("rePB"),Z=G("ODXe"),M=G("Ff2n"),V=G("VTBJ"),I=G("q1tI"),B=G("TSYQ"),K=G.n(B),W=G("Zm9Q"),L=G("6cGi"),P=G("KQm4"),b=G("xEkU"),p=G.n(b),_=G("t23M");function h(ye){var Oe=Object(I.useRef)(),Me=Object(I.useRef)(!1);function Ce(){for(var re=arguments.length,me=new Array(re),oe=0;oe<re;oe++)me[oe]=arguments[oe];Me.current||(p.a.cancel(Oe.current),Oe.current=p()(function(){ye.apply(void 0,me)}))}return Object(I.useEffect)(function(){return function(){Me.current=!0,p.a.cancel(Oe.current)}},[]),Ce}function r(ye){var Oe=Object(I.useRef)([]),Me=Object(I.useState)({}),Ce=Object(Z.a)(Me,2),re=Ce[1],me=Object(I.useRef)(typeof ye=="function"?ye():ye),oe=h(function(){var ve=me.current;Oe.current.forEach(function(ke){ve=ke(ve)}),Oe.current=[],me.current=ve,re({})});function we(ve){Oe.current.push(ve),oe()}return[me.current,we]}var d=G("4IlW");function l(ye,Oe){var Me,Ce=ye.prefixCls,re=ye.id,me=ye.active,oe=ye.rtl,we=ye.tab,ve=we.key,ke=we.tab,Ie=we.disabled,je=we.closeIcon,Ze=ye.tabBarGutter,mt=ye.tabPosition,bt=ye.closable,Ut=ye.renderWrapper,Rn=ye.removeAriaLabel,Qn=ye.editable,jn=ye.onClick,Vn=ye.onRemove,Yn=ye.onFocus,Xn="".concat(Ce,"-tab");I.useEffect(function(){return Vn},[]);var Wn={};mt==="top"||mt==="bottom"?Wn[oe?"marginLeft":"marginRight"]=Ze:Wn.marginBottom=Ze;var Jn=Qn&&bt!==!1&&!Ie;function ei(gn){if(Ie)return;jn(gn)}function ki(gn){gn.preventDefault(),gn.stopPropagation(),Qn.onEdit("remove",{key:ve,event:gn})}var ti=I.createElement("div",{key:ve,ref:Oe,className:K()(Xn,(Me={},Object(de.a)(Me,"".concat(Xn,"-with-remove"),Jn),Object(de.a)(Me,"".concat(Xn,"-active"),me),Object(de.a)(Me,"".concat(Xn,"-disabled"),Ie),Me)),style:Wn,onClick:ei},I.createElement("div",{role:"tab","aria-selected":me,id:re&&"".concat(re,"-tab-").concat(ve),className:"".concat(Xn,"-btn"),"aria-controls":re&&"".concat(re,"-panel-").concat(ve),"aria-disabled":Ie,tabIndex:Ie?null:0,onClick:function(fn){fn.stopPropagation(),ei(fn)},onKeyDown:function(fn){[d.a.SPACE,d.a.ENTER].includes(fn.which)&&(fn.preventDefault(),ei(fn))},onFocus:Yn},ke),Jn&&I.createElement("button",{type:"button","aria-label":Rn||"remove",tabIndex:0,className:"".concat(Xn,"-remove"),onClick:function(fn){fn.stopPropagation(),ki(fn)}},je||Qn.removeIcon||"\xD7"));return Ut&&(ti=Ut(ti)),ti}var a=I.forwardRef(l),u={width:0,height:0,left:0,top:0};function c(ye,Oe,Me){return Object(I.useMemo)(function(){for(var Ce,re=new Map,me=Oe.get((Ce=ye[0])===null||Ce===void 0?void 0:Ce.key)||u,oe=me.left+me.width,we=0;we<ye.length;we+=1){var ve=ye[we].key,ke=Oe.get(ve);if(!ke){var Ie;ke=Oe.get((Ie=ye[we-1])===null||Ie===void 0?void 0:Ie.key)||u}var je=re.get(ve)||Object(V.a)({},ke);je.right=oe-je.left-je.width,re.set(ve,je)}return re},[ye.map(function(Ce){return Ce.key}).join("_"),Oe,Me])}var R={width:0,height:0,left:0,top:0,right:0};function O(ye,Oe,Me,Ce,re){var me=re.tabs,oe=re.tabPosition,we=re.rtl,ve,ke,Ie;["top","bottom"].includes(oe)?(ve="width",ke=we?"right":"left",Ie=Math.abs(Oe.left)):(ve="height",ke="top",Ie=-Oe.top);var je=Oe[ve],Ze=Me[ve],mt=Ce[ve],bt=je;return Ze+mt>je&&(bt=je-mt),Object(I.useMemo)(function(){if(!me.length)return[0,0];for(var Ut=me.length,Rn=Ut,Qn=0;Qn<Ut;Qn+=1){var jn=ye.get(me[Qn].key)||R;if(jn[ke]+jn[ve]>Ie+bt){Rn=Qn-1;break}}for(var Vn=0,Yn=Ut-1;Yn>=0;Yn-=1){var Xn=ye.get(me[Yn].key)||R;if(Xn[ke]<Ie){Vn=Yn+1;break}}return[Vn,Rn]},[ye,Ie,bt,oe,me.map(function(Ut){return Ut.key}).join("_"),we])}var T=G("wx14"),A=G("1OyB"),w=G("vuIU"),m=G("JX7q"),v=G("Ji7U"),s=G("LK+K"),o=G("I8Z2"),E=G("bT9E"),g=G("2GS6"),C=G("Gytx"),N=G.n(C),U=G("U8pU"),j=/iPhone/i,H=/iPod/i,y=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,F=/Android/i,Q=/\bAndroid(?:.+)SD4930UR\b/i,q=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ie=/Windows Phone/i,ge=/\bWindows(?:.+)ARM\b/i,fe=/BlackBerry/i,ue=/BB10/i,he=/Opera Mini/i,_e=/\b(CriOS|Chrome)(?:.+)Mobile/i,le=/Mobile(?:.+)Firefox\b/i;function ne(ye,Oe){return ye.test(Oe)}function Te(ye){var Oe=ye||(typeof navigator!="undefined"?navigator.userAgent:""),Me=(Oe||"").split("[FBAN");if(typeof Me[1]!="undefined"){var Ce=Me,re=Object(Z.a)(Ce,1);Oe=re[0]}if(Me=Oe.split("Twitter"),typeof Me[1]!="undefined"){var me=Me,oe=Object(Z.a)(me,1);Oe=oe[0]}var we={apple:{phone:ne(j,Oe)&&!ne(ie,Oe),ipod:ne(H,Oe),tablet:!ne(j,Oe)&&ne(y,Oe)&&!ne(ie,Oe),device:(ne(j,Oe)||ne(H,Oe)||ne(y,Oe))&&!ne(ie,Oe)},amazon:{phone:ne(Q,Oe),tablet:!ne(Q,Oe)&&ne(q,Oe),device:ne(Q,Oe)||ne(q,Oe)},android:{phone:!ne(ie,Oe)&&ne(Q,Oe)||!ne(ie,Oe)&&ne(x,Oe),tablet:!ne(ie,Oe)&&!ne(Q,Oe)&&!ne(x,Oe)&&(ne(q,Oe)||ne(F,Oe)),device:!ne(ie,Oe)&&(ne(Q,Oe)||ne(q,Oe)||ne(x,Oe)||ne(F,Oe))||ne(/\bokhttp\b/i,Oe)},windows:{phone:ne(ie,Oe),tablet:ne(ge,Oe),device:ne(ie,Oe)||ne(ge,Oe)},other:{blackberry:ne(fe,Oe),blackberry10:ne(ue,Oe),opera:ne(he,Oe),firefox:ne(le,Oe),chrome:ne(_e,Oe),device:ne(fe,Oe)||ne(ue,Oe)||ne(he,Oe)||ne(le,Oe)||ne(_e,Oe)},any:null,phone:null,tablet:null};return we.any=we.apple.device||we.android.device||we.windows.device||we.other.device,we.phone=we.apple.phone||we.android.phone||we.windows.phone,we.tablet=we.apple.tablet||we.android.tablet||we.windows.tablet,we}var Fe=Object(V.a)(Object(V.a)({},Te()),{},{isMobile:Te}),Ke=Fe;function Ue(){}function He(ye,Oe,Me){var Ce=Oe||"";return ye.key||"".concat(Ce,"item_").concat(Me)}function Ne(ye){return"".concat(ye,"-menu-")}function Be(ye,Oe){var Me=-1;I.Children.forEach(ye,function(Ce){Me+=1,Ce&&Ce.type&&Ce.type.isMenuItemGroup?I.Children.forEach(Ce.props.children,function(re){Me+=1,Oe(re,Me)}):Oe(Ce,Me)})}function Je(ye,Oe,Me){if(!ye||Me.find)return;I.Children.forEach(ye,function(Ce){if(Ce){var re=Ce.type;if(!re||!(re.isSubMenu||re.isMenuItem||re.isMenuItemGroup))return;Oe.indexOf(Ce.key)!==-1?Me.find=!0:Ce.props.children&&Je(Ce.props.children,Oe,Me)}})}var tt=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],it=function(Oe){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=Oe&&typeof Oe.getBoundingClientRect=="function"&&Oe.getBoundingClientRect().width;if(Ce){if(Me){var re=getComputedStyle(Oe),me=re.marginLeft,oe=re.marginRight;Ce+=+me.replace("px","")+ +oe.replace("px","")}Ce=+Ce.toFixed(6)}return Ce||0},rt=function(Oe,Me,Ce){Oe&&Object(U.a)(Oe.style)==="object"&&(Oe.style[Me]=Ce)},qe=function(){return Ke.any},gt=G("bdgK"),pt=G("i8i4"),vt=G.n(pt),at=G("wgJM"),Rt=G("l4aY"),xt=G("m+aA"),Tt=G("c+Xe"),Ye=G("zT1h"),Mt=G("QC+M");function St(ye,Oe,Me){return Me?ye[0]===Oe[0]:ye[0]===Oe[0]&&ye[1]===Oe[1]}function ze(ye,Oe,Me){var Ce=ye[Oe]||{};return Object(V.a)(Object(V.a)({},Ce),Me)}function ut(ye,Oe,Me,Ce){for(var re=Me.points,me=Object.keys(ye),oe=0;oe<me.length;oe+=1){var we=me[oe];if(St(ye[we].points,re,Ce))return"".concat(Oe,"-placement-").concat(we)}return""}var be=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ye=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ye)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ye==null?void 0:ye.substr(0,4)))},xe=G("MNnm");function pe(ye,Oe){var Me={};return Me[ye.toLowerCase()]=Oe.toLowerCase(),Me["Webkit".concat(ye)]="webkit".concat(Oe),Me["Moz".concat(ye)]="moz".concat(Oe),Me["ms".concat(ye)]="MS".concat(Oe),Me["O".concat(ye)]="o".concat(Oe.toLowerCase()),Me}function se(ye,Oe){var Me={animationend:pe("Animation","AnimationEnd"),transitionend:pe("Transition","TransitionEnd")};return ye&&("AnimationEvent"in Oe||delete Me.animationend.animation,"TransitionEvent"in Oe||delete Me.transitionend.transition),Me}var ce=se(Object(xe.a)(),typeof window!="undefined"?window:{}),Ee={};if(Object(xe.a)()){var Ae=document.createElement("div");Ee=Ae.style}var De={};function $e(ye){if(De[ye])return De[ye];var Oe=ce[ye];if(Oe)for(var Me=Object.keys(Oe),Ce=Me.length,re=0;re<Ce;re+=1){var me=Me[re];if(Object.prototype.hasOwnProperty.call(Oe,me)&&me in Ee)return De[ye]=Oe[me],De[ye]}return""}var lt=$e("animationend"),Bt=$e("transitionend"),tn=!!(lt&&Bt),nn=lt||"animationend",_n=Bt||"transitionend";function yn(ye,Oe){if(!ye)return null;if(Object(U.a)(ye)==="object"){var Me=Oe.replace(/-\w/g,function(Ce){return Ce[1].toUpperCase()});return ye[Me]}return"".concat(ye,"-").concat(Oe)}var Gt="none",ii="appear",Dn="enter",Ci="leave",fi="none",In="prepare",Ri="start",Si="active",Ot="end";function bn(ye){var Oe=Object(I.useRef)(!1),Me=Object(I.useState)(ye),Ce=Object(Z.a)(Me,2),re=Ce[0],me=Ce[1];function oe(we){Oe.current||me(we)}return Object(I.useEffect)(function(){return function(){Oe.current=!0}},[]),[re,oe]}var Cn=Object(xe.a)()?I.useLayoutEffect:I.useEffect,kn=Cn,Ai=function(){var ye=I.useRef(null);function Oe(){at.a.cancel(ye.current)}function Me(Ce){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Oe();var me=Object(at.a)(function(){re<=1?Ce({isCanceled:function(){return me!==ye.current}}):Me(Ce,re-1)});ye.current=me}return I.useEffect(function(){return function(){Oe()}},[]),[Me,Oe]},Ui=[In,Ri,Si,Ot],dr=!1,mn=!0;function Jt(ye){return ye===Si||ye===Ot}var qi=function(ye,Oe){var Me=I.useState(fi),Ce=Object(Z.a)(Me,2),re=Ce[0],me=Ce[1],oe=Ai(),we=Object(Z.a)(oe,2),ve=we[0],ke=we[1];function Ie(){me(In)}return kn(function(){if(re!==fi&&re!==Ot){var je=Ui.indexOf(re),Ze=Ui[je+1],mt=Oe(re);mt===dr?me(Ze):ve(function(bt){function Ut(){if(bt.isCanceled())return;me(Ze)}mt===!0?Ut():Promise.resolve(mt).then(Ut)})}},[ye,re]),I.useEffect(function(){return function(){ke()}},[]),[Ie,re]},hr=function(ye){var Oe=Object(I.useRef)(),Me=Object(I.useRef)(ye);Me.current=ye;var Ce=I.useCallback(function(oe){Me.current(oe)},[]);function re(oe){oe&&(oe.removeEventListener(_n,Ce),oe.removeEventListener(nn,Ce))}function me(oe){Oe.current&&Oe.current!==oe&&re(Oe.current),oe&&oe!==Oe.current&&(oe.addEventListener(_n,Ce),oe.addEventListener(nn,Ce),Oe.current=oe)}return I.useEffect(function(){return function(){re(Oe.current)}},[]),[me,re]};function sr(ye,Oe,Me,Ce){var re=Ce.motionEnter,me=re===void 0?!0:re,oe=Ce.motionAppear,we=oe===void 0?!0:oe,ve=Ce.motionLeave,ke=ve===void 0?!0:ve,Ie=Ce.motionDeadline,je=Ce.motionLeaveImmediately,Ze=Ce.onAppearPrepare,mt=Ce.onEnterPrepare,bt=Ce.onLeavePrepare,Ut=Ce.onAppearStart,Rn=Ce.onEnterStart,Qn=Ce.onLeaveStart,jn=Ce.onAppearActive,Vn=Ce.onEnterActive,Yn=Ce.onLeaveActive,Xn=Ce.onAppearEnd,Wn=Ce.onEnterEnd,Jn=Ce.onLeaveEnd,ei=Ce.onVisibleChanged,ki=bn(),ti=Object(Z.a)(ki,2),gn=ti[0],fn=ti[1],Hn=bn(Gt),ui=Object(Z.a)(Hn,2),an=ui[0],ci=ui[1],Mi=bn(null),ri=Object(Z.a)(Mi,2),wi=ri[0],bi=ri[1],Hi=Object(I.useRef)(!1),Gi=Object(I.useRef)(null),Bi=Object(I.useRef)(!1),vr=Object(I.useRef)(null);function Lr(){var Oi=Me();return Oi||vr.current}var Cr=Object(I.useRef)(!1);function Vi(Oi){var vi=Lr();if(Oi&&!Oi.deadline&&Oi.target!==vi)return;var ji;an===ii&&Cr.current?ji=Xn==null?void 0:Xn(vi,Oi):an===Dn&&Cr.current?ji=Wn==null?void 0:Wn(vi,Oi):an===Ci&&Cr.current&&(ji=Jn==null?void 0:Jn(vi,Oi)),ji!==!1&&!Bi.current&&(ci(Gt),bi(null))}var Di=hr(Vi),Ei=Object(Z.a)(Di,1),Tn=Ei[0],xi=I.useMemo(function(){var Oi,vi,ji;switch(an){case"appear":return Oi={},Object(de.a)(Oi,In,Ze),Object(de.a)(Oi,Ri,Ut),Object(de.a)(Oi,Si,jn),Oi;case"enter":return vi={},Object(de.a)(vi,In,mt),Object(de.a)(vi,Ri,Rn),Object(de.a)(vi,Si,Vn),vi;case"leave":return ji={},Object(de.a)(ji,In,bt),Object(de.a)(ji,Ri,Qn),Object(de.a)(ji,Si,Yn),ji;default:return{}}},[an]),Nr=qi(an,function(Oi){if(Oi===In){var vi=xi[In];return vi?vi(Lr()):dr}if(Ti in xi){var ji;bi(((ji=xi[Ti])===null||ji===void 0?void 0:ji.call(xi,Lr(),null))||null)}return Ti===Si&&(Tn(Lr()),Ie>0&&(clearTimeout(Gi.current),Gi.current=setTimeout(function(){Vi({deadline:!0})},Ie))),mn}),Zr=Object(Z.a)(Nr,2),ra=Zr[0],Ti=Zr[1],Vr=Jt(Ti);Cr.current=Vr,kn(function(){fn(Oe);var Oi=Hi.current;if(Hi.current=!0,!ye)return;var vi;!Oi&&Oe&&we&&(vi=ii),Oi&&Oe&&me&&(vi=Dn),(Oi&&!Oe&&ke||!Oi&&je&&!Oe&&ke)&&(vi=Ci),vi&&(ci(vi),ra())},[Oe]),Object(I.useEffect)(function(){(an===ii&&!we||an===Dn&&!me||an===Ci&&!ke)&&ci(Gt)},[we,me,ke]),Object(I.useEffect)(function(){return function(){clearTimeout(Gi.current),Bi.current=!0}},[]),Object(I.useEffect)(function(){gn!==void 0&&an===Gt&&(ei==null||ei(gn))},[gn,an]);var Jr=wi;return xi[In]&&Ti===Ri&&(Jr=Object(V.a)({transition:"none"},Jr)),[an,Ti,Jr,gn!=null?gn:Oe]}var Fn=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){return Object(A.a)(this,Me),Oe.apply(this,arguments)}return Object(w.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(I.Component),er=Fn;function kr(ye){var Oe=ye;Object(U.a)(ye)==="object"&&(Oe=ye.transitionSupport);function Me(re){return!!(re.motionName&&Oe)}var Ce=I.forwardRef(function(re,me){var oe=re.visible,we=oe===void 0?!0:oe,ve=re.removeOnLeave,ke=ve===void 0?!0:ve,Ie=re.forceRender,je=re.children,Ze=re.motionName,mt=re.leavedClassName,bt=re.eventProps,Ut=Me(re),Rn=Object(I.useRef)(),Qn=Object(I.useRef)();function jn(){try{return Object(xt.a)(Rn.current||Qn.current)}catch(ci){return null}}var Vn=sr(Ut,we,jn,re),Yn=Object(Z.a)(Vn,4),Xn=Yn[0],Wn=Yn[1],Jn=Yn[2],ei=Yn[3],ki=I.useRef(ei);ei&&(ki.current=!0);var ti=Object(I.useRef)(me);ti.current=me;var gn=I.useCallback(function(ci){Rn.current=ci,Object(Tt.b)(ti.current,ci)},[]),fn,Hn=Object(V.a)(Object(V.a)({},bt),{},{visible:we});if(!je)fn=null;else if(Xn===Gt||!Me(re))ei?fn=je(Object(V.a)({},Hn),gn):!ke&&ki.current?fn=je(Object(V.a)(Object(V.a)({},Hn),{},{className:mt}),gn):Ie?fn=je(Object(V.a)(Object(V.a)({},Hn),{},{style:{display:"none"}}),gn):fn=null;else{var ui,an;Wn===In?an="prepare":Jt(Wn)?an="active":Wn===Ri&&(an="start"),fn=je(Object(V.a)(Object(V.a)({},Hn),{},{className:K()(yn(Ze,Xn),(ui={},Object(de.a)(ui,yn(Ze,"".concat(Xn,"-").concat(an)),an),Object(de.a)(ui,Ze,typeof Ze=="string"),ui)),style:Jn}),gn)}return I.createElement(er,{ref:Qn},fn)});return Ce.displayName="CSSMotion",Ce}var Qr=kr(tn),yt="add",cn="keep",Kr="remove",zr="removed";function na(ye){var Oe;return ye&&Object(U.a)(ye)==="object"&&"key"in ye?Oe=ye:Oe={key:ye},Object(V.a)(Object(V.a)({},Oe),{},{key:String(Oe.key)})}function Gr(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ye.map(na)}function $(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Me=[],Ce=0,re=Oe.length,me=Gr(ye),oe=Gr(Oe);me.forEach(function(ke){for(var Ie=!1,je=Ce;je<re;je+=1){var Ze=oe[je];if(Ze.key===ke.key){Ce<je&&(Me=Me.concat(oe.slice(Ce,je).map(function(mt){return Object(V.a)(Object(V.a)({},mt),{},{status:yt})})),Ce=je),Me.push(Object(V.a)(Object(V.a)({},Ze),{},{status:cn})),Ce+=1,Ie=!0;break}}Ie||Me.push(Object(V.a)(Object(V.a)({},ke),{},{status:Kr}))}),Ce<re&&(Me=Me.concat(oe.slice(Ce).map(function(ke){return Object(V.a)(Object(V.a)({},ke),{},{status:yt})})));var we={};Me.forEach(function(ke){var Ie=ke.key;we[Ie]=(we[Ie]||0)+1});var ve=Object.keys(we).filter(function(ke){return we[ke]>1});return ve.forEach(function(ke){Me=Me.filter(function(Ie){var je=Ie.key,Ze=Ie.status;return je!==ke||Ze!==Kr}),Me.forEach(function(Ie){Ie.key===ke&&(Ie.status=cn)})}),Me}var S=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function D(ye){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qr,Me=function(Ce){Object(v.a)(me,Ce);var re=Object(s.a)(me);function me(){var oe;return Object(A.a)(this,me),oe=re.apply(this,arguments),oe.state={keyEntities:[]},oe.removeKey=function(we){oe.setState(function(ve){var ke=ve.keyEntities;return{keyEntities:ke.map(function(Ie){return Ie.key!==we?Ie:Object(V.a)(Object(V.a)({},Ie),{},{status:zr})})}})},oe}return Object(w.a)(me,[{key:"render",value:function(){var we=this,ve=this.state.keyEntities,ke=this.props,Ie=ke.component,je=ke.children,Ze=ke.onVisibleChanged,mt=Object(M.a)(ke,["component","children","onVisibleChanged"]),bt=Ie||I.Fragment,Ut={};return S.forEach(function(Rn){Ut[Rn]=mt[Rn],delete mt[Rn]}),delete mt.keys,I.createElement(bt,mt,ve.map(function(Rn){var Qn=Rn.status,jn=Object(M.a)(Rn,["status"]),Vn=Qn===yt||Qn===cn;return I.createElement(Oe,Object(T.a)({},Ut,{key:jn.key,visible:Vn,eventProps:jn,onVisibleChanged:function(Xn){Ze==null||Ze(Xn,{key:jn.key}),Xn||we.removeKey(jn.key)}}),je)}))}}],[{key:"getDerivedStateFromProps",value:function(we,ve){var ke=we.keys,Ie=ve.keyEntities,je=Gr(ke),Ze=$(Ie,je);return{keyEntities:Ze.filter(function(mt){var bt=Ie.find(function(Ut){var Rn=Ut.key;return mt.key===Rn});return!(bt&&bt.status===zr&&mt.status===Kr)})}}}]),me}(I.Component);return Me.defaultProps={component:"div"},Me}var z=D(tn),te=Qr;function Y(ye){var Oe=ye.prefixCls,Me=ye.motion,Ce=ye.animation,re=ye.transitionName;return Me||(Ce?{motionName:"".concat(Oe,"-").concat(Ce)}:re?{motionName:re}:null)}function Le(ye){var Oe=ye.prefixCls,Me=ye.visible,Ce=ye.zIndex,re=ye.mask,me=ye.maskMotion,oe=ye.maskAnimation,we=ye.maskTransitionName;if(!re)return null;var ve={};return(me||we||oe)&&(ve=Object(V.a)({motionAppear:!0},Y({motion:me,prefixCls:Oe,transitionName:we,animation:oe}))),I.createElement(te,Object(T.a)({},ve,{visible:Me,removeOnLeave:!0}),function(ke){var Ie=ke.className;return I.createElement("div",{style:{zIndex:Ce},className:K()("".concat(Oe,"-mask"),Ie)})})}var ct=G("9mu1"),Pt=G("o0o1"),rn=G.n(Pt),ht=G("HaE+"),Vt=["measure","align",null,"motion"],hi=function(ye,Oe){var Me=Object(I.useState)(null),Ce=Object(Z.a)(Me,2),re=Ce[0],me=Ce[1],oe=Object(I.useRef)(),we=Object(I.useRef)(!1);function ve(je){we.current||me(je)}function ke(){at.a.cancel(oe.current)}function Ie(je){ke(),oe.current=Object(at.a)(function(){ve(function(Ze){switch(re){case"align":return"motion";case"motion":return"stable";default:}return Ze}),je==null||je()})}return Object(I.useEffect)(function(){ve("measure")},[ye]),Object(I.useEffect)(function(){switch(re){case"measure":Oe();break;default:}re&&(oe.current=Object(at.a)(Object(ht.a)(rn.a.mark(function je(){var Ze,mt;return rn.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:Ze=Vt.indexOf(re),mt=Vt[Ze+1],mt&&Ze!==-1&&ve(mt);case 3:case"end":return Ut.stop()}},je)}))))},[re]),Object(I.useEffect)(function(){return function(){we.current=!0,ke()}},[]),[re,Ie]},Li=function(ye){var Oe=I.useState({width:0,height:0}),Me=Object(Z.a)(Oe,2),Ce=Me[0],re=Me[1];function me(we){re({width:we.offsetWidth,height:we.offsetHeight})}var oe=I.useMemo(function(){var we={};if(ye){var ve=Ce.width,ke=Ce.height;ye.indexOf("height")!==-1&&ke?we.height=ke:ye.indexOf("minHeight")!==-1&&ke&&(we.minHeight=ke),ye.indexOf("width")!==-1&&ve?we.width=ve:ye.indexOf("minWidth")!==-1&&ve&&(we.minWidth=ve)}return we},[ye,Ce]);return[oe,me]},Zt=I.forwardRef(function(ye,Oe){var Me=ye.visible,Ce=ye.prefixCls,re=ye.className,me=ye.style,oe=ye.children,we=ye.zIndex,ve=ye.stretch,ke=ye.destroyPopupOnHide,Ie=ye.forceRender,je=ye.align,Ze=ye.point,mt=ye.getRootDomNode,bt=ye.getClassNameFromAlign,Ut=ye.onAlign,Rn=ye.onMouseEnter,Qn=ye.onMouseLeave,jn=ye.onMouseDown,Vn=ye.onTouchStart,Yn=Object(I.useRef)(),Xn=Object(I.useRef)(),Wn=Object(I.useState)(),Jn=Object(Z.a)(Wn,2),ei=Jn[0],ki=Jn[1],ti=Li(ve),gn=Object(Z.a)(ti,2),fn=gn[0],Hn=gn[1];function ui(){ve&&Hn(mt())}var an=hi(Me,ui),ci=Object(Z.a)(an,2),Mi=ci[0],ri=ci[1],wi=Object(I.useRef)();function bi(){return Ze||mt}function Hi(){var Di;(Di=Yn.current)===null||Di===void 0||Di.forceAlign()}function Gi(Di,Ei){var Tn=bt(Ei);ei!==Tn&&ki(Tn),Mi==="align"&&(ei!==Tn?Promise.resolve().then(function(){Hi()}):ri(function(){var xi;(xi=wi.current)===null||xi===void 0||xi.call(wi)}),Ut==null||Ut(Di,Ei))}var Bi=Object(V.a)({},Y(ye));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Di){var Ei=Bi[Di];Bi[Di]=function(Tn,xi){return ri(),Ei==null?void 0:Ei(Tn,xi)}});function vr(){return new Promise(function(Di){wi.current=Di})}I.useEffect(function(){!Bi.motionName&&Mi==="motion"&&ri()},[Bi.motionName,Mi]),I.useImperativeHandle(Oe,function(){return{forceAlign:Hi,getElement:function(){return Xn.current}}});var Lr=Object(V.a)(Object(V.a)({},fn),{},{zIndex:we,opacity:Mi==="motion"||Mi==="stable"||!Me?void 0:0,pointerEvents:Mi==="stable"?void 0:"none"},me),Cr=!0;(je==null?void 0:je.points)&&(Mi==="align"||Mi==="stable")&&(Cr=!1);var Vi=oe;return I.Children.count(oe)>1&&(Vi=I.createElement("div",{className:"".concat(Ce,"-content")},oe)),I.createElement(te,Object(T.a)({visible:Me,ref:Xn,leavedClassName:"".concat(Ce,"-hidden")},Bi,{onAppearPrepare:vr,onEnterPrepare:vr,removeOnLeave:ke,forceRender:Ie}),function(Di,Ei){var Tn=Di.className,xi=Di.style,Nr=K()(Ce,re,ei,Tn);return I.createElement(ct.a,{target:bi(),key:"popup",ref:Yn,monitorWindowResize:!0,disabled:Cr,align:je,onAlign:Gi},I.createElement("div",{ref:Ei,className:Nr,onMouseEnter:Rn,onMouseLeave:Qn,onMouseDownCapture:jn,onTouchStartCapture:Vn,style:Object(V.a)(Object(V.a)({},xi),Lr)},Vi))})});Zt.displayName="PopupInner";var dt=Zt,kt=I.forwardRef(function(ye,Oe){var Me=ye.prefixCls,Ce=ye.visible,re=ye.zIndex,me=ye.children,oe=ye.mobile;oe=oe===void 0?{}:oe;var we=oe.popupClassName,ve=oe.popupStyle,ke=oe.popupMotion,Ie=ke===void 0?{}:ke,je=oe.popupRender,Ze=I.useRef();I.useImperativeHandle(Oe,function(){return{forceAlign:function(){},getElement:function(){return Ze.current}}});var mt=Object(V.a)({zIndex:re},ve),bt=me;return I.Children.count(me)>1&&(bt=I.createElement("div",{className:"".concat(Me,"-content")},me)),je&&(bt=je(bt)),I.createElement(te,Object(T.a)({visible:Ce,ref:Ze,removeOnLeave:!0},Ie),function(Ut,Rn){var Qn=Ut.className,jn=Ut.style,Vn=K()(Me,we,Qn);return I.createElement("div",{ref:Rn,className:Vn,style:Object(V.a)(Object(V.a)({},jn),mt)},bt)})});kt.displayName="MobilePopupInner";var Lt=kt,Kt=["visible","mobile"],sn=I.forwardRef(function(ye,Oe){var Me=ye.visible,Ce=ye.mobile,re=Object(M.a)(ye,Kt),me=Object(I.useState)(Me),oe=Object(Z.a)(me,2),we=oe[0],ve=oe[1],ke=Object(I.useState)(!1),Ie=Object(Z.a)(ke,2),je=Ie[0],Ze=Ie[1],mt=Object(V.a)(Object(V.a)({},re),{},{visible:we});Object(I.useEffect)(function(){ve(Me),Me&&Ce&&Ze(be())},[Me,Ce]);var bt=je?I.createElement(Lt,Object(T.a)({},mt,{mobile:Ce,ref:Oe})):I.createElement(dt,Object(T.a)({},mt,{ref:Oe}));return I.createElement("div",null,I.createElement(Le,mt),bt)});sn.displayName="Popup";var En=sn,wn=I.createContext(null),hn=wn;function Ln(){}function zn(){return""}function un(ye){return ye?ye.ownerDocument:window.document}var Sn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function di(ye){var Oe=function(Me){Object(v.a)(re,Me);var Ce=Object(s.a)(re);function re(me){var oe;Object(A.a)(this,re),oe=Ce.call(this,me),oe.popupRef=I.createRef(),oe.triggerRef=I.createRef(),oe.attachId=void 0,oe.clickOutsideHandler=void 0,oe.touchOutsideHandler=void 0,oe.contextMenuOutsideHandler1=void 0,oe.contextMenuOutsideHandler2=void 0,oe.mouseDownTimeout=void 0,oe.focusTime=void 0,oe.preClickTime=void 0,oe.preTouchTime=void 0,oe.delayTimer=void 0,oe.hasPopupMouseDown=void 0,oe.onMouseEnter=function(ve){var ke=oe.props.mouseEnterDelay;oe.fireEvents("onMouseEnter",ve),oe.delaySetPopupVisible(!0,ke,ke?null:ve)},oe.onMouseMove=function(ve){oe.fireEvents("onMouseMove",ve),oe.setPoint(ve)},oe.onMouseLeave=function(ve){oe.fireEvents("onMouseLeave",ve),oe.delaySetPopupVisible(!1,oe.props.mouseLeaveDelay)},oe.onPopupMouseEnter=function(){oe.clearDelayTimer()},oe.onPopupMouseLeave=function(ve){var ke;if(ve.relatedTarget&&!ve.relatedTarget.setTimeout&&Object(Rt.a)((ke=oe.popupRef.current)===null||ke===void 0?void 0:ke.getElement(),ve.relatedTarget))return;oe.delaySetPopupVisible(!1,oe.props.mouseLeaveDelay)},oe.onFocus=function(ve){oe.fireEvents("onFocus",ve),oe.clearDelayTimer(),oe.isFocusToShow()&&(oe.focusTime=Date.now(),oe.delaySetPopupVisible(!0,oe.props.focusDelay))},oe.onMouseDown=function(ve){oe.fireEvents("onMouseDown",ve),oe.preClickTime=Date.now()},oe.onTouchStart=function(ve){oe.fireEvents("onTouchStart",ve),oe.preTouchTime=Date.now()},oe.onBlur=function(ve){oe.fireEvents("onBlur",ve),oe.clearDelayTimer(),oe.isBlurToHide()&&oe.delaySetPopupVisible(!1,oe.props.blurDelay)},oe.onContextMenu=function(ve){ve.preventDefault(),oe.fireEvents("onContextMenu",ve),oe.setPopupVisible(!0,ve)},oe.onContextMenuClose=function(){oe.isContextMenuToShow()&&oe.close()},oe.onClick=function(ve){if(oe.fireEvents("onClick",ve),oe.focusTime){var ke;if(oe.preClickTime&&oe.preTouchTime?ke=Math.min(oe.preClickTime,oe.preTouchTime):oe.preClickTime?ke=oe.preClickTime:oe.preTouchTime&&(ke=oe.preTouchTime),Math.abs(ke-oe.focusTime)<20)return;oe.focusTime=0}oe.preClickTime=0,oe.preTouchTime=0,oe.isClickToShow()&&(oe.isClickToHide()||oe.isBlurToHide())&&ve&&ve.preventDefault&&ve.preventDefault();var Ie=!oe.state.popupVisible;(oe.isClickToHide()&&!Ie||Ie&&oe.isClickToShow())&&oe.setPopupVisible(!oe.state.popupVisible,ve)},oe.onPopupMouseDown=function(){if(oe.hasPopupMouseDown=!0,clearTimeout(oe.mouseDownTimeout),oe.mouseDownTimeout=window.setTimeout(function(){oe.hasPopupMouseDown=!1},0),oe.context){var ve;(ve=oe.context).onPopupMouseDown.apply(ve,arguments)}},oe.onDocumentClick=function(ve){if(oe.props.mask&&!oe.props.maskClosable)return;var ke=ve.target,Ie=oe.getRootDomNode(),je=oe.getPopupDomNode();(!Object(Rt.a)(Ie,ke)||oe.isContextMenuOnly())&&!Object(Rt.a)(je,ke)&&!oe.hasPopupMouseDown&&oe.close()},oe.getRootDomNode=function(){var ve=oe.props.getTriggerDOMNode;if(ve)return ve(oe.triggerRef.current);try{var ke=Object(xt.a)(oe.triggerRef.current);if(ke)return ke}catch(Ie){}return vt.a.findDOMNode(Object(m.a)(oe))},oe.getPopupClassNameFromAlign=function(ve){var ke=[],Ie=oe.props,je=Ie.popupPlacement,Ze=Ie.builtinPlacements,mt=Ie.prefixCls,bt=Ie.alignPoint,Ut=Ie.getPopupClassNameFromAlign;return je&&Ze&&ke.push(ut(Ze,mt,ve,bt)),Ut&&ke.push(Ut(ve)),ke.join(" ")},oe.getComponent=function(){var ve=oe.props,ke=ve.prefixCls,Ie=ve.destroyPopupOnHide,je=ve.popupClassName,Ze=ve.onPopupAlign,mt=ve.popupMotion,bt=ve.popupAnimation,Ut=ve.popupTransitionName,Rn=ve.popupStyle,Qn=ve.mask,jn=ve.maskAnimation,Vn=ve.maskTransitionName,Yn=ve.maskMotion,Xn=ve.zIndex,Wn=ve.popup,Jn=ve.stretch,ei=ve.alignPoint,ki=ve.mobile,ti=ve.forceRender,gn=oe.state,fn=gn.popupVisible,Hn=gn.point,ui=oe.getPopupAlign(),an={};return oe.isMouseEnterToShow()&&(an.onMouseEnter=oe.onPopupMouseEnter),oe.isMouseLeaveToHide()&&(an.onMouseLeave=oe.onPopupMouseLeave),an.onMouseDown=oe.onPopupMouseDown,an.onTouchStart=oe.onPopupMouseDown,I.createElement(En,Object(T.a)({prefixCls:ke,destroyPopupOnHide:Ie,visible:fn,point:ei&&Hn,className:je,align:ui,onAlign:Ze,animation:bt,getClassNameFromAlign:oe.getPopupClassNameFromAlign},an,{stretch:Jn,getRootDomNode:oe.getRootDomNode,style:Rn,mask:Qn,zIndex:Xn,transitionName:Ut,maskAnimation:jn,maskTransitionName:Vn,maskMotion:Yn,ref:oe.popupRef,motion:mt,mobile:ki,forceRender:ti}),typeof Wn=="function"?Wn():Wn)},oe.attachParent=function(ve){at.a.cancel(oe.attachId);var ke=oe.props,Ie=ke.getPopupContainer,je=ke.getDocument,Ze=oe.getRootDomNode(),mt;Ie?(Ze||Ie.length===0)&&(mt=Ie(Ze)):mt=je(oe.getRootDomNode()).body,mt?mt.appendChild(ve):oe.attachId=Object(at.a)(function(){oe.attachParent(ve)})},oe.getContainer=function(){var ve=oe.props.getDocument,ke=ve(oe.getRootDomNode()).createElement("div");return ke.style.position="absolute",ke.style.top="0",ke.style.left="0",ke.style.width="100%",oe.attachParent(ke),ke},oe.setPoint=function(ve){var ke=oe.props.alignPoint;if(!ke||!ve)return;oe.setState({point:{pageX:ve.pageX,pageY:ve.pageY}})},oe.handlePortalUpdate=function(){oe.state.prevPopupVisible!==oe.state.popupVisible&&oe.props.afterPopupVisibleChange(oe.state.popupVisible)},oe.triggerContextValue={onPopupMouseDown:oe.onPopupMouseDown};var we;return"popupVisible"in me?we=!!me.popupVisible:we=!!me.defaultPopupVisible,oe.state={prevPopupVisible:we,popupVisible:we},Sn.forEach(function(ve){oe["fire".concat(ve)]=function(ke){oe.fireEvents(ve,ke)}}),oe}return Object(w.a)(re,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var oe=this.props,we=this.state;if(we.popupVisible){var ve;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ve=oe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ye.a)(ve,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ve=ve||oe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ye.a)(ve,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ve=ve||oe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ye.a)(ve,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ye.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),at.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var oe;return((oe=this.popupRef.current)===null||oe===void 0?void 0:oe.getElement())||null}},{key:"getPopupAlign",value:function(){var oe=this.props,we=oe.popupPlacement,ve=oe.popupAlign,ke=oe.builtinPlacements;return we&&ke?ze(ke,we,ve):ve}},{key:"setPopupVisible",value:function(oe,we){var ve=this.props.alignPoint,ke=this.state.popupVisible;this.clearDelayTimer(),ke!==oe&&("popupVisible"in this.props||this.setState({popupVisible:oe,prevPopupVisible:ke}),this.props.onPopupVisibleChange(oe)),ve&&we&&oe&&this.setPoint(we)}},{key:"delaySetPopupVisible",value:function(oe,we,ve){var ke=this,Ie=we*1e3;if(this.clearDelayTimer(),Ie){var je=ve?{pageX:ve.pageX,pageY:ve.pageY}:null;this.delayTimer=window.setTimeout(function(){ke.setPopupVisible(oe,je),ke.clearDelayTimer()},Ie)}else this.setPopupVisible(oe,ve)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(oe){var we=this.props.children.props,ve=this.props;return we[oe]&&ve[oe]?this["fire".concat(oe)]:we[oe]||ve[oe]}},{key:"isClickToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var oe=this.props.action;return oe==="contextMenu"||oe.length===1&&oe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("contextMenu")!==-1||ve.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var oe=this.props,we=oe.action,ve=oe.hideAction;return we.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("hover")!==-1||ve.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var oe=this.props,we=oe.action,ve=oe.hideAction;return we.indexOf("hover")!==-1||ve.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("focus")!==-1||ve.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var oe=this.props,we=oe.action,ve=oe.hideAction;return we.indexOf("focus")!==-1||ve.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var oe;(oe=this.popupRef.current)===null||oe===void 0||oe.forceAlign()}}},{key:"fireEvents",value:function(oe,we){var ve=this.props.children.props[oe];ve&&ve(we);var ke=this.props[oe];ke&&ke(we)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var oe=this.state.popupVisible,we=this.props,ve=we.children,ke=we.forceRender,Ie=we.alignPoint,je=we.className,Ze=we.autoDestroy,mt=I.Children.only(ve),bt={key:"trigger"};this.isContextMenuToShow()?bt.onContextMenu=this.onContextMenu:bt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(bt.onClick=this.onClick,bt.onMouseDown=this.onMouseDown,bt.onTouchStart=this.onTouchStart):(bt.onClick=this.createTwoChains("onClick"),bt.onMouseDown=this.createTwoChains("onMouseDown"),bt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(bt.onMouseEnter=this.onMouseEnter,Ie&&(bt.onMouseMove=this.onMouseMove)):bt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?bt.onMouseLeave=this.onMouseLeave:bt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(bt.onFocus=this.onFocus,bt.onBlur=this.onBlur):(bt.onFocus=this.createTwoChains("onFocus"),bt.onBlur=this.createTwoChains("onBlur"));var Ut=K()(mt&&mt.props&&mt.props.className,je);Ut&&(bt.className=Ut);var Rn=Object(V.a)({},bt);Object(Tt.c)(mt)&&(Rn.ref=Object(Tt.a)(this.triggerRef,mt.ref));var Qn=I.cloneElement(mt,Rn),jn;return(oe||this.popupRef.current||ke)&&(jn=I.createElement(ye,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!oe&&Ze&&(jn=null),I.createElement(hn.Provider,{value:this.triggerContextValue},Qn,jn)}}],[{key:"getDerivedStateFromProps",value:function(oe,we){var ve=oe.popupVisible,ke={};return ve!==void 0&&we.popupVisible!==ve&&(ke.popupVisible=ve,ke.prevPopupVisible=we.popupVisible),ke}}]),re}(I.Component);return Oe.contextType=hn,Oe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:zn,getDocument:un,onPopupVisibleChange:Ln,afterPopupVisibleChange:Ln,onPopupAlign:Ln,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Oe}var Nn=di(Mt.a),zt={adjustX:1,adjustY:1},An={topLeft:{points:["bl","tl"],overflow:zt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:zt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:zt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:zt,offset:[4,0]}},si={topLeft:{points:["bl","tl"],overflow:zt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:zt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:zt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:zt,offset:[4,0]}},Un=An,Xt=0,jt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},pn=function(Oe,Me,Ce){var re=Ne(Me),me=Oe.getState();Oe.setState({defaultActiveFirst:Object(V.a)(Object(V.a)({},me.defaultActiveFirst),{},Object(de.a)({},re,Ce))})},Ct=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(Ce){var re;Object(A.a)(this,Me),re=Oe.call(this,Ce),re.onDestroy=function(Ie){re.props.onDestroy(Ie)},re.onKeyDown=function(Ie){var je=Ie.keyCode,Ze=re.menuInstance,mt=re.props.store,bt=re.getVisible();if(je===d.a.ENTER)return re.onTitleClick(Ie),pn(mt,re.props.eventKey,!0),!0;if(je===d.a.RIGHT)return bt?Ze.onKeyDown(Ie):(re.triggerOpenChange(!0),pn(mt,re.props.eventKey,!0)),!0;if(je===d.a.LEFT){var Ut;if(bt)Ut=Ze.onKeyDown(Ie);else return;return Ut||(re.triggerOpenChange(!1),Ut=!0),Ut}return bt&&(je===d.a.UP||je===d.a.DOWN)?Ze.onKeyDown(Ie):void 0},re.onOpenChange=function(Ie){re.props.onOpenChange(Ie)},re.onPopupVisibleChange=function(Ie){re.triggerOpenChange(Ie,Ie?"mouseenter":"mouseleave")},re.onMouseEnter=function(Ie){var je=re.props,Ze=je.eventKey,mt=je.onMouseEnter,bt=je.store;pn(bt,re.props.eventKey,!1),mt({key:Ze,domEvent:Ie})},re.onMouseLeave=function(Ie){var je=re.props,Ze=je.parentMenu,mt=je.eventKey,bt=je.onMouseLeave;Ze.subMenuInstance=Object(m.a)(re),bt({key:mt,domEvent:Ie})},re.onTitleMouseEnter=function(Ie){var je=re.props,Ze=je.eventKey,mt=je.onItemHover,bt=je.onTitleMouseEnter;mt({key:Ze,hover:!0}),bt({key:Ze,domEvent:Ie})},re.onTitleMouseLeave=function(Ie){var je=re.props,Ze=je.parentMenu,mt=je.eventKey,bt=je.onItemHover,Ut=je.onTitleMouseLeave;Ze.subMenuInstance=Object(m.a)(re),bt({key:mt,hover:!1}),Ut({key:mt,domEvent:Ie})},re.onTitleClick=function(Ie){var je=Object(m.a)(re),Ze=je.props;if(Ze.onTitleClick({key:Ze.eventKey,domEvent:Ie}),Ze.triggerSubMenuAction==="hover")return;re.triggerOpenChange(!re.getVisible(),"click"),pn(Ze.store,re.props.eventKey,!1)},re.onSubMenuClick=function(Ie){typeof re.props.onClick=="function"&&re.props.onClick(re.addKeyPath(Ie))},re.onSelect=function(Ie){re.props.onSelect(Ie)},re.onDeselect=function(Ie){re.props.onDeselect(Ie)},re.getPrefixCls=function(){return"".concat(re.props.rootPrefixCls,"-submenu")},re.getActiveClassName=function(){return"".concat(re.getPrefixCls(),"-active")},re.getDisabledClassName=function(){return"".concat(re.getPrefixCls(),"-disabled")},re.getSelectedClassName=function(){return"".concat(re.getPrefixCls(),"-selected")},re.getOpenClassName=function(){return"".concat(re.props.rootPrefixCls,"-submenu-open")},re.getVisible=function(){return re.state.isOpen},re.getMode=function(){return re.state.mode},re.saveMenuInstance=function(Ie){re.menuInstance=Ie},re.addKeyPath=function(Ie){return Object(V.a)(Object(V.a)({},Ie),{},{keyPath:(Ie.keyPath||[]).concat(re.props.eventKey)})},re.triggerOpenChange=function(Ie,je){var Ze=re.props.eventKey,mt=function(){re.onOpenChange({key:Ze,item:Object(m.a)(re),trigger:je,open:Ie})};je==="mouseenter"?re.mouseenterTimeout=setTimeout(function(){mt()},0):mt()},re.isChildrenSelected=function(){var Ie={find:!1};return Je(re.props.children,re.props.selectedKeys,Ie),Ie.find},re.isInlineMode=function(){return re.getMode()==="inline"},re.adjustWidth=function(){if(!re.subMenuTitle||!re.menuInstance)return;var Ie=pt.findDOMNode(re.menuInstance);if(Ie.offsetWidth>=re.subMenuTitle.offsetWidth)return;Ie.style.minWidth="".concat(re.subMenuTitle.offsetWidth,"px")},re.saveSubMenuTitle=function(Ie){re.subMenuTitle=Ie},re.getBaseProps=function(){var Ie=Object(m.a)(re),je=Ie.props,Ze=re.getMode();return{mode:Ze==="horizontal"?"vertical":Ze,visible:re.getVisible(),level:je.level+1,inlineIndent:je.inlineIndent,focusable:!1,onClick:re.onSubMenuClick,onSelect:re.onSelect,onDeselect:re.onDeselect,onDestroy:re.onDestroy,selectedKeys:je.selectedKeys,eventKey:"".concat(je.eventKey,"-menu-"),openKeys:je.openKeys,motion:je.motion,onOpenChange:re.onOpenChange,subMenuOpenDelay:je.subMenuOpenDelay,parentMenu:Object(m.a)(re),subMenuCloseDelay:je.subMenuCloseDelay,forceSubMenuRender:je.forceSubMenuRender,triggerSubMenuAction:je.triggerSubMenuAction,builtinPlacements:je.builtinPlacements,defaultActiveFirst:je.store.getState().defaultActiveFirst[Ne(je.eventKey)],multiple:je.multiple,prefixCls:je.rootPrefixCls,id:re.internalMenuId,manualRef:re.saveMenuInstance,itemIcon:je.itemIcon,expandIcon:je.expandIcon,direction:je.direction}},re.getMotion=function(Ie,je){var Ze=Object(m.a)(re),mt=Ze.haveRendered,bt=re.props,Ut=bt.motion,Rn=bt.rootPrefixCls,Qn=Object(V.a)(Object(V.a)({},Ut),{},{leavedClassName:"".concat(Rn,"-hidden"),removeOnLeave:!1,motionAppear:mt||!je||Ie!=="inline"});return Qn};var me=Ce.store,oe=Ce.eventKey,we=me.getState(),ve=we.defaultActiveFirst;re.isRootMenu=!1;var ke=!1;return ve&&(ke=ve[oe]),pn(me,oe,ke),re.state={mode:Ce.mode,isOpen:Ce.isOpen},re}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var re=this,me=this.props,oe=me.mode,we=me.parentMenu,ve=me.manualRef,ke=me.isOpen,Ie=function(){re.setState({mode:oe,isOpen:ke})},je=ke!==this.state.isOpen,Ze=oe!==this.state.mode;if((Ze||je)&&(at.a.cancel(this.updateStateRaf),Ze?this.updateStateRaf=Object(at.a)(Ie):Ie()),ve&&ve(this),oe!=="horizontal"||!(we==null?void 0:we.isRootMenu)||!ke)return;this.minWidthTimeout=setTimeout(function(){return re.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var re=this.props,me=re.onDestroy,oe=re.eventKey;me&&me(oe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),at.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(re,me){var oe=this.getBaseProps();return I.createElement(li,Object(T.a)({},oe,{id:this.internalMenuId,className:re,style:me}),this.props.children)}},{key:"renderChildren",value:function(){var re=this,me=this.getBaseProps(),oe=me.mode,we=me.visible,ve=me.forceSubMenuRender,ke=me.direction,Ie=this.getMotion(oe,we);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||we||ve,!this.haveOpened)return I.createElement("div",null);var je=K()("".concat(me.prefixCls,"-sub"),Object(de.a)({},"".concat(me.prefixCls,"-rtl"),ke==="rtl"));return this.isInlineMode()?I.createElement(te,Object(T.a)({visible:me.visible,forceRender:ve},Ie),function(Ze){var mt=Ze.className,bt=Ze.style,Ut=K()(je,mt);return re.renderPopupMenu(Ut,bt)}):this.renderPopupMenu(je)}},{key:"render",value:function(){var re,me,oe,we=Object(V.a)({},this.props),ve=this.getVisible(),ke=this.getPrefixCls(),Ie=this.isInlineMode(),je=this.getMode(),Ze=K()(ke,"".concat(ke,"-").concat(je),(re={},Object(de.a)(re,we.className,!!we.className),Object(de.a)(re,this.getOpenClassName(),ve),Object(de.a)(re,this.getActiveClassName(),we.active||ve&&!Ie),Object(de.a)(re,this.getDisabledClassName(),we.disabled),Object(de.a)(re,this.getSelectedClassName(),this.isChildrenSelected()),re));this.internalMenuId||(we.eventKey?this.internalMenuId="".concat(we.eventKey,"$Menu"):(Xt+=1,this.internalMenuId="$__$".concat(Xt,"$Menu")));var mt={},bt={},Ut={};we.disabled||(mt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},bt={onClick:this.onTitleClick},Ut={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Rn={},Qn=we.direction,jn=Qn==="rtl";Ie&&(jn?Rn.paddingRight=we.inlineIndent*we.level:Rn.paddingLeft=we.inlineIndent*we.level);var Vn={};this.getVisible()&&(Vn={"aria-owns":this.internalMenuId});var Yn=null;je!=="horizontal"&&(Yn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Yn=I.createElement(this.props.expandIcon,Object(V.a)({},this.props))));var Xn=I.createElement("div",Object(T.a)({ref:this.saveSubMenuTitle,style:Rn,className:"".concat(ke,"-title"),role:"button"},Ut,bt,{"aria-expanded":ve},Vn,{"aria-haspopup":"true",title:typeof we.title=="string"?we.title:void 0}),we.title,Yn||I.createElement("i",{className:"".concat(ke,"-arrow")})),Wn=this.renderChildren(),Jn=((me=we.parentMenu)===null||me===void 0?void 0:me.isRootMenu)?we.parentMenu.props.getPopupContainer:function(bi){return bi.parentNode},ei=jt[je],ki=we.popupOffset?{offset:we.popupOffset}:{},ti=K()((oe={},Object(de.a)(oe,we.popupClassName,we.popupClassName&&!Ie),Object(de.a)(oe,"".concat(ke,"-rtl"),jn),oe)),gn=we.disabled,fn=we.triggerSubMenuAction,Hn=we.subMenuOpenDelay,ui=we.forceSubMenuRender,an=we.subMenuCloseDelay,ci=we.builtinPlacements;tt.forEach(function(bi){return delete we[bi]}),delete we.onClick;var Mi=jn?Object(V.a)(Object(V.a)({},si),ci):Object(V.a)(Object(V.a)({},An),ci);delete we.direction;var ri=this.getBaseProps(),wi=Ie?null:this.getMotion(ri.mode,ri.visible);return I.createElement("li",Object(T.a)({},we,mt,{className:Ze,role:"menuitem"}),I.createElement(Nn,{prefixCls:ke,popupClassName:K()("".concat(ke,"-popup"),ti),getPopupContainer:Jn,builtinPlacements:Mi,popupPlacement:ei,popupVisible:Ie?!1:ve,popupAlign:ki,popup:Ie?null:Wn,action:gn||Ie?[]:[fn],mouseEnterDelay:Hn,mouseLeaveDelay:an,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ui,popupMotion:wi},Xn),Ie?Wn:null)}}]),Me}(I.Component);Ct.defaultProps={onMouseEnter:Ue,onMouseLeave:Ue,onTitleMouseEnter:Ue,onTitleMouseLeave:Ue,onTitleClick:Ue,manualRef:Ue,mode:"vertical",title:""};var Nt=Object(o.b)(function(ye,Oe){var Me=ye.openKeys,Ce=ye.activeKey,re=ye.selectedKeys,me=Oe.eventKey,oe=Oe.subMenuKey;return{isOpen:Me.indexOf(me)>-1,active:Ce[oe]===me,selectedKeys:re}})(Ct);Nt.isSubMenu=!0;var Dt=Nt,Pe="menuitem-overflowed",Yt=.5,xn=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){var Ce;return Object(A.a)(this,Me),Ce=Oe.apply(this,arguments),Ce.resizeObserver=null,Ce.mutationObserver=null,Ce.originalTotalWidth=0,Ce.overflowedItems=[],Ce.menuItemSizes=[],Ce.cancelFrameId=null,Ce.state={lastVisibleIndex:void 0},Ce.childRef=I.createRef(),Ce.getMenuItemNodes=function(){var re=Ce.props.prefixCls,me=Ce.childRef.current;return me?[].slice.call(me.children).filter(function(oe){return oe.className.split(" ").indexOf("".concat(re,"-overflowed-submenu"))<0}):[]},Ce.getOverflowedSubMenuItem=function(re,me,oe){var we=Ce.props,ve=we.overflowedIndicator,ke=we.level,Ie=we.mode,je=we.prefixCls,Ze=we.theme;if(ke!==1||Ie!=="horizontal")return null;var mt=Ce.props.children[0],bt=mt.props,Ut=bt.children,Rn=bt.title,Qn=bt.style,jn=Object(M.a)(bt,["children","title","style"]),Vn=Object(V.a)({},Qn),Yn="".concat(re,"-overflowed-indicator"),Xn="".concat(re,"-overflowed-indicator");me.length===0&&oe!==!0?Vn=Object(V.a)(Object(V.a)({},Vn),{},{display:"none"}):oe&&(Vn=Object(V.a)(Object(V.a)({},Vn),{},{visibility:"hidden",position:"absolute"}),Yn="".concat(Yn,"-placeholder"),Xn="".concat(Xn,"-placeholder"));var Wn=Ze?"".concat(je,"-").concat(Ze):"",Jn={};return tt.forEach(function(ei){jn[ei]!==void 0&&(Jn[ei]=jn[ei])}),I.createElement(Dt,Object(T.a)({title:ve,className:"".concat(je,"-overflowed-submenu"),popupClassName:Wn},Jn,{key:Yn,eventKey:Xn,disabled:!1,style:Vn}),me)},Ce.setChildrenWidthAndResize=function(){if(Ce.props.mode!=="horizontal")return;var re=Ce.childRef.current;if(!re)return;var me=re.children;if(!me||me.length===0)return;var oe=re.children[me.length-1];rt(oe,"display","inline-block");var we=Ce.getMenuItemNodes(),ve=we.filter(function(ke){return ke.className.split(" ").indexOf(Pe)>=0});ve.forEach(function(ke){rt(ke,"display","inline-block")}),Ce.menuItemSizes=we.map(function(ke){return it(ke,!0)}),ve.forEach(function(ke){rt(ke,"display","none")}),Ce.overflowedIndicatorWidth=it(re.children[re.children.length-1],!0),Ce.originalTotalWidth=Ce.menuItemSizes.reduce(function(ke,Ie){return ke+Ie},0),Ce.handleResize(),rt(oe,"display","none")},Ce.handleResize=function(){if(Ce.props.mode!=="horizontal")return;var re=Ce.childRef.current;if(!re)return;var me=it(re);Ce.overflowedItems=[];var oe=0,we;Ce.originalTotalWidth>me+Yt&&(we=-1,Ce.menuItemSizes.forEach(function(ve){oe+=ve,oe+Ce.overflowedIndicatorWidth<=me&&(we+=1)})),Ce.setState({lastVisibleIndex:we})},Ce}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){var re=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var me=this.childRef.current;if(!me)return;this.resizeObserver=new gt.default(function(oe){oe.forEach(function(){var we=re.cancelFrameId;cancelAnimationFrame(we),re.cancelFrameId=requestAnimationFrame(re.setChildrenWidthAndResize)})}),[].slice.call(me.children).concat(me).forEach(function(oe){re.resizeObserver.observe(oe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){re.resizeObserver.disconnect(),[].slice.call(me.children).concat(me).forEach(function(oe){re.resizeObserver.observe(oe)}),re.setChildrenWidthAndResize()}),this.mutationObserver.observe(me,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(re){var me=this,oe=this.state.lastVisibleIndex;return(re||[]).reduce(function(we,ve,ke){var Ie=ve;if(me.props.mode==="horizontal"){var je=me.getOverflowedSubMenuItem(ve.props.eventKey,[]);oe!==void 0&&me.props.className.indexOf("".concat(me.props.prefixCls,"-root"))!==-1&&(ke>oe&&(Ie=I.cloneElement(ve,{style:{display:"none"},eventKey:"".concat(ve.props.eventKey,"-hidden"),className:"".concat(Pe)})),ke===oe+1&&(me.overflowedItems=re.slice(oe+1).map(function(mt){return I.cloneElement(mt,{key:mt.props.eventKey,mode:"vertical-left"})}),je=me.getOverflowedSubMenuItem(ve.props.eventKey,me.overflowedItems)));var Ze=[].concat(Object(P.a)(we),[je,Ie]);return ke===re.length-1&&Ze.push(me.getOverflowedSubMenuItem(ve.props.eventKey,[],!0)),Ze}return[].concat(Object(P.a)(we),[Ie])},[])}},{key:"render",value:function(){var re=this.props,me=re.visible,oe=re.prefixCls,we=re.overflowedIndicator,ve=re.mode,ke=re.level,Ie=re.tag,je=re.children,Ze=re.theme,mt=Object(M.a)(re,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),bt=Ie;return I.createElement(bt,Object(T.a)({ref:this.childRef},mt),this.renderChildren(je))}}]),Me}(I.Component);xn.defaultProps={tag:"div",className:""};var pi=xn;function On(ye){return ye.length?ye.every(function(Oe){return!!Oe.props.disabled}):!0}function tr(ye,Oe,Me){var Ce=ye.getState();ye.setState({activeKey:Object(V.a)(Object(V.a)({},Ce.activeKey),{},Object(de.a)({},Oe,Me))})}function nr(ye){return ye.eventKey||"0-menu-"}function Fi(ye,Oe){var Me=Oe,Ce=ye.children,re=ye.eventKey;if(Me){var me;if(Be(Ce,function(oe,we){oe&&oe.props&&!oe.props.disabled&&Me===He(oe,re,we)&&(me=!0)}),me)return Me}return Me=null,ye.defaultActiveFirst&&Be(Ce,function(oe,we){!Me&&oe&&!oe.props.disabled&&(Me=He(oe,re,we))}),Me}function Bn(ye){if(!ye)return;var Oe=this.instanceArray.indexOf(ye);Oe!==-1?this.instanceArray[Oe]=ye:this.instanceArray.push(ye)}var Ft=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(Ce){var re;return Object(A.a)(this,Me),re=Oe.call(this,Ce),re.onKeyDown=function(me,oe){var we=me.keyCode,ve;if(re.getFlatInstanceArray().forEach(function(Ie){Ie&&Ie.props.active&&Ie.onKeyDown&&(ve=Ie.onKeyDown(me))}),ve)return 1;var ke=null;return(we===d.a.UP||we===d.a.DOWN)&&(ke=re.step(we===d.a.UP?-1:1)),ke?(me.preventDefault(),tr(re.props.store,nr(re.props),ke.props.eventKey),typeof oe=="function"&&oe(ke),1):void 0},re.onItemHover=function(me){var oe=me.key,we=me.hover;tr(re.props.store,nr(re.props),we?oe:null)},re.onDeselect=function(me){re.props.onDeselect(me)},re.onSelect=function(me){re.props.onSelect(me)},re.onClick=function(me){re.props.onClick(me)},re.onOpenChange=function(me){re.props.onOpenChange(me)},re.onDestroy=function(me){re.props.onDestroy(me)},re.getFlatInstanceArray=function(){return re.instanceArray},re.step=function(me){var oe=re.getFlatInstanceArray(),we=re.props.store.getState().activeKey[nr(re.props)],ve=oe.length;if(!ve)return null;me<0&&(oe=oe.concat().reverse());var ke=-1;if(oe.every(function(mt,bt){return mt&&mt.props.eventKey===we?(ke=bt,!1):!0}),!re.props.defaultActiveFirst&&ke!==-1&&On(oe.slice(ke,ve-1)))return;var Ie=(ke+1)%ve,je=Ie;do{var Ze=oe[je];if(!Ze||Ze.props.disabled)je=(je+1)%ve;else return Ze}while(je!==Ie);return null},re.renderCommonMenuItem=function(me,oe,we){var ve=re.props.store.getState(),ke=Object(m.a)(re),Ie=ke.props,je=He(me,Ie.eventKey,oe),Ze=me.props;if(!Ze||typeof me.type=="string")return me;var mt=je===ve.activeKey,bt=Object(V.a)(Object(V.a)({mode:Ze.mode||Ie.mode,level:Ie.level,inlineIndent:Ie.inlineIndent,renderMenuItem:re.renderMenuItem,rootPrefixCls:Ie.prefixCls,index:oe,parentMenu:Ie.parentMenu,manualRef:Ze.disabled?void 0:Object(g.a)(me.ref,Bn.bind(Object(m.a)(re))),eventKey:je,active:!Ze.disabled&&mt,multiple:Ie.multiple,onClick:function(Rn){(Ze.onClick||Ue)(Rn),re.onClick(Rn)},onItemHover:re.onItemHover,motion:Ie.motion,subMenuOpenDelay:Ie.subMenuOpenDelay,subMenuCloseDelay:Ie.subMenuCloseDelay,forceSubMenuRender:Ie.forceSubMenuRender,onOpenChange:re.onOpenChange,onDeselect:re.onDeselect,onSelect:re.onSelect,builtinPlacements:Ie.builtinPlacements,itemIcon:Ze.itemIcon||re.props.itemIcon,expandIcon:Ze.expandIcon||re.props.expandIcon},we),{},{direction:Ie.direction});return(Ie.mode==="inline"||qe())&&(bt.triggerSubMenuAction="click"),I.cloneElement(me,Object(V.a)(Object(V.a)({},bt),{},{key:je||oe}))},re.renderMenuItem=function(me,oe,we){if(!me)return null;var ve=re.props.store.getState(),ke={openKeys:ve.openKeys,selectedKeys:ve.selectedKeys,triggerSubMenuAction:re.props.triggerSubMenuAction,subMenuKey:we};return re.renderCommonMenuItem(me,oe,ke)},Ce.store.setState({activeKey:Object(V.a)(Object(V.a)({},Ce.store.getState().activeKey),{},Object(de.a)({},Ce.eventKey,Fi(Ce,Ce.activeKey)))}),re.instanceArray=[],re}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(re){return this.props.visible||re.visible||this.props.className!==re.className||!N()(this.props.style,re.style)}},{key:"componentDidUpdate",value:function(re){var me=this.props,oe="activeKey"in me?me.activeKey:me.store.getState().activeKey[nr(me)],we=Fi(me,oe);if(we!==oe)tr(me.store,nr(me),we);else if("activeKey"in re){var ve=Fi(re,re.activeKey);we!==ve&&tr(me.store,nr(me),we)}}},{key:"render",value:function(){var re=this,me=Object(T.a)({},this.props);this.instanceArray=[];var oe=K()(me.prefixCls,me.className,"".concat(me.prefixCls,"-").concat(me.mode)),we={className:oe,role:me.role||"menu"};me.id&&(we.id=me.id),me.focusable&&(we.tabIndex=0,we.onKeyDown=this.onKeyDown);var ve=me.prefixCls,ke=me.eventKey,Ie=me.visible,je=me.level,Ze=me.mode,mt=me.overflowedIndicator,bt=me.theme;return tt.forEach(function(Ut){return delete me[Ut]}),delete me.onClick,I.createElement(pi,Object(T.a)({},me,{prefixCls:ve,mode:Ze,tag:"ul",level:je,theme:bt,visible:Ie,overflowedIndicator:mt},we),Object(W.a)(me.children).map(function(Ut,Rn){return re.renderMenuItem(Ut,Rn,ke||"0-menu-")}))}}]),Me}(I.Component);Ft.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ue};var yi=Object(o.b)()(Ft),li=yi,$n=G("Kwbf");function ir(ye,Oe,Me){var Ce=ye.prefixCls,re=ye.motion,me=ye.defaultMotions,oe=me===void 0?{}:me,we=ye.openAnimation,ve=ye.openTransitionName,ke=Oe.switchingModeFromInline;if(re)return re;if(Object(U.a)(we)==="object"&&we)Object($n.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof we=="string")return{motionName:"".concat(Ce,"-open-").concat(we)};if(ve)return{motionName:ve};var Ie=oe[Me];return Ie||(ke?null:oe.other)}var Qt=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(Ce){var re;Object(A.a)(this,Me),re=Oe.call(this,Ce),re.onSelect=function(we){var ve=Object(m.a)(re),ke=ve.props;if(ke.selectable){var Ie=re.store.getState(),je=Ie.selectedKeys,Ze=we.key;ke.multiple?je=je.concat([Ze]):je=[Ze],"selectedKeys"in ke||re.store.setState({selectedKeys:je}),ke.onSelect(Object(V.a)(Object(V.a)({},we),{},{selectedKeys:je}))}},re.onClick=function(we){var ve=re.getRealMenuMode(),ke=Object(m.a)(re),Ie=ke.store,je=ke.props.onOpenChange;ve!=="inline"&&!("openKeys"in re.props)&&(Ie.setState({openKeys:[]}),je([])),re.props.onClick(we)},re.onKeyDown=function(we,ve){re.innerMenu.getWrappedInstance().onKeyDown(we,ve)},re.onOpenChange=function(we){var ve=Object(m.a)(re),ke=ve.props,Ie=re.store.getState().openKeys.concat(),je=!1,Ze=function(bt){var Ut=!1;if(bt.open)Ut=Ie.indexOf(bt.key)===-1,Ut&&Ie.push(bt.key);else{var Rn=Ie.indexOf(bt.key);Ut=Rn!==-1,Ut&&Ie.splice(Rn,1)}je=je||Ut};Array.isArray(we)?we.forEach(Ze):Ze(we),je&&("openKeys"in re.props||re.store.setState({openKeys:Ie}),ke.onOpenChange(Ie))},re.onDeselect=function(we){var ve=Object(m.a)(re),ke=ve.props;if(ke.selectable){var Ie=re.store.getState().selectedKeys.concat(),je=we.key,Ze=Ie.indexOf(je);Ze!==-1&&Ie.splice(Ze,1),"selectedKeys"in ke||re.store.setState({selectedKeys:Ie}),ke.onDeselect(Object(V.a)(Object(V.a)({},we),{},{selectedKeys:Ie}))}},re.onMouseEnter=function(we){re.restoreModeVerticalFromInline();var ve=re.props.onMouseEnter;ve&&ve(we)},re.onTransitionEnd=function(we){var ve=we.propertyName==="width"&&we.target===we.currentTarget,ke=we.target.className,Ie=Object.prototype.toString.call(ke)==="[object SVGAnimatedString]"?ke.animVal:ke,je=we.propertyName==="font-size"&&Ie.indexOf("anticon")>=0;(ve||je)&&re.restoreModeVerticalFromInline()},re.setInnerMenu=function(we){re.innerMenu=we},re.isRootMenu=!0;var me=Ce.defaultSelectedKeys,oe=Ce.defaultOpenKeys;return"selectedKeys"in Ce&&(me=Ce.selectedKeys||[]),"openKeys"in Ce&&(oe=Ce.openKeys||[]),re.store=Object(o.c)({selectedKeys:me,openKeys:oe,activeKey:{"0-menu-":Fi(Ce,Ce.activeKey)}}),re.state={switchingModeFromInline:!1,prevProps:Ce,inlineOpenKeys:[],store:re.store},re}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(re){var me=this.props,oe=me.siderCollapsed,we=me.inlineCollapsed,ve=me.onOpenChange;(!re.inlineCollapsed&&we||!re.siderCollapsed&&oe)&&ve([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var re=this.props.collapsedWidth,me=this.store,oe=this.prevOpenKeys,we=this.getInlineCollapsed()&&(re===0||re==="0"||re==="0px");we?(this.prevOpenKeys=me.getState().openKeys.concat(),this.store.setState({openKeys:[]})):oe&&(this.store.setState({openKeys:oe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var re=this.props.mode,me=this.state.switchingModeFromInline,oe=this.getInlineCollapsed();return me&&oe?"inline":oe?"vertical":re}},{key:"getInlineCollapsed",value:function(){var re=this.props,me=re.inlineCollapsed,oe=re.siderCollapsed;return oe!==void 0?oe:me}},{key:"restoreModeVerticalFromInline",value:function(){var re=this.state.switchingModeFromInline;re&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var re=Object(V.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),me=this.getRealMenuMode();return re.className+=" ".concat(re.prefixCls,"-root"),re.direction==="rtl"&&(re.className+=" ".concat(re.prefixCls,"-rtl")),re=Object(V.a)(Object(V.a)({},re),{},{mode:me,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ir(this.props,this.state,me)}),delete re.openAnimation,delete re.openTransitionName,I.createElement(o.a,{store:this.store},I.createElement(li,Object(T.a)({},re,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(re,me){var oe=me.prevProps,we=me.store,ve=we.getState(),ke={},Ie={prevProps:re};return oe.mode==="inline"&&re.mode!=="inline"&&(Ie.switchingModeFromInline=!0),"openKeys"in re?ke.openKeys=re.openKeys||[]:((re.inlineCollapsed&&!oe.inlineCollapsed||re.siderCollapsed&&!oe.siderCollapsed)&&(Ie.switchingModeFromInline=!0,Ie.inlineOpenKeys=ve.openKeys,ke.openKeys=[]),(!re.inlineCollapsed&&oe.inlineCollapsed||!re.siderCollapsed&&oe.siderCollapsed)&&(ke.openKeys=me.inlineOpenKeys,Ie.inlineOpenKeys=[])),Object.keys(ke).length&&we.setState(ke),Ie}}]),Me}(I.Component);Qt.defaultProps={selectable:!0,onClick:Ue,onSelect:Ue,onOpenChange:Ue,onDeselect:Ue,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:I.createElement("span",null,"\xB7\xB7\xB7")};var qt=Qt,$t=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){var Ce;return Object(A.a)(this,Me),Ce=Oe.apply(this,arguments),Ce.onKeyDown=function(re){var me=re.keyCode;return me===d.a.ENTER?(Ce.onClick(re),!0):void 0},Ce.onMouseLeave=function(re){var me=Ce.props,oe=me.eventKey,we=me.onItemHover,ve=me.onMouseLeave;we({key:oe,hover:!1}),ve({key:oe,domEvent:re})},Ce.onMouseEnter=function(re){var me=Ce.props,oe=me.eventKey,we=me.onItemHover,ve=me.onMouseEnter;we({key:oe,hover:!0}),ve({key:oe,domEvent:re})},Ce.onClick=function(re){var me=Ce.props,oe=me.eventKey,we=me.multiple,ve=me.onClick,ke=me.onSelect,Ie=me.onDeselect,je=me.isSelected,Ze={key:oe,keyPath:[oe],item:Object(m.a)(Ce),domEvent:re};ve(Ze),we?je?Ie(Ze):ke(Ze):je||ke(Ze)},Ce.saveNode=function(re){Ce.node=re},Ce}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var re=this.props;re.onDestroy&&re.onDestroy(re.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var re,me=Object(V.a)({},this.props),oe=K()(this.getPrefixCls(),me.className,(re={},Object(de.a)(re,this.getActiveClassName(),!me.disabled&&me.active),Object(de.a)(re,this.getSelectedClassName(),me.isSelected),Object(de.a)(re,this.getDisabledClassName(),me.disabled),re)),we=Object(V.a)(Object(V.a)({},me.attribute),{},{title:typeof me.title=="string"?me.title:void 0,className:oe,role:me.role||"menuitem","aria-disabled":me.disabled});me.role==="option"?we=Object(V.a)(Object(V.a)({},we),{},{role:"option","aria-selected":me.isSelected}):(me.role===null||me.role==="none")&&(we.role="none");var ve={onClick:me.disabled?null:this.onClick,onMouseLeave:me.disabled?null:this.onMouseLeave,onMouseEnter:me.disabled?null:this.onMouseEnter},ke=Object(V.a)({},me.style);me.mode==="inline"&&(me.direction==="rtl"?ke.paddingRight=me.inlineIndent*me.level:ke.paddingLeft=me.inlineIndent*me.level),tt.forEach(function(je){return delete me[je]}),delete me.direction;var Ie=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ie=I.createElement(this.props.itemIcon,this.props)),I.createElement("li",Object(T.a)({},Object(E.a)(me,["onClick","onMouseEnter","onMouseLeave","onSelect"]),we,ve,{style:ke,ref:this.saveNode}),me.children,Ie)}}]),Me}(I.Component);$t.isMenuItem=!0,$t.defaultProps={onSelect:Ue,onMouseEnter:Ue,onMouseLeave:Ue,manualRef:Ue};var dn=Object(o.b)(function(ye,Oe){var Me=ye.activeKey,Ce=ye.selectedKeys,re=Oe.eventKey,me=Oe.subMenuKey;return{active:Me[me]===re,isSelected:Array.isArray(Ce)?Ce.indexOf(re)!==-1:Ce===re}})($t),Gn=dn,Mn=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){var Ce;return Object(A.a)(this,Me),Ce=Oe.apply(this,arguments),Ce.renderInnerMenuItem=function(re){var me=Ce.props,oe=me.renderMenuItem,we=me.index;return oe(re,we,Ce.props.subMenuKey)},Ce}return Object(w.a)(Me,[{key:"render",value:function(){var re=Object(T.a)({},this.props),me=re.className,oe=me===void 0?"":me,we=re.rootPrefixCls,ve="".concat(we,"-item-group-title"),ke="".concat(we,"-item-group-list"),Ie=re.title,je=re.children;return tt.forEach(function(Ze){return delete re[Ze]}),delete re.direction,I.createElement("li",Object(T.a)({},re,{onClick:function(mt){return mt.stopPropagation()},className:"".concat(oe," ").concat(we,"-item-group")}),I.createElement("div",{className:ve,title:typeof Ie=="string"?Ie:void 0},Ie),I.createElement("ul",{className:ke},I.Children.map(je,this.renderInnerMenuItem)))}}]),Me}(I.Component);Mn.isMenuItemGroup=!0,Mn.defaultProps={disabled:!0};var qn=Mn,mi=function(Oe){var Me=Oe.className,Ce=Oe.rootPrefixCls,re=Oe.style;return I.createElement("li",{className:"".concat(Me," ").concat(Ce,"-item-divider"),style:re})};mi.defaultProps={disabled:!0,className:"",style:{}};var Tr=mi,Zn=qt,$r=G("eDIo");function gi(ye,Oe){var Me=ye.prefixCls,Ce=ye.editable,re=ye.locale,me=ye.style;return!Ce||Ce.showAdd===!1?null:I.createElement("button",{ref:Oe,type:"button",className:"".concat(Me,"-nav-add"),style:me,"aria-label":(re==null?void 0:re.addAriaLabel)||"Add tab",onClick:function(we){Ce.onEdit("add",{event:we})}},Ce.addIcon||"+")}var fr=I.forwardRef(gi);function rr(ye,Oe){var Me=ye.prefixCls,Ce=ye.id,re=ye.tabs,me=ye.locale,oe=ye.mobile,we=ye.moreIcon,ve=we===void 0?"More":we,ke=ye.moreTransitionName,Ie=ye.style,je=ye.className,Ze=ye.editable,mt=ye.tabBarGutter,bt=ye.rtl,Ut=ye.onTabClick,Rn=Object(I.useState)(!1),Qn=Object(Z.a)(Rn,2),jn=Qn[0],Vn=Qn[1],Yn=Object(I.useState)(null),Xn=Object(Z.a)(Yn,2),Wn=Xn[0],Jn=Xn[1],ei="".concat(Ce,"-more-popup"),ki="".concat(Me,"-dropdown"),ti=Wn!==null?"".concat(ei,"-").concat(Wn):null,gn=me==null?void 0:me.dropdownAriaLabel,fn=I.createElement(Zn,{onClick:function(wi){var bi=wi.key,Hi=wi.domEvent;Ut(bi,Hi),Vn(!1)},id:ei,tabIndex:-1,role:"listbox","aria-activedescendant":ti,selectedKeys:[Wn],"aria-label":gn!==void 0?gn:"expanded dropdown"},re.map(function(ri){return I.createElement(Gn,{key:ri.key,id:"".concat(ei,"-").concat(ri.key),role:"option","aria-controls":Ce&&"".concat(Ce,"-panel-").concat(ri.key),disabled:ri.disabled},ri.tab)}));function Hn(ri){for(var wi=re.filter(function(vr){return!vr.disabled}),bi=wi.findIndex(function(vr){return vr.key===Wn})||0,Hi=wi.length,Gi=0;Gi<Hi;Gi+=1){bi=(bi+ri+Hi)%Hi;var Bi=wi[bi];if(!Bi.disabled){Jn(Bi.key);return}}}function ui(ri){var wi=ri.which;if(!jn){[d.a.DOWN,d.a.SPACE,d.a.ENTER].includes(wi)&&(Vn(!0),ri.preventDefault());return}switch(wi){case d.a.UP:Hn(-1),ri.preventDefault();break;case d.a.DOWN:Hn(1),ri.preventDefault();break;case d.a.ESC:Vn(!1);break;case d.a.SPACE:case d.a.ENTER:Wn!==null&&Ut(Wn,ri);break}}Object(I.useEffect)(function(){var ri=document.getElementById(ti);ri&&ri.scrollIntoView&&ri.scrollIntoView(!1)},[Wn]),Object(I.useEffect)(function(){jn||Jn(null)},[jn]);var an=Object(de.a)({},bt?"marginLeft":"marginRight",mt);re.length||(an.visibility="hidden",an.order=1);var ci=K()(Object(de.a)({},"".concat(ki,"-rtl"),bt)),Mi=oe?null:I.createElement($r.a,{prefixCls:ki,overlay:fn,trigger:["hover"],visible:jn,transitionName:ke,onVisibleChange:Vn,overlayClassName:ci,mouseEnterDelay:.1,mouseLeaveDelay:.1},I.createElement("button",{type:"button",className:"".concat(Me,"-nav-more"),style:an,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":ei,id:"".concat(Ce,"-more"),"aria-expanded":jn,onKeyDown:ui},ve));return I.createElement("div",{className:K()("".concat(Me,"-nav-operations"),je),style:Ie,ref:Oe},Mi,I.createElement(fr,{prefixCls:Me,locale:me,editable:Ze}))}var Mr=I.forwardRef(rr),ka=Object(I.createContext)(null),Do=.1,ua=.01,Wi=20,lo=Math.pow(.995,Wi);function uo(){var ye=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ye)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ye.substr(0,4)))}function va(ye,Oe){var Me=Object(I.useState)(),Ce=Object(Z.a)(Me,2),re=Ce[0],me=Ce[1],oe=Object(I.useState)(0),we=Object(Z.a)(oe,2),ve=we[0],ke=we[1],Ie=Object(I.useState)(0),je=Object(Z.a)(Ie,2),Ze=je[0],mt=je[1],bt=Object(I.useState)(),Ut=Object(Z.a)(bt,2),Rn=Ut[0],Qn=Ut[1],jn=Object(I.useRef)();function Vn(gn){var fn=gn.touches[0],Hn=fn.screenX,ui=fn.screenY;me({x:Hn,y:ui}),window.clearInterval(jn.current)}function Yn(gn){if(!re)return;gn.preventDefault();var fn=gn.touches[0],Hn=fn.screenX,ui=fn.screenY;me({x:Hn,y:ui});var an=Hn-re.x,ci=ui-re.y;Oe(an,ci);var Mi=Date.now();ke(Mi),mt(Mi-ve),Qn({x:an,y:ci})}function Xn(){if(!re)return;if(me(null),Qn(null),Rn){var gn=Rn.x/Ze,fn=Rn.y/Ze,Hn=Math.abs(gn),ui=Math.abs(fn);if(Math.max(Hn,ui)<Do)return;var an=gn,ci=fn;jn.current=window.setInterval(function(){if(Math.abs(an)<ua&&Math.abs(ci)<ua){window.clearInterval(jn.current);return}an*=lo,ci*=lo,Oe(an*Wi,ci*Wi)},Wi)}}var Wn=Object(I.useRef)(0),Jn=Object(I.useRef)(!1),ei=Object(I.useRef)();function ki(gn){var fn=gn.deltaX,Hn=gn.deltaY,ui=0,an=Math.abs(fn),ci=Math.abs(Hn);an===ci?ui=ei.current==="x"?fn:Hn:an>ci?(ui=fn,ei.current="x"):(ui=Hn,ei.current="y");var Mi=Date.now();Mi-Wn.current>100&&(Jn.current=!1),(Oe(-ui,-ui)||Jn.current)&&(gn.preventDefault(),Jn.current=!0),Wn.current=Mi}var ti=Object(I.useRef)(null);ti.current={onTouchStart:Vn,onTouchMove:Yn,onTouchEnd:Xn,onWheel:ki},I.useEffect(function(){function gn(an){ti.current.onTouchStart(an)}function fn(an){ti.current.onTouchMove(an)}function Hn(an){ti.current.onTouchEnd(an)}function ui(an){ti.current.onWheel(an)}return document.addEventListener("touchmove",fn,{passive:!1}),document.addEventListener("touchend",Hn,{passive:!1}),ye.current.addEventListener("touchstart",gn,{passive:!1}),ye.current.addEventListener("wheel",ui),function(){document.removeEventListener("touchmove",fn),document.removeEventListener("touchend",Hn)}},[])}function _a(){var ye=Object(I.useRef)(new Map);function Oe(Ce){return ye.current.has(Ce)||ye.current.set(Ce,I.createRef()),ye.current.get(Ce)}function Me(Ce){ye.current.delete(Ce)}return[Oe,Me]}function Qa(ye,Oe){var Me=I.useRef(ye),Ce=I.useState({}),re=Object(Z.a)(Ce,2),me=re[1];function oe(we){var ve=typeof we=="function"?we(Me.current):we;ve!==Me.current&&Oe(ve,Me.current),Me.current=ve,me({})}return[Me.current,oe]}var co=function(Oe){var Me=Oe.position,Ce=Oe.prefixCls,re=Oe.extra;if(!re)return null;var me,oe=re;return Me==="right"&&(me=oe.right||!oe.left&&oe||null),Me==="left"&&(me=oe.left||null),me?I.createElement("div",{className:"".concat(Ce,"-extra-content")},me):null};function Ma(ye,Oe){var Me,Ce=I.useContext(ka),re=Ce.prefixCls,me=Ce.tabs,oe=ye.className,we=ye.style,ve=ye.id,ke=ye.animated,Ie=ye.activeKey,je=ye.rtl,Ze=ye.extra,mt=ye.editable,bt=ye.locale,Ut=ye.tabPosition,Rn=ye.tabBarGutter,Qn=ye.children,jn=ye.onTabClick,Vn=ye.onTabScroll,Yn=Object(I.useRef)(),Xn=Object(I.useRef)(),Wn=Object(I.useRef)(),Jn=Object(I.useRef)(),ei=_a(),ki=Object(Z.a)(ei,2),ti=ki[0],gn=ki[1],fn=Ut==="top"||Ut==="bottom",Hn=Qa(0,function(_i,oi){fn&&Vn&&Vn({direction:_i>oi?"left":"right"})}),ui=Object(Z.a)(Hn,2),an=ui[0],ci=ui[1],Mi=Qa(0,function(_i,oi){!fn&&Vn&&Vn({direction:_i>oi?"top":"bottom"})}),ri=Object(Z.a)(Mi,2),wi=ri[0],bi=ri[1],Hi=Object(I.useState)(0),Gi=Object(Z.a)(Hi,2),Bi=Gi[0],vr=Gi[1],Lr=Object(I.useState)(0),Cr=Object(Z.a)(Lr,2),Vi=Cr[0],Di=Cr[1],Ei=Object(I.useState)(0),Tn=Object(Z.a)(Ei,2),xi=Tn[0],Nr=Tn[1],Zr=Object(I.useState)(0),ra=Object(Z.a)(Zr,2),Ti=ra[0],Vr=ra[1],Jr=Object(I.useState)(null),Oi=Object(Z.a)(Jr,2),vi=Oi[0],ji=Oi[1],Ua=Object(I.useState)(null),Za=Object(Z.a)(Ua,2),ca=Za[0],Ea=Za[1],$i=Object(I.useState)(0),Xr=Object(Z.a)($i,2),Ba=Xr[0],Po=Xr[1],Io=Object(I.useState)(0),mo=Object(Z.a)(Io,2),Ja=mo[0],qa=mo[1],da=r(new Map),xa=Object(Z.a)(da,2),go=xa[0],ja=xa[1],Ta=c(me,go,Bi),ha="".concat(re,"-nav-operations-hidden"),Pi=0,Dr=0;fn?je?(Pi=0,Dr=Math.max(0,Bi-vi)):(Pi=Math.min(0,vi-Bi),Dr=0):(Pi=Math.min(0,ca-Vi),Dr=0);function fa(_i){return _i<Pi?[Pi,!1]:_i>Dr?[Dr,!1]:[_i,!0]}var aa=Object(I.useRef)(),Sa=Object(I.useState)(),pa=Object(Z.a)(Sa,2),Fa=pa[0],eo=pa[1];function Wa(){eo(Date.now())}function to(){window.clearTimeout(aa.current)}va(Yn,function(_i,oi){var lr=!1;function _r(sa,ea){sa(function(Ra){var la=fa(Ra+ea),ar=Object(Z.a)(la,2),La=ar[0],et=ar[1];return lr=et,La})}if(fn){if(vi>=Bi)return lr;_r(ci,_i)}else{if(ca>=Vi)return lr;_r(bi,oi)}return to(),Wa(),lr}),Object(I.useEffect)(function(){return to(),Fa&&(aa.current=window.setTimeout(function(){eo(0)},100)),to},[Fa]);function qr(){var _i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ie,oi=Ta.get(_i);if(!oi)return;if(fn){var lr=an;je?oi.right<an?lr=oi.right:oi.right+oi.width>an+vi&&(lr=oi.right+oi.width-vi):oi.left<-an?lr=-oi.left:oi.left+oi.width>-an+vi&&(lr=-(oi.left+oi.width-vi)),bi(0),ci(fa(lr)[0])}else{var _r=wi;oi.top<-wi?_r=-oi.top:oi.top+oi.height>-wi+ca&&(_r=-(oi.top+oi.height-ca)),ci(0),bi(fa(_r)[0])}}var oa=O(Ta,{width:vi,height:ca,left:an,top:wi},{width:xi,height:Ti},{width:Ba,height:Ja},Object(V.a)(Object(V.a)({},ye),{},{tabs:me})),no=Object(Z.a)(oa,2),io=no[0],ko=no[1],Mo=me.map(function(_i){var oi=_i.key;return I.createElement(a,{id:ve,prefixCls:re,key:oi,rtl:je,tab:_i,closable:_i.closable,editable:mt,active:oi===Ie,tabPosition:Ut,tabBarGutter:Rn,renderWrapper:Qn,removeAriaLabel:bt==null?void 0:bt.removeAriaLabel,ref:ti(oi),onClick:function(_r){jn(oi,_r)},onRemove:function(){gn(oi)},onFocus:function(){qr(oi),Wa(),je||(Yn.current.scrollLeft=0),Yn.current.scrollTop=0}})}),ro=h(function(){var _i,oi,lr,_r,sa,ea,Ra,la,ar,La=((_i=Yn.current)===null||_i===void 0?void 0:_i.offsetWidth)||0,et=((oi=Yn.current)===null||oi===void 0?void 0:oi.offsetHeight)||0,Qe=((lr=Jn.current)===null||lr===void 0?void 0:lr.offsetWidth)||0,Ge=((_r=Jn.current)===null||_r===void 0?void 0:_r.offsetHeight)||0,nt=((sa=Wn.current)===null||sa===void 0?void 0:sa.offsetWidth)||0,ot=((ea=Wn.current)===null||ea===void 0?void 0:ea.offsetHeight)||0;ji(La),Ea(et),Po(Qe),qa(Ge);var At=(((Ra=Xn.current)===null||Ra===void 0?void 0:Ra.offsetWidth)||0)-Qe,wt=(((la=Xn.current)===null||la===void 0?void 0:la.offsetHeight)||0)-Ge;vr(At),Di(wt);var Et=(ar=Wn.current)===null||ar===void 0?void 0:ar.className.includes(ha);Nr(At-(Et?0:nt)),Vr(wt-(Et?0:ot)),ja(function(){var ln=new Map;return me.forEach(function(ni){var Sr=ni.key,Kn=ti(Sr).current;Kn&&ln.set(Sr,{width:Kn.offsetWidth,height:Kn.offsetHeight,left:Kn.offsetLeft,top:Kn.offsetTop})}),ln})}),No=me.slice(0,io),Zi=me.slice(ko+1),Xi=[].concat(Object(P.a)(No),Object(P.a)(Zi)),pr=Object(I.useState)(),Yi=Object(Z.a)(pr,2),Aa=Yi[0],Ha=Yi[1],Pr=Ta.get(Ie),ao=Object(I.useRef)();function Ka(){p.a.cancel(ao.current)}Object(I.useEffect)(function(){var _i={};return Pr&&(fn?(je?_i.right=Pr.right:_i.left=Pr.left,_i.width=Pr.width):(_i.top=Pr.top,_i.height=Pr.height)),Ka(),ao.current=p()(function(){Ha(_i)}),Ka},[Pr,fn,je]),Object(I.useEffect)(function(){qr()},[Ie,Pr,Ta,fn]),Object(I.useEffect)(function(){ro()},[je,Rn,Ie,me.map(function(_i){return _i.key}).join("_")]);var vo=!!Xi.length,ma="".concat(re,"-nav-wrap"),za,Oa,_o,Ga;return fn?je?(Oa=an>0,za=an+vi<Bi):(za=an<0,Oa=-an+vi<Bi):(_o=wi<0,Ga=-wi+ca<Vi),I.createElement("div",{ref:Oe,role:"tablist",className:K()("".concat(re,"-nav"),oe),style:we,onKeyDown:function(){Wa()}},I.createElement(co,{position:"left",extra:Ze,prefixCls:re}),I.createElement(_.a,{onResize:ro},I.createElement("div",{className:K()(ma,(Me={},Object(de.a)(Me,"".concat(ma,"-ping-left"),za),Object(de.a)(Me,"".concat(ma,"-ping-right"),Oa),Object(de.a)(Me,"".concat(ma,"-ping-top"),_o),Object(de.a)(Me,"".concat(ma,"-ping-bottom"),Ga),Me)),ref:Yn},I.createElement(_.a,{onResize:ro},I.createElement("div",{ref:Xn,className:"".concat(re,"-nav-list"),style:{transform:"translate(".concat(an,"px, ").concat(wi,"px)"),transition:Fa?"none":void 0}},Mo,I.createElement(fr,{ref:Jn,prefixCls:re,locale:bt,editable:mt,style:{visibility:vo?"hidden":null}}),I.createElement("div",{className:K()("".concat(re,"-ink-bar"),Object(de.a)({},"".concat(re,"-ink-bar-animated"),ke.inkBar)),style:Aa}))))),I.createElement(Mr,Object.assign({},ye,{ref:Wn,prefixCls:re,tabs:Xi,className:!vo&&ha})),I.createElement(co,{position:"right",extra:Ze,prefixCls:re}))}var wa=I.forwardRef(Ma);function ho(ye){var Oe=ye.id,Me=ye.activeKey,Ce=ye.animated,re=ye.tabPosition,me=ye.rtl,oe=ye.destroyInactiveTabPane,we=I.useContext(ka),ve=we.prefixCls,ke=we.tabs,Ie=Ce.tabPane,je=ke.findIndex(function(Ze){return Ze.key===Me});return I.createElement("div",{className:K()("".concat(ve,"-content-holder"))},I.createElement("div",{className:K()("".concat(ve,"-content"),"".concat(ve,"-content-").concat(re),Object(de.a)({},"".concat(ve,"-content-animated"),Ie)),style:je&&Ie?Object(de.a)({},me?"marginRight":"marginLeft","-".concat(je,"00%")):null},ke.map(function(Ze){return I.cloneElement(Ze.node,{key:Ze.key,prefixCls:ve,tabKey:Ze.key,id:Oe,animated:Ie,active:Ze.key===Me,destroyInactiveTabPane:oe})})))}function fo(ye){var Oe=ye.prefixCls,Me=ye.forceRender,Ce=ye.className,re=ye.style,me=ye.id,oe=ye.active,we=ye.animated,ve=ye.destroyInactiveTabPane,ke=ye.tabKey,Ie=ye.children,je=I.useState(Me),Ze=Object(Z.a)(je,2),mt=Ze[0],bt=Ze[1];I.useEffect(function(){oe?bt(!0):ve&&bt(!1)},[oe,ve]);var Ut={};return oe||(we?(Ut.visibility="hidden",Ut.height=0,Ut.overflowY="hidden"):Ut.display="none"),I.createElement("div",{id:me&&"".concat(me,"-panel-").concat(ke),role:"tabpanel",tabIndex:oe?0:-1,"aria-labelledby":me&&"".concat(me,"-tab-").concat(ke),"aria-hidden":!oe,style:Object(V.a)(Object(V.a)({},Ut),re),className:K()("".concat(Oe,"-tabpane"),oe&&"".concat(Oe,"-tabpane-active"),Ce)},(oe||mt||Me)&&Ie)}var Na=0;function po(ye){return Object(W.a)(ye).map(function(Oe){if(I.isValidElement(Oe)){var Me=Oe.key!==void 0?String(Oe.key):void 0;return Object(V.a)(Object(V.a)({key:Me},Oe.props),{},{node:Oe})}return null}).filter(function(Oe){return Oe})}function $a(ye,Oe){var Me,Ce=ye.id,re=ye.prefixCls,me=re===void 0?"rc-tabs":re,oe=ye.className,we=ye.children,ve=ye.direction,ke=ye.activeKey,Ie=ye.defaultActiveKey,je=ye.editable,Ze=ye.animated,mt=ye.tabPosition,bt=mt===void 0?"top":mt,Ut=ye.tabBarGutter,Rn=ye.tabBarStyle,Qn=ye.tabBarExtraContent,jn=ye.locale,Vn=ye.moreIcon,Yn=ye.moreTransitionName,Xn=ye.destroyInactiveTabPane,Wn=ye.renderTabBar,Jn=ye.onChange,ei=ye.onTabClick,ki=ye.onTabScroll,ti=Object(M.a)(ye,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),gn=po(we),fn=ve==="rtl",Hn;Ze===!1?Hn={inkBar:!1,tabPane:!1}:Hn=Object(V.a)({inkBar:!0,tabPane:!1},Ze!==!0?Ze:null);var ui=Object(I.useState)(!1),an=Object(Z.a)(ui,2),ci=an[0],Mi=an[1];Object(I.useEffect)(function(){Mi(uo())},[]);var ri=Object(L.a)(function(){var Ti;return(Ti=gn[0])===null||Ti===void 0?void 0:Ti.key},{value:ke,defaultValue:Ie}),wi=Object(Z.a)(ri,2),bi=wi[0],Hi=wi[1],Gi=Object(I.useState)(function(){return gn.findIndex(function(Ti){return Ti.key===bi})}),Bi=Object(Z.a)(Gi,2),vr=Bi[0],Lr=Bi[1];Object(I.useEffect)(function(){var Ti=gn.findIndex(function(Jr){return Jr.key===bi});if(Ti===-1){var Vr;Ti=Math.max(0,Math.min(vr,gn.length-1)),Hi((Vr=gn[Ti])===null||Vr===void 0?void 0:Vr.key)}Lr(Ti)},[gn.map(function(Ti){return Ti.key}).join("_"),bi,vr]);var Cr=Object(L.a)(null,{value:Ce}),Vi=Object(Z.a)(Cr,2),Di=Vi[0],Ei=Vi[1],Tn=bt;ci&&!["left","right"].includes(bt)&&(Tn="top"),Object(I.useEffect)(function(){Ce||(Ei("rc-tabs-".concat(Na)),Na+=1)},[]);function xi(Ti,Vr){ei==null||ei(Ti,Vr),Hi(Ti),Jn==null||Jn(Ti)}var Nr={id:Di,activeKey:bi,animated:Hn,tabPosition:Tn,rtl:fn,mobile:ci},Zr,ra=Object(V.a)(Object(V.a)({},Nr),{},{editable:je,locale:jn,moreIcon:Vn,moreTransitionName:Yn,tabBarGutter:Ut,onTabClick:xi,onTabScroll:ki,extra:Qn,style:Rn,panes:we});return Wn?Zr=Wn(ra,wa):Zr=I.createElement(wa,Object.assign({},ra)),I.createElement(ka.Provider,{value:{tabs:gn,prefixCls:me}},I.createElement("div",Object.assign({ref:Oe,id:Ce,className:K()(me,"".concat(me,"-").concat(Tn),(Me={},Object(de.a)(Me,"".concat(me,"-mobile"),ci),Object(de.a)(Me,"".concat(me,"-editable"),je),Object(de.a)(Me,"".concat(me,"-rtl"),fn),Me),oe)},ti),Zr,I.createElement(ho,Object.assign({destroyInactiveTabPane:Xn},Nr,{animated:Hn}))))}var ya=I.forwardRef($a);ya.TabPane=fo;var ia=ya,ba=Xe.b=ia},kSUc:function(ft,Xe,G){},lZu9:function(ft,Xe,G){(function(de){de(G("VrN/"),G("1eCo"),G("8EBN"))})(function(de){"use strict";de.defineMode("markdown",function(Z,M){var V=de.getMode(Z,"text/html"),I=V.name=="null";function B(y){if(de.findModeByName){var x=de.findModeByName(y);x&&(y=x.mime||x.mimes[0])}var F=de.getMode(Z,y);return F.name=="null"?null:F}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var W in K)K.hasOwnProperty(W)&&M.tokenTypeOverrides[W]&&(K[W]=M.tokenTypeOverrides[W]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,p=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,_=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,a=" ";function u(y,x,F){return x.f=x.inline=F,F(y,x)}function c(y,x,F){return x.f=x.block=F,F(y,x)}function R(y){return!y||!/\S/.test(y.string)}function O(y){if(y.linkTitle=!1,y.linkHref=!1,y.linkText=!1,y.em=!1,y.strong=!1,y.strikethrough=!1,y.quote=0,y.indentedCode=!1,y.f==A){var x=I;if(!x){var F=de.innerMode(V,y.htmlState);x=F.mode.name=="xml"&&F.state.tagStart===null&&!F.state.context&&F.state.tokenize.isInText}x&&(y.f=s,y.block=T,y.htmlState=null)}return y.trailingSpace=0,y.trailingSpaceNewLine=!1,y.prevLine=y.thisLine,y.thisLine={stream:null},null}function T(y,x){var F=y.column()===x.indentation,Q=R(x.prevLine.stream),q=x.indentedCode,ie=x.prevLine.hr,ge=x.list!==!1,fe=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var ue=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,ge)){for(x.list=null;ue<x.listStack[x.listStack.length-1];)x.listStack.pop(),x.listStack.length?x.indentation=x.listStack[x.listStack.length-1]:x.list=!1;x.list!==!1&&(x.indentationDiff=ue-x.listStack[x.listStack.length-1])}var he=!Q&&!ie&&!x.prevLine.header&&(!ge||!q)&&!x.prevLine.fencedCodeEnd,_e=(x.list===!1||ie||Q)&&x.indentation<=fe&&y.match(L),le=null;if(x.indentationDiff>=4&&(q||x.prevLine.fencedCodeEnd||x.prevLine.header||Q))return y.skipToEnd(),x.indentedCode=!0,K.code;if(y.eatSpace())return null;if(F&&x.indentation<=fe&&(le=y.match(p))&&le[1].length<=6)return x.quote=0,x.header=le[1].length,x.thisLine.header=!0,M.highlightFormatting&&(x.formatting="header"),x.f=x.inline,m(x);if(x.indentation<=fe&&y.eat(">"))return x.quote=F?1:x.quote+1,M.highlightFormatting&&(x.formatting="quote"),y.eatSpace(),m(x);if(!_e&&!x.setext&&F&&x.indentation<=fe&&(le=y.match(P))){var ne=le[1]?"ol":"ul";return x.indentation=ue+y.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,M.taskLists&&y.match(b,!1)&&(x.taskList=!0),x.f=x.inline,M.highlightFormatting&&(x.formatting=["list","list-"+ne]),m(x)}else{if(F&&x.indentation<=fe&&(le=y.match(r,!0)))return x.quote=0,x.fencedEndRE=new RegExp(le[1]+"+ *$"),x.localMode=M.fencedCodeBlockHighlighting&&B(le[2]||M.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=de.startState(x.localMode)),x.f=x.block=w,M.highlightFormatting&&(x.formatting="code-block"),x.code=-1,m(x);if(x.setext||(!he||!ge)&&!x.quote&&x.list===!1&&!x.code&&!_e&&!d.test(y.string)&&(le=y.lookAhead(1))&&(le=le.match(_)))return x.setext?(x.header=x.setext,x.setext=0,y.skipToEnd(),M.highlightFormatting&&(x.formatting="header")):(x.header=le[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,m(x);if(_e)return y.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,K.hr;if(y.peek()==="[")return u(y,x,N)}return u(y,x,x.inline)}function A(y,x){var F=V.token(y,x.htmlState);if(!I){var Q=de.innerMode(V,x.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||x.md_inside&&y.current().indexOf(">")>-1)&&(x.f=s,x.block=T,x.htmlState=null)}return F}function w(y,x){var F=x.listStack[x.listStack.length-1]||0,Q=x.indentation<F,q=F+3;if(x.fencedEndRE&&x.indentation<=q&&(Q||y.match(x.fencedEndRE))){M.highlightFormatting&&(x.formatting="code-block");var ie;return Q||(ie=m(x)),x.localMode=x.localState=null,x.block=T,x.f=s,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,Q?c(y,x,x.block):ie}else return x.localMode?x.localMode.token(y,x.localState):(y.skipToEnd(),K.code)}function m(y){var x=[];if(y.formatting){x.push(K.formatting),typeof y.formatting=="string"&&(y.formatting=[y.formatting]);for(var F=0;F<y.formatting.length;F++)x.push(K.formatting+"-"+y.formatting[F]),y.formatting[F]==="header"&&x.push(K.formatting+"-"+y.formatting[F]+"-"+y.header),y.formatting[F]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=y.quote?x.push(K.formatting+"-"+y.formatting[F]+"-"+y.quote):x.push("error"))}if(y.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(y.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(y.linkHref?x.push(K.linkHref,"url"):(y.strong&&x.push(K.strong),y.em&&x.push(K.em),y.strikethrough&&x.push(K.strikethrough),y.emoji&&x.push(K.emoji),y.linkText&&x.push(K.linkText),y.code&&x.push(K.code),y.image&&x.push(K.image),y.imageAltText&&x.push(K.imageAltText,"link"),y.imageMarker&&x.push(K.imageMarker)),y.header&&x.push(K.header,K.header+"-"+y.header),y.quote&&(x.push(K.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=y.quote?x.push(K.quote+"-"+y.quote):x.push(K.quote+"-"+M.maxBlockquoteDepth)),y.list!==!1){var Q=(y.listStack.length-1)%3;Q?Q===1?x.push(K.list2):x.push(K.list3):x.push(K.list1)}return y.trailingSpaceNewLine?x.push("trailing-space-new-line"):y.trailingSpace&&x.push("trailing-space-"+(y.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function v(y,x){return y.match(h,!0)?m(x):void 0}function s(y,x){var F=x.text(y,x);if(typeof F!="undefined")return F;if(x.list)return x.list=null,m(x);if(x.taskList){var Q=y.match(b,!0)[1]===" ";return Q?x.taskOpen=!0:x.taskClosed=!0,M.highlightFormatting&&(x.formatting="task"),x.taskList=!1,m(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&y.match(/^#+$/,!0))return M.highlightFormatting&&(x.formatting="header"),m(x);var q=y.next();if(x.linkTitle){x.linkTitle=!1;var ie=q;q==="("&&(ie=")"),ie=(ie+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ge="^\\s*(?:[^"+ie+"\\\\]+|\\\\\\\\|\\\\.)"+ie;if(y.match(new RegExp(ge),!0))return K.linkHref}if(q==="`"){var fe=x.formatting;M.highlightFormatting&&(x.formatting="code"),y.eatWhile("`");var ue=y.current().length;if(x.code==0&&(!x.quote||ue==1))return x.code=ue,m(x);if(ue==x.code){var he=m(x);return x.code=0,he}else return x.formatting=fe,m(x)}else if(x.code)return m(x);if(q==="\\"&&(y.next(),M.highlightFormatting)){var _e=m(x),le=K.formatting+"-escape";return _e?_e+" "+le:le}if(q==="!"&&y.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,M.highlightFormatting&&(x.formatting="image"),m(x);if(q==="["&&x.imageMarker&&y.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,M.highlightFormatting&&(x.formatting="image"),m(x);if(q==="]"&&x.imageAltText){M.highlightFormatting&&(x.formatting="image");var _e=m(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=E,_e}if(q==="["&&!x.image)return x.linkText&&y.match(/^.*?\]/)||(x.linkText=!0,M.highlightFormatting&&(x.formatting="link")),m(x);if(q==="]"&&x.linkText){M.highlightFormatting&&(x.formatting="link");var _e=m(x);return x.linkText=!1,x.inline=x.f=y.match(/\(.*?\)| ?\[.*?\]/,!1)?E:s,_e}if(q==="<"&&y.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=o,M.highlightFormatting&&(x.formatting="link");var _e=m(x);return _e?_e+=" ":_e="",_e+K.linkInline}if(q==="<"&&y.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=o,M.highlightFormatting&&(x.formatting="link");var _e=m(x);return _e?_e+=" ":_e="",_e+K.linkEmail}if(M.xml&&q==="<"&&y.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ne=y.string.indexOf(">",y.pos);if(ne!=-1){var Te=y.string.substring(y.start,ne);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Te)&&(x.md_inside=!0)}return y.backUp(1),x.htmlState=de.startState(V),c(y,x,A)}if(M.xml&&q==="<"&&y.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(q==="*"||q==="_"){for(var Fe=1,Ke=y.pos==1?" ":y.string.charAt(y.pos-2);Fe<3&&y.eat(q);)Fe++;var Ue=y.peek()||" ",He=!/\s/.test(Ue)&&(!l.test(Ue)||/\s/.test(Ke)||l.test(Ke)),Ne=!/\s/.test(Ke)&&(!l.test(Ke)||/\s/.test(Ue)||l.test(Ue)),Be=null,Je=null;if(Fe%2&&(!x.em&&He&&(q==="*"||!Ne||l.test(Ke))?Be=!0:x.em==q&&Ne&&(q==="*"||!He||l.test(Ue))&&(Be=!1)),Fe>1&&(!x.strong&&He&&(q==="*"||!Ne||l.test(Ke))?Je=!0:x.strong==q&&Ne&&(q==="*"||!He||l.test(Ue))&&(Je=!1)),Je!=null||Be!=null){M.highlightFormatting&&(x.formatting=Be==null?"strong":Je==null?"em":"strong em"),Be===!0&&(x.em=q),Je===!0&&(x.strong=q);var he=m(x);return Be===!1&&(x.em=!1),Je===!1&&(x.strong=!1),he}}else if(q===" "&&(y.eat("*")||y.eat("_"))){if(y.peek()===" ")return m(x);y.backUp(1)}if(M.strikethrough){if(q==="~"&&y.eatWhile(q)){if(x.strikethrough){M.highlightFormatting&&(x.formatting="strikethrough");var he=m(x);return x.strikethrough=!1,he}else if(y.match(/^[^\s]/,!1))return x.strikethrough=!0,M.highlightFormatting&&(x.formatting="strikethrough"),m(x)}else if(q===" "&&y.match(/^~~/,!0)){if(y.peek()===" ")return m(x);y.backUp(2)}}if(M.emoji&&q===":"&&y.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,M.highlightFormatting&&(x.formatting="emoji");var tt=m(x);return x.emoji=!1,tt}return q===" "&&(y.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),m(x)}function o(y,x){var F=y.next();if(F===">"){x.f=x.inline=s,M.highlightFormatting&&(x.formatting="link");var Q=m(x);return Q?Q+=" ":Q="",Q+K.linkInline}return y.match(/^[^>]+/,!0),K.linkInline}function E(y,x){if(y.eatSpace())return null;var F=y.next();return F==="("||F==="["?(x.f=x.inline=C(F==="("?")":"]"),M.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,m(x)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(y){return function(x,F){var Q=x.next();if(Q===y){F.f=F.inline=s,M.highlightFormatting&&(F.formatting="link-string");var q=m(F);return F.linkHref=!1,q}return x.match(g[y]),F.linkHref=!0,m(F)}}function N(y,x){return y.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=U,y.next(),M.highlightFormatting&&(x.formatting="link"),x.linkText=!0,m(x)):u(y,x,s)}function U(y,x){if(y.match(/^\]:/,!0)){x.f=x.inline=j,M.highlightFormatting&&(x.formatting="link");var F=m(x);return x.linkText=!1,F}return y.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function j(y,x){return y.eatSpace()?null:(y.match(/^[^\s]+/,!0),y.peek()===void 0?x.linkTitle=!0:y.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),x.f=x.inline=s,K.linkHref+" url")}var H={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:s,text:v,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(y){return{f:y.f,prevLine:y.prevLine,thisLine:y.thisLine,block:y.block,htmlState:y.htmlState&&de.copyState(V,y.htmlState),indentation:y.indentation,localMode:y.localMode,localState:y.localMode?de.copyState(y.localMode,y.localState):null,inline:y.inline,text:y.text,formatting:!1,linkText:y.linkText,linkTitle:y.linkTitle,linkHref:y.linkHref,code:y.code,em:y.em,strong:y.strong,strikethrough:y.strikethrough,emoji:y.emoji,header:y.header,setext:y.setext,hr:y.hr,taskList:y.taskList,list:y.list,listStack:y.listStack.slice(0),quote:y.quote,indentedCode:y.indentedCode,trailingSpace:y.trailingSpace,trailingSpaceNewLine:y.trailingSpaceNewLine,md_inside:y.md_inside,fencedEndRE:y.fencedEndRE}},token:function(y,x){if(x.formatting=!1,y!=x.thisLine.stream){if(x.header=0,x.hr=!1,y.match(/^\s*$/,!0))return O(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:y},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=A)){var F=y.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(x.indentation=F,x.indentationDiff=null,F>0)return null}}return x.f(y,x)},innerMode:function(y){return y.block==A?{state:y.htmlState,mode:V}:y.localState?{state:y.localState,mode:y.localMode}:{state:y,mode:H}},indent:function(y,x,F){return y.block==A&&V.indent?V.indent(y.htmlState,x,F):y.localState&&y.localMode.indent?y.localMode.indent(y.localState,x,F):de.Pass},blankLine:O,getType:m,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),de.defineMIME("text/markdown","markdown"),de.defineMIME("text/x-markdown","markdown")})},mgmH:function(ft,Xe,G){"use strict";G.d(Xe,"d",function(){return _}),G.d(Xe,"b",function(){return h}),G.d(Xe,"e",function(){return r}),G.d(Xe,"c",function(){return d}),G.d(Xe,"n",function(){return l}),G.d(Xe,"g",function(){return a}),G.d(Xe,"h",function(){return u}),G.d(Xe,"j",function(){return R}),G.d(Xe,"a",function(){return O}),G.d(Xe,"l",function(){return T}),G.d(Xe,"f",function(){return A}),G.d(Xe,"k",function(){return w}),G.d(Xe,"m",function(){return m}),G.d(Xe,"i",function(){return v}),G.d(Xe,"o",function(){return s}),G.d(Xe,"t",function(){return o}),G.d(Xe,"s",function(){return E}),G.d(Xe,"p",function(){return g}),G.d(Xe,"q",function(){return C}),G.d(Xe,"r",function(){return N}),G.d(Xe,"v",function(){return U}),G.d(Xe,"u",function(){return j});var de=G("miYZ"),Z=G("tsqr"),M=G("k1fw"),V=G("9og8"),I=G("WmNS"),B=G.n(I),K=G("oUNq"),W=G("9kvl"),L=G("1vsH"),P=G("m3rI"),b=function(){Object(W.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(W.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},_=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return b(),q.next=3,Object(K.t)(Object(M.a)({},x));case 3:if(F=q.sent,!(F.status===0)){q.next=7;break}return q.next=7,Object(L.w)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_couser_info.json"),query:x}));case 7:p();case 8:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),h=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.r)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),r=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.u)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),d=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.s)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),l=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.z)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),a=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.v)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),u=function(){var H=Object(V.a)(B.a.mark(function y(x,F){var Q;return B.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.x)(Object(M.a)({},x));case 2:Q=ie.sent,Q.status===0?(Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(F))):Q.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(F)));case 4:case"end":return ie.stop()}},y)}));return function(x,F){return H.apply(this,arguments)}}(),c=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return b(),q.next=3,Object(K.w)(Object(M.a)({},x));case 3:if(F=q.sent,!(F.status===0)){q.next=7;break}return q.next=7,Object(L.w)("",Object(L.Y)({url:P.a.API_SERVER+"/api/homework_commons/".concat(x.categoryId,"/works_list.zip"),query:x}));case 7:p();case 8:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),R=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return b(),q.next=3,Object(K.A)(Object(M.a)({},x));case 3:if(F=q.sent,!(F.status===0)){q.next=7;break}return q.next=7,Object(L.w)("",Object(L.Y)({url:P.a.API_SERVER+"/api/polls/".concat(x.categoryId,"/commit_result.xlsx"),query:x}));case 7:p();case 8:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),O=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/attendances/export_xlsx_data.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),T=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/video_study_statics.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),A=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_course_students_info.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),w=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/item_banks/export.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),m=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),v=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.y)(Object(M.a)({},x));case 2:F=q.sent,F.status===0?(Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score"))):F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score")));case 4:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),s=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Q.next=3,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/export_records/".concat(x.id,".xlsx"),query:x}));case 3:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),o=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),E=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_training_objectives.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),g=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)(x==null?void 0:x.name,Object(L.Y)({url:P.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),C=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_courses.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),N=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_graduation_requirements.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),U=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/rank_list.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),j=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}()},nSDg:function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___2lqeg",flex_space_between:"flex_space_between___RuZ2s",flex_box_vertical_center:"flex_box_vertical_center___2AGHP",flex_box_center_end:"flex_box_center_end___FDazu",flex_box_column:"flex_box_column___1Yqjx",wrp:"wrp____lZAZ",drawer:"drawer___2XpEN",menu:"menu___fZQrG",actived:"actived___1Yg9q",actived2:"actived2___2KHN5",subTag:"subTag___3AbgU",directionName:"directionName___2Xp-L",menuDirection:"menuDirection___1ZMmo",listItem:"listItem___g9W0X",info:"info___1FHWU",title:"title___1VzwI",titleLeft:"titleLeft___yvqaz",titleRight:"titleRight___2Dqm5",search:"search___3pcQt",description:"description___3yQGh",menuCourse:"menuCourse___3iBFc",paginationWrap:"paginationWrap___KxpDN"}},osHv:function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";var Z=de.Pos;function M(l,a){return l.line-a.line||l.ch-a.ch}var V="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=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",B=new RegExp("<(/?)(["+V+"]["+I+"]*)","g");function K(l,a,u,c){this.line=a,this.ch=u,this.cm=l,this.text=l.getLine(a),this.min=c?Math.max(c.from,l.firstLine()):l.firstLine(),this.max=c?Math.min(c.to-1,l.lastLine()):l.lastLine()}function W(l,a){var u=l.cm.getTokenTypeAt(Z(l.line,a));return u&&/\btag\b/.test(u)}function L(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function P(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function b(l){for(;;){var a=l.text.indexOf(">",l.ch);if(a==-1){if(L(l))continue;return}if(!W(l,a+1)){l.ch=a+1;continue}var u=l.text.lastIndexOf("/",a),c=u>-1&&!/\S/.test(l.text.slice(u+1,a));return l.ch=a+1,c?"selfClose":"regular"}}function p(l){for(;;){var a=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(a==-1){if(P(l))continue;return}if(!W(l,a+1)){l.ch=a;continue}B.lastIndex=a,l.ch=a;var u=B.exec(l.text);if(u&&u.index==a)return u}}function _(l){for(;;){B.lastIndex=l.ch;var a=B.exec(l.text);if(!a){if(L(l))continue;return}if(!W(l,a.index+1)){l.ch=a.index+1;continue}return l.ch=a.index+a[0].length,a}}function h(l){for(;;){var a=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(a==-1){if(P(l))continue;return}if(!W(l,a+1)){l.ch=a;continue}var u=l.text.lastIndexOf("/",a),c=u>-1&&!/\S/.test(l.text.slice(u+1,a));return l.ch=a+1,c?"selfClose":"regular"}}function r(l,a){for(var u=[];;){var c=_(l),R,O=l.line,T=l.ch-(c?c[0].length:0);if(!c||!(R=b(l)))return;if(R=="selfClose")continue;if(c[1]){for(var A=u.length-1;A>=0;--A)if(u[A]==c[2]){u.length=A;break}if(A<0&&(!a||a==c[2]))return{tag:c[2],from:Z(O,T),to:Z(l.line,l.ch)}}else u.push(c[2])}}function d(l,a){for(var u=[];;){var c=h(l);if(!c)return;if(c=="selfClose"){p(l);continue}var R=l.line,O=l.ch,T=p(l);if(!T)return;if(T[1])u.push(T[2]);else{for(var A=u.length-1;A>=0;--A)if(u[A]==T[2]){u.length=A;break}if(A<0&&(!a||a==T[2]))return{tag:T[2],from:Z(l.line,l.ch),to:Z(R,O)}}}}de.registerHelper("fold","xml",function(l,a){for(var u=new K(l,a.line,0);;){var c=_(u);if(!c||u.line!=a.line)return;var R=b(u);if(!R)return;if(!c[1]&&R!="selfClose"){var O=Z(u.line,u.ch),T=r(u,c[2]);return T&&M(T.from,O)>0?{from:O,to:T.from}:null}}}),de.findMatchingTag=function(l,a,u){var c=new K(l,a.line,a.ch,u);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var R=b(c),O=R&&Z(c.line,c.ch),T=R&&p(c);if(!R||!T||M(c,a)>0)return;var A={from:Z(c.line,c.ch),to:O,tag:T[2]};return R=="selfClose"?{open:A,close:null,at:"open"}:T[1]?{open:d(c,T[2]),close:A,at:"close"}:(c=new K(l,O.line,O.ch,u),{open:A,close:r(c,T[2]),at:"open"})},de.findEnclosingTag=function(l,a,u,c){for(var R=new K(l,a.line,a.ch,u);;){var O=d(R,c);if(!O)break;var T=new K(l,a.line,a.ch,u),A=r(T,O.tag);if(A)return{open:O,close:A}}},de.scanForClosingTag=function(l,a,u,c){var R=new K(l,a.line,a.ch,c?{from:0,to:c}:null);return r(R,u)}})},p5ED:function(ft,Xe,G){"use strict";var de=G("+L6B"),Z=G("2/Rp"),M=G("5Dmo"),V=G("3S7+"),I=G("k1fw"),B=G("tJVT"),K=G("q1tI"),W=G.n(K),L=G("vHTk"),P=G.n(L),b=G("yEEn"),p=G("ZW9T"),_=G("1vsH");Xe.a=function(h){var r=h.name,d=h.data,l=h.theme,a=h.type,u=h.filename,c=h.monacoEditor,R=h.className,O=h.style,T=h.close,A=h.onClose,w=h.hasMask,m=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),v=Object(B.a)(m,2),s=v[0],o=v[1],E=Object(K.useState)(""),g=Object(B.a)(E,2),C=g[0],N=g[1],U,j=1024*1024,H=10*j,y=Object(K.useRef)();a==="office"&&(U=Object(_.T)(d).filesize,U>H&&(a="other")),u&&(c.filename=u),Object(K.useEffect)(function(){var Q,q,ie=(Q=document.cookie)===null||Q===void 0||((q=Q.replace(/\s/g,""))===null||q===void 0)?void 0:q.split(";");ie==null||ie.map(function(ge){var fe=ge.split("=");fe[0]==="_educoder_session"&&N(fe[1])})},[]);var x=function(){if(d.startsWith("http")||d.startsWith("/")){F();return}Object(_.z)(u||"educoder",d,u)},F=function(){Object(_.x)(u||r,d)};return console.log("data:",d,"fileanme:",u," name:",r),W.a.createElement("div",{style:Object(I.a)({},O||{}),className:"".concat(w&&P.a.bgBlack," ").concat(a?P.a.wrp:"hide")},T&&W.a.createElement("div",{className:P.a.close,ref:y},W.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return y.current}},W.a.createElement("span",{onClick:F},W.a.createElement("i",{className:"icon-quxiaozhiding"}))),W.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return y.current}},W.a.createElement("span",{className:"",onClick:A},W.a.createElement("i",{className:"icon-guanbi1"})))),W.a.createElement("div",{className:"".concat(P.a[R]," ").concat(R," ").concat(P.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&W.a.createElement(p.b,c)),a==="audio"&&W.a.createElement("audio",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?d:"data:audio/mp3;base64,").concat(d),autoPlay:!0}),a==="video"&&W.a.createElement(W.a.Fragment,null,d!=null&&d.startsWith("/")?W.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):W.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),a==="html"&&W.a.createElement("iframe",{src:d+"&disposition=inline"}),a==="pdf"&&W.a.createElement("embed",{className:P.a.embed,src:d}),a==="image"&&W.a.createElement(W.a.Fragment,null,W.a.createElement("img",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(d)})),a==="other"&&W.a.createElement("div",null,W.a.createElement(Z.a,{type:"primary",size:"large",onClick:x},W.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(a==="download"||a==="office")&&W.a.createElement(Z.a,{type:"primary",size:"large",onClick:x},W.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ft,Xe,G){},psGv:function(ft,Xe,G){var de,Z;(function(){var M;(function(){"use strict";var K=[,,function(b){function p(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var r=new p(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},p.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},p.prototype.has_match=function(r){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(r))return!0;return!1},p.prototype.set_indent=function(r,d){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(r){this.__items.push(r);var d=r.lastIndexOf(`
`);d!==-1?this.__character_count=r.length-d:this.__character_count+=r.length},p.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function _(r,d){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),d=d||"",r.indent_level>0&&(d=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}_.prototype.get_indent_size=function(r,d){var l=this.__base_string_length;return d=d||0,r<0&&(l=0),l+=r*this.__indent_size,l+=d,l},_.prototype.get_indent_string=function(r,d){var l=this.__base_string;return d=d||0,r<0&&(r=0,l=""),d+=r*this.__indent_size,this.__ensure_cache(d),l+=this.__cache[d],l},_.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var r=this.__cache.length,d=0,l="";this.__indent_size&&r>=this.__indent_size&&(d=Math.floor(r/this.__indent_size),r-=d*this.__indent_size,l=new Array(d+1).join(this.__indent_string)),r&&(l+=new Array(r+1).join(" ")),this.__cache.push(l)};function h(r,d){this.__indent_cache=new _(r,d),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(r,d){return this.__indent_cache.get_indent_string(r,d)},h.prototype.get_indent_size=function(r,d){return this.__indent_cache.get_indent_size(r,d)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(r){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return r!==`
`&&(l=l.replace(/[\n]/g,r)),l},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(r,d){return r=r||0,d=d||0,this.next_line.set_indent(r,d),this.__lines.length>1?(this.current_line.set_indent(r,d),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(r){for(var d=0;d<r.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(r){for(var d=this.__lines.length;r<d;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(r,d){for(var l=this.__lines.length-2;l>=0;){var a=this.__lines[l];if(a.is_empty())break;if(a.item(0).indexOf(r)!==0&&a.item(-1)!==d){this.__lines.splice(l+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},b.exports.Output=h},function(b){function p(_,h,r,d){this.type=_,this.text=h,this.comments_before=null,this.newlines=r||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=p},,,function(b){function p(r,d){this.raw_options=_(r,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(r,d){var l=this.raw_options[r],a=d||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(a=l.concat()):typeof l=="string"&&(a=l.split(/[^a-zA-Z0-9_\/\-]+/)),a},p.prototype._get_boolean=function(r,d){var l=this.raw_options[r],a=l===void 0?!!d:!!l;return a},p.prototype._get_characters=function(r,d){var l=this.raw_options[r],a=d||"";return typeof l=="string"&&(a=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},p.prototype._get_number=function(r,d){var l=this.raw_options[r];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(l,10);return isNaN(a)&&(a=d),a},p.prototype._get_selection=function(r,d,l){var a=this._get_selection_list(r,d,l);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[r]+"'");return a[0]},p.prototype._get_selection_list=function(r,d,l){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[d[0]],!this._is_valid_selection(l,d))throw new Error("Invalid Default Value!");var a=this._get_array(r,l);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[r]+"'");return a},p.prototype._is_valid_selection=function(r,d){return r.length&&d.length&&!r.some(function(l){return d.indexOf(l)===-1})};function _(r,d){var l={};r=h(r);var a;for(a in r)a!==d&&(l[a]=r[a]);if(d&&r[d])for(a in r[d])l[a]=r[d][a];return l}function h(r){var d={},l;for(l in r){var a=l.replace(/-/g,"_");d[a]=r[l]}return d}b.exports.Options=p,b.exports.normalizeOpts=h,b.exports.mergeOpts=_},,function(b){var p=RegExp.prototype.hasOwnProperty("sticky");function _(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},_.prototype.peek=function(h){var r=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(r=this.__input.charAt(h)),r},_.prototype.__match=function(h,r){h.lastIndex=r;var d=h.exec(this.__input);return d&&!(p&&h.sticky)&&(d.index!==r&&(d=null)),d},_.prototype.test=function(h,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(h,r):!1},_.prototype.testChar=function(h,r){var d=this.peek(r);return h.lastIndex=0,d!==null&&h.test(d)},_.prototype.match=function(h){var r=this.__match(h,this.__position);return r?this.__position+=r[0].length:r=null,r},_.prototype.read=function(h,r,d){var l="",a;return h&&(a=this.match(h),a&&(l+=a[0])),r&&(a||!h)&&(l+=this.readUntil(r,d)),l},_.prototype.readUntil=function(h,r){var d="",l=this.__position;h.lastIndex=this.__position;var a=h.exec(this.__input);return a?(l=a.index,r&&(l+=a[0].length)):l=this.__input_length,d=this.__input.substring(this.__position,l),this.__position=l,d},_.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},_.prototype.get_regexp=function(h,r){var d=null,l="g";return r&&p&&(l="y"),typeof h=="string"&&h!==""?d=new RegExp(h,l):h&&(d=new RegExp(h.source,l)),d},_.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(h){var r=this.__position,d=this.readUntilAfter(h);return this.__position=r,d},_.prototype.lookBack=function(h){var r=this.__position-1;return r>=h.length&&this.__input.substring(r-h.length,r).toLowerCase()===h},b.exports.InputScanner=_},function(b,p,_){var h=_(8).InputScanner,r=_(3).Token,d=_(10).TokenStream,l=_(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(c,R){this._input=new h(c),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var c,R=new r(a.START,""),O=null,T=[],A=new d;R.type!==a.EOF;){for(c=this._get_next_token(R,O);this._is_comment(c);)A.add(c),c=this._get_next_token(R,O);A.isEmpty()||(c.comments_before=A,A=new d),c.parent=O,this._is_opening(c)?(T.push(O),O=c):O&&this._is_closing(c,O)&&(c.opened=O,O.closed=c,O=T.pop(),c.parent=O),c.previous=R,R.next=c,this.__tokens.add(c),R=c}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(c,R){this._readWhitespace();var O=this._input.read(/.+/g);return O?this._create_token(a.RAW,O):this._create_token(a.EOF,"")},u.prototype._is_comment=function(c){return!1},u.prototype._is_opening=function(c){return!1},u.prototype._is_closing=function(c,R){return!1},u.prototype._create_token=function(c,R){var O=new r(c,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return O},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=u,b.exports.TOKEN=a},function(b){function p(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},p.prototype.peek=function(_){var h=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(h=this.__tokens[_]),h},p.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},b.exports.TokenStream=p},function(b,p,_){var h=_(12).Pattern;function r(d,l){h.call(this,d,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new h,r.prototype.__set_whitespace_patterns=function(d,l){d+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var l=this.__split(this._newline_regexp,d);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return d},r.prototype.matching=function(d,l){var a=this._create();return a.__set_whitespace_patterns(d,l),a._update(),a},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(d,l){d.lastIndex=0;for(var a=0,u=[],c=d.exec(l);c;)u.push(l.substring(a,c.index)),a=c.index+c[0].length,c=d.exec(l);return a<l.length?u.push(l.substring(a,l.length)):u.push(""),u},b.exports.WhitespacePattern=r},function(b){function p(_,h){this._input=_,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}p.prototype.read=function(){var _=this._input.read(this._starting_pattern);return(!this._starting_pattern||_)&&(_+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),_},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(_){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(_),h._update(),h},p.prototype.until=function(_){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(_),h._update(),h},p.prototype.starting_with=function(_){var h=this._create();return h._starting_pattern=this._input.get_regexp(_,!0),h._update(),h},p.prototype.matching=function(_){var h=this._create();return h._match_pattern=this._input.get_regexp(_,!0),h._update(),h},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},b.exports.Pattern=p},function(b){function p(_,h){_=typeof _=="string"?_:_.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+h,"g")}p.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(_);r;)h[r[1]]=r[2],r=this.__directive_pattern.exec(_);return h},p.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=p},function(b,p,_){var h=_(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(l,a){h.call(this,l,a),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var u=new h(l);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new h,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(l){var a=this._create();return a._disabled[l]=!0,a._update(),a},d.prototype.read_options=function(l){var a=this._create();for(var u in r)a._disabled[u]=l.templating.indexOf(u)===-1;return a._update(),a},d.prototype.exclude=function(l){var a=this._create();return a._excluded[l]=!0,a._update(),a},d.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),l+=a,a=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},d.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},d.prototype._read_template=function(){var l="",a=this._input.peek();if(a==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(l=l||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},b.exports.TemplatablePattern=d},,,,function(b,p,_){var h=_(19).Beautifier,r=_(20).Options;function d(l,a,u,c){var R=new h(l,a,u,c);return R.beautify()}b.exports=d,b.exports.defaultOptions=function(){return new r}},function(b,p,_){var h=_(20).Options,r=_(2).Output,d=_(21).Tokenizer,l=_(21).TOKEN,a=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,c=function(E,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new r(E,g)};c.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},c.prototype.set_space_before_token=function(E,g){this._output.space_before_token=E,this._output.non_breaking_space=g},c.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},c.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},c.prototype.print_preserved_newlines=function(E){var g=0;E.type!==l.TEXT&&E.previous.type!==l.TEXT&&(g=E.newlines?1:0),this.preserve_newlines&&(g=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var C=0;C<g;C++)this.print_newline(C>0);return g!==0},c.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},c.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},c.prototype.print_newline=function(E){this._output.add_new_line(E)},c.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},c.prototype.indent=function(){this.indent_level++},c.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var R=function(E){for(var g=null,C=E.next;C.type!==l.EOF&&E.closed!==C;){if(C.type===l.ATTRIBUTE&&C.text==="type"){C.next&&C.next.type===l.EQUALS&&C.next.next&&C.next.next.type===l.VALUE&&(g=C.next.next.text);break}C=C.next}return g},O=function(E,g){var C=null,N=null;return g.closed?(E==="script"?C="text/javascript":E==="style"&&(C="text/css"),C=R(g)||C,C.search("text/css")>-1?N="css":C.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":C.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":C.search(/test\/null/)>-1&&(N="null"),N):null};function T(E,g){return g.indexOf(E)!==-1}function A(E,g,C){this.parent=E||null,this.tag=g?g.tag_name:"",this.indent_level=C||0,this.parser_token=g||null}function w(E){this._printer=E,this._current_frame=null}w.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},w.prototype.record_tag=function(E){var g=new A(this._current_frame,E,this._printer.indent_level);this._current_frame=g},w.prototype._try_pop_frame=function(E){var g=null;return E&&(g=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),g},w.prototype._get_frame=function(E,g){for(var C=this._current_frame;C&&!(E.indexOf(C.tag)!==-1);){if(g&&g.indexOf(C.tag)!==-1){C=null;break}C=C.parent}return C},w.prototype.try_pop=function(E,g){var C=this._get_frame([E],g);return this._try_pop_frame(C)},w.prototype.indent_to_tag=function(E){var g=this._get_frame(E);g&&(this._printer.indent_level=g.indent_level)};function m(E,g,C,N){this._source_text=E||"",g=g||{},this._js_beautify=C,this._css_beautify=N,this._tag_stack=null;var U=new h(g,"html");this._options=U,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
`,E&&a.test(E)&&(g=E.match(a)[0])),E=E.replace(u,`
`);var C=E.match(/^[\t ]*/)[0],N={text:"",type:""},U=new v,j=new c(this._options,C),H=new d(E,this._options).tokenize();this._tag_stack=new w(j);for(var y=null,x=H.next();x.type!==l.EOF;)x.type===l.TAG_OPEN||x.type===l.COMMENT?(y=this._handle_tag_open(j,x,U,N),U=y):x.type===l.ATTRIBUTE||x.type===l.EQUALS||x.type===l.VALUE||x.type===l.TEXT&&!U.tag_complete?y=this._handle_inside_tag(j,x,U,H):x.type===l.TAG_CLOSE?y=this._handle_tag_close(j,x,U):x.type===l.TEXT?y=this._handle_text(j,x,U):j.add_raw_token(x),N=y,x=H.next();var F=j._output.get_code(g);return F},m.prototype._handle_tag_close=function(E,g,C){var N={text:g.text,type:g.type};return E.alignment_size=0,C.tag_complete=!0,E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),C.is_unformatted?E.add_raw_token(g):(C.tag_start_char==="<"&&(E.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&C.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(g)),C.indent_content&&!(C.is_unformatted||C.is_content_unformatted)&&(E.indent(),C.indent_content=!1),!C.is_inline_element&&!(C.is_unformatted||C.is_content_unformatted)&&E.set_wrap_point(),N},m.prototype._handle_inside_tag=function(E,g,C,N){var U=C.has_wrapped_attrs,j={text:g.text,type:g.type};if(E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),C.is_unformatted)E.add_raw_token(g);else if(C.tag_start_char==="{"&&g.type===l.TEXT)E.print_preserved_newlines(g)?(g.newlines=0,E.add_raw_token(g)):E.print_token(g);else{if(g.type===l.ATTRIBUTE?(E.set_space_before_token(!0),C.attr_count+=1):(g.type===l.EQUALS||g.type===l.VALUE&&g.previous.type===l.EQUALS)&&E.set_space_before_token(!1),g.type===l.ATTRIBUTE&&C.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(g),U=U||g.newlines!==0),this._is_wrap_attributes_force)){var H=C.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&C.attr_count===1){var y=!0,x=0,F;do{if(F=N.peek(x),F.type===l.ATTRIBUTE){y=!1;break}x+=1}while(x<4&&F.type!==l.EOF&&F.type!==l.TAG_CLOSE);H=!y}H&&(E.print_newline(!1),U=!0)}E.print_token(g),U=U||E.previous_token_wrapped(),C.has_wrapped_attrs=U}return j},m.prototype._handle_text=function(E,g,C){var N={text:g.text,type:"TK_CONTENT"};return C.custom_beautifier_name?this._print_custom_beatifier_text(E,g,C):C.is_unformatted||C.is_content_unformatted?E.add_raw_token(g):(E.traverse_whitespace(g),E.print_token(g)),N},m.prototype._print_custom_beatifier_text=function(E,g,C){var N=this;if(g.text!==""){var U=g.text,j,H=1,y="",x="";C.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?j=this._js_beautify:C.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?j=this._css_beautify:C.custom_beautifier_name==="html"&&(j=function(fe,ue){var he=new m(fe,ue,N._js_beautify,N._css_beautify);return he.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-E.indent_level);var F=E.get_full_indent(H);if(U=U.replace(/\n[ \t]*$/,""),C.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var Q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!Q){E.add_raw_token(g);return}y=F+Q[1]+`
`,U=Q[4],Q[5]&&(x=F+Q[5]),U=U.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(`
`)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(g.whitespace_before=Q[0]))}if(U)if(j){var q=function(){this.eol=`
`};q.prototype=this._options.raw_options;var ie=new q;U=j(F+U,ie)}else{var ge=g.whitespace_before;ge&&(U=U.replace(new RegExp(`
(`+ge+")?","g"),`
`)),U=F+U.replace(/\n/g,`
`+F)}y&&(U?U=y+U+`
`+x:U=y+x),E.print_newline(!1),U&&(g.text=U,g.whitespace_before="",g.newlines=0,E.add_raw_token(g),E.print_newline(!0))}},m.prototype._handle_tag_open=function(E,g,C,N){var U=this._get_tag_open_token(g);return(C.is_unformatted||C.is_content_unformatted)&&!C.is_empty_element&&g.type===l.TAG_OPEN&&g.text.indexOf("</")===0?(E.add_raw_token(g),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(E.traverse_whitespace(g),this._set_tag_position(E,g,U,C,N),U.is_inline_element||E.set_wrap_point(),E.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=g.text.length+1),!U.tag_complete&&!U.is_unformatted&&(E.alignment_size=U.alignment_size),U};var v=function(E,g){if(this.parent=E||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!g)this.tag_complete=!0;else{var C;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(C=g.text.match(/^<([^\s>]*)/),this.tag_check=C?C[1]:""):(C=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=C?C[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.type===l.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||g.closed&&g.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};m.prototype._get_tag_open_token=function(E){var g=new v(this._tag_stack.get_parser_token(),E);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||T(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&T(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&T(g.tag_check,this._options.content_unformatted),g.is_inline_element=T(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},m.prototype._set_tag_position=function(E,g,C,N,U){if(C.is_empty_element||(C.is_end_tag?C.start_tag_token=this._tag_stack.try_pop(C.tag_name):(this._do_optional_end_element(C)&&(C.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(C),(C.tag_name==="script"||C.tag_name==="style")&&!(C.is_unformatted||C.is_content_unformatted)&&(C.custom_beautifier_name=O(C.tag_check,g)))),T(C.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),C.is_empty_element){if(C.tag_start_char==="{"&&C.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),C.indent_content=!0;var j=E.current_line_has_match(/{{#if/);j||E.print_newline(!1)}C.tag_name==="!--"&&U.type===l.TAG_CLOSE&&N.is_end_tag&&C.text.indexOf(`
`)===-1||(C.is_inline_element||C.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,C))}else if(C.is_end_tag){var H=!1;H=C.start_tag_token&&C.start_tag_token.multiline_content,H=H||!C.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(U.type===l.TAG_CLOSE&&C.start_tag_token===N)&&U.type!=="TK_CONTENT",(C.is_content_unformatted||C.is_unformatted)&&(H=!1),H&&E.print_newline(!1)}else C.indent_content=!C.custom_beautifier_name,C.tag_start_char==="<"&&(C.tag_name==="html"?C.indent_content=this._options.indent_inner_html:C.tag_name==="head"?C.indent_content=this._options.indent_head_inner_html:C.tag_name==="body"&&(C.indent_content=this._options.indent_body_inner_html)),!(C.is_inline_element||C.is_unformatted)&&(U.type!=="TK_CONTENT"||C.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,C)},m.prototype._calcluate_parent_multiline=function(E,g){g.parent&&E._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var s=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],o=["a","audio","del","ins","map","noscript","video"];m.prototype._do_optional_end_element=function(E){var g=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(E.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&s.indexOf(E.tag_name)!==-1){var C=E.parent.parent;(!C||o.indexOf(C.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),g},b.exports.Beautifier=m},function(b,p,_){var h=_(6).Options;function r(d){h.call(this,d,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new h,b.exports.Options=r},function(b,p,_){var h=_(9).Tokenizer,r=_(9).TOKEN,d=_(13).Directives,l=_(14).TemplatablePattern,a=_(12).Pattern,u={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},c=new d(/<\!--/,/-->/),R=function(O,T){h.call(this,O,T),this._current_tag_name="";var A=new l(this._input).read_options(this._options),w=new a(this._input);if(this.__patterns={word:A.until(/[\n\r\t <]/),single_quote:A.until_after(/'/),double_quote:A.until_after(/"/),attribute:A.until(/[\n\r\t =>]|\/>/),element_name:A.until(/[\n\r\t >\/]/),handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),handlebars_open:w.until(/[\n\r\t }]/),handlebars_raw_close:w.until(/}}/),comment:w.starting_with(/<!--/).until_after(/-->/),cdata:w.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:w.starting_with(/<!\[/).until_after(/]>/),processing:w.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var m=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=w.matching(m).until_after(m)}};R.prototype=new h,R.prototype._is_comment=function(O){return!1},R.prototype._is_opening=function(O){return O.type===u.TAG_OPEN},R.prototype._is_closing=function(O,T){return O.type===u.TAG_CLOSE&&T&&((O.text===">"||O.text==="/>")&&T.text[0]==="<"||O.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(O,T){var A=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(u.EOF,""):(A=A||this._read_open_handlebars(w,T),A=A||this._read_attribute(w,O,T),A=A||this._read_close(w,T),A=A||this._read_raw_content(w,O,T),A=A||this._read_content_word(w),A=A||this._read_comment_or_cdata(w),A=A||this._read_processing(w),A=A||this._read_open(w,T),A=A||this._create_token(u.UNKNOWN,this._input.next()),A)},R.prototype._read_comment_or_cdata=function(O){var T=null,A=null,w=null;if(O==="<"){var m=this._input.peek(1);m==="!"&&(A=this.__patterns.comment.read(),A?(w=c.get_directives(A),w&&w.ignore==="start"&&(A+=c.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(T=this._create_token(u.COMMENT,A),T.directives=w)}return T},R.prototype._read_processing=function(O){var T=null,A=null,w=null;if(O==="<"){var m=this._input.peek(1);(m==="!"||m==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(T=this._create_token(u.COMMENT,A),T.directives=w)}return T},R.prototype._read_open=function(O,T){var A=null,w=null;return T||O==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),w=this._create_token(u.TAG_OPEN,A)),w},R.prototype._read_open_handlebars=function(O,T){var A=null,w=null;return T||this._options.indent_handlebars&&O==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),w=this._create_token(u.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),w=this._create_token(u.TAG_OPEN,A))),w},R.prototype._read_close=function(O,T){var A=null,w=null;return T&&(T.text[0]==="<"&&(O===">"||O==="/"&&this._input.peek(1)===">")?(A=this._input.next(),O==="/"&&(A+=this._input.next()),w=this._create_token(u.TAG_CLOSE,A)):T.text[0]==="{"&&O==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),w=this._create_token(u.TAG_CLOSE,"}}"))),w},R.prototype._read_attribute=function(O,T,A){var w=null,m="";if(A&&A.text[0]==="<")if(O==="=")w=this._create_token(u.EQUALS,this._input.next());else if(O==='"'||O==="'"){var v=this._input.next();O==='"'?v+=this.__patterns.double_quote.read():v+=this.__patterns.single_quote.read(),w=this._create_token(u.VALUE,v)}else m=this.__patterns.attribute.read(),m&&(T.type===u.EQUALS?w=this._create_token(u.VALUE,m):w=this._create_token(u.ATTRIBUTE,m));return w},R.prototype._is_content_unformatted=function(O){return this._options.void_elements.indexOf(O)===-1&&(this._options.content_unformatted.indexOf(O)!==-1||this._options.unformatted.indexOf(O)!==-1)},R.prototype._read_raw_content=function(O,T,A){var w="";if(A&&A.text[0]==="{")w=this.__patterns.handlebars_raw_close.read();else if(T.type===u.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var m=T.opened.text.substr(1).toLowerCase();if(m==="script"||m==="style"){var v=this._read_comment_or_cdata(O);if(v)return v.type=u.TEXT,v;w=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(m)&&(w=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig")))}return w?this._create_token(u.TEXT,w):null},R.prototype._read_content_word=function(O){var T="";if(this._options.unformatted_content_delimiter&&(O===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(u.TEXT,T)},b.exports.Tokenizer=R,b.exports.TOKEN=u}],W={};function L(b){var p=W[b];if(p!==void 0)return p.exports;var _=W[b]={exports:{}};return K[b](_,_.exports,L),_.exports}var P=L(18);M=P})();var V=M;if(!0)!(de=[G,G("6UM0"),G("TXwP")],Z=function(K){var W=G("6UM0"),L=G("TXwP");return{html_beautify:function(P,b){return V(P,b,W.js_beautify,L.css_beautify)}}}.apply(Xe,de),Z!==void 0&&(ft.exports=Z));else var I,B})()},"rAM+":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return Z});var de=G("Qw5x");function Z(M,V){var I;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(I=Object(de.a)(M))||V&&M&&typeof M.length=="number"){I&&(M=I);var B=0,K=function(){};return{s:K,n:function(){return B>=M.length?{done:!0}:{done:!1,value:M[B++]}},e:function(p){throw p},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W=!0,L=!1,P;return{s:function(){I=M[Symbol.iterator]()},n:function(){var p=I.next();return W=p.done,p},e:function(p){L=!0,P=p},f:function(){try{!W&&I.return!=null&&I.return()}finally{if(L)throw P}}}}},rUJ1:function(ft,Xe){const G=/[&<>"']/,de=/[&<>"']/g,Z=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},I=w=>V[w];function B(w,m){if(m){if(G.test(w))return w.replace(de,I)}else if(Z.test(w))return w.replace(M,I);return w}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(w){return w.replace(K,(m,v)=>(v=v.toLowerCase(),v==="colon"?":":v.charAt(0)==="#"?v.charAt(1)==="x"?String.fromCharCode(parseInt(v.substring(2),16)):String.fromCharCode(+v.substring(1)):""))}const L=/(^|[^\[])\^/g;function P(w,m){w=w.source||w,m=m||"";const v={replace:(s,o)=>(o=o.source||o,o=o.replace(L,"$1"),w=w.replace(s,o),v),getRegex:()=>new RegExp(w,m)};return v}const b=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(w,m,v){if(w){let s;try{s=decodeURIComponent(W(v)).replace(b,"").toLowerCase()}catch(o){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}m&&!p.test(v)&&(v=a(m,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(s){return null}return v}const h={},r=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(w,m){h[" "+w]||(r.test(w)?h[" "+w]=w+"/":h[" "+w]=O(w,"/",!0)),w=h[" "+w];const v=w.indexOf(":")===-1;return m.substring(0,2)==="//"?v?m:w.replace(d,"$1")+m:m.charAt(0)==="/"?v?m:w.replace(l,"$1")+m:w+m}const u={exec:function(){}};function c(w){let m=1,v,s;for(;m<arguments.length;m++){v=arguments[m];for(s in v)Object.prototype.hasOwnProperty.call(v,s)&&(w[s]=v[s])}return w}function R(w,m){const v=w.replace(/\|/g,(E,g,C)=>{let N=!1,U=g;for(;--U>=0&&C[U]==="\\";)N=!N;return N?"|":" |"}),s=v.split(/ \|/);let o=0;if(s.length>m)s.splice(m);else for(;s.length<m;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(/\\\|/g,"|");return s}function O(w,m,v){const s=w.length;if(s===0)return"";let o=0;for(;o<s;){const E=w.charAt(s-o-1);if(E===m&&!v)o++;else if(E!==m&&v)o++;else break}return w.substr(0,s-o)}function T(w,m){if(w.indexOf(m[1])===-1)return-1;const v=w.length;let s=0,o=0;for(;o<v;o++)if(w[o]==="\\")o++;else if(w[o]===m[0])s++;else if(w[o]===m[1]&&(s--,s<0))return o;return-1}function A(w){w&&w.sanitize&&!w.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")}ft.exports={escape:B,unescape:W,edit:P,cleanUrl:_,resolveUrl:a,noopTest:u,merge:c,splitCells:R,rtrim:O,findClosingBracket:T,checkSanitizeDeprecation:A}},sboe:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return M});var de=G("q1tI"),Z=G.n(de),M=de.createContext(null)},sesT:function(ft,Xe){ft.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAoCAYAAACb3CikAAAAAXNSR0IArs4c6QAABJFJREFUWEftWF1oHFUU/u7MZmazm4Q0tS/RmARSba0tDVazqyB9sVYlDzWRllopErWlER9EFFGRIuqDT0UoQaO0adKkQqui+FKhQmqSQn8o1cbYQH9Iia3QNN387Pwemdmdyd472Z0kRMhD7ssddu4997vnfOc7Z5YRkYwlMNgyECEKyx4RabmEPfL39mdham0EqgIYAEJmDg7xrbfSmZ3BGECUmZ3hPWfnFCB/gbXHP3PXillDf754lQhVsxrKQvIO8jHm/SEUKiQluhYPHb0SAGJdajYzXuBvMKtHGAMRgXlXnqceOXsjUrQJj3b9KAD5jZkXDxqePQKBgcGZXQ9ln53ZBSq8DxAwZL1rT2JvFq0/1iYA+TKiXzidnjEY5lr+aMczuR7ynp0572DS58rG7o94IKP7VW10aNLbKJItQN5c9mVcxnE78FoMpRNWST6s1He28ECG3oulUyP3/NAQoNS+Drl0zTyj76UND8y6NwjjWrubPV4yADgZ3dT1HA/kwlsVU8bYbf9UIqhVjZDj1XmAzC901uR1aCM/+7ZcpjF2tvjxjgQHZPqP1kp7YuKGLxuiMATgBJSDd0EAZ1ZUfM4wR0CG4g0d6zgg2vnWWkObuJIvDiIZxXVzImfOpqxHbsYTh6o5IPr5fesMffKiH0SBfcF0FnWXd0FY+ru7mTQeTxxayQFJn9uTNPWp3nw6EaYjhQtCMK0coBKYGUt2RDkgU2dbtpCh/+Ipq5OPal0LImWLkzXm+CC04W+zPMpmDpgWSx6J82Qd2N1sk9XjhdG5ofJgIyIli5M15sQ1aNd/8qtgthZOxJKd5bxHBl55A2Qf9JVQULSwZA0PDU/vTM6xu7Fk5308R87s+sC27P1e+gaVMX9Zn0VYg8VZSDP3nmC348muSt4j/S8fAOzWXOXL7ScClkNdEKb5LvzLseTRDTxH+nYcI6DJ54hYxAL9iChQC6gEDL/Gkj1bRSADYNiUWy3V1Xsglz2ygBOCRdAavwx9+KucCkKQZOlItKH7VR5I//ZREFbNSDxBqd4GuaR2cWpN6ir0Gz/w/Y3EPo0lej6eAXJpX9l06t87fIcappSCshZqUvNcRZbVl5SGzu99IOaZnUnD1Ho9W16Z5sgqGJt3VonNNIDi4hU1qG8f8YFo/U2vEdlt3FniSWLnM19hEe1J0j/R5IkH3Et7Xbzev+0bsq3duUBCinzh74W50JtF2tUnT+zlgfQ1/gWiukL7w9qTMFkRHSJH1GciieOnZoCca16tp6cGuS+g2RAFm1hBswVdKfyFdVN56t0aYLPbOLqhMfteeJ/I+iQARDAkNj4BD+RZb7BSjKeLUEK3XJbpKEdRRf3h0voPW3zxJPpOMU5/PQxQVRj35hL2QNcG4K6pYnLsFmyDYKQJKzfstVZtfHoF8PCUD8T8fcsOss3uhRwStseCjRQB2nQaZtoCiqpRvv5tirKxd9T7nz+Qu58ZvZv7GZBwfgxr7ebSk1pQYbAYdNuEIREiJXWAUoNI+RNQKh6DfOdUj1K5dZd4iSX8t0SYv/+n98seER37H8mkzkc00C7pAAAAAElFTkSuQmCC"},spXi:function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(ft,Xe,G){"use strict";var de=G("VTBJ"),Z=G("1OyB"),M=G("vuIU"),V=G("Ji7U"),I=G("LK+K"),B=G("q1tI"),K=G.n(B),W=G("m+aA"),L=G("Zm9Q"),P=G("Kwbf"),b=G("c+Xe"),p=G("bdgK"),_="rc-observer-key",h=function(r){Object(V.a)(l,r);var d=Object(I.a)(l);function l(){var a;return Object(Z.a)(this,l),a=d.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(u){var c=a.props.onResize,R=u[0].target,O=R.getBoundingClientRect(),T=O.width,A=O.height,w=R.offsetWidth,m=R.offsetHeight,v=Math.floor(T),s=Math.floor(A);if(a.state.width!==v||a.state.height!==s||a.state.offsetWidth!==w||a.state.offsetHeight!==m){var o={width:v,height:s,offsetWidth:w,offsetHeight:m};a.setState(o),c&&Promise.resolve().then(function(){c(Object(de.a)(Object(de.a)({},o),{},{offsetWidth:w,offsetHeight:m}))})}},a.setChildNode=function(u){a.childNode=u},a}return Object(M.a)(l,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var c=Object(W.a)(this.childNode||this),R=c!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=c),!this.resizeObserver&&c&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(c))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,c=Object(L.a)(u);if(c.length>1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=c[0];if(B.isValidElement(R)&&Object(b.c)(R)){var O=R.ref;c[0]=B.cloneElement(R,{ref:Object(b.a)(O,this.setChildNode)})}return c.length===1?c[0]:c.map(function(T,A){return!B.isValidElement(T)||"key"in T&&T.key!==null?T:B.cloneElement(T,{key:"".concat(_,"-").concat(A)})})}}]),l}(B.Component);h.displayName="ResizeObserver",Xe.a=h},tK3L:function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___3uV00",flex_space_between:"flex_space_between___253zc",flex_box_vertical_center:"flex_box_vertical_center___3Nn4F",flex_box_center_end:"flex_box_center_end___3N00E",flex_box_column:"flex_box_column___wngbD",page:"page___1qj_b",wrap:"wrap___1vIxE",title:"title___3EB7K",select:"select___3yoep",contentWrap:"contentWrap___2vBaG",pngIcon:"pngIcon___3tbYk",tabsWrap:"tabsWrap___35WZr",searchWrap:"searchWrap___3zxJK",addQuestionBtn:"addQuestionBtn___3pN4A",search:"search___Qt6zp",searchIcon:"searchIcon___1fYTO",batchWrap:"batchWrap___1QFBy",customTable:"customTable___4pmq7",row:"row___mgwpl",contentListWrap:"contentListWrap___sfO91",li:"li___2kFZ7",bottom:"bottom___1-hPm",actionLeftItem:"actionLeftItem___3mz5t",questionTypeName:"questionTypeName___2Vr34",more:"more___Oo-pR",btnAdd:"btnAdd___3ROdW",cancelC:"cancelC___3SmK1",addC:"addC___3VFkF",actonBtn:"actonBtn___3j8EO",batch:"batch___1YJ8c",btns:"btns___33g-Q",btn:"btn___3yAUt",treeWrapper:"treeWrapper___3Sn4Z",treeHeader:"treeHeader___1fITD",treeContent:"treeContent___3wYv9",action:"action___2Ys8R",sendModal:"sendModal___3kKOa",line:"line___2PBOX",del:"del___1X0CN",divider:"divider___3XDiC",headerWrapper:"headerWrapper___3F2Wp",exportBtn:"exportBtn___3nux1"}},ulZh:function(ft,Xe,G){typeof window!="undefined"&&function(Z,M){ft.exports=M()}(this,function(){return function(de){var Z={};function M(V){if(Z[V])return Z[V].exports;var I=Z[V]={i:V,l:!1,exports:{}};return de[V].call(I.exports,I,I.exports,M),I.l=!0,I.exports}return M.m=de,M.c=Z,M.d=function(V,I,B){M.o(V,I)||Object.defineProperty(V,I,{enumerable:!0,get:B})},M.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},M.t=function(V,I){if(I&1&&(V=M(V)),I&8)return V;if(I&4&&typeof V=="object"&&V&&V.__esModule)return V;var B=Object.create(null);if(M.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:V}),I&2&&typeof V!="string")for(var K in V)M.d(B,K,function(W){return V[W]}.bind(null,K));return B},M.n=function(V){var I=V&&V.__esModule?function(){return V.default}:function(){return V};return M.d(I,"a",I),I},M.o=function(V,I){return Object.prototype.hasOwnProperty.call(V,I)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(de,Z,M){"use strict";var V=Object.prototype.hasOwnProperty,I="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(I=!1));function K(b,p,_){this.fn=b,this.context=p,this.once=_||!1}function W(b,p,_,h,r){if(typeof _!="function")throw new TypeError("The listener must be a function");var d=new K(_,h||b,r),l=I?I+p:p;return b._events[l]?b._events[l].fn?b._events[l]=[b._events[l],d]:b._events[l].push(d):(b._events[l]=d,b._eventsCount++),b}function L(b,p){--b._eventsCount===0?b._events=new B:delete b._events[p]}function P(){this._events=new B,this._eventsCount=0}P.prototype.eventNames=function(){var p=[],_,h;if(this._eventsCount===0)return p;for(h in _=this._events)V.call(_,h)&&p.push(I?h.slice(1):h);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(_)):p},P.prototype.listeners=function(p){var _=I?I+p:p,h=this._events[_];if(!h)return[];if(h.fn)return[h.fn];for(var r=0,d=h.length,l=new Array(d);r<d;r++)l[r]=h[r].fn;return l},P.prototype.listenerCount=function(p){var _=I?I+p:p,h=this._events[_];return h?h.fn?1:h.length:0},P.prototype.emit=function(p,_,h,r,d,l){var a=I?I+p:p;if(!this._events[a])return!1;var u=this._events[a],c=arguments.length,R,O;if(u.fn){u.once&&this.removeListener(p,u.fn,void 0,!0);switch(c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,_),!0;case 3:return u.fn.call(u.context,_,h),!0;case 4:return u.fn.call(u.context,_,h,r),!0;case 5:return u.fn.call(u.context,_,h,r,d),!0;case 6:return u.fn.call(u.context,_,h,r,d,l),!0}for(O=1,R=new Array(c-1);O<c;O++)R[O-1]=arguments[O];u.fn.apply(u.context,R)}else{var T=u.length,A;for(O=0;O<T;O++){u[O].once&&this.removeListener(p,u[O].fn,void 0,!0);switch(c){case 1:u[O].fn.call(u[O].context);break;case 2:u[O].fn.call(u[O].context,_);break;case 3:u[O].fn.call(u[O].context,_,h);break;case 4:u[O].fn.call(u[O].context,_,h,r);break;default:if(!R)for(A=1,R=new Array(c-1);A<c;A++)R[A-1]=arguments[A];u[O].fn.apply(u[O].context,R)}}}return!0},P.prototype.on=function(p,_,h){return W(this,p,_,h,!1)},P.prototype.once=function(p,_,h){return W(this,p,_,h,!0)},P.prototype.removeListener=function(p,_,h,r){var d=I?I+p:p;if(!this._events[d])return this;if(!_)return L(this,d),this;var l=this._events[d];if(l.fn)l.fn===_&&(!r||l.once)&&(!h||l.context===h)&&L(this,d);else{for(var a=0,u=[],c=l.length;a<c;a++)(l[a].fn!==_||r&&!l[a].once||h&&l[a].context!==h)&&u.push(l[a]);u.length?this._events[d]=u.length===1?u[0]:u:L(this,d)}return this},P.prototype.removeAllListeners=function(p){var _;return p?(_=I?I+p:p,this._events[_]&&L(this,_)):(this._events=new B,this._eventsCount=0),this},P.prototype.off=P.prototype.removeListener,P.prototype.addListener=P.prototype.on,P.prefixed=I,P.EventEmitter=P,de.exports=P},"./node_modules/url-toolkit/src/url-toolkit.js":function(de,Z,M){(function(V){var I=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,B=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,L={buildAbsoluteURL:function(P,b,p){if(p=p||{},P=P.trim(),b=b.trim(),!b){if(!p.alwaysNormalize)return P;var _=L.parseURL(P);if(!_)throw new Error("Error trying to parse base URL.");return _.path=L.normalizePath(_.path),L.buildURLFromParts(_)}var h=L.parseURL(b);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return p.alwaysNormalize?(h.path=L.normalizePath(h.path),L.buildURLFromParts(h)):b;var r=L.parseURL(P);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var d=B.exec(r.path);r.netLoc=d[1],r.path=d[2]}r.netLoc&&!r.path&&(r.path="/");var l={scheme:r.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(l.netLoc=r.netLoc,h.path[0]!=="/"))if(!h.path)l.path=r.path,h.params||(l.params=r.params,h.query||(l.query=r.query));else{var a=r.path,u=a.substring(0,a.lastIndexOf("/")+1)+h.path;l.path=L.normalizePath(u)}return l.path===null&&(l.path=p.alwaysNormalize?L.normalizePath(h.path):h.path),L.buildURLFromParts(l)},parseURL:function(P){var b=I.exec(P);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(P){for(P=P.split("").reverse().join("").replace(K,"");P.length!==(P=P.replace(W,"")).length;);return P.split("").reverse().join("")},buildURLFromParts:function(P){return P.scheme+P.netLoc+P.path+P.params+P.query+P.fragment}};de.exports=L})(this)},"./node_modules/webworkify-webpack/index.js":function(de,Z,M){function V(p){var _={};function h(d){if(_[d])return _[d].exports;var l=_[d]={i:d,l:!1,exports:{}};return p[d].call(l.exports,l,l.exports,h),l.l=!0,l.exports}h.m=p,h.c=_,h.i=function(d){return d},h.d=function(d,l,a){h.o(d,l)||Object.defineProperty(d,l,{configurable:!1,enumerable:!0,get:a})},h.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},h.n=function(d){var l=d&&d.__esModule?function(){return d.default}:function(){return d};return h.d(l,"a",l),l},h.o=function(d,l){return Object.prototype.hasOwnProperty.call(d,l)},h.p="/",h.oe=function(d){throw console.error(d),d};var r=h(h.s=ENTRY_MODULE);return r.default||r}var I="[\\.|\\-|\\+|\\w|/|@]+",B="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+I+").*?\\)";function K(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(p){return!isNaN(1*p)}function L(p,_,h){var r={};r[h]=[];var d=_.toString(),l=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return r;for(var a=l[1],u=new RegExp("(\\\\n|\\W)"+K(a)+B,"g"),c;c=u.exec(d);){if(c[3]==="dll-reference")continue;r[h].push(c[3])}for(u=new RegExp("\\("+K(a)+'\\("(dll-reference\\s('+I+'))"\\)\\)'+B,"g");c=u.exec(d);)p[c[2]]||(r[h].push(c[1]),p[c[2]]=M(c[1]).m),r[c[2]]=r[c[2]]||[],r[c[2]].push(c[4]);for(var R=Object.keys(r),O=0;O<R.length;O++)for(var T=0;T<r[R[O]].length;T++)W(r[R[O]][T])&&(r[R[O]][T]=1*r[R[O]][T]);return r}function P(p){var _=Object.keys(p);return _.reduce(function(h,r){return h||p[r].length>0},!1)}function b(p,_){for(var h={main:[_]},r={main:[]},d={main:{}};P(h);)for(var l=Object.keys(h),a=0;a<l.length;a++){var u=l[a],c=h[u],R=c.pop();if(d[u]=d[u]||{},d[u][R]||!p[u][R])continue;d[u][R]=!0,r[u]=r[u]||[],r[u].push(R);for(var O=L(p,p[u][R],u),T=Object.keys(O),A=0;A<T.length;A++)h[T[A]]=h[T[A]]||[],h[T[A]]=h[T[A]].concat(O[T[A]])}return r}de.exports=function(p,_){_=_||{};var h={main:M.m},r=_.all?{main:Object.keys(h.main)}:b(h,p),d="";Object.keys(r).filter(function(R){return R!=="main"}).forEach(function(R){for(var O=0;r[R][O];)O++;r[R].push(O),h[R][O]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+R+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(O))+")({"+r[R].map(function(T){return""+JSON.stringify(T)+": "+h[R][T].toString()}).join(",")+`});
`}),d=d+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+r.main.map(function(R){return""+JSON.stringify(R)+": "+h.main[R].toString()}).join(",")+"}))(self);";var l=new window.Blob([d],{type:"text/javascript"});if(_.bare)return l;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,u=a.createObjectURL(l),c=new window.Worker(u);return c.objectURL=u,c}},"./src/config.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"hlsDefaultConfig",function(){return A}),M.d(Z,"mergeConfig",function(){return m}),M.d(Z,"enableStreamingMode",function(){return v});var V=M("./src/controller/abr-controller.ts"),I=M("./src/controller/audio-stream-controller.ts"),B=M("./src/controller/audio-track-controller.ts"),K=M("./src/controller/subtitle-stream-controller.ts"),W=M("./src/controller/subtitle-track-controller.ts"),L=M("./src/controller/buffer-controller.ts"),P=M("./src/controller/timeline-controller.ts"),b=M("./src/controller/cap-level-controller.ts"),p=M("./src/controller/fps-controller.ts"),_=M("./src/controller/eme-controller.ts"),h=M("./src/controller/cmcd-controller.ts"),r=M("./src/utils/xhr-loader.ts"),d=M("./src/utils/fetch-loader.ts"),l=M("./src/utils/cues.ts"),a=M("./src/utils/mediakeys-helper.ts"),u=M("./src/utils/logger.ts");function c(){return c=Object.assign||function(s){for(var o=1;o<arguments.length;o++){var E=arguments[o];for(var g in E)Object.prototype.hasOwnProperty.call(E,g)&&(s[g]=E[g])}return s},c.apply(this,arguments)}function R(s,o){var E=Object.keys(s);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(s);o&&(g=g.filter(function(C){return Object.getOwnPropertyDescriptor(s,C).enumerable})),E.push.apply(E,g)}return E}function O(s){for(var o=1;o<arguments.length;o++){var E=arguments[o]!=null?arguments[o]:{};o%2?R(Object(E),!0).forEach(function(g){T(s,g,E[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(E)):R(Object(E)).forEach(function(g){Object.defineProperty(s,g,Object.getOwnPropertyDescriptor(E,g))})}return s}function T(s,o,E){return o in s?Object.defineProperty(s,o,{value:E,enumerable:!0,configurable:!0,writable:!0}):s[o]=E,s}var A=O(O({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:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:L.default,capLevelController:b.default,fpsController:p.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:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},w()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:W.default,timelineController:P.TimelineController,audioStreamController:I.default,audioTrackController:B.default,emeController:_.default,cmcdController:h.default});function w(){return{cueHandler:l.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function m(s,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return c({},s,o)}function v(s){var o=s.loader;if(o!==d.default&&o!==r.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var E=Object(d.fetchSupported)();E&&(s.loader=d.default,s.progressive=!0,s.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/polyfills/number.ts"),I=M("./src/utils/ewma-bandwidth-estimator.ts"),B=M("./src/events.ts"),K=M("./src/utils/buffer-helper.ts"),W=M("./src/errors.ts"),L=M("./src/types/loader.ts"),P=M("./src/utils/logger.ts");function b(h,r){for(var d=0;d<r.length;d++){var l=r[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function p(h,r,d){return r&&b(h.prototype,r),d&&b(h,d),h}var _=function(){function h(d){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=d;var l=d.config;this.bwEstimator=new I.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var r=h.prototype;return r.registerListeners=function(){var l=this.hls;l.on(B.Events.FRAG_LOADING,this.onFragLoading,this),l.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(B.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var l=this.hls;l.off(B.Events.FRAG_LOADING,this.onFragLoading,this),l.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(B.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(l,a){var u=a.frag;if(u.type===L.PlaylistLevelType.MAIN&&!this.timer){var c;this.fragCurrent=u,this.partCurrent=(c=a.part)!=null?c:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(l,a){var u=this.hls.config;a.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var l=this.fragCurrent,a=this.partCurrent,u=this.hls,c=u.autoLevelEnabled,R=u.config,O=u.media;if(!l||!O)return;var T=a?a.stats:l.stats,A=a?a.duration:l.duration;if(T.aborted){P.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!c||O.paused||!O.playbackRate||!O.readyState)return;var w=performance.now()-T.loading.start,m=Math.abs(O.playbackRate);if(w<=500*A/m)return;var v=u.levels,s=u.minAutoLevel,o=v[l.level],E=T.total||Math.max(T.loaded,Math.round(A*o.maxBitrate/8)),g=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/w),C=(E-T.loaded)/g,N=O.currentTime,U=(K.BufferHelper.bufferInfo(O,N,R.maxBufferHole).end-N)/m;if(U>=2*A/m||C<=U)return;var j=Number.POSITIVE_INFINITY,H;for(H=l.level-1;H>s;H--){var y=v[H].maxBitrate;if(j=A*y/(8*.8*g),j<U)break}if(j>=C)return;var x=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+l.sn+(a?" part "+a.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+(Object(V.isFiniteNumber)(x)?(x/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+C.toFixed(3)+` s
Estimated load time for the next fragment: `+j.toFixed(3)+` s
Time to underbuffer: `+U.toFixed(3)+" s"),u.nextLoadLevel=H,this.bwEstimator.sample(w,T.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),u.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:a,stats:T})},r.onFragLoaded=function(l,a){var u=a.frag,c=a.part;if(u.type===L.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(u.sn)){var R=c?c.stats:u.stats,O=c?c.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[u.level],A=(T.loaded?T.loaded.bytes:0)+R.loaded,w=(T.loaded?T.loaded.duration:0)+O;T.loaded={bytes:A,duration:w},T.realBitrate=Math.round(8*A/w)}if(u.bitrateTest){var m={stats:R,frag:u,part:c,id:u.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,m),u.bitrateTest=!1}}},r.onFragBuffered=function(l,a){var u=a.frag,c=a.part,R=c?c.stats:u.stats;if(R.aborted)return;if(u.type!==L.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var O=R.parsing.end-R.loading.start;this.bwEstimator.sample(O,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=O/1e3:this.bitrateTestDelay=0},r.onError=function(l,a){switch(a.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var l=this.fragCurrent,a=this.partCurrent,u=this.hls,c=u.maxAutoLevel,R=u.config,O=u.minAutoLevel,T=u.media,A=a?a.duration:l?l.duration:0,w=T?T.currentTime:0,m=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,s=(K.BufferHelper.bufferInfo(T,w,R.maxBufferHole).end-w)/m,o=this.findBestLevel(v,O,c,s,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(o>=0)return o;P.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=A?Math.min(A,R.maxStarvationDelay):R.maxStarvationDelay,g=R.abrBandWidthFactor,C=R.abrBandWidthUpFactor;if(!s){var N=this.bitrateTestDelay;if(N){var U=A?Math.min(A,R.maxLoadingDelay):R.maxLoadingDelay;E=U-N,P.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),g=C=1}}return o=this.findBestLevel(v,O,c,s+E,g,C),Math.max(o,0)},r.findBestLevel=function(l,a,u,c,R,O){for(var T,A=this.fragCurrent,w=this.partCurrent,m=this.lastLoadedFragLevel,v=this.hls.levels,s=v[m],o=!!(s!=null&&(T=s.details)!==null&&T!==void 0&&T.live),E=s==null?void 0:s.codecSet,g=w?w.duration:A?A.duration:0,C=u;C>=a;C--){var N=v[C];if(!N||E&&N.codecSet!==E)continue;var U=N.details,j=(w?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||g,H=void 0;C<=m?H=R*l:H=O*l;var y=v[C].maxBitrate,x=y*j/H;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+C+"/"+Math.round(H)+"/"+y+"/"+j+"/"+c+"/"+x),H>y&&(!x||o&&!this.bitrateTestDelay||x<c))return C}return-1},p(h,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,a=this.bwEstimator;if(l!==-1&&(!a||!a.canEstimate()))return l;var u=this.getNextABRAutoLevel();return l!==-1&&(u=Math.min(l,u)),u},set:function(l){this._nextAutoLevel=l}}]),h}();Z.default=_},"./src/controller/audio-stream-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/polyfills/number.ts"),I=M("./src/controller/base-stream-controller.ts"),B=M("./src/events.ts"),K=M("./src/utils/buffer-helper.ts"),W=M("./src/controller/fragment-tracker.ts"),L=M("./src/types/level.ts"),P=M("./src/types/loader.ts"),b=M("./src/loader/fragment.ts"),p=M("./src/demux/chunk-cache.ts"),_=M("./src/demux/transmuxer-interface.ts"),h=M("./src/types/transmuxer.ts"),r=M("./src/controller/fragment-finders.ts"),d=M("./src/utils/discontinuities.ts"),l=M("./src/errors.ts"),a=M("./src/utils/logger.ts");function u(){return u=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var m=arguments[w];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(A[v]=m[v])}return A},u.apply(this,arguments)}function c(A,w){A.prototype=Object.create(w.prototype),A.prototype.constructor=A,R(A,w)}function R(A,w){return R=Object.setPrototypeOf||function(v,s){return v.__proto__=s,v},R(A,w)}var O=100,T=function(A){c(w,A);function w(v,s){var o;return o=A.call(this,v,s,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var m=w.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var s=this.hls;s.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(B.Events.ERROR,this.onError,this),s.on(B.Events.BUFFER_RESET,this.onBufferReset,this),s.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var s=this.hls;s.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(B.Events.ERROR,this.onError,this),s.off(B.Events.BUFFER_RESET,this.onBufferReset,this),s.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onInitPtsFound=function(s,o){var E=o.frag,g=o.id,C=o.initPTS;if(g==="main"){var N=E.cc;this.initPTS[E.cc]=C,this.log("InitPTS for cc: "+N+" found from main: "+C),this.videoTrackCC=N,this.state===I.State.WAITING_INIT_PTS&&this.tick()}},m.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=I.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(O),this.fragLoadError=0,o>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+o.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()},m.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_TRACK:{var s,o=this.levels,E=this.trackId,g=o==null||((s=o[E])===null||s===void 0)?void 0:s.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=I.State.WAITING_INIT_PTS}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var C,N=performance.now(),U=this.retryDate;(!U||N>=U||(C=this.media)!==null&&C!==void 0&&C.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 H=j.frag,y=j.part,x=j.cache,F=j.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.FRAG_LOADING;var Q=x.flush(),q={frag:H,part:y,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(q),F&&A.prototype._handleFragmentLoadComplete.call(this,q)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ie=this.getLoadPosition(),ge=K.BufferHelper.bufferInfo(this.mediaBuffer,ie,this.config.maxBufferHole),fe=Object(r.fragmentWithinToleranceTest)(ge.end,this.config.maxFragLookUpTolerance,H);fe<0&&(a.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+ge.end+" is needed"),this.clearWaitingFragment())}}else this.state=I.State.IDLE}}this.onTickEnd()},m.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.IDLE)},m.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:s,E=o.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},m.doTickIdle=function(){var s,o,E=this.hls,g=this.levels,C=this.media,N=this.trackId,U=E.config;if(!g||!g[N])return;if(!C&&(this.startFragRequested||!U.startFragPrefetch))return;var j=g[N],H=j.details;if(!H||H.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(H)){this.state=I.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var y=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(y===null)return;var x=y.len,F=this.getMaxBufferLength(),Q=this.audioSwitch;if(x>=F&&!Q)return;if(!Q&&this._streamEnded(y,H)){E.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=I.State.ENDED;return}var q=H.fragments,ie=q[0].start,ge=y.end;if(Q){var fe=this.getLoadPosition();ge=fe,H.PTSKnown&&fe<ie&&((y.end>ie||y.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),C.currentTime=ie+.05))}var ue=this.getNextFragment(ge,H);if(!ue){this.bufferFlushed=!0;return}((s=ue.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((o=ue.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(ue,H):this.loadFragment(ue,H,ge)},m.getMaxBufferLength=function(){var s=A.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return o===null?s:Math.max(s,o.len)},m.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(s,o){var E=o.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(g){return new L.Level(g)})},m.onAudioTrackSwitching=function(s,o){var E=!!o.url;this.trackId=o.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(O):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=I.State.IDLE):this.state=I.State.STOPPED,this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},m.onLevelLoaded=function(s,o){this.mainDetails=o.details},m.onAudioTrackLoaded=function(s,o){var E,g=this.levels,C=o.details,N=o.id;if(!g){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+C.startSN+","+C.endSN+"],duration:"+C.totalduration);var U=g[N],j=0;if(C.live||(E=U.details)!==null&&E!==void 0&&E.live){var H=this.mainDetails;if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed||!H)return;!U.details&&C.hasProgramDateTime&&H.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(C,H),j=C.fragments[0].start):j=this.alignPlaylists(C,U.details)}U.details=C,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!C.live)&&this.setStartPosition(U.details,j),this.state===I.State.WAITING_TRACK&&!this.waitForCdnTuneIn(C)&&(this.state=I.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(s){var o,E=s.frag,g=s.part,C=s.payload,N=this.config,U=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var H=j[U];console.assert(H,"Audio track is defined on fragment load progress");var y=H.details;console.assert(y,"Audio track details are defined on fragment load progress");var x=N.defaultAudioCodec||H.audioCodec||"mp4a.40.2",F=this.transmuxer;F||(F=this.transmuxer=new _.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[E.cc],q=(o=E.initSegment)===null||o===void 0?void 0:o.data;if(Q!==void 0){var ie=!1,ge=g?g.index:-1,fe=ge!==-1,ue=new h.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,C.byteLength,ge,fe);F.push(C,q,x,"",E,g,y.totalduration,ie,ue,Q)}else{a.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+y.startSN+" ,"+y.endSN+"],track "+U);var he=this.waitingData=this.waitingData||{frag:E,part:g,cache:new p.default,complete:!1},_e=he.cache;_e.push(new Uint8Array(C)),this.waitingVideoCC=this.videoTrackCC,this.state=I.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,s)},m.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},m.onBufferCreated=function(s,o){var E=o.tracks.audio;E&&(this.mediaBuffer=E.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},m.onFragBuffered=function(s,o){var E=o.frag,g=o.part;if(E.type!==P.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(g?" p: "+g.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,g)},m.onError=function(s,o){switch(o.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.AUDIO,o);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==I.State.ERROR&&this.state!==I.State.STOPPED&&(this.state=o.fatal?I.State.ERROR:I.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var E=!0,g=this.getFwdBufferInfo(this.mediaBuffer,P.PlaylistLevelType.AUDIO);g&&g.len>.5&&(E=!this.reduceMaxBufferLength(g.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},m.onBufferFlushed=function(s,o){var E=o.type;E===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},m._handleTransmuxComplete=function(s){var o,E="audio",g=this.hls,C=s.remuxResult,N=s.chunkMeta,U=this.getCurrentContext(N);if(!U){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var j=U.frag,H=U.part,y=C.audio,x=C.text,F=C.id3,Q=C.initSegment;if(this.fragContextChanged(j))return;if(this.state=I.State.PARSING,this.audioSwitch&&y&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,j,N),g.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:E,tracks:Q.tracks})),y){var q=y.startPTS,ie=y.endPTS,ge=y.startDTS,fe=y.endDTS;H&&(H.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:ie,startDTS:ge,endDTS:fe}),j.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,q,ie,ge,fe),this.bufferFragmentData(y,j,H,N)}if(F!=null&&(o=F.samples)!==null&&o!==void 0&&o.length){var ue=u({frag:j,id:E},F);g.trigger(B.Events.FRAG_PARSING_METADATA,ue)}if(x){var he=u({frag:j,id:E},x);g.trigger(B.Events.FRAG_PARSING_USERDATA,he)}},m._bufferInitSegment=function(s,o,E){if(this.state!==I.State.PARSING)return;s.video&&delete s.video;var g=s.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,s);var C=g.initSegment;if(C!=null&&C.byteLength){var N={type:"audio",frag:o,part:null,chunkMeta:E,parent:o.type,data:C};this.hls.trigger(B.Events.BUFFER_APPENDING,N)}this.tick()},m.loadFragment=function(s,o,E){var g=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||g===W.FragmentState.NOT_LOADED||g===W.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):o.live&&!Object(V.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,A.prototype.loadFragment.call(this,s,o,E)))},m.completeAudioSwitch=function(){var s=this.hls,o=this.media,E=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:E})},w}(I.default);Z.default=T},"./src/controller/audio-track-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts"),I=M("./src/errors.ts"),B=M("./src/controller/base-playlist-controller.ts"),K=M("./src/types/loader.ts");function W(_,h){for(var r=0;r<h.length;r++){var d=h[r];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(_,d.key,d)}}function L(_,h,r){return h&&W(_.prototype,h),r&&W(_,r),_}function P(_,h){_.prototype=Object.create(h.prototype),_.prototype.constructor=_,b(_,h)}function b(_,h){return b=Object.setPrototypeOf||function(d,l){return d.__proto__=l,d},b(_,h)}var p=function(_){P(h,_);function h(d){var l;return l=_.call(this,d,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var r=h.prototype;return r.registerListeners=function(){var l=this.hls;l.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(V.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var l=this.hls;l.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(V.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,_.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(l,a){this.tracks=a.audioTracks||[]},r.onAudioTrackLoaded=function(l,a){var u=a.id,c=a.details,R=this.tracksInGroup[u];if(!R){this.warn("Invalid audio track id "+u);return}var O=R.details;R.details=a.details,this.log("audioTrack "+u+" loaded ["+c.startSN+"-"+c.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,a,O))},r.onLevelLoading=function(l,a){this.switchLevel(a.level)},r.onLevelSwitching=function(l,a){this.switchLevel(a.level)},r.switchLevel=function(l){var a=this.hls.levels[l];if(!(a!=null&&a.audioGroupIds))return;var u=a.audioGroupIds[a.urlId];if(this.groupId!==u){this.groupId=u;var c=this.tracks.filter(function(O){return!u||O.groupId===u});this.selectDefaultTrack&&!c.some(function(O){return O.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=c;var R={audioTracks:c};this.log("Updating audio tracks, "+c.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},r.onError=function(l,a){if(_.prototype.onError.call(this,l,a),a.fatal||!a.context)return;a.context.type===K.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},r.setAudioTrack=function(l){var a=this.tracksInGroup;if(l<0||l>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=a[this.trackId];this.log("Now switching to audio-track index "+l);var c=a[l],R=c.id,O=c.groupId,T=O===void 0?"":O,A=c.name,w=c.type,m=c.url;if(this.trackId=l,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:T,name:A,type:w,url:m}),c.details&&!c.details.live)return;var v=this.switchParams(c.url,u==null?void 0:u.details);this.loadPlaylist(v)},r.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,u=this.findTrackId(a)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(l){for(var a=this.tracksInGroup,u=0;u<a.length;u++){var c=a[u];if((!this.selectDefaultTrack||c.default)&&(!l||l===c.name))return c.id}return-1},r.loadPlaylist=function(l){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var u=a.id,c=a.groupId,R=a.url;if(l)try{R=l.addDirectives(R)}catch(O){this.warn("Could not construct new URL with HLS Delivery Directives: "+O)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:R,id:u,groupId:c,deliveryDirectives:l||null})}},L(h,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),h}(B.default);Z.default=p},"./src/controller/base-playlist-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return L});var V=M("./src/polyfills/number.ts"),I=M("./src/types/level.ts"),B=M("./src/controller/level-helper.ts"),K=M("./src/utils/logger.ts"),W=M("./src/errors.ts"),L=function(){function P(p,_){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,_+":"),this.warn=K.logger.warn.bind(K.logger,_+":"),this.hls=p}var b=P.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(_,h){h.fatal&&h.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(_,h){var r=h==null?void 0:h.renditionReports;if(r)for(var d=0;d<r.length;d++){var l=r[d],a=""+l.URI;if(a===_.substr(-a.length)){var u=parseInt(l["LAST-MSN"]),c=parseInt(l["LAST-PART"]);if(h&&this.hls.config.lowLatencyMode){var R=Math.min(h.age-h.partTarget,h.targetduration);c!==void 0&&R>h.partTarget&&(c+=1)}if(Object(V.isFiniteNumber)(u))return new I.HlsUrlParameters(u,Object(V.isFiniteNumber)(c)?c:void 0,I.HlsSkip.No)}}},b.loadPlaylist=function(_){},b.shouldLoadTrack=function(_){return this.canLoad&&_&&!!_.url&&(!_.details||_.details.live)},b.playlistLoaded=function(_,h,r){var d=this,l=h.details,a=h.stats,u=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(l.advancedDateTime=Date.now()-u,l.live||r!=null&&r.live){if(l.reloaded(r),r&&this.log("live playlist "+_+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),r&&l.fragments.length>0&&Object(B.mergeDetails)(r,l),!this.canLoad||!l.live)return;var c,R=void 0,O=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var T=this.hls.config.lowLatencyMode,A=l.lastPartSn,w=l.endSN,m=l.lastPartIndex,v=m!==-1,s=A===w,o=T?0:m;v?(R=s?w+1:A,O=s?o:m+1):R=w+1;var E=l.age,g=E+l.ageHeader,C=Math.min(g-l.partTarget,l.targetduration*1.5);if(C>0){if(r&&C>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+C+" with playlist age: "+l.age),C=0;else{var N=Math.floor(C/l.targetduration);if(R+=N,O!==void 0){var U=Math.round(C%l.targetduration/l.partTarget);O+=U}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+C+" skip sn "+N+" to part "+O)}l.tuneInGoal=C}if(c=this.getDeliveryDirectives(l,h.deliveryDirectives,R,O),T||!s){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(l,h.deliveryDirectives,R,O);var j=Object(B.computeReloadInterval)(l,a);R!==void 0&&l.canBlockReload&&(j-=l.partTarget||1),this.log("reload live playlist "+_+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(c)},j)}else this.clearTimer()},b.getDeliveryDirectives=function(_,h,r,d){var l=Object(I.getSkipValue)(_,r);return h!=null&&h.skip&&_.deltaUpdateFailed&&(r=h.msn,d=h.part,l=I.HlsSkip.No),new I.HlsUrlParameters(r,d,l)},b.retryLoadingOrFail=function(_){var h=this,r=this.hls.config,d=this.retryCount<r.levelLoadingMaxRetry;if(d){var l;if(this.retryCount++,_.details.indexOf("LoadTimeOut")>-1&&(l=_.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+_.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+_.details+'"')}}else this.warn('cannot recover from error "'+_.details+'"'),this.clearTimer(),_.fatal=!0;return d},P}()},"./src/controller/base-stream-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"State",function(){return w}),M.d(Z,"default",function(){return m});var V=M("./src/polyfills/number.ts"),I=M("./src/task-loop.ts"),B=M("./src/controller/fragment-tracker.ts"),K=M("./src/utils/buffer-helper.ts"),W=M("./src/utils/logger.ts"),L=M("./src/events.ts"),P=M("./src/errors.ts"),b=M("./src/types/transmuxer.ts"),p=M("./src/utils/mp4-tools.ts"),_=M("./src/utils/discontinuities.ts"),h=M("./src/controller/fragment-finders.ts"),r=M("./src/controller/level-helper.ts"),d=M("./src/loader/fragment-loader.ts"),l=M("./src/crypt/decrypter.ts"),a=M("./src/utils/time-ranges.ts"),u=M("./src/types/loader.ts");function c(v,s){for(var o=0;o<s.length;o++){var E=s[o];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(v,E.key,E)}}function R(v,s,o){return s&&c(v.prototype,s),o&&c(v,o),v}function O(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function T(v,s){v.prototype=Object.create(s.prototype),v.prototype.constructor=v,A(v,s)}function A(v,s){return A=Object.setPrototypeOf||function(E,g){return E.__proto__=g,E},A(v,s)}var w={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"},m=function(v){T(s,v);function s(E,g,C){var N;return N=v.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=w.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=C,N.log=W.logger.log.bind(W.logger,C+":"),N.warn=W.logger.warn.bind(W.logger,C+":"),N.hls=E,N.fragmentLoader=new d.default(E.config),N.fragmentTracker=g,N.config=E.config,N.decrypter=new l.default(E,E.config),E.on(L.Events.KEY_LOADED,N.onKeyLoaded,O(N)),N}var o=s.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(g){},o.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=w.STOPPED},o._streamEnded=function(g,C){var N=this.fragCurrent,U=this.fragmentTracker;if(!C.live&&N&&N.sn===C.endSN&&!g.nextStart){var j=U.getState(N);return j===B.FragmentState.PARTIAL||j===B.FragmentState.OK}return!1},o.onMediaAttached=function(g,C){var N=this.media=this.mediaBuffer=C.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===w.STOPPED&&this.startLoad(U.startPosition)},o.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var g=this.config,C=this.fragCurrent,N=this.media,U=this.mediaBuffer,j=this.state,H=N?N.currentTime:0,y=K.BufferHelper.bufferInfo(U||N,H,g.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+j),j===w.ENDED)this.resetLoadingState();else if(C&&!y.len){var x=g.maxFragLookUpTolerance,F=C.start-x,Q=C.start+C.duration+x,q=H>Q;(H<F||q)&&(q&&C.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),C.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=H),!this.loadedmetadata&&!y.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(g,C){if(this.state!==w.KEY_LOADING||C.frag!==this.fragCurrent||!this.levels)return;this.state=w.IDLE;var N=this.levels[C.frag.level].details;N&&this.loadFragment(C.frag,N,C.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),v.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=w.STOPPED,this.hls.off(L.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,v.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(g,C){this.log("Loading key for "+g.sn+" of ["+C.startSN+"-"+C.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=w.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(L.Events.KEY_LOADING,{frag:g})},o.loadFragment=function(g,C,N){this._loadFragForPlayback(g,C,N)},o._loadFragForPlayback=function(g,C,N){var U=this,j=function(y){if(U.fragContextChanged(g)){U.warn("Fragment "+g.sn+(y.part?" p: "+y.part.index:"")+" of level "+g.level+" was dropped during download."),U.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,U._handleFragmentLoadProgress(y)};this._doFragLoad(g,C,N,j).then(function(H){if(!H)return;U.fragLoadError=0;var y=U.state;if(U.fragContextChanged(g)){(y===w.FRAG_LOADING||y===w.BACKTRACKING||!U.fragCurrent&&y===w.PARSING)&&(U.fragmentTracker.removeFragment(g),U.state=w.IDLE);return}if("payload"in H&&(U.log("Loaded fragment "+g.sn+" of level "+g.level),U.hls.trigger(L.Events.FRAG_LOADED,H),U.state===w.BACKTRACKING)){U.fragmentTracker.backtrack(g,H),U.resetFragmentLoading(g);return}U._handleFragmentLoadComplete(H)}).catch(function(H){U.warn(H),U.resetFragmentLoading(g)})},o.flushMainBuffer=function(g,C,N){if(N===void 0&&(N=null),!(g-C))return;var U={startOffset:g,endOffset:C,type:N};this.fragLoadError=0,this.hls.trigger(L.Events.BUFFER_FLUSHING,U)},o._loadInitSegment=function(g){var C=this;this._doFragLoad(g).then(function(N){if(!N||C.fragContextChanged(g)||!C.levels)throw new Error("init load aborted");return N}).then(function(N){var U=C.hls,j=N.payload,H=g.decryptdata;if(j&&j.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var y=self.performance.now();return C.decrypter.webCryptoDecrypt(new Uint8Array(j),H.key.buffer,H.iv.buffer).then(function(x){var F=self.performance.now();return U.trigger(L.Events.FRAG_DECRYPTED,{frag:g,payload:x,stats:{tstart:y,tdecrypt:F}}),N.payload=x,N})}return N}).then(function(N){var U=C.fragCurrent,j=C.hls,H=C.levels;if(!H)throw new Error("init load aborted, missing levels");var y=H[g.level].details;console.assert(y,"Level details are defined when init segment is loaded");var x=g.stats;C.state=w.IDLE,C.fragLoadError=0,g.data=new Uint8Array(N.payload),x.parsing.start=x.buffering.start=self.performance.now(),x.parsing.end=x.buffering.end=self.performance.now(),N.frag===U&&j.trigger(L.Events.FRAG_BUFFERED,{stats:x,frag:U,part:null,id:g.type}),C.tick()}).catch(function(N){C.warn(N),C.resetFragmentLoading(g)})},o.fragContextChanged=function(g){var C=this.fragCurrent;return!g||!C||g.level!==C.level||g.sn!==C.sn||g.urlId!==C.urlId},o.fragBufferedComplete=function(g,C){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(C?" part: "+C.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+a.default.toString(K.BufferHelper.getBuffered(N))),this.state=w.IDLE,this.tick()},o._handleFragmentLoadComplete=function(g){var C=this.transmuxer;if(!C)return;var N=g.frag,U=g.part,j=g.partsLoaded,H=!j||j.length===0||j.some(function(x){return!x}),y=new b.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,U?U.index:-1,!H);C.flush(y)},o._handleFragmentLoadProgress=function(g){},o._doFragLoad=function(g,C,N,U){var j=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(g.start,N||0),this.config.lowLatencyMode&&C){var H=C.partList;if(H&&U){N>g.end&&C.fragmentHint&&(g=C.fragmentHint);var y=this.getNextPart(H,g,N);if(y>-1){var x=H[y];return this.log("Loading part sn: "+g.sn+" p: "+x.index+" cc: "+g.cc+" of playlist ["+C.startSN+"-"+C.endSN+"] parts [0-"+y+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=x.start+x.duration,this.state=w.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:g,part:H[y],targetBufferTime:N}),this.doFragPartsLoad(g,H,y,U).catch(function(F){return j.handleFragLoadError(F)})}else if(!g.url||this.loadedEndOfParts(H,N))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(C?"of ["+C.startSN+"-"+C.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),Object(V.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=w.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:g,targetBufferTime:N}),this.fragmentLoader.load(g,U).catch(function(F){return j.handleFragLoadError(F)})},o.doFragPartsLoad=function(g,C,N,U){var j=this;return new Promise(function(H,y){var x=[],F=function Q(q){var ie=C[q];j.fragmentLoader.loadPart(g,ie,U).then(function(ge){x[ie.index]=ge;var fe=ge.part;j.hls.trigger(L.Events.FRAG_LOADED,ge);var ue=C[q+1];if(ue&&ue.fragment===g)Q(q+1);else return H({frag:g,part:fe,partsLoaded:x})}).catch(y)};F(N)})},o.handleFragLoadError=function(g){var C=g.data;return C&&C.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(C.frag,C.part):this.hls.trigger(L.Events.ERROR,C),null},o._handleTransmuxerFlush=function(g){var C=this.getCurrentContext(g);if(!C||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var N=C.frag,U=C.part,j=C.level,H=self.performance.now();N.stats.parsing.end=H,U&&(U.stats.parsing.end=H),this.updateLevelTiming(N,U,j,g.partial)},o.getCurrentContext=function(g){var C=this.levels,N=g.level,U=g.sn,j=g.part;if(!C||!C[N])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+N+". The current chunk will not be buffered."),null;var H=C[N],y=j>-1?Object(r.getPartWith)(H,U,j):null,x=y?y.fragment:Object(r.getFragmentWithSN)(H,U,this.fragCurrent);return x?{frag:x,part:y,level:H}:null},o.bufferFragmentData=function(g,C,N,U){if(!g||this.state!==w.PARSING)return;var j=g.data1,H=g.data2,y=j;if(j&&H&&(y=Object(p.appendUint8Array)(j,H)),!y||!y.length)return;var x={type:g.type,frag:C,part:N,chunkMeta:U,parent:C.type,data:y};this.hls.trigger(L.Events.BUFFER_APPENDING,x),g.dropped&&g.independent&&!N&&this.flushBufferGap(C)},o.flushBufferGap=function(g){var C=this.media;if(!C)return;if(!K.BufferHelper.isBuffered(C,C.currentTime)){this.flushMainBuffer(0,g.start);return}var N=C.currentTime,U=K.BufferHelper.bufferInfo(C,N,0),j=g.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),y=Math.max(Math.min(g.start-H,U.end-H),N+H);g.start-y>H&&this.flushMainBuffer(y,g.start)},o.getFwdBufferInfo=function(g,C){var N=this.config,U=this.getLoadPosition();if(!Object(V.isFiniteNumber)(U))return null;var j=K.BufferHelper.bufferInfo(g,U,N.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(U,C);if(H&&j.nextStart<H.end)return K.BufferHelper.bufferInfo(g,U,Math.max(j.nextStart,N.maxBufferHole))}return j},o.getMaxBufferLength=function(g){var C=this.config,N;return g?N=Math.max(8*C.maxBufferSize/g,C.maxBufferLength):N=C.maxBufferLength,Math.min(N,C.maxMaxBufferLength)},o.reduceMaxBufferLength=function(g){var C=this.config,N=g||C.maxBufferLength;return C.maxMaxBufferLength>=N?(C.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+C.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(g,C){var N,U,j=C.fragments,H=j.length;if(!H)return null;var y=this.config,x=j[0].start,F;if(C.live){var Q=y.initialLiveManifestSize;if(H<Q)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+Q+")"),null;!C.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(F=this.getInitialLiveFragment(C,j),this.startPosition=F?this.hls.liveSyncPosition||F.start:g)}else g<=x&&(F=j[0]);if(!F){var q=y.lowLatencyMode?C.partEnd:C.fragmentEnd;F=this.getFragmentAtPosition(g,q,C)}return(N=F)!==null&&N!==void 0&&N.initSegment&&!((U=F)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(F=F.initSegment),F},o.getNextPart=function(g,C,N){for(var U=-1,j=!1,H=!0,y=0,x=g.length;y<x;y++){var F=g[y];if(H=H&&!F.independent,U>-1&&N<F.start)break;var Q=F.loaded;!Q&&(j||F.independent||H)&&F.fragment===C&&(U=y),j=Q}return U},o.loadedEndOfParts=function(g,C){var N=g[g.length-1];return N&&C>N.start&&N.loaded},o.getInitialLiveFragment=function(g,C){var N=this.fragPrevious,U=null;if(N){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),U=Object(h.findFragmentByPDT)(C,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var j=N.sn+1;if(j>=g.startSN&&j<=g.endSN){var H=C[j-g.startSN];N.cc===H.cc&&(U=H,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(h.findFragWithCC)(C,N.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var y=this.hls.liveSyncPosition;y!==null&&(U=this.getFragmentAtPosition(y,this.bitrateTest?g.fragmentEnd:g.edge,g))}return U},o.getFragmentAtPosition=function(g,C,N){var U=this.config,j=this.fragPrevious,H=N.fragments,y=N.endSN,x=N.fragmentHint,F=U.maxFragLookUpTolerance,Q=!!(U.lowLatencyMode&&N.partList&&x);Q&&x&&!this.bitrateTest&&(H=H.concat(x),y=x.sn);var q;if(g<C){var ie=g>C-F?0:F;q=Object(h.findFragmentByPTS)(j,H,g,ie)}else q=H[H.length-1];if(q){var ge=q.sn-N.startSN,fe=j&&q.level===j.level,ue=H[ge+1],he=this.fragmentTracker.getState(q);if(he===B.FragmentState.BACKTRACKED){q=null;for(var _e=ge;H[_e]&&this.fragmentTracker.getState(H[_e])===B.FragmentState.BACKTRACKED;)j?q=H[_e--]:q=H[--_e];q||(q=ue)}else j&&q.sn===j.sn&&!Q&&(fe&&(q.sn<y&&this.fragmentTracker.getState(ue)!==B.FragmentState.OK?(this.log("SN "+q.sn+" just loaded, load next one: "+ue.sn),q=ue):q=null))}return q},o.synchronizeToLiveEdge=function(g){var C=this.config,N=this.media;if(!N)return;var U=this.hls.liveSyncPosition,j=N.currentTime,H=g.fragments[0].start,y=g.edge,x=j>=H-C.maxFragLookUpTolerance&&j<=y;if(U!==null&&N.duration>U&&(j<U||!x)){var F=C.liveMaxLatencyDuration!==void 0?C.liveMaxLatencyDuration:C.liveMaxLatencyDurationCount*g.targetduration;(!x&&N.readyState<4||j<y-F)&&(this.loadedmetadata||(this.nextLoadPosition=U),N.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+y+", reset currentTime to : "+U.toFixed(3)),N.currentTime=U))}},o.alignPlaylists=function(g,C){var N=this.levels,U=this.levelLastLoaded,j=this.fragPrevious,H=U!==null?N[U]:null,y=g.fragments.length;if(!y)return this.warn("No fragments in live playlist"),0;var x=g.fragments[0].start,F=!C,Q=g.alignedSliding&&Object(V.isFiniteNumber)(x);if(F||!Q&&!x){Object(_.alignStream)(j,H,g);var q=g.fragments[0].start;return this.log("Live playlist sliding: "+q.toFixed(2)+" start-sn: "+(C?C.startSN:"na")+"->"+g.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+y),q}return x},o.waitForCdnTuneIn=function(g){var C=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*C)},o.setStartPosition=function(g,C){var N=this.startPosition;if(N<C&&(N=-1),N===-1||this.lastCurrentTime===-1){var U=g.startTimeOffset;Object(V.isFiniteNumber)(U)?(N=C+U,U<0&&(N+=g.totalduration),N=Math.min(Math.max(C,N),C+g.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+N),this.startPosition=N):g.live?N=this.hls.liveSyncPosition||C:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},o.getLoadPosition=function(){var g=this.media,C=0;return this.loadedmetadata&&g?C=g.currentTime:this.nextLoadPosition&&(C=this.nextLoadPosition),C},o.handleFragLoadAborted=function(g,C){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(C?" part"+C.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},o.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=w.IDLE)},o.onFragmentOrKeyLoadError=function(g,C){if(C.fatal)return;var N=C.frag;if(!N||N.type!==g)return;var U=this.fragCurrent;console.assert(U&&N.sn===U.sn&&N.level===U.level&&N.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(N.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*j.fragLoadingRetryDelay,j.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+g+" "+N.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=w.FRAG_LOADING_WAITING_RETRY}else C.levelRetry?(g===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=w.IDLE):(W.logger.error(C.details+" reaches max retry, redispatch as fatal ..."),C.fatal=!0,this.hls.stopLoad(),this.state=w.ERROR)},o.afterBufferFlushed=function(g,C,N){if(!g)return;var U=K.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(C,U,N),this.state===w.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=w.IDLE},o.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var C=this.levels?this.levels[g].details:null;if(C!=null&&C.live)return this.startPosition=-1,this.setStartPosition(C,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(g,C,N,U){var j=this,H=N.details;console.assert(!!H,"level.details must be defined");var y=Object.keys(g.elementaryStreams).reduce(function(x,F){var Q=g.elementaryStreams[F];if(Q){var q=Q.endPTS-Q.startPTS;if(q<=0)return j.warn("Could not parse fragment "+g.sn+" "+F+" duration reliably ("+q+") resetting transmuxer to fallback to playlist timing"),j.resetTransmuxer(),x||!1;var ie=U?0:Object(r.updateFragPTSDTS)(H,g,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return j.hls.trigger(L.Events.LEVEL_PTS_UPDATED,{details:H,level:N,drift:ie,type:F,frag:g,start:Q.startPTS,end:Q.endPTS}),!0}return x},!1);y?(this.state=w.PARSED,this.hls.trigger(L.Events.FRAG_PARSED,{frag:g,part:C})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(s,[{key:"state",get:function(){return this._state},set:function(g){var C=this._state;C!==g&&(this._state=g,this.log(C+"->"+g))}}]),s}(I.default)},"./src/controller/buffer-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h});var V=M("./src/polyfills/number.ts"),I=M("./src/events.ts"),B=M("./src/utils/logger.ts"),K=M("./src/errors.ts"),W=M("./src/utils/buffer-helper.ts"),L=M("./src/utils/mediasource-helper.ts"),P=M("./src/loader/fragment.ts"),b=M("./src/controller/buffer-operation-queue.ts"),p=Object(L.getMediaSource)(),_=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function r(l){var a=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=a.hls,c=a.media,R=a.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),c&&(a.updateMediaElementDuration(),u.trigger(I.Events.MEDIA_ATTACHED,{media:c})),R&&R.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var d=r.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var a=this.hls;a.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(I.Events.BUFFER_RESET,this.onBufferReset,this),a.on(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(I.Events.BUFFER_EOS,this.onBufferEos,this),a.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(I.Events.FRAG_PARSED,this.onFragParsed,this),a.on(I.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var a=this.hls;a.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(I.Events.BUFFER_RESET,this.onBufferReset,this),a.off(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(I.Events.BUFFER_EOS,this.onBufferEos,this),a.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(I.Events.FRAG_PARSED,this.onFragParsed,this),a.off(I.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(a,u){var c=2;(u.audio&&!u.video||!u.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(a,u){var c=this.media=u.media;if(c&&p){var R=this.mediaSource=new p;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(R),this._objectUrl=c.src}},d.onMediaDetaching=function(){var a=this.media,u=this.mediaSource,c=this._objectUrl;if(u){if(B.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(R){B.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(c&&self.URL.revokeObjectURL(c),a.src===c?(a.removeAttribute("src"),a.load()):B.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(I.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(u){var c=a.sourceBuffer[u];try{c&&(a.removeBufferListeners(u),a.mediaSource&&a.mediaSource.removeSourceBuffer(c),a.sourceBuffer[u]=void 0)}catch(R){B.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",R)}}),this._initSourceBuffer()},d.onBufferCodecs=function(a,u){var c=this,R=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(O){if(R){var T=c.tracks[O];if(T&&typeof T.buffer.changeType=="function"){var A=u[O],w=A.codec,m=A.levelCodec,v=A.container,s=(T.levelCodec||T.codec).replace(_,"$1"),o=(m||w).replace(_,"$1");if(s!==o){var E=v+";codecs="+(m||w);c.appendChangeType(O,E)}}}else c.pendingTracks[O]=u[O]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(a,u){var c=this,R=this.operationQueue,O={execute:function(){var A=c.sourceBuffer[a];A&&(B.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+u),A.changeType(u)),R.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(A){B.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",A)}};R.append(O,a)},d.onBufferAppending=function(a,u){var c=this,R=this.hls,O=this.operationQueue,T=this.tracks,A=u.data,w=u.type,m=u.frag,v=u.part,s=u.chunkMeta,o=s.buffering[w],E=self.performance.now();o.start=E;var g=m.stats.buffering,C=v?v.stats.buffering:null;g.start===0&&(g.start=E),C&&C.start===0&&(C.start=E);var N=T.audio,U=w==="audio"&&s.id===1&&(N==null?void 0:N.container)==="audio/mpeg",j={execute:function(){if(o.executeStart=self.performance.now(),U){var y=c.sourceBuffer[w];if(y){var x=m.start-y.timestampOffset;Math.abs(x)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+x+") sn: "+m.sn+")"),y.timestampOffset=m.start)}}c.appendExecutor(A,w)},onStart:function(){},onComplete:function(){var y=self.performance.now();o.executeEnd=o.end=y,g.first===0&&(g.first=y),C&&C.first===0&&(C.first=y);var x=c.sourceBuffer,F={};for(var Q in x)F[Q]=W.BufferHelper.getBuffered(x[Q]);c.appendError=0,c.hls.trigger(I.Events.BUFFER_APPENDED,{type:w,frag:m,part:v,chunkMeta:s,parent:m.type,timeRanges:F})},onError:function(y){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",y);var x={type:K.ErrorTypes.MEDIA_ERROR,parent:m.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:y,fatal:!1};y.code===DOMException.QUOTA_EXCEEDED_ERR?x.details=K.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,x.details=K.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>R.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),x.fatal=!0)),R.trigger(I.Events.ERROR,x)}};O.append(j,w)},d.onBufferFlushing=function(a,u){var c=this,R=this.operationQueue,O=function(A){return{execute:c.removeExecutor.bind(c,A,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(I.Events.BUFFER_FLUSHED,{type:A})},onError:function(m){B.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",m)}}};u.type?R.append(O(u.type),u.type):this.getSourceBufferTypes().forEach(function(T){R.append(O(T),T)})},d.onFragParsed=function(a,u){var c=this,R=u.frag,O=u.part,T=[],A=O?O.elementaryStreams:R.elementaryStreams;A[P.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(A[P.ElementaryStreamTypes.AUDIO]&&T.push("audio"),A[P.ElementaryStreamTypes.VIDEO]&&T.push("video"));var w=function(){var v=self.performance.now();R.stats.buffering.end=v,O&&(O.stats.buffering.end=v);var s=O?O.stats:R.stats;c.hls.trigger(I.Events.FRAG_BUFFERED,{frag:R,part:O,stats:s,id:R.type})};T.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(w,T)},d.onFragChanged=function(a,u){this.flushBackBuffer()},d.onBufferEos=function(a,u){var c=this,R=this.getSourceBufferTypes().reduce(function(O,T){var A=c.sourceBuffer[T];return(!u.type||u.type===T)&&(A&&!A.ended&&(A.ended=!0,B.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),O&&!!(!A||A.ended)},!0);R&&this.blockBuffers(function(){var O=c.mediaSource;if(!O||O.readyState!=="open")return;O.endOfStream()})},d.onLevelUpdated=function(a,u){var c=u.details;if(!c.fragments.length)return;this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var a=this.hls,u=this.details,c=this.media,R=this.sourceBuffer;if(!c||u===null)return;var O=this.getSourceBufferTypes();if(!O.length)return;var T=u.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(V.isFiniteNumber)(T)||T<0)return;var A=c.currentTime,w=u.levelTargetDuration,m=Math.max(T,w),v=Math.floor(A/w)*w-m;O.forEach(function(s){var o=R[s];if(o){var E=W.BufferHelper.getBuffered(o);E.length>0&&v>E.start(0)&&(a.trigger(I.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),u.live&&a.trigger(I.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),a.trigger(I.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:s}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,u=this.hls,c=this.media,R=this.mediaSource,O=a.fragments[0].start+a.totalduration,T=c.duration,A=Object(V.isFiniteNumber)(R.duration)?R.duration:0;a.live&&u.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(a)):(O>A&&O>T||!Object(V.isFiniteNumber)(T))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+O.toFixed(3)),R.duration=O)},d.updateSeekableRange=function(a){var u=this.mediaSource,c=a.fragments,R=c.length;if(R&&a.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var O=Math.max(0,c[0].start),T=Math.max(O,O+a.totalduration);u.setLiveSeekableRange(O,T)}},d.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,u=this.operationQueue,c=this.pendingTracks,R=Object.keys(c).length;if(R&&!a||R===2){this.createSourceBuffers(c),this.pendingTracks={};var O=this.getSourceBufferTypes();if(O.length===0){this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}O.forEach(function(T){u.executeNext(T)})}},d.createSourceBuffers=function(a){var u=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var O in a)if(!u[O]){var T=a[O];if(!T)throw Error("source buffer exists for track "+O+", however track does not");var A=T.levelCodec||T.codec,w=T.container+";codecs="+A;B.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var m=u[O]=c.addSourceBuffer(w),v=O;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[O]={buffer:m,codec:A,container:T.container,levelCodec:T.levelCodec,id:T.id},R++}catch(s){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:w})}}R&&this.hls.trigger(I.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(a){var u=this.operationQueue,c=u.current(a);c.onStart()},d._onSBUpdateEnd=function(a){var u=this.operationQueue,c=u.current(a);c.onComplete(),u.shiftAndExecuteNext(a)},d._onSBUpdateError=function(a,u){B.logger.error("[buffer-controller]: "+a+" SourceBuffer error",u),this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(a);c&&c.onError(u)},d.removeExecutor=function(a,u,c){var R=this.media,O=this.mediaSource,T=this.operationQueue,A=this.sourceBuffer,w=A[a];if(!R||!O||!w){B.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(a);return}var m=Object(V.isFiniteNumber)(R.duration)?R.duration:Infinity,v=Object(V.isFiniteNumber)(O.duration)?O.duration:Infinity,s=Math.max(0,u),o=Math.min(c,m,v);o>s?(B.logger.log("[buffer-controller]: Removing ["+s+","+o+"] from the "+a+" SourceBuffer"),console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.remove(s,o)):T.shiftAndExecuteNext(a)},d.appendExecutor=function(a,u){var c=this.operationQueue,R=this.sourceBuffer,O=R[u];if(!O){B.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(u);return}O.ended=!1,console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.appendBuffer(a)},d.blockBuffers=function(a,u){var c=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var R=this.operationQueue,O=u.map(function(T){return R.appendBlocker(T)});Promise.all(O).then(function(){a(),u.forEach(function(T){var A=c.sourceBuffer[T];(!A||!A.updating)&&R.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(a,u,c){var R=this.sourceBuffer[a];if(!R)return;var O=c.bind(this,a);this.listeners[a].push({event:u,listener:O}),R.addEventListener(u,O)},d.removeBufferListeners=function(a){var u=this.sourceBuffer[a];if(!u)return;this.listeners[a].forEach(function(c){u.removeEventListener(c.event,c.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return I});var V=M("./src/utils/logger.ts"),I=function(){function B(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var K=B.prototype;return K.append=function(L,P){var b=this.queues[P];b.push(L),b.length===1&&this.buffers[P]&&this.executeNext(P)},K.insertAbort=function(L,P){var b=this.queues[P];b.unshift(L),this.executeNext(P)},K.appendBlocker=function(L){var P,b=new Promise(function(_){P=_}),p={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,L),b},K.executeNext=function(L){var P=this.buffers,b=this.queues,p=P[L],_=b[L];if(_.length){var h=_[0];try{h.execute()}catch(r){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(r),(!p||!p.updating)&&(_.shift(),this.executeNext(L))}}},K.shiftAndExecuteNext=function(L){this.queues[L].shift(),this.executeNext(L)},K.current=function(L){return this.queues[L][0]},B}()},"./src/controller/cap-level-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts");function I(W,L){for(var P=0;P<L.length;P++){var b=L[P];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(W,b.key,b)}}function B(W,L,P){return L&&I(W.prototype,L),P&&I(W,P),W}var K=function(){function W(P){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=P,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var L=W.prototype;return L.setStreamController=function(b){this.streamController=b},L.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},L.registerListeners=function(){var b=this.hls;b.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.unregisterListener=function(){var b=this.hls;b.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.onFpsDropLevelCapping=function(b,p){W.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},L.onMediaAttaching=function(b,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},L.onManifestParsed=function(b,p){var _=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,_.config.capLevelToPlayerSize&&p.video&&this.startCapping()},L.onBufferCodecs=function(b,p){var _=this.hls;_.config.capLevelToPlayerSize&&p.video&&this.startCapping()},L.onMediaDetaching=function(){this.stopCapping()},L.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(b.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},L.getMaxLevel=function(b){var p=this,_=this.hls.levels;if(!_.length)return-1;var h=_.filter(function(r,d){return W.isLevelAllowed(d,p.restrictedLevels)&&d<=b});return this.clientRect=null,W.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},L.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()},L.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},L.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,p={width:0,height:0};if(b){var _=b.getBoundingClientRect();p.width=_.width,p.height=_.height,!p.width&&!p.height&&(p.width=_.right-_.left||b.width||0,p.height=_.bottom-_.top||b.height||0)}return this.clientRect=p,p},W.isLevelAllowed=function(b,p){return p===void 0&&(p=[]),p.indexOf(b)===-1},W.getMaxLevelByMediaSize=function(b,p,_){if(!b||!b.length)return-1;for(var h=function(u,c){return c?u.width!==c.width||u.height!==c.height:!0},r=b.length-1,d=0;d<b.length;d+=1){var l=b[d];if((l.width>=p||l.height>=_)&&h(l,b[d+1])){r=d;break}}return r},B(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(p){}return b}}]),W}();Z.default=K},"./src/controller/cmcd-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h});var V=M("./src/events.ts"),I=M("./src/types/cmcd.ts"),B=M("./src/utils/buffer-helper.ts"),K=M("./src/utils/logger.ts");function W(r,d){for(var l=0;l<d.length;l++){var a=d[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}function L(r,d,l){return d&&W(r.prototype,d),l&&W(r,l),r}function P(r,d){var l=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(l)return(l=l.call(r)).next.bind(l);if(Array.isArray(r)||(l=b(r))||d&&r&&typeof r.length=="number"){l&&(r=l);var a=0;return function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}}}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 b(r,d){if(!r)return;if(typeof r=="string")return p(r,d);var l=Object.prototype.toString.call(r).slice(8,-1);if(l==="Object"&&r.constructor&&(l=r.constructor.name),l==="Map"||l==="Set")return Array.from(r);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return p(r,d)}function p(r,d){(d==null||d>r.length)&&(d=r.length);for(var l=0,a=new Array(d);l<d;l++)a[l]=r[l];return a}function _(){return _=Object.assign||function(r){for(var d=1;d<arguments.length;d++){var l=arguments[d];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(r[a]=l[a])}return r},_.apply(this,arguments)}var h=function(){function r(l){var a=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(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(R){try{a.apply(R,{ot:I.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(O){K.logger.warn("Could not generate manifest CMCD data.",O)}},this.applyFragmentData=function(R){try{var O=R.frag,T=a.hls.levels[O.level],A=a.getObjectType(O),w={d:O.duration*1e3,ot:A};(A===I.CMCDObjectType.VIDEO||A===I.CMCDObjectType.AUDIO||A==I.CMCDObjectType.MUXED)&&(w.br=T.bitrate/1e3,w.tb=a.getTopBandwidth(A),w.bl=a.getBufferLength(A)),a.apply(R,w)}catch(m){K.logger.warn("Could not generate segment CMCD data.",m)}},this.hls=l;var u=this.config=l.config,c=u.cmcd;c!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=c.sessionId||r.uuid(),this.cid=c.contentId,this.useHeaders=c.useHeaders===!0,this.registerListeners())}var d=r.prototype;return d.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(V.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(a,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(a,u){var c,R;this.audioBuffer=(c=u.tracks.audio)===null||c===void 0?void 0:c.buffer,this.videoBuffer=(R=u.tracks.video)===null||R===void 0?void 0:R.buffer},d.createData=function(){var a;return{v:I.CMCDVersion,sf:I.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(a,u){u===void 0&&(u={}),_(u,this.createData());var c=u.ot===I.CMCDObjectType.INIT||u.ot===I.CMCDObjectType.VIDEO||u.ot===I.CMCDObjectType.MUXED;if(this.starved&&c&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var R=r.toHeaders(u);if(!Object.keys(R).length)return;a.headers||(a.headers={}),_(a.headers,R)}else{var O=r.toQuery(u);if(!O)return;a.url=r.appendQueryToUri(a.url,O)}},d.getObjectType=function(a){var u=a.type;return u==="subtitle"?I.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?I.CMCDObjectType.INIT:u==="audio"?I.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?I.CMCDObjectType.VIDEO:I.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(a){for(var u=0,c=a===I.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=P(c),O;!(O=R()).done;){var T=O.value;T.bitrate>u&&(u=T.bitrate)}return u>0?u:NaN},d.getBufferLength=function(a){var u=this.hls.media,c=a===I.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!u)return NaN;var R=B.BufferHelper.bufferInfo(c,u.currentTime,this.config.maxBufferHole);return R.len*1e3},d.createPlaylistLoader=function(){var a=this.config.pLoader,u=this.applyPlaylistData,c=a||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new c(T)}var O=R.prototype;return O.destroy=function(){this.loader.destroy()},O.abort=function(){this.loader.abort()},O.load=function(A,w,m){u(A),this.loader.load(A,w,m)},L(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},d.createFragmentLoader=function(){var a=this.config.fLoader,u=this.applyFragmentData,c=a||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new c(T)}var O=R.prototype;return O.destroy=function(){this.loader.destroy()},O.abort=function(){this.loader.abort()},O.load=function(A,w,m){u(A),this.loader.load(A,w,m)},L(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},r.uuid=function(){var a=URL.createObjectURL(new Blob),u=a.toString();return URL.revokeObjectURL(a),u.substr(u.lastIndexOf("/")+1)},r.serialize=function(a){for(var u=[],c=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},R=function(U){return Math.round(U)},O=function(U){return R(U/100)*100},T=function(U){return encodeURIComponent(U)},A={br:R,d:R,bl:O,dl:O,mtp:O,nor:T,rtp:O,tb:R},w=Object.keys(a||{}).sort(),m=P(w),v;!(v=m()).done;){var s=v.value,o=a[s];if(!c(o))continue;if(s==="v"&&o===1)continue;if(s=="pr"&&o===1)continue;var E=A[s];E&&(o=E(o));var g=typeof o,C=void 0;s==="ot"||s==="sf"||s==="st"?C=s+"="+o:g==="boolean"?C=s:g==="number"?C=s+"="+o:C=s+"="+JSON.stringify(o),u.push(C)}return u.join(",")},r.toHeaders=function(a){for(var u=Object.keys(a),c={},R=["Object","Request","Session","Status"],O=[{},{},{},{}],T={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},A=0,w=u;A<w.length;A++){var m=w[A],v=T[m]!=null?T[m]:1;O[v][m]=a[m]}for(var s=0;s<O.length;s++){var o=r.serialize(O[s]);o&&(c["CMCD-"+R[s]]=o)}return c},r.toQuery=function(a){return"CMCD="+encodeURIComponent(r.serialize(a))},r.appendQueryToUri=function(a,u){if(!u)return a;var c=a.includes("?")?"&":"?";return""+a+c+u},r}()},"./src/controller/eme-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts"),I=M("./src/errors.ts"),B=M("./src/utils/logger.ts"),K=M("./src/utils/mediakeys-helper.ts");function W(h,r){for(var d=0;d<r.length;d++){var l=r[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function L(h,r,d){return r&&W(h.prototype,r),d&&W(h,d),h}var P=3,b=function(r,d,l){var a={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(u){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:l.audioRobustness||""})}),d.forEach(function(u){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:l.videoRobustness||""})}),[a]},p=function(r,d,l,a){switch(r){case K.KeySystems.WIDEVINE:return b(d,l,a);default:throw new Error("Unknown key-system: "+r)}},_=function(){function h(d){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=d,this._config=d.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var r=h.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(l){switch(l){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},r._attemptKeySystemAccess=function(l,a,u){var c=this,R=p(l,a,u,this._drmSystemOptions);B.logger.log("Requesting encrypted media key-system access");var O=this.requestMediaKeySystemAccess(l,R);this.mediaKeysPromise=O.then(function(T){return c._onMediaKeySystemAccessObtained(l,T)}),O.catch(function(T){B.logger.error('Failed to obtain key-system "'+l+'" access:',T)})},r._onMediaKeySystemAccessObtained=function(l,a){var u=this;B.logger.log('Access for key-system "'+l+'" obtained');var c={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:l};this._mediaKeysList.push(c);var R=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(O){return c.mediaKeys=O,B.logger.log('Media-keys created for key-system "'+l+'"'),u._onMediaKeysCreated(),O});return R.catch(function(O){B.logger.error("Failed to create media-keys:",O)}),R},r._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),l._onNewMediaKeySession(a.mediaKeysSession))})},r._onNewMediaKeySession=function(l){var a=this;B.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(u){a._onKeySessionMessage(l,u.message)},!1)},r._onKeySessionMessage=function(l,a){B.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(u){B.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),l.update(u)})},r.onMediaEncrypted=function(l){var a=this;if(B.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(R){if(!a._media)return;a._attemptSetMediaKeys(R),a._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(u).catch(u)},r._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}B.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(l,a){var u=this,c=this._mediaKeysList[0];if(!c){B.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(c.mediaKeysSessionInitialized){B.logger.warn("Key-Session already initialized but requested again");return}var R=c.mediaKeysSession;if(!R){B.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){B.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}B.logger.log('Generating key-session request for "'+l+'" init data type'),c.mediaKeysSessionInitialized=!0,R.generateRequest(l,a).then(function(){B.logger.debug("Key-session generation succeeded")}).catch(function(O){B.logger.error("Error generating key-session request:",O),u.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(l,a,u){var c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,c,l,a,u);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,c,l),R=void 0}catch(O){B.logger.error(O)}try{c.readyState||c.open("POST",l,!0),R&&R.call(this.hls,c,l)}catch(O){throw new Error("issue setting up KeySystem license XHR "+O)}return c},r._onLicenseRequestReadyStageChange=function(l,a,u,c){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,B.logger.log("License request succeeded");var R=l.response,O=this._licenseResponseCallback;if(O)try{R=O.call(this.hls,l,a)}catch(A){B.logger.error(A)}c(R)}else{if(B.logger.error("License Request XHR failed ("+a+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>P){this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=P-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(u,c)}break}},r._generateLicenseRequestChallenge=function(l,a){switch(l.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},r._requestLicense=function(l,a){B.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(u.mediaKeySystemDomain),R=this._createLicenseXhr(c,l,a);B.logger.log("Sending license request to URL: "+c);var O=this._generateLicenseRequestChallenge(u,l);R.send(O)}catch(T){B.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(l,a){if(!this._emeEnabled)return;var u=a.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var l=this._media,a=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(l,a){if(!this._emeEnabled)return;var u=a.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),c=a.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,u,c)},L(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();Z.default=_},"./src/controller/fps-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts"),I=M("./src/utils/logger.ts"),B=function(){function K(L){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=L,this.registerListeners()}var W=K.prototype;return W.setStreamController=function(P){this.streamController=P},W.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(P,b){var p=this.hls.config;if(p.capLevelOnFPSDrop){var _=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=_,_&&typeof _.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(P,b,p){var _=performance.now();if(b){if(this.lastTime){var h=_-this.lastTime,r=p-this.lastDroppedFrames,d=b-this.lastDecodedFrames,l=1e3*r/h,a=this.hls;if(a.trigger(V.Events.FPS_DROP,{currentDropped:r,currentDecoded:d,totalDroppedFrames:p}),l>0&&r>a.config.fpsDroppedMonitoringThreshold*d){var u=a.currentLevel;I.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=u)&&(u=u-1,a.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:a.currentLevel}),a.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=p,this.lastDecodedFrames=b}},W.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var b=P.getVideoPlaybackQuality();this.checkFPS(P,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},K}();Z.default=B},"./src/controller/fragment-finders.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"findFragmentByPDT",function(){return B}),M.d(Z,"findFragmentByPTS",function(){return K}),M.d(Z,"fragmentWithinToleranceTest",function(){return W}),M.d(Z,"pdtWithinToleranceTest",function(){return L}),M.d(Z,"findFragWithCC",function(){return P});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/binary-search.ts");function B(b,p,_){if(p===null||!Array.isArray(b)||!b.length||!Object(V.isFiniteNumber)(p))return null;var h=b[0].programDateTime;if(p<(h||0))return null;var r=b[b.length-1].endProgramDateTime;if(p>=(r||0))return null;_=_||0;for(var d=0;d<b.length;++d){var l=b[d];if(L(p,_,l))return l}return null}function K(b,p,_,h){_===void 0&&(_=0),h===void 0&&(h=0);var r=null;if(b?r=p[b.sn-p[0].sn+1]||null:_===0&&p[0].start===0&&(r=p[0]),r&&W(_,h,r)===0)return r;var d=I.default.search(p,W.bind(null,_,h));return d||r}function W(b,p,_){b===void 0&&(b=0),p===void 0&&(p=0);var h=Math.min(p,_.duration+(_.deltaPTS?_.deltaPTS:0));return _.start+_.duration-h<=b?1:_.start-h>b&&_.start?-1:0}function L(b,p,_){var h=Math.min(p,_.duration+(_.deltaPTS?_.deltaPTS:0))*1e3,r=_.endProgramDateTime||0;return r-h>b}function P(b,p){return I.default.search(b,function(_){return _.cc<p?1:_.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"FragmentState",function(){return B}),M.d(Z,"FragmentTracker",function(){return K});var V=M("./src/events.ts"),I=M("./src/types/loader.ts"),B;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(B||(B={}));var K=function(){function P(p){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=p,this._registerListeners()}var b=P.prototype;return b._registerListeners=function(){var _=this.hls;_.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var _=this.hls;_.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(_,h){if(h===I.PlaylistLevelType.MAIN){var r=this.activeFragment,d=this.activeParts;if(!r)return null;if(d)for(var l=d.length;l--;){var a=d[l],u=a?a.end:r.appendedPTS;if(a.start<=_&&u!==void 0&&_<=u)return l>9&&(this.activeParts=d.slice(l-9)),a}else if(r.start<=_&&r.appendedPTS!==void 0&&_<=r.appendedPTS)return r}return this.getBufferedFrag(_,h)},b.getBufferedFrag=function(_,h){for(var r=this.fragments,d=Object.keys(r),l=d.length;l--;){var a=r[d[l]];if((a==null?void 0:a.body.type)===h&&a.buffered){var u=a.body;if(u.start<=_&&_<=u.end)return u}}return null},b.detectEvictedFragments=function(_,h,r){var d=this;Object.keys(this.fragments).forEach(function(l){var a=d.fragments[l];if(!a)return;if(!a.buffered){a.body.type===r&&d.removeFragment(a.body);return}var u=a.range[_];if(!u)return;u.time.some(function(c){var R=!d.isTimeBuffered(c.startPTS,c.endPTS,h);return R&&d.removeFragment(a.body),R})})},b.detectPartialFragments=function(_){var h=this,r=this.timeRanges,d=_.frag,l=_.part;if(!r||d.sn==="initSegment")return;var a=L(d),u=this.fragments[a];if(!u)return;Object.keys(r).forEach(function(c){var R=d.elementaryStreams[c];if(!R)return;var O=r[c],T=l!==null||R.partial===!0;u.range[c]=h.getBufferedTimes(d,l,T,O)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},b.fragBuffered=function(_){var h=L(_),r=this.fragments[h];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},b.getBufferedTimes=function(_,h,r,d){for(var l={time:[],partial:r},a=h?h.start:_.start,u=h?h.end:_.end,c=_.minEndPTS||u,R=_.maxStartPTS||a,O=0;O<d.length;O++){var T=d.start(O)-this.bufferPadding,A=d.end(O)+this.bufferPadding;if(R>=T&&c<=A){l.time.push({startPTS:Math.max(a,d.start(O)),endPTS:Math.min(u,d.end(O))});break}else if(a<A&&u>T)l.partial=!0,l.time.push({startPTS:Math.max(a,d.start(O)),endPTS:Math.min(u,d.end(O))});else if(u<=T)break}return l},b.getPartialFragment=function(_){var h=null,r,d,l,a=0,u=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(R){var O=c[R];if(!O)return;W(O)&&(d=O.body.start-u,l=O.body.end+u,_>=d&&_<=l&&(r=Math.min(_-d,l-_),a<=r&&(h=O.body,a=r)))}),h},b.getState=function(_){var h=L(_),r=this.fragments[h];return r?r.buffered?W(r)?B.PARTIAL:B.OK:r.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},b.backtrack=function(_,h){var r=L(_),d=this.fragments[r];if(!d||d.backtrack)return null;var l=d.backtrack=h||d.loaded;return d.loaded=null,l},b.getBacktrackData=function(_){var h=L(_),r=this.fragments[h];if(r){var d,l=r.backtrack;if(l!=null&&(d=l.payload)!==null&&d!==void 0&&d.byteLength)return l;this.removeFragment(_)}return null},b.isTimeBuffered=function(_,h,r){for(var d,l,a=0;a<r.length;a++){if(d=r.start(a)-this.bufferPadding,l=r.end(a)+this.bufferPadding,_>=d&&h<=l)return!0;if(h<=d)return!1}return!1},b.onFragLoaded=function(_,h){var r=h.frag,d=h.part;if(r.sn==="initSegment"||r.bitrateTest||d)return;var l=L(r);this.fragments[l]={body:r,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(_,h){var r=this,d=h.frag,l=h.part,a=h.timeRanges;if(d.type===I.PlaylistLevelType.MAIN)if(this.activeFragment=d,l){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(l)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(c){var R=a[c];if(r.detectEvictedFragments(c,R),!l)for(var O=0;O<R.length;O++)d.appendedPTS=Math.max(R.end(O),d.appendedPTS||0)})},b.onFragBuffered=function(_,h){this.detectPartialFragments(h)},b.hasFragment=function(_){var h=L(_);return!!this.fragments[h]},b.removeFragmentsInRange=function(_,h,r){var d=this;Object.keys(this.fragments).forEach(function(l){var a=d.fragments[l];if(!a)return;if(a.buffered){var u=a.body;u.type===r&&u.start<h&&u.end>_&&d.removeFragment(u)}})},b.removeFragment=function(_){var h=L(_);_.stats.loaded=0,_.clearElementaryStreamInfo(),delete this.fragments[h]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function W(P){var b,p;return P.buffered&&(((b=P.range.video)===null||b===void 0?void 0:b.partial)||((p=P.range.audio)===null||p===void 0?void 0:p.partial))}function L(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"STALL_MINIMUM_DURATION_MS",function(){return W}),M.d(Z,"MAX_START_GAP_JUMP",function(){return L}),M.d(Z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),M.d(Z,"SKIP_BUFFER_RANGE_START",function(){return b}),M.d(Z,"default",function(){return p});var V=M("./src/utils/buffer-helper.ts"),I=M("./src/errors.ts"),B=M("./src/events.ts"),K=M("./src/utils/logger.ts"),W=250,L=2,P=.1,b=.05,p=function(){function _(r,d,l,a){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=r,this.media=d,this.fragmentTracker=l,this.hls=a}var h=_.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(d){var l=this.config,a=this.media,u=this.stalled,c=a.currentTime,R=a.seeking,O=this.seeking&&!R,T=!this.seeking&&R;if(this.seeking=R,c!==d){if(this.moved=!0,u!==null){if(this.stallReported){var A=self.performance.now()-u;K.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||O)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!V.BufferHelper.getBuffered(a).length)return;var w=V.BufferHelper.bufferInfo(a,c,0),m=w.len>0,v=w.nextStart||0;if(!m&&!v)return;if(R){var s=w.len>L,o=!v||v-c>L&&!this.fragmentTracker.getPartialFragment(c);if(s||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,g=Math.max(v,w.start||0)-c,C=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=C==null||((E=C.details)===null||E===void 0)?void 0:E.live,U=N?C.details.targetduration*2:L;if(g>0&&g<=U){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(u===null){this.stalled=j;return}var H=j-u;!R&&H>=W&&this._reportStall(w.len);var y=V.BufferHelper.bufferInfo(a,c,l.maxBufferHole);this._tryFixBufferStall(y,H)},h._tryFixBufferStall=function(d,l){var a=this.config,u=this.fragmentTracker,c=this.media,R=c.currentTime,O=u.getPartialFragment(R);if(O){var T=this._trySkipBufferHole(O);if(T)return}d.len>a.maxBufferHole&&l>a.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(d){var l=this.hls,a=this.media,u=this.stallReported;u||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+d+")"),l.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},h._trySkipBufferHole=function(d){for(var l=this.config,a=this.hls,u=this.media,c=u.currentTime,R=0,O=V.BufferHelper.getBuffered(u),T=0;T<O.length;T++){var A=O.start(T);if(c+l.maxBufferHole>=R&&c<A){var w=Math.max(A+b,u.currentTime+P);return K.logger.warn("skipping hole, adjusting currentTime from "+c+" to "+w),this.moved=!0,this.stalled=null,u.currentTime=w,d&&a.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+c+" to "+w,frag:d}),w}R=O.end(T)}return 0},h._tryNudgeBuffer=function(){var d=this.config,l=this.hls,a=this.media,u=a.currentTime,c=(this.nudgeRetry||0)+1;if(this.nudgeRetry=c,c<d.nudgeMaxRetry){var R=u+c*d.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+u+" to "+R),a.currentTime=R,l.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+d.nudgeMaxRetry+" nudges"),l.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},_}()},"./src/controller/id3-track-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts"),I=M("./src/utils/texttrack-utils.ts"),B=M("./src/demux/id3.ts"),K=.25,W=function(){function L(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var P=L.prototype;return P.destroy=function(){this._unregisterListeners()},P._registerListeners=function(){var p=this.hls;p.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P._unregisterListeners=function(){var p=this.hls;p.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P.onMediaAttached=function(p,_){this.media=_.media},P.onMediaDetaching=function(){if(!this.id3Track)return;Object(I.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},P.getID3Track=function(p){if(!this.media)return;for(var _=0;_<p.length;_++){var h=p[_];if(h.kind==="metadata"&&h.label==="id3")return Object(I.sendAddTrackEvent)(h,this.media),h}return this.media.addTextTrack("metadata","id3")},P.onFragParsingMetadata=function(p,_){if(!this.media)return;var h=_.frag,r=_.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<r.length;l++){var a=B.getID3Frames(r[l].data);if(a){var u=r[l].pts,c=l<r.length-1?r[l+1].pts:h.end,R=c-u;R<=0&&(c=u+K);for(var O=0;O<a.length;O++){var T=a[O];if(!B.isTimeStampFrame(T)){var A=new d(u,c,"");A.value=T,this.id3Track.addCue(A)}}}}},P.onBufferFlushing=function(p,_){var h=_.startOffset,r=_.endOffset,d=_.type;if(!d||d==="audio"){var l=this.id3Track;l&&Object(I.removeCuesInRange)(l,h,r)}},L}();Z.default=W},"./src/controller/latency-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return L});var V=M("./src/errors.ts"),I=M("./src/events.ts"),B=M("./src/utils/logger.ts");function K(P,b){for(var p=0;p<b.length;p++){var _=b[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(P,_.key,_)}}function W(P,b,p){return b&&K(P.prototype,b),p&&K(P,p),P}var L=function(){function P(p){var _=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 _.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var b=P.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.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)},b.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)},b.onMediaAttached=function(_,h){this.media=h.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(_,h){var r=h.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(_,h){if(h.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,B.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var _=this.media,h=this.levelDetails;if(!_||!h)return;this.currentTime=_.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var d=this.config,l=d.lowLatencyMode,a=d.maxLiveSyncPlaybackRate;if(!l||a===1)return;var u=this.targetLatency;if(u===null)return;var c=r-u,R=Math.min(this.maxLatency,u+h.targetduration),O=c<R;if(h.live&&O&&c>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,a)),A=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;_.playbackRate=Math.min(T,Math.max(1,A))}else _.playbackRate!==1&&_.playbackRate!==0&&(_.playbackRate=1)},b.estimateLiveEdge=function(){var _=this.levelDetails;return _===null?null:_.edge+_.age},b.computeLatency=function(){var _=this.estimateLiveEdge();return _===null?null:_-this.currentTime},W(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var _=this.config,h=this.levelDetails;return _.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:h?_.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var _=this.levelDetails;if(_===null)return null;var h=_.holdBack,r=_.partHoldBack,d=_.targetduration,l=this.config,a=l.liveSyncDuration,u=l.liveSyncDurationCount,c=l.lowLatencyMode,R=this.hls.userConfig,O=c&&r||h;(R.liveSyncDuration||R.liveSyncDurationCount||O===0)&&(O=a!==void 0?a:u*d);var T=d,A=1;return O+Math.min(this.stallCount*A,T)}},{key:"liveSyncPosition",get:function(){var _=this.estimateLiveEdge(),h=this.targetLatency,r=this.levelDetails;if(_===null||h===null||r===null)return null;var d=r.edge,l=_-h-this.edgeStalled,a=d-r.totalduration,u=d-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,l),u)}},{key:"drift",get:function(){var _=this.levelDetails;return _===null?1:_.drift}},{key:"edgeStalled",get:function(){var _=this.levelDetails;if(_===null)return 0;var h=(this.config.lowLatencyMode&&_.partTarget||_.targetduration)*3;return Math.max(_.age-h,0)}},{key:"forwardBufferLength",get:function(){var _=this.media,h=this.levelDetails;if(!_||!h)return 0;var r=_.buffered.length;return r?_.buffered.end(r-1):h.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return l});var V=M("./src/types/level.ts"),I=M("./src/events.ts"),B=M("./src/errors.ts"),K=M("./src/utils/codecs.ts"),W=M("./src/controller/level-helper.ts"),L=M("./src/controller/base-playlist-controller.ts"),P=M("./src/types/loader.ts");function b(){return b=Object.assign||function(a){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var R in c)Object.prototype.hasOwnProperty.call(c,R)&&(a[R]=c[R])}return a},b.apply(this,arguments)}function p(a,u){for(var c=0;c<u.length;c++){var R=u[c];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(a,R.key,R)}}function _(a,u,c){return u&&p(a.prototype,u),c&&p(a,c),a}function h(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,r(a,u)}function r(a,u){return r=Object.setPrototypeOf||function(R,O){return R.__proto__=O,R},r(a,u)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(a){h(u,a);function u(R){var O;return O=a.call(this,R,"[level-controller]")||this,O._levels=[],O._firstLevel=-1,O._startLevel=void 0,O.currentLevelIndex=-1,O.manualLevelIndex=-1,O.onParsedComplete=void 0,O._registerListeners(),O}var c=u.prototype;return c._registerListeners=function(){var O=this.hls;O.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),O.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),O.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),O.on(I.Events.ERROR,this.onError,this)},c._unregisterListeners=function(){var O=this.hls;O.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),O.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),O.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),O.off(I.Events.ERROR,this.onError,this)},c.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},c.startLoad=function(){var O=this._levels;O.forEach(function(T){T.loadError=0}),a.prototype.startLoad.call(this)},c.onManifestLoaded=function(O,T){var A=[],w=[],m=[],v,s={},o,E=!1,g=!1,C=!1;if(T.levels.forEach(function(H){var y=H.attrs;E=E||!!(H.width&&H.height),g=g||!!H.videoCodec,C=C||!!H.audioCodec,d&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var x=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;o=s[x],o?o.url.push(H.url):(o=new V.Level(H),s[x]=o,A.push(o)),y&&(y.AUDIO&&Object(W.addGroupId)(o,"audio",y.AUDIO),y.SUBTITLES&&Object(W.addGroupId)(o,"text",y.SUBTITLES))}),(E||g)&&C&&(A=A.filter(function(H){var y=H.videoCodec,x=H.width,F=H.height;return!!y||!!(x&&F)})),A=A.filter(function(H){var y=H.audioCodec,x=H.videoCodec;return(!y||Object(K.isCodecSupportedInMp4)(y,"audio"))&&(!x||Object(K.isCodecSupportedInMp4)(x,"video"))}),T.audioTracks&&(w=T.audioTracks.filter(function(H){return!H.audioCodec||Object(K.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(w)),T.subtitles&&(m=T.subtitles,Object(W.assignTrackIdsByGroup)(m)),A.length>0){v=A[0].bitrate,A.sort(function(H,y){return H.bitrate-y.bitrate}),this._levels=A;for(var N=0;N<A.length;N++)if(A[N].bitrate===v){this._firstLevel=N,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+v);break}var U=C&&!g,j={levels:A,audioTracks:w,subtitleTracks:m,firstLevel:this._firstLevel,stats:T.stats,audio:C,video:g,altAudio:!U&&w.some(function(H){return!!H.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:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},c.onError=function(O,T){if(a.prototype.onError.call(this,O,T),T.fatal)return;var A=T.context,w=this._levels[this.currentLevelIndex];if(A&&(A.type===P.PlaylistContextType.AUDIO_TRACK&&w.audioGroupIds&&A.groupId===w.audioGroupIds[w.urlId]||A.type===P.PlaylistContextType.SUBTITLE_TRACK&&w.textGroupIds&&A.groupId===w.textGroupIds[w.urlId])){this.redundantFailover(this.currentLevelIndex);return}var m=!1,v=!0,s;switch(T.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:case B.ErrorDetails.KEY_LOAD_ERROR:case B.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var o=this._levels[T.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=T.frag.level)):s=T.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(v=!1),s=A.level),m=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:s=T.level,m=!0;break}s!==void 0&&this.recoverLevel(T,s,m,v)},c.recoverLevel=function(O,T,A,w){var m=O.details,v=this._levels[T];if(v.loadError++,A){var s=this.retryLoadingOrFail(O);if(s)O.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var o=v.url.length;if(o>1&&v.loadError<o)O.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var E=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(m+": switch to "+E),O.levelRetry=!0,this.hls.nextAutoLevel=E)}}},c.redundantFailover=function(O){var T=this._levels[O],A=T.url.length;if(A>1){var w=(T.urlId+1)%A;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(m){m.urlId=w}),this.level=O}},c.onFragLoaded=function(O,T){var A=T.frag;if(A!==void 0&&A.type===P.PlaylistLevelType.MAIN){var w=this._levels[A.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},c.onLevelLoaded=function(O,T){var A,w=T.level,m=T.details,v=this._levels[w];if(!v){var s;this.warn("Invalid level index "+w),(s=T.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(m.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(w,T,v.details)):(A=T.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(m.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(O,T){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var w=-1,m=this.hls.audioTracks[T.id].groupId,v=0;v<A.audioGroupIds.length;v++)if(A.audioGroupIds[v]===m){w=v;break}w!==A.urlId&&(A.urlId=w,this.startLoad())}},c.loadPlaylist=function(O){var T=this.currentLevelIndex,A=this._levels[T];if(this.canLoad&&A&&A.url.length>0){var w=A.urlId,m=A.url[w];if(O)try{m=O.addDirectives(m)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+T+(O?" at sn "+O.msn+" part "+O.part:"")+" with URL-id "+w+" "+m),this.clearTimer(),this.hls.trigger(I.Events.LEVEL_LOADING,{url:m,level:T,id:w,deliveryDirectives:O||null})}},c.removeLevel=function(O,T){var A=function(v,s){return s!==T},w=this._levels.filter(function(m,v){return v!==O?!0:m.url.length>1&&T!==void 0?(m.url=m.url.filter(A),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(A)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(A)),m.urlId=0,!0):!1}).map(function(m,v){var s=m.details;return s!=null&&s.fragments&&s.fragments.forEach(function(o){o.level=v}),m});this._levels=w,this.hls.trigger(I.Events.LEVELS_UPDATED,{levels:w})},_(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(O){var T,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===O&&(T=A[O])!==null&&T!==void 0&&T.details)return;if(O<0||O>=A.length){var w=O<0;if(this.hls.trigger(I.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:O,fatal:w,reason:"invalid level idx"}),w)return;O=Math.min(O,A.length-1)}this.clearTimer();var m=this.currentLevelIndex,v=A[m],s=A[O];this.log("switching to level "+O+" from "+m),this.currentLevelIndex=O;var o=b({},s,{level:O,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete o._urlId,this.hls.trigger(I.Events.LEVEL_SWITCHING,o);var E=s.details;if(!E||E.live){var g=this.switchParams(s.uri,v==null?void 0:v.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(O){this.manualLevelIndex=O,this._startLevel===void 0&&(this._startLevel=O),O!==-1&&(this.level=O)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(O){this._firstLevel=O}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var O=this.hls.config.startLevel;return O!==void 0?O:this._firstLevel}else return this._startLevel},set:function(O){this._startLevel=O}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(O){this.level=O,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=O)}}]),u}(L.default)},"./src/controller/level-helper.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"addGroupId",function(){return B}),M.d(Z,"assignTrackIdsByGroup",function(){return K}),M.d(Z,"updatePTS",function(){return W}),M.d(Z,"updateFragPTSDTS",function(){return P}),M.d(Z,"mergeDetails",function(){return b}),M.d(Z,"mapPartIntersection",function(){return p}),M.d(Z,"mapFragmentIntersection",function(){return _}),M.d(Z,"adjustSliding",function(){return h}),M.d(Z,"addSliding",function(){return r}),M.d(Z,"computeReloadInterval",function(){return d}),M.d(Z,"getFragmentWithSN",function(){return l}),M.d(Z,"getPartWith",function(){return a});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/logger.ts");function B(u,c,R){switch(c){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(R);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(R);break}}function K(u){var c={};u.forEach(function(R){var O=R.groupId||"";R.id=c[O]=c[O]||0,c[O]++})}function W(u,c,R){var O=u[c],T=u[R];L(O,T)}function L(u,c){var R=c.startPTS;if(Object(V.isFiniteNumber)(R)){var O=0,T;c.sn>u.sn?(O=R-u.start,T=u):(O=u.start-R,T=c),T.duration!==O&&(T.duration=O)}else if(c.sn>u.sn){var A=u.cc===c.cc;A&&u.minEndPTS?c.start=u.start+(u.minEndPTS-u.start):c.start=u.start+u.duration}else c.start=Math.max(u.start-c.duration,0)}function P(u,c,R,O,T,A){var w=O-R;w<=0&&(I.logger.warn("Fragment should have a positive duration",c),O=R+c.duration,A=T+c.duration);var m=R,v=O,s=c.startPTS,o=c.endPTS;if(Object(V.isFiniteNumber)(s)){var E=Math.abs(s-R);Object(V.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(E,c.deltaPTS):c.deltaPTS=E,m=Math.max(R,s),R=Math.min(R,s),T=Math.min(T,c.startDTS),v=Math.min(O,o),O=Math.max(O,o),A=Math.max(A,c.endDTS)}c.duration=O-R;var g=R-c.start;c.appendedPTS=O,c.start=c.startPTS=R,c.maxStartPTS=m,c.startDTS=T,c.endPTS=O,c.minEndPTS=v,c.endDTS=A;var C=c.sn;if(!u||C<u.startSN||C>u.endSN)return 0;var N,U=C-u.startSN,j=u.fragments;for(j[U]=c,N=U;N>0;N--)L(j[N],j[N-1]);for(N=U;N<j.length-1;N++)L(j[N],j[N+1]);return u.fragmentHint&&L(j[j.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,g}function b(u,c){for(var R=null,O=u.fragments,T=O.length-1;T>=0;T--){var A=O[T].initSegment;if(A){R=A;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var w=0,m;if(_(u,c,function(N,U){N.relurl&&(w=N.cc-U.cc),Object(V.isFiniteNumber)(N.startPTS)&&Object(V.isFiniteNumber)(N.endPTS)&&(U.start=U.startPTS=N.startPTS,U.startDTS=N.startDTS,U.appendedPTS=N.appendedPTS,U.maxStartPTS=N.maxStartPTS,U.endPTS=N.endPTS,U.endDTS=N.endDTS,U.minEndPTS=N.minEndPTS,U.duration=N.endPTS-N.startPTS,U.duration&&(m=U),c.PTSKnown=c.alignedSliding=!0),U.elementaryStreams=N.elementaryStreams,U.loader=N.loader,U.stats=N.stats,U.urlId=N.urlId,N.initSegment&&(U.initSegment=N.initSegment,R=N.initSegment)}),R){var v=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;v.forEach(function(N){var U;(!N.initSegment||N.initSegment.relurl===((U=R)===null||U===void 0?void 0:U.relurl))&&(N.initSegment=R)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(N){return!N}),c.deltaUpdateFailed)){I.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=c.skippedSegments;s--;)c.fragments.shift();c.startSN=c.fragments[0].sn,c.startCC=c.fragments[0].cc}var o=c.fragments;if(w){I.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<o.length;E++)o[E].cc+=w}c.skippedSegments&&(c.startCC=c.fragments[0].cc),p(u.partList,c.partList,function(N,U){U.elementaryStreams=N.elementaryStreams,U.stats=N.stats}),m?P(c,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):h(u,c),o.length&&(c.totalduration=c.edge-o[0].start),c.driftStartTime=u.driftStartTime,c.driftStart=u.driftStart;var g=c.advancedDateTime;if(c.advanced&&g){var C=c.edge;c.driftStart||(c.driftStartTime=g,c.driftStart=C),c.driftEndTime=g,c.driftEnd=C}else c.driftEndTime=u.driftEndTime,c.driftEnd=u.driftEnd,c.advancedDateTime=u.advancedDateTime}function p(u,c,R){if(u&&c)for(var O=0,T=0,A=u.length;T<=A;T++){var w=u[T],m=c[T+O];w&&m&&w.index===m.index&&w.fragment.sn===m.fragment.sn?R(w,m):O--}}function _(u,c,R){for(var O=c.skippedSegments,T=Math.max(u.startSN,c.startSN)-c.startSN,A=(u.fragmentHint?1:0)+(O?c.endSN:Math.min(u.endSN,c.endSN))-c.startSN,w=c.startSN-u.startSN,m=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,v=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,s=T;s<=A;s++){var o=v[w+s],E=m[s];O&&!E&&s<O&&(E=c.fragments[s]=o),o&&E&&R(o,E)}}function h(u,c){var R=c.startSN+c.skippedSegments-u.startSN,O=u.fragments;if(R<0||R>=O.length)return;r(c,O[R].start)}function r(u,c){if(c){for(var R=u.fragments,O=u.skippedSegments;O<R.length;O++)R[O].start+=c;u.fragmentHint&&(u.fragmentHint.start+=c)}}function d(u,c){var R=1e3*u.levelTargetDuration,O=R/2,T=u.age,A=T>0&&T<R*3,w=c.loading.end-c.loading.start,m,v=u.availabilityDelay;if(u.updated===!1)if(A){var s=333*u.misses;m=Math.max(Math.min(O,w*2),s),u.availabilityDelay=(u.availabilityDelay||0)+m}else m=O;else A?(v=Math.min(v||R/2,T),u.availabilityDelay=v,m=v+R-T):m=R-w;return Math.round(m)}function l(u,c,R){if(!u||!u.details)return null;var O=u.details,T=O.fragments[c-O.startSN];return T||(T=O.fragmentHint,T&&T.sn===c?T:c<O.startSN&&R&&R.sn===c?R:null)}function a(u,c,R){if(!u||!u.details)return null;var O=u.details.partList;if(O)for(var T=O.length;T--;){var A=O[T];if(A.index===R&&A.fragment.sn===c)return A}return null}},"./src/controller/stream-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return O});var V=M("./src/polyfills/number.ts"),I=M("./src/controller/base-stream-controller.ts"),B=M("./src/is-supported.ts"),K=M("./src/events.ts"),W=M("./src/utils/buffer-helper.ts"),L=M("./src/controller/fragment-tracker.ts"),P=M("./src/types/loader.ts"),b=M("./src/loader/fragment.ts"),p=M("./src/demux/transmuxer-interface.ts"),_=M("./src/types/transmuxer.ts"),h=M("./src/controller/gap-controller.ts"),r=M("./src/errors.ts"),d=M("./src/utils/logger.ts");function l(T,A){for(var w=0;w<A.length;w++){var m=A[w];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}function a(T,A,w){return A&&l(T.prototype,A),w&&l(T,w),T}function u(T,A){T.prototype=Object.create(A.prototype),T.prototype.constructor=T,c(T,A)}function c(T,A){return c=Object.setPrototypeOf||function(m,v){return m.__proto__=v,m},c(T,A)}var R=100,O=function(T){u(A,T);function A(m,v){var s;return s=T.call(this,m,v,"[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 w=A.prototype;return w._registerListeners=function(){var v=this.hls;v.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),v.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.on(K.Events.ERROR,this.onError,this),v.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var v=this.hls;v.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.off(K.Events.ERROR,this.onError,this),v.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},w.startLoad=function(v){if(this.levels){var s=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=o.startLevel;E===-1&&(o.config.testBandwidth?(E=0,this.bitrateTest=!0):E=o.nextAutoLevel),this.level=o.nextLoadLevel=E,this.loadedmetadata=!1}s>0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),v=s),this.state=I.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=I.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_LEVEL:{var v,s=this.levels,o=this.level,E=s==null||((v=s[o])===null||v===void 0)?void 0:v.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=I.State.IDLE;break}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var g,C=self.performance.now(),N=this.retryDate;(!N||C>=N||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=I.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var v,s,o=this.hls,E=this.levelLastLoaded,g=this.levels,C=this.media,N=o.config,U=o.nextLoadLevel;if(E===null||!C&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[U])return;var j=g[U];this.level=o.nextLoadLevel=U;var H=j.details;if(!H||this.state===I.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==U){this.state=I.State.WAITING_LEVEL;return}var y=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:C,P.PlaylistLevelType.MAIN);if(y===null)return;var x=y.len,F=this.getMaxBufferLength(j.maxBitrate);if(x>=F)return;if(this._streamEnded(y,H)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,Q),this.state=I.State.ENDED;return}var q=y.end,ie=this.getNextFragment(q,H);if(this.couldBacktrack&&!this.fragPrevious&&ie&&ie.sn!=="initSegment"){var ge=ie.sn-H.startSN;ge>1&&(ie=H.fragments[ge-1],this.fragmentTracker.removeFragment(ie))}if(ie&&this.fragmentTracker.getState(ie)===L.FragmentState.OK&&this.nextLoadPosition>q){var fe=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(C,fe,P.PlaylistLevelType.MAIN),ie=this.getNextFragment(this.nextLoadPosition,H)}if(!ie)return;ie.initSegment&&!ie.initSegment.data&&!this.bitrateTest&&(ie=ie.initSegment),((v=ie.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((s=ie.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(ie,H):this.loadFragment(ie,H,q)},w.loadFragment=function(v,s,o){var E,g=this.fragmentTracker.getState(v);if(this.fragCurrent=v,g===L.FragmentState.BACKTRACKED){var C=this.fragmentTracker.getBacktrackData(v);if(C){this._handleFragmentLoadProgress(C),this._handleFragmentLoadComplete(C);return}else g=L.FragmentState.NOT_LOADED}g===L.FragmentState.NOT_LOADED||g===L.FragmentState.PARTIAL?v.sn==="initSegment"?this._loadInitSegment(v):this.bitrateTest?(v.bitrateTest=!0,this.log("Fragment "+v.sn+" of level "+v.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(v)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,v,s,o)):g===L.FragmentState.APPENDING?this.reduceMaxBufferLength(v.duration)&&this.fragmentTracker.removeFragment(v):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(v){var s=this.fragmentTracker.getAppendedFrag(v,P.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},w.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,P.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var v=this.levels,s=this.media;if(s!=null&&s.readyState){var o,E=this.getAppendedFrag(s.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!s.paused&&v){var g=this.hls.nextLoadLevel,C=v[g],N=this.fragLastKbps;N&&this.fragCurrent?o=this.fragCurrent.duration*C.maxBitrate/(1e3*N)+1:o=0}else o=0;var U=this.getBufferedFrag(s.currentTime+o);if(U){var j=this.followingBufferedFrag(U);if(j){this.abortCurrentFrag();var H=j.maxStartPTS?j.maxStartPTS:j.start,y=j.duration,x=Math.max(U.end,H+Math.min(Math.max(y-this.config.maxFragLookUpTolerance,y*.5),y*.75));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===I.State.KEY_LOADING&&(this.state=I.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(v,s){T.prototype.flushMainBuffer.call(this,v,s,this.altAudio?"video":null)},w.onMediaAttached=function(v,s){T.prototype.onMediaAttached.call(this,v,s);var o=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,o,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var v=this.media;v&&(v.removeEventListener("playing",this.onvplaying),v.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var v=this.media,s=v?v.currentTime:null;Object(V.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(v,s){var o=!1,E=!1,g;s.levels.forEach(function(C){g=C.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(o=!0),g.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=o&&E&&!Object(B.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},w.onLevelLoading=function(v,s){var o=this.levels;if(!o||this.state!==I.State.IDLE)return;var E=o[s.level];(!E.details||E.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(E.details))&&(this.state=I.State.WAITING_LEVEL)},w.onLevelLoaded=function(v,s){var o,E=this.levels,g=s.level,C=s.details,N=C.totalduration;if(!E){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+C.startSN+","+C.endSN+"], cc ["+C.startCC+", "+C.endCC+"] duration:"+N);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=E[g],H=0;if(C.live||(o=j.details)!==null&&o!==void 0&&o.live){if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed)return;H=this.alignPlaylists(C,j.details)}if(j.details=C,this.levelLastLoaded=g,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:C,level:g}),this.state===I.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(C))return;this.state=I.State.IDLE}this.startFragRequested?C.live&&this.synchronizeToLiveEdge(C):this.setStartPosition(C,H),this.tick()},w._handleFragmentLoadProgress=function(v){var s,o=v.frag,E=v.part,g=v.payload,C=this.levels;if(!C){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var N=C[o.level],U=N.details;if(!U){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var j=N.videoCodec,H=U.PTSKnown||!U.live,y=(s=o.initSegment)===null||s===void 0?void 0:s.data,x=this._getAudioCodec(N),F=this.transmuxer=this.transmuxer||new p.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=E?E.index:-1,q=Q!==-1,ie=new _.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,g.byteLength,Q,q),ge=this.initPTS[o.cc];F.push(g,y,x,j,o,E,U.totalduration,H,ie,ge)},w.onAudioTrackSwitching=function(v,s){var o=this.altAudio,E=!!s.url,g=s.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var C=this.fragCurrent;C!=null&&C.loader&&(this.log("Switching to main audio track, cancel main fragment load"),C.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;o&&N.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:g})}},w.onAudioTrackSwitched=function(v,s){var o=s.id,E=!!this.hls.audioTracks[o].url;if(E){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=E,this.tick()},w.onBufferCreated=function(v,s){var o=s.tracks,E,g,C=!1;for(var N in o){var U=o[N];if(U.id==="main"){if(g=N,E=U,N==="video"){var j=o[N];j&&(this.videoBuffer=j.buffer)}}else C=!0}C&&E?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(v,s){var o=s.frag,E=s.part;if(o&&o.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(E?" p: "+E.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===I.State.PARSED&&(this.state=I.State.IDLE);return}var g=E?E.stats:o.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,E)},w.onError=function(v,s){switch(s.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.MAIN,s);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.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 r.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var o=!0,E=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);E&&E.len>.5&&(o=!this.reduceMaxBufferLength(E.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var v=this.media,s=this.gapController;if(!v||!s||!v.readyState)return;var o=W.BufferHelper.getBuffered(v);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=I.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(v,s){var o=s.type;if(o!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(o===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,o,P.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(v,s){this.levels=s.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var v=this.media,s=v.currentTime,o=this.startPosition;if(o>=0&&s<o){if(v.seeking){d.logger.log("could not seek to "+o+", already seeking at "+s);return}var E=W.BufferHelper.getBuffered(v),g=E.length?E.start(0):0,C=g-o;C>0&&(C<this.config.maxBufferHole||C<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+C+" to match buffer start"),o+=C,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+s),v.currentTime=o}},w._getAudioCodec=function(v){var s=this.config.defaultAudioCodec||v.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},w._loadBitrateTestFrag=function(v){var s=this;this._doFragLoad(v).then(function(o){var E=s.hls;if(!o||E.nextLoadLevel||s.fragContextChanged(v))return;s.fragLoadError=0,s.state=I.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var g=v.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),E.trigger(K.Events.FRAG_LOADED,o)})},w._handleTransmuxComplete=function(v){var s,o="main",E=this.hls,g=v.remuxResult,C=v.chunkMeta,N=this.getCurrentContext(C);if(!N){this.warn("The loading context changed while buffering fragment "+C.sn+" of level "+C.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(C.level);return}var U=N.frag,j=N.part,H=N.level,y=g.video,x=g.text,F=g.id3,Q=g.initSegment,q=this.altAudio?void 0:g.audio;if(this.fragContextChanged(U))return;if(this.state=I.State.PARSING,Q){Q.tracks&&(this._bufferInitSegment(H,Q.tracks,U,C),E.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:o,tracks:Q.tracks}));var ie=Q.initPTS,ge=Q.timescale;Object(V.isFiniteNumber)(ie)&&(this.initPTS[U.cc]=ie,E.trigger(K.Events.INIT_PTS_FOUND,{frag:U,id:o,initPTS:ie,timescale:ge}))}if(y&&g.independent!==!1){if(H.details){var fe=y.startPTS,ue=y.endPTS,he=y.startDTS,_e=y.endDTS;if(j)j.elementaryStreams[y.type]={startPTS:fe,endPTS:ue,startDTS:he,endDTS:_e};else if(y.firstKeyFrame&&y.independent&&(this.couldBacktrack=!0),y.dropped&&y.independent){var le=this.getLoadPosition()+this.config.maxBufferHole;if(le<fe){this.backtrack(U);return}U.setElementaryStreamInfo(y.type,U.start,ue,U.start,_e,!0)}U.setElementaryStreamInfo(y.type,fe,ue,he,_e),this.bufferFragmentData(y,U,j,C)}}else if(g.independent===!1){this.backtrack(U);return}if(q){var ne=q.startPTS,Te=q.endPTS,Fe=q.startDTS,Ke=q.endDTS;j&&(j.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:Te,startDTS:Fe,endDTS:Ke}),U.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ne,Te,Fe,Ke),this.bufferFragmentData(q,U,j,C)}if(F!=null&&(s=F.samples)!==null&&s!==void 0&&s.length){var Ue={frag:U,id:o,samples:F.samples};E.trigger(K.Events.FRAG_PARSING_METADATA,Ue)}if(x){var He={frag:U,id:o,samples:x.samples};E.trigger(K.Events.FRAG_PARSING_USERDATA,He)}},w._bufferInitSegment=function(v,s,o,E){var g=this;if(this.state!==I.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var C=s.audio,N=s.video,U=s.audiovideo;if(C){var j=v.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),C.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(j="mp4a.40.5")),H.indexOf("android")!==-1&&C.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),v.audioCodec&&v.audioCodec!==j&&this.log('Swapping manifest audio codec "'+v.audioCodec+'" for "'+j+'"'),C.levelCodec=j,C.id="main",this.log("Init audio buffer, container:"+C.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(v.audioCodec||"")+"/"+C.codec+"]")}N&&(N.levelCodec=v.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(v.videoCodec||"")+"/"+N.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(v.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(y){var x=s[y],F=x.initSegment;F!=null&&F.byteLength&&g.hls.trigger(K.Events.BUFFER_APPENDING,{type:y,data:F,frag:o,part:null,chunkMeta:E,parent:o.type})}),this.tick()},w.backtrack=function(v){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(v);var s=this.fragmentTracker.backtrack(v);this.fragPrevious=null,this.nextLoadPosition=v.start,s?this.resetFragmentLoading(v):this.state=I.State.BACKTRACKING},w.checkFragmentChanged=function(){var v=this.media,s=null;if(v&&v.readyState>1&&v.seeking===!1){var o=v.currentTime;if(W.BufferHelper.isBuffered(v,o)?s=this.getAppendedFrag(o):W.BufferHelper.isBuffered(v,o+.1)&&(s=this.getAppendedFrag(o+.1)),s){var E=this.fragPlaying,g=s.level;(!E||s.sn!==E.sn||E.level!==g||s.urlId!==E.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:s}),(!E||E.level!==g)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=s)}}},a(A,[{key:"nextLevel",get:function(){var v=this.nextBufferedFrag;return v?v.level:-1}},{key:"currentLevel",get:function(){var v=this.media;if(v){var s=this.getAppendedFrag(v.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var v=this.media;if(v){var s=this.getAppendedFrag(v.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(I.default)},"./src/controller/subtitle-stream-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"SubtitleStreamController",function(){return u});var V=M("./src/events.ts"),I=M("./src/utils/logger.ts"),B=M("./src/utils/buffer-helper.ts"),K=M("./src/controller/fragment-finders.ts"),W=M("./src/utils/discontinuities.ts"),L=M("./src/controller/level-helper.ts"),P=M("./src/controller/fragment-tracker.ts"),b=M("./src/controller/base-stream-controller.ts"),p=M("./src/types/loader.ts"),_=M("./src/types/level.ts");function h(c,R){for(var O=0;O<R.length;O++){var T=R[O];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(c,T.key,T)}}function r(c,R,O){return R&&h(c.prototype,R),O&&h(c,O),c}function d(c,R){c.prototype=Object.create(R.prototype),c.prototype.constructor=c,l(c,R)}function l(c,R){return l=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},l(c,R)}var a=500,u=function(c){d(R,c);function R(T,A){var w;return w=c.call(this,T,A,"[subtitle-stream-controller]")||this,w.levels=[],w.currentTrackId=-1,w.tracksBuffered=[],w.mainDetails=null,w._registerListeners(),w}var O=R.prototype;return O.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},O._registerListeners=function(){var A=this.hls;A.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(V.Events.ERROR,this.onError,this),A.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O._unregisterListeners=function(){var A=this.hls;A.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(V.Events.ERROR,this.onError,this),A.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},O.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(a),this.tick()},O.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},O.onLevelLoaded=function(A,w){this.mainDetails=w.details},O.onSubtitleFragProcessed=function(A,w){var m=w.frag,v=w.success;if(this.fragPrevious=m,this.state=b.State.IDLE,!v)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var o,E=m.start,g=0;g<s.length;g++)if(E>=s[g].start&&E<=s[g].end){o=s[g];break}var C=m.start+m.duration;o?o.end=C:(o={start:E,end:C},s.push(o)),this.fragmentTracker.fragBuffered(m)},O.onBufferFlushing=function(A,w){var m=w.startOffset,v=w.endOffset;if(m===0&&v!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,o=this.levels;if(!o.length||!o[s]||!o[s].details)return;var E=o[s].details,g=E.targetduration,C=v-g;if(C<=0)return;w.endOffsetSubtitles=Math.max(0,C),this.tracksBuffered.forEach(function(N){for(var U=0;U<N.length;){if(N[U].end<=C){N.shift();continue}else if(N[U].start<C)N[U].start=C;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(m,C,p.PlaylistLevelType.SUBTITLE)}},O.onError=function(A,w){var m,v=w.frag;if(!v||v.type!==p.PlaylistLevelType.SUBTITLE)return;(m=this.fragCurrent)!==null&&m!==void 0&&m.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},O.onSubtitleTracksUpdated=function(A,w){var m=this,v=w.subtitleTracks;this.tracksBuffered=[],this.levels=v.map(function(s){return new _.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){m.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},O.onSubtitleTrackSwitch=function(A,w){if(this.currentTrackId=w.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var m=this.levels[this.currentTrackId];m!=null&&m.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,m&&this.setInterval(a)},O.onSubtitleTrackLoaded=function(A,w){var m,v=w.details,s=w.id,o=this.currentTrackId,E=this.levels;if(!E.length)return;var g=E[o];if(s>=E.length||s!==o||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(m=g.details)!==null&&m!==void 0&&m.live){var C=this.mainDetails;if(v.deltaUpdateFailed||!C)return;var N=C.fragments[0];if(!g.details)v.hasProgramDateTime&&C.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(v,C):N&&Object(L.addSliding)(v,N.start);else{var U=this.alignPlaylists(v,g.details);U===0&&N&&Object(L.addSliding)(v,N.start)}}if(g.details=v,this.levelLastLoaded=s,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var j=Object(K.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},O._handleFragmentLoadComplete=function(A){var w=A.frag,m=A.payload,v=w.decryptdata,s=this.hls;if(this.fragContextChanged(w))return;if(m&&m.byteLength>0&&v&&v.key&&v.iv&&v.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(m),v.key.buffer,v.iv.buffer).then(function(E){var g=performance.now();s.trigger(V.Events.FRAG_DECRYPTED,{frag:w,payload:E,stats:{tstart:o,tdecrypt:g}})})}},O.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var A,w=this.currentTrackId,m=this.levels;if(!m.length||!m[w]||!m[w].details)return;var v=m[w].details,s=v.targetduration,o=this.config,E=this.media,g=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-s,o.maxBufferHole),C=g.end,N=g.len,U=this.getMaxBufferLength()+s;if(N>U)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var j=v.fragments,H=j.length,y=v.edge,x,F=this.fragPrevious;if(C<y){var Q=o.maxFragLookUpTolerance;F&&v.hasProgramDateTime&&(x=Object(K.findFragmentByPDT)(j,F.endProgramDateTime,Q)),x||(x=Object(K.findFragmentByPTS)(F,j,C,Q),!x&&F&&F.start<j[0].start&&(x=j[0]))}else x=j[H-1];(A=x)!==null&&A!==void 0&&A.encrypted?(I.logger.log("Loading key for "+x.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:x})):x&&this.fragmentTracker.getState(x)===P.FragmentState.NOT_LOADED&&this.loadFragment(x,v,C)}},O.loadFragment=function(A,w,m){this.fragCurrent=A,c.prototype.loadFragment.call(this,A,w,m)},r(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(b.default)},"./src/controller/subtitle-track-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts"),I=M("./src/utils/texttrack-utils.ts"),B=M("./src/controller/base-playlist-controller.ts"),K=M("./src/types/loader.ts");function W(h,r){for(var d=0;d<r.length;d++){var l=r[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function L(h,r,d){return r&&W(h.prototype,r),d&&W(h,d),h}function P(h,r){h.prototype=Object.create(r.prototype),h.prototype.constructor=h,b(h,r)}function b(h,r){return b=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},b(h,r)}var p=function(h){P(r,h);function r(l){var a;return a=h.call(this,l,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var d=r.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,h.prototype.destroy.call(this)},d.registerListeners=function(){var a=this.hls;a.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(V.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var a=this.hls;a.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(V.Events.ERROR,this.onError,this)},d.onMediaAttached=function(a,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)},d.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},d.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var a=_(this.media.textTracks);a.forEach(function(u){Object(I.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(a,u){this.tracks=u.subtitleTracks},d.onSubtitleTrackLoaded=function(a,u){var c=u.id,R=u.details,O=this.trackId,T=this.tracksInGroup[O];if(!T){this.warn("Invalid subtitle track id "+c);return}var A=T.details;T.details=u.details,this.log("subtitle track "+c+" loaded ["+R.startSN+"-"+R.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,u,A))},d.onLevelLoading=function(a,u){this.switchLevel(u.level)},d.onLevelSwitching=function(a,u){this.switchLevel(u.level)},d.switchLevel=function(a){var u=this.hls.levels[a];if(!(u!=null&&u.textGroupIds))return;var c=u.textGroupIds[u.urlId];if(this.groupId!==c){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,O=this.tracks.filter(function(w){return!c||w.groupId===c});this.tracksInGroup=O;var T=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=c;var A={subtitleTracks:O};this.log("Updating subtitle tracks, "+O.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,A),T!==-1&&this.setSubtitleTrack(T,R)}},d.findTrackId=function(a){for(var u=this.tracksInGroup,c=0;c<u.length;c++){var R=u[c];if((!this.selectDefaultTrack||R.default)&&(!a||a===R.name))return R.id}return-1},d.onError=function(a,u){if(h.prototype.onError.call(this,a,u),u.fatal||!u.context)return;u.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},d.loadPlaylist=function(a){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var c=u.id,R=u.groupId,O=u.url;if(a)try{O=a.addDirectives(O)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+c),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:O,id:c,groupId:R,deliveryDirectives:a||null})}},d.toggleTrackModes=function(a){var u=this,c=this.media,R=this.subtitleDisplay,O=this.trackId;if(!c)return;var T=_(c.textTracks),A=T.filter(function(v){return v.groupId===u.groupId});if(a===-1)[].slice.call(T).forEach(function(v){v.mode="disabled"});else{var w=A[O];w&&(w.mode="disabled")}var m=A[a];m&&(m.mode=R?"showing":"hidden")},d.setSubtitleTrack=function(a,u){var c,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(c=R[a])!==null&&c!==void 0&&c.details)||a<-1||a>=R.length)return;this.clearTimer();var O=R[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,O){var T=O.id,A=O.groupId,w=A===void 0?"":A,m=O.name,v=O.type,s=O.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:w,name:m,type:v,url:s});var o=this.switchParams(O.url,u==null?void 0:u.details);this.loadPlaylist(o)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:a})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,u=_(this.media.textTracks),c=0;c<u.length;c++)if(u[c].mode==="hidden")a=c;else if(u[c].mode==="showing"){a=c;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},L(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,u)}}]),r}(B.default);function _(h){for(var r=[],d=0;d<h.length;d++){var l=h[d];l.kind==="subtitles"&&l.label&&r.push(h[d])}return r}Z.default=p},"./src/controller/timeline-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"TimelineController",function(){return _});var V=M("./src/polyfills/number.ts"),I=M("./src/events.ts"),B=M("./src/utils/cea-608-parser.ts"),K=M("./src/utils/output-filter.ts"),W=M("./src/utils/webvtt-parser.ts"),L=M("./src/utils/texttrack-utils.ts"),P=M("./src/utils/imsc1-ttml-parser.ts"),b=M("./src/types/loader.ts"),p=M("./src/utils/logger.ts"),_=function(){function l(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=d(),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 c=new K.default(this,"textTrack1"),R=new K.default(this,"textTrack2"),O=new K.default(this,"textTrack3"),T=new K.default(this,"textTrack4");this.cea608Parser1=new B.default(1,c,R),this.cea608Parser2=new B.default(3,O,T)}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 a=l.prototype;return a.destroy=function(){var c=this.hls;c.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.off(I.Events.FRAG_LOADING,this.onFragLoading,this),c.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.off(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(c,R,O,T,A){for(var w=!1,m=A.length;m--;){var v=A[m],s=r(v[0],v[1],R,O);if(s>=0&&(v[0]=Math.min(v[0],R),v[1]=Math.max(v[1],O),w=!0,s/(O-R)>.5))return}if(w||A.push([R,O]),this.config.renderTextTracksNatively){var o=this.captionsTracks[c];this.Cues.newCue(o,R,O,T)}else{var E=this.Cues.newCue(null,R,O,T);this.hls.trigger(I.Events.CUES_PARSED,{type:"captions",cues:E,track:c})}},a.onInitPtsFound=function(c,R){var O=this,T=R.frag,A=R.id,w=R.initPTS,m=R.timescale,v=this.unparsedVttFrags;A==="main"&&(this.initPTS[T.cc]=w,this.timescale[T.cc]=m),v.length&&(this.unparsedVttFrags=[],v.forEach(function(s){O.onFragLoaded(I.Events.FRAG_LOADED,s)}))},a.getExistingTrack=function(c){var R=this.media;if(R)for(var O=0;O<R.textTracks.length;O++){var T=R.textTracks[O];if(T[c])return T}return null},a.createCaptionsTrack=function(c){this.config.renderTextTracksNatively?this.createNativeTrack(c):this.createNonNativeTrack(c)},a.createNativeTrack=function(c){if(this.captionsTracks[c])return;var R=this.captionsProperties,O=this.captionsTracks,T=this.media,A=R[c],w=A.label,m=A.languageCode,v=this.getExistingTrack(c);if(v)O[c]=v,Object(L.clearCurrentCues)(O[c]),Object(L.sendAddTrackEvent)(O[c],T);else{var s=this.createTextTrack("captions",w,m);s&&(s[c]=!0,O[c]=s)}},a.createNonNativeTrack=function(c){if(this.nonNativeCaptionsTracks[c])return;var R=this.captionsProperties[c];if(!R)return;var O=R.label,T={_id:c,label:O,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[c]=T,this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},a.createTextTrack=function(c,R,O){var T=this.media;return T?T.addTextTrack(c,R,O):void 0},a.onMediaAttaching=function(c,R){this.media=R.media,this._cleanTracks()},a.onMediaDetaching=function(){var c=this.captionsTracks;Object.keys(c).forEach(function(R){Object(L.clearCurrentCues)(c[R]),delete c[R]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},a._cleanTracks=function(){var c=this.media;if(!c)return;var R=c.textTracks;if(R)for(var O=0;O<R.length;O++)Object(L.clearCurrentCues)(R[O])},a.onSubtitleTracksUpdated=function(c,R){var O=this;this.textTracks=[];var T=R.subtitleTracks||[],A=T.some(function(s){return s.textCodec===P.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var w=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var m=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,o){var E;if(o<m.length){for(var g=null,C=0;C<m.length;C++)if(h(m[C],s)){g=m[C];break}g&&(E=g)}E?Object(L.clearCurrentCues)(E):(E=O.createTextTrack("subtitles",s.name,s.lang),E&&(E.mode="disabled")),E&&(E.groupId=s.groupId,O.textTracks.push(E))})}else if(!w&&this.tracks&&this.tracks.length){var v=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:v})}}},a.onManifestLoaded=function(c,R){var O=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(T){var A=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!A)return;var w="textTrack"+A[1],m=O.captionsProperties[w];if(!m)return;m.label=T.name,T.lang&&(m.languageCode=T.lang),m.media=T})},a.onFragLoading=function(c,R){var O=this.cea608Parser1,T=this.cea608Parser2,A=this.lastSn,w=this.lastPartIndex;if(!this.enabled||!(O&&T))return;if(R.frag.type===b.PlaylistLevelType.MAIN){var m,v,s=R.frag.sn,o=(m=R==null||((v=R.part)===null||v===void 0)?void 0:v.index)!=null?m:-1;s===A+1||s===A&&o===w+1||(O.reset(),T.reset()),this.lastSn=s,this.lastPartIndex=o}},a.onFragLoaded=function(c,R){var O=R.frag,T=R.payload,A=this.initPTS,w=this.unparsedVttFrags;if(O.type===b.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(V.isFiniteNumber)(A[O.cc])){w.push(R),A.length&&this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:O,error:new Error("Missing initial subtitle PTS")});return}var m=O.decryptdata;if(m==null||m.key==null||m.method!=="AES-128"){var v=this.tracks[O.level],s=this.vttCCs;s[O.cc]||(s[O.cc]={start:O.start,prevCC:this.prevCC,new:!0},this.prevCC=O.cc),v&&v.textCodec===P.IMSC1_CODEC?this._parseIMSC1(O,T):this._parseVTTs(O,T,s)}}else this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:O,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(c,R){var O=this,T=this.hls;Object(P.parseIMSC1)(R,this.initPTS[c.cc],this.timescale[c.cc],function(A){O._appendCues(A,c.level),T.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(A){p.logger.log("Failed to parse IMSC1: "+A),T.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:A})})},a._parseVTTs=function(c,R,O){var T=this,A=this.hls;Object(W.parseWebVTT)(R,this.initPTS[c.cc],this.timescale[c.cc],O,c.cc,c.start,function(w){T._appendCues(w,c.level),A.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(w){T._fallbackToIMSC1(c,R),p.logger.log("Failed to parse VTT cue: "+w),A.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:w})})},a._fallbackToIMSC1=function(c,R){var O=this,T=this.tracks[c.level];T.textCodec||Object(P.parseIMSC1)(R,this.initPTS[c.cc],this.timescale[c.cc],function(){T.textCodec=P.IMSC1_CODEC,O._parseIMSC1(c,R)},function(){T.textCodec="wvtt"})},a._appendCues=function(c,R){var O=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[R];if(T.mode==="disabled")return;c.forEach(function(m){return Object(L.addCueToTrack)(T,m)})}else{var A=this.tracks[R],w=A.default?"default":"subtitles"+R;O.trigger(I.Events.CUES_PARSED,{type:"subtitles",cues:c,track:w})}},a.onFragDecrypted=function(c,R){var O=R.frag;if(O.type===b.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[O.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(I.Events.FRAG_LOADED,R)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(c,R){var O=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(O&&T))return;for(var A=0;A<R.samples.length;A++){var w=R.samples[A].bytes;if(w){var m=this.extractCea608Data(w);O.addData(R.samples[A].pts,m[0]),T.addData(R.samples[A].pts,m[1])}}},a.onBufferFlushing=function(c,R){var O=R.startOffset,T=R.endOffset,A=R.endOffsetSubtitles,w=R.type,m=this.media;if(!m||m.currentTime<T)return;if(!w||w==="video"){var v=this.captionsTracks;Object.keys(v).forEach(function(o){return Object(L.removeCuesInRange)(v[o],O,T)})}if(this.config.renderTextTracksNatively&&(O===0&&A!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(o){return Object(L.removeCuesInRange)(s[o],O,A)})}},a.extractCea608Data=function(c){for(var R=c[0]&31,O=2,T=[[],[]],A=0;A<R;A++){var w=c[O++],m=127&c[O++],v=127&c[O++],s=(4&w)!==0,o=3&w;if(m===0&&v===0)continue;s&&((o===0||o===1)&&(T[o].push(m),T[o].push(v)))}return T},l}();function h(l,a){return l&&l.label===a.name&&!(l.textTrack1||l.textTrack2)}function r(l,a,u,c){return Math.min(a,c)-Math.max(l,u)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return V});var V=function(){function I(K,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=W}var B=I.prototype;return B.decrypt=function(W,L){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},L,W)},I}()},"./src/crypt/aes-decryptor.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"removePadding",function(){return I}),M.d(Z,"default",function(){return B});var V=M("./src/utils/typed-array.ts");function I(K){var W=K.byteLength,L=W&&new DataView(K.buffer).getUint8(W-1);return L?Object(V.sliceUint8)(K,0,W-L):K}var B=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var W=K.prototype;return W.uint8ArrayToUint32Array_=function(P){for(var b=new DataView(P),p=new Uint32Array(4),_=0;_<4;_++)p[_]=b.getUint32(_*4);return p},W.initTable=function(){var P=this.sBox,b=this.invSBox,p=this.subMix,_=p[0],h=p[1],r=p[2],d=p[3],l=this.invSubMix,a=l[0],u=l[1],c=l[2],R=l[3],O=new Uint32Array(256),T=0,A=0,w=0;for(w=0;w<256;w++)w<128?O[w]=w<<1:O[w]=w<<1^283;for(w=0;w<256;w++){var m=A^A<<1^A<<2^A<<3^A<<4;m=m>>>8^m&255^99,P[T]=m,b[m]=T;var v=O[T],s=O[v],o=O[s],E=O[m]*257^m*16843008;_[T]=E<<24|E>>>8,h[T]=E<<16|E>>>16,r[T]=E<<8|E>>>24,d[T]=E,E=o*16843009^s*65537^v*257^T*16843008,a[m]=E<<24|E>>>8,u[m]=E<<16|E>>>16,c[m]=E<<8|E>>>24,R[m]=E,T?(T=v^O[O[O[o^v]]],A^=O[O[A]]):T=A=1}},W.expandKey=function(P){for(var b=this.uint8ArrayToUint32Array_(P),p=!0,_=0;_<b.length&&p;)p=b[_]===this.key[_],_++;if(p)return;this.key=b;var h=this.keySize=b.length;if(h!==4&&h!==6&&h!==8)throw new Error("Invalid aes key size="+h);var r=this.ksRows=(h+6+1)*4,d,l,a=this.keySchedule=new Uint32Array(r),u=this.invKeySchedule=new Uint32Array(r),c=this.sBox,R=this.rcon,O=this.invSubMix,T=O[0],A=O[1],w=O[2],m=O[3],v,s;for(d=0;d<r;d++){if(d<h){v=a[d]=b[d];continue}s=v,d%h===0?(s=s<<8|s>>>24,s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255],s^=R[d/h|0]<<24):h>6&&d%h===4&&(s=c[s>>>24]<<24|c[s>>>16&255]<<16|c[s>>>8&255]<<8|c[s&255]),a[d]=v=(a[d-h]^s)>>>0}for(l=0;l<r;l++)d=r-l,l&3?s=a[d]:s=a[d-4],l<4||d<=4?u[l]=s:u[l]=T[c[s>>>24]]^A[c[s>>>16&255]]^w[c[s>>>8&255]]^m[c[s&255]],u[l]=u[l]>>>0},W.networkToHostOrderSwap=function(P){return P<<24|(P&65280)<<8|(P&16711680)>>8|P>>>24},W.decrypt=function(P,b,p){for(var _=this.keySize+6,h=this.invKeySchedule,r=this.invSBox,d=this.invSubMix,l=d[0],a=d[1],u=d[2],c=d[3],R=this.uint8ArrayToUint32Array_(p),O=R[0],T=R[1],A=R[2],w=R[3],m=new Int32Array(P),v=new Int32Array(m.length),s,o,E,g,C,N,U,j,H,y,x,F,Q,q,ie=this.networkToHostOrderSwap;b<m.length;){for(H=ie(m[b]),y=ie(m[b+1]),x=ie(m[b+2]),F=ie(m[b+3]),C=H^h[0],N=F^h[1],U=x^h[2],j=y^h[3],Q=4,q=1;q<_;q++)s=l[C>>>24]^a[N>>16&255]^u[U>>8&255]^c[j&255]^h[Q],o=l[N>>>24]^a[U>>16&255]^u[j>>8&255]^c[C&255]^h[Q+1],E=l[U>>>24]^a[j>>16&255]^u[C>>8&255]^c[N&255]^h[Q+2],g=l[j>>>24]^a[C>>16&255]^u[N>>8&255]^c[U&255]^h[Q+3],C=s,N=o,U=E,j=g,Q=Q+4;s=r[C>>>24]<<24^r[N>>16&255]<<16^r[U>>8&255]<<8^r[j&255]^h[Q],o=r[N>>>24]<<24^r[U>>16&255]<<16^r[j>>8&255]<<8^r[C&255]^h[Q+1],E=r[U>>>24]<<24^r[j>>16&255]<<16^r[C>>8&255]<<8^r[N&255]^h[Q+2],g=r[j>>>24]<<24^r[C>>16&255]<<16^r[N>>8&255]<<8^r[U&255]^h[Q+3],v[b]=ie(s^O),v[b+1]=ie(g^T),v[b+2]=ie(E^A),v[b+3]=ie(o^w),O=H,T=y,A=x,w=F,b=b+4}return v.buffer},K}()},"./src/crypt/decrypter.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return b});var V=M("./src/crypt/aes-crypto.ts"),I=M("./src/crypt/fast-aes-key.ts"),B=M("./src/crypt/aes-decryptor.ts"),K=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),L=M("./src/utils/typed-array.ts"),P=16,b=function(){function p(h,r,d){var l=d===void 0?{}:d,a=l.removePKCS7Padding,u=a===void 0?!0:a;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=h,this.config=r,this.removePKCS7Padding=u,u)try{var c=self.crypto;c&&(this.subtle=c.subtle||c.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var _=p.prototype;return _.destroy=function(){this.observer=null},_.isSync=function(){return this.config.enableSoftwareAES},_.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var d=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(B.removePadding)(d):d},_.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},_.decrypt=function(r,d,l,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),d,l);var u=this.flush();u&&a(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),d,l).then(a)},_.softwareDecrypt=function(r,d,l){var a=this.currentIV,u=this.currentResult,c=this.remainderData;this.logOnce("JS AES decrypt"),c&&(r=Object(W.appendUint8Array)(c,r),this.remainderData=null);var R=this.getValidChunk(r);if(!R.length)return null;a&&(l=a);var O=this.softwareDecrypter;O||(O=this.softwareDecrypter=new B.default),O.expandKey(d);var T=u;return this.currentResult=O.decrypt(R.buffer,0,l),this.currentIV=Object(L.sliceUint8)(R,-16).buffer,T||null},_.webCryptoDecrypt=function(r,d,l){var a=this,u=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new I.default(u,d)),this.fastAesKey.expandKey().then(function(c){if(!u)return Promise.reject(new Error("web crypto not initialized"));var R=new V.default(u,l);return R.decrypt(r.buffer,c)}).catch(function(c){return a.onWebCryptoError(c,r,d,l)})},_.onWebCryptoError=function(r,d,l,a){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,l,a)},_.getValidChunk=function(r){var d=r,l=r.length-r.length%P;return l!==r.length&&(d=Object(L.sliceUint8)(r,0,l),this.remainderData=Object(L.sliceUint8)(r,l)),d},_.logOnce=function(r){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return V});var V=function(){function I(K,W){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=W}var B=I.prototype;return B.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},I}()},"./src/demux/aacdemuxer.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/demux/base-audio-demuxer.ts"),I=M("./src/demux/adts.ts"),B=M("./src/utils/logger.ts"),K=M("./src/demux/id3.ts");function W(b,p){b.prototype=Object.create(p.prototype),b.prototype.constructor=b,L(b,p)}function L(b,p){return L=Object.setPrototypeOf||function(h,r){return h.__proto__=r,h},L(b,p)}var P=function(b){W(p,b);function p(h,r){var d;return d=b.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=h,d.config=r,d}var _=p.prototype;return _.resetInitSegment=function(r,d,l){b.prototype.resetInitSegment.call(this,r,d,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(r){if(!r)return!1;for(var d=K.getID3Data(r,0)||[],l=d.length,a=r.length;l<a;l++)if(I.probe(r,l))return B.logger.log("ADTS sync word found !"),!0;return!1},_.canParse=function(r,d){return I.canParse(r,d)},_.appendFrame=function(r,d,l){I.initTrackConfig(r,this.observer,d,l,r.manifestCodec);var a=I.appendFrame(r,d,l,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},p}(V.default);P.minProbeByteLength=9,Z.default=P},"./src/demux/adts.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"getAudioConfig",function(){return K}),M.d(Z,"isHeaderPattern",function(){return W}),M.d(Z,"getHeaderLength",function(){return L}),M.d(Z,"getFullFrameLength",function(){return P}),M.d(Z,"canGetFrameLength",function(){return b}),M.d(Z,"isHeader",function(){return p}),M.d(Z,"canParse",function(){return _}),M.d(Z,"probe",function(){return h}),M.d(Z,"initTrackConfig",function(){return r}),M.d(Z,"getFrameDuration",function(){return d}),M.d(Z,"parseFrameHeader",function(){return l}),M.d(Z,"appendFrame",function(){return a});var V=M("./src/utils/logger.ts"),I=M("./src/errors.ts"),B=M("./src/events.ts");function K(u,c,R,O){var T,A,w,m,v=navigator.userAgent.toLowerCase(),s=O,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((c[R+2]&192)>>>6)+1;var E=(c[R+2]&60)>>>2;if(E>o.length-1){u.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return w=(c[R+2]&1)<<2,w|=(c[R+3]&192)>>>6,V.logger.log("manifest codec:"+O+", ADTS type:"+T+", samplingIndex:"+E),/firefox/i.test(v)?E>=6?(T=5,m=new Array(4),A=E-3):(T=2,m=new Array(2),A=E):v.indexOf("android")!==-1?(T=2,m=new Array(2),A=E):(T=5,m=new Array(4),O&&(O.indexOf("mp4a.40.29")!==-1||O.indexOf("mp4a.40.5")!==-1)||!O&&E>=6?A=E-3:((O&&O.indexOf("mp4a.40.2")!==-1&&(E>=6&&w===1||/vivaldi/i.test(v))||!O&&w===1)&&(T=2,m=new Array(2)),A=E)),m[0]=T<<3,m[0]|=(E&14)>>1,m[1]|=(E&1)<<7,m[1]|=w<<3,T===5&&(m[1]|=(A&14)>>1,m[2]=(A&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:o[E],channelCount:w,codec:"mp4a.40."+T,manifestCodec:s}}function W(u,c){return u[c]===255&&(u[c+1]&246)===240}function L(u,c){return u[c+1]&1?7:9}function P(u,c){return(u[c+3]&3)<<11|u[c+4]<<3|(u[c+5]&224)>>>5}function b(u,c){return c+5<u.length}function p(u,c){return c+1<u.length&&W(u,c)}function _(u,c){return b(u,c)&&W(u,c)&&P(u,c)<=u.length-c}function h(u,c){if(p(u,c)){var R=L(u,c);if(c+R>=u.length)return!1;var O=P(u,c);if(O<=R)return!1;var T=c+O;return T===u.length||p(u,T)}return!1}function r(u,c,R,O,T){if(!u.samplerate){var A=K(c,R,O,T);if(!A)return;u.config=A.config,u.samplerate=A.samplerate,u.channelCount=A.channelCount,u.codec=A.codec,u.manifestCodec=A.manifestCodec,V.logger.log("parsed codec:"+u.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function d(u){return 1024*9e4/u}function l(u,c,R,O,T){var A=L(u,c),w=P(u,c);if(w-=A,w>0){var m=R+O*T;return{headerLength:A,frameLength:w,stamp:m}}}function a(u,c,R,O,T){var A=d(u.samplerate),w=l(c,R,O,T,A);if(w){var m=w.frameLength,v=w.headerLength,s=w.stamp,o=v+m,E=Math.max(0,R+o-c.length),g;E?(g=new Uint8Array(o-v),g.set(c.subarray(R+v,c.length),0)):g=c.subarray(R+v,R+o);var C={unit:g,pts:s};return E||u.samples.push(C),{sample:C,length:o,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"initPTSFn",function(){return P});var V=M("./src/polyfills/number.ts"),I=M("./src/demux/id3.ts"),B=M("./src/demux/dummy-demuxed-track.ts"),K=M("./src/utils/mp4-tools.ts"),W=M("./src/utils/typed-array.ts"),L=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=b.prototype;return p.resetInitSegment=function(h,r,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(h,r){return!1},p.appendFrame=function(h,r,d){},p.demux=function(h,r){this.cachedData&&(h=Object(K.appendUint8Array)(this.cachedData,h),this.cachedData=null);var d=I.getID3Data(h,0),l=d?d.length:0,a,u,c=this._audioTrack,R=this._id3Track,O=d?I.getTimeStamp(d):void 0,T=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(O,r)),d&&d.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),u=this.initPTS;l<T;){if(this.canParse(h,l)){var A=this.appendFrame(c,h,l);A?(this.frameIndex++,u=A.sample.pts,l+=A.length,a=l):l=T}else I.canParse(h,l)?(d=I.getID3Data(h,l),R.samples.push({pts:u,dts:u,data:d}),l+=d.length,a=l):l++;if(l===T&&a!==T){var w=Object(W.sliceUint8)(h,a);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,w):this.cachedData=w}}return{audioTrack:c,avcTrack:Object(B.dummyTrack)(),id3Track:R,textTrack:Object(B.dummyTrack)()}},p.demuxSampleAes=function(h,r,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(h){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(B.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(B.dummyTrack)()}},p.destroy=function(){},b}(),P=function(p,_){return Object(V.isFiniteNumber)(p)?p*90:_*9e4};Z.default=L},"./src/demux/chunk-cache.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return V});var V=function(){function B(){this.chunks=[],this.dataLength=0}var K=B.prototype;return K.push=function(L){this.chunks.push(L),this.dataLength+=L.length},K.flush=function(){var L=this.chunks,P=this.dataLength,b;if(L.length)L.length===1?b=L[0]:b=I(L,P);else return new Uint8Array(0);return this.reset(),b},K.reset=function(){this.chunks.length=0,this.dataLength=0},B}();function I(B,K){for(var W=new Uint8Array(K),L=0,P=0;P<B.length;P++){var b=B[P];W.set(b,L),L+=b.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"dummyTrack",function(){return V});function V(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/utils/logger.ts"),I=function(){function B(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var K=B.prototype;return K.loadWord=function(){var L=this.data,P=this.bytesAvailable,b=L.byteLength-P,p=new Uint8Array(4),_=Math.min(4,P);if(_===0)throw new Error("no bytes available");p.set(L.subarray(b,b+_)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=_*8,this.bytesAvailable-=_},K.skipBits=function(L){var P;this.bitsAvailable>L?(this.word<<=L,this.bitsAvailable-=L):(L-=this.bitsAvailable,P=L>>3,L-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=L,this.bitsAvailable-=L)},K.readBits=function(L){var P=Math.min(this.bitsAvailable,L),b=this.word>>>32-P;return L>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=P,this.bitsAvailable>0?this.word<<=P:this.bytesAvailable>0&&this.loadWord(),P=L-P,P>0&&this.bitsAvailable?b<<P|this.readBits(P):b},K.skipLZ=function(){var L;for(L=0;L<this.bitsAvailable;++L)if((this.word&2147483648>>>L)!==0)return this.word<<=L,this.bitsAvailable-=L,L;return this.loadWord(),L+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var L=this.skipLZ();return this.readBits(L+1)-1},K.readEG=function(){var L=this.readUEG();return 1&L?1+L>>>1:-1*(L>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(L){for(var P=8,b=8,p,_=0;_<L;_++)b!==0&&(p=this.readEG(),b=(P+p+256)%256),P=b===0?P:b},K.readSPS=function(){var L=0,P=0,b=0,p=0,_,h,r,d=this.readUByte.bind(this),l=this.readBits.bind(this),a=this.readUEG.bind(this),u=this.readBoolean.bind(this),c=this.skipBits.bind(this),R=this.skipEG.bind(this),O=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);d();var A=d();if(l(5),c(3),d(),O(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var w=a();if(w===3&&c(1),O(),O(),c(1),u())for(h=w!==3?8:12,r=0;r<h;r++)u()&&(r<6?T(16):T(64))}O();var m=a();if(m===0)a();else if(m===1)for(c(1),R(),R(),_=a(),r=0;r<_;r++)R();O(),c(1);var v=a(),s=a(),o=l(1);o===0&&c(1),c(1),u()&&(L=a(),P=a(),b=a(),p=a());var E=[1,1];if(u()&&u()){var g=d();switch(g){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((v+1)*16-L*2-P*2),height:(2-o)*(s+1)*16-(o?2:4)*(b+p),pixelRatio:E}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},B}();Z.default=I},"./src/demux/id3.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"isHeader",function(){return V}),M.d(Z,"isFooter",function(){return I}),M.d(Z,"getID3Data",function(){return B}),M.d(Z,"canParse",function(){return W}),M.d(Z,"getTimeStamp",function(){return L}),M.d(Z,"isTimeStampFrame",function(){return P}),M.d(Z,"getID3Frames",function(){return p}),M.d(Z,"decodeFrame",function(){return _}),M.d(Z,"utf8ArrayToStr",function(){return a}),M.d(Z,"testables",function(){return u});var V=function(T,A){return A+10<=T.length&&(T[A]===73&&T[A+1]===68&&T[A+2]===51&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},I=function(T,A){return A+10<=T.length&&(T[A]===51&&T[A+1]===68&&T[A+2]===73&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},B=function(T,A){for(var w=A,m=0;V(T,A);){m+=10;var v=K(T,A+6);m+=v,I(T,A+10)&&(m+=10),A+=m}return m>0?T.subarray(w,w+m):void 0},K=function(T,A){var w=0;return w=(T[A]&127)<<21,w|=(T[A+1]&127)<<14,w|=(T[A+2]&127)<<7,w|=T[A+3]&127,w},W=function(T,A){return V(T,A)&&K(T,A+6)+10<=T.length-A},L=function(T){for(var A=p(T),w=0;w<A.length;w++){var m=A[w];if(P(m))return l(m)}return},P=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},b=function(T){var A=String.fromCharCode(T[0],T[1],T[2],T[3]),w=K(T,4),m=10;return{type:A,size:w,data:T.subarray(m,m+w)}},p=function(T){for(var A=0,w=[];V(T,A);){var m=K(T,A+6);A+=10;for(var v=A+m;A+8<v;){var s=b(T.subarray(A)),o=_(s);o&&w.push(o),A+=s.size+10}I(T,A)&&(A+=10)}return w},_=function(T){return T.type==="PRIV"?h(T):T.type[0]==="W"?d(T):r(T)},h=function(T){if(T.size<2)return;var A=a(T.data,!0),w=new Uint8Array(T.data.subarray(A.length+1));return{key:T.type,info:A,data:w.buffer}},r=function(T){if(T.size<2)return;if(T.type==="TXXX"){var A=1,w=a(T.data.subarray(A),!0);A+=w.length+1;var m=a(T.data.subarray(A));return{key:T.type,info:w,data:m}}var v=a(T.data.subarray(1));return{key:T.type,data:v}},d=function(T){if(T.type==="WXXX"){if(T.size<2)return;var A=1,w=a(T.data.subarray(A),!0);A+=w.length+1;var m=a(T.data.subarray(A));return{key:T.type,info:w,data:m}}var v=a(T.data);return{key:T.type,data:v}},l=function(T){if(T.data.byteLength===8){var A=new Uint8Array(T.data),w=A[3]&1,m=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return m/=45,w&&(m+=4772185884e-2),Math.round(m)}return},a=function(T,A){A===void 0&&(A=!1);var w=R();if(w){var m=w.decode(T);if(A){var v=m.indexOf("\0");return v!==-1?m.substring(0,v):m}return m.replace(/\0/g,"")}for(var s=T.length,o,E,g,C="",N=0;N<s;){if(o=T[N++],o===0&&A)return C;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:C+=String.fromCharCode(o);break;case 12:case 13:E=T[N++],C+=String.fromCharCode((o&31)<<6|E&63);break;case 14:E=T[N++],g=T[N++],C+=String.fromCharCode((o&15)<<12|(E&63)<<6|(g&63)<<0);break;default:}}return C},u={decodeTextFrame:r},c;function R(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/demux/base-audio-demuxer.ts"),I=M("./src/demux/id3.ts"),B=M("./src/utils/logger.ts"),K=M("./src/demux/mpegaudio.ts");function W(b,p){b.prototype=Object.create(p.prototype),b.prototype.constructor=b,L(b,p)}function L(b,p){return L=Object.setPrototypeOf||function(h,r){return h.__proto__=r,h},L(b,p)}var P=function(b){W(p,b);function p(){return b.apply(this,arguments)||this}var _=p.prototype;return _.resetInitSegment=function(r,d,l){b.prototype.resetInitSegment.call(this,r,d,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(r){if(!r)return!1;for(var d=I.getID3Data(r,0)||[],l=d.length,a=r.length;l<a;l++)if(K.probe(r,l))return B.logger.log("MPEG Audio sync word found !"),!0;return!1},_.canParse=function(r,d){return K.canParse(r,d)},_.appendFrame=function(r,d,l){return this.initPTS===null?void 0:K.appendFrame(r,d,l,this.initPTS,this.frameIndex)},p}(V.default);P.minProbeByteLength=4,Z.default=P},"./src/demux/mp4demuxer.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/utils/mp4-tools.ts"),I=M("./src/demux/dummy-demuxed-track.ts"),B=function(){function K(L,P){this.remainderData=null,this.config=void 0,this.config=P}var W=K.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},K.probe=function(P){return Object(V.findBox)({data:P,start:0,end:Math.min(P.length,16384)},["moof"]).length>0},W.demux=function(P){var b=P,p=Object(I.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(V.appendUint8Array)(this.remainderData,P));var _=Object(V.segmentValidRange)(b);this.remainderData=_.remainder,p.samples=_.valid||new Uint8Array}else p.samples=b;return{audioTrack:Object(I.dummyTrack)(),avcTrack:p,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},W.flush=function(){var P=Object(I.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(I.dummyTrack)(),avcTrack:P,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},W.demuxSampleAes=function(P,b,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},K}();B.minProbeByteLength=1024,Z.default=B},"./src/demux/mpegaudio.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"appendFrame",function(){return L}),M.d(Z,"parseHeader",function(){return P}),M.d(Z,"isHeaderPattern",function(){return b}),M.d(Z,"isHeader",function(){return p}),M.d(Z,"canParse",function(){return _}),M.d(Z,"probe",function(){return h});var V=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],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function L(r,d,l,a,u){if(l+24>d.length)return;var c=P(d,l);if(c&&l+c.frameLength<=d.length){var R=c.samplesPerFrame*9e4/c.sampleRate,O=a+u*R,T={unit:d.subarray(l,l+c.frameLength),pts:O,dts:O};return r.config=[],r.channelCount=c.channelCount,r.samplerate=c.sampleRate,r.samples.push(T),{sample:T,length:c.frameLength,missing:0}}}function P(r,d){var l=r[d+1]>>3&3,a=r[d+1]>>1&3,u=r[d+2]>>4&15,c=r[d+2]>>2&3;if(l!==1&&u!==0&&u!==15&&c!==3){var R=r[d+2]>>1&1,O=r[d+3]>>6,T=l===3?3-a:a===3?3:4,A=I[T*14+u-1]*1e3,w=l===3?0:l===2?1:2,m=B[w*3+c],v=O===3?1:2,s=K[l][a],o=W[a],E=s*8*o,g=Math.floor(s*A/m+R)*o;if(V===null){var C=navigator.userAgent||"",N=C.match(/Chrome\/(\d+)/i);V=N?parseInt(N[1]):0}var U=!!V&&V<=87;return U&&a===2&&A>=224e3&&O===0&&(r[d+3]=r[d+3]|128),{sampleRate:m,channelCount:v,frameLength:g,samplesPerFrame:E}}}function b(r,d){return r[d]===255&&(r[d+1]&224)===224&&(r[d+1]&6)!==0}function p(r,d){return d+1<r.length&&b(r,d)}function _(r,d){var l=4;return b(r,d)&&l<=r.length-d}function h(r,d){if(d+1<r.length&&b(r,d)){var l=4,a=P(r,d),u=l;a!=null&&a.frameLength&&(u=a.frameLength);var c=d+u;return c===r.length||p(r,c)}return!1}},"./src/demux/sample-aes.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/crypt/decrypter.ts"),I=M("./src/demux/tsdemuxer.ts"),B=function(){function K(L,P,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new V.default(L,P,{removePKCS7Padding:!1})}var W=K.prototype;return W.decryptBuffer=function(P,b){this.decrypter.decrypt(P,this.keyData.key.buffer,this.keyData.iv.buffer,b)},W.decryptAacSample=function(P,b,p,_){var h=P[b].unit,r=h.subarray(16,h.length-h.length%16),d=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),l=this;this.decryptBuffer(d,function(a){var u=new Uint8Array(a);h.set(u,16),_||l.decryptAacSamples(P,b+1,p)})},W.decryptAacSamples=function(P,b,p){for(;;b++){if(b>=P.length){p();return}if(P[b].unit.length<32)continue;var _=this.decrypter.isSync();if(this.decryptAacSample(P,b,p,_),!_)return}},W.getAvcEncryptedData=function(P){for(var b=Math.floor((P.length-48)/160)*16+16,p=new Int8Array(b),_=0,h=32;h<=P.length-16;h+=160,_+=16)p.set(P.subarray(h,h+16),_);return p},W.getAvcDecryptedUnit=function(P,b){for(var p=new Uint8Array(b),_=0,h=32;h<=P.length-16;h+=160,_+=16)P.set(p.subarray(_,_+16),h);return P},W.decryptAvcSample=function(P,b,p,_,h,r){var d=Object(I.discardEPB)(h.data),l=this.getAvcEncryptedData(d),a=this;this.decryptBuffer(l.buffer,function(u){h.data=a.getAvcDecryptedUnit(d,u),r||a.decryptAvcSamples(P,b,p+1,_)})},W.decryptAvcSamples=function(P,b,p,_){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,p=0){if(b>=P.length){_();return}for(var h=P[b].units;!(p>=h.length);p++){var r=h[p];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(P,b,p,_,r,d),!d)return}}},K}();Z.default=B},"./src/demux/transmuxer-interface.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h});var V=M("./node_modules/webworkify-webpack/index.js"),I=M.n(V),B=M("./src/events.ts"),K=M("./src/demux/transmuxer.ts"),W=M("./src/utils/logger.ts"),L=M("./src/errors.ts"),P=M("./src/utils/mediasource-helper.ts"),b=M("./node_modules/eventemitter3/index.js"),p=M.n(b),_=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function r(l,a,u,c){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=a,this.onTransmuxComplete=u,this.onFlush=c;var O=l.config,T=function(s,o){o=o||{},o.frag=R.frag,o.id=R.id,l.trigger(s,o)};this.observer=new b.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,T),this.observer.on(B.Events.ERROR,T);var A={mp4:_.isTypeSupported("video/mp4"),mpeg:_.isTypeSupported("audio/mpeg"),mp3:_.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(O.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var m;try{m=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(v){l.trigger(B.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},m.postMessage({cmd:"init",typeSupported:A,vendor:w,id:a,config:JSON.stringify(O)})}catch(v){W.logger.warn("Error in worker:",v),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new K.default(this.observer,A,O,w,a),this.worker=null}}else this.transmuxer=new K.default(this.observer,A,O,w,a)}var d=r.prototype;return d.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var c=this.observer;c&&c.removeAllListeners(),this.observer=null},d.push=function(a,u,c,R,O,T,A,w,m,v){var s=this;m.transmuxing.start=self.performance.now();var o=this.transmuxer,E=this.worker,g=T?T.start:O.start,C=O.decryptdata,N=this.frag,U=!(N&&O.cc===N.cc),j=!(N&&m.level===N.level),H=N?m.sn-N.sn:-1,y=this.part?m.part-this.part.index:1,x=!j&&(H===1||H===0&&y===1),F=self.performance.now();(j||H||O.stats.parsing.start===0)&&(O.stats.parsing.start=F),T&&(y||!x)&&(T.stats.parsing.start=F);var Q=new K.TransmuxState(U,x,w,j,g);if(!x||U){W.logger.log("[transmuxer-interface, "+O.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+`
discontinuity: `+U+`
trackSwitch: `+j+`
contiguous: `+x+`
accurateTimeOffset: `+w+`
timeOffset: `+g);var q=new K.TransmuxConfig(c,R,u,A,v);this.configureTransmuxer(q)}if(this.frag=O,this.part=T,E)E.postMessage({cmd:"demux",data:a,decryptdata:C,chunkMeta:m,state:Q},a instanceof ArrayBuffer?[a]:[]);else if(o){var ie=o.push(a,C,m,Q);Object(K.isPromise)(ie)?ie.then(function(ge){s.handleTransmuxComplete(ge)}):this.handleTransmuxComplete(ie)}},d.flush=function(a){var u=this;a.transmuxing.start=self.performance.now();var c=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:a});else if(c){var O=c.flush(a);Object(K.isPromise)(O)?O.then(function(T){u.handleFlushResult(T,a)}):this.handleFlushResult(O,a)}},d.handleFlushResult=function(a,u){var c=this;a.forEach(function(R){c.handleTransmuxComplete(R)}),this.onFlush(u)},d.onWorkerMessage=function(a){var u=a.data,c=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,c.trigger(u.event,u.data);break}}},d.configureTransmuxer=function(a){var u=this.worker,c=this.transmuxer;u?u.postMessage({cmd:"configure",config:a}):c&&c.configure(a)},d.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},r}()},"./src/demux/transmuxer-worker.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return L});var V=M("./src/demux/transmuxer.ts"),I=M("./src/events.ts"),B=M("./src/utils/logger.ts"),K=M("./node_modules/eventemitter3/index.js"),W=M.n(K);function L(h){var r=new K.EventEmitter,d=function(a,u){h.postMessage({event:a,data:u})};r.on(I.Events.FRAG_DECRYPTED,d),r.on(I.Events.ERROR,d),h.addEventListener("message",function(l){var a=l.data;switch(a.cmd){case"init":{var u=JSON.parse(a.config);h.transmuxer=new V.default(r,a.typeSupported,u,a.vendor,a.id),Object(B.enableLogs)(u.debug),d("init",null);break}case"configure":{h.transmuxer.configure(a.config);break}case"demux":{var c=h.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(V.isPromise)(c)?c.then(function(T){P(h,T)}):P(h,c);break}case"flush":{var R=a.chunkMeta,O=h.transmuxer.flush(R);Object(V.isPromise)(O)?O.then(function(T){p(h,T,R)}):p(h,O,R);break}default:break}})}function P(h,r){if(_(r.remuxResult))return;var d=[],l=r.remuxResult,a=l.audio,u=l.video;a&&b(d,a),u&&b(d,u),h.postMessage({event:"transmuxComplete",data:r},d)}function b(h,r){r.data1&&h.push(r.data1.buffer),r.data2&&h.push(r.data2.buffer)}function p(h,r,d){r.forEach(function(l){P(h,l)}),h.postMessage({event:"flush",data:d})}function _(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return u}),M.d(Z,"isPromise",function(){return O}),M.d(Z,"TransmuxConfig",function(){return T}),M.d(Z,"TransmuxState",function(){return A});var V=M("./src/events.ts"),I=M("./src/errors.ts"),B=M("./src/crypt/decrypter.ts"),K=M("./src/demux/aacdemuxer.ts"),W=M("./src/demux/mp4demuxer.ts"),L=M("./src/demux/tsdemuxer.ts"),P=M("./src/demux/mp3demuxer.ts"),b=M("./src/remux/mp4-remuxer.ts"),p=M("./src/remux/passthrough-remuxer.ts"),_=M("./src/demux/chunk-cache.ts"),h=M("./src/utils/mp4-tools.ts"),r=M("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(w){r.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var l=[{demux:L.default,remux:b.default},{demux:W.default,remux:p.default},{demux:K.default,remux:b.default},{demux:P.default,remux:b.default}],a=1024;l.forEach(function(w){var m=w.demux;a=Math.max(a,m.minProbeByteLength)});var u=function(){function w(v,s,o,E,g){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 _.default,this.observer=v,this.typeSupported=s,this.config=o,this.vendor=E,this.id=g}var m=w.prototype;return m.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},m.push=function(s,o,E,g){var C=this,N=E.transmuxing;N.executeStart=d();var U=new Uint8Array(s),j=this.cache,H=this.config,y=this.currentTransmuxState,x=this.transmuxConfig;g&&(this.currentTransmuxState=g);var F=c(U,o);if(F&&F.method==="AES-128"){var Q=this.getDecrypter();if(H.enableSoftwareAES){var q=Q.softwareDecrypt(U,F.key.buffer,F.iv.buffer);if(!q)return N.executeEnd=d(),R(E);U=new Uint8Array(q)}else return this.decryptionPromise=Q.webCryptoDecrypt(U,F.key.buffer,F.iv.buffer).then(function(Be){var Je=C.push(Be,null,E);return C.decryptionPromise=null,Je}),this.decryptionPromise}var ie=g||y,ge=ie.contiguous,fe=ie.discontinuity,ue=ie.trackSwitch,he=ie.accurateTimeOffset,_e=ie.timeOffset,le=x.audioCodec,ne=x.videoCodec,Te=x.defaultInitPts,Fe=x.duration,Ke=x.initSegmentData;if((fe||ue)&&this.resetInitSegment(Ke,le,ne,Fe),fe&&this.resetInitialTimestamp(Te),ge||this.resetContiguity(),this.needsProbing(U,fe,ue)){if(j.dataLength){var Ue=j.flush();U=Object(h.appendUint8Array)(Ue,U)}this.configureTransmuxer(U,x)}var He=this.transmux(U,F,_e,he,E),Ne=this.currentTransmuxState;return Ne.contiguous=!0,Ne.discontinuity=!1,Ne.trackSwitch=!1,N.executeEnd=d(),He},m.flush=function(s){var o=this,E=s.transmuxing;E.executeStart=d();var g=this.decrypter,C=this.cache,N=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return o.flush(s)});var j=[],H=N.timeOffset;if(g){var y=g.flush();y&&j.push(this.push(y,null,s))}var x=C.dataLength;C.reset();var F=this.demuxer,Q=this.remuxer;if(!F||!Q)return x>=a&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=d(),[R(s)];var q=F.flush(H);return O(q)?q.then(function(ie){return o.flushRemux(j,ie,s),j}):(this.flushRemux(j,q,s),j)},m.flushRemux=function(s,o,E){var g=o.audioTrack,C=o.avcTrack,N=o.id3Track,U=o.textTrack,j=this.currentTransmuxState,H=j.accurateTimeOffset,y=j.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var x=this.remuxer.remux(g,C,N,U,y,H,!0,this.id);s.push({remuxResult:x,chunkMeta:E}),E.transmuxing.executeEnd=d()},m.resetInitialTimestamp=function(s){var o=this.demuxer,E=this.remuxer;if(!o||!E)return;o.resetTimeStamp(s),E.resetTimeStamp(s)},m.resetContiguity=function(){var s=this.demuxer,o=this.remuxer;if(!s||!o)return;s.resetContiguity(),o.resetNextTimestamp()},m.resetInitSegment=function(s,o,E,g){var C=this.demuxer,N=this.remuxer;if(!C||!N)return;C.resetInitSegment(o,E,g),N.resetInitSegment(s,o,E)},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(s,o,E,g,C){var N;return o&&o.method==="SAMPLE-AES"?N=this.transmuxSampleAes(s,o,E,g,C):N=this.transmuxUnencrypted(s,E,g,C),N},m.transmuxUnencrypted=function(s,o,E,g){var C=this.demuxer.demux(s,o,!1,!this.config.progressive),N=C.audioTrack,U=C.avcTrack,j=C.id3Track,H=C.textTrack,y=this.remuxer.remux(N,U,j,H,o,E,!1,this.id);return{remuxResult:y,chunkMeta:g}},m.transmuxSampleAes=function(s,o,E,g,C){var N=this;return this.demuxer.demuxSampleAes(s,o,E).then(function(U){var j=N.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,E,g,!1,N.id);return{remuxResult:j,chunkMeta:C}})},m.configureTransmuxer=function(s,o){for(var E=this.config,g=this.observer,C=this.typeSupported,N=this.vendor,U=o.audioCodec,j=o.defaultInitPts,H=o.duration,y=o.initSegmentData,x=o.videoCodec,F,Q=0,q=l.length;Q<q;Q++)if(l[Q].demux.probe(s)){F=l[Q];break}F||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),F={demux:W.default,remux:p.default});var ie=this.demuxer,ge=this.remuxer,fe=F.remux,ue=F.demux;(!ge||!(ge instanceof fe))&&(this.remuxer=new fe(g,E,C,N)),(!ie||!(ie instanceof ue))&&(this.demuxer=new ue(g,E,C),this.probe=ue.probe),this.resetInitSegment(y,U,x,H),this.resetInitialTimestamp(j)},m.needsProbing=function(s,o,E){return!this.demuxer||!this.remuxer||o||E},m.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new B.default(this.observer,this.config)),s},w}();function c(w,m){var v=null;return w.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(v=m),v}var R=function(m){return{remuxResult:{},chunkMeta:m}};function O(w){return"then"in w&&w.then instanceof Function}var T=function(m,v,s,o,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=v,this.initSegmentData=s,this.duration=o,this.defaultInitPts=E},A=function(m,v,s,o,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=m,this.contiguous=v,this.accurateTimeOffset=s,this.trackSwitch=o,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"discardEPB",function(){return R});var V=M("./src/demux/adts.ts"),I=M("./src/demux/mpegaudio.ts"),B=M("./src/demux/exp-golomb.ts"),K=M("./src/demux/id3.ts"),W=M("./src/demux/sample-aes.ts"),L=M("./src/events.ts"),P=M("./src/utils/mp4-tools.ts"),b=M("./src/utils/logger.ts"),p=M("./src/errors.ts"),_={video:1,audio:2,id3:3,text:4},h=function(){function O(A,w,m){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=A,this.config=w,this.typeSupported=m}O.probe=function(w){var m=O.syncOffset(w);return m<0?!1:(m&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},O.syncOffset=function(w){for(var m=Math.min(1e3,w.length-3*188),v=0;v<m;){if(w[v]===71&&w[v+188]===71&&w[v+2*188]===71)return v;v++}return-1},O.createTrack=function(w,m){return{container:w==="video"||w==="audio"?"video/mp2t":void 0,type:w,id:_[w],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:w==="audio"?m:void 0}};var T=O.prototype;return T.resetInitSegment=function(w,m,v){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=O.createTrack("video",v),this._audioTrack=O.createTrack("audio",v),this._id3Track=O.createTrack("id3",v),this._txtTrack=O.createTrack("text",v),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=w,this.videoCodec=m,this._duration=v},T.resetTimeStamp=function(){},T.resetContiguity=function(){var w=this._audioTrack,m=this._avcTrack,v=this._id3Track;w&&(w.pesData=null),m&&(m.pesData=null),v&&(v.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(w,m,v,s){v===void 0&&(v=!1),s===void 0&&(s=!1),v||(this.sampleAes=null);var o,E=this._avcTrack,g=this._audioTrack,C=this._id3Track,N=E.pid,U=E.pesData,j=g.pid,H=C.pid,y=g.pesData,x=C.pesData,F=!1,Q=this.pmtParsed,q=this._pmtId,ie=w.length;if(this.remainderData&&(w=Object(P.appendUint8Array)(this.remainderData,w),ie=w.length,this.remainderData=null),ie<188&&!s)return this.remainderData=w,{audioTrack:g,avcTrack:E,id3Track:C,textTrack:this._txtTrack};var ge=Math.max(0,O.syncOffset(w));ie-=(ie+ge)%188,ie<w.byteLength&&!s&&(this.remainderData=new Uint8Array(w.buffer,ie,w.buffer.byteLength-ie));for(var fe=ge;fe<ie;fe+=188)if(w[fe]===71){var ue=!!(w[fe+1]&64),he=((w[fe+1]&31)<<8)+w[fe+2],_e=(w[fe+3]&48)>>4,le=void 0;if(_e>1){if(le=fe+5+w[fe+4],le===fe+188)continue}else le=fe+4;switch(he){case N:ue&&(U&&(o=a(U))&&this.parseAVCPES(o,!1),U={data:[],size:0}),U&&(U.data.push(w.subarray(le,fe+188)),U.size+=fe+188-le);break;case j:ue&&(y&&(o=a(y))&&(g.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),y={data:[],size:0}),y&&(y.data.push(w.subarray(le,fe+188)),y.size+=fe+188-le);break;case H:ue&&(x&&(o=a(x))&&this.parseID3PES(o),x={data:[],size:0}),x&&(x.data.push(w.subarray(le,fe+188)),x.size+=fe+188-le);break;case 0:ue&&(le+=w[le]+1),q=this._pmtId=d(w,le);break;case q:{ue&&(le+=w[le]+1);var ne=l(w,le,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);N=ne.avc,N>0&&(E.pid=N),j=ne.audio,j>0&&(g.pid=j,g.isAAC=ne.isAAC),H=ne.id3,H>0&&(C.pid=H),F&&!Q&&(b.logger.log("reparse from beginning"),F=!1,fe=ge-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:F=!0;break}}else this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=U,g.pesData=y,C.pesData=x;var Te={audioTrack:g,avcTrack:E,id3Track:C,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(Te),Te},T.flush=function(){var w=this.remainderData;this.remainderData=null;var m;return w?m=this.demux(w,-1,!1,!0):m={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(m),this.sampleAes?this.decrypt(m,this.sampleAes):m},T.extractRemainingSamples=function(w){var m=w.audioTrack,v=w.avcTrack,s=w.id3Track,o=v.pesData,E=m.pesData,g=s.pesData,C;o&&(C=a(o))?(this.parseAVCPES(C,!0),v.pesData=null):v.pesData=o,E&&(C=a(E))?(m.isAAC?this.parseAACPES(C):this.parseMPEGPES(C),m.pesData=null):(E!=null&&E.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=E),g&&(C=a(g))?(this.parseID3PES(C),s.pesData=null):s.pesData=g},T.demuxSampleAes=function(w,m,v){var s=this.demux(w,v,!0,!this.config.progressive),o=this.sampleAes=new W.default(this.observer,this.config,m);return this.decrypt(s,o)},T.decrypt=function(w,m){return new Promise(function(v){var s=w.audioTrack,o=w.avcTrack;s.samples&&s.isAAC?m.decryptAacSamples(s.samples,0,function(){o.samples?m.decryptAvcSamples(o.samples,0,0,function(){v(w)}):v(w)}):o.samples&&m.decryptAvcSamples(o.samples,0,0,function(){v(w)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(w,m){var v=this,s=this._avcTrack,o=this.parseAVCNALu(w.data),E=!1,g=this.avcSample,C,N=!1;w.data=null,g&&o.length&&!s.audFound&&(u(g,s),g=this.avcSample=r(!1,w.pts,w.dts,"")),o.forEach(function(U){switch(U.type){case 1:{C=!0,g||(g=v.avcSample=r(!0,w.pts,w.dts,"")),E&&(g.debug+="NDR "),g.frame=!0;var j=U.data;if(N&&j.length>4){var H=new B.default(j).readSliceType();(H===2||H===4||H===7||H===9)&&(g.key=!0)}break}case 5:C=!0,g||(g=v.avcSample=r(!0,w.pts,w.dts,"")),E&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{C=!0,E&&g&&(g.debug+="SEI ");var y=new B.default(R(U.data));y.readUByte();for(var x=0,F=0,Q=!1,q=0;!Q&&y.bytesAvailable>1;){x=0;do q=y.readUByte(),x+=q;while(q===255);F=0;do q=y.readUByte(),F+=q;while(q===255);if(x===4&&y.bytesAvailable!==0){Q=!0;var ie=y.readUByte();if(ie===181){var ge=y.readUShort();if(ge===49){var fe=y.readUInt();if(fe===1195456820){var ue=y.readUByte();if(ue===3){for(var he=y.readUByte(),_e=y.readUByte(),le=31&he,ne=[he,_e],Te=0;Te<le;Te++)ne.push(y.readUByte()),ne.push(y.readUByte()),ne.push(y.readUByte());c(v._txtTrack.samples,{type:3,pts:w.pts,bytes:ne})}}}}}else if(x===5&&y.bytesAvailable!==0){if(Q=!0,F>16){for(var Fe=[],Ke=0;Ke<16;Ke++)Fe.push(y.readUByte().toString(16)),(Ke===3||Ke===5||Ke===7||Ke===9)&&Fe.push("-");for(var Ue=F-16,He=new Uint8Array(Ue),Ne=0;Ne<Ue;Ne++)He[Ne]=y.readUByte();c(v._txtTrack.samples,{pts:w.pts,payloadType:x,uuid:Fe.join(""),userData:Object(K.utf8ArrayToStr)(He),userDataBytes:He})}}else if(F<y.bytesAvailable)for(var Be=0;Be<F;Be++)y.readUByte()}break}case 7:if(C=!0,N=!0,E&&g&&(g.debug+="SPS "),!s.sps){var Je=new B.default(U.data),tt=Je.readSPS();s.width=tt.width,s.height=tt.height,s.pixelRatio=tt.pixelRatio,s.sps=[U.data],s.duration=v._duration;for(var it=U.data.subarray(1,4),rt="avc1.",qe=0;qe<3;qe++){var gt=it[qe].toString(16);gt.length<2&&(gt="0"+gt),rt+=gt}s.codec=rt}break;case 8:C=!0,E&&g&&(g.debug+="PPS "),s.pps||(s.pps=[U.data]);break;case 9:C=!1,s.audFound=!0,g&&u(g,s),g=v.avcSample=r(!1,w.pts,w.dts,E?"AUD ":"");break;case 12:C=!1;break;default:C=!1,g&&(g.debug+="unknown NAL "+U.type+" ");break}if(g&&C){var pt=g.units;pt.push(U)}}),m&&g&&(u(g,s),this.avcSample=null)},T.getLastNalUnit=function(){var w,m=this.avcSample,v;if(!m||m.units.length===0){var s=this._avcTrack.samples;m=s[s.length-1]}if((w=m)!==null&&w!==void 0&&w.units){var o=m.units;v=o[o.length-1]}return v},T.parseAVCNALu=function(w){var m=w.byteLength,v=this._avcTrack,s=v.naluState||0,o=s,E=[],g=0,C,N,U,j=-1,H=0;for(s===-1&&(j=0,H=w[0]&31,s=0,g=1);g<m;){if(C=w[g++],!s){s=C?0:1;continue}if(s===1){s=C?0:2;continue}if(!C)s=3;else if(C===1){if(j>=0){var y={data:w.subarray(j,g-s-1),type:H};E.push(y)}else{var x=this.getLastNalUnit();if(x&&(o&&g<=4-o&&(x.state&&(x.data=x.data.subarray(0,x.data.byteLength-o))),N=g-s-1,N>0)){var F=new Uint8Array(x.data.byteLength+N);F.set(x.data,0),F.set(w.subarray(0,N),x.data.byteLength),x.data=F,x.state=0}}g<m?(U=w[g]&31,j=g,H=U,s=0):s=-1}else s=0}if(j>=0&&s>=0){var Q={data:w.subarray(j,m),type:H,state:s};E.push(Q)}if(E.length===0){var q=this.getLastNalUnit();if(q){var ie=new Uint8Array(q.data.byteLength+w.byteLength);ie.set(q.data,0),ie.set(w,q.data.byteLength),q.data=ie}}return v.naluState=s,E},T.parseAACPES=function(w){var m=0,v=this._audioTrack,s=this.aacOverFlow,o=w.data;if(s){this.aacOverFlow=null;var E=s.sample.unit.byteLength,g=Math.min(s.missing,E),C=E-g;s.sample.unit.set(o.subarray(0,g),C),v.samples.push(s.sample),m=s.missing}var N,U;for(N=m,U=o.length;N<U-1&&!V.isHeader(o,N);N++);if(N!==m){var j,H;if(N<U-1?(j="AAC PES did not start with ADTS header,offset:"+N,H=!1):(j="no ADTS header found in AAC PES",H=!0),b.logger.warn("parsing error:"+j),this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:j}),H)return}V.initTrackConfig(v,this.observer,o,N,this.audioCodec);var y;if(w.pts!==void 0)y=w.pts;else if(s){var x=V.getFrameDuration(v.samplerate);y=s.sample.pts+x}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var F=0;N<U;)if(V.isHeader(o,N)){if(N+5<U){var Q=V.appendFrame(v,o,N,y,F);if(Q)if(Q.missing)this.aacOverFlow=Q;else{N+=Q.length,F++;continue}}break}else N++},T.parseMPEGPES=function(w){var m=w.data,v=m.length,s=0,o=0,E=w.pts;if(E===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<v;)if(I.isHeader(m,o)){var g=I.appendFrame(this._audioTrack,m,o,E,s);if(g)o+=g.length,s++;else break}else o++},T.parseID3PES=function(w){if(w.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(w)},O}();h.minProbeByteLength=188;function r(O,T,A,w){return{key:O,frame:!1,pts:T,dts:A,units:[],debug:w,length:0}}function d(O,T){return(O[T+10]&31)<<8|O[T+11]}function l(O,T,A,w){var m={audio:-1,avc:-1,id3:-1,isAAC:!0},v=(O[T+1]&15)<<8|O[T+2],s=T+3+v-4,o=(O[T+10]&15)<<8|O[T+11];for(T+=12+o;T<s;){var E=(O[T+1]&31)<<8|O[T+2];switch(O[T]){case 207:if(!w){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:m.audio===-1&&(m.audio=E);break;case 21:m.id3===-1&&(m.id3=E);break;case 219:if(!w){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:m.avc===-1&&(m.avc=E);break;case 3:case 4:A?m.audio===-1&&(m.audio=E,m.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((O[T+3]&15)<<8|O[T+4])+5}return m}function a(O){var T=0,A,w,m,v,s,o=O.data;if(!O||O.size===0)return null;for(;o[0].length<19&&o.length>1;){var E=new Uint8Array(o[0].length+o[1].length);E.set(o[0]),E.set(o[1],o[0].length),o[0]=E,o.splice(1,1)}A=o[0];var g=(A[0]<<16)+(A[1]<<8)+A[2];if(g===1){if(w=(A[4]<<8)+A[5],w&&w>O.size-6)return null;var C=A[7];C&192&&(v=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,C&64?(s=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,v-s>60*9e4&&(b.logger.warn(Math.round((v-s)/9e4)+"s delta between PTS and DTS, align them"),v=s)):s=v),m=A[8];var N=m+9;if(O.size<=N)return null;O.size-=N;for(var U=new Uint8Array(O.size),j=0,H=o.length;j<H;j++){A=o[j];var y=A.byteLength;if(N)if(N>y){N-=y;continue}else A=A.subarray(N),y-=N,N=0;U.set(A,T),T+=y}return w&&(w-=m+3),{data:U,pts:v,dts:s,len:w}}return null}function u(O,T){if(O.units.length&&O.frame){if(O.pts===void 0){var A=T.samples,w=A.length;if(w){var m=A[w-1];O.pts=m.pts,O.dts=m.dts}else{T.dropped++;return}}T.samples.push(O)}O.debug.length&&b.logger.log(O.pts+"/"+O.dts+":"+O.debug)}function c(O,T){var A=O.length;if(A>0){if(T.pts>=O[A-1].pts)O.push(T);else for(var w=A-1;w>=0;w--)if(T.pts<O[w].pts){O.splice(w,0,T);break}}else O.push(T)}function R(O){for(var T=O.byteLength,A=[],w=1;w<T-2;)O[w]===0&&O[w+1]===0&&O[w+2]===3?(A.push(w+2),w+=2):w++;if(A.length===0)return O;var m=T-A.length,v=new Uint8Array(m),s=0;for(w=0;w<m;s++,w++)s===A[0]&&(s++,A.shift()),v[w]=O[s];return v}Z.default=h},"./src/errors.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"ErrorTypes",function(){return V}),M.d(Z,"ErrorDetails",function(){return I});var V;(function(B){B.NETWORK_ERROR="networkError",B.MEDIA_ERROR="mediaError",B.KEY_SYSTEM_ERROR="keySystemError",B.MUX_ERROR="muxError",B.OTHER_ERROR="otherError"})(V||(V={}));var I;(function(B){B.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",B.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",B.KEY_SYSTEM_NO_SESSION="keySystemNoSession",B.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",B.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",B.MANIFEST_LOAD_ERROR="manifestLoadError",B.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",B.MANIFEST_PARSING_ERROR="manifestParsingError",B.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",B.LEVEL_EMPTY_ERROR="levelEmptyError",B.LEVEL_LOAD_ERROR="levelLoadError",B.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",B.LEVEL_SWITCH_ERROR="levelSwitchError",B.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",B.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",B.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",B.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",B.FRAG_LOAD_ERROR="fragLoadError",B.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",B.FRAG_DECRYPT_ERROR="fragDecryptError",B.FRAG_PARSING_ERROR="fragParsingError",B.REMUX_ALLOC_ERROR="remuxAllocError",B.KEY_LOAD_ERROR="keyLoadError",B.KEY_LOAD_TIMEOUT="keyLoadTimeOut",B.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",B.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",B.BUFFER_APPEND_ERROR="bufferAppendError",B.BUFFER_APPENDING_ERROR="bufferAppendingError",B.BUFFER_STALLED_ERROR="bufferStalledError",B.BUFFER_FULL_ERROR="bufferFullError",B.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",B.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",B.INTERNAL_EXCEPTION="internalException",B.INTERNAL_ABORTED="aborted",B.UNKNOWN="unknown"})(I||(I={}))},"./src/events.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"Events",function(){return V});var V;(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"})(V||(V={}))},"./src/hls.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return O});var V=M("./node_modules/url-toolkit/src/url-toolkit.js"),I=M.n(V),B=M("./src/loader/playlist-loader.ts"),K=M("./src/loader/key-loader.ts"),W=M("./src/controller/id3-track-controller.ts"),L=M("./src/controller/latency-controller.ts"),P=M("./src/controller/level-controller.ts"),b=M("./src/controller/fragment-tracker.ts"),p=M("./src/controller/stream-controller.ts"),_=M("./src/is-supported.ts"),h=M("./src/utils/logger.ts"),r=M("./src/config.ts"),d=M("./node_modules/eventemitter3/index.js"),l=M.n(d),a=M("./src/events.ts"),u=M("./src/errors.ts");function c(T,A){for(var w=0;w<A.length;w++){var m=A[w];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}function R(T,A,w){return A&&c(T.prototype,A),w&&c(T,w),T}var O=function(){T.isSupported=function(){return Object(_.isSupported)()};function T(w){w===void 0&&(w={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var m=this.config=Object(r.mergeConfig)(T.DefaultConfig,w);this.userConfig=w,Object(h.enableLogs)(m.debug),this._autoLevelCapping=-1,m.progressive&&Object(r.enableStreamingMode)(m);var v=m.abrController,s=m.bufferController,o=m.capLevelController,E=m.fpsController,g=this.abrController=new v(this),C=this.bufferController=new s(this),N=this.capLevelController=new o(this),U=new E(this),j=new B.default(this),H=new K.default(this),y=new W.default(this),x=this.levelController=new P.default(this),F=new b.FragmentTracker(this),Q=this.streamController=new p.default(this,F);N.setStreamController(Q),U.setStreamController(Q);var q=[x,Q];this.networkControllers=q;var ie=[j,H,g,C,N,U,y,F];this.audioTrackController=this.createController(m.audioTrackController,null,q),this.createController(m.audioStreamController,F,q),this.subtitleTrackController=this.createController(m.subtitleTrackController,null,q),this.createController(m.subtitleStreamController,F,q),this.createController(m.timelineController,null,ie),this.emeController=this.createController(m.emeController,null,ie),this.cmcdController=this.createController(m.cmcdController,null,ie),this.latencyController=this.createController(L.default,null,ie),this.coreComponents=ie}var A=T.prototype;return A.createController=function(m,v,s){if(m){var o=v?new m(this,v):new m(this);return s&&s.push(o),o}return null},A.on=function(m,v,s){s===void 0&&(s=this),this._emitter.on(m,v,s)},A.once=function(m,v,s){s===void 0&&(s=this),this._emitter.once(m,v,s)},A.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},A.off=function(m,v,s,o){s===void 0&&(s=this),this._emitter.off(m,v,s,o)},A.listeners=function(m){return this._emitter.listeners(m)},A.emit=function(m,v,s){return this._emitter.emit(m,v,s)},A.trigger=function(m,v){if(this.config.debug)return this.emit(m,m,v);try{return this.emit(m,m,v)}catch(s){h.logger.error("An internal error happened while handling event "+m+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(a.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:s})}return!1},A.listenerCount=function(m){return this._emitter.listenerCount(m)},A.destroy=function(){h.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},A.attachMedia=function(m){h.logger.log("attachMedia"),this._media=m,this.trigger(a.Events.MEDIA_ATTACHING,{media:m})},A.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(m){this.stopLoad();var v=this.media,s=this.url,o=this.url=V.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});h.logger.log("loadSource:"+o),v&&s&&s!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(v)),this.trigger(a.Events.MANIFEST_LOADING,{url:m})},A.startLoad=function(m){m===void 0&&(m=-1),h.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(v){v.startLoad(m)})},A.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},A.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){h.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},A.removeLevel=function(m,v){v===void 0&&(v=0),this.levelController.removeLevel(m,v)},R(T,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){h.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){h.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){h.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){h.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){h.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var v=!!m;v!==this.config.capLevelToPlayerSize&&(v?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=v)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(h.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,v=this.config.minAutoBitrate;if(!m)return 0;for(var s=m.length,o=0;o<s;o++)if(m[o].maxBitrate>v)return o;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,v=this.autoLevelCapping,s;return v===-1&&m&&m.length?s=m.length-1:s=v,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var v=this.audioTrackController;v&&(v.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{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 a.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:r.hlsDefaultConfig},set:function(m){T.defaultConfig=m}}]),T}();O.defaultConfig=void 0},"./src/is-supported.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"isSupported",function(){return B}),M.d(Z,"changeTypeSupported",function(){return K});var V=M("./src/utils/mediasource-helper.ts");function I(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var W=Object(V.getMediaSource)();if(!W)return!1;var L=I(),P=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!L||L.prototype&&typeof L.prototype.appendBuffer=="function"&&typeof L.prototype.remove=="function";return!!P&&!!b}function K(){var W,L=I();return typeof(L==null||((W=L.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h}),M.d(Z,"LoadError",function(){return d});var V=M("./src/polyfills/number.ts"),I=M("./src/errors.ts");function B(l,a){l.prototype=Object.create(a.prototype),l.prototype.constructor=l,b(l,a)}function K(l){var a=typeof Map=="function"?new Map:void 0;return K=function(c){if(c===null||!P(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(c))return a.get(c);a.set(c,R)}function R(){return W(c,arguments,p(this).constructor)}return R.prototype=Object.create(c.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),b(R,c)},K(l)}function W(l,a,u){return L()?W=Reflect.construct:W=function(R,O,T){var A=[null];A.push.apply(A,O);var w=Function.bind.apply(R,A),m=new w;return T&&b(m,T.prototype),m},W.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function P(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function b(l,a){return b=Object.setPrototypeOf||function(c,R){return c.__proto__=R,c},b(l,a)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},p(l)}var _=Math.pow(2,17),h=function(){function l(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var a=l.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(c,R){var O=this,T=c.url;if(!T)return Promise.reject(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var A=this.config,w=A.fLoader,m=A.loader;return new Promise(function(v,s){O.loader&&O.loader.destroy();var o=O.loader=c.loader=w?new w(A):new m(A),E=r(c),g={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:_};c.stats=o.stats,o.load(E,g,{onSuccess:function(N,U,j,H){O.resetLoader(c,o),v({frag:c,part:null,payload:N.data,networkDetails:H})},onError:function(N,U,j){O.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:N,networkDetails:j}))},onAbort:function(N,U,j){O.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:j}))},onTimeout:function(N,U,j){O.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:j}))},onProgress:function(N,U,j,H){R&&R({frag:c,part:null,payload:j,networkDetails:H})}})})},a.loadPart=function(c,R,O){var T=this;this.abort();var A=this.config,w=A.fLoader,m=A.loader;return new Promise(function(v,s){T.loader&&T.loader.destroy();var o=T.loader=c.loader=w?new w(A):new m(A),E=r(c,R),g={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:_};R.stats=o.stats,o.load(E,g,{onSuccess:function(N,U,j,H){T.resetLoader(c,o),T.updateStatsFromPart(c,R);var y={frag:c,part:R,payload:N.data,networkDetails:H};O(y),v(y)},onError:function(N,U,j){T.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:R,response:N,networkDetails:j}))},onAbort:function(N,U,j){c.stats.aborted=R.stats.aborted,T.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:R,networkDetails:j}))},onTimeout:function(N,U,j){T.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:R,networkDetails:j}))}})})},a.updateStatsFromPart=function(c,R){var O=c.stats,T=R.stats,A=T.total;if(O.loaded+=T.loaded,A){var w=Math.round(c.duration/R.duration),m=Math.min(Math.round(O.loaded/A),w),v=w-m,s=v*Math.round(O.loaded/m);O.total=O.loaded+s}else O.total=Math.max(O.loaded,O.total);var o=O.loading,E=T.loading;o.start?o.first+=E.first-E.start:(o.start=E.start,o.first=E.first),o.end=E.end},a.resetLoader=function(c,R){c.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},l}();function r(l,a){a===void 0&&(a=null);var u=a||l,c={frag:l,part:a,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},R=u.byteRangeStartOffset,O=u.byteRangeEndOffset;return Object(V.isFiniteNumber)(R)&&Object(V.isFiniteNumber)(O)&&(c.rangeStart=R,c.rangeEnd=O),c}var d=function(l){B(a,l);function a(u){for(var c,R=arguments.length,O=new Array(R>1?R-1:0),T=1;T<R;T++)O[T-1]=arguments[T];return c=l.call.apply(l,[this].concat(O))||this,c.data=void 0,c.data=u,c}return a}(K(Error))},"./src/loader/fragment.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"ElementaryStreamTypes",function(){return h}),M.d(Z,"BaseSegment",function(){return r}),M.d(Z,"Fragment",function(){return d}),M.d(Z,"Part",function(){return l});var V=M("./src/polyfills/number.ts"),I=M("./node_modules/url-toolkit/src/url-toolkit.js"),B=M.n(I),K=M("./src/utils/logger.ts"),W=M("./src/loader/level-key.ts"),L=M("./src/loader/load-stats.ts");function P(a,u){a.prototype=Object.create(u.prototype),a.prototype.constructor=a,b(a,u)}function b(a,u){return b=Object.setPrototypeOf||function(R,O){return R.__proto__=O,R},b(a,u)}function p(a,u){for(var c=0;c<u.length;c++){var R=u[c];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(a,R.key,R)}}function _(a,u,c){return u&&p(a.prototype,u),c&&p(a,c),a}var h;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(h||(h={}));var r=function(){function a(c){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[h.AUDIO]=null,R[h.VIDEO]=null,R[h.AUDIOVIDEO]=null,R),this.baseurl=c}var u=a.prototype;return u.setByteRange=function(R,O){var T=R.split("@",2),A=[];T.length===1?A[0]=O?O.byteRangeEndOffset:0:A[0]=parseInt(T[1]),A[1]=parseInt(T[0])+A[0],this._byteRange=A},_(a,[{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(R){this._url=R}}]),a}(),d=function(a){P(u,a);function u(R,O){var T;return T=a.call(this,O)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new L.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=R,T}var c=u.prototype;return c.createInitializationVector=function(O){for(var T=new Uint8Array(16),A=12;A<16;A++)T[A]=O>>8*(15-A)&255;return T},c.setDecryptDataFromLevelKey=function(O,T){var A=O;return(O==null?void 0:O.method)==="AES-128"&&O.uri&&!O.iv&&(A=W.LevelKey.fromURI(O.uri),A.method=O.method,A.iv=this.createInitializationVector(T),A.keyFormat="identity"),A},c.setElementaryStreamInfo=function(O,T,A,w,m,v){v===void 0&&(v=!1);var s=this.elementaryStreams,o=s[O];if(!o){s[O]={startPTS:T,endPTS:A,startDTS:w,endDTS:m,partial:v};return}o.startPTS=Math.min(o.startPTS,T),o.endPTS=Math.max(o.endPTS,A),o.startDTS=Math.min(o.startDTS,w),o.endDTS=Math.max(o.endDTS,m)},c.clearElementaryStreamInfo=function(){var O=this.elementaryStreams;O[h.AUDIO]=null,O[h.VIDEO]=null,O[h.AUDIOVIDEO]=null},_(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var O=this.sn;typeof O!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),O=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,O)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var O=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+O*1e3}},{key:"encrypted",get:function(){var O;return!!((O=this.decryptdata)!==null&&O!==void 0&&O.keyFormat&&this.decryptdata.uri)}}]),u}(r),l=function(a){P(u,a);function u(c,R,O,T,A){var w;w=a.call(this,O)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new L.LoadStats,w.duration=c.decimalFloatingPoint("DURATION"),w.gap=c.bool("GAP"),w.independent=c.bool("INDEPENDENT"),w.relurl=c.enumeratedString("URI"),w.fragment=R,w.index=T;var m=c.enumeratedString("BYTERANGE");return m&&w.setByteRange(m,A),A&&(w.fragOffset=A.fragOffset+A.duration),w}return _(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 R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),u}(r)},"./src/loader/key-loader.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return K});var V=M("./src/events.ts"),I=M("./src/errors.ts"),B=M("./src/utils/logger.ts"),K=function(){function W(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var L=W.prototype;return L._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},L._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},L.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var p=this.loaders[b];p&&p.destroy()}this.loaders={}},L.onKeyLoading=function(b,p){var _=p.frag,h=_.type,r=this.loaders[h];if(!_.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=_.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(r&&(B.logger.warn("abort previous key loader for type:"+h),r.abort()),!d){B.logger.warn("key uri is falsy");return}var a=l.loader,u=_.loader=this.loaders[h]=new a(l);this.decrypturl=d,this.decryptkey=null;var c={url:d,frag:_,responseType:"arraybuffer"},R={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(c,R,O)}else this.decryptkey&&(_.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:_}))},L.loadsuccess=function(b,p,_){var h=_.frag;if(!h.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(b.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:h})},L.loaderror=function(b,p){var _=p.frag,h=_.loader;h&&h.abort(),delete this.loaders[_.type],this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:_,response:b})},L.loadtimeout=function(b,p){var _=p.frag,h=_.loader;h&&h.abort(),delete this.loaders[_.type],this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:_})},W}()},"./src/loader/level-details.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"LevelDetails",function(){return W});var V=M("./src/polyfills/number.ts");function I(L,P){for(var b=0;b<P.length;b++){var p=P[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function B(L,P,b){return P&&I(L.prototype,P),b&&I(L,b),L}var K=10,W=function(){function L(b){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=b}var P=L.prototype;return P.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var _=this.lastPartSn-p.lastPartSn,h=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!h||!!_,this.advanced=this.endSN>p.endSN||_>0||_===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},B(L,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var _=this.driftEnd-this.driftStart;return _*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.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 p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),L}()},"./src/loader/level-key.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"LevelKey",function(){return W});var V=M("./node_modules/url-toolkit/src/url-toolkit.js"),I=M.n(V);function B(L,P){for(var b=0;b<P.length;b++){var p=P[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function K(L,P,b){return P&&B(L.prototype,P),b&&B(L,b),L}var W=function(){L.fromURL=function(b,p){return new L(b,p)},L.fromURI=function(b){return new L(b)};function L(P,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(V.buildAbsoluteURL)(P,b,{alwaysNormalize:!0}):this._uri=P}return K(L,[{key:"uri",get:function(){return this._uri}}]),L}()},"./src/loader/load-stats.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"LoadStats",function(){return V});var V=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(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return u});var V=M("./src/polyfills/number.ts"),I=M("./node_modules/url-toolkit/src/url-toolkit.js"),B=M.n(I),K=M("./src/loader/fragment.ts"),W=M("./src/loader/level-details.ts"),L=M("./src/loader/level-key.ts"),P=M("./src/utils/attr-list.ts"),b=M("./src/utils/logger.ts"),p=M("./src/utils/codecs.ts"),_=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,h=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function a(A){var w,m;return l.test((w=(m=I.parseURL(A))===null||m===void 0?void 0:m.path)!=null?w:"")}var u=function(){function A(){}return A.findGroup=function(m,v){for(var s=0;s<m.length;s++){var o=m[s];if(o.id===v)return o}},A.convertAVC1ToAVCOTI=function(m){var v=m.split(".");if(v.length>2){var s=v.shift()+".";return s+=parseInt(v.shift()).toString(16),s+=("000"+parseInt(v.shift()).toString(16)).substr(-4),s}return m},A.resolve=function(m,v){return I.buildAbsoluteURL(v,m,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(m,v){var s=[],o={},E=!1;_.lastIndex=0;for(var g;(g=_.exec(m))!=null;)if(g[1]){var C=new P.AttrList(g[1]),N={attrs:C,bitrate:C.decimalInteger("AVERAGE-BANDWIDTH")||C.decimalInteger("BANDWIDTH"),name:C.NAME,url:A.resolve(g[2],v)},U=C.decimalResolution("RESOLUTION");U&&(N.width=U.width,N.height=U.height),c((C.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=A.convertAVC1ToAVCOTI(N.videoCodec)),s.push(N)}else if(g[3]){var j=new P.AttrList(g[3]);j["DATA-ID"]&&(E=!0,o[j["DATA-ID"]]=j)}return{levels:s,sessionData:E?o:null}},A.parseMasterPlaylistMedia=function(m,v,s,o){o===void 0&&(o=[]);var E,g=[],C=0;for(h.lastIndex=0;(E=h.exec(m))!==null;){var N=new P.AttrList(E[1]);if(N.TYPE===s){var U={attrs:N,bitrate:0,id:C++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:s,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?A.resolve(N.URI,v):""};if(o.length){var j=A.findGroup(o,U.groupId)||o[0];R(U,j,"audioCodec"),R(U,j,"textCodec")}g.push(U)}}return g},A.parseLevelPlaylist=function(m,v,s,o,E){var g=new W.LevelDetails(v),C=g.fragments,N=null,U=0,j=0,H=0,y=0,x=null,F=new K.Fragment(o,v),Q,q,ie,ge=-1,fe=!1;for(r.lastIndex=0,g.m3u8=m;(Q=r.exec(m))!==null;){fe&&(fe=!1,F=new K.Fragment(o,v),F.start=H,F.sn=U,F.cc=y,F.level=s,N&&(F.initSegment=N,F.rawProgramDateTime=N.rawProgramDateTime));var ue=Q[1];if(ue){F.duration=parseFloat(ue);var he=(" "+Q[2]).slice(1);F.title=he||null,F.tagList.push(he?["INF",ue,he]:["INF",ue])}else if(Q[3])Object(V.isFiniteNumber)(F.duration)&&(F.start=H,ie&&(F.levelkey=ie),F.sn=U,F.level=s,F.cc=y,F.urlId=E,C.push(F),F.relurl=(" "+Q[3]).slice(1),T(F,x),x=F,H+=F.duration,U++,j=0,fe=!0);else if(Q[4]){var _e=(" "+Q[4]).slice(1);x?F.setByteRange(_e,x):F.setByteRange(_e)}else if(Q[5])F.rawProgramDateTime=(" "+Q[5]).slice(1),F.tagList.push(["PROGRAM-DATE-TIME",F.rawProgramDateTime]),ge===-1&&(ge=C.length);else{if(Q=Q[0].match(d),!Q){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(q=1;q<Q.length&&!(typeof Q[q]!="undefined");q++);var le=(" "+Q[q]).slice(1),ne=(" "+Q[q+1]).slice(1),Te=Q[q+2]?(" "+Q[q+2]).slice(1):"";switch(le){case"PLAYLIST-TYPE":g.type=ne.toUpperCase();break;case"MEDIA-SEQUENCE":U=g.startSN=parseInt(ne);break;case"SKIP":{var Fe=new P.AttrList(ne),Ke=Fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(Ke)){g.skippedSegments=Ke;for(var Ue=Ke;Ue--;)C.unshift(null);U+=Ke}var He=Fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");He&&(g.recentlyRemovedDateranges=He.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(ne);break;case"VERSION":g.version=parseInt(ne);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(ne||Te)&&F.tagList.push(Te?[ne,Te]:[ne]);break;case"DIS":y++;case"GAP":F.tagList.push([le]);break;case"BITRATE":F.tagList.push([le,ne]);break;case"DISCONTINUITY-SEQ":y=parseInt(ne);break;case"KEY":{var Ne,Be=new P.AttrList(ne),Je=Be.enumeratedString("METHOD"),tt=Be.URI,it=Be.hexadecimalInteger("IV"),rt=Be.enumeratedString("KEYFORMATVERSIONS"),qe=Be.enumeratedString("KEYID"),gt=(Ne=Be.enumeratedString("KEYFORMAT"))!=null?Ne:"identity",pt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(pt.indexOf(gt)>-1){b.logger.warn("Keyformat "+gt+" is not supported from the manifest");continue}else if(gt!=="identity")continue;Je&&(ie=L.LevelKey.fromURL(v,tt),tt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Je)>=0&&(ie.method=Je,ie.keyFormat=gt,qe&&(ie.keyID=qe),rt&&(ie.keyFormatVersions=rt),ie.iv=it));break}case"START":{var vt=new P.AttrList(ne),at=vt.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(at)&&(g.startTimeOffset=at);break}case"MAP":{var Rt=new P.AttrList(ne);F.relurl=Rt.URI,Rt.BYTERANGE&&F.setByteRange(Rt.BYTERANGE),F.level=s,F.sn="initSegment",ie&&(F.levelkey=ie),F.initSegment=null,N=F,fe=!0;break}case"SERVER-CONTROL":{var xt=new P.AttrList(ne);g.canBlockReload=xt.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=xt.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&xt.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=xt.optionalFloat("PART-HOLD-BACK",0),g.holdBack=xt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Tt=new P.AttrList(ne);g.partTarget=Tt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ye=g.partList;Ye||(Ye=g.partList=[]);var Mt=j>0?Ye[Ye.length-1]:void 0,St=j++,ze=new K.Part(new P.AttrList(ne),F,v,St,Mt);Ye.push(ze),F.duration+=ze.duration;break}case"PRELOAD-HINT":{var ut=new P.AttrList(ne);g.preloadHint=ut;break}case"RENDITION-REPORT":{var be=new P.AttrList(ne);g.renditionReports=g.renditionReports||[],g.renditionReports.push(be);break}default:b.logger.warn("line parsed but not handled: "+Q);break}}}x&&!x.relurl?(C.pop(),H-=x.duration,g.partList&&(g.fragmentHint=x)):g.partList&&(T(F,x),F.cc=y,g.fragmentHint=F);var xe=C.length,pe=C[0],se=C[xe-1];if(H+=g.skippedSegments*g.targetduration,H>0&&xe&&se){g.averagetargetduration=H/xe;var ce=se.sn;g.endSN=ce!=="initSegment"?ce:0,pe&&(g.startCC=pe.cc,pe.initSegment||g.fragments.every(function(Ee){return Ee.relurl&&a(Ee.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),F=new K.Fragment(o,v),F.relurl=se.relurl,F.level=s,F.sn="initSegment",pe.initSegment=F,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(H+=g.fragmentHint.duration),g.totalduration=H,g.endCC=y,ge>0&&O(C,ge),g},A}();function c(A,w){["video","audio","text"].forEach(function(m){var v=A.filter(function(o){return Object(p.isCodecType)(o,m)});if(v.length){var s=v.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});w[m+"Codec"]=s.length>0?s[0]:v[0],A=A.filter(function(o){return v.indexOf(o)===-1})}}),w.unknownCodecs=A}function R(A,w,m){var v=w[m];v&&(A[m]=v)}function O(A,w){for(var m=A[w],v=w;v--;){var s=A[v];if(!s)return;s.programDateTime=m.programDateTime-s.duration*1e3,m=s}}function T(A,w){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):w!=null&&w.programDateTime&&(A.programDateTime=w.endProgramDateTime),Object(V.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/polyfills/number.ts"),I=M("./src/events.ts"),B=M("./src/errors.ts"),K=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),L=M("./src/loader/m3u8-parser.ts"),P=M("./src/types/loader.ts"),b=M("./src/utils/attr-list.ts");function p(r){var d=r.type;switch(d){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function _(r,d){var l=r.url;return(l===void 0||l.indexOf("data:")===0)&&(l=d.url),l}var h=function(){function r(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var d=r.prototype;return d.registerListeners=function(){var a=this.hls;a.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(I.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var a=this.hls;a.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(I.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(a){var u=this.hls.config,c=u.pLoader,R=u.loader,O=c||R,T=new O(u);return a.loader=T,this.loaders[a.type]=T,T},d.getInternalLoader=function(a){return this.loaders[a.type]},d.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},d.destroyInternalLoaders=function(){for(var a in this.loaders){var u=this.loaders[a];u&&u.destroy(),this.resetInternalLoader(a)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(a,u){var c=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},d.onLevelLoading=function(a,u){var c=u.id,R=u.level,O=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:null,level:R,responseType:"text",type:P.PlaylistContextType.LEVEL,url:O,deliveryDirectives:T})},d.onAudioTrackLoading=function(a,u){var c=u.id,R=u.groupId,O=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:R,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:O,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(a,u){var c=u.id,R=u.groupId,O=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:R,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:O,deliveryDirectives:T})},d.load=function(a){var u,c=this.hls.config,R=this.getInternalLoader(a);if(R){var O=R.context;if(O&&O.url===a.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),R.abort()}var T,A,w,m;switch(a.type){case P.PlaylistContextType.MANIFEST:T=c.manifestLoadingMaxRetry,A=c.manifestLoadingTimeOut,w=c.manifestLoadingRetryDelay,m=c.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:T=0,A=c.levelLoadingTimeOut;break;default:T=c.levelLoadingMaxRetry,A=c.levelLoadingTimeOut,w=c.levelLoadingRetryDelay,m=c.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(a),(u=a.deliveryDirectives)!==null&&u!==void 0&&u.part){var v;if(a.type===P.PlaylistContextType.LEVEL&&a.level!==null?v=this.hls.levels[a.level].details:a.type===P.PlaylistContextType.AUDIO_TRACK&&a.id!==null?v=this.hls.audioTracks[a.id].details:a.type===P.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(v=this.hls.subtitleTracks[a.id].details),v){var s=v.partTarget,o=v.targetduration;s&&o&&(A=Math.min(Math.max(s*3,o*.8)*1e3,A))}}var E={timeout:A,maxRetry:T,retryDelay:w,maxRetryDelay:m,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(a,E,g)},d.loadsuccess=function(a,u,c,R){if(R===void 0&&(R=null),c.isSidxRequest){this.handleSidxRequest(a,c),this.handlePlaylistLoaded(a,u,c,R);return}this.resetInternalLoader(c.type);var O=a.data;if(O.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,c,"no EXTM3U delimiter",R);return}u.parsing.start=performance.now(),O.indexOf("#EXTINF:")>0||O.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,u,c,R):this.handleMasterPlaylist(a,u,c,R)},d.loaderror=function(a,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!1,a)},d.loadtimeout=function(a,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!0)},d.handleMasterPlaylist=function(a,u,c,R){var O=this.hls,T=a.data,A=_(a,c),w=L.default.parseMasterPlaylist(T,A),m=w.levels,v=w.sessionData;if(!m.length){this.handleManifestParsingError(a,c,"no level found in manifest",R);return}var s=m.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),o=m.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),E=L.default.parseMasterPlaylistMedia(T,A,"AUDIO",s),g=L.default.parseMasterPlaylistMedia(T,A,"SUBTITLES",o),C=L.default.parseMasterPlaylistMedia(T,A,"CLOSED-CAPTIONS");if(E.length){var N=E.some(function(U){return!U.url});!N&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}O.trigger(I.Events.MANIFEST_LOADED,{levels:m,audioTracks:E,subtitles:g,captions:C,url:A,stats:u,networkDetails:R,sessionData:v})},d.handleTrackOrLevelPlaylist=function(a,u,c,R){var O=this.hls,T=c.id,A=c.level,w=c.type,m=_(a,c),v=Object(V.isFiniteNumber)(T)?T:0,s=Object(V.isFiniteNumber)(A)?A:v,o=p(c),E=L.default.parseLevelPlaylist(a.data,m,s,o,v);if(!E.fragments.length){O.trigger(I.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(w===P.PlaylistContextType.MANIFEST){var g={attrs:new b.AttrList({}),bitrate:0,details:E,name:"",url:m};O.trigger(I.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:m,stats:u,networkDetails:R,sessionData:null})}if(u.parsing.end=performance.now(),E.needSidxRanges){var C,N=(C=E.fragments[0].initSegment)===null||C===void 0?void 0:C.url;this.load({url:N,isSidxRequest:!0,type:w,level:A,levelDetails:E,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=E,this.handlePlaylistLoaded(a,u,c,R)},d.handleSidxRequest=function(a,u){var c=Object(W.parseSegmentIndex)(new Uint8Array(a.data));if(!c)return;var R=c.references,O=u.levelDetails;R.forEach(function(T,A){var w=T.info,m=O.fragments[A];m.byteRange.length===0&&m.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),m.initSegment&&m.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(a,u,c,R){this.hls.trigger(I.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===P.PlaylistContextType.MANIFEST,url:a.url,reason:c,response:a,context:u,networkDetails:R})},d.handleNetworkError=function(a,u,c,R){c===void 0&&(c=!1),K.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var O=B.ErrorDetails.UNKNOWN,T=!1,A=this.getInternalLoader(a);switch(a.type){case P.PlaylistContextType.MANIFEST:O=c?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case P.PlaylistContextType.LEVEL:O=c?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.AUDIO_TRACK:O=c?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:O=c?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}A&&this.resetInternalLoader(a.type);var w={type:B.ErrorTypes.NETWORK_ERROR,details:O,fatal:T,url:a.url,loader:A,context:a,networkDetails:u};R&&(w.response=R),this.hls.trigger(I.Events.ERROR,w)},d.handlePlaylistLoaded=function(a,u,c,R){var O=c.type,T=c.level,A=c.id,w=c.groupId,m=c.loader,v=c.levelDetails,s=c.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(a,c,"invalid target duration",R);return}if(!m)return;v.live&&(m.getCacheAge&&(v.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(O){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(I.Events.LEVEL_LOADED,{details:v,level:T||0,id:A||0,stats:u,networkDetails:R,deliveryDirectives:s});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(I.Events.AUDIO_TRACK_LOADED,{details:v,id:A||0,groupId:w||"",stats:u,networkDetails:R,deliveryDirectives:s});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(I.Events.SUBTITLE_TRACK_LOADED,{details:v,id:A||0,groupId:w||"",stats:u,networkDetails:R,deliveryDirectives:s});break}},r}();Z.default=h},"./src/polyfills/number.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"isFiniteNumber",function(){return V}),M.d(Z,"MAX_SAFE_INTEGER",function(){return I});var V=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},I=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(de,Z,M){"use strict";M.r(Z);var V=function(){function I(){}return I.getSilentFrame=function(K,W){switch(K){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(W===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(W===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},I}();Z.default=V},"./src/remux/mp4-generator.ts":function(de,Z,M){"use strict";M.r(Z);var V=Math.pow(2,32)-1,I=function(){function B(){}return B.init=function(){B.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var W;for(W in B.types)B.types.hasOwnProperty(W)&&(B.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var L=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]),P=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);B.HDLR_TYPES={video:L,audio:P};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);B.STTS=B.STSC=B.STCO=p,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var _=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,_,r,_,h),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,b))},B.box=function(W){for(var L=8,P=arguments.length,b=new Array(P>1?P-1:0),p=1;p<P;p++)b[p-1]=arguments[p];for(var _=b.length,h=_;_--;)L+=b[_].byteLength;var r=new Uint8Array(L);for(r[0]=L>>24&255,r[1]=L>>16&255,r[2]=L>>8&255,r[3]=L&255,r.set(W,4),_=0,L=8;_<h;_++)r.set(b[_],L),L+=b[_].byteLength;return r},B.hdlr=function(W){return B.box(B.types.hdlr,B.HDLR_TYPES[W])},B.mdat=function(W){return B.box(B.types.mdat,W)},B.mdhd=function(W,L){L*=W;var P=Math.floor(L/(V+1)),b=Math.floor(L%(V+1));return B.box(B.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,P>>24,P>>16&255,P>>8&255,P&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},B.mdia=function(W){return B.box(B.types.mdia,B.mdhd(W.timescale,W.duration),B.hdlr(W.type),B.minf(W))},B.mfhd=function(W){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},B.minf=function(W){return W.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(W)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(W))},B.moof=function(W,L,P){return B.box(B.types.moof,B.mfhd(W),B.traf(P,L))},B.moov=function(W){for(var L=W.length,P=[];L--;)P[L]=B.trak(W[L]);return B.box.apply(null,[B.types.moov,B.mvhd(W[0].timescale,W[0].duration)].concat(P).concat(B.mvex(W)))},B.mvex=function(W){for(var L=W.length,P=[];L--;)P[L]=B.trex(W[L]);return B.box.apply(null,[B.types.mvex].concat(P))},B.mvhd=function(W,L){L*=W;var P=Math.floor(L/(V+1)),b=Math.floor(L%(V+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,P>>24,P>>16&255,P>>8&255,P&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return B.box(B.types.mvhd,p)},B.sdtp=function(W){var L=W.samples||[],P=new Uint8Array(4+L.length),b,p;for(b=0;b<L.length;b++)p=L[b].flags,P[b+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return B.box(B.types.sdtp,P)},B.stbl=function(W){return B.box(B.types.stbl,B.stsd(W),B.box(B.types.stts,B.STTS),B.box(B.types.stsc,B.STSC),B.box(B.types.stsz,B.STSZ),B.box(B.types.stco,B.STCO))},B.avc1=function(W){var L=[],P=[],b,p,_;for(b=0;b<W.sps.length;b++)p=W.sps[b],_=p.byteLength,L.push(_>>>8&255),L.push(_&255),L=L.concat(Array.prototype.slice.call(p));for(b=0;b<W.pps.length;b++)p=W.pps[b],_=p.byteLength,P.push(_>>>8&255),P.push(_&255),P=P.concat(Array.prototype.slice.call(p));var h=B.box(B.types.avcC,new Uint8Array([1,L[3],L[4],L[5],252|3,224|W.sps.length].concat(L).concat([W.pps.length]).concat(P))),r=W.width,d=W.height,l=W.pixelRatio[0],a=W.pixelRatio[1];return B.box(B.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>8&255,r&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,a>>24,a>>16&255,a>>8&255,a&255])))},B.esds=function(W){var L=W.config.length;return new Uint8Array([0,0,0,0,3,23+L,0,1,0,4,15+L,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([L]).concat(W.config).concat([6,1,2]))},B.mp4a=function(W){var L=W.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]),B.box(B.types.esds,B.esds(W)))},B.mp3=function(W){var L=W.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]))},B.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(W)):B.box(B.types.stsd,B.STSD,B.mp4a(W)):B.box(B.types.stsd,B.STSD,B.avc1(W))},B.tkhd=function(W){var L=W.id,P=W.duration*W.timescale,b=W.width,p=W.height,_=Math.floor(P/(V+1)),h=Math.floor(P%(V+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255,h>>24,h>>16&255,h>>8&255,h&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,b>>8&255,b&255,0,0,p>>8&255,p&255,0,0]))},B.traf=function(W,L){var P=B.sdtp(W),b=W.id,p=Math.floor(L/(V+1)),_=Math.floor(L%(V+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),B.box(B.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,_>>24,_>>16&255,_>>8&255,_&255])),B.trun(W,P.length+16+20+8+16+8+8),P)},B.trak=function(W){return W.duration=W.duration||4294967295,B.box(B.types.trak,B.tkhd(W),B.mdia(W))},B.trex=function(W){var L=W.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(W,L){var P=W.samples||[],b=P.length,p=12+16*b,_=new Uint8Array(p),h,r,d,l,a,u;for(L+=8+p,_.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255],0),h=0;h<b;h++)r=P[h],d=r.duration,l=r.size,a=r.flags,u=r.cts,_.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*h);return B.box(B.types.trun,_)},B.initSegment=function(W){B.types||B.init();var L=B.moov(W),P=new Uint8Array(B.FTYP.byteLength+L.byteLength);return P.set(B.FTYP),P.set(L,B.FTYP.byteLength),P},B}();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,Z.default=I},"./src/remux/mp4-remuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return u}),M.d(Z,"normalizePts",function(){return c});var V=M("./src/polyfills/number.ts"),I=M("./src/remux/aac-helper.ts"),B=M("./src/remux/mp4-generator.ts"),K=M("./src/events.ts"),W=M("./src/errors.ts"),L=M("./src/utils/logger.ts"),P=M("./src/types/loader.ts"),b=M("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(A){for(var w=1;w<arguments.length;w++){var m=arguments[w];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(A[v]=m[v])}return A},p.apply(this,arguments)}var _=10*1e3,h=1024,r=1152,d=null,l=null,a=!1,u=function(){function A(m,v,s,o){if(o===void 0&&(o=""),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=m,this.config=v,this.typeSupported=s,this.ISGenerated=!1,d===null){var E=navigator.userAgent||"",g=E.match(/Chrome\/(\d+)/i);d=g?parseInt(g[1]):0}if(l===null){var C=navigator.userAgent.match(/Safari\/(\d+)/i);l=C?parseInt(C[1]):0}a=!!d&&d<75||!!l&&l<600}var w=A.prototype;return w.destroy=function(){},w.resetTimeStamp=function(v){L.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=v},w.resetNextTimestamp=function(){L.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},w.resetInitSegment=function(){L.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},w.getVideoStartPts=function(v){var s=!1,o=v.reduce(function(E,g){var C=g.pts-E;return C<-4294967296?(s=!0,c(E,g.pts)):C>0?E:g.pts},v[0].pts);return s&&L.logger.debug("PTS rollover detected"),o},w.remux=function(v,s,o,E,g,C,N,U){var j,H,y,x,F,Q,q=g,ie=g,ge=v.pid>-1,fe=s.pid>-1,ue=s.samples.length,he=v.samples.length>0,_e=ue>1,le=(!ge||he)&&(!fe||_e)||this.ISGenerated||N;if(le){this.ISGenerated||(y=this.generateIS(v,s,g));var ne=this.isVideoContiguous,Te=-1;if(_e&&(Te=R(s.samples),!ne&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,Te>0){L.logger.warn("[mp4-remuxer]: Dropped "+Te+" out of "+ue+" video samples due to a missing keyframe");var Fe=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(Te),s.dropped+=Te,ie+=(s.samples[0].pts-Fe)/(s.timescale||9e4)}else Te===-1&&(L.logger.warn("[mp4-remuxer]: No keyframe found out of "+ue+" video samples"),Q=!1);if(this.ISGenerated){if(he&&_e){var Ke=this.getVideoStartPts(s.samples),Ue=c(v.samples[0].pts,Ke)-Ke,He=Ue/s.inputTimeScale;q+=Math.max(0,He),ie+=Math.max(0,-He)}if(he){if(v.samplerate||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),y=this.generateIS(v,s,g)),H=this.remuxAudio(v,q,this.isAudioContiguous,C,fe||_e||U===P.PlaylistLevelType.AUDIO?ie:void 0),_e){var Ne=H?H.endPTS-H.startPTS:0;s.inputTimeScale||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),y=this.generateIS(v,s,g)),j=this.remuxVideo(s,ie,ne,Ne)}}else _e&&(j=this.remuxVideo(s,ie,ne,0));j&&(j.firstKeyFrame=Te,j.independent=Te!==-1)}}return this.ISGenerated&&(o.samples.length&&(F=this.remuxID3(o,g)),E.samples.length&&(x=this.remuxText(E,g))),{audio:H,video:j,initSegment:y,independent:Q,text:x,id3:F}},w.generateIS=function(v,s,o){var E=v.samples,g=s.samples,C=this.typeSupported,N={},U=!Object(V.isFiniteNumber)(this._initPTS),j="audio/mp4",H,y,x;if(U&&(H=y=Infinity),v.config&&E.length&&(v.timescale=v.samplerate,v.isAAC||(C.mpeg?(j="audio/mpeg",v.codec=""):C.mp3&&(v.codec="mp3")),N.audio={id:"audio",container:j,codec:v.codec,initSegment:!v.isAAC&&C.mpeg?new Uint8Array(0):B.default.initSegment([v]),metadata:{channelCount:v.channelCount}},U&&(x=v.inputTimeScale,H=y=E[0].pts-Math.round(x*o))),s.sps&&s.pps&&g.length&&(s.timescale=s.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:B.default.initSegment([s]),metadata:{width:s.width,height:s.height}},U)){x=s.inputTimeScale;var F=this.getVideoStartPts(g),Q=Math.round(x*o);y=Math.min(y,c(g[0].dts,F)-Q),H=Math.min(H,F-Q)}if(Object.keys(N).length)return this.ISGenerated=!0,U&&(this._initPTS=H,this._initDTS=y),{tracks:N,initPTS:H,timescale:x}},w.remuxVideo=function(v,s,o,E){var g=v.inputTimeScale,C=v.samples,N=[],U=C.length,j=this._initPTS,H=this.nextAvcDts,y=8,x,F,Q,q=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,ge=0,fe=!1;if(!o||H===null){var ue=s*g,he=C[0].pts-c(C[0].dts,C[0].pts);H=ue-he}for(var _e=0;_e<U;_e++){var le=C[_e];if(le.pts=c(le.pts-j,H),le.dts=c(le.dts-j,H),le.dts>le.pts){var ne=9e4*.2;ge=Math.max(Math.min(ge,le.pts-le.dts),-1*ne)}le.dts<C[_e>0?_e-1:_e].dts&&(fe=!0)}fe&&C.sort(function(_n,yn){var Gt=_n.dts-yn.dts,ii=_n.pts-yn.pts;return Gt||ii}),F=C[0].dts,Q=C[C.length-1].dts;var Te=Math.round((Q-F)/(U-1));if(ge<0){if(ge<Te*-2){L.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-Te,!0)+" ms");for(var Fe=ge,Ke=0;Ke<U;Ke++)C[Ke].dts=Fe=Math.max(Fe,C[Ke].pts-Te),C[Ke].pts=Math.max(Fe,C[Ke].pts)}else{L.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(ge,!0)+" ms to overcome this issue");for(var Ue=0;Ue<U;Ue++)C[Ue].dts=C[Ue].dts+ge}F=C[0].dts}if(o){var He=F-H,Ne=He>Te,Be=He<-1;if(Ne||Be){Ne?L.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(He,!0)+" ms ("+He+"dts) hole between fragments detected, filling it"):L.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-He,!0)+" ms ("+He+"dts) overlapping between fragments detected"),F=H;var Je=C[0].pts-He;C[0].dts=F,C[0].pts=Je,L.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Je,!0)+"/"+Object(b.toMsFromMpegTsClock)(F,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(He,!0)+" ms")}}a&&(F=Math.max(0,F));for(var tt=0,it=0,rt=0;rt<U;rt++){for(var qe=C[rt],gt=qe.units,pt=gt.length,vt=0,at=0;at<pt;at++)vt+=gt[at].data.length;it+=vt,tt+=pt,qe.length=vt,qe.dts=Math.max(qe.dts,F),qe.pts=Math.max(qe.pts,qe.dts,0),q=Math.min(qe.pts,q),ie=Math.max(qe.pts,ie)}Q=C[U-1].dts;var Rt=it+4*tt+8,xt;try{xt=new Uint8Array(Rt)}catch(_n){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Rt,reason:"fail allocating video mdat "+Rt});return}var Tt=new DataView(xt.buffer);Tt.setUint32(0,Rt),xt.set(B.default.types.mdat,4);for(var Ye=0;Ye<U;Ye++){for(var Mt=C[Ye],St=Mt.units,ze=0,ut=0,be=St.length;ut<be;ut++){var xe=St[ut],pe=xe.data,se=xe.data.byteLength;Tt.setUint32(y,se),y+=4,xt.set(pe,y),y+=se,ze+=4+se}if(Ye<U-1)x=C[Ye+1].dts-Mt.dts;else{var ce=this.config,Ee=Mt.dts-C[Ye>0?Ye-1:Ye].dts;if(ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ae=Math.floor(ce.maxBufferHole*g),De=(E?q+E*g:this.nextAudioPts)-Mt.pts;De>Ae?(x=De-Ee,x<0&&(x=Ee),L.logger.log("[mp4-remuxer]: It is approximately "+De/90+" ms to the next segment; using duration "+x/90+" ms for the last video frame.")):x=Ee}else x=Ee}var $e=Math.round(Mt.pts-Mt.dts);N.push(new O(Mt.key,x,ze,$e))}if(N.length&&d&&d<70){var lt=N[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(x!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=Q+x,this.isVideoContiguous=!0;var Bt=B.default.moof(v.sequenceNumber++,F,p({},v,{samples:N})),tn="video",nn={data1:Bt,data2:xt,startPTS:q/g,endPTS:(ie+x)/g,startDTS:F/g,endDTS:H/g,type:tn,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(xt.length,"MDAT length must not be zero"),nn},w.remuxAudio=function(v,s,o,E,g){var C=v.inputTimeScale,N=v.samplerate?v.samplerate:C,U=C/N,j=v.isAAC?h:r,H=j*U,y=this._initPTS,x=!v.isAAC&&this.typeSupported.mpeg,F=[],Q=v.samples,q=x?0:8,ie=this.nextAudioPts||-1,ge=s*C;if(this.isAudioContiguous=o=o||Q.length&&ie>0&&(E&&Math.abs(ge-ie)<9e3||Math.abs(c(Q[0].pts-y,ge)-ie)<20*H),Q.forEach(function(pe){pe.pts=c(pe.pts-y,ge)}),!o||ie<0){if(Q=Q.filter(function(pe){return pe.pts>=0}),!Q.length)return;g===0?ie=0:E?ie=Math.max(0,ge):ie=Q[0].pts}if(v.isAAC)for(var fe=g!==void 0,ue=this.config.maxAudioFramesDrift,he=0,_e=ie;he<Q.length;he++){var le=Q[he],ne=le.pts,Te=ne-_e,Fe=Math.abs(1e3*Te/C);if(Te<=-ue*H&&fe)he===0&&(L.logger.warn("Audio frame @ "+(ne/C).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Te/C)+" ms."),this.nextAudioPts=ie=_e=ne);else if(Te>=ue*H&&Fe<_&&fe){var Ke=Math.round(Te/H);_e=ne-Ke*H,_e<0&&(Ke--,_e+=H),he===0&&(this.nextAudioPts=ie=_e),L.logger.warn("[mp4-remuxer]: Injecting "+Ke+" audio frame @ "+(_e/C).toFixed(3)+"s due to "+Math.round(1e3*Te/C)+" ms gap.");for(var Ue=0;Ue<Ke;Ue++){var He=Math.max(_e,0),Ne=I.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);Ne||(L.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ne=le.unit.subarray()),Q.splice(he,0,{unit:Ne,pts:He}),_e+=H,he++}}le.pts=_e,_e+=H}for(var Be=null,Je=null,tt,it=0,rt=Q.length;rt--;)it+=Q[rt].unit.byteLength;for(var qe=0,gt=Q.length;qe<gt;qe++){var pt=Q[qe],vt=pt.unit,at=pt.pts;if(Je!==null){var Rt=F[qe-1];Rt.duration=Math.round((at-Je)/U)}else if(o&&v.isAAC&&(at=ie),Be=at,it>0){it+=q;try{tt=new Uint8Array(it)}catch(pe){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:it,reason:"fail allocating audio mdat "+it});return}if(!x){var xt=new DataView(tt.buffer);xt.setUint32(0,it),tt.set(B.default.types.mdat,4)}}else return;tt.set(vt,q);var Tt=vt.byteLength;q+=Tt,F.push(new O(!0,j,Tt,0)),Je=at}var Ye=F.length;if(!Ye)return;var Mt=F[F.length-1];this.nextAudioPts=ie=Je+U*Mt.duration;var St=x?new Uint8Array(0):B.default.moof(v.sequenceNumber++,Be/U,p({},v,{samples:F}));v.samples=[];var ze=Be/C,ut=ie/C,be="audio",xe={data1:St,data2:tt,startPTS:ze,endPTS:ut,startDTS:ze,endDTS:ut,type:be,hasAudio:!0,hasVideo:!1,nb:Ye};return this.isAudioContiguous=!0,console.assert(tt.length,"MDAT length must not be zero"),xe},w.remuxEmptyAudio=function(v,s,o,E){var g=v.inputTimeScale,C=v.samplerate?v.samplerate:g,N=g/C,U=this.nextAudioPts,j=(U!==null?U:E.startDTS*g)+this._initDTS,H=E.endDTS*g+this._initDTS,y=N*h,x=Math.ceil((H-j)/y),F=I.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(L.logger.warn("[mp4-remuxer]: remux empty Audio"),!F){L.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],q=0;q<x;q++){var ie=j+q*y;Q.push({unit:F,pts:ie,dts:ie})}return v.samples=Q,this.remuxAudio(v,s,o,!1)},w.remuxID3=function(v,s){var o=v.samples.length;if(!o)return;for(var E=v.inputTimeScale,g=this._initPTS,C=this._initDTS,N=0;N<o;N++){var U=v.samples[N];U.pts=c(U.pts-g,s*E)/E,U.dts=c(U.dts-C,s*E)/E}var j=v.samples;return v.samples=[],{samples:j}},w.remuxText=function(v,s){var o=v.samples.length;if(!o)return;for(var E=v.inputTimeScale,g=this._initPTS,C=0;C<o;C++){var N=v.samples[C];N.pts=c(N.pts-g,s*E)/E}v.samples.sort(function(j,H){return j.pts-H.pts});var U=v.samples;return v.samples=[],{samples:U}},A}();function c(A,w){var m;if(w===null)return A;for(w<A?m=-8589934592:m=8589934592;Math.abs(A-w)>4294967296;)A+=m;return A}function R(A){for(var w=0;w<A.length;w++)if(A[w].key)return w;return-1}var O=function(w,m,v,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=m,this.size=v,this.cts=s,this.flags=new T(w)},T=function(w){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=w?2:1,this.isNonSync=w?0:1}},"./src/remux/passthrough-remuxer.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/polyfills/number.ts"),I=M("./src/utils/mp4-tools.ts"),B=M("./src/loader/fragment.ts"),K=M("./src/utils/logger.ts"),W=function(){function b(){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 p=b.prototype;return p.destroy=function(){},p.resetTimeStamp=function(h){this.initPTS=h,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(h,r,d){this.audioCodec=r,this.videoCodec=d,this.generateInitSegment(h),this.emitInitSegment=!0},p.generateInitSegment=function(h){var r=this.audioCodec,d=this.videoCodec;if(!h||!h.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(I.parseInitSegment)(h);r||(r=P(l.audio,B.ElementaryStreamTypes.AUDIO)),d||(d=P(l.video,B.ElementaryStreamTypes.VIDEO));var a={};l.audio&&l.video?a.audiovideo={container:"video/mp4",codec:r+","+d,initSegment:h,id:"main"}:l.audio?a.audio={container:"audio/mp4",codec:r,initSegment:h,id:"audio"}:l.video?a.video={container:"video/mp4",codec:d,initSegment:h,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},p.remux=function(h,r,d,l,a){var u=this.initPTS,c=this.lastEndDTS,R={audio:void 0,video:void 0,text:l,id3:d,initSegment:void 0};Object(V.isFiniteNumber)(c)||(c=this.lastEndDTS=a||0);var O=r.samples;if(!O||!O.length)return R;var T={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(O),A=this.initData),!A||!A.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(u)||(this.initPTS=T.initPTS=u=L(A,O,c));var w=Object(I.getDuration)(O,A),m=c,v=w+m;Object(I.offsetStartDTS)(A,O,u),w>0?this.lastEndDTS=v:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!A.audio,o=!!A.video,E="";s&&(E+="audio"),o&&(E+="video");var g={data1:O,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:E,hasAudio:s,hasVideo:o,nb:1,dropped:0};return R.audio=g.type==="audio"?g:void 0,R.video=g.type!=="audio"?g:void 0,R.text=l,R.id3=d,R.initSegment=T,R},b}(),L=function(p,_,h){return Object(I.getStartDTS)(p,_)-h};function P(b,p){var _=b==null?void 0:b.codec;return _&&_.length>4?_:_==="hvc1"?"hvc1.1.c.L120.90":_==="av01"?"av01.0.04M.08":_==="avc1"||p===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Z.default=W},"./src/task-loop.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return V});var V=function(){function I(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=I.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},I}()},"./src/types/cmcd.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"CMCDVersion",function(){return V}),M.d(Z,"CMCDObjectType",function(){return I}),M.d(Z,"CMCDStreamingFormat",function(){return B}),M.d(Z,"CMCDStreamType",function(){return K});var V=1,I;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(I||(I={}));var B;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(B||(B={}));var K;(function(W){W.VOD="v",W.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"HlsSkip",function(){return B}),M.d(Z,"getSkipValue",function(){return K}),M.d(Z,"HlsUrlParameters",function(){return W}),M.d(Z,"Level",function(){return L});function V(P,b){for(var p=0;p<b.length;p++){var _=b[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(P,_.key,_)}}function I(P,b,p){return b&&V(P.prototype,b),p&&V(P,p),P}var B;(function(P){P.No="",P.Yes="YES",P.v2="v2"})(B||(B={}));function K(P,b){var p=P.canSkipUntil,_=P.canSkipDateRanges,h=P.endSN,r=b!==void 0?b-h:0;return p&&r<p?_?B.v2:B.Yes:B.No}var W=function(){function P(p,_,h){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=_,this.skip=h}var b=P.prototype;return b.addDirectives=function(_){var h=new self.URL(_);return this.msn!==void 0&&h.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&h.searchParams.set("_HLS_part",this.part.toString()),this.skip&&h.searchParams.set("_HLS_skip",this.skip),h.toString()},P}(),L=function(){function P(b){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=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return I(P,[{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(p){var _=p%this.url.length;this._urlId!==_&&(this.details=void 0,this._urlId=_)}}]),P}()},"./src/types/loader.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"PlaylistContextType",function(){return V}),M.d(Z,"PlaylistLevelType",function(){return I});var V;(function(B){B.MANIFEST="manifest",B.LEVEL="level",B.AUDIO_TRACK="audioTrack",B.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var I;(function(B){B.MAIN="main",B.AUDIO="audio",B.SUBTITLE="subtitle"})(I||(I={}))},"./src/types/transmuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"ChunkMetadata",function(){return V});var V=function(K,W,L,P,b,p){P===void 0&&(P=0),b===void 0&&(b=-1),p===void 0&&(p=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=I(),this.buffering={audio:I(),video:I(),audiovideo:I()},this.level=K,this.sn=W,this.id=L,this.size=P,this.part=b,this.partial=p};function I(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"AttrList",function(){return B});var V=/^(\d+)x(\d+)$/,I=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,B=function(){function K(L){typeof L=="string"&&(L=K.parseAttrList(L));for(var P in L)L.hasOwnProperty(P)&&(this[P]=L[P])}var W=K.prototype;return W.decimalInteger=function(P){var b=parseInt(this[P],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},W.hexadecimalInteger=function(P){if(this[P]){var b=(this[P]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var p=new Uint8Array(b.length/2),_=0;_<b.length/2;_++)p[_]=parseInt(b.slice(_*2,_*2+2),16);return p}else return null},W.hexadecimalIntegerAsNumber=function(P){var b=parseInt(this[P],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},W.decimalFloatingPoint=function(P){return parseFloat(this[P])},W.optionalFloat=function(P,b){var p=this[P];return p?parseFloat(p):b},W.enumeratedString=function(P){return this[P]},W.bool=function(P){return this[P]==="YES"},W.decimalResolution=function(P){var b=V.exec(this[P]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},K.parseAttrList=function(P){var b,p={},_='"';for(I.lastIndex=0;(b=I.exec(P))!==null;){var h=b[2];h.indexOf(_)===0&&h.lastIndexOf(_)===h.length-1&&(h=h.slice(1,-1)),p[b[1]]=h}return p},K}()},"./src/utils/binary-search.ts":function(de,Z,M){"use strict";M.r(Z);var V={search:function(B,K){for(var W=0,L=B.length-1,P=null,b=null;W<=L;){P=(W+L)/2|0,b=B[P];var p=K(b);if(p>0)W=P+1;else if(p<0)L=P-1;else return b}return null}};Z.default=V},"./src/utils/buffer-helper.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"BufferHelper",function(){return B});var V=M("./src/utils/logger.ts"),I={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function K(){}return K.isBuffered=function(L,P){try{if(L){for(var b=K.getBuffered(L),p=0;p<b.length;p++)if(P>=b.start(p)&&P<=b.end(p))return!0}}catch(_){}return!1},K.bufferInfo=function(L,P,b){try{if(L){var p=K.getBuffered(L),_=[],h;for(h=0;h<p.length;h++)_.push({start:p.start(h),end:p.end(h)});return this.bufferedInfo(_,P,b)}}catch(r){}return{len:0,start:P,end:P,nextStart:void 0}},K.bufferedInfo=function(L,P,b){P=Math.max(0,P),L.sort(function(T,A){var w=T.start-A.start;return w||A.end-T.end});var p=[];if(b)for(var _=0;_<L.length;_++){var h=p.length;if(h){var r=p[h-1].end;L[_].start-r<b?L[_].end>r&&(p[h-1].end=L[_].end):p.push(L[_])}else p.push(L[_])}else p=L;for(var d=0,l,a=P,u=P,c=0;c<p.length;c++){var R=p[c].start,O=p[c].end;if(P+b>=R&&P<O)a=R,u=O,d=u-P;else if(P+b<R){l=R;break}}return{len:d,start:a||0,end:u||0,nextStart:l}},K.getBuffered=function(L){try{return L.buffered}catch(P){return V.logger.log("failed to get media.buffered",P),I}},K}()},"./src/utils/cea-608-parser.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"Row",function(){return u}),M.d(Z,"CaptionScreen",function(){return c});var V=M("./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},B=function(v){var s=v;return I.hasOwnProperty(v)&&(s=I[v]),String.fromCharCode(s)},K=15,W=100,L={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},P={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},_=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h;(function(m){m[m.ERROR=0]="ERROR",m[m.TEXT=1]="TEXT",m[m.WARNING=2]="WARNING",m[m.INFO=2]="INFO",m[m.DEBUG=3]="DEBUG",m[m.DATA=3]="DATA"})(h||(h={}));var r=function(){function m(){this.time=null,this.verboseLevel=h.ERROR}var v=m.prototype;return v.log=function(o,E){this.verboseLevel>=o&&V.logger.log(this.time+" ["+o+"] "+E)},m}(),d=function(v){for(var s=[],o=0;o<v.length;o++)s.push(v[o].toString(16));return s},l=function(){function m(s,o,E,g,C){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=o||!1,this.italics=E||!1,this.background=g||"black",this.flash=C||!1}var v=m.prototype;return v.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},v.setStyles=function(o){for(var E=["foreground","underline","italics","background","flash"],g=0;g<E.length;g++){var C=E[g];o.hasOwnProperty(C)&&(this[C]=o[C])}},v.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},v.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},v.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},v.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},m}(),a=function(){function m(s,o,E,g,C,N){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new l(o,E,g,C,N)}var v=m.prototype;return v.reset=function(){this.uchar=" ",this.penState.reset()},v.setChar=function(o,E){this.uchar=o,this.penState.copy(E)},v.setPenState=function(o){this.penState.copy(o)},v.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},v.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},v.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},m}(),u=function(){function m(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 o=0;o<W;o++)this.chars.push(new a);this.logger=s,this.pos=0,this.currPenState=new l}var v=m.prototype;return v.equals=function(o){for(var E=!0,g=0;g<W;g++)if(!this.chars[g].equals(o.chars[g])){E=!1;break}return E},v.copy=function(o){for(var E=0;E<W;E++)this.chars[E].copy(o.chars[E])},v.isEmpty=function(){for(var o=!0,E=0;E<W;E++)if(!this.chars[E].isEmpty()){o=!1;break}return o},v.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(h.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},v.moveCursor=function(o){var E=this.pos+o;if(o>1)for(var g=this.pos+1;g<E+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(E)},v.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},v.insertChar=function(o){o>=144&&this.backSpace();var E=B(o);if(this.pos>=W){this.logger.log(h.ERROR,"Cannot insert "+o.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(o){var E;for(E=o;E<W;E++)this.chars[E].reset()},v.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},v.clearToEndOfRow=function(){this.clearFromPos(this.pos)},v.getTextString=function(){for(var o=[],E=!0,g=0;g<W;g++){var C=this.chars[g].uchar;C!==" "&&(E=!1),o.push(C)}return E?"":o.join("")},v.setPenStyles=function(o){this.currPenState.setStyles(o);var E=this.chars[this.pos];E.setPenState(this.currPenState)},m}(),c=function(){function m(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 o=0;o<K;o++)this.rows.push(new u(s));this.logger=s,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var v=m.prototype;return v.reset=function(){for(var o=0;o<K;o++)this.rows[o].clear();this.currRow=K-1},v.equals=function(o){for(var E=!0,g=0;g<K;g++)if(!this.rows[g].equals(o.rows[g])){E=!1;break}return E},v.copy=function(o){for(var E=0;E<K;E++)this.rows[E].copy(o.rows[E])},v.isEmpty=function(){for(var o=!0,E=0;E<K;E++)if(!this.rows[E].isEmpty()){o=!1;break}return o},v.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},v.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},v.insertChar=function(o){var E=this.rows[this.currRow];E.insertChar(o)},v.setPen=function(o){var E=this.rows[this.currRow];E.setPenStyles(o)},v.moveCursor=function(o){var E=this.rows[this.currRow];E.moveCursor(o)},v.setCursor=function(o){this.logger.log(h.INFO,"setCursor: "+o);var E=this.rows[this.currRow];E.setCursor(o)},v.setPAC=function(o){this.logger.log(h.INFO,"pacData = "+JSON.stringify(o));var E=o.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var g=0;g<K;g++)this.rows[g].clear();var C=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var U=N.rows[C].cueStartTime,j=this.logger.time;if(U&&j!==null&&U<j)for(var H=0;H<this.nrRollUpRows;H++)this.rows[E-this.nrRollUpRows+H+1].copy(N.rows[C+H])}}this.currRow=E;var y=this.rows[this.currRow];if(o.indent!==null){var x=o.indent,F=Math.max(x-1,0);y.setCursor(o.indent),o.color=y.chars[F].penState.foreground}var Q={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(Q)},v.setBkgData=function(o){this.logger.log(h.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},v.setRollUpRows=function(o){this.nrRollUpRows=o},v.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(h.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(h.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(o,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(h.INFO,"Rolling up")},v.getDisplayText=function(o){o=o||!1;for(var E=[],g="",C=-1,N=0;N<K;N++){var U=this.rows[N].getTextString();U&&(C=N+1,o?E.push("Row "+C+": '"+U+"'"):E.push(U.trim()))}return E.length>0&&(o?g="["+E.join(" | ")+"]":g=E.join(`
`)),g},v.getTextAndFormat=function(){return this.rows},m}(),R=function(){function m(s,o,E){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=o,this.mode=null,this.verbose=0,this.displayedMemory=new c(E),this.nonDisplayedMemory=new c(E),this.lastOutputScreen=new c(E),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var v=m.prototype;return v.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},v.getHandler=function(){return this.outputFilter},v.setHandler=function(o){this.outputFilter=o},v.setPAC=function(o){this.writeScreen.setPAC(o)},v.setBkgData=function(o){this.writeScreen.setBkgData(o)},v.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(h.INFO,"MODE="+o),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=o},v.insertChars=function(o){for(var E=0;E<o.length;E++)this.writeScreen.insertChar(o[E]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(h.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(h.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},v.ccRCL=function(){this.logger.log(h.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},v.ccBS=function(){if(this.logger.log(h.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},v.ccAOF=function(){},v.ccAON=function(){},v.ccDER=function(){this.logger.log(h.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},v.ccRU=function(o){this.logger.log(h.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},v.ccFON=function(){this.logger.log(h.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},v.ccRDC=function(){this.logger.log(h.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},v.ccTR=function(){this.logger.log(h.INFO,"TR"),this.setMode("MODE_TEXT")},v.ccRTD=function(){this.logger.log(h.INFO,"RTD"),this.setMode("MODE_TEXT")},v.ccEDM=function(){this.logger.log(h.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},v.ccCR=function(){this.logger.log(h.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},v.ccENM=function(){this.logger.log(h.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},v.ccEOC=function(){if(this.logger.log(h.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(h.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},v.ccTO=function(o){this.logger.log(h.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},v.ccMIDROW=function(o){var E={flash:!1};if(E.underline=o%2===1,E.italics=o>=46,E.italics)E.foreground="white";else{var g=Math.floor(o/2)-16,C=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=C[g]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},v.outputDataUpdate=function(o){o===void 0&&(o=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},m}(),O=function(){function m(s,o,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new r;this.channels=[null,new R(s,o,g),new R(s+1,E,g)],this.cmdHistory=w(),this.logger=g}var v=m.prototype;return v.getHandler=function(o){return this.channels[o].getHandler()},v.setHandler=function(o,E){this.channels[o].setHandler(E)},v.addData=function(o,E){var g,C,N,U=!1;this.logger.time=o;for(var j=0;j<E.length;j+=2){if(C=E[j]&127,N=E[j+1]&127,C===0&&N===0)continue;if(this.logger.log(h.DATA,"["+d([E[j],E[j+1]])+"] -> ("+d([C,N])+")"),g=this.parseCmd(C,N),g||(g=this.parseMidrow(C,N)),g||(g=this.parsePAC(C,N)),g||(g=this.parseBackgroundAttributes(C,N)),!g&&(U=this.parseChars(C,N),U)){var H=this.currentChannel;if(H&&H>0){var y=this.channels[H];y.insertChars(U)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!U&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+d([C,N])+" orig: "+d([E[j],E[j+1]]))}},v.parseCmd=function(o,E){var g=this.cmdHistory,C=(o===20||o===28||o===21||o===29)&&E>=32&&E<=47,N=(o===23||o===31)&&E>=33&&E<=35;if(!(C||N))return!1;if(A(o,E,g))return T(null,null,g),this.logger.log(h.DEBUG,"Repeated command ("+d([o,E])+") is dropped"),!0;var U=o===20||o===21||o===23?1:2,j=this.channels[U];return o===20||o===21||o===28||o===29?E===32?j.ccRCL():E===33?j.ccBS():E===34?j.ccAOF():E===35?j.ccAON():E===36?j.ccDER():E===37?j.ccRU(2):E===38?j.ccRU(3):E===39?j.ccRU(4):E===40?j.ccFON():E===41?j.ccRDC():E===42?j.ccTR():E===43?j.ccRTD():E===44?j.ccEDM():E===45?j.ccCR():E===46?j.ccENM():E===47&&j.ccEOC():j.ccTO(E-32),T(o,E,g),this.currentChannel=U,!0},v.parseMidrow=function(o,E){var g=0;if((o===17||o===25)&&E>=32&&E<=47){if(o===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var C=this.channels[g];return C?(C.ccMIDROW(E),this.logger.log(h.DEBUG,"MIDROW ("+d([o,E])+")"),!0):!1}return!1},v.parsePAC=function(o,E){var g,C=this.cmdHistory,N=(o>=17&&o<=23||o>=25&&o<=31)&&E>=64&&E<=127,U=(o===16||o===24)&&E>=64&&E<=95;if(!(N||U))return!1;if(A(o,E,C))return T(null,null,C),!0;var j=o<=23?1:2;E>=64&&E<=95?g=j===1?L[o]:b[o]:g=j===1?P[o]:p[o];var H=this.channels[j];return H?(H.setPAC(this.interpretPAC(g,E)),T(o,E,C),this.currentChannel=j,!0):!1},v.interpretPAC=function(o,E){var g,C={color:null,italics:!1,indent:null,underline:!1,row:o};return E>95?g=E-96:g=E-64,C.underline=(g&1)===1,g<=13?C.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(C.italics=!0,C.color="white"):C.indent=Math.floor((g-16)/2)*4,C},v.parseChars=function(o,E){var g,C=null,N=null;if(o>=25?(g=2,N=o-8):(g=1,N=o),N>=17&&N<=19){var U;N===17?U=E+80:N===18?U=E+112:U=E+144,this.logger.log(h.INFO,"Special char '"+B(U)+"' in channel "+g),C=[U]}else o>=32&&o<=127&&(C=E===0?[o]:[o,E]);if(C){var j=d(C);this.logger.log(h.DEBUG,"Char codes = "+j.join(",")),T(o,E,this.cmdHistory)}return C},v.parseBackgroundAttributes=function(o,E){var g=(o===16||o===24)&&E>=32&&E<=47,C=(o===23||o===31)&&E>=45&&E<=47;if(!(g||C))return!1;var N,U={};o===16||o===24?(N=Math.floor((E-32)/2),U.background=_[N],E%2===1&&(U.background=U.background+"_semi")):E===45?U.background="transparent":(U.foreground="black",E===47&&(U.underline=!0));var j=o<=23?1:2,H=this.channels[j];return H.setBkgData(U),T(o,E,this.cmdHistory),!0},v.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var E=this.channels[o];E&&E.reset()}this.cmdHistory=w()},v.cueSplitAtTime=function(o){for(var E=0;E<this.channels.length;E++){var g=this.channels[E];g&&g.cueSplitAtTime(o)}},m}();function T(m,v,s){s.a=m,s.b=v}function A(m,v,s){return s.a===m&&s.b===v}function w(){return{a:null,b:null}}Z.default=O},"./src/utils/codecs.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"isCodecType",function(){return I}),M.d(Z,"isCodecSupportedInMp4",function(){return B});var V={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function I(K,W){var L=V[W];return!!L&&L[K.slice(0,4)]===!0}function B(K,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/utils/vttparser.ts"),I=M("./src/utils/webvtt-parser.ts"),B=M("./src/utils/texttrack-utils.ts"),K=/\s/,W={newCue:function(P,b,p,_){for(var h=[],r,d,l,a,u,c=self.VTTCue||self.TextTrackCue,R=0;R<_.rows.length;R++)if(r=_.rows[R],l=!0,a=0,u="",!r.isEmpty()){for(var O=0;O<r.chars.length;O++)K.test(r.chars[O].uchar)&&l?a++:(u+=r.chars[O].uchar,l=!1);r.cueStartTime=b,b===p&&(p+=1e-4),a>=16?a--:a++;var T=Object(V.fixLineBreaks)(u.trim()),A=Object(I.generateCueId)(b,p,T);(!P||!P.cues||!P.cues.getCueById(A))&&(d=new c(b,p,T),d.id=A,d.line=R+1,d.align="left",d.position=10+Math.min(80,Math.floor(a*8/32)*10),h.push(d))}return P&&h.length&&(h.sort(function(w,m){return w.line==="auto"||m.line==="auto"?0:w.line>8&&m.line>8?m.line-w.line:w.line-m.line}),h.forEach(function(w){return Object(B.addCueToTrack)(P,w)})),h}};Z.default=W},"./src/utils/discontinuities.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"findFirstFragWithCC",function(){return K}),M.d(Z,"shouldAlignOnDiscontinuities",function(){return W}),M.d(Z,"findDiscontinuousReferenceFrag",function(){return L}),M.d(Z,"adjustSlidingStart",function(){return b}),M.d(Z,"alignStream",function(){return p}),M.d(Z,"alignPDT",function(){return h}),M.d(Z,"alignFragmentByPDTDelta",function(){return r}),M.d(Z,"alignMediaPlaylistByPDT",function(){return d});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/logger.ts"),B=M("./src/controller/level-helper.ts");function K(l,a){for(var u=null,c=0,R=l.length;c<R;c++){var O=l[c];if(O&&O.cc===a){u=O;break}}return u}function W(l,a,u){return!!(a.details&&(u.endCC>u.startCC||l&&l.cc<u.startCC))}function L(l,a){var u=l.fragments,c=a.fragments;if(!c.length||!u.length){I.logger.log("No fragments to align");return}var R=K(u,c[0].cc);if(!R||R&&!R.startPTS){I.logger.log("No frag in previous level to align on");return}return R}function P(l,a){if(l){var u=l.start+a;l.start=l.startPTS=u,l.endPTS=u+l.duration}}function b(l,a){for(var u=a.fragments,c=0,R=u.length;c<R;c++)P(u[c],l);a.fragmentHint&&P(a.fragmentHint,l),a.alignedSliding=!0}function p(l,a,u){if(!a)return;_(l,u,a),!u.alignedSliding&&a.details&&h(u,a.details),!u.alignedSliding&&a.details&&!u.skippedSegments&&Object(B.adjustSliding)(a.details,u)}function _(l,a,u){if(W(l,u,a)){var c=L(u.details,a);c&&Object(V.isFiniteNumber)(c.start)&&(I.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),b(c.start,a))}}function h(l,a){if(!a.fragments.length||!l.hasProgramDateTime||!a.hasProgramDateTime)return;var u=a.fragments[0].programDateTime,c=l.fragments[0].programDateTime,R=(c-u)/1e3+a.fragments[0].start;R&&Object(V.isFiniteNumber)(R)&&(I.logger.log("Adjusting PTS using programDateTime delta "+(c-u)+"ms, sliding:"+R.toFixed(3)+" "+l.url+" "),b(R,l))}function r(l,a){var u=l.programDateTime;if(!u)return;var c=(u-a)/1e3;l.start=l.startPTS=c,l.endPTS=c+l.duration}function d(l,a){if(!a.fragments.length||!l.hasProgramDateTime||!a.hasProgramDateTime)return;var u=a.fragments[0].programDateTime,c=a.fragments[0].start,R=u-c*1e3;l.fragments.forEach(function(O){r(O,R)}),l.fragmentHint&&r(l.fragmentHint,R),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/utils/ewma.ts"),I=function(){function B(W,L,P){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=P,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(W),this.fast_=new V.default(L)}var K=B.prototype;return K.update=function(L,P){var b=this.slow_,p=this.fast_;this.slow_.halfLife!==L&&(this.slow_=new V.default(L,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==P&&(this.fast_=new V.default(P,p.getEstimate(),p.getTotalWeight()))},K.sample=function(L,P){L=Math.max(L,this.minDelayMs_);var b=8*P,p=L/1e3,_=b/p;this.fast_.sample(p,_),this.slow_.sample(p,_)},K.canEstimate=function(){var L=this.fast_;return L&&L.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},B}();Z.default=I},"./src/utils/ewma.ts":function(de,Z,M){"use strict";M.r(Z);var V=function(){function I(K,W,L){W===void 0&&(W=0),L===void 0&&(L=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=W,this.totalWeight_=L}var B=I.prototype;return B.sample=function(W,L){var P=Math.pow(this.alpha_,W);this.estimate_=L*(1-P)+P*this.estimate_,this.totalWeight_+=W},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},I}();Z.default=V},"./src/utils/fetch-loader.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"fetchSupported",function(){return r});var V=M("./src/polyfills/number.ts"),I=M("./src/loader/load-stats.ts"),B=M("./src/demux/chunk-cache.ts");function K(c,R){c.prototype=Object.create(R.prototype),c.prototype.constructor=c,p(c,R)}function W(c){var R=typeof Map=="function"?new Map:void 0;return W=function(T){if(T===null||!b(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(T))return R.get(T);R.set(T,A)}function A(){return L(T,arguments,_(this).constructor)}return A.prototype=Object.create(T.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),p(A,T)},W(c)}function L(c,R,O){return P()?L=Reflect.construct:L=function(A,w,m){var v=[null];v.push.apply(v,w);var s=Function.bind.apply(A,v),o=new s;return m&&p(o,m.prototype),o},L.apply(null,arguments)}function P(){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 b(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function p(c,R){return p=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},p(c,R)}function _(c){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(O){return O.__proto__||Object.getPrototypeOf(O)},_(c)}function h(){return h=Object.assign||function(c){for(var R=1;R<arguments.length;R++){var O=arguments[R];for(var T in O)Object.prototype.hasOwnProperty.call(O,T)&&(c[T]=O[T])}return c},h.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(c){}return!1}var d=function(){function c(O){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=O.fetchSetup||a,this.controller=new self.AbortController,this.stats=new I.LoadStats}var R=c.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(T,A,w){var m=this,v=this.stats;if(v.loading.start)throw new Error("Loader can only be used once.");v.loading.start=self.performance.now();var s=l(T,this.controller.signal),o=w.onProgress,E=T.responseType==="arraybuffer",g=E?"byteLength":"length";this.context=T,this.config=A,this.callbacks=w,this.request=this.fetchSetup(T,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){m.abortInternal(),w.onTimeout(v,T,m.response)},A.timeout),self.fetch(this.request).then(function(C){if(m.response=m.loader=C,!C.ok){var N=C.status,U=C.statusText;throw new u(U||"fetch, bad network response",N,C)}return v.loading.first=Math.max(self.performance.now(),v.loading.start),v.total=parseInt(C.headers.get("Content-Length")||"0"),o&&Object(V.isFiniteNumber)(A.highWaterMark)?m.loadProgressively(C,v,T,A.highWaterMark,o):E?C.arrayBuffer():C.text()}).then(function(C){var N=m.response;self.clearTimeout(m.requestTimeout),v.loading.end=Math.max(self.performance.now(),v.loading.first),v.loaded=v.total=C[g];var U={url:N.url,data:C};o&&!Object(V.isFiniteNumber)(A.highWaterMark)&&o(v,T,C,N),w.onSuccess(U,v,T,N)}).catch(function(C){if(self.clearTimeout(m.requestTimeout),v.aborted)return;var N=C.code||0;w.onError({code:N,text:C.message},T,C.details)})},R.getCacheAge=function(){var T=null;if(this.response){var A=this.response.headers.get("age");T=A?parseFloat(A):null}return T},R.loadProgressively=function(T,A,w,m,v){m===void 0&&(m=0);var s=new B.default,o=T.body.getReader(),E=function g(){return o.read().then(function(C){if(C.done)return s.dataLength&&v(A,w,s.flush(),T),Promise.resolve(new ArrayBuffer(0));var N=C.value,U=N.length;return A.loaded+=U,U<m||s.dataLength?(s.push(N),s.dataLength>=m&&v(A,w,s.flush(),T)):v(A,w,N,T),g()}).catch(function(){return Promise.reject()})};return E()},c}();function l(c,R){var O={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(h({},c.headers))};return c.rangeEnd&&O.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),O}function a(c,R){return new self.Request(c.url,R)}var u=function(c){K(R,c);function R(O,T,A){var w;return w=c.call(this,O)||this,w.code=void 0,w.details=void 0,w.code=T,w.details=A,w}return R}(W(Error));Z.default=d},"./src/utils/imsc1-ttml-parser.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"IMSC1_CODEC",function(){return b}),M.d(Z,"parseIMSC1",function(){return r});var V=M("./src/utils/mp4-tools.ts"),I=M("./src/utils/vttparser.ts"),B=M("./src/utils/vttcue.ts"),K=M("./src/demux/id3.ts"),W=M("./src/utils/timescale-conversion.ts"),L=M("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(m){for(var v=1;v<arguments.length;v++){var s=arguments[v];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(m[o]=s[o])}return m},P.apply(this,arguments)}var b="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,_=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,h={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(m,v,s,o,E){var g=Object(V.findBox)(new Uint8Array(m),["mdat"]);if(g.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var C=g[0],N=Object(K.utf8ArrayToStr)(new Uint8Array(m,C.start,C.end-C.start)),U=Object(W.toTimescaleFromScale)(v,1,s);try{o(d(N,U))}catch(j){E(j)}}function d(m,v){var s=new DOMParser,o=s.parseFromString(m,"text/xml"),E=o.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},C=Object.keys(g).reduce(function(y,x){return y[x]=E.getAttribute("ttp:"+x)||g[x],y},{}),N=E.getAttribute("xml:space")!=="preserve",U=a(l(E,"styling","style")),j=a(l(E,"layout","region")),H=l(E,"body","[begin]");return[].map.call(H,function(y){var x=u(y,N);if(!x||!y.hasAttribute("begin"))return null;var F=T(y.getAttribute("begin"),C),Q=T(y.getAttribute("dur"),C),q=T(y.getAttribute("end"),C);if(F===null)throw O(y);if(q===null){if(Q===null)throw O(y);q=F+Q}var ie=new B.default(F-v,q-v,x);ie.id=Object(L.generateCueId)(ie.startTime,ie.endTime,ie.text);var ge=j[y.getAttribute("region")],fe=U[y.getAttribute("style")];ie.position=10,ie.size=80;var ue=c(ge,fe),he=ue.textAlign;if(he){var _e=h[he];_e&&(ie.lineAlign=_e),ie.align=he}return P(ie,ue),ie}).filter(function(y){return y!==null})}function l(m,v,s){var o=m.getElementsByTagName(v)[0];return o?[].slice.call(o.querySelectorAll(s)):[]}function a(m){return m.reduce(function(v,s){var o=s.getAttribute("xml:id");return o&&(v[o]=s),v},{})}function u(m,v){return[].slice.call(m.childNodes).reduce(function(s,o,E){var g;return o.nodeName==="br"&&E?s+`
`:(g=o.childNodes)!==null&&g!==void 0&&g.length?u(o,v):v?s+o.textContent.trim().replace(/\s+/g," "):s+o.textContent},"")}function c(m,v){var s="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(E,g){var C=R(v,s,g)||R(m,s,g);return C&&(E[g]=C),E},{})}function R(m,v,s){return m.hasAttributeNS(v,s)?m.getAttributeNS(v,s):null}function O(m){return new Error("Could not parse ttml timestamp "+m)}function T(m,v){if(!m)return null;var s=Object(I.parseTimeStamp)(m);return s===null&&(p.test(m)?s=A(m,v):_.test(m)&&(s=w(m,v))),s}function A(m,v){var s=p.exec(m),o=(s[4]|0)+(s[5]|0)/v.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+o/v.frameRate}function w(m,v){var s=_.exec(m),o=Number(s[1]),E=s[2];switch(E){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/v.frameRate;case"t":return o/v.tickRate}return o}},"./src/utils/logger.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"enableLogs",function(){return L}),M.d(Z,"logger",function(){return P});var V=function(){},I={trace:V,debug:V,log:V,warn:V,info:V,error:V},B=I;function K(b){var p=self.console[b];return p?p.bind(self.console,"["+b+"] >"):V}function W(b){for(var p=arguments.length,_=new Array(p>1?p-1:0),h=1;h<p;h++)_[h-1]=arguments[h];_.forEach(function(r){B[r]=b[r]?b[r].bind(b):K(r)})}function L(b){if(self.console&&b===!0||typeof b=="object"){W(b,"debug","log","info","warn","error");try{B.log()}catch(p){B=I}}else B=I}var P=B},"./src/utils/mediakeys-helper.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"KeySystems",function(){return V}),M.d(Z,"requestMediaKeySystemAccess",function(){return I});var V;(function(B){B.WIDEVINE="com.widevine.alpha",B.PLAYREADY="com.microsoft.playready"})(V||(V={}));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(de,Z,M){"use strict";M.r(Z),M.d(Z,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"bin2str",function(){return W}),M.d(Z,"readUint16",function(){return L}),M.d(Z,"readUint32",function(){return P}),M.d(Z,"writeUint32",function(){return b}),M.d(Z,"findBox",function(){return p}),M.d(Z,"parseSegmentIndex",function(){return _}),M.d(Z,"parseInitSegment",function(){return h}),M.d(Z,"getStartDTS",function(){return r}),M.d(Z,"getDuration",function(){return d}),M.d(Z,"computeRawDurationFromSamples",function(){return l}),M.d(Z,"offsetStartDTS",function(){return a}),M.d(Z,"segmentValidRange",function(){return u}),M.d(Z,"appendUint8Array",function(){return c});var V=M("./src/utils/typed-array.ts"),I=M("./src/loader/fragment.ts"),B=Math.pow(2,32)-1,K=[].push;function W(R){return String.fromCharCode.apply(null,R)}function L(R,O){"data"in R&&(O+=R.start,R=R.data);var T=R[O]<<8|R[O+1];return T<0?65536+T:T}function P(R,O){"data"in R&&(O+=R.start,R=R.data);var T=R[O]<<24|R[O+1]<<16|R[O+2]<<8|R[O+3];return T<0?4294967296+T:T}function b(R,O,T){"data"in R&&(O+=R.start,R=R.data),R[O]=T>>24,R[O+1]=T>>16&255,R[O+2]=T>>8&255,R[O+3]=T&255}function p(R,O){var T=[];if(!O.length)return T;var A,w,m;"data"in R?(A=R.data,w=R.start,m=R.end):(A=R,w=0,m=A.byteLength);for(var v=w;v<m;){var s=P(A,v),o=W(A.subarray(v+4,v+8)),E=s>1?v+s:m;if(o===O[0])if(O.length===1)T.push({data:A,start:v+8,end:E});else{var g=p({data:A,start:v+8,end:E},O.slice(1));g.length&&K.apply(T,g)}v=E}return T}function _(R){var O=p(R,["moov"]),T=O[0],A=T?T.end:null,w=p(R,["sidx"]);if(!w||!w[0])return null;var m=[],v=w[0],s=v.data[0],o=s===0?8:16,E=P(v,o);o+=4;var g=0,C=0;s===0?o+=8:o+=16,o+=2;var N=v.end+C,U=L(v,o);o+=2;for(var j=0;j<U;j++){var H=o,y=P(v,H);H+=4;var x=y&2147483647,F=(y&2147483648)>>>31;if(F===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=P(v,H);H+=4,m.push({referenceSize:x,subsegmentDuration:Q,info:{duration:Q/E,start:N,end:N+x-1}}),N+=x,H+=4,o=H}return{earliestPresentationTime:g,timescale:E,version:s,referencesCount:U,references:m,moovEndOffset:A}}function h(R){for(var O=[],T=p(R,["moov","trak"]),A=0;A<T.length;A++){var w=T[A],m=p(w,["tkhd"])[0];if(m){var v=m.data[m.start],s=v===0?12:20,o=P(m,s),E=p(w,["mdia","mdhd"])[0];if(E){v=E.data[E.start],s=v===0?12:20;var g=P(E,s),C=p(w,["mdia","hdlr"])[0];if(C){var N=W(C.data.subarray(C.start+8,C.start+12)),U={soun:I.ElementaryStreamTypes.AUDIO,vide:I.ElementaryStreamTypes.VIDEO}[N];if(U){var j=p(w,["mdia","minf","stbl","stsd"])[0],H=void 0;j&&(H=W(j.data.subarray(j.start+12,j.start+16))),O[o]={timescale:g,type:U},O[U]={timescale:g,id:o,codec:H}}}}}}var y=p(R,["moov","mvex","trex"]);return y.forEach(function(x){var F=P(x,4),Q=O[F];Q&&(Q.default={duration:P(x,12),flags:P(x,20)})}),O}function r(R,O){return p(O,["moof","traf"]).reduce(function(T,A){var w=p(A,["tfdt"])[0],m=w.data[w.start],v=p(A,["tfhd"]).reduce(function(s,o){var E=P(o,4),g=R[E];if(g){var C=P(w,4);m===1&&(C*=Math.pow(2,32),C+=P(w,8));var N=g.timescale||9e4,U=C/N;if(isFinite(U)&&(s===null||U<s))return U}return s},null);return v!==null&&isFinite(v)&&(T===null||v<T)?v:T},null)||0}function d(R,O){for(var T=0,A=0,w=0,m=p(R,["moof","traf"]),v=0;v<m.length;v++){var s=m[v],o=p(s,["tfhd"])[0],E=P(o,4),g=O[E];if(!g)continue;var C=g.default,N=P(o,0)|(C==null?void 0:C.flags),U=C==null?void 0:C.duration;N&8&&(N&2?U=P(o,12):U=P(o,8));for(var j=g.timescale||9e4,H=p(s,["trun"]),y=0;y<H.length;y++){if(U){var x=P(H[y],4);T=U*x}else T=l(H[y]);g.type===I.ElementaryStreamTypes.VIDEO?A+=T/j:g.type===I.ElementaryStreamTypes.AUDIO&&(w+=T/j)}}if(A===0&&w===0){var F=_(R);if(F!=null&&F.references)return F.references.reduce(function(Q,q){return Q+q.info.duration||0},0)}return A||w}function l(R){var O=P(R,0),T=8;O&1&&(T+=4),O&4&&(T+=4);for(var A=0,w=P(R,4),m=0;m<w;m++){if(O&256){var v=P(R,T);A+=v,T+=4}O&512&&(T+=4),O&1024&&(T+=4),O&2048&&(T+=4)}return A}function a(R,O,T){p(O,["moof","traf"]).forEach(function(A){p(A,["tfhd"]).forEach(function(w){var m=P(w,4),v=R[m];if(!v)return;var s=v.timescale||9e4;p(A,["tfdt"]).forEach(function(o){var E=o.data[o.start],g=P(o,4);if(E===0)b(o,4,g-T*s);else{g*=Math.pow(2,32),g+=P(o,8),g-=T*s,g=Math.max(g,0);var C=Math.floor(g/(B+1)),N=Math.floor(g%(B+1));b(o,4,C),b(o,8,N)}})})})}function u(R){var O={valid:null,remainder:null},T=p(R,["moof"]);if(T){if(T.length<2)return O.remainder=R,O}else return O;var A=T[T.length-1];return O.valid=Object(V.sliceUint8)(R,0,A.start-8),O.remainder=Object(V.sliceUint8)(R,A.start-8),O}function c(R,O){var T=new Uint8Array(R.length+O.length);return T.set(R),T.set(O,R.length),T}},"./src/utils/output-filter.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return V});var V=function(){function I(K,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=W}var B=I.prototype;return B.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},B.newCue=function(W,L,P){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=L,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},I}()},"./src/utils/texttrack-utils.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"sendAddTrackEvent",function(){return I}),M.d(Z,"addCueToTrack",function(){return B}),M.d(Z,"clearCurrentCues",function(){return K}),M.d(Z,"removeCuesInRange",function(){return W}),M.d(Z,"getCuesInRange",function(){return P});var V=M("./src/utils/logger.ts");function I(b,p){var _;try{_=new Event("addtrack")}catch(h){_=document.createEvent("Event"),_.initEvent("addtrack",!1,!1)}_.track=b,p.dispatchEvent(_)}function B(b,p){var _=b.mode;if(_==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(p.id))try{if(b.addCue(p),!b.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(r){V.logger.debug("[texttrack-utils]: "+r);var h=new self.TextTrackCue(p.startTime,p.endTime,p.text);h.id=p.id,b.addCue(h)}_==="disabled"&&(b.mode=_)}function K(b){var p=b.mode;if(p==="disabled"&&(b.mode="hidden"),b.cues)for(var _=b.cues.length;_--;)b.removeCue(b.cues[_]);p==="disabled"&&(b.mode=p)}function W(b,p,_){var h=b.mode;if(h==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var r=P(b.cues,p,_),d=0;d<r.length;d++)b.removeCue(r[d]);h==="disabled"&&(b.mode=h)}function L(b,p){if(p<b[0].startTime)return 0;var _=b.length-1;if(p>b[_].endTime)return-1;for(var h=0,r=_;h<=r;){var d=Math.floor((r+h)/2);if(p<b[d].startTime)r=d-1;else if(p>b[d].startTime&&h<_)h=d+1;else return d}return b[h].startTime-p<p-b[r].startTime?h:r}function P(b,p,_){var h=[],r=L(b,p);if(r>-1)for(var d=r,l=b.length;d<l;d++){var a=b[d];if(a.startTime>=p&&a.endTime<=_)h.push(a);else if(a.startTime>_)return h}return h}},"./src/utils/time-ranges.ts":function(de,Z,M){"use strict";M.r(Z);var V={toString:function(B){for(var K="",W=B.length,L=0;L<W;L++)K+="["+B.start(L).toFixed(3)+","+B.end(L).toFixed(3)+"]";return K}};Z.default=V},"./src/utils/timescale-conversion.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"toTimescaleFromBase",function(){return I}),M.d(Z,"toTimescaleFromScale",function(){return B}),M.d(Z,"toMsFromMpegTsClock",function(){return K}),M.d(Z,"toMpegTsClockFromTimescale",function(){return W});var V=9e4;function I(L,P,b,p){b===void 0&&(b=1),p===void 0&&(p=!1);var _=L*P*b;return p?Math.round(_):_}function B(L,P,b,p){return b===void 0&&(b=1),p===void 0&&(p=!1),I(L,P,1/b,p)}function K(L,P){return P===void 0&&(P=!1),I(L,1e3,1/V,P)}function W(L,P){return P===void 0&&(P=1),I(L,V,1/P)}},"./src/utils/typed-array.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"sliceUint8",function(){return V});function V(I,B,K){return Uint8Array.prototype.slice?I.slice(B,K):new Uint8Array(Array.prototype.slice.call(I,B,K))}},"./src/utils/vttcue.ts":function(de,Z,M){"use strict";M.r(Z),Z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],I=["start","middle","end","left","right"];function B(b,p){if(typeof p!="string")return!1;if(!Array.isArray(b))return!1;var _=p.toLowerCase();return~b.indexOf(_)?_:!1}function K(b){return B(V,b)}function W(b){return B(I,b)}function L(b){for(var p=arguments.length,_=new Array(p>1?p-1:0),h=1;h<p;h++)_[h-1]=arguments[h];for(var r=1;r<arguments.length;r++){var d=arguments[r];for(var l in d)b[l]=d[l]}return b}function P(b,p,_){var h=this,r={enumerable:!0};h.hasBeenReset=!1;var d="",l=!1,a=b,u=p,c=_,R=null,O="",T=!0,A="auto",w="start",m=50,v="middle",s=50,o="middle";Object.defineProperty(h,"id",L({},r,{get:function(){return d},set:function(g){d=""+g}})),Object.defineProperty(h,"pauseOnExit",L({},r,{get:function(){return l},set:function(g){l=!!g}})),Object.defineProperty(h,"startTime",L({},r,{get:function(){return a},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");a=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",L({},r,{get:function(){return u},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");u=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",L({},r,{get:function(){return c},set:function(g){c=""+g,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",L({},r,{get:function(){return R},set:function(g){R=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",L({},r,{get:function(){return O},set:function(g){var C=K(g);if(C===!1)throw new SyntaxError("An invalid or illegal string was specified.");O=C,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",L({},r,{get:function(){return T},set:function(g){T=!!g,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",L({},r,{get:function(){return A},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",L({},r,{get:function(){return w},set:function(g){var C=W(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");w=C,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",L({},r,{get:function(){return m},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");m=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",L({},r,{get:function(){return v},set:function(g){var C=W(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");v=C,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",L({},r,{get:function(){return s},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");s=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",L({},r,{get:function(){return o},set:function(g){var C=W(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");o=C,this.hasBeenReset=!0}})),h.displayState=void 0}return P.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"parseTimeStamp",function(){return B}),M.d(Z,"fixLineBreaks",function(){return p}),M.d(Z,"VTTParser",function(){return _});var V=M("./src/utils/vttcue.ts"),I=function(){function h(){}var r=h.prototype;return r.decode=function(l,a){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},h}();function B(h){function r(l,a,u,c){return(l|0)*3600+(a|0)*60+(u|0)+parseFloat(c||0)}var d=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?r(d[2],d[3],0,d[4]):r(d[1],d[2],d[3],d[4]):null}var K=function(){function h(){this.values=Object.create(null)}var r=h.prototype;return r.set=function(l,a){!this.get(l)&&a!==""&&(this.values[l]=a)},r.get=function(l,a,u){return u?this.has(l)?this.values[l]:a[u]:this.has(l)?this.values[l]:a},r.has=function(l){return l in this.values},r.alt=function(l,a,u){for(var c=0;c<u.length;++c)if(a===u[c]){this.set(l,a);break}},r.integer=function(l,a){/^-?\d+$/.test(a)&&this.set(l,parseInt(a,10))},r.percent=function(l,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var u=parseFloat(a);if(u>=0&&u<=100)return this.set(l,u),!0}return!1},h}();function W(h,r,d,l){var a=l?h.split(l):[h];for(var u in a){if(typeof a[u]!="string")continue;var c=a[u].split(d);if(c.length!==2)continue;var R=c[0],O=c[1];r(R,O)}}var L=new V.default(0,0,""),P=L.align==="middle"?"middle":"center";function b(h,r,d){var l=h;function a(){var R=B(h);if(R===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),R}function u(R,O){var T=new K;W(R,function(m,v){var s;switch(m){case"region":for(var o=d.length-1;o>=0;o--)if(d[o].id===v){T.set(m,d[o].region);break}break;case"vertical":T.alt(m,v,["rl","lr"]);break;case"line":s=v.split(","),T.integer(m,s[0]),T.percent(m,s[0])&&T.set("snapToLines",!1),T.alt(m,s[0],["auto"]),s.length===2&&T.alt("lineAlign",s[1],["start",P,"end"]);break;case"position":s=v.split(","),T.percent(m,s[0]),s.length===2&&T.alt("positionAlign",s[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":T.percent(m,v);break;case"align":T.alt(m,v,["start",P,"end","left","right"]);break}},/:/,/\s/),O.region=T.get("region",null),O.vertical=T.get("vertical","");var A=T.get("line","auto");A==="auto"&&L.line===-1&&(A=-1),O.line=A,O.lineAlign=T.get("lineAlign","start"),O.snapToLines=T.get("snapToLines",!0),O.size=T.get("size",100),O.align=T.get("align",P);var w=T.get("position","auto");w==="auto"&&L.position===50&&(w=O.align==="start"||O.align==="left"?0:O.align==="end"||O.align==="right"?100:50),O.position=w}function c(){h=h.replace(/^\s+/,"")}if(c(),r.startTime=a(),c(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);h=h.substr(3),c(),r.endTime=a(),c(),u(h,r)}function p(h){return h.replace(/<br(?: \/)?>/gi,`
`)}var _=function(){function h(){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 r=h.prototype;return r.parse=function(l){var a=this;l&&(a.buffer+=a.decoder.decode(l,{stream:!0}));function u(){var w=a.buffer,m=0;for(w=p(w);m<w.length&&w[m]!=="\r"&&w[m]!==`
`;)++m;var v=w.substr(0,m);return w[m]==="\r"&&++m,w[m]===`
`&&++m,a.buffer=w.substr(m),v}function c(w){W(w,function(m,v){},/:/)}try{var R="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;R=u();var O=R.match(/^()?WEBVTT([ \t].*)?$/);if(!O||!O[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var T=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;T?T=!1:R=u();switch(a.state){case"HEADER":/:/.test(R)?c(R):R||(a.state="ID");continue;case"NOTE":R||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){a.state="NOTE";break}if(!R)continue;if(a.cue=new V.default(0,0,""),a.state="CUE",R.indexOf("-->")===-1){a.cue.id=R;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{b(R,a.cue,a.regionList)}catch(w){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var A=R.indexOf("-->")!==-1;if(!R||A&&(T=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
`),a.cue.text+=R}continue;case"BADCUE":R||(a.state="ID")}}}catch(w){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){l.onparsingerror&&l.onparsingerror(a)}return l.onflush&&l.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"generateCueId",function(){return _}),M.d(Z,"parseWebVTT",function(){return r});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/vttparser.ts"),B=M("./src/demux/id3.ts"),K=M("./src/utils/timescale-conversion.ts"),W=M("./src/remux/mp4-remuxer.ts"),L=/\r\n|\n\r|\n|\r/g,P=function(l,a,u){return u===void 0&&(u=0),l.substr(u,a.length)===a},b=function(l){var a=parseInt(l.substr(-3)),u=parseInt(l.substr(-6,2)),c=parseInt(l.substr(-9,2)),R=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(u)||!Object(V.isFiniteNumber)(c)||!Object(V.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return a+=1e3*u,a+=60*1e3*c,a+=60*60*1e3*R,a},p=function(l){for(var a=5381,u=l.length;u;)a=a*33^l.charCodeAt(--u);return(a>>>0).toString()};function _(d,l,a){return p(d.toString())+p(l.toString())+p(a)}var h=function(l,a,u){var c=l[a],R=l[c.prevCC];if(!R||!R.new&&c.new){l.ccOffset=l.presentationOffset=c.start,c.new=!1;return}for(;(O=R)!==null&&O!==void 0&&O.new;){var O;l.ccOffset+=c.start-R.start,c.new=!1,c=R,R=l[c.prevCC]}l.presentationOffset=u};function r(d,l,a,u,c,R,O,T){var A=new I.VTTParser,w=Object(B.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(L,`
`).split(`
`),m=[],v=Object(K.toMpegTsClockFromTimescale)(l,a),s="00:00.000",o=0,E=0,g,C=!0,N=!1;A.oncue=function(U){var j=u[c],H=u.ccOffset,y=(o-v)/9e4;if(j!=null&&j.new&&(E!==void 0?H=u.ccOffset=j.start:h(u,c,y)),y&&(H=y-u.presentationOffset),N){var x=U.endTime-U.startTime,F=Object(W.normalizePts)((U.startTime+H-E)*9e4,R*9e4)/9e4;U.startTime=F,U.endTime=F+x}var Q=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(Q)),U.id||(U.id=_(U.startTime,U.endTime,Q)),U.endTime>0&&m.push(U)},A.onparsingerror=function(U){g=U},A.onflush=function(){if(g){T(g);return}O(m)},w.forEach(function(U){if(C)if(P(U,"X-TIMESTAMP-MAP=")){C=!1,N=!0,U.substr(16).split(",").forEach(function(j){P(j,"LOCAL:")?s=j.substr(6):P(j,"MPEGTS:")&&(o=parseInt(j.substr(7)))});try{E=b(s)/1e3}catch(j){N=!1,g=j}return}else U===""&&(C=!1);A.parse(U+`
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/utils/logger.ts"),I=M("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,K=function(){function W(P){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=P?P.xhrSetup:null,this.stats=new I.LoadStats,this.retryDelay=0}var L=W.prototype;return L.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},L.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},L.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},L.load=function(b,p,_){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=p,this.callbacks=_,this.retryDelay=p.retryDelay,this.loadInternal()},L.loadInternal=function(){var b=this.config,p=this.context;if(!b)return;var _=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var r=this.xhrSetup;try{if(r)try{r(_,p.url)}catch(a){_.open("GET",p.url,!0),r(_,p.url)}_.readyState||_.open("GET",p.url,!0);var d=this.context.headers;if(d)for(var l in d)_.setRequestHeader(l,d[l])}catch(a){this.callbacks.onError({code:_.status,text:a.message},p,_);return}p.rangeEnd&&_.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),_.onreadystatechange=this.readystatechange.bind(this),_.onprogress=this.loadprogress.bind(this),_.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),_.send()},L.readystatechange=function(){var b=this.context,p=this.loader,_=this.stats;if(!b||!p)return;var h=p.readyState,r=this.config;if(_.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),_.loading.first===0&&(_.loading.first=Math.max(self.performance.now(),_.loading.start)),h===4){p.onreadystatechange=null,p.onprogress=null;var d=p.status;if(d>=200&&d<300){_.loading.end=Math.max(self.performance.now(),_.loading.first);var l,a;if(b.responseType==="arraybuffer"?(l=p.response,a=l.byteLength):(l=p.responseText,a=l.length),_.loaded=_.total=a,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(_,b,l,p),!this.callbacks)return;var c={url:p.responseURL,data:l};this.callbacks.onSuccess(c,_,b,p)}else _.retry>=r.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+b.url),this.callbacks.onError({code:d,text:p.statusText},b,p)):(V.logger.warn(d+" while loading "+b.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,r.maxRetryDelay),_.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},L.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},L.loadprogress=function(b){var p=this.stats;p.loaded=b.loaded,b.lengthComputable&&(p.total=b.total)},L.getCacheAge=function(){var b=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");b=p?parseFloat(p):null}return b},W}();Z.default=K}}).default})},vHTk:function(ft,Xe,G){ft.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(ft,Xe,G){"use strict";var de=G("+L6B"),Z=G("2/Rp"),M=G("5NDa"),V=G("5rEg"),I=G("y8nQ"),B=G("Vl3Y"),K=G("tJVT"),W=G("q1tI"),L=G.n(W),P=G("a+yL"),b=G.n(P),p=function(h){var r=h.value,d=h.onChange,l=B.a.useForm(),a=Object(K.a)(l,1),u=a[0];Object(W.useEffect)(function(){r&&u.setFieldsValue(r)},r);var c=function(O){d(O)};return L.a.createElement("div",{className:b.a.search},L.a.createElement(B.a,{className:b.a.formWrap,colon:!1,form:u,size:"large",layout:"inline",onFinish:c},L.a.createElement(B.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},L.a.createElement(V.a,{style:{width:280,height:40}})),L.a.createElement(B.a.Item,{label:"\u5B66\u6821/\u5355\u4F4D",name:"schools",initialValue:"",style:{margin:"0 40px"}},L.a.createElement(V.a,{style:{width:280,height:40}})),L.a.createElement(B.a.Item,{label:"\u521B\u5EFA\u8005",name:"creator",initialValue:""},L.a.createElement(V.a,{style:{width:200,height:40}})),L.a.createElement(Z.a,{className:b.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};Xe.a=p},wNkr:function(ft,Xe){ft.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAoCAYAAACFFRgXAAAAAXNSR0IArs4c6QAABIdJREFUWEftWGtMm1UYfg5taScYNhbt5qAFioMRE6aRkGiQP8vEJcZFZ5YYr9Fd3NTID/3hdS5xXoKZZpvrNsBtJotZlkxHyOIIZjLnLiSGxUWHQKXQsoGAjmAp7dcecw609Lt5GN/XTLOdP6f9Lud73ud93ve85yWUUgv+w4MQEkuFR24CNtlbNx7DvmCshtKYFxR5lAKEAGxmI/GbzYYHQYAQy0ZPnrXZkIZ7ApFeBtYwIAAUFASEz9zg6d9sZoOCBu50OfKNAe6flNjS2oN9mN2bAiD/pwY0G6OLXXbZx645S/SkAFZKgFIKQgjYPC2SFNhaJighJ4xNYKQodjnMAKzNjYZLZS5XwZs2jhnJzVEZDHMA631AyY8yCpWAEt7QXY8QePINSsIXYBrWUbAia6gZncooySyiFvmM8DnjZjGsG3KKqFe4XPWaADCLWo9RDftY0M02zyoBKfOGIHEzCRW75hkLOl9/WEr6VLlzCDSgygHKIFOnHXjmCrhgZ2V1SJp45+ya89UziT0162rp5N99rk5i6o2k8kjF9xZYtlyp7TjJNxdRtZYACqCavXBuTbv+zqRgTJQFknuMjsQYMZVHKhJMcOBCwAvO23Wzwmx2KrOfuQnYbEZVcSzSsJ4kOsovoW/Sn1xvs28d9noOYH3PM+iP9OHzogY0jR7FybFWfOTejqWOUuRYc9AwuAf1Q14cLP4KC223IUanFPdxcBtWLXgYh0cOoePvn3TtnrMkLpR3ovxCiWzhlTkPYdOiV/DlH19gde5jeKp7Ld5Y8i4P0g+CW2GBBV+XHseLvuexx7Mf67qfxkA0mFxjd1Ej9g/tw7nxM+YD/v2eK9hxeTtfOBQPwTu4g//+rGA3Vsx/EFUXKzAqjaCl7BQ2+V5AV7hTBqJ5WSvax89iTBrj1xuH9mKbuw4HhurTA/jScj/W+57lH4vGIzgzfppXZk2lLXDanHiu+wlcnPgZJ8ra8LJvAzrDv/Jnc60LMRkP43DJMTQMejEsDfPrDPwnBTvTB1hLEq8ufg2325w4NHwQuwr3YeUvD6D2jtdhJ3a8F3gL2RnZOFF2Cmt/Ww2vp1ElCab7tDHcdlc7/pJGk25m8tjg3Iwnux5HmIbx0qJaTMRDXM9b8t/H3Vn3wpHhQN3Ah2j+8xvsKqyHy+4GRZyvwZ4rmbcM991aBYlG+bVPL9fhu6stMinNOejSnb701hcCzj2dFaY2yXq9AKZ+l0StkhCws2nxm9HcsbevN2gOdiR7qxCwktneYEhKVGti1q/xFK0o31g9XJiXZawengKsPYTHeg1AqadsrUOsYcD+YGj2BbzIBRoFu7KVVLDkFmMM+wdC0nSfZKZ6n2kjyCt6dYUuqvjlKYwQuI0C7uq9KmXabCLu+H0VgbK+kNjeyGQUS4vmG2O49YcOyZ1XiMxMm0YrSnZKTx7pk40g8RtJkyKRKPqCfqyoWm4M8NHjbb3UpGagyE2EIPDoqmpjzcBj3/5YE4tL3nSDZmAtGdaNj9Tcb6zdKmLF7Ps3XgfebAZF6/3vGf4HhYa6OsTsTGoAAAAASUVORK5CYII="},xTzM:function(ft,Xe){ft.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAqRJREFUWEfNmE1o02AYx/9JzJaltHatZRVR5hSRXHYYbCpMmTIRexAsDD0L8+Rphx10DIQddvDowbugCB68iWOKDqeb7tKD+MGKA8vo3Nzch7ZLlsibJjPrkjRvE8hySUiej9/7/PO+b54wmqZx2IMH4wqWv3kIS19HIcTOgVUP1uRX2XmUVl+DxX10vHpX097FwBmMQC3kP4JtSFElYPiKefnLGJrSd+sFdAb70PMQm8o1KiirMR8D5FXv7pzwE5wyjuSJQbQ9KDiDvWwrgIu2eI8ckOXWWhGtvZ3OYONHlYBS0YeJtT52BnueVMAYMTVAvyZnu8N85mS/67kGMAygGQHNa/PcEC+6gCUqFUueBaQRgD9AP3IaD3kR+HQbWHqje9UG63wE7GumSVG/rbIMTF+nAKs/Fb2nd7An9MH9eEz3eaxY11O39dmYEUHNEgBTWY9gp575GT+97/srFrDl0QGo6h1Ai9JH8lFQNQXwJ3cG2Aab7T+CaPNcoEBUwY4Bje3/PSYvGRUjYGIkPDAmDjRdNsBUYBuMfI9968tBbJGoBhqksXgV4Iy3aPKi5R37nB1CJDUcZC6qWEIHIJ6puEx0W8EyEoR0Tt+7nPYwqkyGsdd4wn4gesMGjNwicrKN4cmZ7Af4RFXFCBiRk+PDkzN+oSLnDil1sIwERsjVo1ggPmIKSNyyATPl3PwbnpyHh6qWC3PIRE55Izw501lgZtBmryRylkvhyjn7wmETJ7NzvRienL/m9O5q9xcskXNjPhw5VRlQSsDvgh1YRsLaQnhybpWBP+sOzchU+1toWlfNnaB6ZaddN6zdEfE14ynymH0zMtNzGivfJ8CH1FpGjnc7d0lkhi7m76H8o5e2EL7sGW4E51eG3f/2+Mrgz3nPgv0D9Cc+LoUg84gAAAAASUVORK5CYII="},xlxt:function(ft,Xe,G){ft.exports={flex_box_center:"flex_box_center___1qaRn",flex_space_between:"flex_space_between___3tOTR",flex_box_vertical_center:"flex_box_vertical_center___2XsRs",flex_box_center_end:"flex_box_center_end___3O9De",flex_box_column:"flex_box_column___3bx6a",exportModal:"exportModal___29rdj"}},"yTi+":function(ft,Xe,G){ft.exports=G.p+"static/AssistantCode3.fdd8db3c.jpeg"}}]);