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.
442 lines
1.6 MiB
442 lines
1.6 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[107,3,5,7,8,14],{"+92d":function(Gt,fe,D){Gt.exports=D.p+"static/b1.8d46544a.svg"},"+NIl":function(Gt,fe,D){(function(q){q(D("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(Y,U){"use strict";function G(u,a){u.cmdState.push(a)}function M(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function k(u){var a=u.cmdState.pop();a&&a.closeBracket()}function K(u){for(var a=u.cmdState,o=a.length-1;o>=0;o--){var c=a[o];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function I(u,a,o){return function(){this.name=u,this.bracketNo=0,this.style=a,this.styles=o,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=I("importmodule","tag",["string","builtin"]),r.documentclass=I("documentclass","tag",["","atom"]),r.usepackage=I("usepackage","tag",["atom"]),r.begin=I("begin","tag",["atom"]),r.end=I("end","tag",["atom"]),r.label=I("label","tag",["atom"]),r.ref=I("ref","tag",["atom"]),r.eqref=I("eqref","tag",["atom"]),r.cite=I("cite","tag",["atom"]),r.bibitem=I("bibitem","tag",["atom"]),r.Bibitem=I("Bibitem","tag",["atom"]),r.RBibitem=I("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(u,a){u.f=a}function _(u,a){var o;if(u.match(/^\\[a-zA-Z@]+/)){var c=u.current().slice(1);return o=r.hasOwnProperty(c)?r[c]:r.DEFAULT,o=new o,G(a,o),P(a,m),o.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return P(a,function(i,n){return p(i,n,"\\]")}),"keyword";if(u.match("\\("))return P(a,function(i,n){return p(i,n,"\\)")}),"keyword";if(u.match("$$"))return P(a,function(i,n){return p(i,n,"$$")}),"keyword";if(u.match("$"))return P(a,function(i,n){return p(i,n,"$")}),"keyword";var s=u.next();if(s=="%")return u.skipToEnd(),"comment";if(s=="}"||s=="]"){if(o=M(a),o)o.closeBracket(s),P(a,m);else return"error";return"bracket"}else return s=="{"||s=="["?(o=r.DEFAULT,o=new o,G(a,o),"bracket"):/\d/.test(s)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),o=K(a),o.name=="begin"&&(o.argument=u.current()),o.styleIdentifier())}function p(u,a,o){if(u.eatSpace())return null;if(o&&u.match(o))return P(a,_),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=u.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,a){var o=u.peek(),c;return o=="{"||o=="["?(c=M(a),c.openBracket(o),u.eat(o),P(a,_),"bracket"):/[ \t\r]/.test(o)?(u.eat(o),null):(P(a,_),k(a),_(u,a))}return{startState:function(){var u=U.inMathMode?function(a,o){return p(a,o)}:_;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,a){return a.f(u,a)},blankLine:function(u){u.f=_,u.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+ua5":function(Gt,fe,D){},"/cxE":function(Gt,fe,D){"use strict";D.d(fe,"f",function(){return U}),D.d(fe,"g",function(){return G}),D.d(fe,"h",function(){return M}),D.d(fe,"e",function(){return K}),D.d(fe,"b",function(){return I}),D.d(fe,"c",function(){return r}),D.d(fe,"d",function(){return P}),D.d(fe,"a",function(){return _});class q{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(m=>{m(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const Y=new q;function U(p){K(p)||Y.onUnexpectedError(p);return}function G(p){K(p)||Y.onUnexpectedExternalError(p);return}function M(p){if(p instanceof Error){let{name:m,message:u}=p;const a=p.stacktrace||p.stack;return{$isError:!0,name:m,message:u,stack:a}}return p}const k="Canceled";function K(p){return p instanceof Error&&p.name===k&&p.message===k}function I(){const p=new Error(k);return p.name=p.message,p}function r(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function P(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class _ extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(Gt,fe,D){(function(q){q(D("VrN/"))})(function(q){q.defineOption("placeholder","",function(I,r,P){var _=P&&P!=q.Init;if(r&&!_)I.on("blur",M),I.on("change",k),I.on("swapDoc",k),q.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){G(I)}),k(I);else if(!r&&_){I.off("blur",M),I.off("change",k),I.off("swapDoc",k),q.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),Y(I);var p=I.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}r&&!I.hasFocus()&&M(I)});function Y(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function U(I){Y(I);var r=I.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=I.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var P=I.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),r.appendChild(P),I.display.lineSpace.insertBefore(r,I.display.lineSpace.firstChild)}function G(I){setTimeout(function(){var r=!1,P=I.getInputField();P.nodeName=="TEXTAREA"?r=!P.value:I.lineCount()==1&&(r=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),r?U(I):Y(I)},20)}function M(I){K(I)&&U(I)}function k(I){var r=I.getWrapperElement(),P=K(I);r.className=r.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?U(I):Y(I)}function K(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1eCo":function(Gt,fe,D){(function(q){q(D("VrN/"))})(function(q){"use strict";var Y={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},U={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(G,M){var k=G.indentUnit,K={},I=M.htmlMode?Y:U;for(var r in I)K[r]=I[r];for(var r in M)K[r]=M[r];var P,_;function p(h,y){function g(F){return y.tokenize=F,F(h,y)}var x=h.next();if(x=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?g(a("atom","]]>")):null:h.match("--")?g(a("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),g(o(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),y.tokenize=a("meta","?>"),"meta"):(P=h.eat("/")?"closeTag":"openTag",y.tokenize=m,"tag bracket");if(x=="&"){var j;return h.eat("#")?h.eat("x")?j=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):j=h.eatWhile(/[\d]/)&&h.eat(";"):j=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),j?"atom":"error"}else return h.eatWhile(/[^&<]/),null}p.isInText=!0;function m(h,y){var g=h.next();if(g==">"||g=="/"&&h.eat(">"))return y.tokenize=p,P=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return P="equals",null;if(g=="<"){y.tokenize=p,y.state=n,y.tagName=y.tagStart=null;var x=y.tokenize(h,y);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(g)?(y.tokenize=u(g),y.stringStartCol=h.column(),y.tokenize(h,y)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(h){var y=function(g,x){for(;!g.eol();)if(g.next()==h){x.tokenize=m;break}return"string"};return y.isInAttribute=!0,y}function a(h,y){return function(g,x){for(;!g.eol();){if(g.match(y)){x.tokenize=p;break}g.next()}return h}}function o(h){return function(y,g){for(var x;(x=y.next())!=null;){if(x=="<")return g.tokenize=o(h+1),g.tokenize(y,g);if(x==">")if(h==1){g.tokenize=p;break}else return g.tokenize=o(h-1),g.tokenize(y,g)}return"meta"}}function c(h,y,g){this.prev=h.context,this.tagName=y,this.indent=h.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(y)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function s(h){h.context&&(h.context=h.context.prev)}function i(h,y){for(var g;;){if(!h.context)return;if(g=h.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(y))return;s(h)}}function n(h,y,g){return h=="openTag"?(g.tagStart=y.column(),O):h=="closeTag"?T:n}function O(h,y,g){return h=="word"?(g.tagName=y.current(),_="tag",S):K.allowMissingTagName&&h=="endTag"?(_="tag bracket",S(h,y,g)):(_="error",O)}function T(h,y,g){if(h=="word"){var x=y.current();return g.context&&g.context.tagName!=x&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&s(g),g.context&&g.context.tagName==x||K.matchClosing===!1?(_="tag",w):(_="tag error",R)}else return K.allowMissingTagName&&h=="endTag"?(_="tag bracket",w(h,y,g)):(_="error",R)}function w(h,y,g){return h!="endTag"?(_="error",w):(s(g),n)}function R(h,y,g){return _="error",w(h,y,g)}function S(h,y,g){if(h=="word")return _="attribute",v;if(h=="endTag"||h=="selfcloseTag"){var x=g.tagName,j=g.tagStart;return g.tagName=g.tagStart=null,h=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(x)?i(g,x):(i(g,x),g.context=new c(g,x,j==g.indented)),n}return _="error",S}function v(h,y,g){return h=="equals"?E:(K.allowMissing||(_="error"),S(h,y,g))}function E(h,y,g){return h=="string"?f:h=="word"&&K.allowUnquoted?(_="string",S):(_="error",S(h,y,g))}function f(h,y,g){return h=="string"?f:S(h,y,g)}return{startState:function(h){var y={tokenize:p,state:n,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(y.baseIndent=h),y},token:function(h,y){if(!y.tagName&&h.sol()&&(y.indented=h.indentation()),h.eatSpace())return null;P=null;var g=y.tokenize(h,y);return(g||P)&&g!="comment"&&(_=null,y.state=y.state(P||g,h,y),_&&(g=_=="error"?g+" error":_)),g},indent:function(h,y,g){var x=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+k;if(x&&x.noIndent)return q.Pass;if(h.tokenize!=m&&h.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(h.tagName)return K.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+k*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(y))return 0;var j=y&&/^<(\/)?([\w_:\.-]*)/.exec(y);if(j&&j[1])for(;x;)if(x.tagName==j[2]){x=x.prev;break}else if(K.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(j)for(;x;){var F=K.contextGrabbers[x.tagName];if(F&&F.hasOwnProperty(j[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+k:h.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(h){h.state==E&&(h.state=S)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var y=[],g=h.context;g;g=g.prev)g.tagName&&y.push(g.tagName);return y.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Gt,fe,D){"use strict";D.d(fe,"d",function(){return Bt}),D.d(fe,"b",function(){return ye}),D.d(fe,"c",function(){return St}),D.d(fe,"a",function(){return Dn});var q=D("VTBJ"),Y=D("1OyB"),U=D("vuIU"),G=D("JX7q"),M=D("Ji7U"),k=D("LK+K"),K=D("q1tI"),I=D("I8Z2"),r=D("BGR+"),P=D("wx14"),_=D("rePB"),p=D("4IlW"),m=D("2GS6"),u=D("Gytx"),a=D.n(u),o=D("TSYQ"),c=D.n(o),s=D("U8pU"),i=D("ODXe"),n=/iPhone/i,O=/iPod/i,T=/iPad/i,w=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,S=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,E=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,h=/BlackBerry/i,y=/BB10/i,g=/Opera Mini/i,x=/\b(CriOS|Chrome)(?:.+)Mobile/i,j=/Mobile(?:.+)Firefox\b/i;function F(en,_t){return en.test(_t)}function A(en){var _t=en||(typeof navigator!="undefined"?navigator.userAgent:""),Et=_t.split("[FBAN");if(typeof Et[1]!="undefined"){var st=Et,he=Object(i.a)(st,1);_t=he[0]}if(Et=_t.split("Twitter"),typeof Et[1]!="undefined"){var Le=Et,Lt=Object(i.a)(Le,1);_t=Lt[0]}var ct={apple:{phone:F(n,_t)&&!F(E,_t),ipod:F(O,_t),tablet:!F(n,_t)&&F(T,_t)&&!F(E,_t),device:(F(n,_t)||F(O,_t)||F(T,_t))&&!F(E,_t)},amazon:{phone:F(S,_t),tablet:!F(S,_t)&&F(v,_t),device:F(S,_t)||F(v,_t)},android:{phone:!F(E,_t)&&F(S,_t)||!F(E,_t)&&F(w,_t),tablet:!F(E,_t)&&!F(S,_t)&&!F(w,_t)&&(F(v,_t)||F(R,_t)),device:!F(E,_t)&&(F(S,_t)||F(v,_t)||F(w,_t)||F(R,_t))||F(/\bokhttp\b/i,_t)},windows:{phone:F(E,_t),tablet:F(f,_t),device:F(E,_t)||F(f,_t)},other:{blackberry:F(h,_t),blackberry10:F(y,_t),opera:F(g,_t),firefox:F(j,_t),chrome:F(x,_t),device:F(h,_t)||F(y,_t)||F(g,_t)||F(j,_t)||F(x,_t)},any:null,phone:null,tablet:null};return ct.any=ct.apple.device||ct.android.device||ct.windows.device||ct.other.device,ct.phone=ct.apple.phone||ct.android.phone||ct.windows.phone,ct.tablet=ct.apple.tablet||ct.android.tablet||ct.windows.tablet,ct}var W=Object(q.a)(Object(q.a)({},A()),{},{isMobile:A}),H=W;function C(){}function z(en,_t,Et){var st=_t||"";return en.key||"".concat(st,"item_").concat(Et)}function Z(en){return"".concat(en,"-menu-")}function le(en,_t){var Et=-1;K.Children.forEach(en,function(st){Et+=1,st&&st.type&&st.type.isMenuItemGroup?K.Children.forEach(st.props.children,function(he){Et+=1,_t(he,Et)}):_t(st,Et)})}function se(en,_t,Et){if(!en||Et.find)return;K.Children.forEach(en,function(st){if(st){var he=st.type;if(!he||!(he.isSubMenu||he.isMenuItem||he.isMenuItemGroup))return;_t.indexOf(st.key)!==-1?Et.find=!0:st.props.children&&se(st.props.children,_t,Et)}})}var Ce=["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"],Ee=function(_t){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,st=_t&&typeof _t.getBoundingClientRect=="function"&&_t.getBoundingClientRect().width;if(st){if(Et){var he=getComputedStyle(_t),Le=he.marginLeft,Lt=he.marginRight;st+=+Le.replace("px","")+ +Lt.replace("px","")}st=+st.toFixed(6)}return st||0},Ie=function(_t,Et,st){_t&&Object(s.a)(_t.style)==="object"&&(_t.style[Et]=st)},Qe=function(){return H.any},Xe=D("KQm4"),_e=D("Ff2n"),pe=D("i8i4"),at=D("bdgK"),Qt=D("uciX"),Ft=D("8XRh"),Tt={adjustX:1,adjustY:1},Ve={topLeft:{points:["bl","tl"],overflow:Tt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Tt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Tt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Tt,offset:[4,0]}},pt={topLeft:{points:["bl","tl"],overflow:Tt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Tt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Tt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Tt,offset:[4,0]}},ut=Ve,Ut=0,oe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ue=function(_t,Et,st){var he=Z(Et),Le=_t.getState();_t.setState({defaultActiveFirst:Object(q.a)(Object(q.a)({},Le.defaultActiveFirst),{},Object(_.a)({},he,st))})},ze=function(en){Object(M.a)(Et,en);var _t=Object(k.a)(Et);function Et(st){var he;Object(Y.a)(this,Et),he=_t.call(this,st),he.onDestroy=function(Pe){he.props.onDestroy(Pe)},he.onKeyDown=function(Pe){var et=Pe.keyCode,jt=he.menuInstance,bn=he.props,Kt=bn.isOpen,Xt=bn.store;if(et===p.a.ENTER)return he.onTitleClick(Pe),Ue(Xt,he.props.eventKey,!0),!0;if(et===p.a.RIGHT)return Kt?jt.onKeyDown(Pe):(he.triggerOpenChange(!0),Ue(Xt,he.props.eventKey,!0)),!0;if(et===p.a.LEFT){var Yn;if(Kt)Yn=jt.onKeyDown(Pe);else return;return Yn||(he.triggerOpenChange(!1),Yn=!0),Yn}return Kt&&(et===p.a.UP||et===p.a.DOWN)?jt.onKeyDown(Pe):void 0},he.onOpenChange=function(Pe){he.props.onOpenChange(Pe)},he.onPopupVisibleChange=function(Pe){he.triggerOpenChange(Pe,Pe?"mouseenter":"mouseleave")},he.onMouseEnter=function(Pe){var et=he.props,jt=et.eventKey,bn=et.onMouseEnter,Kt=et.store;Ue(Kt,he.props.eventKey,!1),bn({key:jt,domEvent:Pe})},he.onMouseLeave=function(Pe){var et=he.props,jt=et.parentMenu,bn=et.eventKey,Kt=et.onMouseLeave;jt.subMenuInstance=Object(G.a)(he),Kt({key:bn,domEvent:Pe})},he.onTitleMouseEnter=function(Pe){var et=he.props,jt=et.eventKey,bn=et.onItemHover,Kt=et.onTitleMouseEnter;bn({key:jt,hover:!0}),Kt({key:jt,domEvent:Pe})},he.onTitleMouseLeave=function(Pe){var et=he.props,jt=et.parentMenu,bn=et.eventKey,Kt=et.onItemHover,Xt=et.onTitleMouseLeave;jt.subMenuInstance=Object(G.a)(he),Kt({key:bn,hover:!1}),Xt({key:bn,domEvent:Pe})},he.onTitleClick=function(Pe){var et=Object(G.a)(he),jt=et.props;if(jt.onTitleClick({key:jt.eventKey,domEvent:Pe}),jt.triggerSubMenuAction==="hover")return;he.triggerOpenChange(!jt.isOpen,"click"),Ue(jt.store,he.props.eventKey,!1)},he.onSubMenuClick=function(Pe){typeof he.props.onClick=="function"&&he.props.onClick(he.addKeyPath(Pe))},he.onSelect=function(Pe){he.props.onSelect(Pe)},he.onDeselect=function(Pe){he.props.onDeselect(Pe)},he.getPrefixCls=function(){return"".concat(he.props.rootPrefixCls,"-submenu")},he.getActiveClassName=function(){return"".concat(he.getPrefixCls(),"-active")},he.getDisabledClassName=function(){return"".concat(he.getPrefixCls(),"-disabled")},he.getSelectedClassName=function(){return"".concat(he.getPrefixCls(),"-selected")},he.getOpenClassName=function(){return"".concat(he.props.rootPrefixCls,"-submenu-open")},he.saveMenuInstance=function(Pe){he.menuInstance=Pe},he.addKeyPath=function(Pe){return Object(q.a)(Object(q.a)({},Pe),{},{keyPath:(Pe.keyPath||[]).concat(he.props.eventKey)})},he.triggerOpenChange=function(Pe,et){var jt=he.props.eventKey,bn=function(){he.onOpenChange({key:jt,item:Object(G.a)(he),trigger:et,open:Pe})};et==="mouseenter"?he.mouseenterTimeout=setTimeout(function(){bn()},0):bn()},he.isChildrenSelected=function(){var Pe={find:!1};return se(he.props.children,he.props.selectedKeys,Pe),Pe.find},he.isOpen=function(){return he.props.openKeys.indexOf(he.props.eventKey)!==-1},he.adjustWidth=function(){if(!he.subMenuTitle||!he.menuInstance)return;var Pe=pe.findDOMNode(he.menuInstance);if(Pe.offsetWidth>=he.subMenuTitle.offsetWidth)return;Pe.style.minWidth="".concat(he.subMenuTitle.offsetWidth,"px")},he.saveSubMenuTitle=function(Pe){he.subMenuTitle=Pe},he.getBaseProps=function(){var Pe=Object(G.a)(he),et=Pe.props;return{mode:et.mode==="horizontal"?"vertical":et.mode,visible:he.props.isOpen,level:et.level+1,inlineIndent:et.inlineIndent,focusable:!1,onClick:he.onSubMenuClick,onSelect:he.onSelect,onDeselect:he.onDeselect,onDestroy:he.onDestroy,selectedKeys:et.selectedKeys,eventKey:"".concat(et.eventKey,"-menu-"),openKeys:et.openKeys,motion:et.motion,onOpenChange:he.onOpenChange,subMenuOpenDelay:et.subMenuOpenDelay,parentMenu:Object(G.a)(he),subMenuCloseDelay:et.subMenuCloseDelay,forceSubMenuRender:et.forceSubMenuRender,triggerSubMenuAction:et.triggerSubMenuAction,builtinPlacements:et.builtinPlacements,defaultActiveFirst:et.store.getState().defaultActiveFirst[Z(et.eventKey)],multiple:et.multiple,prefixCls:et.rootPrefixCls,id:he.internalMenuId,manualRef:he.saveMenuInstance,itemIcon:et.itemIcon,expandIcon:et.expandIcon,direction:et.direction}},he.getMotion=function(Pe,et){var jt=Object(G.a)(he),bn=jt.haveRendered,Kt=he.props,Xt=Kt.motion,Yn=Kt.rootPrefixCls,Bn=Object(q.a)(Object(q.a)({},Xt),{},{leavedClassName:"".concat(Yn,"-hidden"),removeOnLeave:!1,motionAppear:bn||!et||Pe!=="inline"});return Bn};var Le=st.store,Lt=st.eventKey,ct=Le.getState(),tn=ct.defaultActiveFirst;he.isRootMenu=!1;var un=!1;return tn&&(un=tn[Lt]),Ue(Le,Lt,un),he}return Object(U.a)(Et,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var he=this,Le=this.props,Lt=Le.mode,ct=Le.parentMenu,tn=Le.manualRef;if(tn&&tn(this),Lt!=="horizontal"||!ct.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return he.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var he=this.props,Le=he.onDestroy,Lt=he.eventKey;Le&&Le(Lt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(he){var Le=this,Lt=this.getBaseProps(),ct=this.getMotion(Lt.mode,Lt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Lt.visible||Lt.forceSubMenuRender,!this.haveOpened)return K.createElement("div",null);var tn=Lt.direction;return K.createElement(Ft.default,Object.assign({visible:Lt.visible},ct),function(un){var Pe=un.className,et=un.style,jt=c()("".concat(Lt.prefixCls,"-sub"),Pe,Object(_.a)({},"".concat(Lt.prefixCls,"-rtl"),tn==="rtl"));return K.createElement(Ae,Object.assign({},Lt,{id:Le.internalMenuId,className:jt,style:et}),he)})}},{key:"render",value:function(){var he,Le=Object(q.a)({},this.props),Lt=Le.isOpen,ct=this.getPrefixCls(),tn=Le.mode==="inline",un=c()(ct,"".concat(ct,"-").concat(Le.mode),(he={},Object(_.a)(he,Le.className,!!Le.className),Object(_.a)(he,this.getOpenClassName(),Lt),Object(_.a)(he,this.getActiveClassName(),Le.active||Lt&&!tn),Object(_.a)(he,this.getDisabledClassName(),Le.disabled),Object(_.a)(he,this.getSelectedClassName(),this.isChildrenSelected()),he));this.internalMenuId||(Le.eventKey?this.internalMenuId="".concat(Le.eventKey,"$Menu"):(Ut+=1,this.internalMenuId="$__$".concat(Ut,"$Menu")));var Pe={},et={},jt={};Le.disabled||(Pe={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},et={onClick:this.onTitleClick},jt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var bn={},Kt=Le.direction;tn&&(Kt==="rtl"?bn.paddingRight=Le.inlineIndent*Le.level:bn.paddingLeft=Le.inlineIndent*Le.level);var Xt={};this.props.isOpen&&(Xt={"aria-owns":this.internalMenuId});var Yn=null;Le.mode!=="horizontal"&&(Yn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Yn=K.createElement(this.props.expandIcon,Object(q.a)({},this.props))));var Bn=K.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:bn,className:"".concat(ct,"-title"),role:"button"},jt,et,{"aria-expanded":Lt},Xt,{"aria-haspopup":"true",title:typeof Le.title=="string"?Le.title:void 0}),Le.title,Yn||K.createElement("i",{className:"".concat(ct,"-arrow")})),_n=this.renderChildren(Le.children),br=Le.parentMenu.isRootMenu?Le.parentMenu.props.getPopupContainer:function(ni){return ni.parentNode},Fr=oe[Le.mode],hr=Le.popupOffset?{offset:Le.popupOffset}:{},Qn=Le.mode==="inline"?"":Le.popupClassName;Qn+=Kt==="rtl"?" ".concat(ct,"-rtl"):"";var Dr=Le.disabled,Kr=Le.triggerSubMenuAction,ti=Le.subMenuOpenDelay,dn=Le.forceSubMenuRender,rr=Le.subMenuCloseDelay,fi=Le.builtinPlacements;Ce.forEach(function(ni){return delete Le[ni]}),delete Le.onClick;var wi=Kt==="rtl"?Object.assign({},pt,fi):Object.assign({},Ve,fi);return delete Le.direction,K.createElement("li",Object.assign({},Le,Pe,{className:un,role:"menuitem"}),tn&&Bn,tn&&_n,!tn&&K.createElement(Qt.a,{prefixCls:ct,popupClassName:c()("".concat(ct,"-popup"),Qn),getPopupContainer:br,builtinPlacements:wi,popupPlacement:Fr,popupVisible:Lt,popupAlign:hr,popup:_n,action:Dr?[]:[Kr],mouseEnterDelay:ti,mouseLeaveDelay:rr,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:dn},Bn))}}]),Et}(K.Component);ze.defaultProps={onMouseEnter:C,onMouseLeave:C,onTitleMouseEnter:C,onTitleMouseLeave:C,onTitleClick:C,manualRef:C,mode:"vertical",title:""};var $e=Object(I.b)(function(en,_t){var Et=en.openKeys,st=en.activeKey,he=en.selectedKeys,Le=_t.eventKey,Lt=_t.subMenuKey;return{isOpen:Et.indexOf(Le)>-1,active:st[Lt]===Le,selectedKeys:he}})(ze);$e.isSubMenu=!0;var Bt=$e,Ht="menuitem-overflowed",qt=.5,tt=function(en){Object(M.a)(Et,en);var _t=Object(k.a)(Et);function Et(){var st;return Object(Y.a)(this,Et),st=_t.apply(this,arguments),st.resizeObserver=null,st.mutationObserver=null,st.originalTotalWidth=0,st.overflowedItems=[],st.menuItemSizes=[],st.cancelFrameId=null,st.state={lastVisibleIndex:void 0},st.getMenuItemNodes=function(){var he=st.props.prefixCls,Le=pe.findDOMNode(Object(G.a)(st));return Le?[].slice.call(Le.children).filter(function(Lt){return Lt.className.split(" ").indexOf("".concat(he,"-overflowed-submenu"))<0}):[]},st.getOverflowedSubMenuItem=function(he,Le,Lt){var ct=st.props,tn=ct.overflowedIndicator,un=ct.level,Pe=ct.mode,et=ct.prefixCls,jt=ct.theme;if(un!==1||Pe!=="horizontal")return null;var bn=st.props.children[0],Kt=bn.props,Xt=Kt.children,Yn=Kt.title,Bn=Kt.style,_n=Object(_e.a)(Kt,["children","title","style"]),br=Object(q.a)({},Bn),Fr="".concat(he,"-overflowed-indicator"),hr="".concat(he,"-overflowed-indicator");Le.length===0&&Lt!==!0?br=Object(q.a)(Object(q.a)({},br),{},{display:"none"}):Lt&&(br=Object(q.a)(Object(q.a)({},br),{},{visibility:"hidden",position:"absolute"}),Fr="".concat(Fr,"-placeholder"),hr="".concat(hr,"-placeholder"));var Qn=jt?"".concat(et,"-").concat(jt):"",Dr={};return Ce.forEach(function(Kr){_n[Kr]!==void 0&&(Dr[Kr]=_n[Kr])}),K.createElement(Bt,Object.assign({title:tn,className:"".concat(et,"-overflowed-submenu"),popupClassName:Qn},Dr,{key:Fr,eventKey:hr,disabled:!1,style:br}),Le)},st.setChildrenWidthAndResize=function(){if(st.props.mode!=="horizontal")return;var he=pe.findDOMNode(Object(G.a)(st));if(!he)return;var Le=he.children;if(!Le||Le.length===0)return;var Lt=he.children[Le.length-1];Ie(Lt,"display","inline-block");var ct=st.getMenuItemNodes(),tn=ct.filter(function(un){return un.className.split(" ").indexOf(Ht)>=0});tn.forEach(function(un){Ie(un,"display","inline-block")}),st.menuItemSizes=ct.map(function(un){return Ee(un,!0)}),tn.forEach(function(un){Ie(un,"display","none")}),st.overflowedIndicatorWidth=Ee(he.children[he.children.length-1],!0),st.originalTotalWidth=st.menuItemSizes.reduce(function(un,Pe){return un+Pe},0),st.handleResize(),Ie(Lt,"display","none")},st.handleResize=function(){if(st.props.mode!=="horizontal")return;var he=pe.findDOMNode(Object(G.a)(st));if(!he)return;var Le=Ee(he);st.overflowedItems=[];var Lt=0,ct;st.originalTotalWidth>Le+qt&&(ct=-1,st.menuItemSizes.forEach(function(tn){Lt+=tn,Lt+st.overflowedIndicatorWidth<=Le&&(ct+=1)})),st.setState({lastVisibleIndex:ct})},st}return Object(U.a)(Et,[{key:"componentDidMount",value:function(){var he=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Le=pe.findDOMNode(this);if(!Le)return;this.resizeObserver=new at.default(function(Lt){Lt.forEach(function(){var ct=he.cancelFrameId;cancelAnimationFrame(ct),he.cancelFrameId=requestAnimationFrame(he.setChildrenWidthAndResize)})}),[].slice.call(Le.children).concat(Le).forEach(function(Lt){he.resizeObserver.observe(Lt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){he.resizeObserver.disconnect(),[].slice.call(Le.children).concat(Le).forEach(function(Lt){he.resizeObserver.observe(Lt)}),he.setChildrenWidthAndResize()}),this.mutationObserver.observe(Le,{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(he){var Le=this,Lt=this.state.lastVisibleIndex;return(he||[]).reduce(function(ct,tn,un){var Pe=tn;if(Le.props.mode==="horizontal"){var et=Le.getOverflowedSubMenuItem(tn.props.eventKey,[]);Lt!==void 0&&Le.props.className.indexOf("".concat(Le.props.prefixCls,"-root"))!==-1&&(un>Lt&&(Pe=K.cloneElement(tn,{style:{display:"none"},eventKey:"".concat(tn.props.eventKey,"-hidden"),className:"".concat(Ht)})),un===Lt+1&&(Le.overflowedItems=he.slice(Lt+1).map(function(bn){return K.cloneElement(bn,{key:bn.props.eventKey,mode:"vertical-left"})}),et=Le.getOverflowedSubMenuItem(tn.props.eventKey,Le.overflowedItems)));var jt=[].concat(Object(Xe.a)(ct),[et,Pe]);return un===he.length-1&&jt.push(Le.getOverflowedSubMenuItem(tn.props.eventKey,[],!0)),jt}return[].concat(Object(Xe.a)(ct),[Pe])},[])}},{key:"render",value:function(){var he=this.props,Le=he.visible,Lt=he.prefixCls,ct=he.overflowedIndicator,tn=he.mode,un=he.level,Pe=he.tag,et=he.children,jt=he.theme,bn=Object(_e.a)(he,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Kt=Pe;return K.createElement(Kt,Object.assign({},bn),this.renderChildren(et))}}]),Et}(K.Component);tt.defaultProps={tag:"div",className:""};var nn=tt;function xn(en){return en.length?en.every(function(_t){return!!_t.props.disabled}):!0}function Ge(en,_t,Et){var st=en.getState();en.setState({activeKey:Object(q.a)(Object(q.a)({},st.activeKey),{},Object(_.a)({},_t,Et))})}function He(en){return en.eventKey||"0-menu-"}function vt(en,_t){var Et=_t,st=en.children,he=en.eventKey;if(Et){var Le;if(le(st,function(Lt,ct){Lt&&Lt.props&&!Lt.props.disabled&&Et===z(Lt,he,ct)&&(Le=!0)}),Le)return Et}return Et=null,en.defaultActiveFirst&&le(st,function(Lt,ct){!Et&&Lt&&!Lt.props.disabled&&(Et=z(Lt,he,ct))}),Et}function Ot(en){if(en){var _t=this.instanceArray.indexOf(en);_t!==-1?this.instanceArray[_t]=en:this.instanceArray.push(en)}}var nt=function(en){Object(M.a)(Et,en);var _t=Object(k.a)(Et);function Et(st){var he;return Object(Y.a)(this,Et),he=_t.call(this,st),he.onKeyDown=function(Le,Lt){var ct=Le.keyCode,tn;if(he.getFlatInstanceArray().forEach(function(Pe){Pe&&Pe.props.active&&Pe.onKeyDown&&(tn=Pe.onKeyDown(Le))}),tn)return 1;var un=null;return(ct===p.a.UP||ct===p.a.DOWN)&&(un=he.step(ct===p.a.UP?-1:1)),un?(Le.preventDefault(),Ge(he.props.store,He(he.props),un.props.eventKey),typeof Lt=="function"&&Lt(un),1):void 0},he.onItemHover=function(Le){var Lt=Le.key,ct=Le.hover;Ge(he.props.store,He(he.props),ct?Lt:null)},he.onDeselect=function(Le){he.props.onDeselect(Le)},he.onSelect=function(Le){he.props.onSelect(Le)},he.onClick=function(Le){he.props.onClick(Le)},he.onOpenChange=function(Le){he.props.onOpenChange(Le)},he.onDestroy=function(Le){he.props.onDestroy(Le)},he.getFlatInstanceArray=function(){return he.instanceArray},he.step=function(Le){var Lt=he.getFlatInstanceArray(),ct=he.props.store.getState().activeKey[He(he.props)],tn=Lt.length;if(!tn)return null;Le<0&&(Lt=Lt.concat().reverse());var un=-1;if(Lt.every(function(bn,Kt){return bn&&bn.props.eventKey===ct?(un=Kt,!1):!0}),!he.props.defaultActiveFirst&&un!==-1&&xn(Lt.slice(un,tn-1)))return;var Pe=(un+1)%tn,et=Pe;do{var jt=Lt[et];if(!jt||jt.props.disabled)et=(et+1)%tn;else return jt}while(et!==Pe);return null},he.renderCommonMenuItem=function(Le,Lt,ct){var tn=he.props.store.getState(),un=Object(G.a)(he),Pe=un.props,et=z(Le,Pe.eventKey,Lt),jt=Le.props;if(!jt||typeof Le.type=="string")return Le;var bn=et===tn.activeKey,Kt=Object(q.a)(Object(q.a)({mode:jt.mode||Pe.mode,level:Pe.level,inlineIndent:Pe.inlineIndent,renderMenuItem:he.renderMenuItem,rootPrefixCls:Pe.prefixCls,index:Lt,parentMenu:Pe.parentMenu,manualRef:jt.disabled?void 0:Object(m.a)(Le.ref,Ot.bind(Object(G.a)(he))),eventKey:et,active:!jt.disabled&&bn,multiple:Pe.multiple,onClick:function(Yn){(jt.onClick||C)(Yn),he.onClick(Yn)},onItemHover:he.onItemHover,motion:Pe.motion,subMenuOpenDelay:Pe.subMenuOpenDelay,subMenuCloseDelay:Pe.subMenuCloseDelay,forceSubMenuRender:Pe.forceSubMenuRender,onOpenChange:he.onOpenChange,onDeselect:he.onDeselect,onSelect:he.onSelect,builtinPlacements:Pe.builtinPlacements,itemIcon:jt.itemIcon||he.props.itemIcon,expandIcon:jt.expandIcon||he.props.expandIcon},ct),{},{direction:Pe.direction});return(Pe.mode==="inline"||Qe())&&(Kt.triggerSubMenuAction="click"),K.cloneElement(Le,Kt)},he.renderMenuItem=function(Le,Lt,ct){if(!Le)return null;var tn=he.props.store.getState(),un={openKeys:tn.openKeys,selectedKeys:tn.selectedKeys,triggerSubMenuAction:he.props.triggerSubMenuAction,subMenuKey:ct};return he.renderCommonMenuItem(Le,Lt,un)},st.store.setState({activeKey:Object(q.a)(Object(q.a)({},st.store.getState().activeKey),{},Object(_.a)({},st.eventKey,vt(st,st.activeKey)))}),he.instanceArray=[],he}return Object(U.a)(Et,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(he){return this.props.visible||he.visible||this.props.className!==he.className||!a()(this.props.style,he.style)}},{key:"componentDidUpdate",value:function(he){var Le=this.props,Lt="activeKey"in Le?Le.activeKey:Le.store.getState().activeKey[He(Le)],ct=vt(Le,Lt);if(ct!==Lt)Ge(Le.store,He(Le),ct);else if("activeKey"in he){var tn=vt(he,he.activeKey);ct!==tn&&Ge(Le.store,He(Le),ct)}}},{key:"render",value:function(){var he=this,Le=Object(P.a)({},this.props);this.instanceArray=[];var Lt=c()(Le.prefixCls,Le.className,"".concat(Le.prefixCls,"-").concat(Le.mode)),ct={className:Lt,role:Le.role||"menu"};Le.id&&(ct.id=Le.id),Le.focusable&&(ct.tabIndex=0,ct.onKeyDown=this.onKeyDown);var tn=Le.prefixCls,un=Le.eventKey,Pe=Le.visible,et=Le.level,jt=Le.mode,bn=Le.overflowedIndicator,Kt=Le.theme;return Ce.forEach(function(Xt){return delete Le[Xt]}),delete Le.onClick,K.createElement(nn,Object.assign({},Le,{prefixCls:tn,mode:jt,tag:"ul",level:et,theme:Kt,visible:Pe,overflowedIndicator:bn},ct),K.Children.map(Le.children,function(Xt,Yn){return he.renderMenuItem(Xt,Yn,un||"0-menu-")}))}}]),Et}(K.Component);nt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:C};var xt=Object(I.b)()(nt),Ae=xt,ve=D("Kwbf");function we(en,_t,Et){var st=en.prefixCls,he=en.motion,Le=en.defaultMotions,Lt=Le===void 0?{}:Le,ct=en.openAnimation,tn=en.openTransitionName,un=_t.switchingModeFromInline;if(he)return he;if(Object(s.a)(ct)==="object"&&ct)Object(ve.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ct=="string")return{motionName:"".concat(st,"-open-").concat(ct)};if(tn)return{motionName:tn};var Pe=Lt[Et];return Pe||(un?null:Lt.other)}var ie=function(en){Object(M.a)(Et,en);var _t=Object(k.a)(Et);function Et(st){var he;Object(Y.a)(this,Et),he=_t.call(this,st),he.inlineOpenKeys=[],he.onSelect=function(ct){var tn=Object(G.a)(he),un=tn.props;if(un.selectable){var Pe=he.store.getState(),et=Pe.selectedKeys,jt=ct.key;un.multiple?et=et.concat([jt]):et=[jt],"selectedKeys"in un||he.store.setState({selectedKeys:et}),un.onSelect(Object(q.a)(Object(q.a)({},ct),{},{selectedKeys:et}))}},he.onClick=function(ct){var tn=he.getRealMenuMode(),un=Object(G.a)(he),Pe=un.store,et=un.props.onOpenChange;tn!=="inline"&&!("openKeys"in he.props)&&(Pe.setState({openKeys:[]}),et([])),he.props.onClick(ct)},he.onKeyDown=function(ct,tn){he.innerMenu.getWrappedInstance().onKeyDown(ct,tn)},he.onOpenChange=function(ct){var tn=Object(G.a)(he),un=tn.props,Pe=he.store.getState().openKeys.concat(),et=!1,jt=function(Kt){var Xt=!1;if(Kt.open)Xt=Pe.indexOf(Kt.key)===-1,Xt&&Pe.push(Kt.key);else{var Yn=Pe.indexOf(Kt.key);Xt=Yn!==-1,Xt&&Pe.splice(Yn,1)}et=et||Xt};Array.isArray(ct)?ct.forEach(jt):jt(ct),et&&("openKeys"in he.props||he.store.setState({openKeys:Pe}),un.onOpenChange(Pe))},he.onDeselect=function(ct){var tn=Object(G.a)(he),un=tn.props;if(un.selectable){var Pe=he.store.getState().selectedKeys.concat(),et=ct.key,jt=Pe.indexOf(et);jt!==-1&&Pe.splice(jt,1),"selectedKeys"in un||he.store.setState({selectedKeys:Pe}),un.onDeselect(Object(q.a)(Object(q.a)({},ct),{},{selectedKeys:Pe}))}},he.onMouseEnter=function(ct){he.restoreModeVerticalFromInline();var tn=he.props.onMouseEnter;tn&&tn(ct)},he.onTransitionEnd=function(ct){var tn=ct.propertyName==="width"&&ct.target===ct.currentTarget,un=ct.target.className,Pe=Object.prototype.toString.call(un)==="[object SVGAnimatedString]"?un.animVal:un,et=ct.propertyName==="font-size"&&Pe.indexOf("anticon")>=0;(tn||et)&&he.restoreModeVerticalFromInline()},he.setInnerMenu=function(ct){he.innerMenu=ct},he.isRootMenu=!0;var Le=st.defaultSelectedKeys,Lt=st.defaultOpenKeys;return"selectedKeys"in st&&(Le=st.selectedKeys||[]),"openKeys"in st&&(Lt=st.openKeys||[]),he.store=Object(I.c)({selectedKeys:Le,openKeys:Lt,activeKey:{"0-menu-":vt(st,st.activeKey)}}),he.state={switchingModeFromInline:!1},he}return Object(U.a)(Et,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(he){this.updateOpentKeysWhenSwitchMode(he),this.updateMiniStore();var Le=this.props,Lt=Le.siderCollapsed,ct=Le.inlineCollapsed,tn=Le.onOpenChange;(!he.inlineCollapsed&&ct||!he.siderCollapsed&&Lt)&&tn([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(he){var Le=this.props,Lt=this.store,ct=this.inlineOpenKeys,tn=Lt.getState(),un={};he.mode==="inline"&&Le.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Le||((Le.inlineCollapsed&&!he.inlineCollapsed||Le.siderCollapsed&&!he.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=tn.openKeys.concat(),un.openKeys=[]),(!Le.inlineCollapsed&&he.inlineCollapsed||!Le.siderCollapsed&&he.siderCollapsed)&&(un.openKeys=ct,this.inlineOpenKeys=[])),Object.keys(un).length&&Lt.setState(un)}},{key:"updateMenuDisplay",value:function(){var he=this.props.collapsedWidth,Le=this.store,Lt=this.prevOpenKeys,ct=this.getInlineCollapsed()&&(he===0||he==="0"||he==="0px");ct?(this.prevOpenKeys=Le.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Lt&&(this.store.setState({openKeys:Lt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var he=this.props.mode,Le=this.state.switchingModeFromInline,Lt=this.getInlineCollapsed();return Le&&Lt?"inline":Lt?"vertical":he}},{key:"getInlineCollapsed",value:function(){var he=this.props,Le=he.inlineCollapsed,Lt=he.siderCollapsed;return Lt!==void 0?Lt:Le}},{key:"restoreModeVerticalFromInline",value:function(){var he=this.state.switchingModeFromInline;he&&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 he=Object(q.a)({},Object(r.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Le=this.getRealMenuMode();return he.className+=" ".concat(he.prefixCls,"-root"),he.direction==="rtl"&&(he.className+=" ".concat(he.prefixCls,"-rtl")),he=Object(q.a)(Object(q.a)({},he),{},{mode:Le,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:we(this.props,this.state,Le)}),delete he.openAnimation,delete he.openTransitionName,K.createElement(I.a,{store:this.store},K.createElement(Ae,Object.assign({},he,{ref:this.setInnerMenu}),this.props.children))}}]),Et}(K.Component);ie.defaultProps={selectable:!0,onClick:C,onSelect:C,onOpenChange:C,onDeselect:C,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:K.createElement("span",null,"\xB7\xB7\xB7")};var ae=ie,me=function(en){Object(M.a)(Et,en);var _t=Object(k.a)(Et);function Et(){var st;return Object(Y.a)(this,Et),st=_t.apply(this,arguments),st.onKeyDown=function(he){var Le=he.keyCode;return Le===p.a.ENTER?(st.onClick(he),!0):void 0},st.onMouseLeave=function(he){var Le=st.props,Lt=Le.eventKey,ct=Le.onItemHover,tn=Le.onMouseLeave;ct({key:Lt,hover:!1}),tn({key:Lt,domEvent:he})},st.onMouseEnter=function(he){var Le=st.props,Lt=Le.eventKey,ct=Le.onItemHover,tn=Le.onMouseEnter;ct({key:Lt,hover:!0}),tn({key:Lt,domEvent:he})},st.onClick=function(he){var Le=st.props,Lt=Le.eventKey,ct=Le.multiple,tn=Le.onClick,un=Le.onSelect,Pe=Le.onDeselect,et=Le.isSelected,jt={key:Lt,keyPath:[Lt],item:Object(G.a)(st),domEvent:he};tn(jt),ct?et?Pe(jt):un(jt):et||un(jt)},st.saveNode=function(he){st.node=he},st}return Object(U.a)(Et,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var he=this.props;he.onDestroy&&he.onDestroy(he.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 he,Le=Object(q.a)({},this.props),Lt=c()(this.getPrefixCls(),Le.className,(he={},Object(_.a)(he,this.getActiveClassName(),!Le.disabled&&Le.active),Object(_.a)(he,this.getSelectedClassName(),Le.isSelected),Object(_.a)(he,this.getDisabledClassName(),Le.disabled),he)),ct=Object(q.a)(Object(q.a)({},Le.attribute),{},{title:typeof Le.title=="string"?Le.title:void 0,className:Lt,role:Le.role||"menuitem","aria-disabled":Le.disabled});Le.role==="option"?ct=Object(q.a)(Object(q.a)({},ct),{},{role:"option","aria-selected":Le.isSelected}):(Le.role===null||Le.role==="none")&&(ct.role="none");var tn={onClick:Le.disabled?null:this.onClick,onMouseLeave:Le.disabled?null:this.onMouseLeave,onMouseEnter:Le.disabled?null:this.onMouseEnter},un=Object(q.a)({},Le.style);Le.mode==="inline"&&(Le.direction==="rtl"?un.paddingRight=Le.inlineIndent*Le.level:un.paddingLeft=Le.inlineIndent*Le.level),Ce.forEach(function(et){return delete Le[et]}),delete Le.direction;var Pe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Pe=K.createElement(this.props.itemIcon,this.props)),K.createElement("li",Object.assign({},Object(r.default)(Le,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ct,tn,{style:un,ref:this.saveNode}),Le.children,Pe)}}]),Et}(K.Component);me.isMenuItem=!0,me.defaultProps={onSelect:C,onMouseEnter:C,onMouseLeave:C,manualRef:C};var be=Object(I.b)(function(en,_t){var Et=en.activeKey,st=en.selectedKeys,he=_t.eventKey,Le=_t.subMenuKey;return{active:Et[Le]===he,isSelected:st.indexOf(he)!==-1}})(me),ye=be,Be=function(en){Object(M.a)(Et,en);var _t=Object(k.a)(Et);function Et(){var st;return Object(Y.a)(this,Et),st=_t.apply(this,arguments),st.renderInnerMenuItem=function(he){var Le=st.props,Lt=Le.renderMenuItem,ct=Le.index;return Lt(he,ct,st.props.subMenuKey)},st}return Object(U.a)(Et,[{key:"render",value:function(){var he=Object(P.a)({},this.props),Le=he.className,Lt=Le===void 0?"":Le,ct=he.rootPrefixCls,tn="".concat(ct,"-item-group-title"),un="".concat(ct,"-item-group-list"),Pe=he.title,et=he.children;return Ce.forEach(function(jt){return delete he[jt]}),delete he.onClick,delete he.direction,K.createElement("li",Object.assign({},he,{className:"".concat(Lt," ").concat(ct,"-item-group")}),K.createElement("div",{className:tn,title:typeof Pe=="string"?Pe:void 0},Pe),K.createElement("ul",{className:un},K.Children.map(et,this.renderInnerMenuItem)))}}]),Et}(K.Component);Be.isMenuItemGroup=!0,Be.defaultProps={disabled:!0};var St=Be,an=function(_t){var Et=_t.className,st=_t.rootPrefixCls,he=_t.style;return K.createElement("li",{className:"".concat(Et," ").concat(st,"-item-divider"),style:he})};an.defaultProps={disabled:!0,className:"",style:{}};var Dn=an,yt=fe.e=ae},"24hK":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return Y});class q{constructor(U){this.element=U,this.next=q.Undefined,this.prev=q.Undefined}}q.Undefined=new q(void 0);class Y{constructor(){this._first=q.Undefined,this._last=q.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===q.Undefined}clear(){let U=this._first;for(;U!==q.Undefined;){const G=U.next;U.prev=q.Undefined,U.next=q.Undefined,U=G}this._first=q.Undefined,this._last=q.Undefined,this._size=0}unshift(U){return this._insert(U,!1)}push(U){return this._insert(U,!0)}_insert(U,G){const M=new q(U);if(this._first===q.Undefined)this._first=M,this._last=M;else if(G){const K=this._last;this._last=M,M.prev=K,K.next=M}else{const K=this._first;this._first=M,M.next=K,K.prev=M}this._size+=1;let k=!1;return()=>{k||(k=!0,this._remove(M))}}shift(){if(this._first===q.Undefined)return;{const U=this._first.element;return this._remove(this._first),U}}pop(){if(this._last===q.Undefined)return;{const U=this._last.element;return this._remove(this._last),U}}_remove(U){if(U.prev!==q.Undefined&&U.next!==q.Undefined){const G=U.prev;G.next=U.next,U.next.prev=G}else U.prev===q.Undefined&&U.next===q.Undefined?(this._first=q.Undefined,this._last=q.Undefined):U.next===q.Undefined?(this._last=this._last.prev,this._last.next=q.Undefined):U.prev===q.Undefined&&(this._first=this._first.next,this._first.prev=q.Undefined);this._size-=1}*[Symbol.iterator](){let U=this._first;for(;U!==q.Undefined;)yield U.element,U=U.next}}},"3/fG":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return Y});function q(U,G){let M;return G.length===0?M=U:M=U.replace(/\{(\d+)\}/g,function(k,K){const I=K[0];return typeof G[I]!="undefined"?G[I]:k}),M}function Y(U,G,...M){return q(G,M)}},"4wi7":function(Gt,fe,D){"use strict";var q=D("14J3"),Y=D("BMrR"),U=D("sRBo"),G=D("kaz8"),M=D("5NDa"),k=D("5rEg"),K=D("9og8"),I=D("tJVT"),r=D("WmNS"),P=D.n(r),_=D("q1tI"),p=D.n(_),m=D("oOBs"),u=D.n(m),a=D("xOL1"),o=D.n(a),c=D("BdwD"),s=function(n){var O=n.data,T=n.value,w=T===void 0?[]:T,R=n.handleChangePage,S=n.setSelectedRowKeys,v=n.selectedRowKeys,E=n.onChange,f=E===void 0?function(){}:E,h=Object(_.useState)([]),y=Object(I.a)(h,2),g=y[0],x=y[1],j=Object(_.useState)([]),F=Object(I.a)(j,2),A=F[0],W=F[1],H=Object(_.useState)([]),C=Object(I.a)(H,2),z=C[0],Z=C[1],le=Object(_.useState)(1),se=Object(I.a)(le,2),Ce=se[0],Ee=se[1],Ie=Object(_.useState)(),Qe=Object(I.a)(Ie,2),Xe=Qe[0],_e=Qe[1];return Object(_.useEffect)(function(){x(O),W([]),Z([])},[O]),Object(_.useEffect)(function(){S&&(W(v),Z(v))},[v]),p.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},p.a.createElement("div",{className:u.a.leftdiv},p.a.createElement(k.a.Search,{size:"large",onChange:function(){var pe=Object(K.a)(P.a.mark(function at(Qt){return P.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:x(O.filter(function(Ve){var pt;return Ve==null||((pt=Ve.name)===null||pt===void 0)?void 0:pt.includes(Qt.target.value)}));case 1:case"end":return Tt.stop()}},at)}));return function(at){return pe.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),g.length===0&&p.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),p.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},p.a.createElement(G.a.Group,{value:A.map(function(pe){return"".concat(pe.id)}),onChange:function(at){S(g.filter(function(Qt){return at.includes("".concat(Qt.id))}))},style:{marginTop:"10px"}},g.map(function(pe,at){return p.a.createElement(Y.a,{key:pe.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},p.a.createElement(G.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:pe.is_published,value:"".concat(pe.id)},p.a.createElement("div",{className:u.a.listClass},p.a.createElement("span",{className:u.a.spantitle,style:{width:pe.is_published?"108px":"170px"}},pe.name),pe.is_published&&p.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),p.a.createElement("div",{className:u.a.rightdiv},p.a.createElement(k.a.Search,{onChange:function(at){Z(A.filter(function(Qt){return Qt.name.includes(at.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),z.length===0&&p.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),z.length>0&&p.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},p.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},z.map(function(pe,at){return p.a.createElement(Y.a,{justify:"space-between",style:{marginTop:"10px"},key:pe.id},p.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},pe.name),p.a.createElement("img",{src:o.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){S(A.filter(function(Ft){return"".concat(Ft.id)!="".concat(pe.id)}))}}))})))))};fe.a=s},"55Ip":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return i});var q=D("Ty5D"),Y=D("dI71"),U=D("q1tI"),G=D.n(U),M=D("YS25"),k=D("17x9"),K=D.n(k),I=D("wx14"),r=D("zLVn"),P=D("9R94"),_=function(E){Object(Y.a)(f,E);function f(){for(var y,g=arguments.length,x=new Array(g),j=0;j<g;j++)x[j]=arguments[j];return y=E.call.apply(E,[this].concat(x))||this,y.history=Object(M.a)(y.props),y}var h=f.prototype;return h.render=function(){return G.a.createElement(q.c,{history:this.history,children:this.props.children})},f}(G.a.Component),p=function(E){Object(Y.a)(f,E);function f(){for(var y,g=arguments.length,x=new Array(g),j=0;j<g;j++)x[j]=arguments[j];return y=E.call.apply(E,[this].concat(x))||this,y.history=Object(M.b)(y.props),y}var h=f.prototype;return h.render=function(){return G.a.createElement(q.c,{history:this.history,children:this.props.children})},f}(G.a.Component),m=function(f,h){return typeof f=="function"?f(h):f},u=function(f,h){return typeof f=="string"?Object(M.c)(f,null,null,h):f},a=function(f){return f},o=G.a.forwardRef;typeof o=="undefined"&&(o=a);function c(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var s=o(function(E,f){var h=E.innerRef,y=E.navigate,g=E.onClick,x=Object(r.a)(E,["innerRef","navigate","onClick"]),j=x.target,F=Object(I.a)({},x,{onClick:function(W){try{g&&g(W)}catch(H){throw W.preventDefault(),H}!W.defaultPrevented&&W.button===0&&(!j||j==="_self")&&!c(W)&&(W.preventDefault(),y())}});return a!==o?F.ref=f||h:F.ref=h,G.a.createElement("a",F)}),i=o(function(E,f){var h=E.component,y=h===void 0?s:h,g=E.replace,x=E.to,j=E.innerRef,F=Object(r.a)(E,["component","replace","to","innerRef"]);return G.a.createElement(q.e.Consumer,null,function(A){A||Object(P.a)(!1);var W=A.history,H=u(m(x,A.location),A.location),C=H?W.createHref(H):"",z=Object(I.a)({},F,{href:C,navigate:function(){var le=m(x,A.location),se=g?W.replace:W.push;se(le)}});return a!==o?z.ref=f||j:z.innerRef=j,G.a.createElement(y,z)})});if(!1)var n,O;var T=function(f){return f},w=G.a.forwardRef;typeof w=="undefined"&&(w=T);function R(){for(var E=arguments.length,f=new Array(E),h=0;h<E;h++)f[h]=arguments[h];return f.filter(function(y){return y}).join(" ")}var S=w(function(E,f){var h=E["aria-current"],y=h===void 0?"page":h,g=E.activeClassName,x=g===void 0?"active":g,j=E.activeStyle,F=E.className,A=E.exact,W=E.isActive,H=E.location,C=E.sensitive,z=E.strict,Z=E.style,le=E.to,se=E.innerRef,Ce=Object(r.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(q.e.Consumer,null,function(Ee){Ee||Object(P.a)(!1);var Ie=H||Ee.location,Qe=u(m(le,Ie),Ie),Xe=Qe.pathname,_e=Xe&&Xe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),pe=_e?Object(q.f)(Ie.pathname,{path:_e,exact:A,sensitive:C,strict:z}):null,at=!!(W?W(pe,Ie):pe),Qt=at?R(F,x):F,Ft=at?Object(I.a)({},Z,{},j):Z,Tt=Object(I.a)({"aria-current":at&&y||null,className:Qt,style:Ft,to:Qe},Ce);return T!==w?Tt.ref=f||se:Tt.innerRef=se,G.a.createElement(i,Tt)})});if(!1)var v},"5VLF":function(Gt,fe,D){"use strict";var q,Y;function U(G,M,k){var K=function(I,r){return G.js_beautify(I,r)};return K.js=G.js_beautify,K.css=M.css_beautify,K.html=k.html_beautify,K.js_beautify=G.js_beautify,K.css_beautify=M.css_beautify,K.html_beautify=k.html_beautify,K}!(q=[D("6UM0"),D("TXwP"),D("psGv")],Y=function(G,M,k){return U(G,M,k)}.apply(fe,q),Y!==void 0&&(Gt.exports=Y))},"5Y4S":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return U});var q=D("MNsG");const Y=q.b.performance&&typeof q.b.performance.now=="function";class U{constructor(G){this._highResolution=Y&&G,this._startTime=this._now(),this._stopTime=-1}static create(G=!0){return new U(G)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?q.b.performance.now():Date.now()}}},"6+eU":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return w});var q=D("wx14"),Y=D("rePB"),U=D("VTBJ"),G=D("1OyB"),M=D("vuIU"),k=D("Ji7U"),K=D("LK+K"),I=D("q1tI"),r=D.n(I),P=D("TSYQ"),_=D.n(P),p=function(S){var v,E="".concat(S.rootPrefixCls,"-item"),f=_()(E,"".concat(E,"-").concat(S.page),(v={},Object(Y.a)(v,"".concat(E,"-active"),S.active),Object(Y.a)(v,S.className,!!S.className),Object(Y.a)(v,"".concat(E,"-disabled"),!S.page),v)),h=function(){S.onClick(S.page)},y=function(x){S.onKeyPress(x,S.onClick,S.page)};return r.a.createElement("li",{title:S.showTitle?S.page:null,className:f,onClick:h,onKeyPress:y,tabIndex:"0"},S.itemRender(S.page,"page",r.a.createElement("a",{rel:"nofollow"},S.page)))},m=p,u={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(R){Object(k.a)(v,R);var S=Object(K.a)(v);function v(){var E;Object(G.a)(this,v);for(var f=arguments.length,h=new Array(f),y=0;y<f;y++)h[y]=arguments[y];return E=S.call.apply(S,[this].concat(h)),E.state={goInputText:""},E.buildOptionText=function(g){return"".concat(g," ").concat(E.props.locale.items_per_page)},E.changeSize=function(g){E.props.changeSize(Number(g))},E.handleChange=function(g){E.setState({goInputText:g.target.value})},E.handleBlur=function(g){var x=E.props,j=x.goButton,F=x.quickGo,A=x.rootPrefixCls,W=E.state.goInputText;if(j||W==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;E.setState({goInputText:""}),F(E.getValidValue())},E.go=function(g){var x=E.state.goInputText;if(x==="")return;(g.keyCode===u.ENTER||g.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(M.a)(v,[{key:"getValidValue",value:function(){var f=this.state,h=f.goInputText,y=f.current;return!h||isNaN(h)?y:Number(h)}},{key:"getPageSizeOptions",value:function(){var f=this.props,h=f.pageSize,y=f.pageSizeOptions;return y.some(function(g){return g.toString()===h.toString()})?y:y.concat([h.toString()]).sort(function(g,x){var j=isNaN(Number(g))?0:Number(g),F=isNaN(Number(x))?0:Number(x);return j-F})}},{key:"render",value:function(){var f=this,h=this.props,y=h.pageSize,g=h.locale,x=h.rootPrefixCls,j=h.changeSize,F=h.quickGo,A=h.goButton,W=h.selectComponentClass,H=h.buildOptionText,C=h.selectPrefixCls,z=h.disabled,Z=this.state.goInputText,le="".concat(x,"-options"),se=W,Ce=null,Ee=null,Ie=null;if(!j&&!F)return null;var Qe=this.getPageSizeOptions();if(j&&se){var Xe=Qe.map(function(_e,pe){return r.a.createElement(se.Option,{key:pe,value:_e.toString()},(H||f.buildOptionText)(_e))});Ce=r.a.createElement(se,{disabled:z,prefixCls:C,showSearch:!1,className:"".concat(le,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(y||Qe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(pe){return pe.parentNode}},Xe)}return F&&(A&&(Ie=typeof A=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(le,"-quick-jumper-button")},g.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),Ee=r.a.createElement("div",{className:"".concat(le,"-quick-jumper")},g.jump_to,r.a.createElement("input",{disabled:z,type:"text",value:Z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,Ie)),r.a.createElement("li",{className:"".concat(le)},Ce,Ee)}}]),v}(r.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var o=a,c=D("N2Kk");function s(){}function i(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function n(R,S,v){return v}function O(R,S,v){var E=typeof R=="undefined"?S.pageSize:R;return Math.floor((v.total-1)/E)+1}var T=function(R){Object(k.a)(v,R);var S=Object(K.a)(v);function v(E){var f;Object(G.a)(this,v),f=S.call(this,E),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(O(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(j,F){var A=f.props.prefixCls,W=j||r.a.createElement("button",{type:"button","aria-label":F,className:"".concat(A,"-item-link")});return typeof j=="function"&&(W=r.a.createElement(j,Object(U.a)({},f.props))),W},f.savePaginationNode=function(j){f.paginationNode=j},f.isValid=function(j){return i(j)&&j!==f.state.current},f.shouldDisplayQuickJumper=function(){var j=f.props,F=j.showQuickJumper,A=j.pageSize,W=j.total;return W<=A?!1:F},f.handleKeyDown=function(j){(j.keyCode===u.ARROW_UP||j.keyCode===u.ARROW_DOWN)&&j.preventDefault()},f.handleKeyUp=function(j){var F=f.getValidValue(j),A=f.state.currentInputValue;F!==A&&f.setState({currentInputValue:F}),j.keyCode===u.ENTER?f.handleChange(F):j.keyCode===u.ARROW_UP?f.handleChange(F-1):j.keyCode===u.ARROW_DOWN&&f.handleChange(F+1)},f.changePageSize=function(j){var F=f.state.current,A=O(j,f.state,f.props);F=F>A?A:F,A===0&&(F=f.state.current),typeof j=="number"&&("pageSize"in f.props||f.setState({pageSize:j}),"current"in f.props||f.setState({current:F,currentInputValue:F})),f.props.onShowSizeChange(F,j),"onChange"in f.props&&f.props.onChange&&f.props.onChange(F,j)},f.handleChange=function(j){var F=f.props.disabled,A=j;if(f.isValid(A)&&!F){var W=O(void 0,f.state,f.props);A>W?A=W:A<1&&(A=1),"current"in f.props||f.setState({current:A,currentInputValue:A});var H=f.state.pageSize;return f.props.onChange(A,H),A}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current<O(void 0,f.state,f.props)},f.runIfEnter=function(j,F){if(j.key==="Enter"||j.charCode===13){for(var A=arguments.length,W=new Array(A>2?A-2:0),H=2;H<A;H++)W[H-2]=arguments[H];F.apply(void 0,W)}},f.runIfEnterPrev=function(j){f.runIfEnter(j,f.prev)},f.runIfEnterNext=function(j){f.runIfEnter(j,f.next)},f.runIfEnterJumpPrev=function(j){f.runIfEnter(j,f.jumpPrev)},f.runIfEnterJumpNext=function(j){f.runIfEnter(j,f.jumpNext)},f.handleGoTO=function(j){(j.keyCode===u.ENTER||j.type==="click")&&f.handleChange(f.state.currentInputValue)};var h=E.onChange!==s,y="current"in E;y&&!h&&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=E.defaultCurrent;"current"in E&&(g=E.current);var x=E.defaultPageSize;return"pageSize"in E&&(x=E.pageSize),g=Math.min(g,O(x,void 0,E)),f.state={current:g,currentInputValue:g,pageSize:x},f}return Object(M.a)(v,[{key:"componentDidUpdate",value:function(f,h){var y=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(y,"-item-").concat(h.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(f){var h=f.target.value,y=O(void 0,this.state,this.props),g=this.state.currentInputValue,x;return h===""?x=h:isNaN(Number(h))?x=g:h>=y?x=y:x=Number(h),x}},{key:"getShowSizeChanger",value:function(){var f=this.props,h=f.showSizeChanger,y=f.total,g=f.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:y>g}},{key:"renderPrev",value:function(f){var h=this.props,y=h.prevIcon,g=h.itemRender,x=g(f,"prev",this.getItemIcon(y,"prev page")),j=!this.hasPrev();return Object(I.isValidElement)(x)?Object(I.cloneElement)(x,{disabled:j}):x}},{key:"renderNext",value:function(f){var h=this.props,y=h.nextIcon,g=h.itemRender,x=g(f,"next",this.getItemIcon(y,"next page")),j=!this.hasNext();return Object(I.isValidElement)(x)?Object(I.cloneElement)(x,{disabled:j}):x}},{key:"render",value:function(){var f=this,h=this.props,y=h.prefixCls,g=h.className,x=h.style,j=h.disabled,F=h.hideOnSinglePage,A=h.total,W=h.locale,H=h.showQuickJumper,C=h.showLessItems,z=h.showTitle,Z=h.showTotal,le=h.simple,se=h.itemRender,Ce=h.showPrevNextJumpers,Ee=h.jumpPrevIcon,Ie=h.jumpNextIcon,Qe=h.selectComponentClass,Xe=h.selectPrefixCls,_e=h.pageSizeOptions,pe=this.state,at=pe.current,Qt=pe.pageSize,Ft=pe.currentInputValue;if(F===!0&&A<=Qt)return null;var Tt=O(void 0,this.state,this.props),Ve=[],pt=null,ut=null,Ut=null,oe=null,Ue=null,ze=H&&H.goButton,$e=C?1:2,Bt=at-1>0?at-1:0,Ht=at+1<Tt?at+1:Tt,qt=Object.keys(this.props).reduce(function(ie,ae){return(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(ie[ae]=f.props[ae]),ie},{});if(le)return ze&&(typeof ze=="boolean"?Ue=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},W.jump_to_confirm):Ue=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ze),Ue=r.a.createElement("li",{title:z?"".concat(W.jump_to).concat(at,"/").concat(Tt):null,className:"".concat(y,"-simple-pager")},Ue)),r.a.createElement("ul",Object(q.a)({className:_()(y,"".concat(y,"-simple"),Object(Y.a)({},"".concat(y,"-disabled"),j),g),style:x,ref:this.savePaginationNode},qt),r.a.createElement("li",{title:z?W.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:_()("".concat(y,"-prev"),Object(Y.a)({},"".concat(y,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Bt)),r.a.createElement("li",{title:z?"".concat(at,"/").concat(Tt):null,className:"".concat(y,"-simple-pager")},r.a.createElement("input",{type:"text",value:Ft,disabled:j,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(y,"-slash")},"/"),Tt),r.a.createElement("li",{title:z?W.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:_()("".concat(y,"-next"),Object(Y.a)({},"".concat(y,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ht)),Ue);if(Tt<=3+$e*2){var tt={locale:W,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:se};Tt||Ve.push(r.a.createElement(m,Object(q.a)({},tt,{key:"noPager",page:Tt,className:"".concat(y,"-disabled")})));for(var nn=1;nn<=Tt;nn+=1){var xn=at===nn;Ve.push(r.a.createElement(m,Object(q.a)({},tt,{key:nn,page:nn,active:xn})))}}else{var Ge=C?W.prev_3:W.prev_5,He=C?W.next_3:W.next_5;Ce&&(pt=r.a.createElement("li",{title:z?Ge:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:_()("".concat(y,"-jump-prev"),Object(Y.a)({},"".concat(y,"-jump-prev-custom-icon"),!!Ee))},se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ee,"prev page"))),ut=r.a.createElement("li",{title:z?He:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:_()("".concat(y,"-jump-next"),Object(Y.a)({},"".concat(y,"-jump-next-custom-icon"),!!Ie))},se(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ie,"next page")))),oe=r.a.createElement(m,{locale:W,last:!0,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Tt,page:Tt,active:!1,showTitle:z,itemRender:se}),Ut=r.a.createElement(m,{locale:W,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:se});var vt=Math.max(1,at-$e),Ot=Math.min(at+$e,Tt);at-1<=$e&&(Ot=1+$e*2),Tt-at<=$e&&(vt=Tt-$e*2);for(var nt=vt;nt<=Ot;nt+=1){var xt=at===nt;Ve.push(r.a.createElement(m,{locale:W,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:nt,page:nt,active:xt,showTitle:z,itemRender:se}))}at-1>=$e*2&&at!==1+2&&(Ve[0]=Object(I.cloneElement)(Ve[0],{className:"".concat(y,"-item-after-jump-prev")}),Ve.unshift(pt)),Tt-at>=$e*2&&at!==Tt-2&&(Ve[Ve.length-1]=Object(I.cloneElement)(Ve[Ve.length-1],{className:"".concat(y,"-item-before-jump-next")}),Ve.push(ut)),vt!==1&&Ve.unshift(Ut),Ot!==Tt&&Ve.push(oe)}var Ae=null;Z&&(Ae=r.a.createElement("li",{className:"".concat(y,"-total-text")},Z(A,[A===0?0:(at-1)*Qt+1,at*Qt>A?A:at*Qt])));var ve=!this.hasPrev()||!Tt,we=!this.hasNext()||!Tt;return r.a.createElement("ul",Object(q.a)({className:_()(y,g,Object(Y.a)({},"".concat(y,"-disabled"),j)),style:x,unselectable:"unselectable",ref:this.savePaginationNode},qt),Ae,r.a.createElement("li",{title:z?W.prev_page:null,onClick:this.prev,tabIndex:ve?null:0,onKeyPress:this.runIfEnterPrev,className:_()("".concat(y,"-prev"),Object(Y.a)({},"".concat(y,"-disabled"),ve)),"aria-disabled":ve},this.renderPrev(Bt)),Ve,r.a.createElement("li",{title:z?W.next_page:null,onClick:this.next,tabIndex:we?null:0,onKeyPress:this.runIfEnterNext,className:_()("".concat(y,"-next"),Object(Y.a)({},"".concat(y,"-disabled"),we)),"aria-disabled":we},this.renderNext(Ht)),r.a.createElement(o,{disabled:j,locale:W,rootPrefixCls:y,selectComponentClass:Qe,selectPrefixCls:Xe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:at,pageSize:Qt,pageSizeOptions:_e,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ze}))}}],[{key:"getDerivedStateFromProps",value:function(f,h){var y={};if("current"in f&&(y.current=f.current,f.current!==h.current&&(y.currentInputValue=y.current)),"pageSize"in f&&f.pageSize!==h.pageSize){var g=h.current,x=O(f.pageSize,h,f);g=g>x?x:g,"current"in f||(y.current=g,y.currentInputValue=g),y.pageSize=f.pageSize}return y}}]),v}(r.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:s,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:s,locale:c.a,style:{},itemRender:n,totalBoundaryShowSizeChanger:50};var w=T},"6RRn":function(Gt,fe,D){"use strict";var q=D("wCXF"),Y=D("n6Qo");D.d(fe,"b",function(){return Y.a});var U=D("IBYe"),G=D("6eGT"),M=D("hW8S");D.d(fe,"a",function(){return M.a}),fe.c=q.b},"6UM0":function(Gt,fe,D){var q,Y;(function(){var U;(function(){"use strict";var M=[function(r,P,_){var p=_(1).Beautifier,m=_(5).Options;function u(a,o){var c=new p(a,o);return c.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new m}},function(r,P,_){var p=_(2).Output,m=_(3).Token,u=_(4),a=_(5).Options,o=_(7).Tokenizer,c=_(7).line_starters,s=_(7).positionable_operators,i=_(7).TOKEN;function n(C,z){return z.indexOf(C)!==-1}function O(C){return C.replace(/^\s+/g,"")}function T(C){for(var z={},Z=0;Z<C.length;Z++)z[C[Z].replace(/-/g,"_")]=C[Z];return z}function w(C,z){return C&&C.type===i.RESERVED&&C.text===z}function R(C,z){return C&&C.type===i.RESERVED&&n(C.text,z)}var S=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],E=T(v),f=[E.before_newline,E.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function y(C,z){if(z.multiline_frame||z.mode===h.ForInitializer||z.mode===h.Conditional)return;C.remove_indent(z.start_line_index)}function g(C){C=C.replace(u.allLineBreaks,`
|
|
`);for(var z=[],Z=C.indexOf(`
|
|
`);Z!==-1;)z.push(C.substring(0,Z)),C=C.substring(Z+1),Z=C.indexOf(`
|
|
`);return C.length&&z.push(C),z}function x(C){return C===h.ArrayLiteral}function j(C){return n(C,[h.Expression,h.ForInitializer,h.Conditional])}function F(C,z){for(var Z=0;Z<C.length;Z++){var le=C[Z].trim();if(le.charAt(0)!==z)return!1}return!0}function A(C,z){for(var Z=0,le=C.length,se;Z<le;Z++)if(se=C[Z],se&&se.indexOf(z)!==0)return!1;return!0}function W(C,z){z=z||{},this._source_text=C||"",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 a(z)}W.prototype.create_flags=function(C,z){var Z=0;C&&(Z=C.indentation_level,!this._output.just_added_newline()&&C.line_indent_level>Z&&(Z=C.line_indent_level));var le={mode:z,parent:C,last_token:C?C.last_token:new m(i.START_BLOCK,""),last_word:C?C.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Z,alignment:0,line_indent_level:C?C.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return le},W.prototype._reset=function(C){var z=C.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var Z=new o(C,this._options);return this._tokens=Z.tokenize(),C},W.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C,z=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=`
|
|
`,z&&u.lineBreak.test(z||"")&&(Z=z.match(u.lineBreak)[0]));for(var le=this._tokens.next();le;)this.handle_token(le),this._last_last_text=this._flags.last_token.text,this._flags.last_token=le,le=this._tokens.next();return C=this._output.get_code(Z),C},W.prototype.handle_token=function(C,z){C.type===i.START_EXPR?this.handle_start_expr(C):C.type===i.END_EXPR?this.handle_end_expr(C):C.type===i.START_BLOCK?this.handle_start_block(C):C.type===i.END_BLOCK?this.handle_end_block(C):C.type===i.WORD?this.handle_word(C):C.type===i.RESERVED?this.handle_word(C):C.type===i.SEMICOLON?this.handle_semicolon(C):C.type===i.STRING?this.handle_string(C):C.type===i.EQUALS?this.handle_equals(C):C.type===i.OPERATOR?this.handle_operator(C):C.type===i.COMMA?this.handle_comma(C):C.type===i.BLOCK_COMMENT?this.handle_block_comment(C,z):C.type===i.COMMENT?this.handle_comment(C,z):C.type===i.DOT?this.handle_dot(C):C.type===i.EOF?this.handle_eof(C):C.type===i.UNKNOWN?this.handle_unknown(C,z):this.handle_unknown(C,z)},W.prototype.handle_whitespace_and_comments=function(C,z){var Z=C.newlines,le=this._options.keep_array_indentation&&x(this._flags.mode);if(C.comments_before)for(var se=C.comments_before.next();se;)this.handle_whitespace_and_comments(se,z),this.handle_token(se,z),se=C.comments_before.next();if(le)for(var Ce=0;Ce<Z;Ce+=1)this.print_newline(Ce>0,z);else if(this._options.max_preserve_newlines&&Z>this._options.max_preserve_newlines&&(Z=this._options.max_preserve_newlines),this._options.preserve_newlines&&Z>1){this.print_newline(!1,z);for(var Ee=1;Ee<Z;Ee+=1)this.print_newline(!0,z)}};var H=["async","break","continue","return","throw","yield"];W.prototype.allow_wrap_or_preserved_newline=function(C,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var Z=this._options.preserve_newlines&&C.newlines||z,le=n(this._flags.last_token.text,s)||n(C.text,s);if(le){var se=n(this._flags.last_token.text,s)&&n(this._options.operator_position,f)||n(C.text,s);Z=Z&&se}if(Z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,H))return;this._output.set_wrap_point()}},W.prototype.print_newline=function(C,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Z=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&w(Z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(C)&&(this._flags.multiline_frame=!0)},W.prototype.print_token_line_indentation=function(C){this._output.just_added_newline()&&(this._options.keep_array_indentation&&C.newlines&&(C.text==="["||x(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(C.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))},W.prototype.print_token=function(C){if(this._output.raw){this._output.add_raw_token(C);return}if(this._options.comma_first&&C.previous&&C.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(C),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(C),this._output.non_breaking_space=!0,this._output.add_token(C.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},W.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},W.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))},W.prototype.set_mode=function(C){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,C),this._flags=this.create_flags(this._previous_flags,C),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},W.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&y(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},W.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},W.prototype.start_of_statement=function(C){var z=!1;return z=z||R(this._flags.last_token,["var","let","const"])&&C.type===i.WORD,z=z||w(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&R(this._flags.last_token,H)&&!C.newlines,z=z||w(this._flags.last_token,"else")&&!(w(C,"if")&&!C.comments_before),z=z||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),z=z||this._flags.last_token.type===i.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(C.text==="--"||C.text==="++")&&this._last_last_text!=="function"&&C.type!==i.WORD&&C.type!==i.RESERVED,z=z||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),z?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(C,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C,R(C,["do","for","if","while"])),!0):!1},W.prototype.handle_start_expr=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C);var z=h.Expression;if(C.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,c)&&(this._output.space_before_token=!0),this.print_token(C),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=h.ArrayLiteral,x(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())),n(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=h.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=h.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&C.whitespace_before===""?this._output.space_before_token=!1:(n(this._flags.last_token.text,c)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var Z=this._tokens.peek(-3);if(this._options.space_after_named_function&&Z){var le=this._tokens.peek(-4);R(Z,["async","function"])||Z.text==="*"&&R(le,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(Z.text==="{"||Z.text===","||Z.text==="*"&&(le.text==="{"||le.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(C);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&n(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===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(C,C.newlines),this.print_token(C),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},W.prototype.handle_end_expr=function(C){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(C,C.text==="]"&&x(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.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(C),this.restore_mode(),y(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},W.prototype.handle_start_block=function(C){this.handle_whitespace_and_comments(C);var z=this._tokens.peek(),Z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):Z&&(n(Z.text,[":",","])&&n(z.type,[i.STRING,i.WORD,i.RESERVED])||n(z.text,["get","set","..."])&&n(Z.type,[i.WORD,i.RESERVED]))?n(this._last_last_text,["class","interface"])&&!n(Z.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):n(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var le=!z.comments_before&&z.text==="}",se=le&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Ce=0,Ee=null;this._flags.inline_frame=!0;do if(Ce+=1,Ee=this._tokens.peek(Ce-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==i.EOF&&!(Ee.type===i.END_BLOCK&&Ee.opened===C))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(se||this._flags.last_token.type===i.EQUALS||R(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(x(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(C),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(C),this.indent(),!le&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},W.prototype.handle_end_block=function(C){for(this.handle_whitespace_and_comments(C);this._flags.mode===h.Statement;)this.restore_mode();var z=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(x(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(C)},W.prototype.handle_word=function(C){if(C.type===i.RESERVED){if(n(C.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)C.type=i.WORD;else if(C.text==="import"&&n(this._tokens.peek().text,["(","."]))C.type=i.WORD;else if(n(C.text,["as","from"])&&!this._flags.import_block)C.type=i.WORD;else if(this._flags.mode===h.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(C.type=i.WORD)}}if(this.start_of_statement(C)?R(this._flags.last_token,["var","let","const"])&&C.type===i.WORD&&(this._flags.declaration_statement=!0):C.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(C),this.print_newline()):this.handle_whitespace_and_comments(C),this._flags.do_block&&!this._flags.do_while)if(w(C,"while")){this._output.space_before_token=!0,this.print_token(C),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&&w(C,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(C,["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(C),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C)),w(C,"function")){(n(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(n(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!C.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,H)?this._output.space_before_token=!0:w(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===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||x(this._flags.mode))||this.print_newline(),this.print_token(C),this._flags.last_word=C.text;return}var Z="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":R(C,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===h.BlockStatement?Z="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&j(this._flags.mode)?Z="SPACE":this._flags.last_token.type===i.STRING?Z="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&n(this._last_last_text,["{",","]))?Z="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),R(C,c)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Z="SPACE":Z="NEWLINE"),R(C,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var le=this._output.current_line;le.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Z==="NEWLINE"?R(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(C,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!R(C,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(C,"if")&&w(C.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(C,c)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&x(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Z==="SPACE"&&(this._output.space_before_token=!0);C.previous&&(C.previous.type===i.WORD||C.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(C),this._flags.last_word=C.text,C.type===i.RESERVED&&(C.text==="do"?this._flags.do_block=!0:C.text==="if"?this._flags.if_block=!0:C.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(C,"from")&&(this._flags.import_block=!1))},W.prototype.handle_semicolon=function(C){this.start_of_statement(C)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(C);for(var z=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&w(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(C)},W.prototype.handle_string=function(C){C.text.startsWith("`")&&C.newlines===0&&C.whitespace_before===""&&(C.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(C)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(C),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C):C.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(C.previous.text==="]"||C.previous.text===")")&&C.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(C)},W.prototype.handle_equals=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0},W.prototype.handle_comma=function(C){this.handle_whitespace_and_comments(C,!0),this.print_token(C),this._output.space_before_token=!0,this._flags.declaration_statement?(j(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)},W.prototype.handle_operator=function(C){var z=C.text==="*"&&(R(this._flags.last_token,["function","yield"])||n(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),Z=n(C.text,["-","+"])&&(n(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||n(this._flags.last_token.text,c)||this._flags.last_token.text===",");if(!this.start_of_statement(C)){var le=!z;this.handle_whitespace_and_comments(C,le)}if(C.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(C);return}if(C.text==="::"){this.print_token(C);return}if(this._flags.last_token.type===i.OPERATOR&&n(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(C),C.text===":"&&this._flags.in_case){this.print_token(C),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.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 se=!0,Ce=!0,Ee=!1;if(C.text===":"?this._flags.ternary_depth===0?se=!1:(this._flags.ternary_depth-=1,Ee=!0):C.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!z&&this._options.preserve_newlines&&n(C.text,s)){var Ie=C.text===":",Qe=Ie&&Ee,Xe=Ie&&!Ee;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!Xe,this.print_token(C),(!Ie||Qe)&&this.allow_wrap_or_preserved_newline(C),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!Ie||Qe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(C):this._output.space_before_token=!1,this.print_token(C),this._output.space_before_token=!0;return;case E.preserve_newline:Xe||this.allow_wrap_or_preserved_newline(C),se=!(this._output.just_added_newline()||Xe),this._output.space_before_token=se,this.print_token(C),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(C),se=!1;var _e=this._tokens.peek();Ce=_e&&n(_e.type,[i.WORD,i.RESERVED])}else if(C.text==="...")this.allow_wrap_or_preserved_newline(C),se=this._flags.last_token.type===i.START_BLOCK,Ce=!1;else if(n(C.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(C),se=!1,Ce=!1,C.newlines&&(C.text==="--"||C.text==="++"||C.text==="~")){var pe=R(this._flags.last_token,S)&&C.newlines;pe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(pe,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(se=!0),this._flags.last_token.type===i.RESERVED?se=!0:this._flags.last_token.type===i.END_EXPR?se=!(this._flags.last_token.text==="]"&&(C.text==="--"||C.text==="++")):this._flags.last_token.type===i.OPERATOR&&(se=n(C.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(C.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&(Ce=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||se,this.print_token(C),this._output.space_before_token=Ce},W.prototype.handle_block_comment=function(C,z){if(this._output.raw){this._output.add_raw_token(C),C.directives&&C.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(C.directives){this.print_newline(!1,z),this.print_token(C),C.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(C.text)&&!C.newlines){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0;return}else this.print_block_commment(C,z)},W.prototype.print_block_commment=function(C,z){var Z=g(C.text),le,se=!1,Ce=!1,Ee=C.whitespace_before,Ie=Ee.length;if(this.print_newline(!1,z),this.print_token_line_indentation(C),this._output.add_token(Z[0]),this.print_newline(!1,z),Z.length>1){for(Z=Z.slice(1),se=F(Z,"*"),Ce=A(Z,Ee),se&&(this._flags.alignment=1),le=0;le<Z.length;le++)se?(this.print_token_line_indentation(C),this._output.add_token(O(Z[le]))):Ce&&Z[le]?(this.print_token_line_indentation(C),this._output.add_token(Z[le].substring(Ie))):(this._output.current_line.set_indent(-1),this._output.add_token(Z[le])),this.print_newline(!1,z);this._flags.alignment=0}},W.prototype.handle_comment=function(C,z){C.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(C),this.print_newline(!1,z)},W.prototype.handle_dot=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,S)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(C,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(C)},W.prototype.handle_unknown=function(C,z){this.print_token(C),C.text[C.text.length-1]===`
|
|
`&&this.print_newline(!1,z)},W.prototype.handle_eof=function(C){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C)},r.exports.Beautifier=W},function(r){function P(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}P.prototype.clone_empty=function(){var m=new P(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},P.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},P.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},P.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},P.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function _(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}_.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},_.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},_.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,u){this.__indent_cache=new _(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new 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(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(m,u){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(m)!==0&&o.item(-1)!==u){this.__lines.splice(a+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},function(r){function P(_,p,m,u){this.type=_,this.text=p,this.comments_before=null,this.newlines=m||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=P},function(r,P){var _="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\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",a="(?:\\\\u[0-9a-fA-F]{4}|["+_+m+"])",o="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])*";P.identifier=new RegExp(a+o,"g"),P.identifierStart=new RegExp(a),P.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])+");var c=/[\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(r,P,_){var p=_(6).Options,m=["before-newline","after-newline","preserve-newline"];function u(a){p.call(this,a,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="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 c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s<c.length;s++)c[s]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=c[s];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new p,r.exports.Options=u},function(r){function P(m,u){this.raw_options=_(m,u),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(m,u){var a=this.raw_options[m],o=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},P.prototype._get_boolean=function(m,u){var a=this.raw_options[m],o=a===void 0?!!u:!!a;return o},P.prototype._get_characters=function(m,u){var a=this.raw_options[m],o=u||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},P.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var o=parseInt(a,10);return isNaN(o)&&(o=u),o},P.prototype._get_selection=function(m,u,a){var o=this._get_selection_list(m,u,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return o[0]},P.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var o=this._get_array(m,a);if(!this._is_valid_selection(o,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return o},P.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function _(m,u){var a={};m=p(m);var o;for(o in m)o!==u&&(a[o]=m[o]);if(u&&m[u])for(o in m[u])a[o]=m[u][o];return a}function p(m){var u={},a;for(a in m){var o=a.replace(/-/g,"_");u[o]=m[a]}return u}r.exports.Options=P,r.exports.normalizeOpts=p,r.exports.mergeOpts=_},function(r,P,_){var p=_(8).InputScanner,m=_(9).Tokenizer,u=_(9).TOKEN,a=_(13).Directives,o=_(4),c=_(12).Pattern,s=_(14).TemplatablePattern;function i(F,A){return A.indexOf(F)!==-1}var n={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:u.START,RAW:u.RAW,EOF:u.EOF},O=new a(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,w=/[0-9]/,R=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var E=new RegExp(v),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+h.join("|")+")$"),g,x=function(F,A){m.call(this,F,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var W=new c(this._input),H=new s(this._input).read_options(this._options);this.__patterns={template:H,identifier:H.starting_with(o.identifier).matching(o.identifierMatch),number:W.matching(T),punct:W.matching(E),comment:W.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:W.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:W.matching(/<!--/),html_comment_end:W.matching(/-->/),include:W.starting_with(/#include/).until_after(o.lineBreak),shebang:W.starting_with(/#!/).until_after(o.lineBreak),xml:W.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:H.until(/['\\\n\r\u2028\u2029]/),double_quote:H.until(/["\\\n\r\u2028\u2029]/),template_text:H.until(/[`\\$]/),template_expression:H.until(/[`}\\]/)}};x.prototype=new m,x.prototype._is_comment=function(F){return F.type===n.COMMENT||F.type===n.BLOCK_COMMENT||F.type===n.UNKNOWN},x.prototype._is_opening=function(F){return F.type===n.START_BLOCK||F.type===n.START_EXPR},x.prototype._is_closing=function(F,A){return(F.type===n.END_BLOCK||F.type===n.END_EXPR)&&A&&(F.text==="]"&&A.text==="["||F.text===")"&&A.text==="("||F.text==="}"&&A.text==="{")},x.prototype._reset=function(){g=!1},x.prototype._get_next_token=function(F,A){var W=null;this._readWhitespace();var H=this._input.peek();return H===null?this._create_token(n.EOF,""):(W=W||this._read_non_javascript(H),W=W||this._read_string(H),W=W||this._read_word(F),W=W||this._read_singles(H),W=W||this._read_comment(H),W=W||this._read_regexp(H,F),W=W||this._read_xml(H,F),W=W||this._read_punctuation(),W=W||this._create_token(n.UNKNOWN,this._input.next()),W)},x.prototype._read_word=function(F){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(o.allLineBreaks,`
|
|
`),!(F.type===n.DOT||F.type===n.RESERVED&&(F.text==="set"||F.text==="get"))&&y.test(A)?(A==="in"||A==="of")&&(F.type===n.WORD||F.type===n.STRING)?this._create_token(n.OPERATOR,A):this._create_token(n.RESERVED,A):this._create_token(n.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(n.WORD,A)},x.prototype._read_singles=function(F){var A=null;return F==="("||F==="["?A=this._create_token(n.START_EXPR,F):F===")"||F==="]"?A=this._create_token(n.END_EXPR,F):F==="{"?A=this._create_token(n.START_BLOCK,F):F==="}"?A=this._create_token(n.END_BLOCK,F):F===";"?A=this._create_token(n.SEMICOLON,F):F==="."&&R.test(this._input.peek(1))?A=this._create_token(n.DOT,F):F===","&&(A=this._create_token(n.COMMA,F)),A&&this._input.next(),A},x.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(n.EQUALS,F):F==="?."?this._create_token(n.DOT,F):this._create_token(n.OPERATOR,F)},x.prototype._read_non_javascript=function(F){var A="";if(F==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(n.UNKNOWN,A.trim()+`
|
|
`);if(A=this.__patterns.include.read(),A)return this._create_token(n.UNKNOWN,A.trim()+`
|
|
`);F=this._input.next();var W="#";if(this._input.hasNext()&&this._input.testChar(w)){do F=this._input.next(),W+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(W+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(W+="{}",this._input.next(),this._input.next())),this._create_token(n.WORD,W)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)A+=this._input.next();return g=!0,this._create_token(n.COMMENT,A)}}else if(g&&F==="-"&&(A=this.__patterns.html_comment_end.read(),A))return g=!1,this._create_token(n.COMMENT,A);return null},x.prototype._read_comment=function(F){var A=null;if(F==="/"){var W="";if(this._input.peek(1)==="*"){W=this.__patterns.block_comment.read();var H=O.get_directives(W);H&&H.ignore==="start"&&(W+=O.readIgnored(this._input)),W=W.replace(o.allLineBreaks,`
|
|
`),A=this._create_token(n.BLOCK_COMMENT,W),A.directives=H}else this._input.peek(1)==="/"&&(W=this.__patterns.comment.read(),A=this._create_token(n.COMMENT,W))}return A},x.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var A=this._input.next();return this.has_char_escapes=!1,F==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(A=j(A)),this._input.peek()===F&&(A+=this._input.next()),A=A.replace(o.allLineBreaks,`
|
|
`),this._create_token(n.STRING,A)}return null},x.prototype._allow_regexp_or_xml=function(F){return F.type===n.RESERVED&&i(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===n.END_EXPR&&F.text===")"&&F.opened.previous.type===n.RESERVED&&i(F.opened.previous.text,["if","while","for"])||i(F.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},x.prototype._read_regexp=function(F,A){if(F==="/"&&this._allow_regexp_or_xml(A)){for(var W=this._input.next(),H=!1,C=!1;this._input.hasNext()&&(H||C||this._input.peek()!==F)&&!this._input.testChar(o.newline);)W+=this._input.peek(),H?H=!1:(H=this._input.peek()==="\\",this._input.peek()==="["?C=!0:this._input.peek()==="]"&&(C=!1)),this._input.next();return this._input.peek()===F&&(W+=this._input.next(),W+=this._input.read(o.identifier)),this._create_token(n.STRING,W)}return null},x.prototype._read_xml=function(F,A){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(A)){var W="",H=this.__patterns.xml.read_match();if(H){for(var C=H[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=C.indexOf("{")===0,Z=0;H;){var le=!!H[1],se=H[2],Ce=!!H[H.length-1]||se.slice(0,8)==="![CDATA[";if(!Ce&&(se===C||z&&se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(le?--Z:++Z),W+=H[0],Z<=0)break;H=this.__patterns.xml.read_match()}return H||(W+=this._input.match(/[\s\S]*/g)[0]),W=W.replace(o.allLineBreaks,`
|
|
`),this._create_token(n.STRING,W)}}return null};function j(F){for(var A="",W=0,H=new p(F),C=null;H.hasNext();)if(C=H.match(/([\s]|[^\\]|\\\\)+/g),C&&(A+=C[0]),H.peek()==="\\"){if(H.next(),H.peek()==="x")C=H.match(/x([0-9A-Fa-f]{2})/g);else if(H.peek()==="u")C=H.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",H.hasNext()&&(A+=H.next());continue}if(!C)return F;if(W=parseInt(C[1],16),W>126&&W<=255&&C[0].indexOf("x")===0)return F;if(W>=0&&W<32){A+="\\"+C[0];continue}else W===34||W===39||W===92?A+="\\"+String.fromCharCode(W):A+=String.fromCharCode(W)}return A}x.prototype._read_string_recursive=function(F,A,W){var H,C;F==="'"?C=this.__patterns.single_quote:F==='"'?C=this.__patterns.double_quote:F==="`"?C=this.__patterns.template_text:F==="}"&&(C=this.__patterns.template_expression);for(var z=C.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===F||!A&&o.newline.test(Z)){this._input.back();break}else Z==="\\"&&this._input.hasNext()?(H=this._input.peek(),H==="x"||H==="u"?this.has_char_escapes=!0:H==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Z+=this._input.next()):W&&(W==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),W===Z&&(F==="`"?Z+=this._read_string_recursive("}",A,"`"):Z+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=C.read(),z+=Z}return z},r.exports.Tokenizer=x,r.exports.TOKEN=n,r.exports.positionable_operators=S.slice(),r.exports.line_starters=f.slice()},function(r){var P=RegExp.prototype.hasOwnProperty("sticky");function _(p){this.__input=p||"",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 p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},_.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},_.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(P&&p.sticky)&&(u.index!==m&&(u=null)),u},_.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},_.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},_.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},_.prototype.read=function(p,m,u){var a="",o;return p&&(o=this.match(p),o&&(a+=o[0])),m&&(o||!p)&&(a+=this.readUntil(m,u)),a},_.prototype.readUntil=function(p,m){var u="",a=this.__position;p.lastIndex=this.__position;var o=p.exec(this.__input);return o?(a=o.index,m&&(a+=o[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},_.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},_.prototype.get_regexp=function(p,m){var u=null,a="g";return m&&P&&(a="y"),typeof p=="string"&&p!==""?u=new RegExp(p,a):p&&(u=new RegExp(p.source,a)),u},_.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},_.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=_},function(r,P,_){var p=_(8).InputScanner,m=_(3).Token,u=_(10).TokenStream,a=_(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(s,i){this._input=new p(s),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var s,i=new m(o.START,""),n=null,O=[],T=new u;i.type!==o.EOF;){for(s=this._get_next_token(i,n);this._is_comment(s);)T.add(s),s=this._get_next_token(i,n);T.isEmpty()||(s.comments_before=T,T=new u),s.parent=n,this._is_opening(s)?(O.push(n),n=s):n&&this._is_closing(s,n)&&(s.opened=n,n.closed=s,n=O.pop(),s.parent=n),s.previous=i,i.next=s,this.__tokens.add(s),i=s}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(s,i){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(o.RAW,n):this._create_token(o.EOF,"")},c.prototype._is_comment=function(s){return!1},c.prototype._is_opening=function(s){return!1},c.prototype._is_closing=function(s,i){return!1},c.prototype._create_token=function(s,i){var n=new m(s,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=c,r.exports.TOKEN=o},function(r){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 p=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(p=this.__tokens[_]),p},P.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},r.exports.TokenStream=P},function(r,P,_){var p=_(12).Pattern;function m(u,a){p.call(this,u,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new p,m.prototype.__set_whitespace_patterns=function(u,a){u+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var a=this.__split(this._newline_regexp,u);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return u},m.prototype.matching=function(u,a){var o=this._create();return o.__set_whitespace_patterns(u,a),o._update(),o},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(u,a){u.lastIndex=0;for(var o=0,c=[],s=u.exec(a);s;)c.push(a.substring(o,s.index)),o=s.index+s[0].length,s=u.exec(a);return o<a.length?c.push(a.substring(o,a.length)):c.push(""),c},r.exports.WhitespacePattern=m},function(r){function P(_,p){this._input=_,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 _=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 p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(_),p._update(),p},P.prototype.until=function(_){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(_),p._update(),p},P.prototype.starting_with=function(_){var p=this._create();return p._starting_pattern=this._input.get_regexp(_,!0),p._update(),p},P.prototype.matching=function(_){var p=this._create();return p._match_pattern=this._input.get_regexp(_,!0),p._update(),p},P.prototype._create=function(){return new P(this._input,this)},P.prototype._update=function(){},r.exports.Pattern=P},function(r){function P(_,p){_=typeof _=="string"?_:_.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+p,"g")}P.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(_);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(_);return p},P.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=P},function(r,P,_){var p=_(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(a,o){p.call(this,a,o),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var c=new p(a);this.__patterns={handlebars_comment:c.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:c.starting_with(/{{{/).until_after(/}}}/),handlebars:c.starting_with(/{{/).until_after(/}}/),php:c.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:c.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:c.starting_with(/{%/).until_after(/%}/),django_value:c.starting_with(/{{/).until_after(/}}/),django_comment:c.starting_with(/{#/).until_after(/#}/),smarty:c.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:c.starting_with(/{\*/).until_after(/\*}/),smarty_literal:c.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new p,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(a){var o=this._create();return o._disabled[a]=!0,o._update(),o},u.prototype.read_options=function(a){var o=this._create();for(var c in m)o._disabled[c]=a.templating.indexOf(c)===-1;return o._update(),o},u.prototype.exclude=function(a){var o=this._create();return o._excluded[a]=!0,o._update(),o},u.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),a+=o,o=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},u.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},u.prototype._read_template=function(){var a="",o=this._input.peek();if(o==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(a=a||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},r.exports.TemplatablePattern=u}],k={};function K(r){var P=k[r];if(P!==void 0)return P.exports;var _=k[r]={exports:{}};return M[r](_,_.exports,K),_.exports}var I=K(0);U=I})();var G=U;!(q=[],Y=function(){return{js_beautify:G}}.apply(fe,q),Y!==void 0&&(Gt.exports=Y))})()},"6eGT":function(Gt,fe,D){"use strict";function q(Y){return null}fe.a=q},"746U":function(Gt,fe,D){"use strict";D.d(fe,"f",function(){return q}),D.d(fe,"l",function(){return Y}),D.d(fe,"k",function(){return U}),D.d(fe,"j",function(){return G}),D.d(fe,"g",function(){return M}),D.d(fe,"m",function(){return k}),D.d(fe,"h",function(){return K}),D.d(fe,"n",function(){return I}),D.d(fe,"c",function(){return r}),D.d(fe,"a",function(){return P}),D.d(fe,"i",function(){return _}),D.d(fe,"o",function(){return p}),D.d(fe,"e",function(){return a}),D.d(fe,"d",function(){return o}),D.d(fe,"p",function(){return c}),D.d(fe,"b",function(){return s});function q(i){return Array.isArray(i)}function Y(i){return typeof i=="string"}function U(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function G(i){return typeof i=="number"&&!isNaN(i)}function M(i){return i===!0||i===!1}function k(i){return typeof i=="undefined"}function K(i){return!I(i)}function I(i){return k(i)||i===null}function r(i,n){if(!i)throw new Error(n?`Unexpected type, expected '${n}'`:"Unexpected type")}function P(i){if(I(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function _(i){return typeof i=="function"}function p(i,n){const O=Math.min(i.length,n.length);for(let T=0;T<O;T++)m(i[T],n[T])}function m(i,n){if(Y(n)){if(typeof i!==n)throw new Error(`argument does not match constraint: typeof ${n}`)}else if(_(n)){try{if(i instanceof n)return}catch(O){}if(!I(i)&&i.constructor===n)return;if(n.length===1&&n.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(i){let n=[],O=Object.getPrototypeOf(i);for(;Object.prototype!==O;)n=n.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return n}function a(i){const n=[];for(const O of u(i))typeof i[O]=="function"&&n.push(O);return n}function o(i,n){const O=w=>function(){const R=Array.prototype.slice.call(arguments,0);return n(w,R)};let T={};for(const w of i)T[w]=O(w);return T}function c(i){return i===null?void 0:i}function s(i,n="Unreachable"){throw new Error(n)}},"7Cbv":function(Gt,fe,D){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function U(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(Y)}var G=/^(?:[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 M(m){return typeof m=="string"&&G.test(m)}for(var k=M,K=[],I=0;I<256;++I)K.push((I+256).toString(16).substr(1));function r(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(K[m[u+0]]+K[m[u+1]]+K[m[u+2]]+K[m[u+3]]+"-"+K[m[u+4]]+K[m[u+5]]+"-"+K[m[u+6]]+K[m[u+7]]+"-"+K[m[u+8]]+K[m[u+9]]+"-"+K[m[u+10]]+K[m[u+11]]+K[m[u+12]]+K[m[u+13]]+K[m[u+14]]+K[m[u+15]]).toLowerCase();if(!k(a))throw TypeError("Stringified UUID is invalid");return a}var P=r;function _(m,u,a){m=m||{};var o=m.random||(m.rng||U)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,u){a=a||0;for(var c=0;c<16;++c)u[a+c]=o[c];return u}return P(o)}var p=fe.a=_},"7ahc":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return O});var q=D("k1fw"),Y=D("0Owb"),U=D("+L6B"),G=D("2/Rp"),M=D("y8nQ"),k=D("Vl3Y"),K=D("tJVT"),I=D("OaEy"),r=D("2fM7"),P=D("q1tI"),_=D.n(P),p=D("VrN/"),m=D.n(p),u=D("p77/"),a=D.n(u),o=D("c5Ni"),c=D.n(o),s=r.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},n={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"]};fe.b=function(T){var w=T.callback,R=T.onCancel,S=Object(P.useState)("python"),v=Object(K.a)(S,2),E=v[0],f=v[1];function h(g){f(n[g][1])}function y(g){w(g)}return _.a.createElement(k.a,Object(Y.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),_.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},_.a.createElement(r.a,{onChange:h},Object.keys(n).map(function(g){return _.a.createElement(s,{key:g,value:g},n[g][0])}))),_.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},_.a.createElement(O,{mode:E})),_.a.createElement("div",{className:"flex-container flex-end"},_.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(G.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function O(T){var w=T.value,R=T.onChange,S=T.mode,v=T.options,E=v===void 0?{}:v,f=Object(P.useRef)(),h=Object(P.useState)(),y=Object(K.a)(h,2),g=y[0],x=y[1];return Object(P.useEffect)(function(){if(g){function j(F){var A=F.getValue();R&&R(A)}return g.on("change",j),function(){g.off("change",j)}}},[g,R]),Object(P.useEffect)(function(){g&&g.setOption("mode",S)},[g,S]),Object(P.useEffect)(function(){g&&((w!==g.getValue()||w==="")&&setTimeout(function(){g.setValue(w||" ")},300))},[g,w]),Object(P.useEffect)(function(){if(f.current&&!g){var j=m.a.fromTextArea(f.current,Object(q.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));x(j)}},[f.current,g]),_.a.createElement("div",{className:"my-codemirror-container"},_.a.createElement("textarea",{ref:f}))}},"7ixt":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return U});var q={adjustX:1,adjustY:1},Y=[0,0],U={left:{points:["cr","cl"],overflow:q,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:q,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:q,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:q,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:q,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:q,offset:[-4,0],targetOffset:Y}},G=U},"815F":function(Gt,fe,D){"use strict";D.d(fe,"e",function(){return K}),D.d(fe,"c",function(){return r}),D.d(fe,"d",function(){return P}),D.d(fe,"a",function(){return p}),D.d(fe,"f",function(){return m}),D.d(fe,"b",function(){return u});var q=D("KQm4"),Y=D("VTBJ"),U=D("Ff2n"),G=D("Zm9Q"),M=D("Kwbf"),k=D("OZM5");function K(a,o){return a!=null?a:o}function I(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=new Map;function c(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(n){var O=n.key,T=n.children;Object(M.a)(O!=null,"Tree node must have a certain key: [".concat(i).concat(O,"]"));var w=String(O);Object(M.a)(!o.has(w)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(w)),o.set(w,!0),c(T,"".concat(i).concat(w," > "))})}c(a)}function r(a){function o(c){var s=Object(G.a)(c);return s.map(function(i){if(!Object(k.i)(i))return Object(M.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var n=i.key,O=i.props,T=O.children,w=Object(U.a)(O,["children"]),R=Object(Y.a)({key:n},w),S=o(T);return S.length&&(R.children=S),R}).filter(function(i){return i})}return o(a)}function P(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(o===!0?[]:o),s=[];function i(n){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(T,w){var R=Object(k.h)(O?O.pos:"0",w),S=K(T.key,R),v=Object(Y.a)(Object(Y.a)({},T),{},{parent:O,pos:R,children:null,data:T,isStart:[].concat(Object(q.a)(O?O.isStart:[]),[w===0]),isEnd:[].concat(Object(q.a)(O?O.isEnd:[]),[w===n.length-1])});return s.push(v),o===!0||c.has(S)?v.children=i(T.children||[],v):v.children=[],v})}return i(a),s}function _(a,o,c){var s;c?typeof c=="string"?s=function(O){return O[c]}:typeof c=="function"&&(s=function(O){return c(O)}):s=function(O,T){return K(O.key,T)};function i(n,O,T){var w=n?n.children:a,R=n?Object(k.h)(T.pos,O):"0";if(n){var S=s(n,R),v={node:n,index:O,pos:R,key:S,parentPos:T.node?T.pos:null,level:T.level+1};o(v)}w&&w.forEach(function(E,f){i(E,f,{node:n,pos:R,level:T?T.level+1:-1})})}i(null)}function p(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=o.initWrapper,s=o.processEntity,i=o.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,O={},T={},w={posEntities:O,keyEntities:T};return c&&(w=c(w)||w),_(a,function(R){var S=R.node,v=R.index,E=R.pos,f=R.key,h=R.parentPos,y=R.level,g={node:S,index:v,key:f,pos:E,level:y},x=K(f,E);O[E]=g,T[x]=g,g.parent=O[h],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),s&&s(g,w)},n),i&&i(w),w}function m(a,o){var c=o.expandedKeys,s=o.selectedKeys,i=o.loadedKeys,n=o.loadingKeys,O=o.checkedKeys,T=o.halfCheckedKeys,w=o.dragOverNodeKey,R=o.dropPosition,S=o.keyEntities,v=S[a],E={eventKey:a,expanded:c.indexOf(a)!==-1,selected:s.indexOf(a)!==-1,loaded:i.indexOf(a)!==-1,loading:n.indexOf(a)!==-1,checked:O.indexOf(a)!==-1,halfChecked:T.indexOf(a)!==-1,pos:String(v?v.pos:""),dragOver:w===a&&R===0,dragOverGapTop:w===a&&R===-1,dragOverGapBottom:w===a&&R===1};return E}function u(a){var o=a.data,c=a.expanded,s=a.selected,i=a.checked,n=a.loaded,O=a.loading,T=a.halfChecked,w=a.dragOver,R=a.dragOverGapTop,S=a.dragOverGapBottom,v=a.pos,E=a.active,f=Object(Y.a)(Object(Y.a)({},o),{},{expanded:c,selected:s,checked:i,loaded:n,loading:O,halfChecked:T,dragOver:w,dragOverGapTop:R,dragOverGapBottom:S,pos:v,active:E});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(M.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),f}},"8EBN":function(Gt,fe,D){(function(q){q(D("VrN/"))})(function(q){"use strict";q.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 Y=0;Y<q.modeInfo.length;Y++){var U=q.modeInfo[Y];U.mimes&&(U.mime=U.mimes[0])}q.findModeByMIME=function(G){G=G.toLowerCase();for(var M=0;M<q.modeInfo.length;M++){var k=q.modeInfo[M];if(k.mime==G)return k;if(k.mimes){for(var K=0;K<k.mimes.length;K++)if(k.mimes[K]==G)return k}}if(/\+xml$/.test(G))return q.findModeByMIME("application/xml");if(/\+json$/.test(G))return q.findModeByMIME("application/json")},q.findModeByExtension=function(G){G=G.toLowerCase();for(var M=0;M<q.modeInfo.length;M++){var k=q.modeInfo[M];if(k.ext){for(var K=0;K<k.ext.length;K++)if(k.ext[K]==G)return k}}},q.findModeByFileName=function(G){for(var M=0;M<q.modeInfo.length;M++){var k=q.modeInfo[M];if(k.file&&k.file.test(G))return k}var K=G.lastIndexOf("."),I=K>-1&&G.substring(K+1,G.length);if(I)return q.findModeByExtension(I)},q.findModeByName=function(G){G=G.toLowerCase();for(var M=0;M<q.modeInfo.length;M++){var k=q.modeInfo[M];if(k.name.toLowerCase()==G)return k;if(k.alias){for(var K=0;K<k.alias.length;K++)if(k.alias[K].toLowerCase()==G)return k}}}})},"8HAY":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return M}),D.d(fe,"b",function(){return k}),D.d(fe,"d",function(){return K}),D.d(fe,"e",function(){return I}),D.d(fe,"c",function(){return r});var q=D("MI8n"),Y=D("pmY6"),U=D("3/fG"),G=function(P,_,p,m){function u(a){return a instanceof p?a:new p(function(o){o(a)})}return new(p||(p=Promise))(function(a,o){function c(n){try{i(m.next(n))}catch(O){o(O)}}function s(n){try{i(m.throw(n))}catch(O){o(O)}}function i(n){n.done?a(n.value):u(n.value).then(c,s)}i((m=m.apply(P,_||[])).next())})};class M extends Y.a{constructor(P,_="",p="",m=!0,u){super();this._onDidChange=this._register(new q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=P,this._label=_,this._cssClass=p,this._enabled=m,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(P){this._setLabel(P)}_setLabel(P){this._label!==P&&(this._label=P,this._onDidChange.fire({label:P}))}get tooltip(){return this._tooltip||""}set tooltip(P){this._setTooltip(P)}_setTooltip(P){this._tooltip!==P&&(this._tooltip=P,this._onDidChange.fire({tooltip:P}))}get class(){return this._cssClass}set class(P){this._setClass(P)}_setClass(P){this._cssClass!==P&&(this._cssClass=P,this._onDidChange.fire({class:P}))}get enabled(){return this._enabled}set enabled(P){this._setEnabled(P)}_setEnabled(P){this._enabled!==P&&(this._enabled=P,this._onDidChange.fire({enabled:P}))}get checked(){return this._checked}set checked(P){this._setChecked(P)}_setChecked(P){this._checked!==P&&(this._checked=P,this._onDidChange.fire({checked:P}))}run(P,_){return G(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(P))})}}class k extends Y.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new q.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new q.b),this.onDidRun=this._onDidRun.event}run(P,_){return G(this,void 0,void 0,function*(){if(!P.enabled)return;this._onBeforeRun.fire({action:P});let p;try{yield this.runAction(P,_)}catch(m){p=m}this._onDidRun.fire({action:P,error:p})})}runAction(P,_){return G(this,void 0,void 0,function*(){yield P.run(_)})}}class K extends M{constructor(P){super(K.ID,P,P?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class I{constructor(P,_,p,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=P,this.label=_,this.class=m,this._actions=p}get actions(){return this._actions}dispose(){}run(){return G(this,void 0,void 0,function*(){})}}class r extends M{constructor(){super(r.ID,U.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(Gt,fe,D){Gt.exports={button:"button___1wy9m"}},"9Bee":function(Gt,fe,D){"use strict";var q=D("DYRE"),Y=D("zeV3"),U=D("+L6B"),G=D("2/Rp"),M=D("k1fw"),k=D("9og8"),K=D("tJVT"),I=D("WmNS"),r=D.n(I),P=D("q1tI"),_=D.n(P),p=D("vg9a"),m=D("DlQD"),u=D.n(m),a=D("rUJ1");function o(X,L){var N=X.match(/^(\s+)(?:```)/);if(N===null)return L;var V=N[1];return L.split(`
|
|
`).map(function(ne){var J=ne.match(/^\s+/);if(J===null)return ne;var Fe=Object(K.a)(J,1),Jt=Fe[0];return Jt.length>=V.length?ne.slice(V.length):ne}).join(`
|
|
`)}var c=[],s=["<ul>"],i=new u.a.Renderer,n=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){c.length=0,s=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(X,L,N,V){if(L>=X.length||X[L].level<=N)return L;var ne=X[L];V.push("<li><a href='#"+ne.anchor+"'>"+ne.text+"</a>"),L++;var J=[];return L=w(X,L,ne.level,J),J.length>0&&(V.push("<ul>"),J.forEach(function(Fe){V.push(Fe)}),V.push("</ul>")),V.push("</li>"),L=w(X,L,N,V),L}function R(){return w(c,0,0,s),s.push("</ul>"),s.join("")}var S={heading:function(L){var N=n.exec(L);if(N)return{type:"heading",raw:N[0],depth:N[1].length,text:N[2]}},fences:function(L){var N=this.rules.block.fences.exec(L);if(N){var V=N[0],ne=o(V,N[3]||""),J=N[2]?N[2].trim():N[2];if(["latex","katex","math"].indexOf(J)>=0){var Fe=f(),Jt=ne;ne=Fe,h[Fe]={type:"block",expression:Jt}}return{type:"code",raw:V,lang:J,text:ne}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,f=function(){return"__special_katext_id_".concat(E++,"__")},h={};function y(){return h}function g(){E=0,h={}}function x(X){return X=X.replace(v,function(L,N){var V=f();return h[V]={type:"inline",expression:N},V}),X}var j=i.listitem;i.listitem=function(X){return j(x(X))};var F=i.paragraph;i.paragraph=function(X){return F(x(X))};var A=i.tablecell;i.tablecell=function(X,L){return A(x(X),L)},i.code=function(X,L,N){var V=(L||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(N?X:Object(a.escape)(X,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(N?X:Object(a.escape)(X,!0))+"</code></pre>"},i.heading=function(X,L,N){var V=this.options.headerPrefix+N.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:V,level:L,text:X}),"<h"+L+' id="'+V+'">'+X+"</h"+L+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:S,renderer:i});var W=u.a,H=D("SJMd"),C=D("ulZh"),z=D.n(C),Z=D("m3rI"),le=D("Oy/b"),se=D("p5ED"),Ce=D("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 Ee=function(X,L){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,V){N.__proto__=V}||function(N,V){for(var ne in V)Object.prototype.hasOwnProperty.call(V,ne)&&(N[ne]=V[ne])})(X,L)};function Ie(X,L){function N(){this.constructor=X}Ee(X,L),X.prototype=L===null?Object.create(L):(N.prototype=L.prototype,new N)}function Qe(X,L,N,V){return new(N||(N=Promise))(function(ne,J){function Fe(Zn){try{In(V.next(Zn))}catch(ln){J(ln)}}function Jt(Zn){try{In(V.throw(Zn))}catch(ln){J(ln)}}function In(Zn){var ln;Zn.done?ne(Zn.value):(ln=Zn.value,ln instanceof N?ln:new N(function(ir){ir(ln)})).then(Fe,Jt)}In((V=V.apply(X,L||[])).next())})}function Xe(X,L){var N,V,ne,J,Fe={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return J={next:Jt(0),throw:Jt(1),return:Jt(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function Jt(In){return function(Zn){return function(ln){if(N)throw new TypeError("Generator is already executing.");for(;Fe;)try{if(N=1,V&&(ne=2&ln[0]?V.return:ln[0]?V.throw||((ne=V.return)&&ne.call(V),0):V.next)&&!(ne=ne.call(V,ln[1])).done)return ne;switch(V=0,ne&&(ln=[2&ln[0],ne.value]),ln[0]){case 0:case 1:ne=ln;break;case 4:return Fe.label++,{value:ln[1],done:!1};case 5:Fe.label++,V=ln[1],ln=[0];continue;case 7:ln=Fe.ops.pop(),Fe.trys.pop();continue;default:if(!(ne=Fe.trys,(ne=ne.length>0&&ne[ne.length-1])||ln[0]!==6&&ln[0]!==2)){Fe=0;continue}if(ln[0]===3&&(!ne||ln[1]>ne[0]&&ln[1]<ne[3])){Fe.label=ln[1];break}if(ln[0]===6&&Fe.label<ne[1]){Fe.label=ne[1],ne=ln;break}if(ne&&Fe.label<ne[2]){Fe.label=ne[2],Fe.ops.push(ln);break}ne[2]&&Fe.ops.pop(),Fe.trys.pop();continue}ln=L.call(X,Fe)}catch(ir){ln=[6,ir],V=0}finally{N=ne=0}if(5&ln[0])throw ln[1];return{value:ln[0]?ln[1]:void 0,done:!0}}([In,Zn])}}}function _e(){for(var X=0,L=0,N=arguments.length;L<N;L++)X+=arguments[L].length;var V=Array(X),ne=0;for(L=0;L<N;L++)for(var J=arguments[L],Fe=0,Jt=J.length;Fe<Jt;Fe++,ne++)V[ne]=J[Fe];return V}var pe=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(L,N){for(var V=0,ne=N;V<ne.length;V++){var J=ne[V],Fe=J[0],Jt=J[1];L.setAttribute(Fe,Jt)}},X.createRect=function(L,N,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",N.toString()),V&&X.setAttributes(ne,V),ne},X.createLine=function(L,N,V,ne,J){var Fe=document.createElementNS("http://www.w3.org/2000/svg","line");return Fe.setAttribute("x1",L.toString()),Fe.setAttribute("y1",N.toString()),Fe.setAttribute("x2",V.toString()),Fe.setAttribute("y2",ne.toString()),J&&X.setAttributes(Fe,J),Fe},X.createPolygon=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",L),N&&X.setAttributes(V,N),V},X.createCircle=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(L/2).toString()),V.setAttribute("cy",(L/2).toString()),V.setAttribute("r",L.toString()),N&&X.setAttributes(V,N),V},X.createEllipse=function(L,N,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(N/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(N/2).toString()),V&&X.setAttributes(ne,V),ne},X.createGroup=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&X.setAttributes(N,L),N},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(L,N,V,ne,J,Fe,Jt){var In=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(In,[["id",L],["orient",N],["markerWidth",V.toString()],["markerHeight",ne.toString()],["refX",J.toString()],["refY",Fe.toString()]]),In.appendChild(Jt),In},X.createText=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),L&&X.setAttributes(N,L),N},X.createTSpan=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=L,N&&X.setAttributes(V,N),V},X.createImage=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&X.setAttributes(N,L),N},X.createPoint=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=L,V.y=N,V},X.createPath=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",L),N&&X.setAttributes(V,N),V},X}(),at=function(){function X(){}return X.addKey=function(L){X.key=L},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Qt=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(L,N,V){var ne=this;return new Promise(function(J){var Fe=V!==void 0?V:document.createElement("canvas");L===null&&(ne.markersOnly=!0,ne.naturalSize=!1);var Jt=document.createElementNS("http://www.w3.org/2000/svg","svg");Jt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Jt.setAttribute("width",N.width.baseVal.valueAsString),Jt.setAttribute("height",N.height.baseVal.valueAsString),Jt.setAttribute("viewBox","0 0 "+N.viewBox.baseVal.width.toString()+" "+N.viewBox.baseVal.height.toString()),Jt.innerHTML=N.innerHTML,ne.naturalSize===!0?(Jt.width.baseVal.value=L.naturalWidth,Jt.height.baseVal.value=L.naturalHeight):ne.width!==void 0&&ne.height!==void 0&&(Jt.width.baseVal.value=ne.width,Jt.height.baseVal.value=ne.height),Fe.width=Jt.width.baseVal.value,Fe.height=Jt.height.baseVal.value;var In=Jt.outerHTML,Zn=Fe.getContext("2d");ne.markersOnly!==!0&&Zn.drawImage(L,0,0,Fe.width,Fe.height);var ln=window.URL,ir=new Image(Fe.width,Fe.height);ir.setAttribute("crossOrigin","anonymous");var tr=new Blob([In],{type:"image/svg+xml"}),Mr=ln.createObjectURL(tr);ir.onload=function(){Zn.drawImage(ir,0,0),ln.revokeObjectURL(Mr);var ui=Fe.toDataURL(ne.imageType,ne.imageQuality);J(ui)},ir.src=Mr})},X}(),Ft=function(){},Tt=function(){function X(L){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},X.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new Ve("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new pt("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new pt("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),Ve=function(X,L){this.selector=X,this.style=L},pt=function(X,L){this.localName=X,this.style=L},ut=function(){function X(L,N,V,ne,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=L,this.displayMode=N,this.markerItems=V,this.uiStyleSettings=ne,this.styles=J,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(L){var N=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",this.uiContainer.appendChild(V),this.addActionButton(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(J){var Fe=document.createElement("div");Fe.className=""+N.toolbarButtonStyleClass.name,Fe.setAttribute("data-type-name",J.typeName),Fe.innerHTML=J.icon,Fe.addEventListener("click",function(){N.markerToolbarButtonClicked(Fe,J)}),N.buttons.push(Fe),N.markerButtons.push(Fe)}),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 ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",ne.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ne),this.addActionButton(ne,'<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(ne,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(L){this.buttonClickListeners.push(L)},X.prototype.removeButtonClickListener=function(L){this.buttonClickListeners.indexOf(L)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(L),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var L=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var N=0;N<this.markerButtons.length;N++)N<L||N===L&&this.markerButtons.length-1===L?this.markerButtonBlock.appendChild(this.markerButtons[N]):(N===L&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[N]))}},X.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},X.prototype.resetButtonStyles=function(){var L=this;this.buttons.forEach(function(N){N.className=N.className.replace(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name,"").trim(),N.className=N.className.replace(L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:L.toolbarActiveButtonStyleColorsClass.name,"").trim(),N.className+=" "+(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(L,N,V){var ne=this,J=document.createElement("div");switch(J.className=""+this.toolbarButtonStyleClass.name,J.innerHTML=N,J.setAttribute("data-action",V),J.addEventListener("click",function(){ne.actionToolbarButtonClicked(J,V)}),V){case"select":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":J.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":J.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":J.style.fill=this.uiStyleSettings.closeButtonColor}L.appendChild(J),this.buttons.push(J)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pt("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 pt("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pt("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new pt("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 pt("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new pt("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pt("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},X.prototype.markerToolbarButtonClicked=function(L,N){this.setActiveButton(L),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",N)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(L,N){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",N)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(L){this.resetButtonStyles(),L.className=L.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),L.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(L){var N=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===L});N&&this.setActiveButton(N)},X.prototype.setCurrentMarker=function(L){var N=this;this.currentMarker=L,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){N.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},X}(),Ut=function(){function X(L,N,V,ne){this.panels=[],this.panelButtons=[],this.markerjsContainer=L,this.displayMode=N,this.uiStyleSettings=V,this.styles=ne,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var L;this.toolboxStyleClass=this.styles.addClass(new pt("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 pt("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new pt("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new pt("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new pt("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 pt("toolbox-panel-row_colors",`
|
|
background-color: `+((L=this.uiStyleSettings.toolboxBackgroundColor)!==null&&L!==void 0?L:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new pt("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
|
|
padding: `+N+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new pt("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new pt("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},X.prototype.show=function(L){var N;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolboxStyleClass.name+" "+((N=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(L){var N,V,ne=this;this.panels=L,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var Fe;J.uiStyleSettings=ne.uiStyleSettings;var Jt=document.createElement("div");Jt.className=ne.toolboxButtonStyleClass.name+" "+((Fe=ne.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Fe!==void 0?Fe:ne.toolboxButtonStyleColorsClass.name),Jt.innerHTML=J.icon,Jt.title=J.title,Jt.addEventListener("click",function(){ne.panelButtonClick(J)}),ne.panelButtons.push(Jt),ne.buttonRow.appendChild(Jt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(L){var N=this,V=-1;if(L!==this.activePanel){V=this.panels.indexOf(L),this.panelRow.innerHTML="";var ne=L.getUi();ne.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ne),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=L}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){N.displayMode==="inline"?N.panelRow.style.display="none":N.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,Fe){var Jt,In;J.className=N.toolboxButtonStyleClass.name+" "+(Fe===V?""+((Jt=N.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Jt!==void 0?Jt:N.toolboxActiveButtonStyleColorsClass.name):""+((In=N.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&In!==void 0?In:N.toolboxButtonStyleColorsClass.name))})},X}(),oe=function(X,L){this.title=X,this.icon=L},Ue=function(X){function L(N,V,ne,J){var Fe=X.call(this,N,J||'<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 Fe.colors=[],Fe.addTransparent=!1,Fe.colorBoxes=[],Fe.colors=V,Fe.currentColor=ne,Fe.setCurrentColor=Fe.setCurrentColor.bind(Fe),Fe.getColorBox=Fe.getColorBox.bind(Fe),Fe}return Ie(L,X),L.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(ne){var J=N.getColorBox(ne);V.appendChild(J),N.colorBoxes.push(J)}),V},L.prototype.getColorBox=function(N){var V=this,ne=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-ne,Fe=document.createElement("div");Fe.style.display="inline-block",Fe.style.boxSizing="content-box",Fe.style.width=J-2+"px",Fe.style.height=J-2+"px",Fe.style.padding="1px",Fe.style.marginRight="2px",Fe.style.marginBottom="2px",Fe.style.borderWidth="2px",Fe.style.borderStyle="solid",Fe.style.borderRadius=(J+2)/2+"px",Fe.style.borderColor=N===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Fe.addEventListener("click",function(){V.setCurrentColor(N,Fe)});var Jt=document.createElement("div");return Jt.style.display="inline-block",Jt.style.width=J-2+"px",Jt.style.height=J-2+"px",Jt.style.backgroundColor=N,Jt.style.borderRadius=J/2+"px",N==="transparent"&&(Jt.style.fill=this.uiStyleSettings.toolboxAccentColor,Jt.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>`),Fe.appendChild(Jt),Fe},L.prototype.setCurrentColor=function(N,V){var ne=this;this.currentColor=N,this.colorBoxes.forEach(function(J){J.style.borderColor=J===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(N)},L}(oe),ze=function(){function X(L,N,V){this._state="new",this._isSelected=!1,this._container=L,this._overlayContainer=N,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(L){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(L,N){},X.prototype.dblClick=function(L,N){},X.prototype.manipulate=function(L){},X.prototype.pointerUp=function(L){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(L){this.container.childNodes.length>0?this.container.insertBefore(L,this.container.childNodes[0]):this.container.appendChild(L)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(L){this._state=L.state,this.notes=L.notes},X.prototype.scale=function(L,N){},X.prototype.colorChanged=function(L){this.onColorChanged&&this.onColorChanged(L),this.stateChanged()},X.prototype.fillColorChanged=function(L){this.onFillColorChanged&&this.onFillColorChanged(L),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var L=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),L.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(L)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),$e=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(L){return this.topLeft.ownsTarget(L)?this.topLeft:this.topCenter.ownsTarget(L)?this.topCenter:this.topRight.ownsTarget(L)?this.topRight:this.centerLeft.ownsTarget(L)?this.centerLeft:this.centerRight.ownsTarget(L)?this.centerRight:this.bottomLeft.ownsTarget(L)?this.bottomLeft:this.bottomCenter.ownsTarget(L)?this.bottomCenter:this.bottomRight.ownsTarget(L)?this.bottomRight:void 0},X}(),Bt=function(){function X(){this.GRIP_SIZE=10,this.visual=pe.createGroup(),this.visual.appendChild(pe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(pe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},X}(),Ht=function(){function X(){}return X.toITransformMatrix=function(L){return{a:L.a,b:L.b,c:L.c,d:L.d,e:L.e,f:L.f}},X.toSVGMatrix=function(L,N){return L.a=N.a,L.b=N.b,L.c=N.c,L.d=N.d,L.e=N.e,L.f=N.f,L},X}(),qt=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(pe.createTransform()),J.setupControlBox(),J}return Ie(L,X),Object.defineProperty(L.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"visual",{get:function(){return this._visual},set:function(N){this._visual=N;var V=pe.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!!(this.controlGrips.findGripByVisual(N)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N))},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.left=N.x,this.top=N.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ne=this.unrotatePoint(N);if(this.manipulationStartX=ne.x,this.manipulationStartY=ne.y,this.offsetX=ne.x-this.left,this.offsetY=ne.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Fe=this.container.transform.baseVal.getItem(0);Fe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Fe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},L.prototype.pointerUp=function(N){var V=this.state;X.prototype.pointerUp.call(this,N),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(N),this._state="select",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},L.prototype.moveVisual=function(N){this.visual.style.transform="translate("+N.x+"px, "+N.y+"px)"},L.prototype.manipulate=function(N){var V=this.unrotatePoint(N);this.state==="creating"?this.resize(N):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(N)},L.prototype.resize=function(N){var V=this.manipulationStartLeft,ne=this.manipulationStartWidth,J=this.manipulationStartTop,Fe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+N.x-this.manipulationStartX,ne=this.manipulationStartWidth+this.manipulationStartLeft-V;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ne=this.manipulationStartWidth+N.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+N.y-this.manipulationStartY,Fe=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Fe=this.manipulationStartHeight+N.y-this.manipulationStartY}ne>=0?(this.left=V,this.width=ne):(this.left=V+ne,this.width=-ne),Fe>=0?(this.top=J,this.height=Fe):(this.top=J+Fe,this.height=-Fe),this.setSize()},L.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},L.prototype.rotate=function(N){if(Math.abs(N.x-this.centerX)>.1){var V=Math.sign(N.x-this.centerX);this.rotationAngle=180*Math.atan((N.y-this.centerY)/(N.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},L.prototype.applyRotation=function(){var N=this.container.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(N,0)},L.prototype.rotatePoint=function(N){if(this.rotationAngle===0)return N;var V=this.container.getCTM(),ne=pe.createPoint(N.x,N.y);return{x:(ne=ne.matrixTransform(V)).x,y:ne.y}},L.prototype.unrotatePoint=function(N){if(this.rotationAngle===0)return N;var V=this.container.getCTM();V=V.inverse();var ne=pe.createPoint(N.x,N.y);return{x:(ne=ne.matrixTransform(V)).x,y:ne.y}},L.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=pe.createGroup();var N=pe.createTransform();N.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(N),this.container.appendChild(this.controlBox),this.controlRect=pe.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=pe.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 $e,this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){var N=this.controlBox.transform.baseVal.getItem(0);N.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(N,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()},L.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()},L.prototype.createGrip=function(){var N=new Bt;return N.visual.transform.baseVal.appendItem(pe.createTransform()),this.controlBox.appendChild(N.visual),N},L.prototype.positionGrips=function(){var N=this.controlGrips.topLeft.GRIP_SIZE,V=-N/2,ne=V,J=(this.width+this.CB_DISTANCE)/2-N/2,Fe=(this.height+this.CB_DISTANCE)/2-N/2,Jt=this.height+this.CB_DISTANCE-N/2,In=this.width+this.CB_DISTANCE-N/2;this.positionGrip(this.controlGrips.topLeft.visual,V,ne),this.positionGrip(this.controlGrips.topCenter.visual,J,ne),this.positionGrip(this.controlGrips.topRight.visual,In,ne),this.positionGrip(this.controlGrips.centerLeft.visual,V,Fe),this.positionGrip(this.controlGrips.centerRight.visual,In,Fe),this.positionGrip(this.controlGrips.bottomLeft.visual,V,Jt),this.positionGrip(this.controlGrips.bottomCenter.visual,J,Jt),this.positionGrip(this.controlGrips.bottomRight.visual,In,Jt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,ne-3*this.CB_DISTANCE)},L.prototype.positionGrip=function(N,V,ne){var J=N.transform.baseVal.getItem(0);J.setTranslate(V,ne),N.transform.baseVal.replaceItem(J,0)},L.prototype.hideControlBox=function(){this.controlBox.style.display="none"},L.prototype.showControlBox=function(){this.controlBox.style.display=""},L.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ht.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ht.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var V=N;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ht.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ht.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},L.prototype.scale=function(N,V){X.prototype.scale.call(this,N,V);var ne=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:ne.x*N,y:ne.y*V});this.left=J.x,this.top=J.y,this.width=this.width*N,this.height=this.height*V,this.adjustControlBox()},L}(ze),tt=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},L.prototype.createVisual=function(){this.visual=pe.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)},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},L.prototype.setSize=function(){X.prototype.setSize.call(this),pe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&pe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},L.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&pe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&pe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&pe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){var V=N;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,V){X.prototype.scale.call(this,N,V),this.setSize()},L.title="Rectangle marker",L}(qt),nn=function(X){function L(N,V,ne,J){var Fe=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Fe.widths=[],Fe.widthBoxes=[],Fe.widths=V,Fe.currentWidth=ne,Fe.setCurrentWidth=Fe.setCurrentWidth.bind(Fe),Fe}return Ie(L,X),L.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ne===N.currentWidth?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentWidth(ne,J)}),V.appendChild(J);var Fe=document.createElement("div");Fe.innerText=ne.toString(),Fe.style.marginRight="5px",J.appendChild(Fe);var Jt=document.createElement("div");Jt.style.minHeight="20px",Jt.style.flexGrow="2",Jt.style.display="flex",Jt.style.alignItems="center";var In=document.createElement("hr");In.style.minWidth="20px",In.style.border="0px",In.style.borderTop=ne+"px solid "+N.uiStyleSettings.toolboxColor,In.style.flexGrow="2",Jt.appendChild(In),J.appendChild(Jt),N.widthBoxes.push(J)}),V},L.prototype.setCurrentWidth=function(N,V){var ne=this;this.currentWidth=N,this.widthBoxes.forEach(function(J){J.style.borderColor=J===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},L}(oe),xn=function(X){function L(N,V,ne,J){var Fe=X.call(this,N,J||'<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 Fe.styles=[],Fe.styleBoxes=[],Fe.styles=V,Fe.currentStyle=ne,Fe.setCurrentStyle=Fe.setCurrentStyle.bind(Fe),Fe}return Ie(L,X),L.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/N.styles.length-5+"%",J.style.borderColor=ne===N.currentStyle?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentStyle(ne,J)}),V.appendChild(J);var Fe=document.createElement("div");Fe.style.minHeight="20px",Fe.style.flexGrow="2",Fe.style.overflow="hidden";var Jt=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+N.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ne!==""?'stroke-dasharray="'+ne+'"':"")+` />
|
|
</svg>`;Fe.innerHTML=Jt,J.appendChild(Fe),N.styleBoxes.push(J)}),V},L.prototype.setCurrentStyle=function(N,V){var ne=this;this.currentStyle=N,this.styleBoxes.forEach(function(J){J.style.borderColor=J===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},L}(oe),Ge=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ue("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new nn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new xn("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Ie(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="FrameMarker",L.title="Frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',L}(tt),He=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},vt=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!(!this.grip1.ownsTarget(N)&&!this.grip2.ownsTarget(N))},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.manipulationStartX=N.x,this.manipulationStartY=N.y,this.state==="new"&&(this.x1=N.x,this.y1=N.y,this.x2=N.x,this.y2=N.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(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},L.prototype.pointerUp=function(N){var V=this.state;X.prototype.pointerUp.call(this,N),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(N),this._state="select",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},L.prototype.adjustVisual=function(){},L.prototype.manipulate=function(N){this.state==="creating"?this.resize(N):this.state==="move"?(this.x1=this.manipulationStartX1+N.x-this.manipulationStartX,this.y1=this.manipulationStartY1+N.y-this.manipulationStartY,this.x2=this.manipulationStartX2+N.x-this.manipulationStartX,this.y2=this.manipulationStartY2+N.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(N)},L.prototype.resize=function(N){switch(this.activeGrip){case this.grip1:this.x1=N.x,this.y1=N.y;break;case this.grip2:case void 0:this.x2=N.x,this.y2=N.y}this.adjustVisual(),this.adjustControlBox()},L.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=pe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){this.positionGrips()},L.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},L.prototype.createGrip=function(){var N=new Bt;return N.visual.transform.baseVal.appendItem(pe.createTransform()),this.controlBox.appendChild(N.visual),N},L.prototype.positionGrips=function(){var N=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-N/2,this.y1-N/2),this.positionGrip(this.grip2.visual,this.x2-N/2,this.y2-N/2)},L.prototype.positionGrip=function(N,V,ne){var J=N.transform.baseVal.getItem(0);J.setTranslate(V,ne),N.transform.baseVal.replaceItem(J,0)},L.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var V=N;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},L.prototype.scale=function(N,V){X.prototype.scale.call(this,N,V),this.x1=this.x1*N,this.y1=this.y1*V,this.x2=this.x2*N,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},L}(ze),Ot=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ue("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new nn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new xn("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorLine&&N!==this.visibleLine)},L.prototype.createVisual=function(){this.visual=pe.createGroup(),this.selectorLine=pe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=pe.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)},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},L.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()),pe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),pe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),pe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var V=N;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},L.typeName="LineMarker",L.title="Line marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',L}(vt),nt=function(X){function L(N,V,ne,J){var Fe=X.call(this,N,J||'<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 Fe.fonts=[],Fe.fontBoxes=[],Fe.fonts=V,Fe.currentFont=ne,Fe.setCurrentFont=Fe.setCurrentFont.bind(Fe),Fe}return Ie(L,X),L.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(ne){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/N.fonts.length-5+"%",J.style.borderColor=ne===N.currentFont?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentFont(ne,J)}),V.appendChild(J);var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.minHeight="20px",Fe.style.flexGrow="2",Fe.style.fontFamily=ne,Fe.style.overflow="hidden";var Jt=document.createElement("div");Jt.style.whiteSpace="nowrap",Jt.style.overflow="hidden",Jt.style.textOverflow="ellipsis",Jt.innerHTML="The quick brown fox jumps over the lazy dog",Fe.appendChild(Jt),J.appendChild(Fe),N.fontBoxes.push(J)}),V},L.prototype.setCurrentFont=function(N,V){var ne=this;this.currentFont=N,this.fontBoxes.forEach(function(J){J.style.borderColor=J===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},L}(oe),xt=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=ne.defaultColor,J.fontFamily=ne.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new Ue("Color",ne.defaultColorSet,ne.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new nt("Font",ne.defaultFontFamilies,ne.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return Ie(L,X),L.prototype.ownsTarget=function(N){if(X.prototype.ownsTarget.call(this,N)||N===this.visual||N===this.textElement||N===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(ne){ne===N&&(V=!0)}),V},L.prototype.createVisual=function(){this.visual=pe.createGroup(),this.bgRectangle=pe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=pe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(pe.createTransform()),this.textElement.transform.baseVal.appendItem(pe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.isMoved=!1,this.pointerDownPoint=N,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.renderText=function(){var N=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(V){N.textElement.appendChild(pe.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},L.prototype.getTextScale=function(){var N=this.textElement.getBBox(),V=1;if(N.width>0&&N.height>0){var ne=(1*this.width-this.width*this.padding*2/100)/N.width,J=(1*this.height-this.height*this.padding*2/100)/N.height;V=Math.min(ne,J)}return V},L.prototype.getTextPosition=function(N){var V=this.textElement.getBBox(),ne=0,J=0;return V.width>0&&V.height>0&&(ne=(this.width-V.width*N)/2,J=this.height/2-V.height*N/2),{x:ne,y:J}},L.prototype.sizeText=function(){var N=this.textElement.getBBox(),V=this.getTextScale(),ne=this.getTextPosition(V);ne.y-=N.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ne.x+"px, "+ne.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ne.x,ne.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(N.x-this.pointerDownPoint.x)>5||Math.abs(N.y-this.pointerDownPoint.y)>5)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.isMoved=!0,this.setSize(),this.sizeText()},L.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(pe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),pe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},L.prototype.pointerUp=function(N){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,N),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},L.prototype.showTextEditor=function(){var N=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(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(N.textEditor.style.fontSize);N.textEditor.clientWidth>=Number.parseInt(N.textEditor.style.maxWidth)&&V>.9;)V-=.1,N.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var ne=V.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(ne)),V.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){N.textEditDivClicked(N.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},L.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var N=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ne=this.textElement.getBBox(),J={x:ne.width*N,y:ne.height*N};V.x-=J.x/2,V.y-=J.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*N,12)+"px",this.textElement.style.display="none"}},L.prototype.textEditDivClicked=function(N){this.text=N.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},L.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},L.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},L.prototype.dblClick=function(N,V){X.prototype.dblClick.call(this,N,V),this.showTextEditor()},L.prototype.setColor=function(N){this.textElement&&pe.setAttributes(this.textElement,[["fill",N]]),this.color=N,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(N)},L.prototype.setFont=function(N){this.textElement&&pe.setAttributes(this.textElement,[["font-family",N]]),this.fontFamily=N,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},L.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},L.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var V=N;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,V){X.prototype.scale.call(this,N,V),this.setSize(),this.sizeText(),this.positionTextEditor()},L.typeName="TextMarker",L.title="Text marker",L.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>',L}(qt),Ae=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=ne.defaultColor,J.lineWidth=ne.defaultStrokeWidth,J.pixelRatio=ne.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new Ue("Color",ne.defaultColorSet,ne.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new nn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.drawingImage)},L.prototype.createVisual=function(){this.visual=pe.createGroup(),this.drawingImage=pe.createImage(),this.visual.appendChild(this.drawingImage);var N=pe.createTransform();this.visual.transform.baseVal.appendItem(N),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,V){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(N.x,N.y),this.drawing=!0):X.prototype.pointerDown.call(this,N,V)},L.prototype.manipulate=function(N){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(N.x,N.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),pe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),pe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(N){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,N)},L.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)},L.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},L.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},L.prototype.finishCreation=function(){for(var N=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ne=V[0],J=V[1],Fe=V[2],Jt=V[3],In=!1,Zn=0;Zn<this.canvasElement.height;Zn++)for(var ln=0;ln<this.canvasElement.width;ln++)N.data[Zn*this.canvasElement.width*4+4*ln+3]>0&&(In=!0,Zn<J&&(J=Zn),ln<ne&&(ne=ln),Zn>Jt&&(Jt=Zn),ln>Fe&&(Fe=ln));if(In){this.left=ne/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(Fe-ne)/this.pixelRatio,this.height=(Jt-J)/this.pixelRatio;var ir=document.createElement("canvas");ir.width=Fe-ne,ir.height=Jt-J,ir.getContext("2d").putImageData(this.canvasContext.getImageData(ne,J,Fe-ne,Jt-J),0,0),this.drawingImgUrl=ir.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},L.prototype.setDrawingImage=function(){pe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),pe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},L.prototype.setColor=function(N){this.color=N,this.colorChanged(N)},L.prototype.setLineWidth=function(N){this.lineWidth=N},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){this.createVisual(),X.prototype.restoreState.call(this,N),this.drawingImgUrl=N.drawingImgUrl,this.setDrawingImage()},L.prototype.scale=function(N,V){X.prototype.scale.call(this,N,V),this.setDrawingImage()},L.typeName="FreehandMarker",L.title="Freehand marker",L.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>',L}(qt),ve=function(X){function L(N,V,ne){var J=X.call(this,N,ne||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return J.typeBoxes=[],J.currentType=V,J.setCurrentType=J.setCurrentType.bind(J),J}return Ie(L,X),L.prototype.getUi=function(){var N=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var ne=function(Jt){var In="both";switch(Jt){case 0:In="both";break;case 1:In="start";break;case 2:In="end";break;case 3:In="none"}var Zn=document.createElement("div");if(Zn.style.display="flex",Zn.style.flexGrow="2",Zn.style.alignItems="center",Zn.style.justifyContent="space-between",Zn.style.padding="5px",Zn.style.borderWidth="2px",Zn.style.borderStyle="solid",Zn.style.borderColor=In===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Zn.addEventListener("click",function(){N.setCurrentType(In,Zn)}),V.appendChild(Zn),In==="both"||In==="start"){var ln=document.createElement("div");ln.style.display="flex",ln.style.alignItems="center",ln.style.minHeight="20px",ln.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ln.style.marginLeft="5px",Zn.appendChild(ln)}var ir=document.createElement("div");ir.style.display="flex",ir.style.alignItems="center",ir.style.minHeight="20px",ir.style.flexGrow="2";var tr=document.createElement("hr");if(tr.style.minWidth="20px",tr.style.border="0px",tr.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),tr.style.flexGrow="2",ir.appendChild(tr),Zn.appendChild(ir),In==="both"||In==="end"){var Mr=document.createElement("div");Mr.style.display="flex",Mr.style.alignItems="center",Mr.style.minHeight="20px",Mr.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="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Mr.style.marginRight="5px",Zn.appendChild(Mr)}J.typeBoxes.push(Zn)},J=this,Fe=0;Fe<4;Fe++)ne(Fe);return V},L.prototype.setCurrentType=function(N,V){var ne=this;this.currentType=N,this.typeBoxes.forEach(function(J){J.style.borderColor=J===V?ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},L}(oe),we=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ve("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.arrow1&&N!==this.arrow2)},L.prototype.getArrowPoints=function(N,V){var ne=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return N-ne/2+","+(V+J/2)+" "+N+","+(V-J/2)+" "+(N+ne/2)+","+(V+J/2)},L.prototype.createTips=function(){this.arrow1=pe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(pe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=pe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(pe.createTransform()),this.visual.appendChild(this.arrow2)},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",pe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),pe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(N,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var ne=this.arrow2.transform.baseVal.getItem(0);ne.setRotate(N+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ne,0)}},L.prototype.setArrowType=function(N){this.arrowType=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var V=N;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},L.typeName="ArrowMarker",L.title="Arrow marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',L}(Ot),ie=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.fillColor=ne.defaultFillColor,J.strokeWidth=0,J.fillPanel=new Ue("Color",ne.defaultColorSet,ne.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return Ie(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="CoverMarker",L.title="Cover marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',L}(tt),ae=function(X){function L(N,V,ne,J){var Fe=X.call(this,N,J||'<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 Fe.opacities=[],Fe.opacityBoxes=[],Fe.opacities=V,Fe.currentOpacity=ne,Fe.setCurrentOpacity=Fe.setCurrentOpacity.bind(Fe),Fe}return Ie(L,X),L.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ne===N.currentOpacity?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentOpacity(ne,J)}),V.appendChild(J);var Fe=document.createElement("div");Fe.innerText=100*ne+"%",J.appendChild(Fe),N.opacityBoxes.push(J)}),V},L.prototype.setCurrentOpacity=function(N,V){var ne=this;this.currentOpacity=N,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===V?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},L}(oe),me=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=ne.defaultHighlightColor,J.strokeWidth=0,J.opacity=ne.defaultHighlightOpacity,J.fillPanel=new Ue("Color",ne.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new ae("Opacity",ne.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Ie(L,X),L.prototype.setOpacity=function(N){this.opacity=N,this.visual&&pe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="HighlightMarker",L.title="Highlight marker",L.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>',L}(ie),be='<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>',ye=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=ne.defaultStrokeColor,J.bgColor=ne.defaultFillColor,J.fontFamily=ne.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new Ue("Text color",ne.defaultColorSet,J.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>'),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new Ue("Fill color",ne.defaultColorSet,J.bgColor,be),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new nt("Font",ne.defaultFontFamilies,ne.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new Bt,J.tipGrip.visual.transform.baseVal.appendItem(pe.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return Ie(L,X),L.prototype.ownsTarget=function(N){return X.prototype.ownsTarget.call(this,N)||this.tipGrip.ownsTarget(N)||this.tip===N},L.prototype.createTip=function(){pe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=pe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},L.prototype.pointerDown=function(N,V){this.state==="new"&&X.prototype.pointerDown.call(this,N,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,N,V)},L.prototype.pointerUp=function(N){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,N);else{var V=this.state==="creating";X.prototype.pointerUp.call(this,N),this.setTipPoints(V),this.positionTip()}},L.prototype.manipulate=function(N){if(this.tipMoving){var V=this.unrotatePoint(N);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,N)},L.prototype.setBgColor=function(N){this.bgRectangle&&this.tip&&(pe.setAttributes(this.bgRectangle,[["fill",N]]),pe.setAttributes(this.tip,[["fill",N]])),this.bgColor=N,this.fillColorChanged(N)},L.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},L.prototype.setTipPoints=function(N){N===void 0&&(N=!1);var V=Math.min(this.height/2,15),ne=this.height/5;N&&(this.tipPosition={x:V+ne/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:0},this.tipBase2Position={x:V+ne,y:0}):(this.tipBase1Position={x:0,y:V},this.tipBase2Position={x:0,y:V+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-ne,y:0},this.tipBase2Position={x:this.width-V,y:0}):(this.tipBase1Position={x:this.width,y:V},this.tipBase2Position={x:this.width,y:V+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-ne,y:this.height},this.tipBase2Position={x:this.width-V,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-V-ne},this.tipBase2Position={x:this.width,y:this.height-V}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:this.height},this.tipBase2Position={x:V+ne,y:this.height}):(this.tipBase1Position={x:0,y:this.height-V},this.tipBase2Position={x:0,y:this.height-V-ne})},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.positionTip()},L.prototype.positionTip=function(){pe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var N=this.tipGrip.visual.transform.baseVal.getItem(0);N.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(N,0)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},L.prototype.getState=function(){var N=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var V=N;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,X.prototype.restoreState.call(this,N),this.createTip(),this.setTipPoints()},L.prototype.scale=function(N,V){X.prototype.scale.call(this,N,V),this.tipPosition={x:this.tipPosition.x*N,y:this.tipPosition.y*V},this.positionTip()},L.typeName="CalloutMarker",L.title="Callout marker",L.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>',L}(xt),Be=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.fillColor=ne.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new Ue("Line color",_e(ne.defaultColorSet,["transparent"]),ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new Ue("Fill color",_e(ne.defaultColorSet,["transparent"]),J.fillColor,be),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new nn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new xn("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new ae("Opacity",ne.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},L.prototype.createVisual=function(){this.visual=pe.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)},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},L.prototype.setSize=function(){X.prototype.setSize.call(this),pe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},L.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&pe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},L.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&pe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(N),this.stateChanged()},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&pe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&pe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.setOpacity=function(N){this.opacity=N,this.visual&&pe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var V=N;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,V){X.prototype.scale.call(this,N,V),this.setSize()},L.typeName="EllipseMarker",L.title="Ellipse marker",L.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>',L}(qt),St=function(X){function L(N,V,ne){return X.call(this,N,V,ne)||this}return Ie(L,X),Object.defineProperty(L.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.tip1&&N!==this.tip2)},L.prototype.createTips=function(){this.tip1=pe.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(pe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=pe.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(pe.createTransform()),this.visual.appendChild(this.tip2)},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(pe.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()]]),pe.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 N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(N,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var ne=this.tip2.transform.baseVal.getItem(0);ne.setRotate(N+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ne,0)}},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N),this.createTips(),this.adjustVisual()},L.typeName="MeasurementMarker",L.title="Measurement marker",L.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>',L}(Ot),an=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.strokePanel.colors=ne.defaultColorSet,J.fillColor="transparent",J}return Ie(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="EllipseFrameMarker",L.title="Ellipse frame marker",L.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>',L}(Be),Dn=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(L){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(L)||(this.undoStack.push(L),JSON.stringify(this.lastRedoStep)!==JSON.stringify(L)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(L){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=L)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var L=this.undoStack.pop();return L!==void 0&&this.redoStack.push(L),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),yt=function(X){function L(N,V,ne){var J=X.call(this,N,V,ne)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ue("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new nn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new xn("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorCurve&&N!==this.visibleCurve&&!this.curveGrip.ownsTarget(N))},L.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},L.prototype.createVisual=function(){this.visual=pe.createGroup(),this.selectorCurve=pe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=pe.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)},L.prototype.pointerDown=function(N,V){X.prototype.pointerDown.call(this,N,V),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=N.x,this.curveY=N.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},L.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),pe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),pe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),pe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=pe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=pe.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)},L.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},L.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var N=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-N/2,this.curveY-N/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()))},L.prototype.manipulate=function(N){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+N.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+N.y-this.manipulationStartY),X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){this.activeGrip===this.curveGrip&&(this.curveX=N.x,this.curveY=N.y),X.prototype.resize.call(this,N),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual()},L.prototype.scale=function(N,V){this.curveX=this.curveX*N,this.curveY=this.curveY*V,X.prototype.scale.call(this,N,V)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var V=N;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},L.typeName="CurveMarker",L.title="Curve marker",L.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>',L}(vt),en=function(){function X(L,N){N===void 0&&(N=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=L,this.cancelable=N}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),_t=function(X){function L(N,V,ne){var J=X.call(this,N,!1)||this;return J.dataUrl=V,J.state=ne,J}return Ie(L,X),L}(en),Et=function(X){function L(N,V,ne){ne===void 0&&(ne=!1);var J=X.call(this,N,ne)||this;return J.marker=V,J}return Ie(L,X),L}(en),st=function(){function X(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return X.prototype.addEventListener=function(L,N){this[L].push(N)},X.prototype.removeEventListener=function(L,N){var V=this[L].indexOf(N);V>-1&&this[L].splice(V,1)},X}(),he=function(){function X(L){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new He,this._isOpen=!1,this.undoRedoManager=new Dn,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 st,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new Tt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=L,this.targetRoot=document.body,this.width=L.clientWidth,this.height=L.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ge,Ae,we,xt,an,Be,me,ye,St,ie,Ot,yt]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ge,Ae,we,xt,Be,me,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ge,Ae,we,xt,me]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(L){var N=this;this._availableMarkerTypes.splice(0),L.forEach(function(V){if(typeof V=="string"){var ne=N.ALL_MARKER_TYPES.find(function(J){return J.typeName===V});ne!==void 0&&N._availableMarkerTypes.push(ne)}else N._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(L){this._zoomLevel=L,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),at.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var L=this;this.styles.styleSheetRoot===void 0&&Ft.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ft.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(N){return N(new en(L))})},X.prototype.render=function(){return Qe(this,void 0,void 0,function(){var L;return Xe(this,function(N){switch(N.label){case 0:return this.setCurrentMarker(),(L=new Qt).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.markersOnly=this.renderMarkersOnly,L.width=this.renderWidth,L.height=this.renderHeight,[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return N.sent(),[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,N.sent()]}})})},X.prototype.close=function(L){var N=this;if(L===void 0&&(L=!1),this.isOpen){var V=!1;L||this.eventListeners.beforeclose.forEach(function(ne){var J=new en(N,!0);ne(J),J.defaultPrevented&&(V=!0)}),V||(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(ne){return ne(new en(N))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var L,N=[],V=0;V<arguments.length;V++)N[V]=arguments[V];(L=this._availableMarkerTypes).push.apply(L,N)},X.prototype.addRenderEventListener=function(L){this.addEventListener("render",function(N){L(N.dataUrl,N.state)})},X.prototype.removeRenderEventListener=function(L){},X.prototype.addCloseEventListener=function(L){this.addEventListener("close",function(){L()})},X.prototype.removeCloseEventListener=function(L){},X.prototype.setupResizeObserver=function(){var L=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return L.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var L=1*this.target.clientWidth/this.target.clientHeight,N=this.editorCanvas.clientWidth/L>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*L:this.editorCanvas.clientWidth,V=N<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/L;this.resize(N,V)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(L,N){this._isResizing=!0;var V=L/this.imageWidth,ne=N/this.imageHeight;this.imageWidth=Math.round(L),this.imageHeight=Math.round(N),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(V,ne),this._isResizing=!1},X.prototype.scaleMarkers=function(L,N){var V,ne=this;this._currentMarker&&this._currentMarker instanceof xt?this._currentMarker.scale(L,N):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==ne._currentMarker&&J.scale(L,N)}),V!==void 0&&this.setCurrentMarker(V)},X.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},X.prototype.setTopLeft=function(){var L=this.editingTarget.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=L.left-N.left,this.top=L.top-N.top},X.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},X.prototype.addDefs=function(){for(var L,N=[],V=0;V<arguments.length;V++)N[V]=arguments[V];this.defs=pe.createDefs(),this.addDefsToImage(),(L=this.defs).append.apply(L,N)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},X.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var L=document.createElement("a");L.href="https://markerjs.com/",L.target="_blank",L.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>',L.title="Powered by marker.js",L.style.display="grid",L.style.alignItems="center",L.style.justifyItems="center",L.style.padding="3px",L.style.width="20px",L.style.height="20px",this.logoUI.appendChild(L),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"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 ut(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 Ut(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(L){this.markerImage.removeChild(L.container),this.markers.indexOf(L)>-1&&this.markers.splice(this.markers.indexOf(L),1),L.dispose()},X.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},X.prototype.toolbarButtonClicked=function(L,N){if(L==="marker"&&N!==void 0)this.createNewMarker(N);else if(L==="action")switch(N){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var L=this;if(this._currentMarker!==void 0){var N=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ne){var J=new Et(L,L._currentMarker,!0);ne(J),J.defaultPrevented&&(N=!0)}),!N){var V=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(ne){return ne(new Et(L,V))})}}},X.prototype.clear=function(){var L=this,N=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Fe){var Jt=new Et(L,void 0,!0);Fe(Jt),Jt.defaultPrevented&&(N=!0)}),!N)){this.setCurrentMarker();for(var V=function(Fe){var Jt=ne.markers[Fe];ne.setCurrentMarker(ne.markers[Fe]),ne._currentMarker.dispose(),ne.markerImage.removeChild(ne._currentMarker.container),ne.markers.splice(ne.markers.indexOf(ne._currentMarker),1),ne.eventListeners.markerdelete.forEach(function(In){return In(new Et(L,Jt))})},ne=this,J=this.markers.length-1;J>=0;J--)V(J);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var L;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=(L=this._currentMarker.notes)!==null&&L!==void 0?L:"",this.overlayContainer.appendChild(this.notesArea))},X.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var L=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var N=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===N.width&&V.height===N.height){var ne=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(N),ne<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new en(L))})}else this.undoRedoManager.replaceLastUndoStep(N),this.eventListeners.statechange.forEach(function(J){return J(new en(L))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var L=this,N=this.undoRedoManager.undo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new en(L))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var L=this,N=this.undoRedoManager.redo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new en(L))}))},X.prototype.stepZoom=function(){var L=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=L<this.zoomSteps.length-1?this.zoomSteps[L+1]:this.zoomSteps[0]},X.prototype.panTo=function(L){this.contentDiv.scrollBy({left:this.prevPanPoint.x-L.x,top:this.prevPanPoint.y-L.y}),this.prevPanPoint=L},X.prototype.startRenderAndClose=function(){return Qe(this,void 0,void 0,function(){var L,N,V=this;return Xe(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return L=ne.sent(),N=this.getState(),this.eventListeners.render.forEach(function(J){return J(new _t(V,L,N))}),this.close(!0),[2]}})})},X.prototype.getState=function(L){L===!0&&this.setCurrentMarker();var N={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return N.markers.push(V.getState())}),N},X.prototype.restoreState=function(L){var N=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);L.markers.forEach(function(V){var ne=N._availableMarkerTypes.find(function(Fe){return Fe.typeName===V.typeName});if(ne!==void 0){var J=N.addNewMarker(ne);J.restoreState(V),N.markers.push(J)}}),L.width&&L.height&&(L.width!==this.imageWidth||L.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/L.width,this.imageHeight/L.height),this.eventListeners.restorestate.forEach(function(V){return V(new en(N))})},X.prototype.addNewMarker=function(L){var N=pe.createGroup();return this.markerImage.appendChild(N),new L(N,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(L){var N,V=this;(N=typeof L=="string"?this._availableMarkerTypes.find(function(ne){return ne.typeName===L}):L)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(N),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(N.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ne){return ne(new Et(V,V._currentMarker))}))},X.prototype.markerCreated=function(L){var N=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(L),this.setCurrentMarker(L),L instanceof Ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new Et(N,N._currentMarker))})},X.prototype.colorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=L,this.settings.defaultStrokeColor=L)},X.prototype.fillColorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=L)},X.prototype.markerStateChanged=function(L){var N=this;this.eventListeners.markerchange.forEach(function(V){return V(new Et(N,L))})},X.prototype.setCurrentMarker=function(L){var N=this;this._currentMarker!==L&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(V){return V(new Et(N,N._currentMarker))})),this._currentMarker=L,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(V){return V(new Et(N,N._currentMarker))}))},X.prototype.onPointerDown=function(L){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||L.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var N=this.markers.find(function(V){return V.ownsTarget(L.target)});N!==void 0?(this.setCurrentMarker(N),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:L.clientX,y:L.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY))},X.prototype.onDblClick=function(L){if(this._isFocused||this.focus(),this.mode==="select"){var N=this.markers.find(function(V){return V.ownsTarget(L.target)});N!==void 0&&N!==this._currentMarker&&this.setCurrentMarker(N),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(L){this.touchPoints!==1&&L.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||L.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(L.clientX,L.clientY)):this.zoomLevel>1&&this.panTo({x:L.clientX,y:L.clientY}))},X.prototype.onPointerUp=function(L){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(L.clientX,L.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(L){this._currentMarker===void 0||this.notesArea!==void 0||L.key!=="Delete"&&L.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(L,N){var V=this.markerImage.getBoundingClientRect();return{x:(L-V.left)/this.zoomLevel,y:(N-V.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(L){at.addKey(L)},X.prototype.addEventListener=function(L,N){this.eventListeners.addEventListener(L,N)},X.prototype.removeEventListener=function(L,N){this.eventListeners.removeEventListener(L,N)},X.prototype.renderState=function(L){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(L),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var L=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(N){return N(new en(L))}))},X.prototype.blur=function(){var L=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(N){return N(new en(L))}))},X.instanceCounter=0,X}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Le=function(X,L){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,V){N.__proto__=V}||function(N,V){for(var ne in V)Object.prototype.hasOwnProperty.call(V,ne)&&(N[ne]=V[ne])})(X,L)};function Lt(X,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function N(){this.constructor=X}Le(X,L),X.prototype=L===null?Object.create(L):(N.prototype=L.prototype,new N)}function ct(X,L,N,V){return new(N||(N=Promise))(function(ne,J){function Fe(Zn){try{In(V.next(Zn))}catch(ln){J(ln)}}function Jt(Zn){try{In(V.throw(Zn))}catch(ln){J(ln)}}function In(Zn){var ln;Zn.done?ne(Zn.value):(ln=Zn.value,ln instanceof N?ln:new N(function(ir){ir(ln)})).then(Fe,Jt)}In((V=V.apply(X,L||[])).next())})}function tn(X,L){var N,V,ne,J,Fe={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return J={next:Jt(0),throw:Jt(1),return:Jt(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function Jt(In){return function(Zn){return function(ln){if(N)throw new TypeError("Generator is already executing.");for(;Fe;)try{if(N=1,V&&(ne=2&ln[0]?V.return:ln[0]?V.throw||((ne=V.return)&&ne.call(V),0):V.next)&&!(ne=ne.call(V,ln[1])).done)return ne;switch(V=0,ne&&(ln=[2&ln[0],ne.value]),ln[0]){case 0:case 1:ne=ln;break;case 4:return Fe.label++,{value:ln[1],done:!1};case 5:Fe.label++,V=ln[1],ln=[0];continue;case 7:ln=Fe.ops.pop(),Fe.trys.pop();continue;default:if(!(ne=Fe.trys,(ne=ne.length>0&&ne[ne.length-1])||ln[0]!==6&&ln[0]!==2)){Fe=0;continue}if(ln[0]===3&&(!ne||ln[1]>ne[0]&&ln[1]<ne[3])){Fe.label=ln[1];break}if(ln[0]===6&&Fe.label<ne[1]){Fe.label=ne[1],ne=ln;break}if(ne&&Fe.label<ne[2]){Fe.label=ne[2],Fe.ops.push(ln);break}ne[2]&&Fe.ops.pop(),Fe.trys.pop();continue}ln=L.call(X,Fe)}catch(ir){ln=[6,ir],V=0}finally{N=ne=0}if(5&ln[0])throw ln[1];return{value:ln[0]?ln[1]:void 0,done:!0}}([In,Zn])}}}var un=function(){function X(){}return X.addKey=function(L){X.key=L},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Pe=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(L,N){for(var V=0,ne=N;V<ne.length;V++){var J=ne[V],Fe=J[0],Jt=J[1];L.setAttribute(Fe,Jt)}},X.createRect=function(L,N,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",N.toString()),V&&X.setAttributes(ne,V),ne},X.createLine=function(L,N,V,ne,J){var Fe=document.createElementNS("http://www.w3.org/2000/svg","line");return Fe.setAttribute("x1",L.toString()),Fe.setAttribute("y1",N.toString()),Fe.setAttribute("x2",V.toString()),Fe.setAttribute("y2",ne.toString()),J&&X.setAttributes(Fe,J),Fe},X.createPolygon=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",L),N&&X.setAttributes(V,N),V},X.createCircle=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(L/2).toString()),V.setAttribute("cy",(L/2).toString()),V.setAttribute("r",L.toString()),N&&X.setAttributes(V,N),V},X.createEllipse=function(L,N,V){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(N/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(N/2).toString()),V&&X.setAttributes(ne,V),ne},X.createGroup=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&X.setAttributes(N,L),N},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(L,N,V,ne,J,Fe,Jt){var In=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(In,[["id",L],["orient",N],["markerWidth",V.toString()],["markerHeight",ne.toString()],["refX",J.toString()],["refY",Fe.toString()]]),In.appendChild(Jt),In},X.createText=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),L&&X.setAttributes(N,L),N},X.createTSpan=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=L,N&&X.setAttributes(V,N),V},X.createImage=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&X.setAttributes(N,L),N},X.createPoint=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=L,V.y=N,V},X.createPath=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",L),N&&X.setAttributes(V,N),V},X.createElement=function(L,N){var V=document.createElementNS("http://www.w3.org/2000/svg",L);return N&&X.setAttributes(V,N),V},X.getHollowRectanglePath=function(L,N,V,ne,J,Fe,Jt,In){return"M"+L+","+N+"V"+(N+ne)+"H"+(L+V)+"V"+N+"H"+J+"V"+Fe+"H"+(J+Jt)+"V"+(Fe+In)+"H"+J+"V"+N+"Z"},X}(),et=function(){function X(L){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},X.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new jt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new jt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new jt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new bn("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new bn("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),jt=function(X,L){this.selector=X,this.style=L},bn=function(X,L){this.localName=X,this.style=L},Kt=function(){function X(){this.blocks=[],this.display=""}return X.prototype.addButtonBlock=function(L){L.className=this.blockClassName,L.buttonClassName=this.buttonClassName,L.buttonColorsClassName=this.buttonColorsClassName,L.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(L)},X.prototype.addElementBlock=function(L){L.className===void 0&&(L.className=this.blockClassName),this.blocks.push(L)},X.prototype.getUI=function(){var L=document.createElement("div");return L.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,L.style.display=this.display,this.blocks.forEach(function(N){return L.appendChild(N.getUI())}),L},X}(),Xt=function(){function X(){}return X.prototype.getUI=function(){var L=document.createElement("div");if(L.className=this.className,this.minWidth!==void 0&&(L.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":L.style.justifyContent="flex-start";break;case"center":L.style.justifyContent="center";break;case"end":L.style.justifyContent="flex-end"}return L.style.whiteSpace="nowrap",L},X}(),Yn=function(X){function L(){var N=X!==null&&X.apply(this,arguments)||this;return N.buttons=[],N}return Lt(L,X),L.prototype.addButton=function(N){N.className=this.buttonClassName,N.colorsClassName=this.buttonColorsClassName,N.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(N)},L.prototype.getUI=function(){var N=X.prototype.getUI.call(this);return this.buttons.forEach(function(V){return N.appendChild(V.getUI())}),N},L}(Xt),Bn=function(){function X(L,N){this._isActive=!1,this._isHidden=!1,this._icon=L,this.title=N,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(X.prototype,"icon",{get:function(){return this._icon},set:function(L){this._icon=L,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isActive",{get:function(){return this._isActive},set:function(L){this._isActive=L,this.adjustClassName()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){var L=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 L.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},X.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},X.prototype.hide=function(){this._isHidden=!0},X}(),_n=function(X){function L(){var N=X!==null&&X.apply(this,arguments)||this;return N.elements=[],N}return Lt(L,X),L.prototype.addElement=function(N){this.elements.push(N)},L.prototype.getUI=function(){var N=X.prototype.getUI.call(this);return this.elements.forEach(function(V){return N.appendChild(V)}),N},L}(Xt),br=function(){function X(L,N){this.horizontal=L,this.vertical=N}return Object.defineProperty(X.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),X.prototype.getVerticalLength=function(L){return L/this.ratio},X.prototype.getHorizontalLength=function(L){return L*this.ratio},X}(),Fr=function(){function X(){}return X.getIcon=function(L,N){if(L>0&&N>0){var V=new br(L,N),ne=V.ratio>=1?20:V.getHorizontalLength(20),J=V.ratio<1?20:V.getVerticalLength(20),Fe=document.createElementNS("http://www.w3.org/2000/svg","svg");Fe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Fe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Fe);var Jt=Pe.createDefs();Fe.appendChild(Jt);var In=Pe.createElement("clipPath",[["id","text-bg-clip"]]);Jt.appendChild(In);var Zn=Pe.createPath(Pe.getHollowRectanglePath((24-ne)/2,(24-J)/2,ne,J,(24-ne)/2+2,(24-J)/2+2,ne-4,J-4));Fe.appendChild(Zn);var ln=Pe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ln.appendChild(Pe.createTSpan(L+":"+N)),Fe.appendChild(ln);var ir=ln.getBBox();Pe.setAttributes(ln,[["x",((24-ir.width)/2).toString()],["y",((24-ir.height)/2-ir.y).toString()]]);var tr=Pe.createPath(Pe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ir.width))/2,(24-Math.ceil(ir.height))/2,Math.ceil(ir.width),Math.ceil(ir.height)));return In.appendChild(tr),Pe.setAttributes(Zn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Fe),Fe.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},X}(),hr=function(X){function L(N,V,ne){var J=X.call(this,N,V)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=ne,J}return Lt(L,X),L.prototype.setupDropdown=function(){var N=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(V){V.className=N.className,V.colorsClassName=N.colorsClassName,N.dropdownBlock.appendChild(V.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},L.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},L.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},L.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},L.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},L.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},L}(Bn),Qn=function(){function X(L,N){this.GRIP_SIZE=10,this.color=L,this.fillColor=N,this.visual=Pe.createGroup(),this.visual.appendChild(Pe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Pe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},X.prototype.setCenter=function(L,N){this.visual.childNodes.forEach(function(V){return Pe.setAttributes(V,[["cx",L.toString()],["cy",N.toString()]])})},X}(),Dr=function(){function X(L,N,V,ne){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=L,this.canvasHeight=N,this.margin=V,this.container=ne,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(L){this._aspectRatio=L,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.gridContainer&&Pe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(L){this._zoomFactor=L,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var L=this;this.cropShadeElement=Pe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Pe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var N=0;N<this.numberOfGridLines;N++)this.horizontalGridLines.push(Pe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Pe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(V){return L.gridContainer.appendChild(V)}),this.verticalGridLines.forEach(function(V){return L.gridContainer.appendChild(V)}),this.cropRectElement=Pe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Qn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Qn(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Qn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Qn(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(L){this.cropRect=L;var N=Object.assign({},this.cropRect);this.zoomFactor!==1&&(N.width=this.cropRect.width*this.zoomFactor,N.height=this.cropRect.height*this.zoomFactor,N.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-N.width/2,N.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-N.height/2),Pe.setAttributes(this.cropRectElement,[["x",N.x.toString()],["y",N.y.toString()],["width",N.width.toString()],["height",N.height.toString()]]);var V=N.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,Fe){var Jt=N.y+V*(Fe+1);Pe.setAttributes(J,[["x1",""+N.x],["y1",""+Jt],["x2",""+(N.x+N.width)],["y2",""+Jt]])});var ne=N.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,Fe){var Jt=N.x+ne*(Fe+1);Pe.setAttributes(J,[["x1",""+Jt],["y1",""+N.y],["x2",""+Jt],["y2",""+(N.y+N.height)]])}),Pe.setAttributes(this.cropShadeElement,[["d",Pe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,N.x,N.y,N.width,N.height)]]),this.topLeftGrip.setCenter(N.x,N.y),this.topRightGrip.setCenter(N.x+N.width,N.y),this.bottomLeftGrip.setCenter(N.x,N.y+N.height),this.bottomRightGrip.setCenter(N.x+N.width,N.y+N.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},X.prototype.clientToLocalCoordinates=function(L,N){var V=this.container.getBoundingClientRect();return{x:L-V.left+this.margin,y:N-V.top+this.margin}},X.prototype.onPointerDown=function(L){this.container.setPointerCapture(L.pointerId),this.previousPoint=this.clientToLocalCoordinates(L.clientX,L.clientY),this.cropRectElement===L.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(L.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(L.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(L.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(L.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(L){if(this.isMoving)this.move(this.clientToLocalCoordinates(L.clientX,L.clientY));else if(this.activeGrip){var N=this.clientToLocalCoordinates(L.clientX,L.clientY);this.resize(N)}L.preventDefault()},X.prototype.onPointerUp=function(L){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(L.pointerId)},X.prototype.move=function(L){var N=L.x-this.previousPoint.x,V=L.y-this.previousPoint.y;this.zoomFactor!==1&&(N=-N/this.zoomFactor,V=-V/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+N),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=L},X.prototype.resize=function(L){var N=Object.assign({},this.cropRect),V=L.x-this.previousPoint.x,ne=L.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:N.x+V<this.margin&&(V=this.margin-N.x),N.x+=V,N.width=this.cropRect.x+this.cropRect.width-N.x;break;case this.bottomRightGrip:case this.topRightGrip:N.width+V>this.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-N.width),N.width+=V}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(N.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(V),N.height=this.aspectRatio.getVerticalLength(N.width)):(N.y+=ne,N.height=this.cropRect.y+this.cropRect.height-N.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?N.height=this.aspectRatio.getVerticalLength(N.width):N.height+=ne}N.width<10&&(N.x=this.cropRect.x,N.width=10),N.height<10&&(N.y=this.cropRect.y,N.height=10),this.previousPoint=L,N.x>=this.margin&&N.y>=this.margin&&N.x-this.margin+N.width<=this.canvasWidth&&N.y-this.margin+N.height<=this.canvasHeight&&(this.cropRect=N,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var L=this.cropRect.x+this.cropRect.width/2,N=this.cropRect.y+this.cropRect.height/2,V=this.aspectRatio.getHorizontalLength(this.cropRect.height),ne=this.aspectRatio.getVerticalLength(this.cropRect.width);V/this.canvasWidth<ne/this.canvasHeight?this.cropRect.width=V:this.cropRect.height=ne,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=L-this.cropRect.width/2,this.cropRect.y=N-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},X.prototype.getRescaledRect=function(L,N,V,ne,J,Fe){var Jt=V/L,In=ne/N;return{x:(J.x-Fe)*Jt+Fe,y:(J.y-Fe)*In+Fe,width:J.width*Jt,height:J.height*In}},X.prototype.scaleCanvas=function(L,N){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,L,N,this.cropRect,this.margin);this.canvasWidth=L,this.canvasHeight=N,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},X}(),Kr=function(){function X(L){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=L,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(X.prototype,"angle",{get:function(){return this._angle},set:function(L){this._angle=L,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},X.prototype.onPointerDown=function(L){this.controlContainer.setPointerCapture(L.pointerId),this.isDragging=!0,this.previousPoint={x:L.clientX,y:L.clientY}},X.prototype.onPointerMove=function(L){this.isDragging&&(this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.previousPoint.x=L.clientX)},X.prototype.onPointerUp=function(L){this.isDragging&&this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(L.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var L=this.angleLabelText.getBBox();Pe.setAttributes(this.angleLabelElement,[["x",((this.width-L.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var L=this.scaleShape.transform.baseVal.getItem(0);L.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(L,0)}},X.prototype.getVisual=function(){var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("width",this.width+"px"),L.setAttribute("height",this.height+"px"),L.setAttribute("viewBox","0 0 "+this.width+" "+this.height),L.style.flexShrink="0",document.body.appendChild(L);for(var N="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,V=1;V<=this.width/5+10;V++){var ne=V%5==0?this.height/3:this.height/6;N+="h4v"+-ne+"h1v"+ne}N+="v1H0Z",this.scaleShape=Pe.createPath(N);var J=Pe.createTransform();this.scaleShape.transform.baseVal.appendItem(J),L.appendChild(this.scaleShape),this.angleLabelElement=Pe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Pe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Fe=Pe.createTSpan("");return Fe.innerHTML="°",this.angleLabelElement.appendChild(Fe),L.appendChild(this.angleLabelElement),document.body.removeChild(L),L},X}(),ti=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(L,N,V,ne,J,Fe,Jt){var In=this;return new Promise(function(Zn){var ln=document.createElement("canvas");ln.width=L.width.baseVal.value-2*ne,ln.height=L.height.baseVal.value-2*ne;var ir=1,tr=1;In.naturalSize===!0?(ir=N.naturalWidth/(L.width.baseVal.value-2*ne)/Fe,tr=N.naturalHeight/(L.height.baseVal.value-2*ne)/Jt,ln.width=N.naturalWidth/Fe,ln.height=N.naturalHeight/Jt):In.width!==void 0&&In.height!==void 0&&(ir=In.width/V.width,tr=In.height/V.height,ln.width*=ir,ln.height*=tr);var Mr=ln.getContext("2d");Mr.translate(ln.width/2,ln.height/2),Mr.rotate(J*Math.PI/180),Mr.scale(Fe,Jt),Mr.translate(-ln.width/2,-ln.height/2),Mr.drawImage(N,0,0,ln.width,ln.height);var ui=document.createElement("canvas");ui.width=V.width*ir,ui.height=V.height*tr,ui.getContext("2d").putImageData(Mr.getImageData((V.x-ne)*ir,(V.y-ne)*tr,V.width*ir,V.height*tr),0,0),Zn(ui.toDataURL(In.imageType,In.imageQuality))})},X}(),dn=function(){function X(L){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=X.instanceCounter++,this.styles=new et(this.instanceNo),this.target=L,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(L){this._zoomToCropEnabled=L,L?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(L){this._gridLines=L,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(L){this._rotationAngle=L,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var L;return(L=this._aspectRatio)!==null&&L!==void 0?L:this.aspectRatios[0]},set:function(L){this._aspectRatio=L},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(L){L===void 0&&(L=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),L||this.closeEventListeners.forEach(function(N){return N()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(L){this.renderEventListeners.push(L)},X.prototype.removeRenderEventListener=function(L){this.renderEventListeners.indexOf(L)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(L),1)},X.prototype.addCloseEventListener=function(L){this.closeEventListeners.push(L)},X.prototype.removeCloseEventListener=function(L){this.closeEventListeners.indexOf(L)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(L),1)},X.prototype.setupResizeObserver=function(){var L=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var L=1*this.target.clientWidth/this.target.clientHeight,N=this.contentDiv.clientWidth/L>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*L:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=N+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/L;this.resize(N,V)}},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Pe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},X.prototype.resize=function(L,N){this.imageWidth=Math.round(L),this.imageHeight=Math.round(N),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},X.prototype.setEditingTarget=function(){var L=document.createElement("canvas");L.width=this.target.naturalWidth,L.height=this.target.naturalHeight,L.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var N=L.toDataURL();Pe.setAttributes(this.editingTarget,[["href",N]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var L=this.target.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=L.left-N.left-this.CANVAS_MARGIN,this.top=L.top-N.top-this.CANVAS_MARGIN},X.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Pe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Pe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Pe.createGroup(),this.editingTargetRotationScaleContainer=Pe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var L=Pe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(L);var N=Pe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(N),this.editingTargetContainer=Pe.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},X.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},X.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Pe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Dr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},X.prototype.zoomToCrop=function(){if(this.cropRect){var L=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,N=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=L+"px "+N+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-L+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-N+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},X.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},X.prototype.cropRectChanged=function(L){this.cropRect=L,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},X.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,N=this.target.offsetTop>L+this.CANVAS_MARGIN?this.target.offsetTop-(L+this.CANVAS_MARGIN):0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var L=this;this.topToolbar=new Kt,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 N=new Yn;N.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(N);var V=[];this.aspectRatios.forEach(function(tr){var Mr=new Bn(Fr.getIcon(tr.horizontal,tr.vertical),tr.horizontal===0&&tr.vertical===0?"FREE":tr.horizontal+":"+tr.vertical);Mr.onClick=function(){return L.ratioButtonClicked(tr)},V.push(Mr)}),this.aspectRatioButton=new hr(Fr.getIcon(0,0),"Aspect ratio",V),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,N.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ne=new Bn('<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");ne.isActive=this.isGridVisible,ne.onClick=function(){L.isGridVisible=!L.isGridVisible,ne.isActive=L.isGridVisible},N.addButton(ne);var J=new Bn('<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(J.isActive=this.zoomToCropEnabled,J.onClick=function(){L.zoomToCropEnabled=!L.zoomToCropEnabled,J.isActive=L.zoomToCropEnabled},N.addButton(J),!un.isLicensed){var Fe=new _n;this.topToolbar.addElementBlock(Fe);var Jt=document.createElement("div");Jt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var In=document.createElement("a");In.style.color="currentColor",In.href="https://markerjs.com/products/cropro",In.target="_blank",In.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>',Jt.appendChild(In),Fe.addElement(Jt)}var Zn=new Yn;Zn.minWidth=3*this.toolbarHeight+"px",Zn.contentAlign="end",this.topToolbar.addButtonBlock(Zn);var ln=new Bn('<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");ln.onClick=this.startRenderAndClose,Zn.addButton(ln),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ln.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ir=new Bn('<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");ir.onClick=this.close,Zn.addButton(ir),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ir.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var L=this;this.bottomToolbar=new Kt,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 N=new Yn;N.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(N);var V=new Bn('<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");V.onClick=this.rotateLeftButtonClicked,N.addButton(V);var ne=new Bn('<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");ne.onClick=this.rotateRightButtonClicked,N.addButton(ne);var J=new _n;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),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(Zn){L.rotateBy(Zn),L.straightener.angle=L.rotationAngle},J.addElement(this.straightener.getUI());var Fe=new Yn;Fe.minWidth=2*this.toolbarHeight+"px",Fe.contentAlign="end",this.bottomToolbar.addButtonBlock(Fe);var Jt=new Bn('<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");Jt.onClick=this.flipHorizontallyButtonClicked,Fe.addButton(Jt);var In=new Bn('<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");In.onClick=this.flipVerticallyButtonClicked,Fe.addButton(In)},X.prototype.ratioButtonClicked=function(L){this.aspectRatio=L,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Fr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new br(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(L){if(L){var N=this.cropLayer.getRescaledRect(L.width,L.height,this.imageWidth,this.imageHeight,L.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(N),this.cropRectChanged(N),this.flippedHorizontally=L.flippedHorizontally,this.flippedVertically=L.flippedVertically,this.applyFlip(),this.rotationAngle=L.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(L,N){var V=this.cropImage.getBoundingClientRect();return{x:L-V.left,y:N-V.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var L=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},X.prototype.rotateLeftButtonClicked=function(){var L=this.rotationAngle-90;this.rotationAngle%90!=0&&(L+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(L)},X.prototype.rotateRightButtonClicked=function(){var L=this.rotationAngle+90;this.rotationAngle%90!=0&&(L-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(L)},X.prototype.rotateTo=function(L){L=(L=L>180?L-360:L)<=-180?L+360:L,this.rotationAngle=L,this.applyRotation()},X.prototype.rotateBy=function(L){this.rotateTo((this.rotationAngle+L)%360)},X.prototype.applyRotation=function(){var L=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var N=this.editingTargetRotationContainer.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(N,0);var V=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/V.width,this.imageHeight/V.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=L},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return ct(this,void 0,void 0,function(){var L,N;return tn(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return L=V.sent(),N=this.getState(),this.renderEventListeners.forEach(function(ne){return ne(L,N)}),this.close(!0),[2]}})})},X.prototype.render=function(){return ct(this,void 0,void 0,function(){var L;return tn(this,function(N){switch(N.label){case 0:return(L=new ti).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.width=this.renderWidth,L.height=this.renderHeight,this.unzoomFromCrop(),Pe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,L.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 N.sent(),[4,L.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,N.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new bn("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 bn("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new bn("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var L=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new bn("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*L)+`px;
|
|
height: `+(this.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new bn("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new bn("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new bn("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 bn("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new bn("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 bn("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new bn("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},X.instanceCounter=0,X}(),rr=D("8hTe"),fi=D.n(rr),wi=/<pre[^>]*>/g;function ni(X){var L=document.createElement("div");return L.innerHTML=X,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var ri=fe.a=function(X){var L=X.value,N=L===void 0?"":L,V=X.edit,ne=V===void 0?!1:V,J=X.className,Fe=X.showTextOnly,Jt=X.showLines,In=X.replaces,Zn=X.zoomImg,ln=X.hasMask,ir=X.style,tr=ir===void 0?{}:ir,Mr=X.stylesPrev,ui=Mr===void 0?{}:Mr,oi=String(N),Gr=Object(P.useRef)(),Li=Object(P.useRef)(),Vi=Object(P.useState)(""),Ar=Object(K.a)(Vi,2),Tr=Ar[0],ii=Ar[1],Br=Object(P.useState)("office"),Hn=Object(K.a)(Br,2),yn=Hn[0],Sn=Hn[1],En=function(){var De=new dn(Li.current);De.displayMode="popup",De.addRenderEventListener(function(){var Je=Object(k.a)(r.a.mark(function it(At){var Ct;return r.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return Gr.current.style.display="none",gt.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:At}});case 3:Ct=gt.sent,Ct!=null&&Ct.id&&In(Li.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Ct==null?void 0:Ct.id,"?type=").concat(Ct.content_type));case 5:case"end":return gt.stop()}},it)}));return function(it){return Je.apply(this,arguments)}}()),De.show()},ur=function(){var De=new he(Li.current);De.settings.displayMode="popup",De.addEventListener("render",function(){var Je=Object(k.a)(r.a.mark(function it(At){var Ct;return r.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(Gr.current.style.display="none",!Li.current){gt.next=6;break}return gt.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:At.dataUrl}});case 4:Ct=gt.sent,Ct!=null&&Ct.id&&In(Li.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Ct==null?void 0:Ct.id,"?type=").concat(Ct.content_type));case 6:case"end":return gt.stop()}},it)}));return function(it){return Je.apply(this,arguments)}}()),De.show(),window.markerArea=De},sr=Object(P.useMemo)(function(){Gr.current&&(Gr.current.style.zIndex=-1);try{var rt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,De=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Je=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;oi=oi.replace(rt,"("+Z.a.API_SERVER+"/api/attachments/").replace(De,'"'+Z.a.API_SERVER+"/api/attachments/").replace(Je,'"'+Z.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(We){}var it=W(oi),At=y();if(oi.match(/\[TOC\]/)&&(it=it.replace("<p>[TOC]</p>",R()),O()),it=it.replace(/(__special_katext_id_\d+__)/g,function(We,gt){var ot=At[gt],dt=ot.type,wt=ot.expression;return Object(le.renderToString)(ni(wt)||"",{displayMode:dt==="block",throwOnError:!1,output:"html"})}),it=it.replace(/▁/g,"\u2581\u2581\u2581"),g(),Fe){var Ct=document.createElement("div");return Ct.innerHTML=it,Ct.innerText}return setTimeout(function(){return Te()},500),it},[oi]),Q=Object(P.useRef)();T.WebkitLineClamp=Jt,Jt&&(tr=Object(M.a)(Object(M.a)({},tr),T));function de(rt){var De=rt.target;if(De.tagName.toUpperCase()==="IMG"){if(Zn){var Je=De.getAttribute("src");ii(Je),Sn("image")}}else if(De.tagName.toUpperCase()==="A"){var it=De.getAttribute("href");if(it.indexOf("office")>-1)rt.preventDefault(),ii(it),Sn("office");else if(it.indexOf("application/pdf")>-1)rt.preventDefault(),ii(it),Sn("pdf");else if(it.indexOf("text/html")>-1)rt.preventDefault(),ii(it),Sn("html");else if(it.startsWith("#")){rt.preventDefault();var At=document.getElementById(it.replace("#",""));At&&At.scrollIntoView(!0)}}}var Te=function(){var De,Je=(De=Q.current)===null||De===void 0?void 0:De.querySelectorAll("video");Je==null||Je.forEach(function(it){if(it.oncontextmenu=function(){return!1},it.src.indexOf(".m3u8")>-1&&!it.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var At=new z.a;At.loadSource(it.src),At.attachMedia(it)}}})};Object(P.useEffect)(function(){if(Q.current&&sr&&(sr.match(wi)&&window.PR.prettyPrint()),Q.current)return Q.current.addEventListener("click",de),function(){Q.current.removeEventListener("click",de),g(),O()}},[sr,Q.current,de]);var Se=function(De){if(!ne)return;De.target.nodeName==="IMG"?(Gr.current.style.zIndex=1,Gr.current.style.display="flex",Gr.current.style.width=De.target.clientWidth+"px",Gr.current.style.height=De.target.clientHeight+"px",Gr.current.style.top=De.target.offsetTop+"px",Gr.current.style.left=De.target.offsetLeft+"px",Li.current.src=De.target.getAttribute("src")):Gr.current.style.display="none"};return _.a.createElement("div",{style:{position:"relative"}},_.a.createElement("div",{ref:Q,style:Object(M.a)({},tr),className:"".concat(J||""," markdown-body ").concat(fi.a.mdBody),onMouseOver:Se,dangerouslySetInnerHTML:{__html:sr}}),_.a.createElement("div",{ref:Gr,className:fi.a.button},_.a.createElement(Y.a,null,_.a.createElement(G.a,{onClick:function(){return En()}},"\u88C1\u526A"),_.a.createElement(G.a,{onClick:function(){return ur()}},"\u7F16\u8F91"))),_.a.createElement("img",{ref:Li,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),_.a.createElement(se.a,{close:!0,data:Tr,type:Tr!=null&&Tr.length?yn:"",style:Object(M.a)({},ui),onClose:function(){return ii("")}}))}},"9VGf":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return U});var q=D("q1tI"),Y=D.n(q);function U(G,M){var k=Object(q.useRef)();Object(q.useEffect)(function(){k.current=G}),Object(q.useEffect)(function(){function K(){k.current()}if(M!==null){var I=setInterval(K,M);return function(){return clearInterval(I)}}},[M])}},AHFd:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return I});var q=D("giR+"),Y=D("fyUT"),U=D("OaEy"),G=D("2fM7"),M=D("tJVT"),k=D("q1tI"),K=D.n(k),I;(function(P){P[P.Number=1]="Number",P[P.Percent=2]="Percent"})(I||(I={}));var r=function(_){var p=_.value,m=_.onChange,u=_.disabled,a=_.hidePercentOption,o=a===void 0?!1:a,c=Object(k.useMemo)(function(){return o?I.Number:I.Percent},[o]),s=Object(k.useState)(c),i=Object(M.a)(s,2),n=i[0],O=i[1],T=Object(k.useCallback)(function(R){return n===I.Number?"".concat(R,"\u5206"):"".concat(R,"%")},[n]),w=Object(k.useCallback)(function(R){if(n===I.Number){var S=R.replace("\u5206","");return isNaN(parseInt(S,10))?0:S}else{var v=R.replace("%","");return v}},[n]);return Object(k.useEffect)(function(){O(p.type)},[p]),K.a.createElement("div",{style:{display:"inline-block"}},K.a.createElement(G.a,{onChange:function(S){O(S),m({type:S,inputValue:S===I.Number?5:20})},value:n||c,style:{width:100},options:o?[{label:"\u5206\u503C",value:I.Number}]:[{label:"\u767E\u5206\u6BD4",value:I.Percent},{label:"\u5206\u503C",value:I.Number}],disabled:u}),K.a.createElement(Y.a,{disabled:u,value:p.inputValue,formatter:T,parser:w,max:n===I.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(S){m({type:n,inputValue:S})}}))};fe.b=r},BU3w:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return k});var q=D("MNnm"),Y="rc-util-key";function U(K){if(K.attachTo)return K.attachTo;var I=document.querySelector("head");return I||document.body}function G(K){var I,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(q.a)())return null;var P=document.createElement("style");if((I=r.csp)===null||I===void 0?void 0:I.nonce){var _;P.nonce=(_=r.csp)===null||_===void 0?void 0:_.nonce}P.innerHTML=K;var p=U(r),m=p.firstChild;return r.prepend&&p.prepend?p.prepend(P):r.prepend&&m?p.insertBefore(P,m):p.appendChild(P),P}var M=new Map;function k(K,I){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=U(r);if(!M.has(P)){var _=G("",r),p=_.parentNode;M.set(P,p),p.removeChild(_)}var m=Array.from(M.get(P).children).find(function(s){return s.tagName==="STYLE"&&s[Y]===I});if(m){var u,a;if(((u=r.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((a=r.csp)===null||a===void 0?void 0:a.nonce)){var o;m.nonce=(o=r.csp)===null||o===void 0?void 0:o.nonce}return m.innerHTML!==K&&(m.innerHTML=K),m}var c=G(K,r);return c[Y]=I,c}},Bd2K:function(Gt,fe,D){(function(q){q(D("VrN/"),D("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(r,P,_){if(_!=q.Init&&_&&r.removeKeyMap("autoCloseTags"),!P)return;var p={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(p["'/'"]=function(m){return k(m)}),(typeof P!="object"||P.whenOpening!==!1)&&(p["'>'"]=function(m){return G(m)}),r.addKeyMap(p)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=["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 G(r){if(r.getOption("disableInput"))return q.Pass;for(var P=r.listSelections(),_=[],p=r.getOption("autoCloseTags"),m=0;m<P.length;m++){if(!P[m].empty())return q.Pass;var u=P[m].head,a=r.getTokenAt(u),o=q.innerMode(r.getMode(),a.state),c=o.state,s=o.mode.xmlCurrentTag&&o.mode.xmlCurrentTag(c),i=s&&s.name;if(!i)return q.Pass;var n=o.mode.configuration=="html",O=typeof p=="object"&&p.dontCloseTags||n&&Y,T=typeof p=="object"&&p.indentTags||n&&U;a.end>u.ch&&(i=i.slice(0,i.length-a.end+u.ch));var w=i.toLowerCase();if(!i||a.type=="string"&&(a.end!=u.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&s.close||a.string.indexOf("/")==u.ch-a.start-1||O&&K(O,w)>-1||I(r,o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(c)||[],i,u,!0))return q.Pass;var R=typeof p=="object"&&p.emptyTags;if(R&&K(R,i)>-1){_[m]={text:"/>",newPos:q.Pos(u.line,u.ch+2)};continue}var S=T&&K(T,w)>-1;_[m]={indent:S,text:">"+(S?`
|
|
|
|
`:"")+"</"+i+">",newPos:S?q.Pos(u.line+1,0):q.Pos(u.line,u.ch+1)}}for(var v=typeof p=="object"&&p.dontIndentOnAutoClose,m=P.length-1;m>=0;m--){var E=_[m];r.replaceRange(E.text,P[m].head,P[m].anchor,"+insert");var f=r.listSelections().slice(0);f[m]={head:E.newPos,anchor:E.newPos},r.setSelections(f),!v&&E.indent&&(r.indentLine(E.newPos.line,null,!0),r.indentLine(E.newPos.line+1,null,!0))}}function M(r,P){for(var _=r.listSelections(),p=[],m=P?"/":"</",u=r.getOption("autoCloseTags"),a=typeof u=="object"&&u.dontIndentOnSlash,o=0;o<_.length;o++){if(!_[o].empty())return q.Pass;var c=_[o].head,s=r.getTokenAt(c),i=q.innerMode(r.getMode(),s.state),n=i.state;if(P&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=c.ch-1))return q.Pass;var O,T=i.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(T&&i.mode.name=="javascript")O=m+"script";else if(T&&i.mode.name=="css")O=m+"style";else{var w=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(n);if(!w||w.length&&I(r,w,w[w.length-1],c))return q.Pass;O=m+w[w.length-1]}r.getLine(c.line).charAt(s.end)!=">"&&(O+=">"),p[o]=O}if(r.replaceSelections(p),_=r.listSelections(),!a)for(var o=0;o<_.length;o++)(o==_.length-1||_[o].head.line<_[o+1].head.line)&&r.indentLine(_[o].head.line)}function k(r){return r.getOption("disableInput")?q.Pass:M(r,!0)}q.commands.closeTag=function(r){return M(r)};function K(r,P){if(r.indexOf)return r.indexOf(P);for(var _=0,p=r.length;_<p;++_)if(r[_]==P)return _;return-1}function I(r,P,_,p,m){if(!q.scanForClosingTag)return!1;var u=Math.min(r.lastLine()+1,p.line+500),a=q.scanForClosingTag(r,p,null,u);if(!a||a.tag!=_)return!1;for(var o=m?1:0,c=P.length-1;c>=0&&P[c]==_;c--)++o;p=a.to;for(var c=1;c<o;c++){var s=q.scanForClosingTag(r,p,null,u);if(!s||s.tag!=_)return!1;p=s.to}return!0}})},BdwD:function(Gt,fe,D){"use strict";var q=D("+L6B"),Y=D("2/Rp"),U=D("0Owb"),G=D("k1fw"),M=D("q1tI"),k=D.n(M),K=D("FOrL"),I=D.n(K),r=function(_){var p=_.buttonProps,m=p===void 0?{}:p,u=_.styles,a=u===void 0?{}:u,o=_.customText,c=_.ButtonText,s=_.ButtonClick,i=_.Buttonclass,n=_.ButtonTwo;return k.a.createElement("section",{className:"tc animated fadeIn",style:Object(G.a)(Object(G.a)({},{color:"#999",margin:"200px auto"}),a)},k.a.createElement("img",{src:I.a}),k.a.createElement("p",{className:"mt20 font14"},o||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),c&&k.a.createElement(Y.a,Object(U.a)({className:i,onClick:s},m),c),n&&n)};fe.a=r},BjJ7:function(Gt,fe,D){"use strict";D.d(fe,"d",function(){return Y}),D.d(fe,"c",function(){return U}),D.d(fe,"e",function(){return G}),D.d(fe,"b",function(){return M}),D.d(fe,"a",function(){return K});var q=D("m3rI");function Y(I){var r=!0;if(I.length>0){for(var P=0;P<I.length;P++)if(I[P].compile_success==0||!I[P].compile_success){r=!1;break}}else r=!1;return r}function U(I){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",P=[],_=0;_<I.length;_++){var p=I[_],m=r?"".concat(r,"/").concat(p.name):"".concat(p.name);P.push({title:p.name,isLeaf:!(p.type==="tree"),key:m})}return P}function G(I,r,P){for(var _=0;_<I.length;_++){var p=I[_];if(p.key===r){p.children=P;break}p.children&&G(p.children,r,P)}return I}function M(I,r,P){var _;return function(){var p=this,m=arguments,u=function(){_=null,P||I.apply(p,m)},a=P&&!_;clearTimeout(_),_=setTimeout(u,r),a&&I.apply(p,m)}}var k=!0,K=q.a.API_SERVER},"C+DQ":function(Gt,fe,D){},"C/vA":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return q});function q(Y){const U=this;let G=!1,M;return function(){return G||(G=!0,M=Y.apply(U,arguments)),M}}},"Cg/j":function(Gt,fe,D){"use strict";D.d(fe,"b",function(){return q}),D.d(fe,"a",function(){return Y}),D.d(fe,"c",function(){return G}),D.d(fe,"d",function(){return M});var q;(function(k){k.serviceIds=new Map,k.DI_TARGET="$di$target",k.DI_DEPENDENCIES="$di$dependencies";function K(I){return I[k.DI_DEPENDENCIES]||[]}k.getServiceDependencies=K})(q||(q={}));const Y=G("instantiationService");function U(k,K,I,r){K[q.DI_TARGET]===K?K[q.DI_DEPENDENCIES].push({id:k,index:I,optional:r}):(K[q.DI_DEPENDENCIES]=[{id:k,index:I,optional:r}],K[q.DI_TARGET]=K)}function G(k){if(q.serviceIds.has(k))return q.serviceIds.get(k);const K=function(I,r,P){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");U(K,I,P,!1)};return K.toString=()=>k,q.serviceIds.set(k,K),K}function M(k){return function(K,I,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");U(k,K,r,!0)}}},DlQD:function(Gt,fe,D){(function(q,Y){Gt.exports=Y()})(this,function(){"use strict";function q(Ae,ve){for(var we=0;we<ve.length;we++){var ie=ve[we];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(Ae,ie.key,ie)}}function Y(Ae,ve,we){return ve&&q(Ae.prototype,ve),we&&q(Ae,we),Ae}function U(Ae,ve){if(!Ae)return;if(typeof Ae=="string")return G(Ae,ve);var we=Object.prototype.toString.call(Ae).slice(8,-1);if(we==="Object"&&Ae.constructor&&(we=Ae.constructor.name),we==="Map"||we==="Set")return Array.from(Ae);if(we==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(we))return G(Ae,ve)}function G(Ae,ve){(ve==null||ve>Ae.length)&&(ve=Ae.length);for(var we=0,ie=new Array(ve);we<ve;we++)ie[we]=Ae[we];return ie}function M(Ae,ve){var we;if(typeof Symbol=="undefined"||Ae[Symbol.iterator]==null){if(Array.isArray(Ae)||(we=U(Ae))||ve&&Ae&&typeof Ae.length=="number"){we&&(Ae=we);var ie=0;return function(){return ie>=Ae.length?{done:!0}:{done:!1,value:Ae[ie++]}}}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 we=Ae[Symbol.iterator](),we.next.bind(we)}function k(Ae,ve){return ve={exports:{}},Ae(ve,ve.exports),ve.exports}var K=k(function(Ae){function ve(){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 we(ie){Ae.exports.defaults=ie}Ae.exports={defaults:ve(),getDefaults:ve,changeDefaults:we}}),I=K.defaults,r=K.getDefaults,P=K.changeDefaults,_=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},o=function(ve){return a[ve]};function c(Ae,ve){if(ve){if(_.test(Ae))return Ae.replace(p,o)}else if(m.test(Ae))return Ae.replace(u,o);return Ae}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(Ae){return Ae.replace(s,function(ve,we){return we=we.toLowerCase(),we==="colon"?":":we.charAt(0)==="#"?we.charAt(1)==="x"?String.fromCharCode(parseInt(we.substring(2),16)):String.fromCharCode(+we.substring(1)):""})}var n=/(^|[^\[])\^/g;function O(Ae,ve){Ae=Ae.source||Ae,ve=ve||"";var we={replace:function(ae,me){return me=me.source||me,me=me.replace(n,"$1"),Ae=Ae.replace(ae,me),we},getRegex:function(){return new RegExp(Ae,ve)}};return we}var T=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ae,ve,we){if(Ae){var ie;try{ie=decodeURIComponent(i(we)).replace(T,"").toLowerCase()}catch(ae){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}ve&&!w.test(we)&&(we=h(ve,we));try{we=encodeURI(we).replace(/%25/g,"%")}catch(ae){return null}return we}var S={},v=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(Ae,ve){S[" "+Ae]||(v.test(Ae)?S[" "+Ae]=Ae+"/":S[" "+Ae]=j(Ae,"/",!0)),Ae=S[" "+Ae];var we=Ae.indexOf(":")===-1;return ve.substring(0,2)==="//"?we?ve:Ae.replace(E,"$1")+ve:ve.charAt(0)==="/"?we?ve:Ae.replace(f,"$1")+ve:Ae+ve}var y={exec:function(){}};function g(Ae){for(var ve=1,we,ie;ve<arguments.length;ve++){we=arguments[ve];for(ie in we)Object.prototype.hasOwnProperty.call(we,ie)&&(Ae[ie]=we[ie])}return Ae}function x(Ae,ve){var we=Ae.replace(/\|/g,function(me,be,ye){for(var Be=!1,St=be;--St>=0&&ye[St]==="\\";)Be=!Be;return Be?"|":" |"}),ie=we.split(/ \|/),ae=0;if(ie.length>ve)ie.splice(ve);else for(;ie.length<ve;)ie.push("");for(;ae<ie.length;ae++)ie[ae]=ie[ae].trim().replace(/\\\|/g,"|");return ie}function j(Ae,ve,we){var ie=Ae.length;if(ie===0)return"";for(var ae=0;ae<ie;){var me=Ae.charAt(ie-ae-1);if(me===ve&&!we)ae++;else if(me!==ve&&we)ae++;else break}return Ae.substr(0,ie-ae)}function F(Ae,ve){if(Ae.indexOf(ve[1])===-1)return-1;for(var we=Ae.length,ie=0,ae=0;ae<we;ae++)if(Ae[ae]==="\\")ae++;else if(Ae[ae]===ve[0])ie++;else if(Ae[ae]===ve[1]&&(ie--,ie<0))return ae;return-1}function A(Ae){Ae&&Ae.sanitize&&!Ae.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 W={escape:c,unescape:i,edit:O,cleanUrl:R,resolveUrl:h,noopTest:y,merge:g,splitCells:x,rtrim:j,findClosingBracket:F,checkSanitizeDeprecation:A},H=K.defaults,C=W.rtrim,z=W.splitCells,Z=W.escape,le=W.findClosingBracket;function se(Ae,ve,we){var ie=ve.href,ae=ve.title?Z(ve.title):null,me=Ae[1].replace(/\\([\[\]])/g,"$1");return Ae[0].charAt(0)!=="!"?{type:"link",raw:we,href:ie,title:ae,text:me}:{type:"image",raw:we,href:ie,title:ae,text:Z(me)}}function Ce(Ae,ve){var we=Ae.match(/^(\s+)(?:```)/);if(we===null)return ve;var ie=we[1];return ve.split(`
|
|
`).map(function(ae){var me=ae.match(/^\s+/);if(me===null)return ae;var be=me[0];return be.length>=ie.length?ae.slice(ie.length):ae}).join(`
|
|
`)}var Ee=function(){function Ae(we){this.options=we||H}var ve=Ae.prototype;return ve.space=function(ie){var ae=this.rules.block.newline.exec(ie);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},ve.code=function(ie,ae){var me=this.rules.block.code.exec(ie);if(me){var be=ae[ae.length-1];if(be&&be.type==="paragraph")return{raw:me[0],text:me[0].trimRight()};var ye=me[0].replace(/^ {4}/gm,"");return{type:"code",raw:me[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:C(ye,`
|
|
`)}}},ve.fences=function(ie){var ae=this.rules.block.fences.exec(ie);if(ae){var me=ae[0],be=Ce(me,ae[3]||"");return{type:"code",raw:me,lang:ae[2]?ae[2].trim():ae[2],text:be}}},ve.heading=function(ie){var ae=this.rules.block.heading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},ve.nptable=function(ie){var ae=this.rules.block.nptable.exec(ie);if(ae){var me={type:"table",header:z(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(me.header.length===me.align.length){var be=me.align.length,ye;for(ye=0;ye<be;ye++)/^ *-+: *$/.test(me.align[ye])?me.align[ye]="right":/^ *:-+: *$/.test(me.align[ye])?me.align[ye]="center":/^ *:-+ *$/.test(me.align[ye])?me.align[ye]="left":me.align[ye]=null;for(be=me.cells.length,ye=0;ye<be;ye++)me.cells[ye]=z(me.cells[ye],me.header.length);return me}}},ve.hr=function(ie){var ae=this.rules.block.hr.exec(ie);if(ae)return{type:"hr",raw:ae[0]}},ve.blockquote=function(ie){var ae=this.rules.block.blockquote.exec(ie);if(ae){var me=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:me}}},ve.list=function(ie){var ae=this.rules.block.list.exec(ie);if(ae){for(var me=ae[0],be=ae[2],ye=be.length>1,Be=be[be.length-1]===")",St={type:"list",raw:me,ordered:ye,start:ye?+be.slice(0,-1):"",loose:!1,items:[]},an=ae[0].match(this.rules.block.item),Dn=!1,yt,en,_t,Et,st,he,Le,Lt=an.length,ct=0;ct<Lt;ct++)yt=an[ct],me=yt,en=yt.length,yt=yt.replace(/^ *([*+-]|\d+[.)]) */,""),~yt.indexOf(`
|
|
`)&&(en-=yt.length,yt=this.options.pedantic?yt.replace(/^ {1,4}/gm,""):yt.replace(new RegExp("^ {1,"+en+"}","gm"),"")),ct!==Lt-1&&(_t=this.rules.block.bullet.exec(an[ct+1])[0],(ye?_t.length===1||!Be&&_t[_t.length-1]===")":_t.length>1||this.options.smartLists&&_t!==be)&&(Et=an.slice(ct+1).join(`
|
|
`),St.raw=St.raw.substring(0,St.raw.length-Et.length),ct=Lt-1)),st=Dn||/\n\n(?!\s*$)/.test(yt),ct!==Lt-1&&(Dn=yt.charAt(yt.length-1)===`
|
|
`,st||(st=Dn)),st&&(St.loose=!0),he=/^\[[ xX]\] /.test(yt),Le=void 0,he&&(Le=yt[1]!==" ",yt=yt.replace(/^\[[ xX]\] +/,"")),St.items.push({type:"list_item",raw:me,task:he,checked:Le,loose:st,text:yt});return St}},ve.html=function(ie){var ae=this.rules.block.html.exec(ie);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):Z(ae[0]):ae[0]}},ve.def=function(ie){var ae=this.rules.block.def.exec(ie);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var me=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:me,raw:ae[0],href:ae[2],title:ae[3]}}},ve.table=function(ie){var ae=this.rules.block.table.exec(ie);if(ae){var me={type:"table",header:z(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(me.header.length===me.align.length){me.raw=ae[0];var be=me.align.length,ye;for(ye=0;ye<be;ye++)/^ *-+: *$/.test(me.align[ye])?me.align[ye]="right":/^ *:-+: *$/.test(me.align[ye])?me.align[ye]="center":/^ *:-+ *$/.test(me.align[ye])?me.align[ye]="left":me.align[ye]=null;for(be=me.cells.length,ye=0;ye<be;ye++)me.cells[ye]=z(me.cells[ye].replace(/^ *\| *| *\| *$/g,""),me.header.length);return me}}},ve.lheading=function(ie){var ae=this.rules.block.lheading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},ve.paragraph=function(ie){var ae=this.rules.block.paragraph.exec(ie);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
|
|
`?ae[1].slice(0,-1):ae[1]}},ve.text=function(ie,ae){var me=this.rules.block.text.exec(ie);if(me){var be=ae[ae.length-1];return be&&be.type==="text"?{raw:me[0],text:me[0]}:{type:"text",raw:me[0],text:me[0]}}},ve.escape=function(ie){var ae=this.rules.inline.escape.exec(ie);if(ae)return{type:"escape",raw:ae[0],text:Z(ae[1])}},ve.tag=function(ie,ae,me){var be=this.rules.inline.tag.exec(ie);if(be)return!ae&&/^<a /i.test(be[0])?ae=!0:ae&&/^<\/a>/i.test(be[0])&&(ae=!1),!me&&/^<(pre|code|kbd|script)(\s|>)/i.test(be[0])?me=!0:me&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(be[0])&&(me=!1),{type:this.options.sanitize?"text":"html",raw:be[0],inLink:ae,inRawBlock:me,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(be[0]):Z(be[0]):be[0]}},ve.link=function(ie){var ae=this.rules.inline.link.exec(ie);if(ae){var me=le(ae[2],"()");if(me>-1){var be=ae[0].indexOf("!")===0?5:4,ye=be+ae[1].length+me;ae[2]=ae[2].substring(0,me),ae[0]=ae[0].substring(0,ye).trim(),ae[3]=""}var Be=ae[2],St="";if(this.options.pedantic){var an=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Be);an?(Be=an[1],St=an[3]):St=""}else St=ae[3]?ae[3].slice(1,-1):"";Be=Be.trim().replace(/^<([\s\S]*)>$/,"$1");var Dn=se(ae,{href:Be&&Be.replace(this.rules.inline._escapes,"$1"),title:St&&St.replace(this.rules.inline._escapes,"$1")},ae[0]);return Dn}},ve.reflink=function(ie,ae){var me;if((me=this.rules.inline.reflink.exec(ie))||(me=this.rules.inline.nolink.exec(ie))){var be=(me[2]||me[1]).replace(/\s+/g," ");if(be=ae[be.toLowerCase()],!be||!be.href){var ye=me[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Be=se(me,be,me[0]);return Be}},ve.strong=function(ie,ae,me){me===void 0&&(me="");var be=this.rules.inline.strong.start.exec(ie);if(be&&(!be[1]||be[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ae=ae.slice(-1*ie.length);var ye=be[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Be;(be=ye.exec(ae))!=null;)if(Be=this.rules.inline.strong.middle.exec(ae.slice(0,be.index+3)),Be)return{type:"strong",raw:ie.slice(0,Be[0].length),text:ie.slice(2,Be[0].length-2)}}},ve.em=function(ie,ae,me){me===void 0&&(me="");var be=this.rules.inline.em.start.exec(ie);if(be&&(!be[1]||be[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ae=ae.slice(-1*ie.length);var ye=be[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Be;(be=ye.exec(ae))!=null;)if(Be=this.rules.inline.em.middle.exec(ae.slice(0,be.index+2)),Be)return{type:"em",raw:ie.slice(0,Be[0].length),text:ie.slice(1,Be[0].length-1)}}},ve.codespan=function(ie){var ae=this.rules.inline.code.exec(ie);if(ae){var me=ae[2].replace(/\n/g," "),be=/[^ ]/.test(me),ye=me.startsWith(" ")&&me.endsWith(" ");return be&&ye&&(me=me.substring(1,me.length-1)),me=Z(me,!0),{type:"codespan",raw:ae[0],text:me}}},ve.br=function(ie){var ae=this.rules.inline.br.exec(ie);if(ae)return{type:"br",raw:ae[0]}},ve.del=function(ie){var ae=this.rules.inline.del.exec(ie);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},ve.autolink=function(ie,ae){var me=this.rules.inline.autolink.exec(ie);if(me){var be,ye;return me[2]==="@"?(be=Z(this.options.mangle?ae(me[1]):me[1]),ye="mailto:"+be):(be=Z(me[1]),ye=be),{type:"link",raw:me[0],text:be,href:ye,tokens:[{type:"text",raw:be,text:be}]}}},ve.url=function(ie,ae){var me;if(me=this.rules.inline.url.exec(ie)){var be,ye;if(me[2]==="@")be=Z(this.options.mangle?ae(me[0]):me[0]),ye="mailto:"+be;else{var Be;do Be=me[0],me[0]=this.rules.inline._backpedal.exec(me[0])[0];while(Be!==me[0]);be=Z(me[0]),me[1]==="www."?ye="http://"+be:ye=be}return{type:"link",raw:me[0],text:be,href:ye,tokens:[{type:"text",raw:be,text:be}]}}},ve.inlineText=function(ie,ae,me){var be=this.rules.inline.text.exec(ie);if(be){var ye;return ae?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(be[0]):Z(be[0]):be[0]:ye=Z(this.options.smartypants?me(be[0]):be[0]),{type:"text",raw:be[0],text:ye}}},Ae}(),Ie=W.noopTest,Qe=W.edit,Xe=W.merge,_e={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:Ie,table:Ie,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};_e._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,_e.def=Qe(_e.def).replace("label",_e._label).replace("title",_e._title).getRegex(),_e.bullet=/(?:[*+-]|\d{1,9}[.)])/,_e.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,_e.item=Qe(_e.item,"gm").replace(/bull/g,_e.bullet).getRegex(),_e.list=Qe(_e.list).replace(/bull/g,_e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_e.def.source+")").getRegex(),_e._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",_e._comment=/<!--(?!-?>)[\s\S]*?-->/,_e.html=Qe(_e.html,"i").replace("comment",_e._comment).replace("tag",_e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e.paragraph=Qe(_e._paragraph).replace("hr",_e.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",_e._tag).getRegex(),_e.blockquote=Qe(_e.blockquote).replace("paragraph",_e.paragraph).getRegex(),_e.normal=Xe({},_e),_e.gfm=Xe({},_e.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*|$)"}),_e.gfm.nptable=Qe(_e.gfm.nptable).replace("hr",_e.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",_e._tag).getRegex(),_e.gfm.table=Qe(_e.gfm.table).replace("hr",_e.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",_e._tag).getRegex(),_e.pedantic=Xe({},_e.normal,{html:Qe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_e._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:Ie,paragraph:Qe(_e.normal._paragraph).replace("hr",_e.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var pe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ie,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:Ie,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};pe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",pe.punctuation=Qe(pe.punctuation).replace(/punctuation/g,pe._punctuation).getRegex(),pe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",pe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",pe.em.start=Qe(pe.em.start).replace(/punctuation/g,pe._punctuation).getRegex(),pe.em.middle=Qe(pe.em.middle).replace(/punctuation/g,pe._punctuation).replace(/overlapSkip/g,pe._overlapSkip).getRegex(),pe.em.endAst=Qe(pe.em.endAst,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.em.endUnd=Qe(pe.em.endUnd,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.start=Qe(pe.strong.start).replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.middle=Qe(pe.strong.middle).replace(/punctuation/g,pe._punctuation).replace(/blockSkip/g,pe._blockSkip).getRegex(),pe.strong.endAst=Qe(pe.strong.endAst,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.endUnd=Qe(pe.strong.endUnd,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.blockSkip=Qe(pe._blockSkip,"g").getRegex(),pe.overlapSkip=Qe(pe._overlapSkip,"g").getRegex(),pe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,pe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,pe._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])?)+(?![-_])/,pe.autolink=Qe(pe.autolink).replace("scheme",pe._scheme).replace("email",pe._email).getRegex(),pe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,pe.tag=Qe(pe.tag).replace("comment",_e._comment).replace("attribute",pe._attribute).getRegex(),pe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,pe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,pe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,pe.link=Qe(pe.link).replace("label",pe._label).replace("href",pe._href).replace("title",pe._title).getRegex(),pe.reflink=Qe(pe.reflink).replace("label",pe._label).getRegex(),pe.reflinkSearch=Qe(pe.reflinkSearch,"g").replace("reflink",pe.reflink).replace("nolink",pe.nolink).getRegex(),pe.normal=Xe({},pe),pe.pedantic=Xe({},pe.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:Qe(/^!?\[(label)\]\((.*?)\)/).replace("label",pe._label).getRegex(),reflink:Qe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pe._label).getRegex()}),pe.gfm=Xe({},pe.normal,{escape:Qe(pe.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),pe.gfm.url=Qe(pe.gfm.url,"i").replace("email",pe.gfm._extended_email).getRegex(),pe.breaks=Xe({},pe.gfm,{br:Qe(pe.br).replace("{2,}","*").getRegex(),text:Qe(pe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var at={block:_e,inline:pe},Qt=K.defaults,Ft=at.block,Tt=at.inline;function Ve(Ae){return Ae.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 pt(Ae){var ve="",we,ie,ae=Ae.length;for(we=0;we<ae;we++)ie=Ae.charCodeAt(we),Math.random()>.5&&(ie="x"+ie.toString(16)),ve+="&#"+ie+";";return ve}var ut=function(){function Ae(we){this.tokens=[],this.tokens.links=Object.create(null),this.options=we||Qt,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:Ft.normal,inline:Tt.normal};this.options.pedantic?(ie.block=Ft.pedantic,ie.inline=Tt.pedantic):this.options.gfm&&(ie.block=Ft.gfm,this.options.breaks?ie.inline=Tt.breaks:ie.inline=Tt.gfm),this.tokenizer.rules=ie}Ae.lex=function(ie,ae){var me=new Ae(ae);return me.lex(ie)};var ve=Ae.prototype;return ve.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(ie,ae,me){ae===void 0&&(ae=[]),me===void 0&&(me=!0),ie=ie.replace(/^ +$/gm,"");for(var be,ye,Be,St;ie;){if(be=this.tokenizer.space(ie)){ie=ie.substring(be.raw.length),be.type&&ae.push(be);continue}if(be=this.tokenizer.code(ie,ae)){ie=ie.substring(be.raw.length),be.type?ae.push(be):(St=ae[ae.length-1],St.raw+=`
|
|
`+be.raw,St.text+=`
|
|
`+be.text);continue}if(be=this.tokenizer.fences(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.heading(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.nptable(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.hr(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.blockquote(ie)){ie=ie.substring(be.raw.length),be.tokens=this.blockTokens(be.text,[],me),ae.push(be);continue}if(be=this.tokenizer.list(ie)){for(ie=ie.substring(be.raw.length),Be=be.items.length,ye=0;ye<Be;ye++)be.items[ye].tokens=this.blockTokens(be.items[ye].text,[],!1);ae.push(be);continue}if(be=this.tokenizer.html(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(me&&(be=this.tokenizer.def(ie))){ie=ie.substring(be.raw.length),this.tokens.links[be.tag]||(this.tokens.links[be.tag]={href:be.href,title:be.title});continue}if(be=this.tokenizer.table(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.lheading(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(me&&(be=this.tokenizer.paragraph(ie))){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.text(ie,ae)){ie=ie.substring(be.raw.length),be.type?ae.push(be):(St=ae[ae.length-1],St.raw+=`
|
|
`+be.raw,St.text+=`
|
|
`+be.text);continue}if(ie){var an="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(an);break}else throw new Error(an)}}return ae},ve.inline=function(ie){var ae,me,be,ye,Be,St,an=ie.length;for(ae=0;ae<an;ae++){St=ie[ae];switch(St.type){case"paragraph":case"text":case"heading":{St.tokens=[],this.inlineTokens(St.text,St.tokens);break}case"table":{for(St.tokens={header:[],cells:[]},ye=St.header.length,me=0;me<ye;me++)St.tokens.header[me]=[],this.inlineTokens(St.header[me],St.tokens.header[me]);for(ye=St.cells.length,me=0;me<ye;me++)for(Be=St.cells[me],St.tokens.cells[me]=[],be=0;be<Be.length;be++)St.tokens.cells[me][be]=[],this.inlineTokens(Be[be],St.tokens.cells[me][be]);break}case"blockquote":{this.inline(St.tokens);break}case"list":{for(ye=St.items.length,me=0;me<ye;me++)this.inline(St.items[me].tokens);break}}}return ie},ve.inlineTokens=function(ie,ae,me,be,ye){ae===void 0&&(ae=[]),me===void 0&&(me=!1),be===void 0&&(be=!1),ye===void 0&&(ye="");var Be,St=ie,an;if(this.tokens.links){var Dn=Object.keys(this.tokens.links);if(Dn.length>0)for(;(an=this.tokenizer.rules.inline.reflinkSearch.exec(St))!=null;)Dn.includes(an[0].slice(an[0].lastIndexOf("[")+1,-1))&&(St=St.slice(0,an.index)+"["+"a".repeat(an[0].length-2)+"]"+St.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(an=this.tokenizer.rules.inline.blockSkip.exec(St))!=null;)St=St.slice(0,an.index)+"["+"a".repeat(an[0].length-2)+"]"+St.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Be=this.tokenizer.escape(ie)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.tag(ie,me,be)){ie=ie.substring(Be.raw.length),me=Be.inLink,be=Be.inRawBlock,ae.push(Be);continue}if(Be=this.tokenizer.link(ie)){ie=ie.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,be)),ae.push(Be);continue}if(Be=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,be)),ae.push(Be);continue}if(Be=this.tokenizer.strong(ie,St,ye)){ie=ie.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],me,be),ae.push(Be);continue}if(Be=this.tokenizer.em(ie,St,ye)){ie=ie.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],me,be),ae.push(Be);continue}if(Be=this.tokenizer.codespan(ie)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.br(ie)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.del(ie)){ie=ie.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],me,be),ae.push(Be);continue}if(Be=this.tokenizer.autolink(ie,pt)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(!me&&(Be=this.tokenizer.url(ie,pt))){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.inlineText(ie,be,Ve)){ie=ie.substring(Be.raw.length),ye=Be.raw.slice(-1),ae.push(Be);continue}if(ie){var yt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return ae},Y(Ae,null,[{key:"rules",get:function(){return{block:Ft,inline:Tt}}}]),Ae}(),Ut=K.defaults,oe=W.cleanUrl,Ue=W.escape,ze=function(){function Ae(we){this.options=we||Ut}var ve=Ae.prototype;return ve.code=function(ie,ae,me){var be=(ae||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(ie,be);ye!=null&&ye!==ie&&(me=!0,ie=ye)}return be?'<pre><code class="'+this.options.langPrefix+Ue(be,!0)+'">'+(me?ie:Ue(ie,!0))+`</code></pre>
|
|
`:"<pre><code>"+(me?ie:Ue(ie,!0))+`</code></pre>
|
|
`},ve.blockquote=function(ie){return`<blockquote>
|
|
`+ie+`</blockquote>
|
|
`},ve.html=function(ie){return ie},ve.heading=function(ie,ae,me,be){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+be.slug(me)+'">'+ie+"</h"+ae+`>
|
|
`:"<h"+ae+">"+ie+"</h"+ae+`>
|
|
`},ve.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ve.list=function(ie,ae,me){var be=ae?"ol":"ul",ye=ae&&me!==1?' start="'+me+'"':"";return"<"+be+ye+`>
|
|
`+ie+"</"+be+`>
|
|
`},ve.listitem=function(ie){return"<li>"+ie+`</li>
|
|
`},ve.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ve.paragraph=function(ie){return"<p>"+ie+`</p>
|
|
`},ve.table=function(ie,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ie+`</thead>
|
|
`+ae+`</table>
|
|
`},ve.tablerow=function(ie){return`<tr>
|
|
`+ie+`</tr>
|
|
`},ve.tablecell=function(ie,ae){var me=ae.header?"th":"td",be=ae.align?"<"+me+' align="'+ae.align+'">':"<"+me+">";return be+ie+"</"+me+`>
|
|
`},ve.strong=function(ie){return"<strong>"+ie+"</strong>"},ve.em=function(ie){return"<em>"+ie+"</em>"},ve.codespan=function(ie){return"<code>"+ie+"</code>"},ve.br=function(){return this.options.xhtml?"<br/>":"<br>"},ve.del=function(ie){return"<del>"+ie+"</del>"},ve.link=function(ie,ae,me){if(ie=oe(this.options.sanitize,this.options.baseUrl,ie),ie===null)return me;var be='<a href="'+Ue(ie)+'"';return ae&&(be+=' title="'+ae+'"'),be+=">"+me+"</a>",be},ve.image=function(ie,ae,me){if(ie=oe(this.options.sanitize,this.options.baseUrl,ie),ie===null)return me;var be='<img src="'+ie+'" alt="'+me+'"';return ae&&(be+=' title="'+ae+'"'),be+=this.options.xhtml?"/>":">",be},ve.text=function(ie){return ie},Ae}(),$e=function(){function Ae(){}var ve=Ae.prototype;return ve.strong=function(ie){return ie},ve.em=function(ie){return ie},ve.codespan=function(ie){return ie},ve.del=function(ie){return ie},ve.html=function(ie){return ie},ve.text=function(ie){return ie},ve.link=function(ie,ae,me){return""+me},ve.image=function(ie,ae,me){return""+me},ve.br=function(){return""},Ae}(),Bt=function(){function Ae(){this.seen={}}var ve=Ae.prototype;return ve.slug=function(ie){var ae=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var me=ae;do this.seen[me]++,ae=me+"-"+this.seen[me];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Ae}(),Ht=K.defaults,qt=W.unescape,tt=function(){function Ae(we){this.options=we||Ht,this.options.renderer=this.options.renderer||new ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new $e,this.slugger=new Bt}Ae.parse=function(ie,ae){var me=new Ae(ae);return me.parse(ie)};var ve=Ae.prototype;return ve.parse=function(ie,ae){ae===void 0&&(ae=!0);var me="",be,ye,Be,St,an,Dn,yt,en,_t,Et,st,he,Le,Lt,ct,tn,un,Pe,et=ie.length;for(be=0;be<et;be++){Et=ie[be];switch(Et.type){case"space":continue;case"hr":{me+=this.renderer.hr();continue}case"heading":{me+=this.renderer.heading(this.parseInline(Et.tokens),Et.depth,qt(this.parseInline(Et.tokens,this.textRenderer)),this.slugger);continue}case"code":{me+=this.renderer.code(Et.text,Et.lang,Et.escaped);continue}case"table":{for(en="",yt="",St=Et.header.length,ye=0;ye<St;ye++)yt+=this.renderer.tablecell(this.parseInline(Et.tokens.header[ye]),{header:!0,align:Et.align[ye]});for(en+=this.renderer.tablerow(yt),_t="",St=Et.cells.length,ye=0;ye<St;ye++){for(Dn=Et.tokens.cells[ye],yt="",an=Dn.length,Be=0;Be<an;Be++)yt+=this.renderer.tablecell(this.parseInline(Dn[Be]),{header:!1,align:Et.align[Be]});_t+=this.renderer.tablerow(yt)}me+=this.renderer.table(en,_t);continue}case"blockquote":{_t=this.parse(Et.tokens),me+=this.renderer.blockquote(_t);continue}case"list":{for(st=Et.ordered,he=Et.start,Le=Et.loose,St=Et.items.length,_t="",ye=0;ye<St;ye++)ct=Et.items[ye],tn=ct.checked,un=ct.task,Lt="",ct.task&&(Pe=this.renderer.checkbox(tn),Le?ct.tokens.length>0&&ct.tokens[0].type==="text"?(ct.tokens[0].text=Pe+" "+ct.tokens[0].text,ct.tokens[0].tokens&&ct.tokens[0].tokens.length>0&&ct.tokens[0].tokens[0].type==="text"&&(ct.tokens[0].tokens[0].text=Pe+" "+ct.tokens[0].tokens[0].text)):ct.tokens.unshift({type:"text",text:Pe}):Lt+=Pe),Lt+=this.parse(ct.tokens,Le),_t+=this.renderer.listitem(Lt,un,tn);me+=this.renderer.list(_t,st,he);continue}case"html":{me+=this.renderer.html(Et.text);continue}case"paragraph":{me+=this.renderer.paragraph(this.parseInline(Et.tokens));continue}case"text":{for(_t=Et.tokens?this.parseInline(Et.tokens):Et.text;be+1<et&&ie[be+1].type==="text";)Et=ie[++be],_t+=`
|
|
`+(Et.tokens?this.parseInline(Et.tokens):Et.text);me+=ae?this.renderer.paragraph(_t):_t;continue}default:{var jt='Token with "'+Et.type+'" type was not found.';if(this.options.silent){console.error(jt);return}else throw new Error(jt)}}}return me},ve.parseInline=function(ie,ae){ae=ae||this.renderer;var me="",be,ye,Be=ie.length;for(be=0;be<Be;be++){ye=ie[be];switch(ye.type){case"escape":{me+=ae.text(ye.text);break}case"html":{me+=ae.html(ye.text);break}case"link":{me+=ae.link(ye.href,ye.title,this.parseInline(ye.tokens,ae));break}case"image":{me+=ae.image(ye.href,ye.title,ye.text);break}case"strong":{me+=ae.strong(this.parseInline(ye.tokens,ae));break}case"em":{me+=ae.em(this.parseInline(ye.tokens,ae));break}case"codespan":{me+=ae.codespan(ye.text);break}case"br":{me+=ae.br();break}case"del":{me+=ae.del(this.parseInline(ye.tokens,ae));break}case"text":{me+=ae.text(ye.text);break}default:{var St='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(St);return}else throw new Error(St)}}}return me},Ae}(),nn=W.merge,xn=W.checkSanitizeDeprecation,Ge=W.escape,He=K.getDefaults,vt=K.changeDefaults,Ot=K.defaults;function nt(Ae,ve,we){if(typeof Ae=="undefined"||Ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ae)+", string expected");if(typeof ve=="function"&&(we=ve,ve=null),ve=nn({},nt.defaults,ve||{}),xn(ve),we){var ie=ve.highlight,ae;try{ae=ut.lex(Ae,ve)}catch(Be){return we(Be)}var me=function(St){var an;if(!St)try{an=tt.parse(ae,ve)}catch(Dn){St=Dn}return ve.highlight=ie,St?we(St):we(null,an)};if(!ie||ie.length<3)return me();if(delete ve.highlight,!ae.length)return me();var be=0;nt.walkTokens(ae,function(Be){Be.type==="code"&&(be++,setTimeout(function(){ie(Be.text,Be.lang,function(St,an){if(St)return me(St);an!=null&&an!==Be.text&&(Be.text=an,Be.escaped=!0),be--,be===0&&me()})},0))}),be===0&&me();return}try{var ye=ut.lex(Ae,ve);return ve.walkTokens&&nt.walkTokens(ye,ve.walkTokens),tt.parse(ye,ve)}catch(Be){if(Be.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ve.silent)return"<p>An error occurred:</p><pre>"+Ge(Be.message+"",!0)+"</pre>";throw Be}}nt.options=nt.setOptions=function(Ae){return nn(nt.defaults,Ae),vt(nt.defaults),nt},nt.getDefaults=He,nt.defaults=Ot,nt.use=function(Ae){var ve=nn({},Ae);if(Ae.renderer&&function(){var ie=nt.defaults.renderer||new ze,ae=function(ye){var Be=ie[ye];ie[ye]=function(){for(var St=arguments.length,an=new Array(St),Dn=0;Dn<St;Dn++)an[Dn]=arguments[Dn];var yt=Ae.renderer[ye].apply(ie,an);return yt===!1&&(yt=Be.apply(ie,an)),yt}};for(var me in Ae.renderer)ae(me);ve.renderer=ie}(),Ae.tokenizer&&function(){var ie=nt.defaults.tokenizer||new Ee,ae=function(ye){var Be=ie[ye];ie[ye]=function(){for(var St=arguments.length,an=new Array(St),Dn=0;Dn<St;Dn++)an[Dn]=arguments[Dn];var yt=Ae.tokenizer[ye].apply(ie,an);return yt===!1&&(yt=Be.apply(ie,an)),yt}};for(var me in Ae.tokenizer)ae(me);ve.tokenizer=ie}(),Ae.walkTokens){var we=nt.defaults.walkTokens;ve.walkTokens=function(ie){Ae.walkTokens(ie),we&&we(ie)}}nt.setOptions(ve)},nt.walkTokens=function(Ae,ve){for(var we=M(Ae),ie;!(ie=we()).done;){var ae=ie.value;ve(ae);switch(ae.type){case"table":{for(var me=M(ae.tokens.header),be;!(be=me()).done;){var ye=be.value;nt.walkTokens(ye,ve)}for(var Be=M(ae.tokens.cells),St;!(St=Be()).done;)for(var an=St.value,Dn=M(an),yt;!(yt=Dn()).done;){var en=yt.value;nt.walkTokens(en,ve)}break}case"list":{nt.walkTokens(ae.items,ve);break}default:ae.tokens&&nt.walkTokens(ae.tokens,ve)}}},nt.Parser=tt,nt.parser=tt.parse,nt.Renderer=ze,nt.TextRenderer=$e,nt.Lexer=ut,nt.lexer=ut.lex,nt.Tokenizer=Ee,nt.Slugger=Bt,nt.parse=nt;var xt=nt;return xt})},ELLl:function(Gt,fe,D){(function(q){q(D("VrN/"))})(function(q){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},U=q.Pos;q.defineOption("autoCloseBrackets",!1,function(a,o,c){c&&c!=q.Init&&(a.removeKeyMap(M),a.state.closeBrackets=null),o&&(k(G(o,"pairs")),a.state.closeBrackets=o,a.addKeyMap(M))});function G(a,o){return o=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[o]!=null?a[o]:Y[o]}var M={Backspace:r,Enter:P};function k(a){for(var o=0;o<a.length;o++){var c=a.charAt(o),s="'"+c+"'";M[s]||(M[s]=K(c))}}k(Y.pairs+"`");function K(a){return function(o){return p(o,a)}}function I(a){var o=a.state.closeBrackets;if(!o||o.override)return o;var c=a.getModeAt(a.getCursor());return c.closeBrackets||o}function r(a){var o=I(a);if(!o||a.getOption("disableInput"))return q.Pass;for(var c=G(o,"pairs"),s=a.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return q.Pass;var n=m(a,s[i].head);if(!n||c.indexOf(n)%2!=0)return q.Pass}for(var i=s.length-1;i>=0;i--){var O=s[i].head;a.replaceRange("",U(O.line,O.ch-1),U(O.line,O.ch+1),"+delete")}}function P(a){var o=I(a),c=o&&G(o,"explode");if(!c||a.getOption("disableInput"))return q.Pass;for(var s=a.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return q.Pass;var n=m(a,s[i].head);if(!n||c.indexOf(n)%2!=0)return q.Pass}a.operation(function(){var O=a.lineSeparator()||`
|
|
`;a.replaceSelection(O+O,null),a.execCommand("goCharLeft"),s=a.listSelections();for(var T=0;T<s.length;T++){var w=s[T].head.line;a.indentLine(w,null,!0),a.indentLine(w+1,null,!0)}})}function _(a){var o=q.cmpPos(a.anchor,a.head)>0;return{anchor:new U(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new U(a.head.line,a.head.ch+(o?1:-1))}}function p(a,o){var c=I(a);if(!c||a.getOption("disableInput"))return q.Pass;var s=G(c,"pairs"),i=s.indexOf(o);if(i==-1)return q.Pass;for(var n=G(c,"closeBefore"),O=G(c,"triples"),T=s.charAt(i+1)==o,w=a.listSelections(),R=i%2==0,S,v=0;v<w.length;v++){var E=w[v],f=E.head,h,y=a.getRange(f,U(f.line,f.ch+1));if(R&&!E.empty())h="surround";else if((T||!R)&&y==o)T&&u(a,f)?h="both":O.indexOf(o)>=0&&a.getRange(f,U(f.line,f.ch+3))==o+o+o?h="skipThree":h="skip";else if(T&&f.ch>1&&O.indexOf(o)>=0&&a.getRange(U(f.line,f.ch-2),f)==o+o){if(f.ch>2&&/\bstring/.test(a.getTokenTypeAt(U(f.line,f.ch-2))))return q.Pass;h="addFour"}else if(T){var g=f.ch==0?" ":a.getRange(U(f.line,f.ch-1),f);if(!q.isWordChar(y)&&g!=o&&!q.isWordChar(g))h="both";else return q.Pass}else if(R&&(y.length===0||/\s/.test(y)||n.indexOf(y)>-1))h="both";else return q.Pass;if(!S)S=h;else if(S!=h)return q.Pass}var x=i%2?s.charAt(i-1):o,j=i%2?o:s.charAt(i+1);a.operation(function(){if(S=="skip")a.execCommand("goCharRight");else if(S=="skipThree")for(var F=0;F<3;F++)a.execCommand("goCharRight");else if(S=="surround"){for(var A=a.getSelections(),F=0;F<A.length;F++)A[F]=x+A[F]+j;a.replaceSelections(A,"around"),A=a.listSelections().slice();for(var F=0;F<A.length;F++)A[F]=_(A[F]);a.setSelections(A)}else S=="both"?(a.replaceSelection(x+j,null),a.triggerElectric(x+j),a.execCommand("goCharLeft")):S=="addFour"&&(a.replaceSelection(x+x+x+x,"before"),a.execCommand("goCharRight"))})}function m(a,o){var c=a.getRange(U(o.line,o.ch-1),U(o.line,o.ch+1));return c.length==2?c:null}function u(a,o){var c=a.getTokenAt(U(o.line,o.ch+1));return/\bstring/.test(c.type)&&c.start==o.ch&&(o.ch==0||!/\bstring/.test(a.getTokenTypeAt(o)))}})},F0VM:function(Gt,fe,D){Gt.exports={flex_box_center:"flex_box_center___2fDN3",flex_space_between:"flex_space_between___BHBBv",flex_box_vertical_center:"flex_box_vertical_center___tpxsE",flex_box_center_end:"flex_box_center_end___rP7bQ",flex_box_column:"flex_box_column___1_rF-",md:"md___3SObb",title:"title___HfZ1b"}},FOrL:function(Gt,fe,D){Gt.exports=D.p+"static/nodata.a6b3f948.png"},FWmy:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return q});function q(Y,U){if(!Y)throw new Error(U?`Assertion failed (${U})`:"Assertion Failed")}},Gytx:function(Gt,fe){Gt.exports=function(q,Y,U,G){var M=U?U.call(G,q,Y):void 0;if(M!==void 0)return!!M;if(q===Y)return!0;if(typeof q!="object"||!q||typeof Y!="object"||!Y)return!1;var k=Object.keys(q),K=Object.keys(Y);if(k.length!==K.length)return!1;for(var I=Object.prototype.hasOwnProperty.bind(Y),r=0;r<k.length;r++){var P=k[r];if(!I(P))return!1;var _=q[P],p=Y[P];if(M=U?U.call(G,_,p,P):void 0,M===!1||M===void 0&&_!==p)return!1}return!0}},HmJG:function(Gt,fe,D){},I8Z2:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return G}),D.d(fe,"b",function(){return m}),D.d(fe,"c",function(){return a});var q=D("q1tI"),Y=function(){var o=function(c,s){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var O in n)n.hasOwnProperty(O)&&(i[O]=n[O])},o(c,s)};return function(c,s){o(c,s);function i(){this.constructor=c}c.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),U=q.createContext(null),G=function(o){Y(c,o);function c(){return o!==null&&o.apply(this,arguments)||this}return c.prototype.render=function(){return q.createElement(U.Provider,{value:this.props.store},this.props.children)},c}(q.Component),M=D("Gytx"),k=D.n(M),K=D("2mql"),I=D.n(K),r=function(){var o=function(c,s){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var O in n)n.hasOwnProperty(O)&&(i[O]=n[O])},o(c,s)};return function(c,s){o(c,s);function i(){this.constructor=c}c.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),P=function(){return P=Object.assign||function(o){for(var c,s=1,i=arguments.length;s<i;s++){c=arguments[s];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(o[n]=c[n])}return o},P.apply(this,arguments)};function _(o){return o.displayName||o.name||"Component"}var p=function(){return{}};function m(o,c){c===void 0&&(c={});var s=!!o,i=o||p;return function(O){var T=function(R){r(S,R);function S(v,E){var f=R.call(this,v,E)||this;return f.unsubscribe=null,f.handleChange=function(){if(!f.unsubscribe)return;var h=i(f.store.getState(),f.props);f.setState({subscribed:h})},f.store=f.context,f.state={subscribed:i(f.store.getState(),v),store:f.store,props:v},f}return S.getDerivedStateFromProps=function(v,E){return o&&o.length===2&&v!==E.props?{subscribed:i(E.store.getState(),v),props:v}:{props:v}},S.prototype.componentDidMount=function(){this.trySubscribe()},S.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},S.prototype.shouldComponentUpdate=function(v,E){return!k()(this.props,v)||!k()(this.state.subscribed,E.subscribed)},S.prototype.trySubscribe=function(){s&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},S.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},S.prototype.render=function(){var v=P(P(P({},this.props),this.state.subscribed),{store:this.store});return q.createElement(O,P({},v,{ref:this.props.miniStoreForwardedRef}))},S.displayName="Connect("+_(O)+")",S.contextType=U,S}(q.Component);if(c.forwardRef){var w=q.forwardRef(function(R,S){return q.createElement(T,P({},R,{miniStoreForwardedRef:S}))});return I()(w,O)}return I()(T,O)}}var u=function(){return u=Object.assign||function(o){for(var c,s=1,i=arguments.length;s<i;s++){c=arguments[s];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(o[n]=c[n])}return o},u.apply(this,arguments)};function a(o){var c=o,s=[];function i(T){c=u(u({},c),T);for(var w=0;w<s.length;w++)s[w]()}function n(){return c}function O(T){return s.push(T),function(){var R=s.indexOf(T);s.splice(R,1)}}return{setState:i,getState:n,subscribe:O}}},IBYe:function(Gt,fe,D){"use strict";function q(Y){return null}fe.a=q},J66h:function(Gt,fe,D){(function(q){var Y,U;(function(G,M){Gt.exports=M(G)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof q!="undefined"?q:this,function(G){"use strict";G=G||{};var M=G.Base64,k="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=function(x){for(var j={},F=0,A=x.length;F<A;F++)j[x.charAt(F)]=F;return j}(K),r=String.fromCharCode,P=function(x){if(x.length<2){var j=x.charCodeAt(0);return j<128?x:j<2048?r(192|j>>>6)+r(128|j&63):r(224|j>>>12&15)+r(128|j>>>6&63)+r(128|j&63)}else{var j=65536+(x.charCodeAt(0)-55296)*1024+(x.charCodeAt(1)-56320);return r(240|j>>>18&7)+r(128|j>>>12&63)+r(128|j>>>6&63)+r(128|j&63)}},_=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(x){return x.replace(_,P)},m=function(x){var j=[0,2,1][x.length%3],F=x.charCodeAt(0)<<16|(x.length>1?x.charCodeAt(1):0)<<8|(x.length>2?x.charCodeAt(2):0),A=[K.charAt(F>>>18),K.charAt(F>>>12&63),j>=2?"=":K.charAt(F>>>6&63),j>=1?"=":K.charAt(F&63)];return A.join("")},u=G.btoa&&typeof G.btoa=="function"?function(x){return G.btoa(x)}:function(x){if(x.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return x.replace(/[\s\S]{1,3}/g,m)},a=function(x){return u(p(String(x)))},o=function(x){return x.replace(/[+\/]/g,function(j){return j=="+"?"-":"_"}).replace(/=/g,"")},c=function(x,j){return j?o(a(x)):a(x)},s=function(x){return c(x,!0)},i;G.Uint8Array&&(i=function(x,j){for(var F="",A=0,W=x.length;A<W;A+=3){var H=x[A],C=x[A+1],z=x[A+2],Z=H<<16|C<<8|z;F+=K.charAt(Z>>>18)+K.charAt(Z>>>12&63)+(typeof C!="undefined"?K.charAt(Z>>>6&63):"=")+(typeof z!="undefined"?K.charAt(Z&63):"=")}return j?o(F):F});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(x){switch(x.length){case 4:var j=(7&x.charCodeAt(0))<<18|(63&x.charCodeAt(1))<<12|(63&x.charCodeAt(2))<<6|63&x.charCodeAt(3),F=j-65536;return r((F>>>10)+55296)+r((F&1023)+56320);case 3:return r((15&x.charCodeAt(0))<<12|(63&x.charCodeAt(1))<<6|63&x.charCodeAt(2));default:return r((31&x.charCodeAt(0))<<6|63&x.charCodeAt(1))}},T=function(x){return x.replace(n,O)},w=function(x){var j=x.length,F=j%4,A=(j>0?I[x.charAt(0)]<<18:0)|(j>1?I[x.charAt(1)]<<12:0)|(j>2?I[x.charAt(2)]<<6:0)|(j>3?I[x.charAt(3)]:0),W=[r(A>>>16),r(A>>>8&255),r(A&255)];return W.length-=[0,0,2,1][F],W.join("")},R=G.atob&&typeof G.atob=="function"?function(x){return G.atob(x)}:function(x){return x.replace(/\S{1,4}/g,w)},S=function(x){return R(String(x).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(x){return T(R(x))},E=function(x){return String(x).replace(/[-_]/g,function(j){return j=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(x){return v(E(x))},h;G.Uint8Array&&(h=function(x){return Uint8Array.from(S(E(x)),function(j){return j.charCodeAt(0)})});var y=function(){var x=G.Base64;return G.Base64=M,x};if(G.Base64={VERSION:k,atob:S,btoa:u,fromBase64:f,toBase64:c,utob:p,encode:c,encodeURI:s,btou:T,decode:f,noConflict:y,fromUint8Array:i,toUint8Array:h},typeof Object.defineProperty=="function"){var g=function(x){return{value:x,enumerable:!1,writable:!0,configurable:!0}};G.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",g(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",g(function(x){return c(this,x)})),Object.defineProperty(String.prototype,"toBase64URI",g(function(){return c(this,!0)}))}}return G.Meteor&&(Base64=G.Base64),Gt.exports?Gt.exports.Base64=G.Base64:!(Y=[],U=function(){return G.Base64}.apply(fe,Y),U!==void 0&&(Gt.exports=U)),{Base64:G.Base64}})}).call(this,D("IyRk"))},JYp7:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return q});var q;(function(Y){function U(n){return n&&typeof n=="object"&&typeof n[Symbol.iterator]=="function"}Y.is=U;const G=Object.freeze([]);function M(){return G}Y.empty=M;function*k(n){yield n}Y.single=k;function K(n){return n||G}Y.from=K;function I(n){return!n||n[Symbol.iterator]().next().done===!0}Y.isEmpty=I;function r(n){return n[Symbol.iterator]().next().value}Y.first=r;function P(n,O){for(const T of n)if(O(T))return!0;return!1}Y.some=P;function _(n,O){for(const T of n)if(O(T))return T;return}Y.find=_;function*p(n,O){for(const T of n)O(T)&&(yield T)}Y.filter=p;function*m(n,O){let T=0;for(const w of n)yield O(w,T++)}Y.map=m;function*u(...n){for(const O of n)for(const T of O)yield T}Y.concat=u;function*a(n){for(const O of n)for(const T of O)yield T}Y.concatNested=a;function o(n,O,T){let w=T;for(const R of n)w=O(w,R);return w}Y.reduce=o;function*c(n,O,T=n.length){for(O<0&&(O+=n.length),T<0?T+=n.length:T>n.length&&(T=n.length);O<T;O++)yield n[O]}Y.slice=c;function s(n,O=Number.POSITIVE_INFINITY){const T=[];if(O===0)return[T,n];const w=n[Symbol.iterator]();for(let R=0;R<O;R++){const S=w.next();if(S.done)return[T,Y.empty()];T.push(S.value)}return[T,{[Symbol.iterator](){return w}}]}Y.consume=s;function i(n,O,T=(w,R)=>w===R){const w=n[Symbol.iterator](),R=O[Symbol.iterator]();for(;;){const S=w.next(),v=R.next();if(S.done!==v.done)return!1;if(S.done)return!0;if(!T(S.value,v.value))return!1}}Y.equals=i})(q||(q={}))},LSTS:function(Gt,fe,D){"use strict";Object.defineProperty(fe,"__esModule",{value:!0});var q=function(){function p(m,u){for(var a=0;a<u.length;a++){var o=u[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}return function(m,u,a){return u&&p(m.prototype,u),a&&p(m,a),m}}(),Y=D("q1tI"),U=k(Y),G=D("17x9"),M=k(G);function k(p){return p&&p.__esModule?p:{default:p}}function K(p,m){var u={};for(var a in p){if(m.indexOf(a)>=0)continue;if(!Object.prototype.hasOwnProperty.call(p,a))continue;u[a]=p[a]}return u}function I(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function r(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function P(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var _=function(p){P(m,p);function m(u){I(this,m);var a=r(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,u));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return q(m,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var a=this.getParentElement(this.scrollComponent);a.scrollTop=a.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var a=!1,o={get passive(){a=!0}};try{document.addEventListener("test",null,o),document.removeEventListener("test",null,o)}catch(c){}return a}},{key:"eventListenerOptions",value:function(){var a=this.props.useCapture;return this.isPassiveSupported()&&(a={useCapture:this.props.useCapture,passive:!0}),a}},{key:"setDefaultLoader",value:function(a){this.defaultLoader=a}},{key:"detachMousewheelListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.scrollComponent.parentNode),a.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.getParentElement(this.scrollComponent)),a.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(a){var o=this.props.getScrollParent&&this.props.getScrollParent();return o!=null?o:a&&a.parentNode}},{key:"filterProps",value:function(a){return a}},{key:"attachScrollListener",value:function(){var a=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!a)return;var o=window;this.props.useWindow===!1&&(o=a),o.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),o.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(a){a.deltaY===1&&!this.isPassiveSupported()&&a.preventDefault()}},{key:"scrollListener",value:function(){var a=this.scrollComponent,o=window,c=this.getParentElement(a),s=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,n=o.pageYOffset!==void 0?o.pageYOffset:i.scrollTop;this.props.isReverse?s=n:s=this.calculateOffset(a,n)}else this.props.isReverse?s=c.scrollTop:s=a.scrollHeight-c.scrollTop-c.clientHeight;s<Number(this.props.threshold)&&a&&a.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=c.scrollHeight,this.beforeScrollTop=c.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(a,o){return a?this.calculateTopPosition(a)+(a.offsetHeight-o-window.innerHeight):0}},{key:"calculateTopPosition",value:function(a){return a?a.offsetTop+this.calculateTopPosition(a.offsetParent):0}},{key:"render",value:function(){var a=this,o=this.filterProps(this.props),c=o.children,s=o.element,i=o.hasMore,n=o.initialLoad,O=o.isReverse,T=o.loader,w=o.loadMore,R=o.pageStart,S=o.ref,v=o.threshold,E=o.useCapture,f=o.useWindow,h=o.getScrollParent,y=K(o,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);y.ref=function(x){a.scrollComponent=x,S&&S(x)};var g=[c];return i&&(T?O?g.unshift(T):g.push(T):this.defaultLoader&&(O?g.unshift(this.defaultLoader):g.push(this.defaultLoader))),U.default.createElement(s,y,g)}}]),m}(Y.Component);_.propTypes={children:M.default.node.isRequired,element:M.default.node,hasMore:M.default.bool,initialLoad:M.default.bool,isReverse:M.default.bool,loader:M.default.node,loadMore:M.default.func.isRequired,pageStart:M.default.number,ref:M.default.func,getScrollParent:M.default.func,threshold:M.default.number,useCapture:M.default.bool,useWindow:M.default.bool},_.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},fe.default=_,Gt.exports=fe.default},LdHM:function(Gt,fe,D){"use strict";D.d(fe,"b",function(){return n}),D.d(fe,"a",function(){return T});var q=D("1OyB"),Y=D("vuIU"),U=D("Ji7U"),G=D("LK+K"),M=D("q1tI"),k=D("rePB"),K=D("Ff2n"),I=D("ODXe"),r=D("4IlW"),P=D("bX4T"),_=D("YrtM"),p=D("TSYQ"),m=D.n(p),u=D("+nKL"),a=D("8OUc"),o=function(z,Z){var le=z.prefixCls,se=z.id,Ce=z.flattenOptions,Ee=z.childrenAsData,Ie=z.values,Qe=z.searchValue,Xe=z.multiple,_e=z.defaultActiveFirstOption,pe=z.height,at=z.itemHeight,Qt=z.notFoundContent,Ft=z.open,Tt=z.menuItemSelectedIcon,Ve=z.virtual,pt=z.onSelect,ut=z.onToggleOpen,Ut=z.onActiveValue,oe=z.onScroll,Ue=z.onMouseEnter,ze="".concat(le,"-item"),$e=Object(_.a)(function(){return Ce},[Ft,Ce],function(xt,Ae){return Ae[0]&&xt[1]!==Ae[1]}),Bt=M.useRef(null),Ht=function(Ae){Ae.preventDefault()},qt=function(Ae){Bt.current&&Bt.current.scrollTo({index:Ae})},tt=function(Ae){for(var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,we=$e.length,ie=0;ie<we;ie+=1){var ae=(Ae+ie*ve+we)%we,me=$e[ae],be=me.group,ye=me.data;if(!be&&!ye.disabled)return ae}return-1},nn=M.useState(function(){return tt(0)}),xn=Object(I.a)(nn,2),Ge=xn[0],He=xn[1],vt=function(Ae){He(Ae);var ve=$e[Ae];if(!ve){Ut(null,-1);return}Ut(ve.data.value,Ae)};M.useEffect(function(){vt(_e!==!1?tt(0):-1)},[$e.length,Qe]),M.useEffect(function(){var xt=setTimeout(function(){if(!Xe&&Ft&&Ie.size===1){var Ae=Array.from(Ie)[0],ve=$e.findIndex(function(we){var ie=we.data;return ie.value===Ae});vt(ve),qt(ve)}});return function(){return clearTimeout(xt)}},[Ft]);var Ot=function(Ae){Ae!==void 0&&pt(Ae,{selected:!Ie.has(Ae)}),Xe||ut(!1)};if(M.useImperativeHandle(Z,function(){return{onKeyDown:function(Ae){var ve=Ae.which;switch(ve){case r.a.UP:case r.a.DOWN:{var we=0;if(ve===r.a.UP?we=-1:ve===r.a.DOWN&&(we=1),we!==0){var ie=tt(Ge+we,we);qt(ie),vt(ie)}break}case r.a.ENTER:{var ae=$e[Ge];ae&&!ae.data.disabled?Ot(ae.data.value):Ot(void 0),Ft&&Ae.preventDefault();break}case r.a.ESC:ut(!1)}},onKeyUp:function(){},scrollTo:function(Ae){qt(Ae)}}}),$e.length===0)return M.createElement("div",{role:"listbox",id:"".concat(se,"_list"),className:"".concat(ze,"-empty"),onMouseDown:Ht},Qt);function nt(xt){var Ae=$e[xt];if(!Ae)return null;var ve=Ae.data||{},we=ve.value,ie=ve.label,ae=ve.children,me=Object(P.a)(ve,!0),be=Ee?ae:ie;return Ae?M.createElement("div",Object.assign({"aria-label":typeof be=="string"?be:null},me,{key:xt,role:"option",id:"".concat(se,"_list_").concat(xt),"aria-selected":Ie.has(we)}),we):null}return M.createElement(M.Fragment,null,M.createElement("div",{role:"listbox",id:"".concat(se,"_list"),style:{height:0,width:0,overflow:"hidden"}},nt(Ge-1),nt(Ge),nt(Ge+1)),M.createElement(u.a,{itemKey:"key",ref:Bt,data:$e,height:pe,itemHeight:at,fullHeight:!1,onMouseDown:Ht,onScroll:oe,virtual:Ve,onMouseEnter:Ue},function(xt,Ae){var ve,we=xt.group,ie=xt.groupOption,ae=xt.data,me=ae.label,be=ae.key;if(we)return M.createElement("div",{className:m()(ze,"".concat(ze,"-group"))},me!==void 0?me:be);var ye=ae.disabled,Be=ae.value,St=ae.title,an=ae.children,Dn=ae.style,yt=ae.className,en=Object(K.a)(ae,["disabled","value","title","children","style","className"]),_t=Ie.has(Be),Et="".concat(ze,"-option"),st=m()(ze,Et,yt,(ve={},Object(k.a)(ve,"".concat(Et,"-grouped"),ie),Object(k.a)(ve,"".concat(Et,"-active"),Ge===Ae&&!ye),Object(k.a)(ve,"".concat(Et,"-disabled"),ye),Object(k.a)(ve,"".concat(Et,"-selected"),_t),ve)),he=Ee?an:me,Le=!Tt||typeof Tt=="function"||_t;return M.createElement("div",Object.assign({},en,{"aria-selected":_t,className:st,title:St,onMouseMove:function(){if(Ge===Ae||ye)return;vt(Ae)},onClick:function(){ye||Ot(Be)},style:Dn}),M.createElement("div",{className:"".concat(Et,"-content")},he||Be),M.isValidElement(Tt)||_t,Le&&M.createElement(a.a,{className:"".concat(ze,"-option-state"),customizeIcon:Tt,customizeIconProps:{isSelected:_t}},_t?"\u2713":null))}))},c=M.forwardRef(o);c.displayName="OptionList";var s=c,i=function(){return null};i.isSelectOption=!0;var n=i,O=function(){return null};O.isSelectOptGroup=!0;var T=O,w=D("VTBJ"),R=D("Zm9Q");function S(C){var z=C.key,Z=C.props,le=Z.children,se=Z.value,Ce=Object(K.a)(Z,["children","value"]);return Object(w.a)({key:z,value:se!==void 0?se:z,children:le},Ce)}function v(C){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(C).map(function(Z,le){if(!M.isValidElement(Z)||!Z.type)return null;var se=Z.type.isSelectOptGroup,Ce=Z.key,Ee=Z.props,Ie=Ee.children,Qe=Object(K.a)(Ee,["children"]);return z||!se?S(Z):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?le:Ce,"__"),label:Ce},Qe),{},{options:v(Ie)})}).filter(function(Z){return Z})}var E=D("2Qr1"),f=D("qNPg"),h=D("U8pU"),y=D("Kwbf"),g=D("WKfj");function x(C){var z=C.mode,Z=C.options,le=C.children,se=C.backfill,Ce=C.allowClear,Ee=C.placeholder,Ie=C.getInputElement,Qe=C.showSearch,Xe=C.onSearch,_e=C.defaultOpen,pe=C.autoFocus,at=C.labelInValue,Qt=C.value,Ft=C.inputValue,Tt=C.optionLabelProp,Ve=z==="multiple"||z==="tags",pt=Qe!==void 0?Qe:Ve||z==="combobox",ut=Z||v(le);if(Object(y.a)(z!=="tags"||ut.every(function(ze){return!ze.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Ut=ut.some(function(ze){return ze.options?ze.options.some(function($e){return typeof("value"in $e?$e.value:$e.key)=="number"}):typeof("value"in ze?ze.value:ze.key)=="number"});Object(y.a)(!Ut,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(y.a)(z!=="combobox"||!Tt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(y.a)(z==="combobox"||!se,"`backfill` only works with `combobox` mode."),Object(y.a)(z==="combobox"||!Ie,"`getInputElement` only work with `combobox` mode."),Object(y.b)(z!=="combobox"||!Ie||!Ce||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Xe&&!pt&&z!=="combobox"&&z!=="tags"&&Object(y.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(y.b)(!_e||pe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Qt!=null){var oe=Object(g.d)(Qt);Object(y.a)(!at||oe.every(function(ze){return Object(h.a)(ze)==="object"&&("key"in ze||"value"in ze)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(y.a)(!Ve||Array.isArray(Qt),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var Ue=null;Object(R.a)(le).some(function(ze){if(!M.isValidElement(ze)||!ze.type)return!1;var $e=ze.type;if($e.isSelectOption)return!1;if($e.isSelectOptGroup){var Bt=Object(R.a)(ze.props.children).every(function(Ht){return!M.isValidElement(Ht)||!ze.type||Ht.type.isSelectOption?!0:(Ue=Ht.type,!1)});return!Bt}return Ue=$e,!0}),Ue&&Object(y.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ue.displayName||Ue.name||Ue,"`.")),Object(y.a)(Ft===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=x,F=Object(f.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:v,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:j,fillOptionsWithMissingValue:E.a}),A=function(C){Object(U.a)(Z,C);var z=Object(G.a)(Z);function Z(){var le;return Object(q.a)(this,Z),le=z.apply(this,arguments),le.selectRef=M.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object(Y.a)(Z,[{key:"render",value:function(){return M.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Z}(M.Component);A.Option=n,A.OptGroup=T;var W=A,H=fe.c=W},M8RZ:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return r});var q=D("fWQN"),Y=D("mtLc"),U=D("yKVA"),G=D("879j"),M=D("q1tI"),k=D.n(M),K=D("i8i4"),I=D.n(K),r=function(P){Object(U.a)(p,P);var _=Object(G.a)(p);function p(m){var u;Object(q.a)(this,p),u=_.call(this,m);var a=window.document;return u.node=a.createElement("div"),a.body.appendChild(u.node),u}return Object(Y.a)(p,[{key:"render",value:function(){var u=this.props.children;return Object(K.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(k.a.Component)},MI8n:function(Gt,fe,D){"use strict";D.d(fe,"c",function(){return M}),D.d(fe,"b",function(){return r}),D.d(fe,"e",function(){return P}),D.d(fe,"a",function(){return _}),D.d(fe,"d",function(){return p}),D.d(fe,"f",function(){return m});var q=D("/cxE"),Y=D("pmY6"),U=D("24hK"),G=D("5Y4S"),M;(function(u){u.None=()=>Y.a.None;function a(x){return(j,F=null,A)=>{let W=!1,H;return H=x(C=>W?void 0:(H?H.dispose():W=!0,j.call(F,C)),null,A),W&&H.dispose(),H}}u.once=a;function o(x,j){return T((F,A=null,W)=>x(H=>F.call(A,j(H)),null,W))}u.map=o;function c(x,j){return T((F,A=null,W)=>x(H=>{j(H),F.call(A,H)},null,W))}u.forEach=c;function s(x,j){return T((F,A=null,W)=>x(H=>j(H)&&F.call(A,H),null,W))}u.filter=s;function i(x){return x}u.signal=i;function n(...x){return(j,F=null,A)=>Object(Y.e)(...x.map(W=>W(H=>j.call(F,H),null,A)))}u.any=n;function O(x,j,F){let A=F;return o(x,W=>(A=j(A,W),A))}u.reduce=O;function T(x){let j;const F=new r({onFirstListenerAdd(){j=x(F.fire,F)},onLastListenerRemove(){j.dispose()}});return F.event}function w(x,j,F=100,A=!1,W){let H,C,z,Z=0;const le=new r({leakWarningThreshold:W,onFirstListenerAdd(){H=x(se=>{Z++,C=j(C,se),A&&!z&&(le.fire(C),C=void 0),clearTimeout(z),z=setTimeout(()=>{const Ce=C;C=void 0,z=void 0,(!A||Z>1)&&le.fire(Ce),Z=0},F)})},onLastListenerRemove(){H.dispose()}});return le.event}u.debounce=w;function R(x,j=(F,A)=>F===A){let F=!0,A;return s(x,W=>{const H=F||!j(W,A);return F=!1,A=W,H})}u.latch=R;function S(x,j){return[u.filter(x,j),u.filter(x,F=>!j(F))]}u.split=S;function v(x,j=!1,F=[]){let A=F.slice(),W=x(z=>{A?A.push(z):C.fire(z)});const H=()=>{A&&A.forEach(z=>C.fire(z)),A=null},C=new r({onFirstListenerAdd(){W||(W=x(z=>C.fire(z)))},onFirstListenerDidAdd(){A&&(j?setTimeout(H):H())},onLastListenerRemove(){W&&W.dispose(),W=null}});return C.event}u.buffer=v;class E{constructor(x){this.event=x}map(x){return new E(o(this.event,x))}forEach(x){return new E(c(this.event,x))}filter(x){return new E(s(this.event,x))}reduce(x,j){return new E(O(this.event,x,j))}latch(){return new E(R(this.event))}debounce(x,j=100,F=!1,A){return new E(w(this.event,x,j,F,A))}on(x,j,F){return this.event(x,j,F)}once(x,j,F){return a(this.event)(x,j,F)}}function f(x){return new E(x)}u.chain=f;function h(x,j,F=A=>A){const A=(...z)=>C.fire(F(...z)),W=()=>x.on(j,A),H=()=>x.removeListener(j,A),C=new r({onFirstListenerAdd:W,onLastListenerRemove:H});return C.event}u.fromNodeEventEmitter=h;function y(x,j,F=A=>A){const A=(...z)=>C.fire(F(...z)),W=()=>x.addEventListener(j,A),H=()=>x.removeEventListener(j,A),C=new r({onFirstListenerAdd:W,onLastListenerRemove:H});return C.event}u.fromDOMEventEmitter=y;function g(x){return new Promise(j=>a(x)(j))}u.toPromise=g})(M||(M={}));class k{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${k._idPool++}`}start(u){this._stopWatch=new G.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}k._idPool=0;let K=-1;class I{constructor(u,a=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let a=K;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||u<a)return;this._stacks||(this._stacks=new Map);const o=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),c=this._stacks.get(o)||0;if(this._stacks.set(o,c+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let s,i=0;for(const[n,O]of this._stacks)(!s||i<O)&&(s=n,i=O);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${i}):`),console.warn(s)}return()=>{const s=this._stacks.get(o)||0;this._stacks.set(o,s-1)}}}class r{constructor(u){var a;this._disposed=!1,this._options=u,this._leakageMon=K>0?new I(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new k(this._options._profName):void 0}get event(){return this._event||(this._event=(u,a,o)=>{var c;this._listeners||(this._listeners=new U.a);const s=this._listeners.isEmpty();s&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(a?[u,a]:u);s&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,a);const n=(c=this._leakageMon)===null||c===void 0?void 0:c.check(this._listeners.size),O=Object(Y.i)(()=>{if(n&&n(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return o instanceof Y.b?o.add(O):Array.isArray(o)&&o.push(O),O}),this._event}fire(u){var a,o;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new U.a);for(let c of this._listeners)this._deliveryQueue.push([c,u]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[c,s]=this._deliveryQueue.shift();try{typeof c=="function"?c.call(void 0,s):c[0].call(c[1],s)}catch(i){Object(q.f)(i)}}(o=this._perfMon)===null||o===void 0||o.stop()}}dispose(){var u,a,o,c,s;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(c=(o=this._options)===null||o===void 0?void 0:o.onLastListenerRemove)===null||c===void 0||c.call(o),(s=this._leakageMon)===null||s===void 0||s.dispose())}}class P extends r{constructor(u){super(u);this._isPaused=0,this._eventQueue=new U.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class _ extends P{constructor(u){var a;super(u);this._delay=(a=u.delay)!==null&&a!==void 0?a:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class p{constructor(){this.buffers=[]}wrapEvent(u){return(a,o,c)=>u(s=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>a.call(o,s)):a.call(o,s)},void 0,c)}bufferEvents(u){const a=[];this.buffers.push(a);const o=u();return this.buffers.pop(),a.forEach(c=>c()),o}}class m{constructor(){this.listening=!1,this.inputEvent=M.None,this.inputEventListener=Y.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Gt,fe,D){"use strict";(function(q,Y){D.d(fe,"b",function(){return o}),D.d(fe,"i",function(){return n}),D.d(fe,"f",function(){return O}),D.d(fe,"d",function(){return T}),D.d(fe,"g",function(){return w}),D.d(fe,"h",function(){return R}),D.d(fe,"c",function(){return S}),D.d(fe,"k",function(){return v}),D.d(fe,"j",function(){return E}),D.d(fe,"a",function(){return f}),D.d(fe,"e",function(){return g});var U;const G="en";let M=!1,k=!1,K=!1,I=!1,r=!1,P=!1,_=!1,p,m=G,u,a;const o=typeof self=="object"?self:typeof q=="object"?q:{};let c;typeof o.vscode!="undefined"&&typeof o.vscode.process!="undefined"?c=o.vscode.process:typeof Y!="undefined"&&(c=Y);const s=typeof((U=c==null?void 0:c.versions)===null||U===void 0?void 0:U.electron)=="string"&&c.type==="renderer";if(typeof navigator=="object"&&!s)a=navigator.userAgent,M=a.indexOf("Windows")>=0,k=a.indexOf("Macintosh")>=0,_=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=a.indexOf("Linux")>=0,P=!0,p=navigator.language,m=p;else if(typeof c=="object"){M=c.platform==="win32",k=c.platform==="darwin",K=c.platform==="linux",I=K&&!!c.env.SNAP&&!!c.env.SNAP_REVISION,p=G,m=G;const x=c.env.VSCODE_NLS_CONFIG;if(x)try{const j=JSON.parse(x),F=j.availableLanguages["*"];p=j.locale,m=F||G,u=j._translationsConfigFile}catch(j){}r=!0}else console.error("Unable to resolve platform.");let i=0;k?i=1:M?i=3:K&&(i=2);const n=M,O=k,T=K,w=r,R=P,S=_,v=a,E=function(){if(o.setImmediate)return o.setImmediate.bind(o);if(typeof o.postMessage=="function"&&!o.importScripts){let F=[];o.addEventListener("message",W=>{if(W.data&&W.data.vscodeSetImmediateId)for(let H=0,C=F.length;H<C;H++){const z=F[H];if(z.id===W.data.vscodeSetImmediateId){F.splice(H,1),z.callback();return}}});let A=0;return W=>{const H=++A;F.push({id:H,callback:W}),o.postMessage({vscodeSetImmediateId:H},"*")}}if(typeof(c==null?void 0:c.nextTick)=="function")return c.nextTick.bind(c);const j=Promise.resolve();return F=>j.then(F)}(),f=k||_?2:M?1:3;let h=!0,y=!1;function g(){if(!y){y=!0;const x=new Uint8Array(2);x[0]=1,x[1]=2;const j=new Uint16Array(x.buffer);h=j[0]===(2<<8)+1}return h}}).call(this,D("IyRk"),D("Q2Ig"))},N0LK:function(Gt,fe,D){"use strict";D.d(fe,"C",function(){return q}),D.d(fe,"v",function(){return U}),D.d(fe,"s",function(){return G}),D.d(fe,"t",function(){return M}),D.d(fe,"U",function(){return k}),D.d(fe,"J",function(){return K}),D.d(fe,"O",function(){return I}),D.d(fe,"p",function(){return r}),D.d(fe,"T",function(){return P}),D.d(fe,"q",function(){return _}),D.d(fe,"N",function(){return p}),D.d(fe,"M",function(){return m}),D.d(fe,"Q",function(){return u}),D.d(fe,"u",function(){return a}),D.d(fe,"x",function(){return o}),D.d(fe,"I",function(){return c}),D.d(fe,"f",function(){return s}),D.d(fe,"h",function(){return i}),D.d(fe,"g",function(){return n}),D.d(fe,"i",function(){return O}),D.d(fe,"G",function(){return T}),D.d(fe,"H",function(){return w}),D.d(fe,"r",function(){return R}),D.d(fe,"R",function(){return S}),D.d(fe,"d",function(){return v}),D.d(fe,"e",function(){return E}),D.d(fe,"E",function(){return f}),D.d(fe,"F",function(){return h}),D.d(fe,"j",function(){return y}),D.d(fe,"z",function(){return g}),D.d(fe,"K",function(){return j}),D.d(fe,"L",function(){return F}),D.d(fe,"m",function(){return W}),D.d(fe,"k",function(){return C}),D.d(fe,"A",function(){return Z}),D.d(fe,"a",function(){return le}),D.d(fe,"n",function(){return se}),D.d(fe,"l",function(){return Ce}),D.d(fe,"D",function(){return Ee}),D.d(fe,"B",function(){return Ie}),D.d(fe,"b",function(){return Qe}),D.d(fe,"S",function(){return Xe}),D.d(fe,"o",function(){return _e}),D.d(fe,"P",function(){return pe}),D.d(fe,"w",function(){return at}),D.d(fe,"c",function(){return Qt}),D.d(fe,"y",function(){return Ve});function q(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const Y=/{(\d+)}/g;function U(oe,...Ue){return Ue.length===0?oe:oe.replace(Y,function(ze,$e){const Bt=parseInt($e,10);return isNaN(Bt)||Bt<0||Bt>=Ue.length?ze:Ue[Bt]})}function G(oe){return oe.replace(/[<>&]/g,function(Ue){switch(Ue){case"<":return"<";case">":return">";case"&":return"&";default:return Ue}})}function M(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k(oe,Ue=" "){const ze=K(oe,Ue);return I(ze,Ue)}function K(oe,Ue){if(!oe||!Ue)return oe;const ze=Ue.length;if(ze===0||oe.length===0)return oe;let $e=0;for(;oe.indexOf(Ue,$e)===$e;)$e=$e+ze;return oe.substring($e)}function I(oe,Ue){if(!oe||!Ue)return oe;const ze=Ue.length,$e=oe.length;if(ze===0||$e===0)return oe;let Bt=$e,Ht=-1;for(;!(Ht=oe.lastIndexOf(Ue,Bt-1),Ht===-1||Ht+ze!==Bt);){if(Ht===0)return"";Bt=Ht}return oe.substring(0,Bt)}function r(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function P(oe){return oe.replace(/\*/g,"")}function _(oe,Ue,ze={}){if(!oe)throw new Error("Cannot create regex from empty string");Ue||(oe=M(oe)),ze.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let $e="";return ze.global&&($e+="g"),ze.matchCase||($e+="i"),ze.multiline&&($e+="m"),ze.unicode&&($e+="u"),new RegExp(oe,$e)}function p(oe){if(oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$")return!1;const Ue=oe.exec("");return!!(Ue&&oe.lastIndex===0)}function m(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function u(oe){return oe.split(/\r\n|\r|\n/)}function a(oe){for(let Ue=0,ze=oe.length;Ue<ze;Ue++){const $e=oe.charCodeAt(Ue);if($e!==32&&$e!==9)return Ue}return-1}function o(oe,Ue=0,ze=oe.length){for(let $e=Ue;$e<ze;$e++){const Bt=oe.charCodeAt($e);if(Bt!==32&&Bt!==9)return oe.substring(Ue,$e)}return oe.substring(Ue,ze)}function c(oe,Ue=oe.length-1){for(let ze=Ue;ze>=0;ze--){const $e=oe.charCodeAt(ze);if($e!==32&&$e!==9)return ze}return-1}function s(oe,Ue){return oe<Ue?-1:oe>Ue?1:0}function i(oe,Ue,ze=0,$e=oe.length,Bt=0,Ht=Ue.length){for(;ze<$e&&Bt<Ht;ze++,Bt++){let nn=oe.charCodeAt(ze),xn=Ue.charCodeAt(Bt);if(nn<xn)return-1;if(nn>xn)return 1}const qt=$e-ze,tt=Ht-Bt;return qt<tt?-1:qt>tt?1:0}function n(oe,Ue){return O(oe,Ue,0,oe.length,0,Ue.length)}function O(oe,Ue,ze=0,$e=oe.length,Bt=0,Ht=Ue.length){for(;ze<$e&&Bt<Ht;ze++,Bt++){let nn=oe.charCodeAt(ze),xn=Ue.charCodeAt(Bt);if(nn===xn)continue;if(nn>=128||xn>=128)return i(oe.toLowerCase(),Ue.toLowerCase(),ze,$e,Bt,Ht);T(nn)&&(nn-=32),T(xn)&&(xn-=32);const Ge=nn-xn;if(Ge===0)continue;return Ge}const qt=$e-ze,tt=Ht-Bt;return qt<tt?-1:qt>tt?1:0}function T(oe){return oe>=97&&oe<=122}function w(oe){return oe>=65&&oe<=90}function R(oe,Ue){return oe.length===Ue.length&&O(oe,Ue)===0}function S(oe,Ue){const ze=Ue.length;return Ue.length>oe.length?!1:O(oe,Ue,0,ze)===0}function v(oe,Ue){let ze,$e=Math.min(oe.length,Ue.length);for(ze=0;ze<$e;ze++)if(oe.charCodeAt(ze)!==Ue.charCodeAt(ze))return ze;return $e}function E(oe,Ue){let ze,$e=Math.min(oe.length,Ue.length);const Bt=oe.length-1,Ht=Ue.length-1;for(ze=0;ze<$e;ze++)if(oe.charCodeAt(Bt-ze)!==Ue.charCodeAt(Ht-ze))return ze;return $e}function f(oe){return 55296<=oe&&oe<=56319}function h(oe){return 56320<=oe&&oe<=57343}function y(oe,Ue){return(oe-55296<<10)+(Ue-56320)+65536}function g(oe,Ue,ze){const $e=oe.charCodeAt(ze);if(f($e)&&ze+1<Ue){const Bt=oe.charCodeAt(ze+1);if(h(Bt))return y($e,Bt)}return $e}function x(oe,Ue){const ze=oe.charCodeAt(Ue-1);if(h(ze)&&Ue>1){const $e=oe.charCodeAt(Ue-2);if(f($e))return y($e,ze)}return ze}function j(oe,Ue){const ze=Ft.getInstance(),$e=Ue,Bt=oe.length,Ht=g(oe,Bt,Ue);Ue+=Ht>=65536?2:1;let qt=ze.getGraphemeBreakType(Ht);for(;Ue<Bt;){const tt=g(oe,Bt,Ue),nn=ze.getGraphemeBreakType(tt);if(Qt(qt,nn))break;Ue+=tt>=65536?2:1,qt=nn}return Ue-$e}function F(oe,Ue){const ze=Ft.getInstance(),$e=Ue,Bt=x(oe,Ue);Ue-=Bt>=65536?2:1;let Ht=ze.getGraphemeBreakType(Bt);for(;Ue>0;){const qt=x(oe,Ue),tt=ze.getGraphemeBreakType(qt);if(Qt(tt,Ht))break;Ue-=qt>=65536?2:1,Ht=tt}return $e-Ue}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function W(oe){return A.test(oe)}const H=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function C(oe){return H.test(oe)}const z=/^[\t\n\r\x20-\x7E]*$/;function Z(oe){return z.test(oe)}const le=/[\u2028\u2029]/;function se(oe){return le.test(oe)}function Ce(oe){for(let Ue=0,ze=oe.length;Ue<ze;Ue++)if(Ee(oe.charCodeAt(Ue)))return!0;return!1}function Ee(oe){return oe=+oe,oe>=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function Ie(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const Qe=String.fromCharCode(65279);function Xe(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function _e(oe,Ue=!1){return oe?(Ue&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function pe(oe){const Ue=90-65+1;return oe=oe%(2*Ue),oe<Ue?String.fromCharCode(97+oe):String.fromCharCode(65+oe-Ue)}function at(oe){const Ue=Ft.getInstance();return Ue.getGraphemeBreakType(oe)}function Qt(oe,Ue){return oe===0?Ue!==5&&Ue!==7:oe===2&&Ue===3?!1:oe===4||oe===2||oe===3||(Ue===4||Ue===2||Ue===3)?!0:oe===8&&(Ue===8||Ue===9||Ue===11||Ue===12)||((oe===11||oe===9)&&(Ue===9||Ue===10)||((oe===12||oe===10)&&Ue===10||(Ue===5||Ue===13||(Ue===7||(oe===1||oe===13&&Ue===14)))))?!1:!(oe===6&&Ue===6)}class Ft{constructor(){this._data=Tt()}static getInstance(){return Ft._INSTANCE||(Ft._INSTANCE=new Ft),Ft._INSTANCE}getGraphemeBreakType(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;const Ue=this._data,ze=Ue.length/3;let $e=1;for(;$e<=ze;)if(oe<Ue[3*$e])$e=2*$e;else if(oe>Ue[3*$e+1])$e=2*$e+1;else return Ue[3*$e+2];return 0}}Ft._INSTANCE=null;function Tt(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ve(oe,Ue){if(oe===0)return 0;const ze=pt(oe,Ue);if(ze!==void 0)return ze;const $e=x(Ue,oe);return oe-=ut($e),oe}function pt(oe,Ue){let ze=x(Ue,oe);for(oe-=ut(ze);Ut(ze)||ze===65039||ze===8419;){if(oe===0)return;ze=x(Ue,oe),oe-=ut(ze)}if(!Ie(ze))return;if(oe>=0){const $e=x(Ue,oe);$e===8205&&(oe-=ut($e))}return oe}function ut(oe){return oe>=65536?2:1}function Ut(oe){return 127995<=oe&&oe<=127999}},NLgs:function(Gt,fe,D){"use strict";D.d(fe,"e",function(){return c}),D.d(fe,"f",function(){return s}),D.d(fe,"d",function(){return n}),D.d(fe,"c",function(){return O}),D.d(fe,"a",function(){return T}),D.d(fe,"b",function(){return w});var q=D("miYZ"),Y=D("tsqr"),U=D("9og8"),G=D("2qtc"),M=D("kLXV"),k=D("WmNS"),K=D.n(k),I=D("q1tI"),r=D.n(I),P=D("9kvl"),_=D("xKgJ"),p=D("1vsH"),m=D("RCxd"),u=D("yTi+"),a=D.n(u),o=D("m3rI"),c=function(S){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(s(S)&&i(v))},s=function(S){return Object(_.p)()?!0:(S({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},i=function(){var S,v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(P.c)()._store.getState(),f=E.user;return(S=f.userInfo)!==null&&S!==void 0&&S.profile_completed?!0:(M.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:v?"\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)},n=function(){var S,v=Object(P.c)()._store.getState(),E=v.user;return(S=E.userInfo)!==null&&S!==void 0&&S.professional_certification?!0:(M.a.confirm({title:"\u63D0\u793A",centered:!0,content:r.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.U)("/account/certification")}}),!1)},O=function(){var S;if(Object(_.a)())return!0;var v=Object(P.c)()._store.getState(),E=v.user,f=v.globalSetting;return M.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:o.a.IMG_SERVER+(f==null||((S=f.setting)===null||S===void 0)?void 0:S.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},T=function(S,v){var E;if(S)return!0;var f=Object(P.c)()._store.getState(),h=f.user,y=f.globalSetting;return M.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,v||"\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"),r.a.createElement("div",{style:{marginLeft:"110px"}},r.a.createElement("img",{src:o.a.IMG_SERVER+(y==null||((E=y.setting)===null||E===void 0)?void 0:E.authority_qrcode_url),width:200}),r.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(p.U)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},w=function(S){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(P.c)()._store.getState(),f=E.shixunsDetail.detail;return(f==null?void 0:f.public)===2||(f==null?void 0:f.public)===1||(f==null?void 0:f.shixun_status)===3?(M.a.info({centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(f==null?void 0:f.public)===2?"\u5DF2\u516C\u5F00":(f==null?void 0:f.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",v,"\u3002"),r.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),r.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:a.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(f==null?void 0:f.shixun_status)===2?(M.a.confirm({centered:!0,icon:r.a.createElement(m.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",v,"\u3002"),r.a.createElement("br",null),r.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(){M.a.confirm({width:440,centered:!0,icon:r.a.createElement(m.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 y=Object(U.a)(K.a.mark(function x(){var j;return K.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,S({type:"shixunsDetail/cancelRelease",payload:{id:f==null?void 0:f.identifier}});case 2:j=A.sent,j.status!==401&&(Y.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:f==null?void 0:f.identifier}}),S({type:"practiceSetting/getCommonData",payload:{id:f==null?void 0:f.identifier}}));case 4:case"end":return A.stop()}},x)}));function g(){return y.apply(this,arguments)}return g}()})}}),!0):!1}},Nd3P:function(Gt,fe,D){Gt.exports={wrap:"wrap___h8kK3",maxWidth70:"maxWidth70___31ilo",maxWidth80:"maxWidth80___QYyBn",maxWidth100:"maxWidth100___1Caz0",maxWidth110:"maxWidth110___2Ikef",maxWidth120:"maxWidth120___1TY6-",reviewStatusTooltip:"reviewStatusTooltip___btvLr",color32C:"color32C___3168D",MdEditor:"MdEditor___1md-c",tr1:"tr1___33AUl"}},NvD2:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return k});var q=D("Kwbf");function Y(K,I){var r=new Set;return K.forEach(function(P){I.has(P)||r.add(P)}),r}function U(K){var I=K||{},r=I.disabled,P=I.disableCheckbox,_=I.checkable;return!!(r||P)||_===!1}function G(K,I,r,P){for(var _=new Set(K),p=new Set,m=0;m<=r;m+=1){var u=I.get(m)||new Set;u.forEach(function(s){var i=s.key,n=s.node,O=s.children,T=O===void 0?[]:O;_.has(i)&&!P(n)&&T.filter(function(w){return!P(w.node)}).forEach(function(w){_.add(w.key)})})}for(var a=new Set,o=r;o>=0;o-=1){var c=I.get(o)||new Set;c.forEach(function(s){var i=s.parent,n=s.node;if(P(n)||!s.parent||a.has(s.parent.key))return;if(P(s.parent.node)){a.add(i.key);return}var O=!0,T=!1;(i.children||[]).filter(function(w){return!P(w.node)}).forEach(function(w){var R=w.key,S=_.has(R);O&&!S&&(O=!1),!T&&(S||p.has(R))&&(T=!0)}),O&&_.add(i.key),T&&p.add(i.key),a.add(i.key)})}return{checkedKeys:Array.from(_),halfCheckedKeys:Array.from(Y(p,_))}}function M(K,I,r,P,_){for(var p=new Set(K),m=new Set(I),u=0;u<=P;u+=1){var a=r.get(u)||new Set;a.forEach(function(i){var n=i.key,O=i.node,T=i.children,w=T===void 0?[]:T;!p.has(n)&&!m.has(n)&&!_(O)&&w.filter(function(R){return!_(R.node)}).forEach(function(R){p.delete(R.key)})})}m=new Set;for(var o=new Set,c=P;c>=0;c-=1){var s=r.get(c)||new Set;s.forEach(function(i){var n=i.parent,O=i.node;if(_(O)||!i.parent||o.has(i.parent.key))return;if(_(i.parent.node)){o.add(n.key);return}var T=!0,w=!1;(n.children||[]).filter(function(R){return!_(R.node)}).forEach(function(R){var S=R.key,v=p.has(S);T&&!v&&(T=!1),!w&&(v||m.has(S))&&(w=!0)}),T||p.delete(n.key),w&&m.add(n.key),o.add(n.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Y(m,p))}}function k(K,I,r,P){var _=[],p;P?p=P:p=U;var m=new Set(K.filter(function(c){var s=!!r[c];return s||_.push(c),s})),u=new Map,a=0;Object.keys(r).forEach(function(c){var s=r[c],i=s.level,n=u.get(i);n||(n=new Set,u.set(i,n)),n.add(s),a=Math.max(a,i)}),Object(q.a)(!_.length,"Tree missing follow keys: ".concat(_.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var o;return I===!0?o=G(m,u,a,p):o=M(m,I.halfCheckedKeys,u,a,p),o}},OH33:function(Gt,fe,D){"use strict";D.r(fe);var q=D("g9YV"),Y=D("wCAj"),U=D("Znn+"),G=D("ZTPi"),M=D("5Dmo"),k=D("3S7+"),K=D("sPJy"),I=D("bE4q"),r=D("+L6B"),P=D("2/Rp"),_=D("miYZ"),p=D("tsqr"),m=D("9og8"),u=D("2qtc"),a=D("kLXV"),o=D("tJVT"),c=D("WmNS"),s=D.n(c),i=D("q1tI"),n=D.n(i),O=D("ErOA"),T=D("Ty5D"),w=D("55Ip"),R=D("9kvl"),S=D("jhfD"),v=D("1vsH"),E=D("T2oS"),f=D("W9HT"),h=D("DjyN"),y=D("NUBc"),g=D("k1fw"),x=D("9Bee"),j=function(yn){var Sn=yn.shixunHomeworks,En=yn.dispatch,ur=Object(T.i)();return n.a.createElement(a.a,{centered:!0,title:"\u63D0\u793A",visible:Sn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function sr(){var Q;return s.a.wrap(function(Te){for(;;)switch(Te.prev=Te.next){case 0:return Te.next=2,En({type:"shixunHomeworks/deleteReply",payload:{object_id:Sn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Q=Te.sent,Q.status===0&&(p.b.success("\u5220\u9664\u6210\u529F"),En({type:"shixunHomeworks/setActionTabs",payload:{}}),En({type:"shixunHomeworks/getReplyList",payload:Object(g.a)({},Sn.actionTabs.params)}));case 4:case"end":return Te.stop()}},sr)})),onCancel:function(){En({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},F=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks;return{shixunHomeworks:yn}})(j),A=D("wd/R"),W=D.n(A),H=D("iF7n"),C=D.n(H),z=D("xKgJ"),Z=D("BdwD");W.a.lang("ZH-cn");var le=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],se=function(yn){var Sn,En,ur=yn.shixunHomeworks,sr=yn.classroomList,Q=yn.globalSetting,de=yn.user,Te=yn.loading,Se=yn.dispatch,rt=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(T.i)()),{},{per_page:10})),De=Object(o.a)(rt,2),Je=De[0],it=De[1],At=Object(i.useState)([]),Ct=Object(o.a)(At,2),We=Ct[0],gt=Ct[1],ot=Object(i.useState)(-1),dt=Object(o.a)(ot,2),wt=dt[0],kt=dt[1],mt=Object(i.useState)(""),$t=Object(o.a)(mt,2),hn=$t[0],Pn=$t[1],Gn=Object(i.useState)(""),On=Object(o.a)(Gn,2),Nn=On[0],Mn=On[1],Pt=sr.detailLeftMenus,fn=Object(T.h)(),Wt=Object(i.useState)({}),Rt=Object(o.a)(Wt,2),Un=Rt[0],Rn=Rt[1],Yt=ur.workDetail,ht=ur.workList,jn=Object(i.useState)("1"),pn=Object(o.a)(jn,2),qn=pn[0],Zt=pn[1],An=Object(i.useState)(!1),Fn=Object(o.a)(An,2),vn=Fn[0],yr=Fn[1];Object(i.useEffect)(function(){ht.homework_status&&Ln()},[ht]);function Ln(){return Cn.apply(this,arguments)}function Cn(){return Cn=Object(m.a)(s.a.mark(function Dt(){var Ze,It,Mt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return yr(!0),zn.next=3,Object(O.a)("/api/courses/".concat(Je.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(g.a)(Object(g.a)({},Je),{},{id:Je.categoryId})});case 3:Mt=zn.sent,gt(Mt),yr(!1),Je.defaultExpandedRowKeys=["".concat(Mt==null||((Ze=Mt.data)===null||Ze===void 0||((It=Ze[0])===null||It===void 0))?void 0:It.identifier)],qn!="2"&&Zt(Mt!=null&&Mt.description?"1":"2"),it(Object(g.a)({},Je));case 9:case"end":return zn.stop()}},Dt)})),Cn.apply(this,arguments)}return n.a.createElement("section",{className:C.a.bg},n.a.createElement(f.a,{spinning:vn},n.a.createElement(G.a,{onChange:function(Ze){Zt(Ze)},activeKey:qn},n.a.createElement(G.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(We!=null&&We.description)&&n.a.createElement(Z.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(x.a,{value:(We==null?void 0:We.description)||""}))),n.a.createElement(G.a.TabPane,{key:2,tab:"\u9898\u76EE\u5217\u8868"},n.a.createElement("div",null,n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},Je.defaultExpandedRowKeys&&n.a.createElement(Y.a,{dataSource:We==null?void 0:We.data,rowKey:function(Ze){return Ze==null?void 0:Ze.identifier},pagination:!1,expandable:{expandedRowRender:function(Ze){var It,Mt;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",Ze==null?void 0:Ze.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",Ze==null?void 0:Ze.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(z.c)()&&(We==null||((It=We.homework_status)===null||It===void 0)?void 0:It.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(P.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(Ze==null?void 0:Ze.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[Je.coursesId,Je.categoryId])}},"\u7F16\u8F91"),Object(z.c)()&&(We==null||((Mt=We.homework_status)===null||Mt===void 0)?void 0:Mt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(P.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){a.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var zn=Object(m.a)(s.a.mark(function lr(){var nr;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,Object(O.a)("/api/problems/".concat(Ze==null?void 0:Ze.identifier,".json"),{method:"delete"});case 2:nr=mr.sent,(nr==null?void 0:nr.status)===0&&(p.b.info("\u5220\u9664\u6210\u529F"),Je.page=1,Ln());case 4:case"end":return mr.stop()}},lr)}));function kn(){return zn.apply(this,arguments)}return kn}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:Je.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(Ze,It,Mt){return n.a.createElement("div",null,le[Ze])}},{title:"\u901A\u8FC7\u7387",dataIndex:"pass_rate",key:"pass_rate"},{title:"\u901A\u8FC7\u4EBA\u6570",dataIndex:"submit_info",key:"submit_info"},{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline",ellipsis:!0,width:"10%",key:"tag_discipline"},{title:"\u64CD\u4F5C",dataIndex:"identifier",key:"identifier",render:function(Ze,It,Mt){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat(Je.coursesId,"/program_homework/").concat(Je.categoryId,"/").concat(Ze,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function cn(){var zn;return s.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return lr.next=2,Object(O.a)("/api/problems/".concat(It==null?void 0:It.identifier,"/start.json"),{method:"get"});case 2:zn=lr.sent,zn&&(window.open("/myproblems/".concat(zn==null?void 0:zn.identifier,"?type=1")),localStorage.setItem("program_homework",[Je.coursesId,Je.categoryId]));case 4:case"end":return lr.stop()}},cn)})),style:{margin:"0px 20px"}},Object(z.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(We==null||((Sn=We.data)===null||Sn===void 0||((En=Sn[0])===null||En===void 0))?void 0:En.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(y.a,{defaultCurrent:1,total:We==null?void 0:We.count,hideOnSinglePage:!0,showTotal:function(Ze){return n.a.createElement("span",null,"\u5171",Ze,"\u6761")},current:Je.page||1,pageSize:Je.per_page||10,onChange:function(Ze,It){Je.page=Ze,Je.per_page=It,it(Object(g.a)({},Je)),Ln()}})))))),n.a.createElement(F,null))},Ce=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.classroomList,En=Hn.loading,ur=Hn.user,sr=Hn.globalSetting;return{shixunHomeworks:yn,globalSetting:sr,classroomList:Sn,user:ur,loading:En.effects}})(se),Ee=D("oBTY"),Ie=D("giR+"),Qe=D("fyUT"),Xe=D("7Kak"),_e=D("9yH6"),pe=D("qVdP"),at=D("jsC+"),Qt=D("5NDa"),Ft=D("5rEg"),Tt=D("14J3"),Ve=D("BMrR"),pt=D("sRBo"),ut=D("kaz8"),Ut=D("jCWc"),oe=D("kPKH"),Ue=D("lUTK"),ze=D("BvKs"),$e=D("jrin"),Bt=D("y8nQ"),Ht=D("Vl3Y"),qt=D("8Skl"),tt=D("y3Kf"),nn=D("Llu2"),xn=D("0NbB"),Ge=D("T7RX"),He=D("PpiC"),vt=D("IMoZ"),Ot=function(yn){var Sn=yn.shixunHomeworks,En=yn.dispatch,ur=Object(He.a)(yn,["shixunHomeworks","dispatch"]),sr=Object(T.i)(),Q=Object(i.useState)(!0),de=Object(o.a)(Q,2),Te=de[0],Se=de[1],rt=Object(i.useState)(!1),De=Object(o.a)(rt,2),Je=De[0],it=De[1],At=Ht.a.useForm(),Ct=Object(o.a)(At,1),We=Ct[0],gt=function(){var ot=Object(m.a)(s.a.mark(function dt(){var wt,kt;return s.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return wt=We.getFieldValue(),$t.next=3,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(Ee.a)(Sn.actionTabs.selectArrs),cover_all:Te,hidden_comment:wt.hidden_comment,comment:wt.comment}});case 3:kt=$t.sent,kt.status===0&&(p.b.success("\u8BC4\u9605\u6210\u529F"),We.resetFields(),En({type:"shixunHomeworks/setActionTabs",payload:{}}),En({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Sn.actionTabs.params)}));case 5:case"end":return $t.stop()}},dt)}));return function(){return ot.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:Sn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function ot(){var dt;return s.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:dt=We.getFieldValue(),JSON.stringify(dt)==="{}"||dt.hidden_comment===""&&dt.comment===""?it(!0):Sn.workList.partial_comment?En({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:Sn.actionTabs.selectArrs,params:Sn.actionTabs.params}}):gt();case 2:case"end":return kt.stop()}},ot)})),onCancel:function(){En({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Ht.a,{form:We,onChange:function(){Je&&it(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ht.a.Item,{name:"comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ht.a.Item,{name:"hidden_comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Je&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(a.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(vt.a,{className:"c-orange mr20"}),"\u63D0\u793A"),visible:Sn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:function(){gt()},onCancel:function(){En({type:"shixunHomeworks/setActionTabs",payload:{}})},width:400},n.a.createElement("div",{className:"tc"},n.a.createElement("p",null,"\u90E8\u5206\u5B66\u751F\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF0C\u662F\u5426\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF1F"),n.a.createElement("p",null,n.a.createElement(_e.a.Group,{onChange:function(dt){Se(dt.target.value)},value:Te},n.a.createElement(_e.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(_e.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},nt=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks;return{shixunHomeworks:yn}})(Ot),xt=D("XYT7"),Ae=D("Nd3P"),ve=D.n(Ae),we=function(yn){var Sn,En,ur,sr,Q=yn.shixunHomeworks,de=yn.dispatch,Te=Object(He.a)(yn,["shixunHomeworks","dispatch"]),Se=Object(T.i)(),rt=Object(i.useState)(!1),De=Object(o.a)(rt,2),Je=De[0],it=De[1],At=Object(i.useState)((Sn=Q.actionTabs.selectArrs)===null||Sn===void 0||((En=Sn.data)===null||En===void 0)?void 0:En.name),Ct=Object(o.a)(At,2),We=Ct[0],gt=Ct[1],ot=Ht.a.useForm(),dt=Object(o.a)(ot,1),wt=dt[0];Object(i.useEffect)(function(){var mt,$t,hn,Pn,Gn,On;Q.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&wt.setFieldsValue({comment:(mt=Q.actionTabs.selectArrs)===null||mt===void 0||(($t=mt.data)===null||$t===void 0)?void 0:$t.work_comment,hidden_comment:(hn=Q.actionTabs.selectArrs)===null||hn===void 0||((Pn=hn.data)===null||Pn===void 0)?void 0:Pn.work_comment_hidden}),gt((Gn=Q.actionTabs.selectArrs)===null||Gn===void 0||((On=Gn.data)===null||On===void 0)?void 0:On.name)},[Q.actionTabs.key]);var kt=function(){var mt=Object(m.a)(s.a.mark(function $t(){var hn,Pn,Gn,On;return s.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Gn=wt.getFieldValue(),Mn.next=3,Object(O.a)("/api/student_works/".concat((hn=Q.actionTabs.selectArrs)===null||hn===void 0||((Pn=hn.data)===null||Pn===void 0)?void 0:Pn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:Gn.hidden_comment,comment:Gn.comment}});case 3:if(On=Mn.sent,!(On.status===0)){Mn.next=9;break}return p.b.success("\u8BC4\u9605\u6210\u529F"),wt.resetFields(),de({type:"shixunHomeworks/setActionTabs",payload:{}}),Mn.abrupt("return",de({type:"shixunHomeworks/getWorkList",payload:Se}));case 9:case"end":return Mn.stop()}},$t)}));return function(){return mt.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:(ur=Q.actionTabs.selectArrs)!==null&&ur!==void 0&&(sr=ur.data)!==null&&sr!==void 0&&sr.work_comment_hidden?"\u66F4\u6539"+We+"\u70B9\u8BC4":We+"\u70B9\u8BC4",visible:Q.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function mt(){var $t;return s.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:$t=wt.getFieldValue(),JSON.stringify($t)==="{}"||$t.hidden_comment===""&&$t.comment===""?it(!0):kt();case 2:case"end":return Pn.stop()}},mt)})),onCancel:function(){de({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Ht.a,{form:wt,onChange:function(){Je&&it(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ht.a.Item,{name:"comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Ht.a.Item,{name:"hidden_comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Je&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},ie=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks;return{shixunHomeworks:yn}})(we),ae=function(yn){var Sn=yn.shixunHomeworks,En=yn.dispatch,ur=Object(He.a)(yn,["shixunHomeworks","dispatch"]),sr=Object(T.i)(),Q=Object(i.useState)([]),de=Object(o.a)(Q,2),Te=de[0],Se=de[1],rt=Object(i.useState)([]),De=Object(o.a)(rt,2),Je=De[0],it=De[1];Object(i.useEffect)(function(){Sn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&At()},[Sn.actionTabs.key]);function At(){return Ct.apply(this,arguments)}function Ct(){return Ct=Object(m.a)(s.a.mark(function gt(){var ot;return s.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:ot=wt.sent,Se(ot);case 4:case"end":return wt.stop()}},gt)})),Ct.apply(this,arguments)}var We=[{title:"\u5206\u73ED\u60C5\u51B5",dataIndex:"name"},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u68C0\u6D4B\u8FDB\u5EA6",dataIndex:"status"},{title:"\u4E0A\u6B21\u8BC4\u5206\u65F6\u95F4",dataIndex:"last_analysis_time"}];return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:"\u4EE3\u7801\u8D28\u91CF\u8BC4\u5206",visible:Sn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B",width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function gt(){var ot;return s.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:Je}});case 2:ot=wt.sent,(ot==null?void 0:ot.status)===0&&(R.d.replace("/classrooms/".concat(sr.coursesId,"/shixun_homework/").concat(sr.categoryId,"/detail?tabs=4")),window.location.reload(),En({type:"shixunHomeworks/setActionTabs",payload:{}}),it([]));case 4:case"end":return wt.stop()}},gt)})),onCancel:function(){it([]),En({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Y.a,{rowSelection:{type:"checkbox",onChange:function(ot,dt){it(Object(Ee.a)(ot))},selectedRowKeys:Je,getCheckboxProps:function(ot){return{disabled:ot.status==="\u8FDB\u884C\u4E2D"||ot.works_count===0}}},rowKey:function(ot){return ot.key||ot.id},scroll:{y:300},pagination:!1,columns:We,dataSource:Te==null?void 0:Te.group_list})))},me=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks;return{shixunHomeworks:yn}})(ae),be=D("Ot1p"),ye=D("mgmH"),Be=function(yn){var Sn,En,ur,sr,Q,de,Te,Se,rt,De=yn.shixunHomeworks,Je=yn.loading,it=yn.dispatch,At=yn.setExportParams,Ct=yn.user,We=Object(T.i)(),gt=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),We)),ot=Object(o.a)(gt,2),dt=ot[0],wt=ot[1],kt=Ht.a.useForm(),mt=Object(o.a)(kt,1),$t=mt[0],hn=Object(i.useState)(),Pn=Object(o.a)(hn,2),Gn=Pn[0],On=Pn[1],Nn=Object(i.useState)({}),Mn=Object(o.a)(Nn,2),Pt=Mn[0],fn=Mn[1],Wt=Object(i.useState)([]),Rt=Object(o.a)(Wt,2),Un=Rt[0],Rn=Rt[1],Yt=Object(i.useState)(!1),ht=Object(o.a)(Yt,2),jn=ht[0],pn=ht[1],qn=Object(i.useState)([]),Zt=Object(o.a)(qn,2),An=Zt[0],Fn=Zt[1],vn=Object(i.useState)(!1),yr=Object(o.a)(vn,2),Ln=yr[0],Cn=yr[1],Dt=Object(i.useState)(),Ze=Object(o.a)(Dt,2),It=Ze[0],Mt=Ze[1],cn=Object(i.useState)(1),zn=Object(o.a)(cn,2),kn=zn[0],lr=zn[1],nr=Object(i.useState)(),Or=Object(o.a)(nr,2),mr=Or[0],Er=Or[1],Zr=Object(i.useState)(),Yr=Object(o.a)(Zr,2),Jr=Yr[0],vi=Yr[1],_i=Object(i.useState)(),xe=Object(o.a)(_i,2),je=xe[0],Ye=xe[1],Oe=Object(i.useState)(),re=Object(o.a)(Oe,2),ge=re[0],ce=re[1],Re=Object(i.useState)(),Me=Object(o.a)(Re,2),qe=Me[0],Ne=Me[1],lt=Object(i.useState)(!1),Nt=Object(o.a)(lt,2),on=Nt[0],mn=Nt[1],Wn=Object(T.h)();Object(i.useEffect)(function(){return Vn(!0),function(){fn([]),Rn([])}},[dt.coursesId]),Object(i.useEffect)(function(){var gn,rn=JSON.parse(JSON.stringify(De.workList));!(rn!=null&&(gn=rn.student_works)!==null&&gn!==void 0&&gn.length)&&rn!==null&&rn!==void 0&&rn.id?(rn.student_works=[Object(g.a)({},rn)],fn(rn)):(rn!=null&&rn.id&&Rn([Object(g.a)(Object(g.a)({},rn),{number:"\u6211"})]),fn(Object(g.a)({},rn)))},[De.workList]);var Vn=function(rn){At(Object(g.a)({},dt));var wn=it({type:"shixunHomeworks/getWorkList",payload:dt});return rn&&wn.then(function(zt){var Vt,pr,Pr;(zt!=null&&(Vt=zt.homework_status)!==null&&Vt!==void 0&&Vt.includes("\u8FDB\u884C\u4E2D")||zt!=null&&(pr=zt.homework_status)!==null&&pr!==void 0&&pr.includes("\u8865\u4EA4\u4E2D")||zt!=null&&(Pr=zt.homework_status)!==null&&Pr!==void 0&&Pr.includes("\u63D0\u4EA4\u4E2D"))&&!Object(z.s)()&&cr()}),wn};Object(i.useEffect)(function(){fr()},[]);var fr=function(){var gn=Object(m.a)(s.a.mark(function rn(){var wn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Vt.next=2,Object(xt.I)({categoryId:We.categoryId});case 2:wn=Vt.sent,On(wn==null?void 0:wn.update_score);case 4:case"end":return Vt.stop()}},rn)}));return function(){return gn.apply(this,arguments)}}(),cr=function(){var gn=Object(m.a)(s.a.mark(function rn(){var wn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return it({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),Vt.next=3,Object(xt.Z)({categoryId:We.categoryId});case 3:wn=Vt.sent,it({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(wn==null?void 0:wn.status)===0&&(p.b.success(wn==null?void 0:wn.message),Vn());case 6:case"end":return Vt.stop()}},rn)}));return function(){return gn.apply(this,arguments)}}(),xr=function(){dt.page=1;var rn=Object.assign({},$t.getFieldValue());delete dt.course_group,delete dt.teacher_comment,Object.keys(rn).map(function(wn){switch(wn){case"task_status":rn[wn].includes("all")||!rn[wn].length?(delete dt.work_status,$t.setFieldsValue(Object($e.a)({},"task_status","all"))):(dt.work_status=rn[wn],$t.setFieldsValue(Object($e.a)({},"task_status",dt.work_status)));break;case"course_group_info":rn[wn].includes("all")||!rn[wn].length?(delete dt.course_group,$t.setFieldsValue(Object($e.a)({},"course_group_info","all"))):(dt.course_group=rn[wn],$t.setFieldsValue(Object($e.a)({},"course_group_info",dt.course_group)));break;case"teacher_comment":if(rn[wn].includes("all")||!rn[wn].length)delete dt.teacher_comment,$t.setFieldsValue(Object($e.a)({},"teacher_comment","all"));else{var zt;dt.teacher_comment=((zt=rn[wn])===null||zt===void 0?void 0:zt.length)===1?Number(rn[wn][0]):"",$t.setFieldsValue(Object($e.a)({},"teacher_comment",rn[wn]))}break}}),Vn()};Object(i.useEffect)(function(){if(document.getElementById("divhe")){var gn=document.getElementById("divhe").scrollHeight;gn>47&&(Ne(47),mn(!0))}},[document.getElementById("divhe")]);var Rr=function(rn,wn){dt.page=rn,dt.limit=20,Vn()};function gr(){lr(1),Er(""),vi(""),Ye(""),ce(""),Fn([])}var wr=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(rn,wn,zt){return dt.limit*(dt.page-1)+zt+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(rn){return n.a.createElement(k.a,{placement:"bottomLeft",title:rn},n.a.createElement("span",{className:"current"},rn))}},!(Pt!=null&&Pt.is_excellent)&&!Object(z.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:dt.order==="student_id"?dt.b_order==="desc"?"descend":"ascend":null,render:function(rn){return n.a.createElement(k.a,{placement:"bottomLeft",title:rn||"--"},n.a.createElement("span",{className:"current"},rn||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(rn,wn){return rn?n.a.createElement(k.a,{placement:"bottom",title:rn},n.a.createElement("span",{className:"current"},rn)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:dt.order==="work_status"?dt.b_order==="desc"?"descend":"ascend":null,render:function(rn){return n.a.createElement(v.h,{status:rn})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(rn,wn){return n.a.createElement(k.a,{placement:"bottomLeft",title:rn},n.a.createElement("span",{className:"current"},rn))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(rn,wn){return n.a.createElement("span",null,rn||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(rn,wn){return n.a.createElement("span",null,rn||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(rn,wn){return rn&&rn!="--"?n.a.createElement(k.a,{placement:"bottom",title:rn},n.a.createElement("span",{className:"current"},rn)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(rn){return rn?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(rn,wn){return Object(z.s)()?n.a.createElement("div",null,Object(v.D)(wn==null?void 0:wn.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(w.a,{target:"_blank",onClick:function(Vt){Vt.stopPropagation()},to:"/classrooms/".concat(dt.coursesId,"/program_homework/").concat(dt.categoryId,"/").concat(wn.id,"/").concat(wn.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(Vt){var pr;if(Vt.stopPropagation(),(pr=Ct.userInfo)!==null&&pr!==void 0&&pr.professional_certification)window.open("/classrooms/".concat(dt.coursesId,"/program_homework/").concat(dt.categoryId,"/").concat(wn.id,"/").concat(wn.user_id,"/comment"),"_blank");else return a.a.confirm({title:"\u63D0\u793A",centered:!0,content:n.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(v.U)("/account/certification")}}),!1}},"\u67E5\u770B\u4F5C\u4E1A")}}].filter(function(gn){return!!gn}),Lr=function(){return n.a.createElement(ze.a,null,n.a.createElement(ze.a.Item,{onClick:function(){Object(ye.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(ze.a.Item,{key:"2"},n.a.createElement(w.a,{to:"/classrooms/".concat(dt.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(ve.a.wrap," minH500 bg-white pl30 pr30 pt30")},((Sn=Pt.homework_status)===null||Sn===void 0?void 0:Sn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(Z.a,null),!((En=Pt.homework_status)!==null&&En!==void 0&&En.includes("\u672A\u53D1\u5E03"))&&n.a.createElement("aside",null,!Object(z.c)()&&n.a.createElement("div",{className:"c-light-black font12"},n.a.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4 ",Pt==null?void 0:Pt.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",Pt==null?void 0:Pt.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(Pt==null?void 0:Pt.late_time)||"- -")),Object(z.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Ht.a,{form:$t,onChange:xr,initialValues:(ur={},Object($e.a)(ur,"task_status","all"),Object($e.a)(ur,"course_group_info","all"),Object($e.a)(ur,"teacher_comment","all"),ur)},((sr=Pt.task_status)===null||sr===void 0?void 0:sr.length)>0&&n.a.createElement(Ht.a.Item,{name:"task_status"},n.a.createElement(ut.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ut.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1"},Pt.task_status&&Pt.task_status.map(function(gn,rn){return n.a.createElement(ut.a,{name:"task_status",value:gn.id},gn.name,"(",gn.count,")")}))))),((Q=Pt.course_group_info)===null||Q===void 0?void 0:Q.length)>0&&n.a.createElement(Ht.a.Item,{name:"course_group_info"},n.a.createElement(ut.a.Group,{style:{width:"100%"}},n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ut.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1",id:"divhe",style:{height:qe+"px",overflow:"hidden"}},(de=Pt.course_group_info)===null||de===void 0?void 0:de.map(function(gn,rn){return n.a.createElement(ut.a,{value:gn.course_group_id},gn.group_group_name,"(",gn.count,")")})),on&&n.a.createElement("span",{onClick:function(){var rn=document.getElementById("divhe").scrollHeight;qe>47?Ne(47):Ne(rn)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},qe===47?"\u5C55\u5F00":"\u6536\u8D77",qe===47?n.a.createElement(qt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(tt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((Te=Pt.teacher_comment)===null||Te===void 0?void 0:Te.length)>0&&n.a.createElement(Ht.a.Item,{name:"teacher_comment"},n.a.createElement(ut.a.Group,{style:{width:"100%"}},n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ut.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1"},Pt.teacher_comment&&Pt.teacher_comment.map(function(gn,rn){return n.a.createElement(ut.a,{value:String(gn.id)},gn.name,"(",gn.count,")")})))))),n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(oe.a,null,n.a.createElement(Ft.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(rn){dt.search=rn,dt.page=1,Vn()},style:{width:240}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},Pt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Pt.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(oe.a,null,Object(z.c)()&&n.a.createElement(P.a,{className:"ml10",onClick:function(){it({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Pt.student_works.map(function(rn){return rn.id}),params:dt}})}},n.a.createElement("span",{className:"".concat(ve.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(z.c)()&&n.a.createElement(P.a,{className:"ml10",onClick:cr},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(z.c)()&&n.a.createElement(at.a,{overlay:Lr,className:"ml10"},n.a.createElement(P.a,null,n.a.createElement(nn.a,null),"\u5BFC\u51FA",n.a.createElement(xn.a,null)))))),n.a.createElement(Ve.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(z.c)()&&Gn&&n.a.createElement("span",null,n.a.createElement("span",{style:{color:"red"}},"*"),"\u5217\u8868\u4E2D\u4F5C\u4E1A\u8BB0\u5F55\u5B58\u5728\u5DEE\u5F02\uFF0C\u8BF7\u70B9\u51FB\u201C\u66F4\u65B0\u6210\u7EE9\u201D\u6309\u94AE")),n.a.createElement(Y.a,{className:"mt30",loading:Je["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(rn){return{onClick:function(zt){window.open("/classrooms/".concat(dt.coursesId,"/program_homework/").concat(dt.categoryId,"/").concat(rn.id,"/").concat(rn.user_id,"/comment"),"_blank")}}},dataSource:Pt.student_works,columns:wr,onChange:function(rn,wn,zt){zt.field&&(dt.order=zt.field),zt.order||(dt.b_order="asc"),zt.order==="ascend"&&(dt.b_order="asc"),zt.order==="descend"&&(dt.b_order="desc"),zt.order||(dt.b_order="asc"),Vn()}}),n.a.createElement(nt,null),n.a.createElement(ie,null),n.a.createElement(Ge.a,null)),n.a.createElement(a.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:jn,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(m.a)(s.a.mark(function gn(){var rn,wn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(!(kn===2)){Vt.next=13;break}if(!(An.length<=0)){Vt.next=4;break}return p.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),Vt.abrupt("return");case 4:if(ge){Vt.next=7;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 7:return Vt.next=9,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,status:An}});case 9:rn=Vt.sent,rn.status===0&&(Mt(rn),pn(!1),Cn(!0)),Vt.next=32;break;case 13:if(!(je===0||Jr===0)){Vt.next=16;break}Vt.next=22;break;case 16:if(je){Vt.next=19;break}return p.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 19:if(Jr){Vt.next=22;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 22:if(!(je>Jr)){Vt.next=25;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),Vt.abrupt("return");case 25:if(ge){Vt.next=28;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 28:return Vt.next=30,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,min_score:je,max_score:Jr}});case 30:wn=Vt.sent,wn.status===0&&(Mt(wn),pn(!1),Cn(!0));case 32:case"end":return Vt.stop()}},gn)})),onCancel:function(){pn(!1),gr()}},n.a.createElement("div",{style:{padding:"32px"}},n.a.createElement("div",null,n.a.createElement("div",null,n.a.createElement("span",{style:{width:"80px"}},"\u6253\u56DE\u65B9\u5F0F\uFF1A"),n.a.createElement(_e.a.Group,{value:kn,onChange:function(rn){lr(rn.target.value)}},n.a.createElement(_e.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(_e.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),kn===1&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),n.a.createElement(Qe.a,{min:0,max:100,value:je,onChange:function(rn){return Ye(rn)},style:{width:"100px"}}),n.a.createElement("span",{style:{width:"80px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),n.a.createElement(Qe.a,{min:0,max:100,value:Jr,onChange:function(rn){return vi(rn)},style:{width:"100px"}})),kn===2&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"80px"}},"\u4F5C\u4E1A\u72B6\u6001\uFF1A"),n.a.createElement(ut.a.Group,{onChange:function(rn){Fn(Object(Ee.a)(rn))},style:{width:"100%"}},(Se=Pt.task_status)===null||Se===void 0?void 0:Se.map(function(gn,rn){return n.a.createElement(ut.a,{name:"task_status",value:gn.id},gn.name,"(",gn.count,")")}))),n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*")," \u8BC4\u8BED\uFF1A"),n.a.createElement(be.a,{className:ve.a.MdEditor,onChange:function(rn){return ce(rn)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(a.a,{visible:Ln,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(m.a)(s.a.mark(function gn(){var rn,wn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(!(kn===2)){Vt.next=7;break}return Vt.next=3,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,status:An}});case 3:rn=Vt.sent,rn.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),gr(),Vn(),Cn(!1)),Vt.next=11;break;case 7:return Vt.next=9,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,min_score:je,max_score:Jr}});case 9:wn=Vt.sent,wn.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),gr(),Vn(),Cn(!1));case 11:case"end":return Vt.stop()}},gn)})),onCancel:function(){gr(),Cn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},kn===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",je,"-",Jr,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),kn===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((rt=Pt.task_status)===null||rt===void 0?void 0:rt.filter(function(gn){return An==null?void 0:An.includes(gn.id)}).map(function(gn){return gn.name}).toString())+",","\u7684\u5B66\u751F\u8FDB\u884C\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),n.a.createElement("br",null),n.a.createElement("span",null,"\u8BE5\u6761\u4EF6\u4E0B\u5171\u6709",It==null?void 0:It.count,"\u540D\u5B66\u751F")))),n.a.createElement(me,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(y.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:Rr,current:dt.page||1,defaultPageSize:20,total:Pt.work_count})))},St=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading,En=Hn.user;return{shixunHomeworks:yn,loading:Sn.effects,user:En}})(Be),an=D("fOrg"),Dn=D("+KLJ"),yt=function(yn){var Sn,En=yn.shixunHomeworks,ur=yn.loading,sr=yn.dispatch,Q=Object(T.i)(),de=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,group_ids:[]}),Q)),Te=Object(o.a)(de,2),Se=Te[0],rt=Te[1],De=Object(T.h)(),Je=En.codeReview,it=Object(i.useState)({}),At=Object(o.a)(it,2),Ct=At[0],We=At[1],gt=Ht.a.useForm(),ot=Object(o.a)(gt,1),dt=ot[0];Se.order="code_rate",Se.sort="desc",Se.category=Se.categoryId,Object(i.useEffect)(function(){wt(),console.log("params",Se)},[Se]),Object(i.useEffect)(function(){En.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&wt()},[En.actionTabs.key]);var wt=function(){var hn=Object(m.a)(s.a.mark(function Pn(){var Gn;return s.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Se)});case 2:Gn=Nn.sent,Gn.status===-2&&setTimeout(function(){return wt()},1500);case 4:case"end":return Nn.stop()}},Pn)}));return function(){return hn.apply(this,arguments)}}(),kt=function(){},mt=function(Pn,Gn){Se.page=Pn,Se.limit=20,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Se)})},$t=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(Pn,Gn,On){return Se.limit*(Se.page-1)+On+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(Pn){return n.a.createElement("span",{className:"c-orange"},Pn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(Pn,Gn){return n.a.createElement("div",null,n.a.createElement(w.a,{target:"_blank",to:"/classrooms/".concat(Se.coursesId,"/program_homework/").concat(Se.categoryId,"/review_detail/").concat(Gn.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(Je==null?void 0:Je.status)===-2&&n.a.createElement(Dn.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",Je.last_review_time,n.a.createElement(P.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){sr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Se}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(oe.a,null,n.a.createElement(Ft.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Pn){Se.search=Pn,sr({type:"shixunHomeworks/getCodeReview",payload:Se})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((Sn=Je.group_info)===null||Sn===void 0?void 0:Sn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ut.a,{checked:Se.group_ids=="",value:"all",onChange:function(Pn){delete Se.group_ids,Se.group_ids=[],Se.page=1,rt(Object(g.a)({},Se))}},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1"},Je.group_info&&Je.group_info.map(function(hn,Pn){return n.a.createElement(ut.a,{style:{marginLeft:0},value:hn.id,checked:Se.group_ids.includes(hn.id),onChange:function(On){On.target.checked?Se.group_ids.push(hn.id):Se.group_ids.splice(Se.group_ids.indexOf(hn.id),1),Se.page=1,rt(Object(g.a)({},Se))}},hn.name,"(",hn.members_count,")")}))),n.a.createElement(Ve.a,{className:"font14 c-red mt5"},n.a.createElement(oe.a,null,"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u67E5\u91CD\u5206\u73ED"))),n.a.createElement("p",{className:"mt10"},n.a.createElement("span",{className:"c-red"},Je.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",Je.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(Y.a,{className:"mt30",loading:ur["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:Je.users_reviews,columns:$t,onChange:function(Pn,Gn,On){On.order==="ascend"&&(Se.b_order="asc"),On.order==="descend"&&(Se.b_order="desc"),On.order||delete Se.b_order,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Se)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(y.a,{showSizeChanger:!1,onChange:mt,defaultCurrent:Se.page||1,current:Se.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:Je.copy_reviews_count})))},en=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading;return{shixunHomeworks:yn,loading:Sn.effects}})(yt),_t=D("OaEy"),Et=D("2fM7"),st=D("iQDF"),he=D("+eQT"),Le=D("/MfK"),Lt=D("w5pM"),ct=D("Lyp1"),tn=D("LvDl"),un=D("xb3X"),Pe=D.n(un),et=D("AHFd"),jt=D("eozf"),bn=he.a.RangePicker,Kt=Et.a.Option,Xt=function(yn){var Sn,En,ur,sr,Q,de,Te,Se,rt,De,Je=yn.shixunHomeworks,it=yn.loading,At=yn.dispatch,Ct=Object(T.i)(),We=Je.workSetting,gt=Je.workList,ot=Je.changeData,dt=Object(i.useState)(!0),wt=Object(o.a)(dt,2),kt=wt[0],mt=wt[1],$t=Object(i.useState)(!1),hn=Object(o.a)($t,2),Pn=hn[0],Gn=hn[1],On=Object(i.useState)([]),Nn=Object(o.a)(On,2),Mn=Nn[0],Pt=Nn[1],fn=Object(i.useState)([]),Wt=Object(o.a)(fn,2),Rt=Wt[0],Un=Wt[1],Rn=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:et.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,send_type:void 0,difficult_count:[],difficult_settings:[],late_penalty:0}),Yt=Object(o.a)(Rn,2),ht=Yt[0],jn=Yt[1];Object(i.useEffect)(function(){return pn(),function(){Pt([].concat())}},[]);var pn=function(){At({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Ct)})};Object(i.useEffect)(function(){var Dt;if(!(We!=null&&We.course_id))return;Object.keys(ht).map(function(Ze){ht[Ze]=We[Ze]}),(!ht.allow_late||!ht.unified_late)&&(ht.late_minus_score=20,ht.penalty_type=et.a.Percent),ht.unified_setting||(ht.unified_late=!1,ht.unified_anonymous_comment=!1,ht.unified_anonymous_appeal=!1),Mn=JSON.parse(JSON.stringify(We.group_settings.map(function(Ze){return Object(g.a)(Object(g.a)({},Ze),{},{group_name:[Ze.group_name]})}).filter(function(Ze){return Ze.publish_time!==null}))),Rt=JSON.parse(JSON.stringify(We.allow_late_settings.map(function(Ze){return Object(g.a)(Object(g.a)({},Ze),{},{group_name:[Ze.group_name]})}).filter(function(Ze){return Ze.late_time!==null}))),ht.difficult_settings.length===0&&(ht.difficult_settings=[0,0,0]),jn(Object(g.a)({},ht)),Pt(Object(Ee.a)(Mn)),((Dt=Rt)===null||Dt===void 0?void 0:Dt.length)<=0?Un([{late_minus_score:20}]):Un(Object(Ee.a)(Rt))},[We]);var qn=function(){var Ze,It=JSON.parse(JSON.stringify(ht));if(It.categoryId=Ct.categoryId,ht.unified_setting||(Mn=(Ze=Mn)===null||Ze===void 0?void 0:Ze.map(function(cn){var zn;if(!cn.publish_time||!cn.end_time)throw p.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!cn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return cn.group_name=typeof(cn==null?void 0:cn.group_name)=="string"?[cn==null?void 0:cn.group_name]:cn==null?void 0:cn.group_name,cn.group_id=(zn=We.group_settings)===null||zn===void 0?void 0:zn.filter(function(kn){var lr;return cn==null||((lr=cn.group_name)===null||lr===void 0)?void 0:lr.includes(kn.group_name)}).map(function(kn){return kn.group_id||kn.id}).toString().split(","),cn})),It.group_settings=Mn,ht.allow_late)if(ht.unified_late){if(ht.late_minus_score===null||ht.late_minus_score===void 0||ht.late_minus_score<0||ht.late_minus_score>100)throw p.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!ht.late_time)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var Mt;Rt=(Mt=Rt)===null||Mt===void 0?void 0:Mt.map(function(cn){var zn,kn;if(cn.late_minus_score===null||cn.late_minus_score===void 0||cn.late_minus_score<0||cn.late_minus_score>100)throw p.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!cn.late_time)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!cn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return cn.group_name=typeof(cn==null?void 0:cn.group_name)=="string"?[cn==null?void 0:cn.group_name]:cn==null?void 0:cn.group_name,cn.group_id=cn==null||((zn=cn.group_name)===null||zn===void 0||((kn=zn.map(function(lr){var nr,Or,mr=(nr=We.group_settings)===null||nr===void 0||((Or=nr.filter(function(Er){return(Er==null?void 0:Er.group_name)===lr}))===null||Or===void 0)?void 0:Or[0];return mr==null?void 0:mr.group_id}))===null||kn===void 0))?void 0:kn.toString().split(","),cn}),It.allow_late_settings=Rt}It.send_type===1&&(It.difficult_settings=It.difficult_settings.map(function(cn){return cn||0})),Zt(It)},Zt=function(Ze){var It;if(Ze.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ze!=null&&Ze.work_efficiency&&Ze.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Mt={shixun_evaluation:Ze.shixun_evaluation,challenge_settings:Ze.challenge_settings},cn=function(){var zn=Object(m.a)(s.a.mark(function kn(){var lr;return s.a.wrap(function(Or){for(;;)switch(Or.prev=Or.next){case 0:return Gn(!0),Or.next=3,Object(O.a)("/api/homework_commons/".concat(Ct.categoryId,"/publish_setting.json"),{method:"post",body:Object(g.a)({},Ze)});case 3:lr=Or.sent,lr.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),mt(!0),pn(),At({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Ct)})),Gn(!1);case 6:case"end":return Or.stop()}},kn)}));return function(){return zn.apply(this,arguments)}}();!Object(tn.isEqual)(ot,Mt)&&!(gt!=null&&(It=gt.homework_status)!==null&&It!==void 0&&It.includes("\u672A\u53D1\u5E03"))?a.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:cn}):cn()},An=function(Ze,It){var Mt,cn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return It?It.find(function(zn){return zn[cn]===Ze}):We==null||((Mt=We.group_settings)===null||Mt===void 0)?void 0:Mt.find(function(zn){return zn.group_id[0]===Ze})},Fn=(We==null?void 0:We.allow_late)||(We==null?void 0:We.anonymous_comment),vn=function(Ze){var It=An(Ze,We==null?void 0:We.allow_late_settings,"id"),Mt=An(Ze,We==null?void 0:We.anonymous_comment_settings);return(We==null?void 0:We.allow_late)&&It&&(It==null?void 0:It.late_time)!==null||(We==null?void 0:We.anonymous_comment)&&Mt&&(Mt==null?void 0:Mt.evaluation_start)!==null},yr=Object(i.useMemo)(function(){var Dt;if(We!=null&&We.unified_setting){var Ze;return!(gt!=null&&(Ze=gt.homework_status)!==null&&Ze!==void 0&&Ze.includes("\u5DF2\u622A\u6B62"))||(We==null?void 0:We.allow_late)||(We==null?void 0:We.anonymous_comment)}var It=We==null||((Dt=We.group_settings)===null||Dt===void 0)?void 0:Dt.some(function(Mt){return W()(Mt.end_time)<=W()()});return!It||(We==null?void 0:We.allow_late)||(We==null?void 0:We.all_group_late)},[We,gt]),Ln=We==null?void 0:We.anonymous_comment,Cn=function(Ze){if(!Ze)return!1;var It=An(Ze,We==null?void 0:We.anonymous_comment_settings);return(We==null?void 0:We.anonymous_comment)&&It&&(It==null?void 0:It.evaluation_start)!==null};return n.a.createElement("section",{className:Pe.a.form},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"},n.a.createElement("div",{className:Pe.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(oe.a,null,Object(z.c)()&&n.a.createElement(P.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return mt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(_e.a.Group,{disabled:kt||!(gt!=null&&(Sn=gt.homework_status)!==null&&Sn!==void 0&&Sn.includes("\u672A\u53D1\u5E03")),value:ht.send_type,onChange:function(Ze){ht.send_type=Ze.target.value,jn(Object.assign({},ht))}},n.a.createElement(_e.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(_e.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),ht.send_type===1&&n.a.createElement(Ve.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(oe.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement(Qe.a,{precision:0,disabled:kt||!(gt!=null&&(En=gt.homework_status)!==null&&En!==void 0&&En.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ht.difficult_count[0]||0),min:0,max:ht.difficult_count[0]||0,value:ht.difficult_settings[0],onChange:function(Ze){ht.difficult_settings[0]=Ze,jn(Object.assign({},ht))},className:"ml10 mr20"})),n.a.createElement(oe.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement(Qe.a,{precision:0,disabled:kt||!(gt!=null&&(ur=gt.homework_status)!==null&&ur!==void 0&&ur.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ht.difficult_count[1]||0),min:0,max:ht.difficult_count[1]||0,value:ht.difficult_settings[1],onChange:function(Ze){ht.difficult_settings[1]=Ze,jn(Object.assign({},ht))},className:"ml10 mr20"})),n.a.createElement(oe.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement(Qe.a,{precision:0,disabled:kt||!(gt!=null&&(sr=gt.homework_status)!==null&&sr!==void 0&&sr.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ht.difficult_count[2]||0),min:0,max:ht.difficult_count[2]||0,value:ht.difficult_settings[2],onChange:function(Ze){ht.difficult_settings[2]=Ze,jn(Object.assign({},ht))},className:"ml10 mr20"})))),n.a.createElement("div",{className:"mt30"},n.a.createElement("h1",{className:"mb10"},"\u53D1\u5E03\u8BBE\u7F6E"),n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(_e.a.Group,{disabled:kt||!(gt!=null&&(Q=gt.homework_status)!==null&&Q!==void 0&&Q.includes("\u672A\u53D1\u5E03")),value:ht.unified_setting,onChange:function(Ze){var It;if(!(gt!=null&&(It=gt.homework_status)!==null&&It!==void 0&&It.includes("\u672A\u53D1\u5E03"))){p.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(ht.unified_setting=!ht.unified_setting,ht.unified_setting||(ht.unified_late=!1),jn(Object.assign({},ht)),ht.unified_setting===!1&&Mn==""){Pt(Mn.concat({}));return}ht.unified_setting&&(Pt([]),Un([{late_minus_score:5}]))}},n.a.createElement(_e.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(_e.a,{className:"ml20",disabled:(We==null||((de=We.group_settings)===null||de===void 0)?void 0:de.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(We==null||((Te=We.group_settings)===null||Te===void 0)?void 0:Te.length)===0&&n.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09")),ht.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(he.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(Ze){return Object(jt.b)(Ze,We==null?void 0:We.course_end_date)},disabledTime:function(Ze){return Object(jt.c)(Ze)},disabled:kt||!(gt!=null&&(Se=gt.homework_status)!==null&&Se!==void 0&&Se.includes("\u672A\u53D1\u5E03")),value:ht.publish_time?W()(ht.publish_time):"",onChange:function(Ze,It){ht.publish_time=It,(ht.end_time==""||!ht.end_time)&&ht.unified_setting&&(ht.end_time=W()(Ze).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),jn(Object.assign({},ht))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(he.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:W()(Object(v.f)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:kt||Fn,disabledDate:function(Ze){return Object(jt.b)(Ze,We==null?void 0:We.course_end_date,ht.publish_time)},disabledTime:function(Ze){return Object(jt.c)(Ze,ht.publish_time)},value:ht.end_time?W()(ht.end_time):"",onChange:function(Ze,It){ht.end_time=It,jn(Object.assign({},ht))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!ht.unified_setting&&((rt=Mn)===null||rt===void 0?void 0:rt.length)>0&&n.a.createElement(Ve.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(oe.a,{span:24},n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{span:10}),n.a.createElement(oe.a,{span:10},n.a.createElement(Ve.a,{className:"c-grey-c ml30"},n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(oe.a,{span:4}))),Mn&&Mn.map(function(Dt,Ze){var It,Mt,cn,zn,kn;return n.a.createElement(oe.a,{span:24,key:Ze},n.a.createElement(Ve.a,{gutter:[8,16]},n.a.createElement(oe.a,{span:10},n.a.createElement(Ve.a,{gutter:[8,16]},n.a.createElement(oe.a,null,"\u53D1\u5E03\u89C4\u5219 ",Ze+1),n.a.createElement(oe.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(Et.a,{disabled:kt||!(gt!=null&&(It=gt.homework_status)!==null&&It!==void 0&&It.includes("\u672A\u53D1\u5E03"))&&Dt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Dt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(nr){Mn[Ze].group_name=nr,Mn[Ze].group_id=Dt.group_id;var Or=Object(tn.flattenDeep)(Mn.map(function(Er){return Er.group_name})),mr=Rt.map(function(Er){var Zr=(Er==null?void 0:Er.group_name)||[];return Object(g.a)(Object(g.a)({},Er),{},{group_name:Object(tn.remove)(Zr,function(Yr){return Or.includes(Yr)})})});Un(mr),Pt(Mn.slice())}},We.group_settings&&We.group_settings.map(function(lr){if(!Mn.map(function(nr){return nr.group_name}).toString().split(",").includes(String(lr.group_name)))return n.a.createElement(Kt,{value:lr.group_name,key:lr.id},lr.group_name)}))))),n.a.createElement(oe.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(bn,{allowClear:!1,ranges:{\u6B64\u523B:[Dt.publish_time?W()(Dt.publish_time):W()(),W()()]},disabled:kt||(W()()<=W()((Mt=An((cn=Dt.group_id)===null||cn===void 0?void 0:cn[0]))===null||Mt===void 0?void 0:Mt.publish_time)?!1:[!0,vn((zn=Dt.group_id)===null||zn===void 0?void 0:zn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(nr){return Object(jt.b)(nr,We==null?void 0:We.course_end_date)},disabledTime:function(nr){return Object(jt.c)(nr)},showTime:{format:"HH:mm",defaultValue:[W()(Object(v.f)(),"HH:mm"),W()(Object(v.f)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Dt.publish_time&&[W()(Dt.publish_time),Dt.end_time?W()(Dt.end_time):void 0],onChange:function(nr,Or){Mn[Ze].publish_time=Or[0],Mn[Ze].end_time=Or[1],Pt(Object(Ee.a)(Mn))}}))),!kt&&n.a.createElement(oe.a,{span:4},Ze>0&&!Dt.id&&n.a.createElement(Le.a,{onClick:function(){Mn=Mn.filter(function(nr,Or){return Ze!==Or}),Pt(Mn.slice()),setTimeout(function(){return Pt(Mn.slice())},10)}}),Mn.length<(We==null||((kn=We.group_settings)===null||kn===void 0)?void 0:kn.length)&&n.a.createElement(Lt.a,{className:"c-green ml20",onClick:function(){Pt(Mn.concat({}))}}))))})),n.a.createElement(Ve.a,{className:"mt30"},n.a.createElement(oe.a,null,n.a.createElement(Ve.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(k.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},n.a.createElement(ct.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(oe.a,{span:24,className:"mt10"},n.a.createElement(ut.a,{checked:ht.allow_late,disabled:kt||yr,onChange:function(){ht.allow_late=!ht.allow_late,Rt==""&&Un([{late_minus_score:5}]),jn(Object.assign({},ht))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(k.a,{overlayStyle:{width:380,maxWidth:380},title:n.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),n.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},n.a.createElement(ct.a,null)))),(ht==null?void 0:ht.allow_late)&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement("div",{className:"ml30 mt20",style:{marginLeft:50}},n.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),n.a.createElement(_e.a.Group,{disabled:kt||(We==null?void 0:We.anonymous_comment)||(We==null?void 0:We.allow_late),value:ht.unified_late,onChange:function(Ze){ht.unified_late=Ze.target.value,Rt==""&&!Ze.target.value&&Un([{late_minus_score:5}]),jn(Object(g.a)({},ht))}},(ht==null?void 0:ht.unified_setting)&&n.a.createElement(_e.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(We==null||((De=We.group_settings)===null||De===void 0)?void 0:De.length)&&n.a.createElement(_e.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),ht!=null&&ht.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(oe.a,{className:"ml5"},n.a.createElement(et.b,{disabled:kt||Ln,value:{type:ht.penalty_type,inputValue:ht.late_minus_score},onChange:function(Ze){jn(Object(g.a)(Object(g.a)({},ht),{},{late_minus_score:Ze.inputValue,penalty_type:Ze.type}))}})),n.a.createElement(oe.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},ht.penalty_type===et.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(oe.a,{className:"ml5"},n.a.createElement(he.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:W()(Object(v.f)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:kt||Ln,value:ht.late_time?W()(ht.late_time):"",disabledDate:function(Ze){return Object(jt.b)(Ze,We==null?void 0:We.course_end_date)},disabledTime:function(Ze){return Object(jt.c)(Ze)},onChange:function(Ze,It){ht.late_time=It,jn(Object.assign({},ht))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Rt.map(function(Dt,Ze){var It;return n.a.createElement(oe.a,{span:24,key:Ze},n.a.createElement(Ve.a,{className:"mt25"},n.a.createElement(oe.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Ze+1,"\uFF1A"),n.a.createElement(Et.a,{disabled:kt||!(gt!=null&&(It=gt.homework_status)!==null&&It!==void 0&&It.includes("\u672A\u53D1\u5E03"))&&Dt.id||(We==null?void 0:We.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Dt.group_name=="string"?[Dt.group_name]:Dt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(cn){Rt[Ze].group_name=cn,Rt[Ze].group_id=Dt.group_id,Un(Rt.slice())}},We.group_settings&&We.group_settings.map(function(Mt){if(ht!=null&&ht.unified_setting&&!Rt.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name)))return n.a.createElement(Kt,{value:Mt.group_name,key:Mt.id},Mt.group_name);if(Mn.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name))&&(!Rt.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name))&&W()(Mt.end_time)<=W()()))return n.a.createElement(Kt,{value:Mt.group_name,key:Mt.id},Mt.group_name)}))),n.a.createElement(oe.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(et.b,{disabled:kt||Cn(Dt.id),value:{type:Dt.penalty_type,inputValue:Dt.late_minus_score},onChange:function(cn){Rt[Ze].late_minus_score=cn.inputValue,Rt[Ze].penalty_type=cn.type,Un(Object(Ee.a)(Rt))}})),n.a.createElement(oe.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(he.a,{disabled:kt||Cn(Dt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:W()(Object(v.f)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(cn){return Object(jt.b)(cn,We==null?void 0:We.course_end_date)},disabledTime:function(cn){return Object(jt.c)(cn)},format:"YYYY-MM-DD HH:mm",value:Dt!=null&&Dt.late_time?W()(Dt.late_time):void 0,onChange:function(cn,zn){Rt[Ze].late_time=zn,Un(Object(Ee.a)(Rt))}})),!kt&&n.a.createElement(oe.a,{className:"ml20"},Ze>0&&!Dt.id&&n.a.createElement(Le.a,{onClick:function(){Rt=Rt.filter(function(cn,zn){return Ze!==zn}),Un(Rt.slice()),setTimeout(function(){return Un(Rt.slice())},10)}}),n.a.createElement(Lt.a,{className:"c-green ml20",onClick:function(){Un(Rt.concat({penalty_type:et.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!kt&&n.a.createElement("div",{className:Pe.a.btns},n.a.createElement(P.a,{type:"primary",loading:Pn,onClick:function(){return qn()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){mt(!0),pn()}},"\u53D6\u6D88")))},Yn=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading;return{shixunHomeworks:yn,loading:Sn.effects}})(Xt);function Bn(Hn,yn){for(var Sn=[],En=Hn;En<yn;En++)Sn.push(En);return Sn}var _n=function(yn){var Sn=new Date,En=W()(yn).format("HH");if(W()(yn).isSame(W()(Sn),"day")){var ur=W()(Sn).format("HH"),sr=W()(Sn).format("mm");return{disabledHours:function(){return Bn(0,24).splice(1,ur*1-1)},disabledMinutes:function(){return console.log("\u7981\u6B62\u65F6\u95F4\uFF1A",En,ur),W()(yn).isSame(W()(Sn),"hour")&&En<=ur?Bn(0,60).splice(0,sr):Bn(60,60)}}}else if(W()(yn).isSame(W()(),"day")){var Q=W()().format("HH"),de=W()().format("mm");return{disabledHours:function(){return Bn(0,24).splice(0,Q)},disabledMinutes:function(){return En<=Q?Bn(0,de):Bn(60,60)}}}else return},br=he.a.RangePicker,Fr=Et.a.Option,hr=function(yn){var Sn,En=yn.shixunHomeworks,ur=yn.loading,sr=yn.dispatch,Q=Object(T.i)(),de=Object(T.h)(),Te=En.workSetting,Se=En.workList,rt=En.changeData,De=Object(i.useState)(!0),Je=Object(o.a)(De,2),it=Je[0],At=Je[1],Ct=Object(i.useState)({}),We=Object(o.a)(Ct,2),gt=We[0],ot=We[1],dt=Object(i.useState)(!1),wt=Object(o.a)(dt,2),kt=wt[0],mt=wt[1],$t=Ht.a.useForm(),hn=Object(o.a)($t,1),Pn=hn[0],Gn=Object(i.useState)([]),On=Object(o.a)(Gn,2),Nn=On[0],Mn=On[1],Pt=Object(i.useState)([]),fn=Object(o.a)(Pt,2),Wt=fn[0],Rt=fn[1],Un=Object(i.useState)(!1),Rn=Object(o.a)(Un,2),Yt=Rn[0],ht=Rn[1],jn=Object(i.useState)([]),pn=Object(o.a)(jn,2),qn=pn[0],Zt=pn[1],An=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,open_code:!1,rank_forbidden:!1,open_code_type:void 0,comment_public:!0,total_score:"",eff_score:0,rank_forbidden_start:"",rank_forbidden_end:""}),Fn=Object(o.a)(An,2),vn=Fn[0],yr=Fn[1];Object(i.useEffect)(function(){return Ln(),function(){Mn([].concat())}},[]);var Ln=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Q)})},Cn=function(Mt){return Mt&&Mt<W()().startOf("day")};Object(i.useEffect)(function(){var It;if(!(Te!=null&&Te.course_id))return;Object.keys(vn).map(function(Mt){vn[Mt]=Te[Mt]}),(!vn.allow_late||!vn.unified_late)&&(vn.late_penalty=5),Nn=JSON.parse(JSON.stringify(Te.group_settings.map(function(Mt){return Object(g.a)(Object(g.a)({},Mt),{},{group_name:[Mt.group_name]})}).filter(function(Mt){return Mt.publish_time!==null}))),Wt=JSON.parse(JSON.stringify(Te.allow_late_settings.map(function(Mt){return Object(g.a)(Object(g.a)({},Mt),{},{group_name:[Mt.group_name]})}).filter(function(Mt){return Mt.rank_forbidden_start!==null}))),yr(Object(g.a)({},vn)),Mn(Object(Ee.a)(Nn)),((It=Wt)===null||It===void 0?void 0:It.length)<=0?Rt([{}]):Rt(Object(Ee.a)(Wt))},[Te]),console.log(vn,"data");var Dt=function(){var Mt,cn=JSON.parse(JSON.stringify(vn));if(cn.categoryId=Q.categoryId,vn.unified_setting||(Nn=(Mt=Nn)===null||Mt===void 0?void 0:Mt.map(function(kn){var lr;if(!kn.publish_time||!kn.end_time)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return kn.group_name=typeof(kn==null?void 0:kn.group_name)=="string"?[kn==null?void 0:kn.group_name]:kn==null?void 0:kn.group_name,kn.group_id=(lr=Te.group_settings)===null||lr===void 0?void 0:lr.filter(function(nr){var Or;return kn==null||((Or=kn.group_name)===null||Or===void 0)?void 0:Or.includes(nr.group_name)}).map(function(nr){return nr.group_id||nr.id}).toString().split(","),kn})),cn.group_settings=Nn,vn.rank_forbidden)if(vn.unified_setting){if(!vn.rank_forbidden_start)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!vn.rank_forbidden_end)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(W()(vn.rank_forbidden_end)<W()(vn.rank_forbidden_start))throw p.b.error("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4"),new String("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4")}else{var zn;Wt=(zn=Wt)===null||zn===void 0?void 0:zn.map(function(kn){var lr,nr;if(!kn.rank_forbidden_start)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.rank_forbidden_end)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return kn.group_name=typeof(kn==null?void 0:kn.group_name)=="string"?[kn==null?void 0:kn.group_name]:kn==null?void 0:kn.group_name,kn.group_id=kn==null||((lr=kn.group_name)===null||lr===void 0||((nr=lr.map(function(Or){var mr,Er,Zr=(mr=Te.group_settings)===null||mr===void 0||((Er=mr.filter(function(Yr){return(Yr==null?void 0:Yr.group_name)===Or}))===null||Er===void 0)?void 0:Er[0];return Zr==null?void 0:Zr.group_id}))===null||nr===void 0))?void 0:nr.toString().split(","),kn}),cn.group_settingss=Wt}Ze(cn)},Ze=function(Mt){if(console.log(Mt.total_score,Mt.eff_score),Mt.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Mt!=null&&Mt.work_efficiency&&Mt.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var cn={shixun_evaluation:Mt.shixun_evaluation},zn=function(){var kn=Object(m.a)(s.a.mark(function lr(){var nr;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mt(!0),mr.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/public_setting.json"),{method:"post",body:Object(g.a)({},Mt)});case 3:nr=mr.sent,nr.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),At(!0),Ln(),sr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Q)})),mt(!1);case 6:case"end":return mr.stop()}},lr)}));return function(){return kn.apply(this,arguments)}}();zn()};return n.a.createElement("section",{className:Pe.a.form},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"},n.a.createElement("div",{className:Pe.a.title},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(oe.a,null,(Te==null?void 0:Te.can_edit)&&n.a.createElement(P.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return At(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{span:24,className:"mt15 mt20"},n.a.createElement(ut.a,{checked:vn.score_open,disabled:it,onChange:function(Mt){vn.score_open=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u6210\u7EE9")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u5B83\u5B66\u751F\u7684\u6210\u7EE9\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u770B\u81EA\u5DF1\u7684\u6210\u7EE9)")),n.a.createElement(oe.a,{span:24,className:"mt15"},n.a.createElement(ut.a,{checked:vn.open_code,disabled:it,onChange:function(Mt){vn.open_code=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u4EE3\u7801")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u4ED6\u5B66\u751F\u7684\u4EE3\u7801\u8BE6\u60C5)")),!!vn.open_code&&n.a.createElement(oe.a,{span:24,className:"mt10 ml25"},n.a.createElement(_e.a.Group,{disabled:it,value:vn.open_code_type,onChange:function(Mt){vn.open_code_type=Mt.target.value,yr(Object.assign({},vn))}},n.a.createElement(_e.a,{value:0},"\u4EFB\u610F\u65F6\u95F4\u67E5\u770B"),n.a.createElement(_e.a,{style:{marginLeft:60},value:1},"\u7EC3\u4E60\u65F6\u95F4\u7ED3\u675F\u540E"))),n.a.createElement(oe.a,{span:24,className:"mt15 mt20"},n.a.createElement(ut.a,{checked:vn.rank_forbidden,disabled:it,onChange:function(Mt){vn.rank_forbidden=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u5F00\u542F\u5C01\u699C")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\u5219\u5728\u8BBE\u7F6E\u7684\u8FD9\u6BB5\u65F6\u95F4\u5185\uFF0C\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u4FE1\u606F\uFF0C\u5176\u4ED6\u65F6\u95F4\u53EF\u4EE5\u67E5\u770B)")),!!vn.rank_forbidden&&vn.unified_setting&&n.a.createElement(oe.a,{span:24,className:"mt10 "},n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(Ve.a,{align:"middle",className:"mt25 "},n.a.createElement(oe.a,null,"\u5F00\u59CB\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(he.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:Cn,disabledTime:_n,disabled:it||W()()>W()(Te.rank_forbidden_start),value:vn.rank_forbidden_start?W()(vn.rank_forbidden_start):"",onChange:function(Mt,cn){vn.rank_forbidden_start=cn,(vn.end_time==""||!vn.end_time)&&vn.unified_setting&&(vn.end_time=W()(Mt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),yr(Object.assign({},vn))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"))),n.a.createElement(Ve.a,{align:"middle",className:"mt25"},n.a.createElement(oe.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(he.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:W()(Object(v.f)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:it,disabledDate:Cn,value:vn.rank_forbidden_end?W()(vn.rank_forbidden_end):"",onChange:function(Mt,cn){vn.rank_forbidden_end=cn,yr(Object.assign({},vn))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))))),console.log("----",Nn),!vn.unified_setting&&((Sn=Nn)===null||Sn===void 0?void 0:Sn.length)>0&&!!vn.rank_forbidden&&n.a.createElement(Ve.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(oe.a,{span:24},n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{span:10}),n.a.createElement(oe.a,{span:10},n.a.createElement(Ve.a,{className:"c-grey-c ml30"},n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(oe.a,{span:4}))),Wt.map(function(It,Mt){var cn,zn,kn,lr,nr,Or,mr;return n.a.createElement(oe.a,{span:24,key:Mt},n.a.createElement(Ve.a,{className:"mt25"},n.a.createElement(oe.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",Mt+1,"\uFF1A"),n.a.createElement(Et.a,{disabled:it||!(Se!=null&&(cn=Se.homework_status)!==null&&cn!==void 0&&cn.includes("\u672A\u53D1\u5E03"))&&It.id,mode:"multiple",style:{width:306},value:typeof It.group_name=="string"?[It.group_name]:It.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Zr){Wt[Mt].group_name=Zr,Wt[Mt].group_id=It.group_id,Rt(Wt.slice())}},Te.group_settings&&Te.group_settings.map(function(Er){if(vn!=null&&vn.unified_setting&&!Wt.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(Er.group_name)))return n.a.createElement(Fr,{value:Er.group_name,key:Er.id},Er.group_name);if(Nn.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(Er.group_name))&&!Wt.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(Er.group_name)))return n.a.createElement(Fr,{value:Er.group_name,key:Er.id},Er.group_name)}))),n.a.createElement(oe.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(br,{allowClear:!1,disabled:it||(Te!=null&&(zn=Te.group_settings)!==null&&zn!==void 0&&(kn=zn.filter(function(Er){return Er.id===It.id}))!==null&&kn!==void 0&&(lr=kn[0])!==null&&lr!==void 0&&lr.rank_forbidden_start?W()()<W()(Te==null||((nr=Te.group_settings)===null||nr===void 0||((Or=nr.filter(function(Er){return Er.id===It.id}))===null||Or===void 0||((mr=Or[0])===null||mr===void 0)))?void 0:mr.rank_forbidden_start)?!1:[!0,!1]:!1),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4","\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4"],disabledDate:Cn,disabledTime:_n,showTime:{format:"HH:mm",defaultValue:[W()(Object(v.f)(),"HH:mm"),W()(Object(v.f)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:It.rank_forbidden_start&&[W()(It.rank_forbidden_start),It.rank_forbidden_end?W()(It.rank_forbidden_end):void 0],onChange:function(Zr,Yr){Wt[Mt].rank_forbidden_start=Yr[0],Wt[Mt].rank_forbidden_end=Yr[1],Rt(Object(Ee.a)(Wt))}}))),!it&&n.a.createElement(oe.a,{className:"ml20"},Mt>0&&!It.id&&n.a.createElement(Le.a,{onClick:function(){Wt=Wt.filter(function(Zr,Yr){return Mt!==Yr}),Rt(Wt.slice()),setTimeout(function(){return Rt(Wt.slice())},10)}}),n.a.createElement(Lt.a,{className:"c-green ml20",onClick:function(){Rt(Wt.concat({}))}}))))})),!it&&n.a.createElement("div",{className:Pe.a.btns},n.a.createElement(P.a,{type:"primary",loading:kt,onClick:function(){return Dt()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){At(!0),Ln()}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Yt,onCancel:function(){return ht(!1)}},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Ft.a.Search,{onChange:function(Mt){}})),n.a.createElement(Y.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Mt,cn){Zt(Mt)}},pagination:!1,dataSource:[{name:"1"}],columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]}))))},Qn=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading;return{shixunHomeworks:yn,loading:Sn.effects}})(hr),Dr=function(yn){var Sn,En=yn.shixunHomeworks,ur=yn.loading,sr=yn.dispatch,Q=Object(T.i)(),de=En.workSetting,Te=En.workList,Se=En.changeData,rt=Object(i.useState)(!0),De=Object(o.a)(rt,2),Je=De[0],it=De[1],At=Object(i.useState)(!1),Ct=Object(o.a)(At,2),We=Ct[0],gt=Ct[1],ot=Object(i.useState)(!1),dt=Object(o.a)(ot,2),wt=dt[0],kt=dt[1],mt=Ht.a.useForm(),$t=Object(o.a)(mt,1),hn=$t[0],Pn=Object(i.useState)([]),Gn=Object(o.a)(Pn,2),On=Gn[0],Nn=Gn[1],Mn=Object(i.useState)([]),Pt=Object(o.a)(Mn,2),fn=Pt[0],Wt=Pt[1],Rt=!(Te!=null&&(Sn=Te.homework_status)!==null&&Sn!==void 0&&Sn.includes("\u672A\u53D1\u5E03")),Un=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,is_onpage_time:!0,training_time_rules:1,hack_settings:[],punish_time:void 0,hack_score_settings:void 0}),Rn=Object(o.a)(Un,2),Yt=Rn[0],ht=Rn[1];Object(i.useEffect)(function(){return jn(),function(){Nn([].concat())}},[]);var jn=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Q)})};Object(i.useEffect)(function(){if(!(de!=null&&de.course_id))return;Object.keys(Yt).map(function(An){Yt[An]=de[An]}),(!Yt.allow_late||!Yt.unified_late)&&(Yt.late_penalty=5),On=JSON.parse(JSON.stringify(de.group_settings.map(function(An){return Object(g.a)(Object(g.a)({},An),{},{group_name:[An.group_name]})}).filter(function(An){return An.publish_time!==null}))),fn=JSON.parse(JSON.stringify(de.allow_late_settings.map(function(An){return Object(g.a)(Object(g.a)({},An),{},{group_name:[An.group_name]})}).filter(function(An){return An.late_time!==null}))),Zt(),ht(Object(g.a)({},Yt)),Nn(Object(Ee.a)(On)),Wt(Object(Ee.a)(fn))},[de]);var pn=function(){var Fn=JSON.parse(JSON.stringify(Yt));qn(Fn)},qn=function(Fn){if(console.log(Fn.total_score,Fn.eff_score),Fn.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var vn=function(){var yr=Object(m.a)(s.a.mark(function Ln(){var Cn;return s.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return gt(!0),Ze.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(g.a)({},Fn)});case 3:Cn=Ze.sent,Cn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),it(!0),jn(),sr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Q)})),gt(!1);case 6:case"end":return Ze.stop()}},Ln)}));return function(){return yr.apply(this,arguments)}}();(Yt==null?void 0:Yt.hack_score_settings)!==(de==null?void 0:de.hack_score_settings)&&Rt?a.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:vn}):vn()},Zt=function(){var Fn,vn=Yt.total_score,yr=(Fn=Yt.hack_settings)===null||Fn===void 0?void 0:Fn.length,Ln=0,Cn;switch(Yt.hack_score_settings){case 0:var Dt=(vn/yr).toFixed(2);Yt.hack_settings.map(function(nr,Or){Ln=Or,nr.hack_score=Dt>0?Dt:0}),Cn=(vn-Dt*(yr-1)).toFixed(2),Yt.hack_settings[Ln].hack_score=Cn>0?Cn:0;break;case 1:var Ze=[0,1,3,6],It=0,Mt=Yt.hack_settings.filter(function(nr){return nr.difficult===1}).length*Ze[1],cn=Yt.hack_settings.filter(function(nr){return nr.difficult===2}).length*Ze[2],zn=Yt.hack_settings.filter(function(nr){return nr.difficult===3}).length*Ze[3],kn=vn/(Mt+cn+zn);console.log(kn,2222),Yt.hack_settings.map(function(nr,Or){Ln=Or,nr.hack_score=(Ze[nr.difficult]*kn).toFixed(2),It=It+Number(nr.hack_score)});var lr=Yt.hack_settings[Ln].hack_score;Cn=(vn-It+Number(lr)).toFixed(2),Yt.hack_settings[Ln].hack_score=Cn>0?Cn:0;break}};return n.a.createElement("section",{className:Pe.a.form},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"}),n.a.createElement(oe.a,null,(de==null?void 0:de.can_edit)&&n.a.createElement(P.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return it(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(oe.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement(Qe.a,{min:0,className:"ml10 mr10",style:{width:160},value:Yt.total_score,disabled:Je||Rt,onChange:function(Fn){Yt.total_score=Fn,ht(Object.assign({},Yt)),Zt()}}),"\xA0\u5206"),n.a.createElement(oe.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement(Qe.a,{className:"ml10 mr10",style:{width:160},min:0,value:Yt.punish_time,precision:0,disabled:Je,onChange:function(Fn){Yt.punish_time=Fn,ht(Object.assign({},Yt)),Zt()}}),"\xA0\u5206\u949F")),n.a.createElement(Ve.a,{align:"middle",style:{marginTop:20}},n.a.createElement(oe.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(oe.a,{flex:"1"},n.a.createElement(Ht.a.Item,{className:"ml20"},n.a.createElement(_e.a.Group,{disabled:Je||Rt,value:Yt.hack_score_settings,onChange:function(Fn){Yt.hack_score_settings=Fn.target.value,ht(Object.assign({},Yt)),Zt()}},n.a.createElement(_e.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(_e.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(_e.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:Pe.a.hackList},Yt.hack_settings&&Yt.hack_settings.map(function(An,Fn){return n.a.createElement(Ve.a,{key:Fn,align:"middle",style:{marginTop:20}},n.a.createElement(oe.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,An.hack_name)),n.a.createElement(oe.a,{flex:"150px"},n.a.createElement(Qe.a,{min:0,step:.1,value:An.hack_score,disabled:Je||Yt.hack_score_settings!==2||Rt,onChange:function(yr){Yt.hack_settings[Fn].hack_score=yr;var Ln=Yt.hack_settings.reduce(function(Cn,Dt){return Cn+Number(Dt.hack_score)},0);Yt.total_score=Ln.toFixed(2),ht(Object(g.a)({},Yt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(oe.a,{style:{lineHeight:"20px"}},An.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),An.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),An.difficult===3&&n.a.createElement("span",{className:"tag-style-border-small bg-orange c-white mr10"},"\u56F0\u96BE")))})),n.a.createElement("div",{style:{height:100}}),!Je&&n.a.createElement("div",{className:Pe.a.btns},n.a.createElement(P.a,{type:"primary",loading:We,onClick:function(){return pn()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){it(!0),jn()}},"\u53D6\u6D88")))},Kr=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading;return{shixunHomeworks:yn,loading:Sn.effects}})(Dr),ti=function(yn){var Sn,En,ur=yn.shixunHomeworks,sr=yn.loading,Q=yn.dispatch,de=Object(i.useState)(!0),Te=Object(o.a)(de,2),Se=Te[0],rt=Te[1],De=Object(i.useState)(!1),Je=Object(o.a)(De,2),it=Je[0],At=Je[1],Ct=Object(i.useState)([]),We=Object(o.a)(Ct,2),gt=We[0],ot=We[1],dt=Object(i.useState)([]),wt=Object(o.a)(dt,2),kt=wt[0],mt=wt[1],$t=Object(i.useState)([]),hn=Object(o.a)($t,2),Pn=hn[0],Gn=hn[1],On=Object(i.useState)([]),Nn=Object(o.a)(On,2),Mn=Nn[0],Pt=Nn[1],fn=Object(T.i)();function Wt(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(m.a)(s.a.mark(function ht(){var jn;return s.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return qn.next=2,Object(O.a)("/api/homework_commons/".concat(fn.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:jn=qn.sent,mt(jn);case 4:case"end":return qn.stop()}},ht)})),Rt.apply(this,arguments)}function Un(){return Rn.apply(this,arguments)}function Rn(){return Rn=Object(m.a)(s.a.mark(function ht(){var jn;return s.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return qn.next=2,Object(O.a)("/api/courses/".concat(fn==null?void 0:fn.coursesId,"/teachers"),{method:"get",params:{homework_id:fn.categoryId}});case 2:jn=qn.sent,jn==null||jn.teacher_list.map(function(Zt){Zt.key=Zt.user_id}),Gn(jn==null?void 0:jn.teacher_list),Pt(jn==null?void 0:jn.teacher_list);case 6:case"end":return qn.stop()}},ht)})),Rn.apply(this,arguments)}Object(i.useEffect)(function(){Wt(),Un()},[fn]);var Yt=function(){};return n.a.createElement("section",{className:Pe.a.form},n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(kt==null?void 0:kt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){At(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),n.a.createElement(Ve.a,{style:{marginTop:"20px",marginBottom:"20px"}},(kt==null||((Sn=kt.data)===null||Sn===void 0)?void 0:Sn.length)<=0&&n.a.createElement(Z.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),kt==null||((En=kt.data)===null||En===void 0)?void 0:En.map(function(ht){return n.a.createElement("span",{style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px"}},n.a.createElement("span",{style:{flex:"1"}},ht==null?void 0:ht.real_name),(kt==null?void 0:kt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(m.a)(s.a.mark(function jn(){var pn;return s.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(O.a)("/api/homework_commons/".concat(fn.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:ht.id}});case 2:pn=Zt.sent,pn.status===0&&(p.b.info("\u5220\u9664\u6210\u529F"),Wt(),Un());case 4:case"end":return Zt.stop()}},jn)}))},"X"))})),n.a.createElement(Ve.a,null,!Se&&n.a.createElement(oe.a,{className:"mb50"},n.a.createElement(P.a,{type:"primary",size:"large",onClick:function(){return Yt()}},"\u63D0\u4EA4"),n.a.createElement(P.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){rt(!0)}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:it,onCancel:function(){return At(!1)},onOk:Object(m.a)(s.a.mark(function ht(){var jn;return s.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(!(gt.length===0)){qn.next=3;break}return p.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),qn.abrupt("return");case 3:return qn.next=5,Object(O.a)("/api/homework_commons/".concat(fn.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:gt}});case 5:jn=qn.sent,jn.status===0&&(p.b.info("\u6DFB\u52A0\u6210\u529F"),ot([]),Wt(),Un(),At(!1));case 7:case"end":return qn.stop()}},ht)}))},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Ft.a.Search,{onChange:function(jn){Gn(Mn.filter(function(pn){return pn.name.indexOf(jn.target.value)>-1}))}})),n.a.createElement(Y.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(jn,pn){ot(jn)},selectedRowKeys:gt,getCheckboxProps:function(jn){return{disabled:jn.is_collaborator}}},pagination:!1,dataSource:Pn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},dn=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading;return{shixunHomeworks:yn,loading:Sn.effects}})(ti),rr=he.a.RangePicker,fi=Et.a.Option,wi=function(yn){var Sn=yn.shixunHomeworks,En=yn.loading,ur=yn.dispatch;return n.a.createElement("section",{className:"bg-white pl30 pr30 pt10 mb10"},n.a.createElement(G.a,null,n.a.createElement(G.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},n.a.createElement(Yn,null)),n.a.createElement(G.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(Kr,null)),n.a.createElement(G.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(Qn,null)),n.a.createElement(G.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(dn,null))))},ni=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading;return{shixunHomeworks:yn,loading:Sn.effects}})(wi),ri=D("RotF"),X=D.n(ri),L=function(yn){var Sn,En=yn.shixunHomeworks,ur=yn.loading,sr=yn.dispatch,Q=Object(T.i)(),de=Object(T.h)(),Te=Object(i.useState)([]),Se=Object(o.a)(Te,2),rt=Se[0],De=Se[1],Je=Object(i.useState)([]),it=Object(o.a)(Je,2),At=it[0],Ct=it[1],We=Object(i.useState)(!0),gt=Object(o.a)(We,2),ot=gt[0],dt=gt[1],wt=Object(i.useState)(!1),kt=Object(o.a)(wt,2),mt=kt[0],$t=kt[1],hn=Object(i.useState)(1),Pn=Object(o.a)(hn,2),Gn=Pn[0],On=Pn[1],Nn=Object(i.useState)([]),Mn=Object(o.a)(Nn,2),Pt=Mn[0],fn=Mn[1],Wt=Object(i.useState)(!1),Rt=Object(o.a)(Wt,2),Un=Rt[0],Rn=Rt[1],Yt=Object(i.useState)(!1),ht=Object(o.a)(Yt,2),jn=ht[0],pn=ht[1];Object(i.useEffect)(function(){En.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(An.resetFields(),De([]),Rn(!0),vn()):Rn(!1)},[En.actionTabs.key]);var qn=Ht.a.useForm(),Zt=Object(o.a)(qn,1),An=Zt[0],Fn=[],vn=function(){var Cn=Object(m.a)(s.a.mark(function Dt(){var Ze,It,Mt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(!(ot&&!mt)){zn.next=11;break}return $t(!0),On(Gn+1),zn.next=5,Object(xt.x)(Object(g.a)(Object(g.a)({},Q),{},{page:Gn}));case 5:It=zn.sent,Mt=Object(Ee.a)(It.group_list),It!=null&&It.ungroup_list&&Mt.push({id:It==null?void 0:It.ungroup_list.id,name:It==null?void 0:It.ungroup_list.name,works_count:It==null?void 0:It.ungroup_list.work_count,last_review_time:It==null?void 0:It.ungroup_list.last_review_time}),De([].concat(Object(Ee.a)(rt),Object(Ee.a)(Mt))),$t(!1),((Ze=It.group_list)===null||Ze===void 0?void 0:Ze.length)<10&&dt(!1);case 11:case"end":return zn.stop()}},Dt)}));return function(){return Cn.apply(this,arguments)}}(),yr=function(){sr({type:"shixunHomeworks/setActionTabs",payload:{}}),pn(!1),dt(!0),$t(!1),On(1),De([]),An.resetFields()},Ln=[{title:"",dataIndex:"id",width:280,render:function(Dt,Ze){return n.a.createElement(ut.a,{disabled:!(Ze.works_count>1),value:String(Ze.id)},Ze.name)}},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u4E0A\u6B21\u67E5\u91CD\u65F6\u95F4",dataIndex:"last_review_time",width:130}];return n.a.createElement(a.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Un,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(m.a)(s.a.mark(function Cn(){var Dt,Ze;return s.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Dt=An.getFieldValue(),Mt.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(Ee.a)(Dt.group_ids)}});case 3:if(Ze=Mt.sent,!(Ze.status===0)){Mt.next=11;break}return yr(),p.b.success("\u64CD\u4F5C\u6210\u529F"),Mt.next=9,sr({type:"shixunHomeworks/getWorkList",payload:En.actionTabs.params});case 9:R.d.push("/classrooms/".concat(Q.coursesId,"/program_homework/").concat(Q.categoryId,"/detail?tabs=2")),sr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return Mt.stop()}},Cn)})),onCancel:yr},En.codeReviewCourse&&n.a.createElement(Ht.a,{form:An,onChange:function(Dt){fn(Object(g.a)({},An.getFieldValue()))},initialValues:(Sn={},Object($e.a)(Sn,"group_ids",Fn),Object($e.a)(Sn,"end_time",W()(W()().add(7,"days").format("YYYY-MM-DD HH:mm"))),Sn)},n.a.createElement("div",{className:"flexd-table-header mt20"},n.a.createElement(Y.a,{pagination:!1,dataSource:[],columns:Ln})),n.a.createElement(Ht.a.Item,{name:"group_ids"},n.a.createElement(ut.a.Group,{className:"w100"},n.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},n.a.createElement(X.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(Dt){vn()},hasMore:ot,useWindow:!1},n.a.createElement(Y.a,{loading:ur.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:Ln,dataSource:rt,pagination:!1})))))),n.a.createElement(Ve.a,null,n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(ut.a,{checked:jn,onChange:function(Dt){pn(Dt.target.checked);var Ze=[];Dt.target.checked&&(Ze=rt.filter(function(It){return It.works_count>1}).map(function(It){return It.id+""})),An.setFieldsValue(Object($e.a)({},"group_ids",Ze))}},"\u5168\u9009"))))},N=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading;return{shixunHomeworks:yn,loading:Sn}})(L),V=D("nPLb"),ne=D("XpUO"),J=D("bTeP"),Fe=D.n(J),Jt=D("HBuW"),In=D("NLgs"),Zn=D("m3rI"),ln=D("+92d"),ir=D.n(ln),tr=D("wwSX"),Mr=D.n(tr),ui=D("zlzj"),oi=D.n(ui),Gr=D("deN7"),Li=[ir.a,Mr.a,oi.a],Vi=function(yn){var Sn,En,ur=yn.user,sr=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(T.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(z.s)()?[ur.userInfo.course.course_group_id]:[]},Object(T.i)())),Q=Object(o.a)(sr,2),de=Q[0],Te=Q[1],Se=Object(i.useState)([]),rt=Object(o.a)(Se,2),De=rt[0],Je=rt[1],it=Object(i.useState)([]),At=Object(o.a)(it,2),Ct=At[0],We=At[1],gt=Object(i.useState)([]),ot=Object(o.a)(gt,2),dt=ot[0],wt=ot[1],kt=Object(i.useState)(!1),mt=Object(o.a)(kt,2),$t=mt[0],hn=mt[1],Pn=Object(i.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(Wt,Rt,Un){return Wt<4?n.a.createElement("img",{src:Li[Wt-1]}):Wt}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(Wt,Rt,Un){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Zn.a.IMG_SERVER+"/images/"+(Rt==null?void 0:Rt.image_url)}),Wt)}},{title:"\u5206\u73ED",dataIndex:"course_group",key:"course_group",ellipsis:!0,width:150,fixed:"left"},{title:"\u5B66\u53F7",dataIndex:"student_id",key:"student_id",width:150,ellipsis:!0,fixed:"left",render:function(Wt){return Wt||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),Gn=Object(o.a)(Pn,2),On=Gn[0],Nn=Gn[1];Object(i.useEffect)(function(){On.splice(7);for(var fn=function(Rn){var Yt,ht,jn,pn,qn={};qn.title=De!=null&&De.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Rn+1)+"\uFF08".concat(De==null||((Yt=De.question_data)===null||Yt===void 0||((ht=Yt[Rn])===null||ht===void 0))?void 0:ht.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function Zt(){var An,Fn,vn;return s.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Ln.next=2,Object(O.a)("/api/problems/".concat(De==null||((An=De.question_data)===null||An===void 0||((Fn=An[Rn])===null||Fn===void 0))?void 0:Fn.identifier,"/start.json"),{method:"get"});case 2:vn=Ln.sent,vn&&(window.open("/myproblems/".concat(vn==null?void 0:vn.identifier,"?type=1")),localStorage.setItem("program_homework",[de.coursesId,de.categoryId]));case 4:case"end":return Ln.stop()}},Zt)}))},"\u9898\u76EE"+(Rn+1)+"\uFF08".concat(De==null||((jn=De.question_data)===null||jn===void 0||((pn=jn[Rn])===null||pn===void 0))?void 0:pn.question_score,"\uFF09")),qn.dataIndex="question_data",qn.width=250,qn.render=function(Zt,An){var Fn,vn,yr,Ln,Cn;return n.a.createElement("div",null,(Zt==null||((Fn=Zt[Rn])===null||Fn===void 0)?void 0:Fn.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(s.a.mark(function Dt(){var Ze,It,Mt,cn,zn,kn,lr,nr;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(Zt!=null&&(Ze=Zt[Rn])!==null&&Ze!==void 0&&Ze.open_code){mr.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),mr.abrupt("return");case 3:return mr.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},de),{},{id:de.coursesId,homework_common_id:de.categoryId,hack_user_code_id:Zt==null||((It=Zt[Rn])===null||It===void 0)?void 0:It.hack_user_code_id})});case 5:nr=mr.sent,a.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",Zt==null||((Mt=Zt[Rn])===null||Mt===void 0)?void 0:Mt.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Zt==null||((cn=Zt[Rn])===null||cn===void 0)?void 0:cn.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Zt==null||((zn=Zt[Rn])===null||zn===void 0)?void 0:zn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Zt==null||((kn=Zt[Rn])===null||kn===void 0)?void 0:kn.score)),content:n.a.createElement(Gr.a,{languages:[{language:Zt==null||((lr=Zt[Rn])===null||lr===void 0)?void 0:lr.language,code:nr==null?void 0:nr.code}],v:Zt,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Zt.language,game_id:Zt.id,diff_code_count:Zt.diff_code_count})});case 7:case"end":return mr.stop()}},Dt)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Zt==null||((vn=Zt[Rn])===null||vn===void 0)?void 0:vn.answer_question_time)||"- -"),Zt!=null&&(yr=Zt[Rn])!==null&&yr!==void 0&&yr.submit_count?n.a.createElement(k.a,{title:"".concat((Zt==null||((Ln=Zt[Rn])===null||Ln===void 0)?void 0:Ln.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Zt==null||((Cn=Zt[Rn])===null||Cn===void 0)?void 0:Cn.submit_count)||0):null))},On.push(qn)},Wt=0;Wt<(De==null||((Rt=De.question_data)===null||Rt===void 0)?void 0:Rt.length);Wt++){var Rt;fn(Wt)}Nn(Object(Ee.a)(On))},[De==null?void 0:De.question_data]),Object(i.useEffect)(function(){var fn;ur!=null&&(fn=ur.userInfo)!==null&&fn!==void 0&&fn.course&&(Object(z.s)()&&(de.course_group=Object(z.s)()?[ur.userInfo.course.course_group_id]:[],Te(Object(g.a)({},de))),Mn(1))},[ur==null?void 0:ur.userInfo]);function Mn(fn){return Pt.apply(this,arguments)}function Pt(){return Pt=Object(m.a)(s.a.mark(function fn(Wt){var Rt,Un,Rn,Yt,ht,jn,pn;return s.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return hn(!0),Zt.next=3,Object(O.a)("/api/courses/rank_list.json",{method:"get",params:Object(g.a)(Object(g.a)({},de),{},{id:de.coursesId,rank_type:2,homework_common_id:de.categoryId})});case 3:if(Rt=Zt.sent,Je(Rt),hn(!1),Object(z.s)()?(Wt===1&&We([Rt==null||((Un=Rt.course_group)===null||Un===void 0||((Rn=Un[0])===null||Rn===void 0))?void 0:Rn.id]),Rt!=null&&Rt.my_rank?wt([Rt==null?void 0:Rt.my_rank].concat(Object(Ee.a)(Rt==null?void 0:Rt.rank_list))):wt(Object(Ee.a)(Rt==null?void 0:Rt.rank_list))):wt(Object(Ee.a)(Rt==null?void 0:Rt.rank_list)),Wt===1){for(Yt={title:n.a.createElement(k.a,{title:`\u603B\u8017\u65F6\u65F6\u4E3A\u505A\u9898\u901A\u8FC7\u65F6\u957F\u548C\u7F5A\u65F6\u65F6\u957F\u7684\u603B\u548C\uFF0C
|
|
\u7F5A\u65F6\u65F6\u957F=\u8BC4\u6D4B\u51FA\u9519\u6B21\u6570X\u8BBE\u7F6E\u7684\u7F5A\u65F6\uFF08\u5F53\u524D\u4E3A`.concat(Rt==null?void 0:Rt.punish_time,"\u5206\uFF09")},n.a.createElement("span",{style:{marginRight:3}},"\u603B\u8017\u65F6")," ",n.a.createElement("span",{style:{fontSize:"14px"},className:"iconfont icon-tishixiaowenhao c-blue"})),dataIndex:"finish_time",width:150,ellipsis:!0,fixed:"left",key:"finish_time"},On.push(Yt),ht=function(Fn){var vn,yr,Ln,Cn,Dt={};Dt.title=Rt!=null&&Rt.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(Rt==null||((vn=Rt.question_data)===null||vn===void 0||((yr=vn[Fn])===null||yr===void 0))?void 0:yr.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function Ze(){var It,Mt,cn;return s.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(O.a)("/api/problems/".concat(Rt==null||((It=Rt.question_data)===null||It===void 0||((Mt=It[Fn])===null||Mt===void 0))?void 0:Mt.identifier,"/start.json"),{method:"get"});case 2:cn=kn.sent,cn&&(window.open("/myproblems/".concat(cn==null?void 0:cn.identifier,"?type=1")),localStorage.setItem("program_homework",[de.coursesId,de.categoryId]));case 4:case"end":return kn.stop()}},Ze)}))},"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(Rt==null||((Ln=Rt.question_data)===null||Ln===void 0||((Cn=Ln[Fn])===null||Cn===void 0))?void 0:Cn.question_score,"\uFF09")),Dt.dataIndex="question_data",Dt.width=250,Dt.render=function(Ze,It){var Mt,cn,zn,kn,lr;return n.a.createElement("div",null,(Ze==null||((Mt=Ze[Fn])===null||Mt===void 0)?void 0:Mt.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(s.a.mark(function nr(){var Or,mr,Er,Zr,Yr,Jr,vi,_i;return s.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:if(Ze!=null&&(Or=Ze[Fn])!==null&&Or!==void 0&&Or.open_code){je.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),je.abrupt("return");case 3:return je.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},de),{},{id:de.coursesId,homework_common_id:de.categoryId,hack_user_code_id:Ze==null||((mr=Ze[Fn])===null||mr===void 0)?void 0:mr.hack_user_code_id})});case 5:_i=je.sent,a.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",Ze==null||((Er=Ze[Fn])===null||Er===void 0)?void 0:Er.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Ze==null||((Zr=Ze[Fn])===null||Zr===void 0)?void 0:Zr.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Ze==null||((Yr=Ze[Fn])===null||Yr===void 0)?void 0:Yr.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Ze==null||((Jr=Ze[Fn])===null||Jr===void 0)?void 0:Jr.score)),content:n.a.createElement(Gr.a,{languages:[{language:Ze==null||((vi=Ze[Fn])===null||vi===void 0)?void 0:vi.language,code:_i==null?void 0:_i.code}],v:Ze,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Ze.language,game_id:Ze.id,diff_code_count:Ze.diff_code_count})});case 7:case"end":return je.stop()}},nr)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Ze==null||((cn=Ze[Fn])===null||cn===void 0)?void 0:cn.answer_question_time)||"- -"),Ze!=null&&(zn=Ze[Fn])!==null&&zn!==void 0&&zn.submit_count?n.a.createElement(k.a,{title:"".concat((Ze==null||((kn=Ze[Fn])===null||kn===void 0)?void 0:kn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Ze==null||((lr=Ze[Fn])===null||lr===void 0)?void 0:lr.submit_count)||0):null))},On.push(Dt)},jn=0;jn<(Rt==null||((pn=Rt.question_data)===null||pn===void 0)?void 0:pn.length);jn++)ht(jn);Nn(Object(Ee.a)(On))}case 8:case"end":return Zt.stop()}},fn)})),Pt.apply(this,arguments)}return console.log("----",On),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(De==null?void 0:De.message)==="\u5C01\u699C\u4E2D"?n.a.createElement(Z.a,{customText:"\u7B54\u9898\u65F6\u95F4\u8FDB\u5165\u5012\u8BA1\u65F6\uFF0C\u6682\u65F6\u5C01\u699C\uFF0C\u8BF7\u52A0\u901F\u7ADE\u6280\u901A\u5173\u7B54\u9898"}):n.a.createElement("div",{style:{background:"#fff",padding:20}},n.a.createElement("div",{style:{display:"inline-flex"}},n.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5\uFF1A"),Object(z.c)()&&n.a.createElement("div",{style:{flex:1}},n.a.createElement(ut.a.Group,{className:Fe.a.checkboxgroup,value:Ct,onChange:function(Wt){if(de.type===1)We([]),de.course_group=[],de.page=1,Te(Object(g.a)({},de)),Mn();else if(de.type===2){var Rt;We(["\u5168\u90E8"].concat()),de.course_group=De==null||((Rt=De.course_group)===null||Rt===void 0)?void 0:Rt.map(function(Un){return Un.id}),de.page=1,Te(Object(g.a)({},de)),Mn()}else We(Object(Ee.a)(Wt.filter(function(Un){return Un!="\u5168\u90E8"}))),de.course_group=Wt.filter(function(Un){return Un!="\u5168\u90E8"}),de.page=1,Te(Object(g.a)({},de)),Mn()}},n.a.createElement(ut.a,{value:"\u5168\u90E8",onChange:function(Wt){Wt.target.checked?de.type=2:de.type=1}},"\u5168\u90E8\u5206\u73ED"),De==null||((Sn=De.course_group)===null||Sn===void 0)?void 0:Sn.map(function(fn,Wt){return n.a.createElement(ut.a,{onChange:function(Un){de.type=3},value:fn.id},fn==null?void 0:fn.name)}))),Object(z.s)()&&n.a.createElement(_e.a.Group,{onChange:function(Wt){Wt.target.value==="\u5168\u90E8"?(de.course_group=[],de.page=1,Te(Object(g.a)({},de)),Mn()):(de.course_group=[Wt.target.value],de.page=1,Te(Object(g.a)({},de)),Mn())},defaultValue:ur.userInfo.course.course_group_id},n.a.createElement(_e.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),De==null||((En=De.course_group)===null||En===void 0)?void 0:En.map(function(fn,Wt){return n.a.createElement(_e.a,{value:fn.id},fn.name)}))),Object(z.c)()&&n.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:10}},n.a.createElement("span",{style:{fontSize:14,color:"#B1BACD"}},"\u6392\u884C\u89C4\u5219\uFF1A\u65F6\u95F4\u7ED3\u675F\u540E\u6B63\u5F0F\u5C01\u699C\uFF0C\u65F6\u95F4\u6BB5\u4E4B\u5916\u7684\u63D0\u4EA4\u4E0D\u8BA1\u5165\u6392\u884C\u3002"," ",n.a.createElement("a",{onClick:function(){a.a.warning({title:"\u8BA1\u5206\u89C4\u5219",width:500,content:n.a.createElement("div",null,n.a.createElement("p",null,"\u6392\u540D\u89C4\u5219\uFF1A\u7ECF\u5178ACM\u89C4\u5219"),n.a.createElement("p",null,"AC\uFF08\u901A\u8FC7\u9898\u76EE\uFF09\u8D8A\u591A\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"AC\u76F8\u540C\uFF0C\u603B\u7528\u65F6\u8D8A\u5C11\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"\u603B\u7528\u65F6=\u2211\uFF08\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6\uFF09"),n.a.createElement("p",null,"\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6=\u6BD4\u8D5B\u5F00\u59CB\u5230\u63D0\u4EA4\u88AB\u901A\u8FC7\u7684\u65F6\u95F4+\u7F5A\u65F6"),n.a.createElement("p",null,"\u7F5A\u65F6=\uFF08\u901A\u8FC7\u524D\uFF09\u9519\u8BEF\u4EE3\u7801\u63D0\u4EA4\u6B21\u6570*\u6BCF\u6B21\u7F5A\u65F6"),n.a.createElement("p",null,"\u4E0D\u7B97\u7F5A\u65F6\u7684\u60C5\u51B5\uFF1A\u6CA1\u6709\u901A\u8FC7\u7684\u9898\u76EE\u3001\uFF08\u7CFB\u7EDF\uFF09\u5185\u90E8\u9519\u8BEF\u3001\u7F16\u8BD1\u9519\u8BEF"))})}},"\u70B9\u51FB\u67E5\u770B\u8BA1\u5206\u89C4\u5219")),n.a.createElement(P.a,{onClick:function(){Object(ye.x)(Object(g.a)(Object(g.a)({},de),{},{id:de.coursesId,rank_type:2,homework_common_id:de.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(f.a,{spinning:$t},n.a.createElement(Y.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(Wt,Rt){return Rt===0&&Object(z.s)()&&Fe.a.tables},dataSource:dt,columns:On})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(y.a,{current:de.page,pageSize:de.per_page,total:De==null?void 0:De.count,hideOnSinglePage:!0,onChange:function(Wt,Rt){de.page=Wt,de.per_page=Rt,Te(Object(g.a)({},de)),Mn()}}))))},Ar=Object(R.a)(function(Hn){var yn=Hn.user;return{user:yn}})(Vi),Tr=[{live:"A",gz:"0\u4E2A\u9519\u8BEF",ld:"0\u4E2A\u6F0F\u6D1E",gf:"0 - 5%"},{live:"B",gz:"\u81F3\u5C111\u4E2A\u6B21\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u6B21\u8981\u6F0F\u6D1E",gf:"6% - 10%"},{live:"C",gz:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u6F0F\u6D1E",gf:"11% - 20%"},{live:"D",gz:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u6F0F\u6D1E",gf:"21% - 50%"},{live:"E",gz:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u6F0F\u6D1E",gf:"\u8D85\u8FC750%"}],ii=function(yn){var Sn,En=yn.shixunHomeworks,ur=yn.globalSetting,sr=yn.loading,Q=yn.dispatch,de=Object(T.i)(),Te=Object(T.h)(),Se=Object(T.g)(),rt=Object(i.useState)([]),De=Object(o.a)(rt,2),Je=De[0],it=De[1],At=Object(i.useState)(Te.query.tabs||"0"),Ct=Object(o.a)(At,2),We=Ct[0],gt=Ct[1],ot=Object(i.useState)({}),dt=Object(o.a)(ot,2),wt=dt[0],kt=dt[1],mt=En.workList,$t=Object(i.useState)(!1),hn=Object(o.a)($t,2),Pn=hn[0],Gn=hn[1],On;de.category=Te.query.category_id,de.order="work_score",de.b_order="desc";var Nn=function(Yt){gt(Yt),Yt==="0"&&Q({type:"shixunHomeworks/getWorkList",payload:de})},Mn=function(){a.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u4F60\u5728\u8BE5\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A\uFF0C\u65E0\u6CD5\u6062\u590D",n.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u91CD\u505A\uFF1F"),onOk:function(){var Yt=Object(m.a)(s.a.mark(function jn(){var pn,qn,Zt;return s.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return qn=(pn=En.workList)===null||pn===void 0?void 0:pn.myshixun_identifier,Fn.next=3,Object(xt.X)({id:qn});case 3:Zt=Fn.sent,Zt&&(p.b.info(`\u5DF2\u6E05\u7A7A\u672C\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55
|
|
|
|
\u8BF7\u70B9\u51FB\u201C\u5F00\u542F\u6311\u6218\u201D\u91CD\u505A\u8BFE\u7A0B\u5B9E\u9A8C`),Q({type:"shixunHomeworks/getWorkList",payload:wt}));case 5:case"end":return Fn.stop()}},jn)}));function ht(){return Yt.apply(this,arguments)}return ht}()})},Pt=function Rn(Yt){var ht;Yt=(ht=Yt)!==null&&ht!==void 0&&ht.includes(".json")?Yt:"".concat(Yt,".json"),a.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var jn=Object(m.a)(s.a.mark(function qn(){var Zt,An;return s.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object(Jt.Bb)({url:Yt});case 2:if(Zt=vn.sent,Zt){vn.next=5;break}return vn.abrupt("return");case 5:return p.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),vn.next=8,Object(Jt.E)({id:Zt.shixun_identifier});case 8:if(An=vn.sent,!(An!=null&&An.game_identifier)){vn.next=12;break}return Object(v.U)("/tasks/".concat(An.game_identifier,"?coursesId=").concat(de.coursesId)),vn.abrupt("return");case 12:(An==null?void 0:An.status)===2?Rn(An==null?void 0:An.message):(An==null?void 0:An.status)===3&&fn(An==null?void 0:An.message);case 13:case"end":return vn.stop()}},qn)}));function pn(){return jn.apply(this,arguments)}return pn}()})},fn=function(Yt){a.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",Yt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Wt=function(){var Rn=Object(m.a)(s.a.mark(function Yt(ht){var jn,pn;return s.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return ht=(jn=ht)!==null&&jn!==void 0&&jn.includes(".json")?ht:"".concat(ht,".json"),Zt.next=3,Object(Jt.Bb)({url:ht});case 3:if(pn=Zt.sent,console.log(pn,"execRes"),!(pn!=null&&pn.game_identifier)){Zt.next=8;break}return Object(v.U)("/tasks/".concat(pn.game_identifier,"?coursesId=").concat(de.coursesId)),Zt.abrupt("return");case 8:(pn==null?void 0:pn.status)===-3?Object(v.s)():(pn==null?void 0:pn.status)===2?Pt(pn==null?void 0:pn.message):(pn==null?void 0:pn.status)===3&&fn(pn==null?void 0:pn.message);case 9:case"end":return Zt.stop()}},Yt)}));return function(ht){return Rn.apply(this,arguments)}}(),Rt=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(St,{setExportParams:kt}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement(Ce,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(Ar,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(en,null)},{name:Object(z.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement(ni,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(de.coursesId,"/program_homework/").concat(de.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(Rn){var Yt;if(Object(z.s)())return Rn.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(z.s)()||(mt==null||((Yt=mt.homework_status)===null||Yt===void 0)?void 0:Yt[0])!=="\u5DF2\u622A\u6B62")return Rn.name!=="\u8D28\u91CF\u68C0\u6D4B";var ht;return!mt.code_review&&(mt==null||((ht=mt.homework_status)===null||ht===void 0)?void 0:ht[0])!=="\u672A\u53D1\u5E03"?!0:Rn.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(Rn){return mt.open_code_quality_analysis?!0:Rn.name!=="\u8D28\u91CF\u68C0\u6D4B"}),Un=function(){var Yt,ht,jn,pn,qn,Zt,An,Fn;return n.a.createElement("aside",{className:Fe.a.workListTabButton},Object(z.s)()&&((Yt=En.workList)===null||Yt===void 0?void 0:Yt.redo_work)&&n.a.createElement(P.a,{onClick:Mn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((ht=En.workList)===null||ht===void 0?void 0:ht.shixun_status)>1&&((jn=En.workList)===null||jn===void 0?void 0:jn.time_status)<5&&Object(z.s)()&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var yr,Ln,Cn,Dt,Ze,It,Mt;if(!Object(In.e)(Q,!0))return;(yr=En.workList)!==null&&yr!==void 0&&(Ln=yr.task_operation)!==null&&Ln!==void 0&&(Cn=Ln[1])!==null&&Cn!==void 0&&Cn.includes("/")?Wt((Dt=En.workList)===null||Dt===void 0||((Ze=Dt.task_operation)===null||Ze===void 0)?void 0:Ze[1]):Object(v.U)("/tasks/".concat((It=En.workList)===null||It===void 0||((Mt=It.task_operation)===null||Mt===void 0)?void 0:Mt[1]))}},(pn=En.workList)===null||pn===void 0||((qn=pn.task_operation)===null||qn===void 0)?void 0:qn[0]),((Zt=En.workList)===null||Zt===void 0?void 0:Zt.commit_des)&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var yr;Object(v.U)("/classrooms/".concat(de.coursesId,"/shixun_homework/").concat(de.categoryId,"/").concat((yr=En.workList)===null||yr===void 0?void 0:yr.id,"/commitsummary"))}},(An=En.workList)===null||An===void 0?void 0:An.commit_des),Object(z.c)()&&(mt==null||((Fn=mt.homework_status)===null||Fn===void 0)?void 0:Fn[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){Se.push("/classrooms/".concat(de.coursesId,"/program_homework/").concat(de.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(z.c)()&&mt.publish_immediately&&n.a.createElement(P.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){Q({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[de.categoryId],selectArrsAll:[mt],params:de,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(z.c)()&&mt.end_immediately&&n.a.createElement(P.a,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){Q({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:de,type:2,detail:!0,selectArrs:[de.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},mt.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},mt.category&&n.a.createElement(I.a,{separator:">"},n.a.createElement(I.a.Item,null,n.a.createElement(w.a,{to:"/classrooms/".concat(mt.course_id,"/program_homework")},mt.course_name)),n.a.createElement(I.a.Item,null,n.a.createElement(w.a,{to:"/classrooms/".concat(mt.course_id,"/program_homework/").concat(mt.category.main?"":mt.category.category_id)},mt.category.category_name)),n.a.createElement(I.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[Fe.a.title,"mt20"].join(" ")},n.a.createElement(w.a,{to:"/classrooms/".concat(mt.course_id,"/program_homework/").concat(mt.category.main?"":mt.category.category_id)},n.a.createElement(S.a,{className:"font16 c-black"})),n.a.createElement(k.a,{title:mt.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},mt.homework_name)),n.a.createElement(v.o,{temporary:!0,status:mt.homework_status}),Object(z.s)()&&n.a.createElement("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},n.a.createElement(P.a,{onClick:Object(m.a)(s.a.mark(function Rn(){var Yt,ht;return s.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(O.a)("/api/problems/".concat((Yt=En.workList)===null||Yt===void 0?void 0:Yt.start_identifier,"/start.json"),{method:"get"});case 2:ht=pn.sent,ht&&(window.open("/myproblems/".concat(ht==null?void 0:ht.identifier,"?type=1")),localStorage.setItem("program_homework",[de.coursesId,de.categoryId]));case 4:case"end":return pn.stop()}},Rn)})),type:"primary"},(Sn=mt.homework_status)!==null&&Sn!==void 0&&Sn.includes("\u5DF2\u622A\u6B62")?"\u67E5\u770B\u4F5C\u4E1A":"\u8FDB\u5165\u7EC3\u4E60"," ")))),n.a.createElement("aside",{className:"mt30 relative ".concat(Fe.a.workListTabWrap)},n.a.createElement(G.a,{type:"card",defaultActiveKey:We,activeKey:We,tabBarExtraContent:Un(),onChange:Nn},Rt.map(function(Rn,Yt){return n.a.createElement(G.a.TabPane,{tab:Rn.name,key:Rn.id,forceRender:Rn.forceRender},Rn.compontent)})))),n.a.createElement(N,null),n.a.createElement(V.a,{courseEndTime:mt==null?void 0:mt.course_end_date}),n.a.createElement(ne.a,{courseEndTime:mt==null?void 0:mt.course_end_date}),n.a.createElement(a.a,{visible:Pn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){Gn(!1)}},n.a.createElement("p",null,"\u4E00\u3001\u7B49\u7EA7\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"1. \u7F3A\u9677\u7B49\u7EA7"),n.a.createElement("p",{style:{marginLeft:"10px"}},n.a.createElement(Y.a,{dataSource:Tr,columns:[{title:"\u7B49\u7EA7",dataIndex:"live"},{title:"\u7F3A\u9677\u8BC4\u4F30\u89C4\u5219",dataIndex:"gz"},{title:"\u6F0F\u6D1E\u8BC4\u4F30\u89C4\u5219",dataIndex:"ld"},{title:"\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219",dataIndex:"gf"}],pagination:!1})),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219\u4E2D\u6570\u503C\u6765\u6E90\u4E3A\u8BA1\u7B97\u6280\u672F\u503A\u52A1\u65F6\u95F4\u5360\u5F00\u53D1\u6240\u6709\u4EE3\u7801\u6240\u9700\u8981\u7684\u65F6\u95F4\u7684\u6BD4\u4F8B\uFF08Technical Debt Ratio\uFF09"),n.a.createElement("p",{style:{marginLeft:"20px"}},"Technical Debt Ratio = \u6280\u672F\u503A\u52A1\u65F6\u95F4 / \u5F00\u53D1\u65F6\u95F4"),n.a.createElement("p",{style:{marginLeft:"20px"}},"\u6280\u672F\u503A\u52A1\u65F6\u95F4\u4E3A\u4FEE\u590D\u6240\u6709\u95EE\u9898\u6240\u9700\u8981\u7684\u65F6\u95F4\u3002"),n.a.createElement("p",null,"\u4E8C\u3001\u590D\u6742\u5EA6\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6839\u636E\u4EE3\u7801\u8DEF\u5F84\u6570\u8BA1\u7B97\u7684\u6570\u503C\uFF0C\u6BCF\u5F53\u4E00\u4E2A\u51FD\u6570\u7684\u63A7\u5236\u6D41\u5206\u53C9\u65F6\uFF0C\u590D\u6742\u5EA6\u8BA1\u6570\u5668\u5C31\u4F1A\u81EA\u589E\u4E00\u3002"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6BCF\u4E2A\u7A0B\u5E8F\u8BED\u8A00\u7684\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u590D\u6742\u5EA6\u6570\u636E\u4E0D\u540C\uFF0C\u4F46\u6BCF\u4E2A\u51FD\u6570\u7684\u6700\u5C0F\u590D\u6742\u5EA6\u4E3A1\u3002\uFF08\u7279\u5B9A\u8BED\u8A00\u7684\u8BE6\u7EC6\u6570\u636E\u7565\uFF09"),n.a.createElement("p",null,"\u4E09\u3001\u4EE3\u7801\u8D28\u91CF\u5206\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u4EE3\u7801\u8D28\u91CF\u5206 = 0.5*\u7F3A\u9677\u5206\u6570 + 0.3*\u6F0F\u6D1E\u5206\u6570 + 0.2*\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u5176\u4E2D\uFF1A"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u7F3A\u9677/\u6F0F\u6D1E/\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570\u8BA1\u7B97\u89C4\u5219\u4E3A\uFF1A100 - 100 *((100*\u5D29\u6E83\u6570 + 5*\u4E25\u91CD\u6570 + 3*\u4E3B\u8981\u6570 + 1*\u6B21\u6570\uFF09/ \u4EE3\u7801\u884C\u6570\uFF09"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u5206\u6570\u4E3A\u7A7A\u7684\u4EE3\u8868\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F\u3002")))},Br=fe.default=Object(R.a)(function(Hn){var yn=Hn.shixunHomeworks,Sn=Hn.loading,En=Hn.globalSetting;return{shixunHomeworks:yn,globalSetting:En,loading:Sn.effects}})(ii)},OLES:function(Gt,fe,D){"use strict";var q=D("U8pU"),Y=D("VTBJ"),U=D("Ff2n"),G=D("q1tI"),M=D("uciX"),k=D("7ixt"),K=function(m){var u=m.overlay,a=m.prefixCls,o=m.id,c=m.overlayInnerStyle;return G.createElement("div",{className:"".concat(a,"-inner"),id:o,role:"tooltip",style:c},typeof u=="function"?u():u)},I=K,r=function(m,u){var a=m.overlayClassName,o=m.trigger,c=o===void 0?["hover"]:o,s=m.mouseEnterDelay,i=s===void 0?0:s,n=m.mouseLeaveDelay,O=n===void 0?.1:n,T=m.overlayStyle,w=m.prefixCls,R=w===void 0?"rc-tooltip":w,S=m.children,v=m.onVisibleChange,E=m.afterVisibleChange,f=m.transitionName,h=m.animation,y=m.placement,g=y===void 0?"right":y,x=m.align,j=x===void 0?{}:x,F=m.destroyTooltipOnHide,A=F===void 0?!1:F,W=m.defaultVisible,H=m.getTooltipContainer,C=m.overlayInnerStyle,z=Object(U.a)(m,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Z=Object(G.useRef)(null);Object(G.useImperativeHandle)(u,function(){return Z.current});var le=Object(Y.a)({},z);"visible"in m&&(le.popupVisible=m.visible);var se=function(){var Xe=m.arrowContent,_e=Xe===void 0?null:Xe,pe=m.overlay,at=m.id;return[G.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},_e),G.createElement(I,{key:"content",prefixCls:R,id:at,overlay:pe,overlayInnerStyle:C})]},Ce=!1,Ee=!1;if(typeof A=="boolean")Ce=A;else if(A&&Object(q.a)(A)==="object"){var Ie=A.keepParent;Ce=Ie===!0,Ee=Ie===!1}return G.createElement(M.a,Object.assign({popupClassName:a,prefixCls:R,popup:se,action:c,builtinPlacements:k.a,popupPlacement:g,ref:Z,popupAlign:j,getPopupContainer:H,onPopupVisibleChange:v,afterPopupVisibleChange:E,popupTransitionName:f,popupAnimation:h,defaultPopupVisible:W,destroyPopupOnHide:Ce,autoDestroy:Ee,mouseLeaveDelay:O,popupStyle:T,mouseEnterDelay:i},le),S)},P=Object(G.forwardRef)(r),_=fe.a=P},OZM5:function(Gt,fe,D){"use strict";D.d(fe,"b",function(){return P}),D.d(fe,"a",function(){return _}),D.d(fe,"k",function(){return p}),D.d(fe,"h",function(){return m}),D.d(fe,"i",function(){return u}),D.d(fe,"g",function(){return a}),D.d(fe,"c",function(){return o}),D.d(fe,"d",function(){return c}),D.d(fe,"j",function(){return n}),D.d(fe,"e",function(){return O}),D.d(fe,"f",function(){return T});var q=D("KQm4"),Y=D("U8pU"),U=D("Ff2n"),G=D("q1tI"),M=D.n(G),k=D("Kwbf"),K=D("WaYH"),I=.25,r=2;function P(w,R){var S=w.slice(),v=S.indexOf(R);return v>=0&&S.splice(v,1),S}function _(w,R){var S=w.slice();return S.indexOf(R)===-1&&S.push(R),S}function p(w){return w.split("-")}function m(w,R){return"".concat(w,"-").concat(R)}function u(w){return w&&w.type&&w.type.isTreeNode}function a(w,R){var S=[w],v=R[w];function E(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(h){var y=h.key,g=h.children;S.push(y),E(g)})}return E(v.children),S}function o(w,R){var S=w.clientY,v=R.selectHandle.getBoundingClientRect(),E=v.top,f=v.bottom,h=v.height,y=Math.max(h*I,r);return S<=E+y?-1:S>=f-y?1:0}function c(w,R){if(!w)return;var S=R.multiple;return S?w.slice():w.length?[w[0]]:w}var s=function(R){return R};function i(w,R){if(!w)return[];var S=R||{},v=S.processProps,E=v===void 0?s:v,f=Array.isArray(w)?w:[w];return f.map(function(h){var y=h.children,g=Object(U.a)(h,["children"]),x=i(y,R);return M.a.createElement(K.a,Object.assign({},E(g)),x)})}function n(w){if(!w)return null;var R;if(Array.isArray(w))R={checkedKeys:w,halfCheckedKeys:void 0};else if(Object(Y.a)(w)==="object")R={checkedKeys:w.checked||void 0,halfCheckedKeys:w.halfChecked||void 0};else return Object(k.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function O(w,R){var S=new Set;function v(E){if(S.has(E))return;var f=R[E];if(!f)return;S.add(E);var h=f.parent,y=f.node;if(y.disabled)return;h&&v(h.key)}return(w||[]).forEach(function(E){v(E)}),Object(q.a)(S)}function T(w){var R={};return Object.keys(w).forEach(function(S){(S.startsWith("data-")||S.startsWith("aria-"))&&(R[S]=w[S])}),R}},Ot1p:function(Gt,fe,D){"use strict";var q=D("2qtc"),Y=D("kLXV"),U=D("rAM+"),G=D("miYZ"),M=D("tsqr"),k=D("9og8"),K=D("tJVT"),I=D("jrin"),r=D("WmNS"),P=D.n(r),_=D("q1tI"),p=D.n(_),m=D("VrN/"),u=D.n(m),a=D("bdgK"),o=D("p77/"),c=D("Bd2K"),s=D("ELLl"),i=D("19Vz"),n=D("lZu9"),O=D("+NIl"),T=D("kSUc"),w=D("9Bee"),R=function(ye){var Be=ye.value,St=Be===void 0?"":Be,an=ye.className,Dn=ye.showTextOnly,yt=ye.showLines,en=ye.style,_t=en===void 0?{}:en,Et=Object(_.useMemo)(function(){return""},[St]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Et}}))},S=D("0Owb"),v=D("dejd"),E=D("C+DQ"),f=D("1vsH"),h=D("m3rI"),y=[{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(ye){var Be=ye.onActionCallback,St=ye.title,an=ye.icon,Dn=ye.actionName,yt=ye.className,en=yt===void 0?"":yt,_t=ye.children;function Et(){Be(Dn)}return p.a.createElement("a",{title:St,className:en,onClick:Et},p.a.createElement("i",{className:"md-iconfont ".concat(an)}),_t)}var x=function(ye){var Be=ye.watch,St=ye.showNullButton,an=ye.onActionCallback,Dn=ye.fullScreen,yt=ye.insertTemp,en=ye.hidetoolBar,_t=ye.uuid,Et=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.H)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.H)("_educoder_session"),"&key=").concat(_t,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var st=[].concat(y,[{title:"".concat(Be?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Be?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!en&&st.map(function(he,Le){return p.a.createElement("li",{key:Le},he.actionName?p.a.createElement(g,Object(S.a)({},he,{onActionCallback:an})):p.a.createElement("span",{className:"v-line"}))}),St?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:an},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,yt&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(yt),onActionCallback:an},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(Dn?"icon-shrink":"icon-enlarge"),title:Dn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:an})))},j=D("M8RZ"),F=D("+L6B"),A=D("2/Rp"),W=D("y8nQ"),H=D("Vl3Y"),C=D("5NDa"),z=D("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},le=function(ye){var Be=ye.callback,St=ye.onCancel;function an(Dn){Be(Dn)}return p.a.createElement(H.a,Object(S.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:an}),p.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(z.a,null)),p.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(z.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))},se=D("7ahc"),Ce=D("HmJG"),Ee=D("BjJ7"),Ie=H.a.useForm,Qe={width:280,marginRight:10},Xe={labelCol:{span:5},wrapperCol:{span:19}},_e=function(ye){var Be=ye.callback,St=ye.onCancel,an=Ie(),Dn=Object(K.a)(an,1),yt=Dn[0];function en(st){Be(st)}function _t(st,he){if(st.status===-1){M.b.error(st.message);return}yt.setFieldsValue({src:"/api/attachments/".concat(st.id),type:he.type})}function Et(st){var he=st.target.files[0];at(he,_t)}return p.a.createElement(H.a,Object(S.a)({form:yt},Xe,{className:"upload-image-panel",onFinish:en}),p.a.createElement(H.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(H.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(z.a,{style:Qe})),p.a.createElement(pe,{onFileChange:Et}))),p.a.createElement(H.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(z.a,{style:{width:264}})),p.a.createElement(H.a.Item,{style:{textAlign:"right"}},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))};function pe(ye){var Be=ye.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Be}))}function at(ye,Be){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var St=new FormData;St.append("editormd-image-file",ye),St.append("file_param_name","editormd-image-file"),St.append("byxhr","true");var an=new window.XMLHttpRequest;an.withCredentials=!0,an.addEventListener("load",function(Dn){Be(JSON.parse(Dn.target.responseText),ye)},!1),an.addEventListener("error",function(Dn){console.error(Dn)},!1),an.open("POST","".concat(Ee.a,"/api/attachments.json")),an.send(St)}var Qt=D("giR+"),Ft=D("fyUT"),Tt=D("7Kak"),Ve=D("9yH6"),pt=Ve.a.Group,ut={margin:"0 8px"},Ut=function(ye){var Be=ye.callback,St=ye.onCancel;function an(Dn){Be(Dn)}return p.a.createElement(H.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:an},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:ut},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:ut},"\u884C\u6570"),p.a.createElement(H.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Ft.a,null)),p.a.createElement("span",{style:ut},"\u5217\u6570"),p.a.createElement(H.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Ft.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:ut},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(H.a.Item,{name:"align"},p.a.createElement(pt,null,p.a.createElement(Ve.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(Ve.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(Ve.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(Ve.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))},oe=D("ErOA"),Ue=D("7Cbv"),ze="link",$e="upload-image",Bt="code-block",Ht="add-table",qt="------------",tt={default:qt,left:":".concat(qt),center:":".concat(qt,":"),right:"".concat(qt,":")},nn=D("9VGf"),xn,Ge;function He(){}var vt=0,Ot=1e4,nt="\u2581",xt=`
|
|
**\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 Ae(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var ve=navigator.platform.toUpperCase().indexOf("MAC")>=0,we=ve?"Cmd":"Ctrl",ie=["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"],ae=(xn={},Object(I.a)(xn,we+"-B","bold"),Object(I.a)(xn,we+"-I","italic"),xn),me=(Ge={},Object(I.a)(Ge,ze,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(Ge,Bt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(Ge,$e,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(Ge,Ht,"\u6DFB\u52A0\u8868\u683C"),Ge),be=fe.a=function(ye){var Be=ye.defaultValue,St=Be===void 0?"":Be,an=ye.onChange,Dn=ye.width,yt=Dn===void 0?"100%":Dn,en=ye.height,_t=en===void 0?400:en,Et=ye.miniToolbar,st=Et===void 0?!1:Et,he=ye.isFocus,Le=he===void 0?!1:he,Lt=ye.watch,ct=ye.insertTemp,tn=ye.mode,un=tn===void 0?"markdown":tn,Pe=ye.id,et=Pe===void 0?"markdown-editor-id":Pe,jt=ye.showResizeBar,bn=jt===void 0?!1:jt,Kt=ye.noStorage,Xt=Kt===void 0?!1:Kt,Yn=ye.showNullButton,Bn=Yn===void 0?!1:Yn,_n=ye.hidetoolBar,br=_n===void 0?!1:_n,Fr=ye.fullScreen,hr=Fr===void 0?!1:Fr,Qn=ye.onBlur,Dr=ye.onCMBeforeChange,Kr=ye.onFullScreen,ti=ye.className,dn=ti===void 0?"":ti,rr=ye.disablePaste,fi=rr===void 0?!1:rr,wi=ye.placeholder,ni=wi===void 0?"":wi,ri=ye.values,X=ri===void 0?"":ri,L=Object(_.useState)(null),N=Object(K.a)(L,2),V=N[0],ne=N[1],J=Object(_.useState)(St),Fe=Object(K.a)(J,2),Jt=Fe[0],In=Fe[1],Zn=Object(_.useState)(Lt),ln=Object(K.a)(Zn,2),ir=ln[0],tr=ln[1],Mr=Object(_.useState)(hr),ui=Object(K.a)(Mr,2),oi=ui[0],Gr=ui[1],Li=Object(_.useState)(""),Vi=Object(K.a)(Li,2),Ar=Vi[0],Tr=Vi[1],ii=Object(_.useState)(0),Br=Object(K.a)(ii,2),Hn=Br[0],yn=Br[1],Sn=Object(_.useState)(_t),En=Object(K.a)(Sn,2),ur=En[0],sr=En[1],Q=Object(_.useState)(!1),de=Object(K.a)(Q,2),Te=de[0],Se=de[1],rt=Object(_.useRef)(Object(Ue.a)()),De=Object(_.useRef)(!1),Je=Object(_.useRef)(),it=Object(_.useRef)(),At=Object(_.useRef)(),Ct=Object(_.useRef)(),We=Object(_.useRef)(),gt=function(){var Pt=Object(k.a)(P.a.mark(function fn(){var Wt,Rt;return P.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return Rn.next=2,Object(oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:rt.current}});case 2:Rt=Rn.sent,Rt!=null&&(Wt=Rt.attachments)!==null&&Wt!==void 0&&Wt.length&&(console.log("cm:",V,it),Rt.attachments.map(function(Yt){Yt.content_type.indexOf("image")>-1?V.replaceSelection(".concat(Yt.content_type,")")):Yt.content_type.indexOf("video")>-1?V.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Yt.content_type.indexOf("pdf")>-1?V.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,'&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):V.replaceSelection("[".concat(Yt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}));case 4:case"end":return Rn.stop()}},fn)}));return function(){return Pt.apply(this,arguments)}}();Object(_.useEffect)(function(){In(X),V==null||V.setValue(X)},[X]),Object(_.useEffect)(function(){Kr==null||Kr(oi)},[oi]),Object(_.useEffect)(function(){if(it.current){var Pt=u.a.fromTextArea(it.current,{mode:un,lineNumbers:!st,lineWrapping:!0,value:St,autoCloseTags:!0,autoCloseBrackets:!0});Le&&Pt.focus();function fn(Wt,Rt){if(fi){Rt.preventDefault();return}var Un=Rt.clipboardData;if(Un){var Rn=Un.types.toString(),Yt=Un.items;if(Rn==="Files"||Un.types.indexOf("Files")>-1){if(Rt.preventDefault(),un=="stex")return;try{var ht,jn=Yt[1];((ht=Yt[0])===null||ht===void 0?void 0:ht.kind)==="file"&&(jn=Yt[0]);var pn=jn.getAsFile(),qn=pn.name.split(".").pop();at(pn,function(Zt){if(Zt.id){var An,Fn,vn;(pn==null||((An=pn.type)===null||An===void 0)?void 0:An.indexOf("image"))>-1?Pt.replaceSelection(".concat(Zt.content_type,")")):(pn==null||((Fn=pn.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Pt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,'"></video>')):(pn==null||((vn=pn.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(pn.type,'&disposition=inline" target="_blank">').concat(pn.name,"</a>")):ie.includes(qn)?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,'?type=office&disposition=inline" target="_blank">').concat(pn.name,"</a>")):Pt.replaceSelection("[".concat(pn.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(Zt.content_type,")"))}else(Zt==null?void 0:Zt.status)===401&&(document.location.href="/user/login")})}catch(Zt){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Pt.on("paste",fn),Pt.on("dragleave",function(Wt,Rt){At.current.classList.remove("mouse-hover-md")}),Pt.on("dragover",function(Wt,Rt){At.current.classList.add("mouse-hover-md")}),Pt.on("drop",function(Wt,Rt){At.current.classList.add("mouse-hover-md");var Un;if(Un=Rt.dataTransfer.files,Un.length>0){Rt.preventDefault(),Rt.stopPropagation();for(var Rn=function(jn){var pn=Un[jn],qn=pn.name.split(".").pop();at(pn,function(Zt){if(Zt.id){var An,Fn,vn;(pn==null||((An=pn.type)===null||An===void 0)?void 0:An.indexOf("image"))>-1?Pt.replaceSelection(".concat(Zt.content_type,")")):(pn==null||((Fn=pn.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Pt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,'"></video>')):(pn==null||((vn=pn.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(pn.type,'&disposition=inline" target="_blank">').concat(pn.name,"</a>")):ie.includes(qn)?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,'?type=office&disposition=inline" target="_blank">').concat(pn.name,"</a>")):Pt.replaceSelection("[".concat(pn.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(Zt.content_type,")"))}else(Zt==null?void 0:Zt.status)===401&&(document.location.href="/user/login")})},Yt=0;Yt<Un.length;Yt++)Rn(Yt)}}),ne(Pt),function(){Pt.off("paste",fn)}}},[]);var ot=Object(_.useCallback)(function(){if(At.current)try{}catch(Pt){console.log(Pt,"---- to set md editor body height")}},[ur,At,oi]);Object(_.useEffect)(function(){function Pt(){var Wt=new a.default(function(Rt){var Un=Object(U.a)(Rt),Rn;try{for(Un.s();!(Rn=Un.n()).done;){var Yt=Rn.value;(Yt.target.offsetHeight>0||Yt.target.offsetWidth>0)&&(ot(),V.setSize("100%","100%"),V.refresh())}}catch(ht){Un.e(ht)}finally{Un.f()}});return Wt.observe(it.current.parentElement),Wt}if(V){var fn=Pt();return function(){fn.unobserve(it.current.parentElement)}}},[V,ot]),Object(_.useEffect)(function(){if(V){for(var Pt=[],fn=function(){var Yt=Rt[Wt];Un=Object(K.a)(Yt,2);var ht=Un[0],jn=Un[1],pn=Object(I.a)({},ht,function(){dt(jn)});Pt.push(pn),V.addKeyMap(pn)},Wt=0,Rt=Object.entries(ae);Wt<Rt.length;Wt++){var Un;fn()}return Je.current=setInterval(function(){De.current&>()},4e3),function(){clearInterval(Je.current);var Rn=Object(U.a)(Pt),Yt;try{for(Rn.s();!(Yt=Rn.n()).done;){var ht=Yt.value;V.removeKeyMap(ht)}}catch(jn){Rn.e(jn)}finally{Rn.f()}}}},[V]),Object(_.useEffect)(function(){hr!==oi&&Gr(hr)},[hr]),Object(nn.a)(function(){if(!Xt&&Hn>0){var Pt=new Date().getTime(),fn=window.sessionStorage.getItem(et);Pt>=Hn+Ot&&(!fn||fn!==Jt)&&(window.sessionStorage.setItem(et,Jt),Se(!0))}},Ot),Object(_.useEffect)(function(){tr(Lt)},[V,Lt]),Object(_.useEffect)(function(){V&&(Le&&V.focus())},[V,Le]),Object(_.useEffect)(function(){if(ir&&V){var Pt=V.getScrollerElement();function fn(Wt){var Rt=Wt.target;if(We.current){var Un=Rt.scrollTop/Rt.scrollHeight;We.current.scrollTop=We.current.scrollHeight*Un}}return Pt.addEventListener("scroll",fn),function(){Pt.removeEventListener("scroll",fn)}}},[V,ir]),Object(_.useEffect)(function(){if(V&&Dr){function Pt(fn,Wt){Dr(fn,Wt)}return V.on("beforeChange",Pt),function(){V.off("beforeChange",Pt)}}},[V,Dr]),Object(_.useEffect)(function(){if(V&&Qn){function Pt(){Qn(V.getValue())}return V.on("blur",Pt),function(){V.off("blur",Pt)}}},[V,Qn]),Object(_.useEffect)(function(){if(V){function Pt(fn){var Wt=fn.getValue();In(Wt),yn(new Date().getTime()),fn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),an&&an(Wt)}return V.on("change",Pt),function(){V.off("change",Pt)}}},[V,an]),Object(_.useEffect)(function(){V&&(St==null?(V.setValue(""),In("")):St!==V.getValue()&&(V.setValue(St),In(St),V.setCursor(V.lineCount(),0)))},[V,St]);var dt=Object(_.useCallback)(function(Pt){var fn=V.getCursor(),Wt=V.getSelection(),Rt=Wt.split(`
|
|
`);switch(Pt){case"bold":return V.replaceSelection("**"+Wt+"**"),Wt===""&&V.setCursor(fn.line,fn.ch+2),V.focus();case"italic":return V.replaceSelection("*"+Wt+"*"),Wt===""&&V.setCursor(fn.line,fn.ch+1),V.focus();case"code":return V.replaceSelection("`"+Wt+"`"),Wt===""&&V.setCursor(fn.line,fn.ch+1),V.focus();case"inline-latex":return V.replaceSelection("`$$"+Wt+"$$`"),Wt===""&&V.setCursor(fn.line,fn.ch+3),V.focus();case"latex":return V.replaceSelection("```latex\n"+Wt+"\n```"),V.setCursor(fn.line+1,Wt.length+1),V.focus();case"line-break":return V.replaceSelection(`<br/>
|
|
`),V.focus();case"list-ul":return Wt===""?V.replaceSelection("- "+Wt):V.replaceSelection(Rt.map(function(Un){return Un===""?"":"- ".concat(Un)}).join(`
|
|
`)),V.focus();case"list-ol":return Wt===""?V.replaceSelection("1. "+Wt):V.replaceSelection(Rt.map(function(Un,Rn){return Un===""?"":"".concat(Rn+1,". ").concat(Un)}).join(`
|
|
`)),V.focus();case"add-null-ch":return Wt===""&&V.setCursor(fn.line,fn.ch+1),V.replaceSelection(nt),V.focus();case"inster-template-1":return Wt===""&&V.setCursor(fn.line,fn.ch),V.replaceSelection(xt),V.focus();case"eraser":return V.setValue(""),V.focus();case"trigger-watch":return tr(!ir),V.focus();case"trigger-full-screen":return Gr(!oi),V.focus();case ze:Tr(ze);return;case Bt:Tr(Bt);return;case $e:Tr($e);return;case Ht:Tr(Ht);return;default:throw new Error}},[V,ir,oi]),wt=Object(_.useCallback)(function(Pt){Tr("");switch(Ar){case ze:var fn=Pt.title,Wt=Pt.link;return V.replaceSelection("[".concat(fn,"](").concat(Wt,")")),V.focus();case Bt:var Rt=Pt.language,Un=Pt.content;return V.replaceSelection(["```"+Rt,Un,"```"].join(`
|
|
`)),V.focus();case $e:var Rn=Pt.src,Yt=Pt.alt;return Yt?V.replaceSelection(".concat(Rn,' "').concat(Yt,'" )')):V.replaceSelection("")),V.focus();case Ht:for(var ht=Pt.row,jn=Pt.col,pn=Pt.align,qn=`
|
|
`,Zt=0;Zt<ht;Zt++){for(var An=[],Fn=[],vn=0;vn<jn;vn++)Zt===1&&Fn.push(tt[pn]),An.push(" ");Zt===1&&(qn+="| ".concat(Fn.join(" | "),` |
|
|
`)),qn+="| ".concat(An.join(jn===1?"":" | "),` |
|
|
`)}return V.replaceSelection(qn+`
|
|
`),V.focus();default:throw new Error}},[V,Ar]),kt=Object(_.useMemo)(function(){switch(Ar){case ze:return p.a.createElement(le,{callback:wt,onCancel:mt});case Bt:return p.a.createElement(se.b,{callback:wt,onCancel:mt});case $e:return p.a.createElement(_e,{callback:wt,onCancel:mt});case Ht:return p.a.createElement(Ut,{callback:wt,onCancel:mt});default:return null}},[Ar]);function mt(){Tr("")}Object(_.useEffect)(function(){if(Ct.current){var Pt=Ct.current,fn=!1,Wt=0;function Rt(Yt){fn=!0,Wt=Yt.pageY}function Un(){fn=!1}function Rn(Yt){if(fn){var ht=Yt.pageY-Wt;ht<0&&(ht=0),ht>300&&(ht=300);var jn=_t+ht+"px";sr(jn)}}return Pt.addEventListener("mousedown",Rt),document.addEventListener("mousemove",Rn),document.addEventListener("mouseup",Un),function(){Pt.removeEventListener("mousedown",Rt),document.removeEventListener("mousemove",Rn),document.removeEventListener("mouseup",Un)}}},[V,Ct]),Object(_.useEffect)(function(){sr(_t)},[_t]);var $t=Ae(yt),hn=Ae(ur),Pn={width:$t,height:hn},Gn=Object(_.useMemo)(function(){if(Hn){var Pt=new Date(Hn),fn=Pt.getHours(),Wt=Pt.getMinutes(),Rt=Pt.getSeconds();return fn=fn<10?"0"+fn:fn,Wt=Wt<10?"0"+Wt:Wt,Rt=Rt<10?"0"+Rt:Rt,"".concat(fn,":").concat(Wt,":").concat(Rt)}return 0},[Hn]);function On(){window.sessionStorage.removeItem(et),Se(!1),yn(0)}function Nn(){Se(!1),yn(0),V.setValue(window.sessionStorage.getItem(et))}function Mn(Pt,fn){var Wt=V.getValue();Wt=Wt.replace(Pt,fn),In(Wt),V==null||V.setValue(Wt)}return p.a.createElement(_.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:At},p.a.createElement("div",{className:"markdown-editor-container ".concat(dn," ").concat(ir?"on-preview":""," ").concat(st?"mini":""," ").concat(oi?"full-screen":""),style:Pn},p.a.createElement(x,{insertTemp:ct,watch:ir,fullScreen:oi,showNullButton:Bn,onActionCallback:dt,hidetoolBar:br,uuid:rt.current,setOpenPhones:function(){De.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:it,placeholder:ni})),ir?p.a.createElement("div",{ref:We,className:"preview-container"},un==="stex"&&p.a.createElement(R,{value:Jt}),un!=="stex"&&p.a.createElement(w.a,{edit:!0,value:Jt,replaces:Mn})):null))),bn?p.a.createElement("a",{ref:Ct,className:"editor-resize"}):null,p.a.createElement(j.a,null,me[Ar]?p.a.createElement(Y.a,{centered:!0,title:me[Ar],visible:!0,onCancel:mt,footer:null,className:"markdown-popup-form"},kt):null))}},RotF:function(Gt,fe,D){Gt.exports=D("LSTS")},"SA+Z":function(Gt,fe,D){var q=D("wTVA"),Y=D("EbDI"),U=D("ZhPi"),G=D("wkBT");function M(k){return q(k)||Y(k)||U(k)||G()}Gt.exports=M,Gt.exports.__esModule=!0,Gt.exports.default=Gt.exports},SJMd:function(Gt,fe){/**
|
|
* @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 D,q,Y,U=!1,G,M;window.PR_SHOULD_USE_CONTINUATION=!0;var k,K;(function(){var I=window,r=["break,continue,do,else,for,if,return,while"],P=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],_=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[_,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[_,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[_,"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"],a="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",o=[_,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",s=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],i=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],n=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[p,u,m,o,c,s,i,n],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",R="kwd",S="com",v="typ",E="lit",f="pun",h="pln",y="tag",g="dec",x="src",j="atn",F="atv",A="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(pt){for(var ut=0,Ut=!1,oe=!1,Ue=0,ze=pt.length;Ue<ze;++Ue){var $e=pt[Ue];if($e.ignoreCase)oe=!0;else if(/[a-z]/i.test($e.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ut=!0,oe=!1;break}}var Bt={b:8,t:9,n:10,v:11,f:12,r:13};function Ht(Ge){var He=Ge.charCodeAt(0);if(He!==92)return He;var vt=Ge.charAt(1);return He=Bt[vt],He||("0"<=vt&&vt<="7"?parseInt(Ge.substring(1),8):vt==="u"||vt==="x"?parseInt(Ge.substring(2),16):Ge.charCodeAt(1))}function qt(Ge){if(Ge<32)return(Ge<16?"\\x0":"\\x")+Ge.toString(16);var He=String.fromCharCode(Ge);return He==="\\"||He==="-"||He==="]"||He==="^"?"\\"+He:He}function tt(Ge){var He=Ge.substring(1,Ge.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")),vt=[],Ot=He[0]==="^",nt=["["];Ot&&nt.push("^");for(var xt=Ot?1:0,Ae=He.length;xt<Ae;++xt){var ve=He[xt];if(/\\[bdsw]/i.test(ve))nt.push(ve);else{var we=Ht(ve),ie;xt+2<Ae&&He[xt+1]==="-"?(ie=Ht(He[xt+2]),xt+=2):ie=we,vt.push([we,ie]),ie<65||we>122||(ie<65||we>90||vt.push([Math.max(65,we)|32,Math.min(ie,90)|32]),ie<97||we>122||vt.push([Math.max(97,we)&~32,Math.min(ie,122)&~32]))}}vt.sort(function(ye,Be){return ye[0]-Be[0]||Be[1]-ye[1]});for(var ae=[],me=[],xt=0;xt<vt.length;++xt){var be=vt[xt];be[0]<=me[1]+1?me[1]=Math.max(me[1],be[1]):ae.push(me=be)}for(var xt=0;xt<ae.length;++xt){var be=ae[xt];nt.push(qt(be[0])),be[1]>be[0]&&(be[1]+1>be[0]&&nt.push("-"),nt.push(qt(be[1])))}return nt.push("]"),nt.join("")}function nn(Ge){for(var He=Ge.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")),vt=He.length,Ot=[],nt=0,xt=0;nt<vt;++nt){var Ae=He[nt];if(Ae==="(")++xt;else if(Ae.charAt(0)==="\\"){var ve=+Ae.substring(1);ve&&(ve<=xt?Ot[ve]=-1:He[nt]=qt(ve))}}for(var nt=1;nt<Ot.length;++nt)Ot[nt]===-1&&(Ot[nt]=++ut);for(var nt=0,xt=0;nt<vt;++nt){var Ae=He[nt];if(Ae==="(")++xt,Ot[xt]||(He[nt]="(?:");else if(Ae.charAt(0)==="\\"){var ve=+Ae.substring(1);ve&&ve<=xt&&(He[nt]="\\"+Ot[ve])}}for(var nt=0;nt<vt;++nt)He[nt]==="^"&&He[nt+1]!=="^"&&(He[nt]="");if(Ge.ignoreCase&&Ut)for(var nt=0;nt<vt;++nt){var Ae=He[nt],we=Ae.charAt(0);Ae.length>=2&&we==="["?He[nt]=tt(Ae):we!=="\\"&&(He[nt]=Ae.replace(/[a-zA-Z]/g,function(me){var be=me.charCodeAt(0);return"["+String.fromCharCode(be&~32,be|32)+"]"}))}return He.join("")}for(var xn=[],Ue=0,ze=pt.length;Ue<ze;++Ue){var $e=pt[Ue];if($e.global||$e.multiline)throw new Error(""+$e);xn.push("(?:"+nn($e)+")")}return new RegExp(xn.join("|"),oe?"gi":"g")}function C(pt,ut){var Ut=/(?:^|\s)nocode(?:\s|$)/,oe=[],Ue=0,ze=[],$e=0;function Bt(Ht){var qt=Ht.nodeType;if(qt==1){if(Ut.test(Ht.className))return;for(var tt=Ht.firstChild;tt;tt=tt.nextSibling)Bt(tt);var nn=Ht.nodeName.toLowerCase();(nn==="br"||nn==="li")&&(oe[$e]=`
|
|
`,ze[$e<<1]=Ue++,ze[$e++<<1|1]=Ht)}else if(qt==3||qt==4){var xn=Ht.nodeValue;xn.length&&(ut?xn=xn.replace(/\r\n?/g,`
|
|
`):xn=xn.replace(/[ \t\r\n]+/g," "),oe[$e]=xn,ze[$e<<1]=Ue,Ue+=xn.length,ze[$e++<<1|1]=Ht)}}return Bt(pt),{sourceCode:oe.join("").replace(/\n$/,""),spans:ze}}function z(pt,ut,Ut,oe,Ue){if(!Ut)return;var ze={sourceNode:pt,pre:1,langExtension:null,numberLines:null,sourceCode:Ut,spans:null,basePos:ut,decorations:null};oe(ze),Ue.push.apply(Ue,ze.decorations)}var Z=/\S/;function le(pt){for(var ut=void 0,Ut=pt.firstChild;Ut;Ut=Ut.nextSibling){var oe=Ut.nodeType;ut=oe===1?ut?pt:Ut:oe===3&&Z.test(Ut.nodeValue)?pt:ut}return ut===pt?void 0:ut}function se(pt,ut){var Ut={},oe;(function(){for(var $e=pt.concat(ut),Bt=[],Ht={},qt=0,tt=$e.length;qt<tt;++qt){var nn=$e[qt],xn=nn[3];if(xn)for(var Ge=xn.length;--Ge>=0;)Ut[xn.charAt(Ge)]=nn;var He=nn[1],vt=""+He;Ht.hasOwnProperty(vt)||(Bt.push(He),Ht[vt]=null)}Bt.push(/[\0-\uffff]/),oe=H(Bt)})();var Ue=ut.length,ze=function($e){for(var Bt=$e.sourceCode,Ht=$e.basePos,qt=$e.sourceNode,tt=[Ht,h],nn=0,xn=Bt.match(oe)||[],Ge={},He=0,vt=xn.length;He<vt;++He){var Ot=xn[He],nt=Ge[Ot],xt=void 0,Ae;if(typeof nt=="string")Ae=!1;else{var ve=Ut[Ot.charAt(0)];if(ve)xt=Ot.match(ve[1]),nt=ve[0];else{for(var we=0;we<Ue;++we)if(ve=ut[we],xt=Ot.match(ve[1]),xt){nt=ve[0];break}xt||(nt=h)}Ae=nt.length>=5&&nt.substring(0,5)==="lang-",Ae&&!(xt&&typeof xt[1]=="string")&&(Ae=!1,nt=x),Ae||(Ge[Ot]=nt)}var ie=nn;if(nn+=Ot.length,!Ae)tt.push(Ht+ie,nt);else{var ae=xt[1],me=Ot.indexOf(ae),be=me+ae.length;xt[2]&&(be=Ot.length-xt[2].length,me=be-ae.length);var ye=nt.substring(5);z(qt,Ht+ie,Ot.substring(0,me),ze,tt),z(qt,Ht+ie+me,ae,pe(ye,ae),tt),z(qt,Ht+ie+be,Ot.substring(be),ze,tt)}}$e.decorations=tt};return ze}function Ce(pt){var ut=[],Ut=[];pt.tripleQuotedStrings?ut.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):pt.multiLineStrings?ut.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ut.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),pt.verbatimStrings&&Ut.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var oe=pt.hashComments;oe&&(pt.cStyleComments?(oe>1?ut.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ut.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ut.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ut.push([S,/^#[^\r\n]*/,null,"#"])),pt.cStyleComments&&(Ut.push([S,/^\/\/[^\r\n]*/,null]),Ut.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ue=pt.regexLiterals;if(Ue){var ze=Ue>1?"":`
|
|
\r`,$e=ze?".":"[\\S\\s]",Bt="/(?=[^/*"+ze+"])(?:[^/\\x5B\\x5C"+ze+"]|\\x5C"+$e+"|\\x5B(?:[^\\x5C\\x5D"+ze+"]|\\x5C"+$e+")*(?:\\x5D|$))+/";Ut.push(["lang-regex",RegExp("^"+W+"("+Bt+")")])}var Ht=pt.types;Ht&&Ut.push([v,Ht]);var qt=(""+pt.keywords).replace(/^ | $/g,"");qt.length&&Ut.push([R,new RegExp("^(?:"+qt.replace(/[\s,]+/g,"|")+")\\b"),null]),ut.push([h,/^\s+/,null,` \r
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return pt.regexLiterals&&(tt+="(?!s*/)"),Ut.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[f,new RegExp(tt),null]),se(ut,Ut)}var Ee=Ce({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ie(pt,ut,Ut){for(var oe=/(?:^|\s)nocode(?:\s|$)/,Ue=/\r\n?|\n/,ze=pt.ownerDocument,$e=ze.createElement("li");pt.firstChild;)$e.appendChild(pt.firstChild);var Bt=[$e];function Ht(He){var vt=He.nodeType;if(vt==1&&!oe.test(He.className))if(He.nodeName==="br")qt(He),He.parentNode&&He.parentNode.removeChild(He);else for(var Ot=He.firstChild;Ot;Ot=Ot.nextSibling)Ht(Ot);else if((vt==3||vt==4)&&Ut){var nt=He.nodeValue,xt=nt.match(Ue);if(xt){var Ae=nt.substring(0,xt.index);He.nodeValue=Ae;var ve=nt.substring(xt.index+xt[0].length);if(ve){var we=He.parentNode;we.insertBefore(ze.createTextNode(ve),He.nextSibling)}qt(He),Ae||He.parentNode.removeChild(He)}}}function qt(He){for(;!He.nextSibling;)if(He=He.parentNode,!He)return;function vt(xt,Ae){var ve=Ae?xt.cloneNode(!1):xt,we=xt.parentNode;if(we){var ie=vt(we,1),ae=xt.nextSibling;ie.appendChild(ve);for(var me=ae;me;me=ae)ae=me.nextSibling,ie.appendChild(me)}return ve}for(var Ot=vt(He.nextSibling,0),nt;(nt=Ot.parentNode)&&nt.nodeType===1;)Ot=nt;Bt.push(Ot)}for(var tt=0;tt<Bt.length;++tt)Ht(Bt[tt]);ut===(ut|0)&&Bt[0].setAttribute("value",ut);var nn=ze.createElement("ol");nn.className="linenums";for(var xn=Math.max(0,ut-1|0)||0,tt=0,Ge=Bt.length;tt<Ge;++tt)$e=Bt[tt],$e.className="L"+(tt+xn)%10,$e.firstChild||$e.appendChild(ze.createTextNode("\xA0")),nn.appendChild($e);pt.appendChild(nn)}function Qe(pt){var ut=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ut=ut&&+ut[1]<=8;var Ut=/\n/g,oe=pt.sourceCode,Ue=oe.length,ze=0,$e=pt.spans,Bt=$e.length,Ht=0,qt=pt.decorations,tt=qt.length,nn=0;qt[tt]=Ue;var xn,Ge;for(Ge=xn=0;Ge<tt;)qt[Ge]!==qt[Ge+2]?(qt[xn++]=qt[Ge++],qt[xn++]=qt[Ge++]):Ge+=2;for(tt=xn,Ge=xn=0;Ge<tt;){for(var He=qt[Ge],vt=qt[Ge+1],Ot=Ge+2;Ot+2<=tt&&qt[Ot+1]===vt;)Ot+=2;qt[xn++]=He,qt[xn++]=vt,Ge=Ot}tt=qt.length=xn;var nt=pt.sourceNode,xt="";nt&&(xt=nt.style.display,nt.style.display="none");try{for(var Ae=null;Ht<Bt;){var ve=$e[Ht],we=$e[Ht+2]||Ue,ie=qt[nn+2]||Ue,Ot=Math.min(we,ie),ae=$e[Ht+1],me;if(ae.nodeType!==1&&(me=oe.substring(ze,Ot))){ut&&(me=me.replace(Ut,"\r")),ae.nodeValue=me;var be=ae.ownerDocument,ye=be.createElement("span");ye.className=qt[nn+1];var Be=ae.parentNode;Be.replaceChild(ye,ae),ye.appendChild(ae),ze<we&&($e[Ht+1]=ae=be.createTextNode(oe.substring(Ot,we)),Be.insertBefore(ae,ye.nextSibling))}ze=Ot,ze>=we&&(Ht+=2),ze>=ie&&(nn+=2)}}finally{nt&&(nt.style.display=xt)}}var Xe={};function _e(pt,ut){for(var Ut=ut.length;--Ut>=0;){var oe=ut[Ut];Xe.hasOwnProperty(oe)?I.console&&console.warn("cannot override language handler %s",oe):Xe[oe]=pt}}function pe(pt,ut){return pt&&Xe.hasOwnProperty(pt)||(pt=/^\s*</.test(ut)?"default-markup":"default-code"),Xe[pt]}_e(Ee,["default-code"]),_e(se([],[[h,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["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"]),_e(se([[h,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[y,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[f,/^[=<>\/]+/],["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"]),_e(se([],[[F,/^[\s\S]+/]]),["uq.val"]),_e(Ce({keywords:p,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),_e(Ce({keywords:"null,true,false"}),["json"]),_e(Ce({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),_e(Ce({keywords:m,cStyleComments:!0}),["java"]),_e(Ce({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),_e(Ce({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),_e(Ce({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),_e(Ce({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),_e(Ce({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),_e(Ce({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),_e(se([],[[w,/^[\s\S]+/]]),["regex"]);function at(pt){var ut=pt.langExtension;try{var Ut=C(pt.sourceNode,pt.pre),oe=Ut.sourceCode;pt.sourceCode=oe,pt.spans=Ut.spans,pt.basePos=0,pe(ut,oe)(pt),Qe(pt)}catch(Ue){I.console&&console.log(Ue&&Ue.stack||Ue)}}function Qt(pt,ut,Ut){var oe=Ut||!1,Ue=ut||null,ze=document.createElement("div");ze.innerHTML="<pre>"+pt+"</pre>",ze=ze.firstChild,oe&&Ie(ze,oe,!0);var $e={langExtension:Ue,numberLines:oe,sourceNode:ze,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return at($e),ze.innerHTML}function Ft(pt,ut){var Ut=ut||document.body,oe=Ut.ownerDocument||document;function Ue(ve){return Ut.getElementsByTagName(ve)}for(var ze=[Ue("pre"),Ue("code"),Ue("xmp")],$e=[],Bt=0;Bt<ze.length;++Bt)for(var Ht=0,qt=ze[Bt].length;Ht<qt;++Ht)$e.push(ze[Bt][Ht]);ze=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var nn=0,xn=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ge=/\bprettyprint\b/,He=/\bprettyprinted\b/,vt=/pre|xmp/i,Ot=/^code$/i,nt=/^(?:pre|code|xmp)$/i,xt={};function Ae(){for(var ve=I.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;nn<$e.length&&tt.now()<ve;nn++){for(var we=$e[nn],ie=xt,ae=we;ae=ae.previousSibling;){var me=ae.nodeType,be=(me===7||me===8)&&ae.nodeValue;if(be?!/^\??prettify\b/.test(be):me!==3||/\S/.test(ae.nodeValue))break;if(be){ie={},be.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Lt,ct,tn){ie[ct]=tn});break}}var ye=we.className;if((ie!==xt||Ge.test(ye))&&!He.test(ye)){for(var Be=!1,St=we.parentNode;St;St=St.parentNode){var an=St.tagName;if(nt.test(an)&&St.className&&Ge.test(St.className)){Be=!0;break}}if(!Be){we.className+=" prettyprinted";var Dn=ie.lang;if(!Dn){Dn=ye.match(xn);var yt;!Dn&&(yt=le(we))&&Ot.test(yt.tagName)&&(Dn=yt.className.match(xn)),Dn&&(Dn=Dn[1])}var en;if(vt.test(we.tagName))en=1;else{var _t=we.currentStyle,Et=oe.defaultView,st=_t?_t.whiteSpace:Et&&Et.getComputedStyle?Et.getComputedStyle(we,null).getPropertyValue("white-space"):0;en=st&&st.substring(0,3)==="pre"}var he=ie.linenums;(he=he==="true"||+he)||(he=ye.match(/\blinenums\b(?::(\d+))?/),he=he?he[1]&&he[1].length?+he[1]:!0:!1),he&&Ie(we,he,en);var Le={langExtension:Dn,sourceNode:we,numberLines:he,pre:en,sourceCode:null,basePos:null,spans:null,decorations:null};at(Le)}}}nn<$e.length?I.setTimeout(Ae,250):typeof pt=="function"&&pt()}Ae()}var Tt=I.PR={createSimpleLexer:se,registerLangHandler:_e,sourceDecorator:Ce,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:F,PR_COMMENT:S,PR_DECLARATION:g,PR_KEYWORD:R,PR_LITERAL:E,PR_NOCODE:A,PR_PLAIN:h,PR_PUNCTUATION:f,PR_SOURCE:x,PR_STRING:w,PR_TAG:y,PR_TYPE:v,prettyPrintOne:U?I.prettyPrintOne=Qt:k=Qt,prettyPrint:K=U?I.prettyPrint=Ft:K=Ft},Ve=I.define;typeof Ve=="function"&&Ve.amd&&Ve("google-code-prettify",[],function(){return Tt})})()},T7RX:function(Gt,fe,D){"use strict";var q=D("2qtc"),Y=D("kLXV"),U=D("k1fw"),G=D("miYZ"),M=D("tsqr"),k=D("9og8"),K=D("PpiC"),I=D("WmNS"),r=D.n(I),P=D("q1tI"),_=D.n(P),p=D("ErOA"),m=D("Ty5D"),u=D("9kvl"),a=function(c){var s=c.shixunHomeworks,i=c.dispatch,n=Object(K.a)(c,["shixunHomeworks","dispatch"]),O=Object(m.i)();return _.a.createElement(Y.a,{centered:!0,title:"\u63D0\u793A",visible:s.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(k.a)(r.a.mark(function T(){var w;return r.a.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=2,Object(p.a)("/api/myshixuns/".concat(s.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:O.coursesId}});case 2:w=S.sent,w.shixun_identifier&&(M.b.success("\u64CD\u4F5C\u6210\u529F"),i({type:"shixunHomeworks/setActionTabs",payload:{}}),i({type:"shixunHomeworks/getWorkList",payload:Object(U.a)({},s.actionTabs.params)}));case 4:case"end":return S.stop()}},T)})),onCancel:function(){i({type:"shixunHomeworks/setActionTabs",payload:{}})}},_.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),_.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};fe.a=Object(u.a)(function(o){var c=o.shixunHomeworks;return{shixunHomeworks:c}})(a)},T8No:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return K}),D.d(fe,"e",function(){return I}),D.d(fe,"c",function(){return f}),D.d(fe,"b",function(){return h}),D.d(fe,"d",function(){return y}),D.d(fe,"f",function(){return j});var q=D("MNsG"),Y=D("N0LK"),U=D("Cg/j");let G=q.k||"";const M=new Map;M.set("false",!1),M.set("true",!0),M.set("isMac",q.f),M.set("isLinux",q.d),M.set("isWindows",q.i),M.set("isWeb",q.h),M.set("isMacNative",q.f&&!q.h),M.set("isEdge",G.indexOf("Edg/")>=0),M.set("isFirefox",G.indexOf("Firefox")>=0),M.set("isChrome",G.indexOf("Chrome")>=0),M.set("isSafari",G.indexOf("Safari")>=0);const k=Object.prototype.hasOwnProperty;class K{static has(A){return p.create(A)}static equals(A,W){return m.create(A,W)}static regex(A,W){return w.create(A,W)}static not(A){return c.create(A)}static and(...A){return v.create(A,null)}static or(...A){return E.create(A,null,!0)}static deserialize(A,W=!1){return A?this._deserializeOrExpression(A,W):void 0}static _deserializeOrExpression(A,W){let H=A.split("||");return E.create(H.map(C=>this._deserializeAndExpression(C,W)),null,!0)}static _deserializeAndExpression(A,W){let H=A.split("&&");return v.create(H.map(C=>this._deserializeOne(C,W)),null)}static _deserializeOne(A,W){if(A=A.trim(),A.indexOf("!=")>=0){let H=A.split("!=");return o.create(H[0].trim(),this._deserializeValue(H[1],W))}if(A.indexOf("==")>=0){let H=A.split("==");return m.create(H[0].trim(),this._deserializeValue(H[1],W))}if(A.indexOf("=~")>=0){let H=A.split("=~");return w.create(H[0].trim(),this._deserializeRegexValue(H[1],W))}if(A.indexOf(" in ")>=0){let H=A.split(" in ");return u.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const H=A.split(">=");return n.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const H=A.split(">");return i.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const H=A.split("<=");return T.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const H=A.split("<");return O.create(H[0].trim(),H[1].trim())}return/^\!\s*/.test(A)?c.create(A.substr(1).trim()):p.create(A)}static _deserializeValue(A,W){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let H=/^'([^']*)'$/.exec(A);return H?H[1].trim():A}static _deserializeRegexValue(A,W){if(Object(Y.C)(A)){if(W)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let H=A.indexOf("/"),C=A.lastIndexOf("/");if(H===C||H<0){if(W)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let z=A.slice(H+1,C),Z=A[C+1]==="i"?"i":"";try{return new RegExp(z,Z)}catch(le){if(W)throw new Error(`bad regexp-value '${A}', parse error: ${le}`);return console.warn(`bad regexp-value '${A}', parse error: ${le}`),null}}}function I(A,W){const H=A?A.substituteConstants():void 0,C=W?W.substituteConstants():void 0;return!H&&!C?!0:!H||!C?!1:H.equals(C)}function r(A,W){return A.cmp(W)}class P{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return _.INSTANCE}}P.INSTANCE=new P;class _{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return P.INSTANCE}}_.INSTANCE=new _;class p{constructor(A,W){this.key=A,this.negated=W,this.type=2}static create(A,W=null){const H=M.get(A);return typeof H=="boolean"?H?_.INSTANCE:P.INSTANCE:new p(A,W)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=M.get(this.key);return typeof A=="boolean"?A?_.INSTANCE:P.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this)),this.negated}}class m{constructor(A,W,H){this.key=A,this.value=W,this.negated=H,this.type=4}static create(A,W,H=null){if(typeof W=="boolean")return W?p.create(A,H):c.create(A,H);const C=M.get(A);if(typeof C=="boolean"){const z=C?"true":"false";return W===z?_.INSTANCE:P.INSTANCE}return new m(A,W,H)}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=M.get(this.key);if(typeof A=="boolean"){const W=A?"true":"false";return this.value===W?_.INSTANCE:P.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class u{constructor(A,W){this.key=A,this.valueKey=W,this.type=10,this.negated=null}static create(A,W){return new u(A,W)}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const W=A.getValue(this.valueKey),H=A.getValue(this.key);return Array.isArray(W)?W.indexOf(H)>=0:typeof H=="string"&&typeof W=="object"&&W!==null?k.call(W,H):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(A){this._actual=A,this.type=11}static create(A){return new a(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class o{constructor(A,W,H){this.key=A,this.value=W,this.negated=H,this.type=5}static create(A,W,H=null){if(typeof W=="boolean")return W?c.create(A,H):p.create(A,H);const C=M.get(A);if(typeof C=="boolean"){const z=C?"true":"false";return W===z?P.INSTANCE:_.INSTANCE}return new o(A,W,H)}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=M.get(this.key);if(typeof A=="boolean"){const W=A?"true":"false";return this.value===W?P.INSTANCE:_.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class c{constructor(A,W){this.key=A,this.negated=W,this.type=3}static create(A,W=null){const H=M.get(A);return typeof H=="boolean"?H?P.INSTANCE:_.INSTANCE:new c(A,W)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=M.get(this.key);return typeof A=="boolean"?A?P.INSTANCE:_.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function s(A,W){if(typeof A=="string"){const H=parseFloat(A);isNaN(H)||(A=H)}return typeof A=="string"||typeof A=="number"?W(A):P.INSTANCE}class i{constructor(A,W,H){this.key=A,this.value=W,this.negated=H,this.type=12}static create(A,W,H=null){return s(W,C=>new i(A,C,H))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class n{constructor(A,W,H){this.key=A,this.value=W,this.negated=H,this.type=13}static create(A,W,H=null){return s(W,C=>new n(A,C,H))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(A,W,H){this.key=A,this.value=W,this.negated=H,this.type=14}static create(A,W,H=null){return s(W,C=>new O(A,C,H))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class T{constructor(A,W,H){this.key=A,this.value=W,this.negated=H,this.type=15}static create(A,W,H=null){return s(W,C=>new T(A,C,H))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class w{constructor(A,W){this.key=A,this.regexp=W,this.type=7,this.negated=null}static create(A,W){return new w(A,W)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const W=this.regexp?this.regexp.source:"",H=A.regexp?A.regexp.source:"";return W<H?-1:W>H?1:0}equals(A){if(A.type===this.type){const W=this.regexp?this.regexp.source:"",H=A.regexp?A.regexp.source:"";return this.key===A.key&&W===H}return!1}substituteConstants(){return this}evaluate(A){let W=A.getValue(this.key);return this.regexp?this.regexp.test(W):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(A){this._actual=A,this.type=8}static create(A){return new R(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function S(A){let W=null;for(let H=0,C=A.length;H<C;H++){const z=A[H].substituteConstants();if(A[H]!==z&&W===null){W=[];for(let Z=0;Z<H;Z++)W[Z]=A[Z]}W!==null&&(W[H]=z)}return W===null?A:W}class v{constructor(A,W){this.expr=A,this.negated=W,this.type=6}static create(A,W){return v._normalizeArr(A,W)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let W=0,H=this.expr.length;W<H;W++){const C=r(this.expr[W],A.expr[W]);if(C!==0)return C}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let W=0,H=this.expr.length;W<H;W++)if(!this.expr[W].equals(A.expr[W]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:v.create(A,this.negated)}evaluate(A){for(let W=0,H=this.expr.length;W<H;W++)if(!this.expr[W].evaluate(A))return!1;return!0}static _normalizeArr(A,W){const H=[];let C=!1;for(const z of A){if(!z)continue;if(z.type===1){C=!0;continue}if(z.type===0)return P.INSTANCE;if(z.type===6){H.push(...z.expr);continue}H.push(z)}if(H.length===0&&C)return _.INSTANCE;if(H.length===0)return;if(H.length===1)return H[0];H.sort(r);for(let z=1;z<H.length;z++)H[z-1].equals(H[z])&&(H.splice(z,1),z--);if(H.length===1)return H[0];for(;H.length>1;){const z=H[H.length-1];if(z.type!==9)break;H.pop();const Z=H.pop(),le=H.length===0,se=E.create(z.expr.map(Ce=>v.create([Ce,Z],null)),null,le);se&&(H.push(se),H.sort(r))}return H.length===1?H[0]:new v(H,W)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let W of this.expr)A.push(...W.keys());return A}negate(){if(!this.negated){const A=[];for(let W of this.expr)A.push(W.negate());this.negated=E.create(A,this,!0)}return this.negated}}class E{constructor(A,W){this.expr=A,this.negated=W,this.type=9}static create(A,W,H){return E._normalizeArr(A,W,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let W=0,H=this.expr.length;W<H;W++){const C=r(this.expr[W],A.expr[W]);if(C!==0)return C}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let W=0,H=this.expr.length;W<H;W++)if(!this.expr[W].equals(A.expr[W]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:E.create(A,this.negated,!1)}evaluate(A){for(let W=0,H=this.expr.length;W<H;W++)if(this.expr[W].evaluate(A))return!0;return!1}static _normalizeArr(A,W,H){let C=[],z=!1;if(A){for(let Z=0,le=A.length;Z<le;Z++){const se=A[Z];if(!se)continue;if(se.type===0){z=!0;continue}if(se.type===1)return _.INSTANCE;if(se.type===9){C=C.concat(se.expr);continue}C.push(se)}if(C.length===0&&z)return P.INSTANCE;C.sort(r)}if(C.length===0)return;if(C.length===1)return C[0];for(let Z=1;Z<C.length;Z++)C[Z-1].equals(C[Z])&&(C.splice(Z,1),Z--);if(C.length===1)return C[0];if(H){for(let Z=0;Z<C.length;Z++)for(let le=Z+1;le<C.length;le++)j(C[Z],C[le])&&(C.splice(le,1),le--);if(C.length===1)return C[0]}return new E(C,W)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let W of this.expr)A.push(...W.keys());return A}negate(){if(!this.negated){let A=[];for(let W of this.expr)A.push(W.negate());for(;A.length>1;){const W=A.shift(),H=A.shift(),C=[];for(const Z of F(W))for(const le of F(H))C.push(v.create([Z,le],null));const z=A.length===0;A.unshift(E.create(C,null,z))}this.negated=A[0]}return this.negated}}class f extends p{constructor(A,W,H){super(A,null);this._defaultValue=W,typeof H=="object"?f._info.push(Object.assign(Object.assign({},H),{key:A})):H!==!0&&f._info.push({key:A,description:H,type:W!=null?typeof W:void 0})}static all(){return f._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return m.create(this.key,A)}}f._info=[];const h=Object(U.c)("contextKeyService"),y="setContext";function g(A,W){return A<W?-1:A>W?1:0}function x(A,W,H,C){return A<H?-1:A>H?1:W<C?-1:W>C?1:0}function j(A,W){if(W.type===6&&A.type!==9&&A.type!==6){for(const z of W.expr)if(A.equals(z))return!0}const H=A.negate(),C=F(H).concat(F(W));C.sort(r);for(let z=0;z<C.length;z++){const Z=C[z],le=Z.negate();for(let se=z+1;se<C.length;se++){const Ce=C[se];if(le.equals(Ce))return!0}}return!1}function F(A){return A.type===9?A.expr:[A]}},TXwP:function(Gt,fe,D){var q,Y;(function(){var U;(function(){"use strict";var M=[,,function(r){function P(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}P.prototype.clone_empty=function(){var m=new P(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},P.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},P.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},P.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var u=m.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},P.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function _(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}_.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},_.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},_.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,u){this.__indent_cache=new _(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new 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(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(m,u){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(m)!==0&&o.item(-1)!==u){this.__lines.splice(a+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},,,,function(r){function P(m,u){this.raw_options=_(m,u),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(m,u){var a=this.raw_options[m],o=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},P.prototype._get_boolean=function(m,u){var a=this.raw_options[m],o=a===void 0?!!u:!!a;return o},P.prototype._get_characters=function(m,u){var a=this.raw_options[m],o=u||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},P.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var o=parseInt(a,10);return isNaN(o)&&(o=u),o},P.prototype._get_selection=function(m,u,a){var o=this._get_selection_list(m,u,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return o[0]},P.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var o=this._get_array(m,a);if(!this._is_valid_selection(o,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[m]+"'");return o},P.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function _(m,u){var a={};m=p(m);var o;for(o in m)o!==u&&(a[o]=m[o]);if(u&&m[u])for(o in m[u])a[o]=m[u][o];return a}function p(m){var u={},a;for(a in m){var o=a.replace(/-/g,"_");u[o]=m[a]}return u}r.exports.Options=P,r.exports.normalizeOpts=p,r.exports.mergeOpts=_},,function(r){var P=RegExp.prototype.hasOwnProperty("sticky");function _(p){this.__input=p||"",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 p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},_.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},_.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(P&&p.sticky)&&(u.index!==m&&(u=null)),u},_.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},_.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},_.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},_.prototype.read=function(p,m,u){var a="",o;return p&&(o=this.match(p),o&&(a+=o[0])),m&&(o||!p)&&(a+=this.readUntil(m,u)),a},_.prototype.readUntil=function(p,m){var u="",a=this.__position;p.lastIndex=this.__position;var o=p.exec(this.__input);return o?(a=o.index,m&&(a+=o[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},_.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},_.prototype.get_regexp=function(p,m){var u=null,a="g";return m&&P&&(a="y"),typeof p=="string"&&p!==""?u=new RegExp(p,a):p&&(u=new RegExp(p.source,a)),u},_.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},_.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=_},,,,,function(r){function P(_,p){_=typeof _=="string"?_:_.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+p,"g")}P.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(_);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(_);return p},P.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=P},,function(r,P,_){var p=_(16).Beautifier,m=_(17).Options;function u(a,o){var c=new p(a,o);return c.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new m}},function(r,P,_){var p=_(17).Options,m=_(2).Output,u=_(8).InputScanner,a=_(13).Directives,o=new a(/\/\*/,/\*\//),c=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=/\s/,n=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function w(R,S){this._source_text=R||"",this._options=new p(S),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"]}w.prototype.eatString=function(R){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return S},w.prototype.eatWhitespace=function(R){for(var S=i.test(this._input.peek()),v=0;i.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
|
|
`&&((v===0||v<this._options.max_preserve_newlines)&&(v++,this._output.add_new_line(!0)));return S},w.prototype.foundNestedPseudoClass=function(){for(var R=0,S=1,v=this._input.peek(S);v;){if(v==="{")return!0;if(v==="(")R+=1;else if(v===")"){if(R===0)return!1;R-=1}else if(v===";"||v==="}")return!1;S++,v=this._input.peek(S)}return!1},w.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},w.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},w.prototype.indent=function(){this._indentLevel++},w.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,S=this._options.eol;S==="auto"&&(S=`
|
|
`,R&&c.test(R||"")&&(S=R.match(c)[0])),R=R.replace(s,`
|
|
`);var v=R.match(/^[\t ]*/)[0];this._output=new m(this._options,v),this._input=new u(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,f=!1,h=!1,y=!1,g=!1,x=!1,j=!1,F=this._ch,A=!1,W,H,C;W=this._input.read(n),H=W!=="",C=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(O),Z=o.get_directives(z);Z&&Z.ignore==="start"&&(z+=o.readIgnored(this._input)),this.print_string(z),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(H),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var le=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);le.match(/[ :]$/)&&(le=this.eatString(": ").replace(/\s$/,""),this.print_string(le),this._output.space_before_token=!0),le=le.replace(/\s$/,""),le==="extend"?g=!0:le==="import"&&(x=!0),le in this.NESTED_AT_RULE?(this._nestedLevel+=1,le in this.CONDITIONAL_GROUP_RULE&&(y=!0)):!f&&E===0&&le.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),y?(y=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(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)):(C==="("?this._output.space_before_token=!1:C!==","&&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(),C==="{"&&this._output.trim(!0),x=!1,g=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),f=!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 se=0;se<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;se++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[se])){A=!0;break}(f||y)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&E===0?(this.print_string(":"),h||(h=!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 Ce=C==='"'||C==="'";this.preserveSingleSpace(Ce||H),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,E===0?(h&&(this.outdent(),h=!1),g=!1,x=!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(),E++,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(")")),E&&(E--,this.outdent()));else{var Ee=!1;this._input.lookBack("with")&&(Ee=!0),this.preserveSingleSpace(H||Ee),this.print_string(this._ch),h&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||j)&&E===0&&!x&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&E===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&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(H),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.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 Ie=C==='"'||C==="'";this.preserveSingleSpace(Ie||H),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&A&&this._output.add_new_line()}var Qe=this._output.get_code(S);return Qe},r.exports.Beautifier=w},function(r,P,_){var p=_(6).Options;function m(u){p.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var c=0;c<o.length;c++)o[c]!=="expand"?this.brace_style="collapse":this.brace_style=o[c]}m.prototype=new p,r.exports.Options=m}],k={};function K(r){var P=k[r];if(P!==void 0)return P.exports;var _=k[r]={exports:{}};return M[r](_,_.exports,K),_.exports}var I=K(15);U=I})();var G=U;!(q=[],Y=function(){return{css_beautify:G}}.apply(fe,q),Y!==void 0&&(Gt.exports=Y))})()},Vhoy:function(Gt,fe,D){"use strict";D.d(fe,"d",function(){return G}),D.d(fe,"e",function(){return M}),D.d(fe,"c",function(){return k}),D.d(fe,"b",function(){return K}),D.d(fe,"a",function(){return I});var q=D("MI8n");class Y{constructor(){this._icons=new Map,this._onDidRegister=new q.b}add(r){const P=this._icons.get(r.id);P?r.description?P.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const U=new Y,G=U;function M(r,P){return new K(r,P)}function k(r){return r?r.replace(/\$\((.*?)\)/g,(P,_)=>` ${_} `).trim():""}class K{constructor(r,P,_){this.id=r,this.definition=P,this.description=_,U.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var I;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const P=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function _(u){if(u instanceof K)return["codicon","codicon-"+u.id];const a=P.exec(u.id);if(!a)return _(K.error);let[,o,c]=a;const s=["codicon","codicon-"+o];return c&&s.push("codicon-modifier-"+c.substr(1)),s}r.asClassNameArray=_;function p(u){return _(u).join(" ")}r.asClassName=p;function m(u){return"."+_(u).join(".")}r.asCSSSelector=m})(I||(I={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(Gt,fe,D){(function(q,Y){Gt.exports=Y()})(this,function(){"use strict";var q=navigator.userAgent,Y=navigator.platform,U=/gecko\/\d/i.test(q),G=/MSIE \d/.test(q),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),k=/Edge\/(\d+)/.exec(q),K=G||M||k,I=K&&(G?document.documentMode||6:+(k||M)[1]),r=!k&&/WebKit\//.test(q),P=r&&/Qt\/\d+\.\d+/.test(q),_=!k&&/Chrome\//.test(q),p=/Opera\//.test(q),m=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),a=/PhantomJS/.test(q),o=!k&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),c=/Android/.test(q),s=o||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),i=o||/Mac/.test(Y),n=/\bCrOS\b/.test(q),O=/win/i.test(Y),T=p&&q.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(p=!1,r=!0);var w=i&&(P||p&&(T==null||T<12.11)),R=U||K&&I>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var d=e.className,l=S(t).exec(d);if(l){var b=d.slice(l.index+l[0].length);e.className=d.slice(0,l.index)+(b?l[1]+b:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return E(e).appendChild(t)}function h(e,t,d,l){var b=document.createElement(e);if(d&&(b.className=d),l&&(b.style.cssText=l),typeof t=="string")b.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)b.appendChild(t[B]);return b}function y(e,t,d,l){var b=h(e,t,d,l);return b.setAttribute("role","presentation"),b}var g;document.createRange?g=function(e,t,d,l){var b=document.createRange();return b.setEnd(l||e,d),b.setStart(e,t),b}:g=function(e,t,d){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(b){return l}return l.collapse(!0),l.moveEnd("character",d),l.moveStart("character",t),l};function x(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function j(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var d=e.className;S(t).test(d)||(e.className+=(d?" ":"")+t)}function A(e,t){for(var d=e.split(" "),l=0;l<d.length;l++)d[l]&&!S(d[l]).test(t)&&(t+=" "+d[l]);return t}var W=function(e){e.select()};o?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(W=function(e){try{e.select()}catch(t){}});function H(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function C(e,t,d){t||(t={});for(var l in e)e.hasOwnProperty(l)&&(d!==!1||!t.hasOwnProperty(l))&&(t[l]=e[l]);return t}function z(e,t,d,l,b){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=l||0,$=b||0;;){var ee=e.indexOf(" ",B);if(ee<0||ee>=t)return $+(t-B);$+=ee-B,$+=d-$%d,B=ee+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=H(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var d=+new Date+e;(!this.id||d<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=d)};function le(e,t){for(var d=0;d<e.length;++d)if(e[d]==t)return d;return-1}var se=50,Ce={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},Ie={origin:"*mouse"},Qe={origin:"+move"};function Xe(e,t,d){for(var l=0,b=0;;){var B=e.indexOf(" ",l);B==-1&&(B=e.length);var $=B-l;if(B==e.length||b+$>=t)return l+Math.min($,t-b);if(b+=B-l,b+=d-b%d,l=B+1,b>=t)return l}}var _e=[""];function pe(e){for(;_e.length<=e;)_e.push(at(_e)+" ");return _e[e]}function at(e){return e[e.length-1]}function Qt(e,t){for(var d=[],l=0;l<e.length;l++)d[l]=t(e[l],l);return d}function Ft(e,t,d){for(var l=0,b=d(t);l<e.length&&d(e[l])<=b;)l++;e.splice(l,0,t)}function Tt(){}function Ve(e,t){var d;return Object.create?d=Object.create(e):(Tt.prototype=e,d=new Tt),t&&C(t,d),d}var pt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ut(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||pt.test(e))}function Ut(e,t){return t?t.source.indexOf("\\w")>-1&&ut(e)?!0:t.test(e):ut(e)}function oe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ue=/[\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 ze(e){return e.charCodeAt(0)>=768&&Ue.test(e)}function $e(e,t,d){for(;(d<0?t>0:t<e.length)&&ze(e.charAt(t));)t+=d;return t}function Bt(e,t,d){for(var l=t>d?-1:1;;){if(t==d)return t;var b=(t+d)/2,B=l<0?Math.ceil(b):Math.floor(b);if(B==t)return e(B)?t:d;e(B)?d=B:t=B+l}}function Ht(e,t,d,l){if(!e)return l(t,d,"ltr",0);for(var b=!1,B=0;B<e.length;++B){var $=e[B];($.from<d&&$.to>t||t==d&&$.to==t)&&(l(Math.max($.from,t),Math.min($.to,d),$.level==1?"rtl":"ltr",B),b=!0)}b||l(t,d,"ltr")}var qt=null;function tt(e,t,d){var l;qt=null;for(var b=0;b<e.length;++b){var B=e[b];if(B.from<t&&B.to>t)return b;B.to==t&&(B.from!=B.to&&d=="before"?l=b:qt=b),B.from==t&&(B.from!=B.to&&d!="before"?l=b:qt=b)}return l!=null?l:qt}var nn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function d(ue){return ue<=247?e.charAt(ue):1424<=ue&&ue<=1524?"R":1536<=ue&&ue<=1785?t.charAt(ue-1536):1774<=ue&&ue<=2220?"r":8192<=ue&&ue<=8203?"w":ue==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,b=/[stwN]/,B=/[LRr]/,$=/[Lb1n]/,ee=/[1n]/;function te(ue,ke,Ke){this.level=ue,this.from=ke,this.to=Ke}return function(ue,ke){var Ke=ke=="ltr"?"L":"R";if(ue.length==0||ke=="ltr"&&!l.test(ue))return!1;for(var bt=ue.length,ft=[],sn=0;sn<bt;++sn)ft.push(d(ue.charCodeAt(sn)));for(var Tn=0,Kn=Ke;Tn<bt;++Tn){var Xn=ft[Tn];Xn=="m"?ft[Tn]=Kn:Kn=Xn}for(var er=0,$n=Ke;er<bt;++er){var or=ft[er];or=="1"&&$n=="r"?ft[er]="n":B.test(or)&&($n=or,or=="r"&&(ft[er]="R"))}for(var Cr=1,_r=ft[0];Cr<bt-1;++Cr){var jr=ft[Cr];jr=="+"&&_r=="1"&&ft[Cr+1]=="1"?ft[Cr]="1":jr==","&&_r==ft[Cr+1]&&(_r=="1"||_r=="n")&&(ft[Cr]=_r),_r=jr}for(var mi=0;mi<bt;++mi){var Hi=ft[mi];if(Hi==",")ft[mi]="N";else if(Hi=="%"){var Ci=void 0;for(Ci=mi+1;Ci<bt&&ft[Ci]=="%";++Ci);for(var oa=mi&&ft[mi-1]=="!"||Ci<bt&&ft[Ci]=="1"?"1":"N",na=mi;na<Ci;++na)ft[na]=oa;mi=Ci-1}}for(var ki=0,ra=Ke;ki<bt;++ki){var zi=ft[ki];ra=="L"&&zi=="1"?ft[ki]="L":B.test(zi)&&(ra=zi)}for(var Ui=0;Ui<bt;++Ui)if(b.test(ft[Ui])){var Ii=void 0;for(Ii=Ui+1;Ii<bt&&b.test(ft[Ii]);++Ii);for(var Oi=(Ui?ft[Ui-1]:Ke)=="L",ia=(Ii<bt?ft[Ii]:Ke)=="L",So=Oi==ia?Oi?"L":"R":Ke,to=Ui;to<Ii;++to)ft[to]=So;Ui=Ii-1}for(var Xi=[],Pa,Wi=0;Wi<bt;)if($.test(ft[Wi])){var ms=Wi;for(++Wi;Wi<bt&&$.test(ft[Wi]);++Wi);Xi.push(new te(0,ms,Wi))}else{var Ga=Wi,lo=Xi.length,uo=ke=="rtl"?1:0;for(++Wi;Wi<bt&&ft[Wi]!="L";++Wi);for(var Ji=Ga;Ji<Wi;)if(ee.test(ft[Ji])){Ga<Ji&&(Xi.splice(lo,0,new te(1,Ga,Ji)),lo+=uo);var Oo=Ji;for(++Ji;Ji<Wi&&ee.test(ft[Ji]);++Ji);Xi.splice(lo,0,new te(2,Oo,Ji)),lo+=uo,Ga=Ji}else++Ji;Ga<Wi&&Xi.splice(lo,0,new te(1,Ga,Wi))}return ke=="ltr"&&(Xi[0].level==1&&(Pa=ue.match(/^\s+/))&&(Xi[0].from=Pa[0].length,Xi.unshift(new te(0,0,Pa[0].length))),at(Xi).level==1&&(Pa=ue.match(/\s+$/))&&(at(Xi).to-=Pa[0].length,Xi.push(new te(0,bt-Pa[0].length,bt)))),ke=="rtl"?Xi.reverse():Xi}}();function xn(e,t){var d=e.order;return d==null&&(d=e.order=nn(e.text,t)),d}var Ge=[],He=function(e,t,d){if(e.addEventListener)e.addEventListener(t,d,!1);else if(e.attachEvent)e.attachEvent("on"+t,d);else{var l=e._handlers||(e._handlers={});l[t]=(l[t]||Ge).concat(d)}};function vt(e,t){return e._handlers&&e._handlers[t]||Ge}function Ot(e,t,d){if(e.removeEventListener)e.removeEventListener(t,d,!1);else if(e.detachEvent)e.detachEvent("on"+t,d);else{var l=e._handlers,b=l&&l[t];if(b){var B=le(b,d);B>-1&&(l[t]=b.slice(0,B).concat(b.slice(B+1)))}}}function nt(e,t){var d=vt(e,t);if(!d.length)return;for(var l=Array.prototype.slice.call(arguments,2),b=0;b<d.length;++b)d[b].apply(null,l)}function xt(e,t,d){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),nt(e,d||t.type,e,t),me(t)||t.codemirrorIgnore}function Ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var d=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<t.length;++l)le(d,t[l])==-1&&d.push(t[l])}function ve(e,t){return vt(e,t).length>0}function we(e){e.prototype.on=function(t,d){He(this,t,d)},e.prototype.off=function(t,d){Ot(this,t,d)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function me(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function be(e){ie(e),ae(e)}function ye(e){return e.target||e.srcElement}function Be(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var St=function(){if(K&&I<9)return!1;var e=h("div");return"draggable"in e||"dragDrop"in e}(),an;function Dn(e){if(an==null){var t=h("span","\u200B");f(e,h("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(an=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&I<8))}var d=an?h("span","\u200B"):h("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return d.setAttribute("cm-text",""),d}var yt;function en(e){if(yt!=null)return yt;var t=f(e,document.createTextNode("A\u062EA")),d=g(t,0,1).getBoundingClientRect(),l=g(t,1,2).getBoundingClientRect();return E(e),!d||d.left==d.right?!1:yt=l.right-d.right<3}var _t=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,d=[],l=e.length;t<=l;){var b=e.indexOf(`
|
|
`,t);b==-1&&(b=e.length);var B=e.slice(t,e.charAt(b-1)=="\r"?b-1:b),$=B.indexOf("\r");$!=-1?(d.push(B.slice(0,$)),t+=$+1):(d.push(B),t=b+1)}return d}:function(e){return e.split(/\r\n?|\n/)},Et=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(d){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},st=function(){var e=h("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),he=null;function Le(e){if(he!=null)return he;var t=f(e,h("span","x")),d=t.getBoundingClientRect(),l=g(t,0,1).getBoundingClientRect();return he=Math.abs(d.left-l.left)>1}var Lt={},ct={};function tn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Lt[e]=t}function un(e,t){ct[e]=t}function Pe(e){if(typeof e=="string"&&ct.hasOwnProperty(e))e=ct[e];else if(e&&typeof e.name=="string"&&ct.hasOwnProperty(e.name)){var t=ct[e.name];typeof t=="string"&&(t={name:t}),e=Ve(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function et(e,t){t=Pe(t);var d=Lt[t.name];if(!d)return et(e,"text/plain");var l=d(e,t);if(jt.hasOwnProperty(t.name)){var b=jt[t.name];for(var B in b){if(!b.hasOwnProperty(B))continue;l.hasOwnProperty(B)&&(l["_"+B]=l[B]),l[B]=b[B]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)l[$]=t.modeProps[$];return l}var jt={};function bn(e,t){var d=jt.hasOwnProperty(e)?jt[e]:jt[e]={};C(t,d)}function Kt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var d={};for(var l in t){var b=t[l];b instanceof Array&&(b=b.concat([])),d[l]=b}return d}function Xt(e,t){for(var d;e.innerMode&&!(d=e.innerMode(t),!d||d.mode==e);)t=d.state,e=d.mode;return d||{mode:e,state:t}}function Yn(e,t,d){return e.startState?e.startState(t,d):!0}var Bn=function(e,t,d){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=d};Bn.prototype.eol=function(){return this.pos>=this.string.length},Bn.prototype.sol=function(){return this.pos==this.lineStart},Bn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Bn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Bn.prototype.eat=function(e){var t=this.string.charAt(this.pos),d;if(typeof e=="string"?d=t==e:d=t&&(e.test?e.test(t):e(t)),d)return++this.pos,t},Bn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Bn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Bn.prototype.skipToEnd=function(){this.pos=this.string.length},Bn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Bn.prototype.backUp=function(e){this.pos-=e},Bn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Bn.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Bn.prototype.match=function(e,t,d){if(typeof e=="string"){var l=function($){return d?$.toLowerCase():$},b=this.string.substr(this.pos,e.length);if(l(b)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},Bn.prototype.current=function(){return this.string.slice(this.start,this.pos)},Bn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Bn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Bn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function _n(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 d=e;!d.lines;)for(var l=0;;++l){var b=d.children[l],B=b.chunkSize();if(t<B){d=b;break}t-=B}return d.lines[t]}function br(e,t,d){var l=[],b=t.line;return e.iter(t.line,d.line+1,function(B){var $=B.text;b==d.line&&($=$.slice(0,d.ch)),b==t.line&&($=$.slice(t.ch)),l.push($),++b}),l}function Fr(e,t,d){var l=[];return e.iter(t,d,function(b){l.push(b.text)}),l}function hr(e,t){var d=t-e.height;if(d)for(var l=e;l;l=l.parent)l.height+=d}function Qn(e){if(e.parent==null)return null;for(var t=e.parent,d=le(t.lines,e),l=t.parent;l;t=l,l=l.parent)for(var b=0;!(l.children[b]==t);++b)d+=l.children[b].chunkSize();return d+t.first}function Dr(e,t){var d=e.first;e:do{for(var l=0;l<e.children.length;++l){var b=e.children[l],B=b.height;if(t<B){e=b;continue e}t-=B,d+=b.chunkSize()}return d}while(!e.lines);for(var $=0;$<e.lines.length;++$){var ee=e.lines[$],te=ee.height;if(t<te)break;t-=te}return d+$}function Kr(e,t){return t>=e.first&&t<e.first+e.size}function ti(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function dn(e,t,d){if(d===void 0&&(d=null),!(this instanceof dn))return new dn(e,t,d);this.line=e,this.ch=t,this.sticky=d}function rr(e,t){return e.line-t.line||e.ch-t.ch}function fi(e,t){return e.sticky==t.sticky&&rr(e,t)==0}function wi(e){return dn(e.line,e.ch)}function ni(e,t){return rr(e,t)<0?t:e}function ri(e,t){return rr(e,t)<0?e:t}function X(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function L(e,t){if(t.line<e.first)return dn(e.first,0);var d=e.first+e.size-1;return t.line>d?dn(d,_n(e,d).text.length):N(t,_n(e,t.line).text.length)}function N(e,t){var d=e.ch;return d==null||d>t?dn(e.line,t):d<0?dn(e.line,0):e}function V(e,t){for(var d=[],l=0;l<t.length;l++)d[l]=L(e,t[l]);return d}var ne=function(e,t){this.state=e,this.lookAhead=t},J=function(e,t,d,l){this.state=t,this.doc=e,this.line=d,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};J.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},J.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}},J.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},J.fromSaved=function(e,t,d){return t instanceof ne?new J(e,Kt(e.mode,t.state),d,t.lookAhead):new J(e,Kt(e.mode,t),d)},J.prototype.save=function(e){var t=e!==!1?Kt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ne(t,this.maxLookAhead):t};function Fe(e,t,d,l){var b=[e.state.modeGen],B={};oi(e,t.text,e.doc.mode,d,function(ue,ke){return b.push(ue,ke)},B,l);for(var $=d.state,ee=function(ue){d.baseTokens=b;var ke=e.state.overlays[ue],Ke=1,bt=0;d.state=!0,oi(e,t.text,ke.mode,d,function(ft,sn){for(var Tn=Ke;bt<ft;){var Kn=b[Ke];Kn>ft&&b.splice(Ke,1,ft,b[Ke+1],Kn),Ke+=2,bt=Math.min(ft,Kn)}if(!sn)return;if(ke.opaque)b.splice(Tn,Ke-Tn,ft,"overlay "+sn),Ke=Tn+2;else for(;Tn<Ke;Tn+=2){var Xn=b[Tn+1];b[Tn+1]=(Xn?Xn+" ":"")+"overlay "+sn}},B),d.state=$,d.baseTokens=null,d.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)ee(te);return{styles:b,classes:B.bgClass||B.textClass?B:null}}function Jt(e,t,d){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=In(e,Qn(t)),b=t.text.length>e.options.maxHighlightLength&&Kt(e.doc.mode,l.state),B=Fe(e,t,l);b&&(l.state=b),t.stateAfter=l.save(!b),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),d===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function In(e,t,d){var l=e.doc,b=e.display;if(!l.mode.startState)return new J(l,!0,t);var B=Gr(e,t,d),$=B>l.first&&_n(l,B-1).stateAfter,ee=$?J.fromSaved(l,$,B):new J(l,Yn(l.mode),B);return l.iter(B,t,function(te){Zn(e,te.text,ee);var ue=ee.line;te.stateAfter=ue==t-1||ue%5==0||ue>=b.viewFrom&&ue<b.viewTo?ee.save():null,ee.nextLine()}),d&&(l.modeFrontier=ee.line),ee}function Zn(e,t,d,l){var b=e.doc.mode,B=new Bn(t,e.options.tabSize,d);for(B.start=B.pos=l||0,t==""&&ln(b,d.state);!B.eol();)ir(b,B,d.state),B.start=B.pos}function ln(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var d=Xt(e,t);if(d.mode.blankLine)return d.mode.blankLine(d.state)}function ir(e,t,d,l){for(var b=0;b<10;b++){l&&(l[0]=Xt(e,d).mode);var B=e.token(t,d);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var tr=function(e,t,d){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=d};function Mr(e,t,d,l){var b=e.doc,B=b.mode,$;t=L(b,t);var ee=_n(b,t.line),te=In(e,t.line,d),ue=new Bn(ee.text,e.options.tabSize,te),ke;for(l&&(ke=[]);(l||ue.pos<t.ch)&&!ue.eol();)ue.start=ue.pos,$=ir(B,ue,te.state),l&&ke.push(new tr(ue,$,Kt(b.mode,te.state)));return l?ke:new tr(ue,$,te.state)}function ui(e,t){if(e)for(;;){var d=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!d)break;e=e.slice(0,d.index)+e.slice(d.index+d[0].length);var l=d[1]?"bgClass":"textClass";t[l]==null?t[l]=d[2]:new RegExp("(?:^|\\s)"+d[2]+"(?:$|\\s)").test(t[l])||(t[l]+=" "+d[2])}return e}function oi(e,t,d,l,b,B,$){var ee=d.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var te=0,ue=null,ke=new Bn(t,e.options.tabSize,l),Ke,bt=e.options.addModeClass&&[null];for(t==""&&ui(ln(d,l.state),B);!ke.eol();){if(ke.pos>e.options.maxHighlightLength?(ee=!1,$&&Zn(e,t,l,ke.pos),ke.pos=t.length,Ke=null):Ke=ui(ir(d,ke,l.state,bt),B),bt){var ft=bt[0].name;ft&&(Ke="m-"+(Ke?ft+" "+Ke:ft))}if(!ee||ue!=Ke){for(;te<ke.start;)te=Math.min(ke.start,te+5e3),b(te,ue);ue=Ke}ke.start=ke.pos}for(;te<ke.pos;){var sn=Math.min(ke.pos,te+5e3);b(sn,ue),te=sn}}function Gr(e,t,d){for(var l,b,B=e.doc,$=d?-1:t-(e.doc.mode.innerMode?1e3:100),ee=t;ee>$;--ee){if(ee<=B.first)return B.first;var te=_n(B,ee-1),ue=te.stateAfter;if(ue&&(!d||ee+(ue instanceof ne?ue.lookAhead:0)<=B.modeFrontier))return ee;var ke=z(te.text,null,e.options.tabSize);(b==null||l>ke)&&(b=ee-1,l=ke)}return b}function Li(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var d=e.first,l=t-1;l>d;l--){var b=_n(e,l).stateAfter;if(b&&(!(b instanceof ne)||l+b.lookAhead<t)){d=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,d)}var Vi=!1,Ar=!1;function Tr(){Vi=!0}function ii(){Ar=!0}function Br(e,t,d){this.marker=e,this.from=t,this.to=d}function Hn(e,t){if(e)for(var d=0;d<e.length;++d){var l=e[d];if(l.marker==t)return l}}function yn(e,t){for(var d,l=0;l<e.length;++l)e[l]!=t&&(d||(d=[])).push(e[l]);return d}function Sn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function En(e,t,d){var l;if(e)for(var b=0;b<e.length;++b){var B=e[b],$=B.marker,ee=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);if(ee||B.from==t&&$.type=="bookmark"&&(!d||!B.marker.insertLeft)){var te=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);(l||(l=[])).push(new Br($,B.from,te?null:B.to))}}return l}function ur(e,t,d){var l;if(e)for(var b=0;b<e.length;++b){var B=e[b],$=B.marker,ee=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);if(ee||B.from==t&&$.type=="bookmark"&&(!d||B.marker.insertLeft)){var te=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);(l||(l=[])).push(new Br($,te?null:B.from-t,B.to==null?null:B.to-t))}}return l}function sr(e,t){if(t.full)return null;var d=Kr(e,t.from.line)&&_n(e,t.from.line).markedSpans,l=Kr(e,t.to.line)&&_n(e,t.to.line).markedSpans;if(!d&&!l)return null;var b=t.from.ch,B=t.to.ch,$=rr(t.from,t.to)==0,ee=En(d,b,$),te=ur(l,B,$),ue=t.text.length==1,ke=at(t.text).length+(ue?b:0);if(ee)for(var Ke=0;Ke<ee.length;++Ke){var bt=ee[Ke];if(bt.to==null){var ft=Hn(te,bt.marker);ft?ue&&(bt.to=ft.to==null?null:ft.to+ke):bt.to=b}}if(te)for(var sn=0;sn<te.length;++sn){var Tn=te[sn];if(Tn.to!=null&&(Tn.to+=ke),Tn.from==null){var Kn=Hn(ee,Tn.marker);Kn||(Tn.from=ke,ue&&(ee||(ee=[])).push(Tn))}else Tn.from+=ke,ue&&(ee||(ee=[])).push(Tn)}ee&&(ee=Q(ee)),te&&te!=ee&&(te=Q(te));var Xn=[ee];if(!ue){var er=t.text.length-2,$n;if(er>0&&ee)for(var or=0;or<ee.length;++or)ee[or].to==null&&($n||($n=[])).push(new Br(ee[or].marker,null,null));for(var Cr=0;Cr<er;++Cr)Xn.push($n);Xn.push(te)}return Xn}function Q(e){for(var t=0;t<e.length;++t){var d=e[t];d.from!=null&&d.from==d.to&&d.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function de(e,t,d){var l=null;if(e.iter(t.line,d.line+1,function(ft){if(ft.markedSpans)for(var sn=0;sn<ft.markedSpans.length;++sn){var Tn=ft.markedSpans[sn].marker;Tn.readOnly&&(!l||le(l,Tn)==-1)&&(l||(l=[])).push(Tn)}}),!l)return null;for(var b=[{from:t,to:d}],B=0;B<l.length;++B)for(var $=l[B],ee=$.find(0),te=0;te<b.length;++te){var ue=b[te];if(rr(ue.to,ee.from)<0||rr(ue.from,ee.to)>0)continue;var ke=[te,1],Ke=rr(ue.from,ee.from),bt=rr(ue.to,ee.to);(Ke<0||!$.inclusiveLeft&&!Ke)&&ke.push({from:ue.from,to:ee.from}),(bt>0||!$.inclusiveRight&&!bt)&&ke.push({from:ee.to,to:ue.to}),b.splice.apply(b,ke),te+=ke.length-3}return b}function Te(e){var t=e.markedSpans;if(!t)return;for(var d=0;d<t.length;++d)t[d].marker.detachLine(e);e.markedSpans=null}function Se(e,t){if(!t)return;for(var d=0;d<t.length;++d)t[d].marker.attachLine(e);e.markedSpans=t}function rt(e){return e.inclusiveLeft?-1:0}function De(e){return e.inclusiveRight?1:0}function Je(e,t){var d=e.lines.length-t.lines.length;if(d!=0)return d;var l=e.find(),b=t.find(),B=rr(l.from,b.from)||rt(e)-rt(t);if(B)return-B;var $=rr(l.to,b.to)||De(e)-De(t);return $||t.id-e.id}function it(e,t){var d=Ar&&e.markedSpans,l;if(d)for(var b=void 0,B=0;B<d.length;++B)b=d[B],b.marker.collapsed&&(t?b.from:b.to)==null&&(!l||Je(l,b.marker)<0)&&(l=b.marker);return l}function At(e){return it(e,!0)}function Ct(e){return it(e,!1)}function We(e,t){var d=Ar&&e.markedSpans,l;if(d)for(var b=0;b<d.length;++b){var B=d[b];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!l||Je(l,B.marker)<0)&&(l=B.marker)}return l}function gt(e,t,d,l,b){var B=_n(e,t),$=Ar&&B.markedSpans;if($)for(var ee=0;ee<$.length;++ee){var te=$[ee];if(!te.marker.collapsed)continue;var ue=te.marker.find(0),ke=rr(ue.from,d)||rt(te.marker)-rt(b),Ke=rr(ue.to,l)||De(te.marker)-De(b);if(ke>=0&&Ke<=0||ke<=0&&Ke>=0)continue;if(ke<=0&&(te.marker.inclusiveRight&&b.inclusiveLeft?rr(ue.to,d)>=0:rr(ue.to,d)>0)||ke>=0&&(te.marker.inclusiveRight&&b.inclusiveLeft?rr(ue.from,l)<=0:rr(ue.from,l)<0))return!0}}function ot(e){for(var t;t=At(e);)e=t.find(-1,!0).line;return e}function dt(e){for(var t;t=Ct(e);)e=t.find(1,!0).line;return e}function wt(e){for(var t,d;t=Ct(e);)e=t.find(1,!0).line,(d||(d=[])).push(e);return d}function kt(e,t){var d=_n(e,t),l=ot(d);return d==l?t:Qn(l)}function mt(e,t){if(t>e.lastLine())return t;var d=_n(e,t),l;if(!$t(e,d))return t;for(;l=Ct(d);)d=l.find(1,!0).line;return Qn(d)+1}function $t(e,t){var d=Ar&&t.markedSpans;if(d)for(var l=void 0,b=0;b<d.length;++b){if(l=d[b],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&hn(e,t,l))return!0}}function hn(e,t,d){if(d.to==null){var l=d.marker.find(1,!0);return hn(e,l.line,Hn(l.line.markedSpans,d.marker))}if(d.marker.inclusiveRight&&d.to==t.text.length)return!0;for(var b=void 0,B=0;B<t.markedSpans.length;++B)if(b=t.markedSpans[B],b.marker.collapsed&&!b.marker.widgetNode&&b.from==d.to&&(b.to==null||b.to!=d.from)&&(b.marker.inclusiveLeft||d.marker.inclusiveRight)&&hn(e,t,b))return!0}function Pn(e){e=ot(e);for(var t=0,d=e.parent,l=0;l<d.lines.length;++l){var b=d.lines[l];if(b==e)break;t+=b.height}for(var B=d.parent;B;d=B,B=d.parent)for(var $=0;$<B.children.length;++$){var ee=B.children[$];if(ee==d)break;t+=ee.height}return t}function Gn(e){if(e.height==0)return 0;for(var t=e.text.length,d,l=e;d=At(l);){var b=d.find(0,!0);l=b.from.line,t+=b.from.ch-b.to.ch}for(l=e;d=Ct(l);){var B=d.find(0,!0);t-=l.text.length-B.from.ch,l=B.to.line,t+=l.text.length-B.to.ch}return t}function On(e){var t=e.display,d=e.doc;t.maxLine=_n(d,d.first),t.maxLineLength=Gn(t.maxLine),t.maxLineChanged=!0,d.iter(function(l){var b=Gn(l);b>t.maxLineLength&&(t.maxLineLength=b,t.maxLine=l)})}var Nn=function(e,t,d){this.text=e,Se(this,t),this.height=d?d(this):1};Nn.prototype.lineNo=function(){return Qn(this)},we(Nn);function Mn(e,t,d,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Te(e),Se(e,d);var b=l?l(e):1;b!=e.height&&hr(e,b)}function Pt(e){e.parent=null,Te(e)}var fn={},Wt={};function Rt(e,t){if(!e||/^\s*$/.test(e))return null;var d=t.addModeClass?Wt:fn;return d[e]||(d[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,t){var d=y("span",null,null,r?"padding-right: .1px":null),l={pre:y("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var b=0;b<=(t.rest?t.rest.length:0);b++){var B=b?t.rest[b-1]:t.line,$=void 0;l.pos=0,l.addToken=Yt,en(e.display.measure)&&($=xn(B,e.doc.direction))&&(l.addToken=jn(l.addToken,$)),l.map=[];var ee=t!=e.display.externalMeasured&&Qn(B);qn(B,l,Jt(e,B,ee)),B.styleClasses&&(B.styleClasses.bgClass&&(l.bgClass=A(B.styleClasses.bgClass,l.bgClass||"")),B.styleClasses.textClass&&(l.textClass=A(B.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Dn(e.display.measure))),b==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var te=l.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return nt(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=A(l.pre.className,l.textClass||"")),l}function Rn(e){var t=h("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yt(e,t,d,l,b,B,$){if(!t)return;var ee=e.splitSpaces?ht(t,e.trailingSpace):t,te=e.cm.state.specialChars,ue=!1,ke;if(!te.test(t))e.col+=t.length,ke=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,ke),K&&I<9&&(ue=!0),e.pos+=t.length;else{ke=document.createDocumentFragment();for(var Ke=0;;){te.lastIndex=Ke;var bt=te.exec(t),ft=bt?bt.index-Ke:t.length-Ke;if(ft){var sn=document.createTextNode(ee.slice(Ke,Ke+ft));K&&I<9?ke.appendChild(h("span",[sn])):ke.appendChild(sn),e.map.push(e.pos,e.pos+ft,sn),e.col+=ft,e.pos+=ft}if(!bt)break;Ke+=ft+1;var Tn=void 0;if(bt[0]==" "){var Kn=e.cm.options.tabSize,Xn=Kn-e.col%Kn;Tn=ke.appendChild(h("span",pe(Xn),"cm-tab")),Tn.setAttribute("role","presentation"),Tn.setAttribute("cm-text"," "),e.col+=Xn}else bt[0]=="\r"||bt[0]==`
|
|
`?(Tn=ke.appendChild(h("span",bt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Tn.setAttribute("cm-text",bt[0]),e.col+=1):(Tn=e.cm.options.specialCharPlaceholder(bt[0]),Tn.setAttribute("cm-text",bt[0]),K&&I<9?ke.appendChild(h("span",[Tn])):ke.appendChild(Tn),e.col+=1);e.map.push(e.pos,e.pos+1,Tn),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,d||l||b||ue||B||$){var er=d||"";l&&(er+=l),b&&(er+=b);var $n=h("span",[ke],er,B);if($)for(var or in $)$.hasOwnProperty(or)&&or!="style"&&or!="class"&&$n.setAttribute(or,$[or]);return e.content.appendChild($n)}e.content.appendChild(ke)}function ht(e,t){if(e.length>1&&!/ /.test(e))return e;for(var d=t,l="",b=0;b<e.length;b++){var B=e.charAt(b);B==" "&&d&&(b==e.length-1||e.charCodeAt(b+1)==32)&&(B="\xA0"),l+=B,d=B==" "}return l}function jn(e,t){return function(d,l,b,B,$,ee,te){b=b?b+" cm-force-border":"cm-force-border";for(var ue=d.pos,ke=ue+l.length;;){for(var Ke=void 0,bt=0;bt<t.length&&!(Ke=t[bt],Ke.to>ue&&Ke.from<=ue);bt++);if(Ke.to>=ke)return e(d,l,b,B,$,ee,te);e(d,l.slice(0,Ke.to-ue),b,B,null,ee,te),B=null,l=l.slice(Ke.to-ue),ue=Ke.to}}}function pn(e,t,d,l){var b=!l&&d.widgetNode;b&&e.map.push(e.pos,e.pos+t,b),!l&&e.cm.display.input.needsContentAttribute&&(b||(b=e.content.appendChild(document.createElement("span"))),b.setAttribute("cm-marker",d.id)),b&&(e.cm.display.input.setUneditable(b),e.content.appendChild(b)),e.pos+=t,e.trailingSpace=!1}function qn(e,t,d){var l=e.markedSpans,b=e.text,B=0;if(!l){for(var $=1;$<d.length;$+=2)t.addToken(t,b.slice(B,B=d[$]),Rt(d[$+1],t.cm.options));return}for(var ee=b.length,te=0,ue=1,ke="",Ke,bt,ft=0,sn,Tn,Kn,Xn,er;;){if(ft==te){sn=Tn=Kn=bt="",er=null,Xn=null,ft=Infinity;for(var $n=[],or=void 0,Cr=0;Cr<l.length;++Cr){var _r=l[Cr],jr=_r.marker;if(jr.type=="bookmark"&&_r.from==te&&jr.widgetNode)$n.push(jr);else if(_r.from<=te&&(_r.to==null||_r.to>te||jr.collapsed&&_r.to==te&&_r.from==te)){if(_r.to!=null&&_r.to!=te&&ft>_r.to&&(ft=_r.to,Tn=""),jr.className&&(sn+=" "+jr.className),jr.css&&(bt=(bt?bt+";":"")+jr.css),jr.startStyle&&_r.from==te&&(Kn+=" "+jr.startStyle),jr.endStyle&&_r.to==ft&&(or||(or=[])).push(jr.endStyle,_r.to),jr.title&&((er||(er={})).title=jr.title),jr.attributes)for(var mi in jr.attributes)(er||(er={}))[mi]=jr.attributes[mi];jr.collapsed&&(!Xn||Je(Xn.marker,jr)<0)&&(Xn=_r)}else _r.from>te&&ft>_r.from&&(ft=_r.from)}if(or)for(var Hi=0;Hi<or.length;Hi+=2)or[Hi+1]==ft&&(Tn+=" "+or[Hi]);if(!Xn||Xn.from==te)for(var Ci=0;Ci<$n.length;++Ci)pn(t,0,$n[Ci]);if(Xn&&(Xn.from||0)==te){if(pn(t,(Xn.to==null?ee+1:Xn.to)-te,Xn.marker,Xn.from==null),Xn.to==null)return;Xn.to==te&&(Xn=!1)}}if(te>=ee)break;for(var oa=Math.min(ee,ft);;){if(ke){var na=te+ke.length;if(!Xn){var ki=na>oa?ke.slice(0,oa-te):ke;t.addToken(t,ki,Ke?Ke+sn:sn,Kn,te+ki.length==ft?Tn:"",bt,er)}if(na>=oa){ke=ke.slice(oa-te),te=oa;break}te=na,Kn=""}ke=b.slice(B,B=d[ue++]),Ke=Rt(d[ue++],t.cm.options)}}}function Zt(e,t,d){this.line=t,this.rest=wt(t),this.size=this.rest?Qn(at(this.rest))-d+1:1,this.node=this.text=null,this.hidden=$t(e,t)}function An(e,t,d){for(var l=[],b,B=t;B<d;B=b){var $=new Zt(e.doc,_n(e.doc,B),B);b=B+$.size,l.push($)}return l}var Fn=null;function vn(e){Fn?Fn.ops.push(e):e.ownsGroup=Fn={ops:[e],delayedCallbacks:[]}}function yr(e){var t=e.delayedCallbacks,d=0;do{for(;d<t.length;d++)t[d].call(null);for(var l=0;l<e.ops.length;l++){var b=e.ops[l];if(b.cursorActivityHandlers)for(;b.cursorActivityCalled<b.cursorActivityHandlers.length;)b.cursorActivityHandlers[b.cursorActivityCalled++].call(null,b.cm)}}while(d<t.length)}function Ln(e,t){var d=e.ownsGroup;if(!d)return;try{yr(d)}finally{Fn=null,t(d)}}var Cn=null;function Dt(e,t){var d=vt(e,t);if(!d.length)return;var l=Array.prototype.slice.call(arguments,2),b;Fn?b=Fn.delayedCallbacks:Cn?b=Cn:(b=Cn=[],setTimeout(Ze,0));for(var B=function(ee){b.push(function(){return d[ee].apply(null,l)})},$=0;$<d.length;++$)B($)}function Ze(){var e=Cn;Cn=null;for(var t=0;t<e.length;++t)e[t]()}function It(e,t,d,l){for(var b=0;b<t.changes.length;b++){var B=t.changes[b];B=="text"?kn(e,t):B=="gutter"?nr(e,t,d,l):B=="class"?lr(e,t):B=="widget"&&Or(e,t,l)}t.changes=null}function Mt(e){return e.node==e.text&&(e.node=h("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&I<8&&(e.node.style.zIndex=2)),e.node}function cn(e,t){var d=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(d&&(d+=" CodeMirror-linebackground"),t.background)d?t.background.className=d:(t.background.parentNode.removeChild(t.background),t.background=null);else if(d){var l=Mt(t);t.background=l.insertBefore(h("div",null,d),l.firstChild),e.display.input.setUneditable(t.background)}}function zn(e,t){var d=e.display.externalMeasured;return d&&d.line==t.line?(e.display.externalMeasured=null,t.measure=d.measure,d.built):Un(e,t)}function kn(e,t){var d=t.text.className,l=zn(e,t);t.text==t.node&&(t.node=l.pre),t.text.parentNode.replaceChild(l.pre,t.text),t.text=l.pre,l.bgClass!=t.bgClass||l.textClass!=t.textClass?(t.bgClass=l.bgClass,t.textClass=l.textClass,lr(e,t)):d&&(t.text.className=d)}function lr(e,t){cn(e,t),t.line.wrapClass?Mt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var d=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=d||""}function nr(e,t,d,l){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 b=Mt(t);t.gutterBackground=h("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),b.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var $=Mt(t),ee=t.gutter=h("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),$.insertBefore(ee,t.text),t.line.gutterClass&&(ee.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=ee.appendChild(h("div",ti(e.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var te=0;te<e.display.gutterSpecs.length;++te){var ue=e.display.gutterSpecs[te].className,ke=B.hasOwnProperty(ue)&&B[ue];ke&&ee.appendChild(h("div",[ke],"CodeMirror-gutter-elt","left: "+l.gutterLeft[ue]+"px; width: "+l.gutterWidth[ue]+"px"))}}}function Or(e,t,d){t.alignable&&(t.alignable=null);for(var l=S("CodeMirror-linewidget"),b=t.node.firstChild,B=void 0;b;b=B)B=b.nextSibling,l.test(b.className)&&t.node.removeChild(b);Er(e,t,d)}function mr(e,t,d,l){var b=zn(e,t);return t.text=t.node=b.pre,b.bgClass&&(t.bgClass=b.bgClass),b.textClass&&(t.textClass=b.textClass),lr(e,t),nr(e,t,d,l),Er(e,t,l),t.node}function Er(e,t,d){if(Zr(e,t.line,t,d,!0),t.rest)for(var l=0;l<t.rest.length;l++)Zr(e,t.rest[l],t,d,!1)}function Zr(e,t,d,l,b){if(!t.widgets)return;for(var B=Mt(d),$=0,ee=t.widgets;$<ee.length;++$){var te=ee[$],ue=h("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||ue.setAttribute("cm-ignore-events","true"),Yr(te,ue,d,l),e.display.input.setUneditable(ue),b&&te.above?B.insertBefore(ue,d.gutter||d.text):B.appendChild(ue),Dt(te,"redraw")}}function Yr(e,t,d,l){if(e.noHScroll){(d.alignable||(d.alignable=[])).push(t);var b=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(b-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=b+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function Jr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var d="position: relative;";e.coverGutter&&(d+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(d+="width: "+t.display.wrapper.clientWidth+"px;"),f(t.display.measure,h("div",[e.node],null,d))}return e.height=e.node.parentNode.offsetHeight}function vi(e,t){for(var d=ye(t);d!=e.wrapper;d=d.parentNode)if(!d||d.nodeType==1&&d.getAttribute("cm-ignore-events")=="true"||d.parentNode==e.sizer&&d!=e.mover)return!0}function _i(e){return e.lineSpace.offsetTop}function xe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function je(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,h("pre","x","CodeMirror-line-like")),d=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,l={left:parseInt(d.paddingLeft),right:parseInt(d.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Ye(e){return se-e.display.nativeBarWidth}function Oe(e){return e.display.scroller.clientWidth-Ye(e)-e.display.barWidth}function re(e){return e.display.scroller.clientHeight-Ye(e)-e.display.barHeight}function ge(e,t,d){var l=e.options.lineWrapping,b=l&&Oe(e);if(!t.measure.heights||l&&t.measure.width!=b){var B=t.measure.heights=[];if(l){t.measure.width=b;for(var $=t.text.firstChild.getClientRects(),ee=0;ee<$.length-1;ee++){var te=$[ee],ue=$[ee+1];Math.abs(te.bottom-ue.bottom)>2&&B.push((te.bottom+ue.top)/2-d.top)}}B.push(d.bottom-d.top)}}function ce(e,t,d){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==t)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var b=0;b<e.rest.length;b++)if(Qn(e.rest[b])>d)return{map:e.measure.maps[b],cache:e.measure.caches[b],before:!0}}function Re(e,t){t=ot(t);var d=Qn(t),l=e.display.externalMeasured=new Zt(e.doc,t,d);l.lineN=d;var b=l.built=Un(e,l);return l.text=b.pre,f(e.display.lineMeasure,b.pre),l}function Me(e,t,d,l){return lt(e,Ne(e,t),d,l)}function qe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ci(e,t)];var d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size)return d}function Ne(e,t){var d=Qn(t),l=qe(e,d);l&&!l.text?l=null:l&&l.changes&&(It(e,l,d,vr(e)),e.curOp.forceUpdate=!0),l||(l=Re(e,t));var b=ce(l,t,d);return{line:t,view:l,rect:null,map:b.map,cache:b.cache,before:b.before,hasHeights:!1}}function lt(e,t,d,l,b){t.before&&(d=-1);var B=d+(l||""),$;return t.cache.hasOwnProperty(B)?$=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ge(e,t.view,t.rect),t.hasHeights=!0),$=Wn(e,t,d,l),$.bogus||(t.cache[B]=$)),{left:$.left,right:$.right,top:b?$.rtop:$.top,bottom:b?$.rbottom:$.bottom}}var Nt={left:0,right:0,top:0,bottom:0};function on(e,t,d){for(var l,b,B,$,ee,te,ue=0;ue<e.length;ue+=3)if(ee=e[ue],te=e[ue+1],t<ee?(b=0,B=1,$="left"):t<te?(b=t-ee,B=b+1):(ue==e.length-3||t==te&&e[ue+3]>t)&&(B=te-ee,b=B-1,t>=te&&($="right")),b!=null){if(l=e[ue+2],ee==te&&d==(l.insertLeft?"left":"right")&&($=d),d=="left"&&b==0)for(;ue&&e[ue-2]==e[ue-3]&&e[ue-1].insertLeft;)l=e[(ue-=3)+2],$="left";if(d=="right"&&b==te-ee)for(;ue<e.length-3&&e[ue+3]==e[ue+4]&&!e[ue+5].insertLeft;)l=e[(ue+=3)+2],$="right";break}return{node:l,start:b,end:B,collapse:$,coverStart:ee,coverEnd:te}}function mn(e,t){var d=Nt;if(t=="left")for(var l=0;l<e.length&&!((d=e[l]).left!=d.right);l++);else for(var b=e.length-1;b>=0&&!((d=e[b]).left!=d.right);b--);return d}function Wn(e,t,d,l){var b=on(t.map,d,l),B=b.node,$=b.start,ee=b.end,te=b.collapse,ue;if(B.nodeType==3){for(var ke=0;ke<4;ke++){for(;$&&ze(t.line.text.charAt(b.coverStart+$));)--$;for(;b.coverStart+ee<b.coverEnd&&ze(t.line.text.charAt(b.coverStart+ee));)++ee;if(K&&I<9&&$==0&&ee==b.coverEnd-b.coverStart?ue=B.parentNode.getBoundingClientRect():ue=mn(g(B,$,ee).getClientRects(),l),ue.left||ue.right||$==0)break;ee=$,$=$-1,te="right"}K&&I<11&&(ue=Vn(e.display.measure,ue))}else{$>0&&(te=l="right");var Ke;e.options.lineWrapping&&(Ke=B.getClientRects()).length>1?ue=Ke[l=="right"?Ke.length-1:0]:ue=B.getBoundingClientRect()}if(K&&I<9&&!$&&(!ue||!ue.left&&!ue.right)){var bt=B.parentNode.getClientRects()[0];bt?ue={left:bt.left,right:bt.left+Hr(e.display),top:bt.top,bottom:bt.bottom}:ue=Nt}for(var ft=ue.top-t.rect.top,sn=ue.bottom-t.rect.top,Tn=(ft+sn)/2,Kn=t.view.measure.heights,Xn=0;Xn<Kn.length-1&&!(Tn<Kn[Xn]);Xn++);var er=Xn?Kn[Xn-1]:0,$n=Kn[Xn],or={left:(te=="right"?ue.right:ue.left)-t.rect.left,right:(te=="left"?ue.left:ue.right)-t.rect.left,top:er,bottom:$n};return!ue.left&&!ue.right&&(or.bogus=!0),e.options.singleCursorHeightPerLine||(or.rtop=ft,or.rbottom=sn),or}function Vn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Le(e))return t;var d=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*d,right:t.right*d,top:t.top*l,bottom:t.bottom*l}}function fr(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 cr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)fr(e.display.view[t])}function xr(e){cr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Rr(){return _&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function gr(){return _&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wr(e){var t=0;if(e.widgets)for(var d=0;d<e.widgets.length;++d)e.widgets[d].above&&(t+=Jr(e.widgets[d]));return t}function Lr(e,t,d,l,b){if(!b){var B=wr(t);d.top+=B,d.bottom+=B}if(l=="line")return d;l||(l="local");var $=Pn(t);if(l=="local"?$+=_i(e.display):$-=e.display.viewOffset,l=="page"||l=="window"){var ee=e.display.lineSpace.getBoundingClientRect();$+=ee.top+(l=="window"?0:gr());var te=ee.left+(l=="window"?0:Rr());d.left+=te,d.right+=te}return d.top+=$,d.bottom+=$,d}function gn(e,t,d){if(d=="div")return t;var l=t.left,b=t.top;if(d=="page")l-=Rr(),b-=gr();else if(d=="local"||!d){var B=e.display.sizer.getBoundingClientRect();l+=B.left,b+=B.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:l-$.left,top:b-$.top}}function rn(e,t,d,l,b){return l||(l=_n(e.doc,t.line)),Lr(e,l,Me(e,l,t.ch,b),d)}function wn(e,t,d,l,b,B){l=l||_n(e.doc,t.line),b||(b=Ne(e,l));function $(sn,Tn){var Kn=lt(e,b,sn,Tn?"right":"left",B);return Tn?Kn.left=Kn.right:Kn.right=Kn.left,Lr(e,l,Kn,d)}var ee=xn(l,e.doc.direction),te=t.ch,ue=t.sticky;if(te>=l.text.length?(te=l.text.length,ue="before"):te<=0&&(te=0,ue="after"),!ee)return $(ue=="before"?te-1:te,ue=="before");function ke(sn,Tn,Kn){var Xn=ee[Tn],er=Xn.level==1;return $(Kn?sn-1:sn,er!=Kn)}var Ke=tt(ee,te,ue),bt=qt,ft=ke(te,Ke,ue=="before");return bt!=null&&(ft.other=ke(te,bt,ue!="before")),ft}function zt(e,t){var d=0;t=L(e.doc,t),e.options.lineWrapping||(d=Hr(e.display)*t.ch);var l=_n(e.doc,t.line),b=Pn(l)+_i(e.display);return{left:d,right:d,top:b,bottom:b+l.height}}function Vt(e,t,d,l,b){var B=dn(e,t,d);return B.xRel=b,l&&(B.outside=l),B}function pr(e,t,d){var l=e.doc;if(d+=e.display.viewOffset,d<0)return Vt(l.first,0,null,-1,-1);var b=Dr(l,d),B=l.first+l.size-1;if(b>B)return Vt(l.first+l.size-1,_n(l,B).text.length,null,1,1);t<0&&(t=0);for(var $=_n(l,b);;){var ee=si(e,$,b,t,d),te=We($,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!te)return ee;var ue=te.find(1);if(ue.line==b)return ue;$=_n(l,b=ue.line)}}function Pr(e,t,d,l){l-=wr(t);var b=t.text.length,B=Bt(function($){return lt(e,d,$-1).bottom<=l},b,0);return b=Bt(function($){return lt(e,d,$).top>l},B,b),{begin:B,end:b}}function ar(e,t,d,l){d||(d=Ne(e,t));var b=Lr(e,t,lt(e,d,l),"line").top;return Pr(e,t,d,b)}function Nr(e,t,d,l){return e.bottom<=d?!1:e.top>d?!0:(l?e.left:e.right)>t}function si(e,t,d,l,b){b-=Pn(t);var B=Ne(e,t),$=wr(t),ee=0,te=t.text.length,ue=!0,ke=xn(t,e.doc.direction);if(ke){var Ke=(e.options.lineWrapping?Xr:Ur)(e,t,d,B,ke,l,b);ue=Ke.level!=1,ee=ue?Ke.from:Ke.to-1,te=ue?Ke.to:Ke.from-1}var bt=null,ft=null,sn=Bt(function(Cr){var _r=lt(e,B,Cr);return _r.top+=$,_r.bottom+=$,Nr(_r,l,b,!1)?(_r.top<=b&&_r.left<=l&&(bt=Cr,ft=_r),!0):!1},ee,te),Tn,Kn,Xn=!1;if(ft){var er=l-ft.left<ft.right-l,$n=er==ue;sn=bt+($n?0:1),Kn=$n?"after":"before",Tn=er?ft.left:ft.right}else{!ue&&(sn==te||sn==ee)&&sn++,Kn=sn==0?"after":sn==t.text.length?"before":lt(e,B,sn-(ue?1:0)).bottom+$<=b==ue?"after":"before";var or=wn(e,dn(d,sn,Kn),"line",t,B);Tn=or.left,Xn=b<or.top?-1:b>=or.bottom?1:0}return sn=$e(t.text,sn,1),Vt(d,sn,Kn,Xn,l-Tn)}function Ur(e,t,d,l,b,B,$){var ee=Bt(function(Ke){var bt=b[Ke],ft=bt.level!=1;return Nr(wn(e,dn(d,ft?bt.to:bt.from,ft?"before":"after"),"line",t,l),B,$,!0)},0,b.length-1),te=b[ee];if(ee>0){var ue=te.level!=1,ke=wn(e,dn(d,ue?te.from:te.to,ue?"after":"before"),"line",t,l);Nr(ke,B,$,!0)&&ke.top>$&&(te=b[ee-1])}return te}function Xr(e,t,d,l,b,B,$){var ee=Pr(e,t,l,$),te=ee.begin,ue=ee.end;/\s/.test(t.text.charAt(ue-1))&&ue--;for(var ke=null,Ke=null,bt=0;bt<b.length;bt++){var ft=b[bt];if(ft.from>=ue||ft.to<=te)continue;var sn=ft.level!=1,Tn=lt(e,l,sn?Math.min(ue,ft.to)-1:Math.max(te,ft.from)).right,Kn=Tn<B?B-Tn+1e9:Tn-B;(!ke||Ke>Kn)&&(ke=ft,Ke=Kn)}return ke||(ke=b[b.length-1]),ke.from<te&&(ke={from:te,to:ke.to,level:ke.level}),ke.to>ue&&(ke={from:ke.from,to:ue,level:ke.level}),ke}var zr;function Wr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(zr==null){zr=h("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)zr.appendChild(document.createTextNode("x")),zr.appendChild(h("br"));zr.appendChild(document.createTextNode("x"))}f(e.measure,zr);var d=zr.offsetHeight/50;return d>3&&(e.cachedTextHeight=d),E(e.measure),d||1}function Hr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=h("span","xxxxxxxxxx"),d=h("pre",[t],"CodeMirror-line-like");f(e.measure,d);var l=t.getBoundingClientRect(),b=(l.right-l.left)/10;return b>2&&(e.cachedCharWidth=b),b||10}function vr(e){for(var t=e.display,d={},l={},b=t.gutters.clientLeft,B=t.gutters.firstChild,$=0;B;B=B.nextSibling,++$){var ee=e.display.gutterSpecs[$].className;d[ee]=B.offsetLeft+B.clientLeft+b,l[ee]=B.clientWidth}return{fixedPos:yi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:d,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function yi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qi(e){var t=Wr(e.display),d=e.options.lineWrapping,l=d&&Math.max(5,e.display.scroller.clientWidth/Hr(e.display)-3);return function(b){if($t(e.doc,b))return 0;var B=0;if(b.widgets)for(var $=0;$<b.widgets.length;$++)b.widgets[$].height&&(B+=b.widgets[$].height);return d?B+(Math.ceil(b.text.length/l)||1)*t:B+t}}function ji(e){var t=e.doc,d=Qi(e);t.iter(function(l){var b=d(l);b!=l.height&&hr(l,b)})}function Ri(e,t,d,l){var b=e.display;if(!d&&ye(t).getAttribute("cm-not-content")=="true")return null;var B,$,ee=b.lineSpace.getBoundingClientRect();try{B=t.clientX-ee.left,$=t.clientY-ee.top}catch(Ke){return null}var te=pr(e,B,$),ue;if(l&&te.xRel>0&&(ue=_n(e.doc,te.line).text).length==te.ch){var ke=z(ue,ue.length,e.options.tabSize)-ue.length;te=dn(te.line,Math.max(0,Math.round((B-je(e.display).left)/Hr(e.display))-ke))}return te}function ci(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var d=e.display.view,l=0;l<d.length;l++)if(t-=d[l].size,t<0)return l}function qr(e,t,d,l){t==null&&(t=e.doc.first),d==null&&(d=e.doc.first+e.doc.size),l||(l=0);var b=e.display;if(l&&d<b.viewTo&&(b.updateLineNumbers==null||b.updateLineNumbers>t)&&(b.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=b.viewTo)Ar&&kt(e.doc,t)<b.viewTo&&di(e);else if(d<=b.viewFrom)Ar&&mt(e.doc,d+l)>b.viewFrom?di(e):(b.viewFrom+=l,b.viewTo+=l);else if(t<=b.viewFrom&&d>=b.viewTo)di(e);else if(t<=b.viewFrom){var B=Fi(e,d,d+l,1);B?(b.view=b.view.slice(B.index),b.viewFrom=B.lineN,b.viewTo+=l):di(e)}else if(d>=b.viewTo){var $=Fi(e,t,t,-1);$?(b.view=b.view.slice(0,$.index),b.viewTo=$.lineN):di(e)}else{var ee=Fi(e,t,t,-1),te=Fi(e,d,d+l,1);ee&&te?(b.view=b.view.slice(0,ee.index).concat(An(e,ee.lineN,te.lineN)).concat(b.view.slice(te.index)),b.viewTo+=l):di(e)}var ue=b.externalMeasured;ue&&(d<ue.lineN?ue.lineN+=l:t<ue.lineN+ue.size&&(b.externalMeasured=null))}function ai(e,t,d){e.curOp.viewChanged=!0;var l=e.display,b=e.display.externalMeasured;if(b&&t>=b.lineN&&t<b.lineN+b.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var B=l.view[ci(e,t)];if(B.node==null)return;var $=B.changes||(B.changes=[]);le($,d)==-1&&$.push(d)}function di(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fi(e,t,d,l){var b=ci(e,t),B,$=e.display.view;if(!Ar||d==e.doc.first+e.doc.size)return{index:b,lineN:d};for(var ee=e.display.viewFrom,te=0;te<b;te++)ee+=$[te].size;if(ee!=t){if(l>0){if(b==$.length-1)return null;B=ee+$[b].size-t,b++}else B=ee-t;t+=B,d+=B}for(;kt(e.doc,d)!=d;){if(b==(l<0?0:$.length-1))return null;d+=l*$[b-(l<0?1:0)].size,b+=l}return{index:b,lineN:d}}function ha(e,t,d){var l=e.display,b=l.view;b.length==0||t>=l.viewTo||d<=l.viewFrom?(l.view=An(e,t,d),l.viewFrom=t):(l.viewFrom>t?l.view=An(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(ci(e,t))),l.viewFrom=t,l.viewTo<d?l.view=l.view.concat(An(e,l.viewTo,d)):l.viewTo>d&&(l.view=l.view.slice(0,ci(e,d)))),l.viewTo=d}function sa(e){for(var t=e.display.view,d=0,l=0;l<t.length;l++){var b=t[l];!b.hidden&&(!b.node||b.changes)&&++d}return d}function ei(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Zi(e,t){t===void 0&&(t=!0);for(var d=e.doc,l={},b=l.cursors=document.createDocumentFragment(),B=l.selection=document.createDocumentFragment(),$=0;$<d.sel.ranges.length;$++){if(!t&&$==d.sel.primIndex)continue;var ee=d.sel.ranges[$];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var te=ee.empty();(te||e.options.showCursorWhenSelecting)&&qi(e,ee.head,b),te||Qr(e,ee,B)}return l}function qi(e,t,d){var l=wn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),b=d.appendChild(h("div","\xA0","CodeMirror-cursor"));if(b.style.left=l.left+"px",b.style.top=l.top+"px",b.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var B=d.appendChild(h("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=l.other.left+"px",B.style.top=l.other.top+"px",B.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function li(e,t){return e.top-t.top||e.left-t.left}function Qr(e,t,d){var l=e.display,b=e.doc,B=document.createDocumentFragment(),$=je(e.display),ee=$.left,te=Math.max(l.sizerWidth,Oe(e)-l.sizer.offsetLeft)-$.right,ue=b.direction=="ltr";function ke($n,or,Cr,_r){or<0&&(or=0),or=Math.round(or),_r=Math.round(_r),B.appendChild(h("div",null,"CodeMirror-selected","position: absolute; left: "+$n+`px;
|
|
top: `+or+"px; width: "+(Cr==null?te-$n:Cr)+`px;
|
|
height: `+(_r-or)+"px"))}function Ke($n,or,Cr){var _r=_n(b,$n),jr=_r.text.length,mi,Hi;function Ci(ki,ra){return rn(e,dn($n,ki),"div",_r,ra)}function oa(ki,ra,zi){var Ui=ar(e,_r,null,ki),Ii=ra=="ltr"==(zi=="after")?"left":"right",Oi=zi=="after"?Ui.begin:Ui.end-(/\s/.test(_r.text.charAt(Ui.end-1))?2:1);return Ci(Oi,Ii)[Ii]}var na=xn(_r,b.direction);return Ht(na,or||0,Cr==null?jr:Cr,function(ki,ra,zi,Ui){var Ii=zi=="ltr",Oi=Ci(ki,Ii?"left":"right"),ia=Ci(ra-1,Ii?"right":"left"),So=or==null&&ki==0,to=Cr==null&&ra==jr,Xi=Ui==0,Pa=!na||Ui==na.length-1;if(ia.top-Oi.top<=3){var Wi=(ue?So:to)&&Xi,ms=(ue?to:So)&&Pa,Ga=Wi?ee:(Ii?Oi:ia).left,lo=ms?te:(Ii?ia:Oi).right;ke(Ga,Oi.top,lo-Ga,Oi.bottom)}else{var uo,Ji,Oo,gs;Ii?(uo=ue&&So&&Xi?ee:Oi.left,Ji=ue?te:oa(ki,zi,"before"),Oo=ue?ee:oa(ra,zi,"after"),gs=ue&&to&&Pa?te:ia.right):(uo=ue?oa(ki,zi,"before"):ee,Ji=!ue&&So&&Xi?te:Oi.right,Oo=!ue&&to&&Pa?ee:ia.left,gs=ue?oa(ra,zi,"after"):te),ke(uo,Oi.top,Ji-uo,Oi.bottom),Oi.bottom<ia.top&&ke(ee,Oi.bottom,null,ia.top),ke(Oo,ia.top,gs-Oo,ia.bottom)}(!mi||li(Oi,mi)<0)&&(mi=Oi),li(ia,mi)<0&&(mi=ia),(!Hi||li(Oi,Hi)<0)&&(Hi=Oi),li(ia,Hi)<0&&(Hi=ia)}),{start:mi,end:Hi}}var bt=t.from(),ft=t.to();if(bt.line==ft.line)Ke(bt.line,bt.ch,ft.ch);else{var sn=_n(b,bt.line),Tn=_n(b,ft.line),Kn=ot(sn)==ot(Tn),Xn=Ke(bt.line,bt.ch,Kn?sn.text.length+1:null).end,er=Ke(ft.line,Kn?0:null,ft.ch).start;Kn&&(Xn.top<er.top-2?(ke(Xn.right,Xn.top,null,Xn.bottom),ke(ee,er.top,er.left,er.bottom)):ke(Xn.right,Xn.top,er.left-Xn.right,Xn.bottom)),Xn.bottom<er.top&&ke(ee,Xn.bottom,null,er.top)}d.appendChild(B)}function Ti(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var d=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ca(e),t.cursorDiv.style.visibility=(d=!d)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ma(e){e.state.focused||(e.display.input.focus(),la(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ca(e))},100)}function la(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(nt(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ti(e)}function Ca(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(nt(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ta(e){for(var t=e.display,d=t.lineDiv.offsetTop,l=0;l<t.view.length;l++){var b=t.view[l],B=e.options.lineWrapping,$=void 0,ee=0;if(b.hidden)continue;if(K&&I<8){var te=b.node.offsetTop+b.node.offsetHeight;$=te-d,d=te}else{var ue=b.node.getBoundingClientRect();$=ue.bottom-ue.top,!B&&b.text.firstChild&&(ee=b.text.firstChild.getBoundingClientRect().right-ue.left-1)}var ke=b.line.height-$;if((ke>.005||ke<-.005)&&(hr(b.line,$),Sa(b.line),b.rest))for(var Ke=0;Ke<b.rest.length;Ke++)Sa(b.rest[Ke]);if(ee>e.display.sizerWidth){var bt=Math.ceil(ee/Hr(e.display));bt>e.display.maxLineLength&&(e.display.maxLineLength=bt,e.display.maxLine=b.line,e.display.maxLineChanged=!0)}}}function Sa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var d=e.widgets[t],l=d.node.parentNode;l&&(d.height=l.offsetHeight)}}function ka(e,t,d){var l=d&&d.top!=null?Math.max(0,d.top):e.scroller.scrollTop;l=Math.floor(l-_i(e));var b=d&&d.bottom!=null?d.bottom:l+e.wrapper.clientHeight,B=Dr(t,l),$=Dr(t,b);if(d&&d.ensure){var ee=d.ensure.from.line,te=d.ensure.to.line;ee<B?(B=ee,$=Dr(t,Pn(_n(t,ee))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=$&&(B=Dr(t,Pn(_n(t,te))-e.wrapper.clientHeight),$=te)}return{from:B,to:Math.max($,B+1)}}function co(e,t){if(xt(e,"scrollCursorIntoView"))return;var d=e.display,l=d.sizer.getBoundingClientRect(),b=null;if(t.top+l.top<0?b=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(b=!1),b!=null&&!a){var B=h("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-d.viewOffset-_i(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Ye(e)+d.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(b),e.display.lineSpace.removeChild(B)}}function Ro(e,t,d,l){l==null&&(l=0);var b;!e.options.lineWrapping&&t==d&&(t=t.ch?dn(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,d=t.sticky=="before"?dn(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var $=!1,ee=wn(e,t),te=!d||d==t?ee:wn(e,d);b={left:Math.min(ee.left,te.left),top:Math.min(ee.top,te.top)-l,right:Math.max(ee.left,te.left),bottom:Math.max(ee.bottom,te.bottom)+l};var ue=Oa(e,b),ke=e.doc.scrollTop,Ke=e.doc.scrollLeft;if(ue.scrollTop!=null&&(Da(e,ue.scrollTop),Math.abs(e.doc.scrollTop-ke)>1&&($=!0)),ue.scrollLeft!=null&&(Ni(e,ue.scrollLeft),Math.abs(e.doc.scrollLeft-Ke)>1&&($=!0)),!$)break}return b}function za(e,t){var d=Oa(e,t);d.scrollTop!=null&&Da(e,d.scrollTop),d.scrollLeft!=null&&Ni(e,d.scrollLeft)}function Oa(e,t){var d=e.display,l=Wr(e.display);t.top<0&&(t.top=0);var b=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:d.scroller.scrollTop,B=re(e),$={};t.bottom-t.top>B&&(t.bottom=t.top+B);var ee=e.doc.height+xe(d),te=t.top<l,ue=t.bottom>ee-l;if(t.top<b)$.scrollTop=te?0:t.top;else if(t.bottom>b+B){var ke=Math.min(t.top,(ue?ee:t.bottom)-B);ke!=b&&($.scrollTop=ke)}var Ke=e.options.fixedGutter?0:d.gutters.offsetWidth,bt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:d.scroller.scrollLeft-Ke,ft=Oe(e)-d.gutters.offsetWidth,sn=t.right-t.left>ft;return sn&&(t.right=t.left+ft),t.left<10?$.scrollLeft=0:t.left<bt?$.scrollLeft=Math.max(0,t.left+Ke-(sn?0:10)):t.right>ft+bt-3&&($.scrollLeft=t.right+(sn?0:10)-ft),$}function Va(e,t){if(t==null)return;Ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){Ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ra(e,t,d){(t!=null||d!=null)&&Ya(e),t!=null&&(e.curOp.scrollLeft=t),d!=null&&(e.curOp.scrollTop=d)}function ho(e,t){Ya(e),e.curOp.scrollToPos=t}function Ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var d=zt(e,t.from),l=zt(e,t.to);Aa(e,d,l,t.margin)}}function Aa(e,t,d,l){var b=Oa(e,{left:Math.min(t.left,d.left),top:Math.min(t.top,d.top)-l,right:Math.max(t.right,d.right),bottom:Math.max(t.bottom,d.bottom)+l});Ra(e,b.scrollLeft,b.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;U||Ua(e,{top:t}),ya(e,t,!0),U&&Ua(e),Na(e,100)}function ya(e,t,d){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!d)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ni(e,t,d,l){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(d?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!l)return;e.doc.scrollLeft=t,Ir(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,d=t.gutters.offsetWidth,l=Math.round(e.doc.height+xe(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?d:0,docHeight:l,scrollHeight:l+Ye(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:d}}var pa=function(e,t,d){this.cm=d;var l=this.vert=h("div",[h("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),b=this.horiz=h("div",[h("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=b.tabIndex=-1,e(l),e(b),He(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),He(b,"scroll",function(){b.clientWidth&&t(b.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,d=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(d){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var b=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+b)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=d?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(d?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:d?l:0,bottom:t?l:0}},pa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pa.prototype.zeroWidthHack=function(){var e=i&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},pa.prototype.enableZeroWidthBar=function(e,t,d){e.style.pointerEvents="auto";function l(){var b=e.getBoundingClientRect(),B=d=="vert"?document.elementFromPoint(b.right-1,(b.top+b.bottom)/2):document.elementFromPoint((b.right+b.left)/2,b.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},pa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function ma(e,t){t||(t=fa(e));var d=e.display.barWidth,l=e.display.barHeight;Xa(e,t);for(var b=0;b<4&&d!=e.display.barWidth||l!=e.display.barHeight;b++)d!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Xa(e,fa(e)),d=e.display.barWidth,l=e.display.barHeight}function Xa(e,t){var d=e.display,l=d.scrollbars.update(t);d.sizer.style.paddingRight=(d.barWidth=l.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=l.bottom)+"px",d.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=l.bottom+"px",d.scrollbarFiller.style.width=l.right+"px"):d.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=l.bottom+"px",d.gutterFiller.style.width=t.gutterWidth+"px"):d.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Ja(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $a[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),He(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,d){d=="horizontal"?Ni(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Ia=0;function ua(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:++Ia},vn(e.curOp)}function Ea(e){var t=e.curOp;t&&Ln(t,function(d){for(var l=0;l<d.ops.length;l++)d.ops[l].cm.curOp=null;ro(d)})}function ro(e){for(var t=e.ops,d=0;d<t.length;d++)Ao(t[d]);for(var l=0;l<t.length;l++)Do(t[l]);for(var b=0;b<t.length;b++)fo(t[b]);for(var B=0;B<t.length;B++)io(t[B]);for(var $=0;$<t.length;$++)po(t[$])}function Ao(e){var t=e.cm,d=t.display;ao(t),e.updateMaxLine&&On(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ea(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&xa(e.cm,e.update)}function fo(e){var t=e.cm,d=t.display;e.updatedDisplay&&Ta(t),e.barMeasure=fa(t),d.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Me(t,d.maxLine,d.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(d.scroller.clientWidth,d.sizer.offsetLeft+e.adjustWidthTo+Ye(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo-Oe(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=d.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ni(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var d=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,d),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ma(t,e.barMeasure),e.updatedDisplay&&$r(t,e.barMeasure),e.selectionChanged&&Ti(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),d&&Ma(e.cm)}function po(e){var t=e.cm,d=t.display,l=t.doc;if(e.updatedDisplay&&Qa(t,e.update),d.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(d.wheelStartX=d.wheelStartY=null),e.scrollTop!=null&&ya(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ni(t,e.scrollLeft,!0,!0),e.scrollToPos){var b=Ro(t,L(l,e.scrollToPos.from),L(l,e.scrollToPos.to),e.scrollToPos.margin);co(t,b)}var B=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(B)for(var ee=0;ee<B.length;++ee)B[ee].lines.length||nt(B[ee],"hide");if($)for(var te=0;te<$.length;++te)$[te].lines.length&&nt($[te],"unhide");d.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&nt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ki(e,t){if(e.curOp)return t();ua(e);try{return t()}finally{Ea(e)}}function bi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ua(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Pi(e){return function(){if(this.curOp)return e.apply(this,arguments);ua(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function Ei(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ua(t);try{return e.apply(this,arguments)}finally{Ea(t)}}}function Na(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,H(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var d=+new Date+e.options.workTime,l=In(e,t.highlightFrontier),b=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(l.line>=e.display.viewFrom){var $=B.styles,ee=B.text.length>e.options.maxHighlightLength?Kt(t.mode,l.state):null,te=Fe(e,B,l,!0);ee&&(l.state=ee),B.styles=te.styles;var ue=B.styleClasses,ke=te.classes;ke?B.styleClasses=ke:ue&&(B.styleClasses=null);for(var Ke=!$||$.length!=B.styles.length||ue!=ke&&(!ue||!ke||ue.bgClass!=ke.bgClass||ue.textClass!=ke.textClass),bt=0;!Ke&&bt<$.length;++bt)Ke=$[bt]!=B.styles[bt];Ke&&b.push(l.line),B.stateAfter=l.save(),l.nextLine()}else B.text.length<=e.options.maxHighlightLength&&Zn(e,B.text,l),B.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>d)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),b.length&&Ki(e,function(){for(var B=0;B<b.length;B++)ai(e,b[B],"text")})}var ea=function(e,t,d){var l=e.display;this.viewport=t,this.visible=ka(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=Oe(e),this.force=d,this.dims=vr(e),this.events=[]};ea.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},ea.prototype.finish=function(){for(var e=0;e<this.events.length;e++)nt.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=Ye(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ye(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=j();if(!t||!x(e.display.lineDiv,t))return null;var d={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&x(e.display.lineDiv,l.anchorNode)&&(d.anchorNode=l.anchorNode,d.anchorOffset=l.anchorOffset,d.focusNode=l.focusNode,d.focusOffset=l.focusOffset)}return d}function so(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),d=document.createRange();d.setEnd(e.anchorNode,e.anchorOffset),d.collapse(!1),t.removeAllRanges(),t.addRange(d),t.extend(e.focusNode,e.focusOffset)}}function xa(e,t){var d=e.display,l=e.doc;if(t.editorIsHidden)return di(e),!1;if(!t.force&&t.visible.from>=d.viewFrom&&t.visible.to<=d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&sa(e)==0)return!1;gi(e)&&(di(e),t.dims=vr(e));var b=l.first+l.size,B=Math.max(t.visible.from-e.options.viewportMargin,l.first),$=Math.min(b,t.visible.to+e.options.viewportMargin);d.viewFrom<B&&B-d.viewFrom<20&&(B=Math.max(l.first,d.viewFrom)),d.viewTo>$&&d.viewTo-$<20&&($=Math.min(b,d.viewTo)),Ar&&(B=kt(e.doc,B),$=mt(e.doc,$));var ee=B!=d.viewFrom||$!=d.viewTo||d.lastWrapHeight!=t.wrapperHeight||d.lastWrapWidth!=t.wrapperWidth;ha(e,B,$),d.viewOffset=Pn(_n(e.doc,d.viewFrom)),e.display.mover.style.top=d.viewOffset+"px";var te=sa(e);if(!ee&&te==0&&!t.force&&d.renderedView==d.view&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo))return!1;var ue=oo(e);return te>4&&(d.lineDiv.style.display="none"),go(e,d.updateLineNumbers,t.dims),te>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,so(ue),E(d.cursorDiv),E(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,ee&&(d.lastWrapHeight=t.wrapperHeight,d.lastWrapWidth=t.wrapperWidth,Na(e,400)),d.updateLineNumbers=null,!0}function Qa(e,t){for(var d=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==Oe(e)){if(d&&d.top!=null&&(d={top:Math.min(e.doc.height+xe(e.display)-re(e),d.top)}),t.visible=ka(e.display,e.doc,d),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=ka(e.display,e.doc,d));if(!xa(e,t))break;Ta(e);var b=fa(e);ei(e),ma(e,b),$r(e,b),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 Ua(e,t){var d=new ea(e,t);if(xa(e,d)){Ta(e),Qa(e,d);var l=fa(e);ei(e),ma(e,l),$r(e,l),d.finish()}}function go(e,t,d){var l=e.display,b=e.options.lineNumbers,B=l.lineDiv,$=B.firstChild;function ee(sn){var Tn=sn.nextSibling;return r&&i&&e.display.currentWheelTarget==sn?sn.style.display="none":sn.parentNode.removeChild(sn),Tn}for(var te=l.view,ue=l.viewFrom,ke=0;ke<te.length;ke++){var Ke=te[ke];if(!Ke.hidden)if(!Ke.node||Ke.node.parentNode!=B){var bt=mr(e,Ke,ue,d);B.insertBefore(bt,$)}else{for(;$!=Ke.node;)$=ee($);var ft=b&&t!=null&&t<=ue&&Ke.lineNumber;Ke.changes&&(le(Ke.changes,"gutter")>-1&&(ft=!1),It(e,Ke,ue,d)),ft&&(E(Ke.lineNumber),Ke.lineNumber.appendChild(document.createTextNode(ti(e.options,ue)))),$=Ke.node.nextSibling}ue+=Ke.size}for(;$;)$=ee($)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function $r(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+Ye(e)+"px"}function Ir(e){var t=e.display,d=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=yi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,b=t.gutters.offsetWidth,B=l+"px",$=0;$<d.length;$++)if(!d[$].hidden){e.options.fixedGutter&&(d[$].gutter&&(d[$].gutter.style.left=B),d[$].gutterBackground&&(d[$].gutterBackground.style.left=B));var ee=d[$].alignable;if(ee)for(var te=0;te<ee.length;te++)ee[te].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=l+b+"px")}function gi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,d=ti(e.options,t.first+t.size-1),l=e.display;if(d.length!=l.lineNumChars){var b=l.measure.appendChild(h("div",[h("div",d)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=b.firstChild.offsetWidth,$=b.offsetWidth-B;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(B,l.lineGutter.offsetWidth-$)+1,l.lineNumWidth=l.lineNumInnerWidth+$,l.lineNumChars=l.lineNumInnerWidth?d.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Za(e.display),!0}return!1}function Bi(e,t){for(var d=[],l=!1,b=0;b<e.length;b++){var B=e[b],$=null;if(typeof B!="string"&&($=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)l=!0;else continue;d.push({className:B,style:$})}return t&&!l&&d.push({className:"CodeMirror-linenumbers",style:null}),d}function La(e){var t=e.gutters,d=e.gutterSpecs;E(t),e.lineGutter=null;for(var l=0;l<d.length;++l){var b=d[l],B=b.className,$=b.style,ee=t.appendChild(h("div",null,"CodeMirror-gutter "+B));$&&(ee.style.cssText=$),B=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}t.style.display=d.length?"":"none",Za(e)}function ca(e){La(e.display),qr(e),Ir(e)}function ja(e,t,d,l){var b=this;this.input=d,b.scrollbarFiller=h("div",null,"CodeMirror-scrollbar-filler"),b.scrollbarFiller.setAttribute("cm-not-content","true"),b.gutterFiller=h("div",null,"CodeMirror-gutter-filler"),b.gutterFiller.setAttribute("cm-not-content","true"),b.lineDiv=y("div",null,"CodeMirror-code"),b.selectionDiv=h("div",null,null,"position: relative; z-index: 1"),b.cursorDiv=h("div",null,"CodeMirror-cursors"),b.measure=h("div",null,"CodeMirror-measure"),b.lineMeasure=h("div",null,"CodeMirror-measure"),b.lineSpace=y("div",[b.measure,b.lineMeasure,b.selectionDiv,b.cursorDiv,b.lineDiv],null,"position: relative; outline: none");var B=y("div",[b.lineSpace],"CodeMirror-lines");b.mover=h("div",[B],null,"position: relative"),b.sizer=h("div",[b.mover],"CodeMirror-sizer"),b.sizerWidth=null,b.heightForcer=h("div",null,null,"position: absolute; height: "+se+"px; width: 1px;"),b.gutters=h("div",null,"CodeMirror-gutters"),b.lineGutter=null,b.scroller=h("div",[b.sizer,b.heightForcer,b.gutters],"CodeMirror-scroll"),b.scroller.setAttribute("tabIndex","-1"),b.wrapper=h("div",[b.scrollbarFiller,b.gutterFiller,b.scroller],"CodeMirror"),K&&I<8&&(b.gutters.style.zIndex=-1,b.scroller.style.paddingRight=0),!r&&!(U&&s)&&(b.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(b.wrapper):e(b.wrapper)),b.viewFrom=b.viewTo=t.first,b.reportedViewFrom=b.reportedViewTo=t.first,b.view=[],b.renderedView=null,b.externalMeasured=null,b.viewOffset=0,b.lastWrapHeight=b.lastWrapWidth=0,b.updateLineNumbers=null,b.nativeBarWidth=b.barHeight=b.barWidth=0,b.scrollbarsClipped=!1,b.lineNumWidth=b.lineNumInnerWidth=b.lineNumChars=null,b.alignWidgets=!1,b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.maxLine=null,b.maxLineLength=0,b.maxLineChanged=!1,b.wheelDX=b.wheelDY=b.wheelStartX=b.wheelStartY=null,b.shift=!1,b.selForContextMenu=null,b.activeTouch=null,b.gutterSpecs=Bi(l.gutters,l.lineNumbers),La(b),d.init(b)}var da=0,Si=null;K?Si=-.53:U?Si=15:_?Si=-.7:m&&(Si=-1/3);function Fa(e){var t=e.wheelDeltaX,d=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),d==null&&e.detail&&e.axis==e.VERTICAL_AXIS?d=e.detail:d==null&&(d=e.wheelDelta),{x:t,y:d}}function Ba(e){var t=Fa(e);return t.x*=Si,t.y*=Si,t}function Ha(e,t){var d=Fa(t),l=d.x,b=d.y,B=e.display,$=B.scroller,ee=$.scrollWidth>$.clientWidth,te=$.scrollHeight>$.clientHeight;if(!(l&&ee||b&&te))return;if(b&&i&&r){e:for(var ue=t.target,ke=B.view;ue!=$;ue=ue.parentNode)for(var Ke=0;Ke<ke.length;Ke++)if(ke[Ke].node==ue){e.display.currentWheelTarget=ue;break e}}if(l&&!U&&!p&&Si!=null){b&&te&&Da(e,Math.max(0,$.scrollTop+b*Si)),Ni(e,Math.max(0,$.scrollLeft+l*Si)),(!b||b&&te)&&ie(t),B.wheelStartX=null;return}if(b&&Si!=null){var bt=b*Si,ft=e.doc.scrollTop,sn=ft+B.wrapper.clientHeight;bt<0?ft=Math.max(0,ft+bt-50):sn=Math.min(e.doc.height,sn+bt+50),Ua(e,{top:ft,bottom:sn})}da<20&&(B.wheelStartX==null?(B.wheelStartX=$.scrollLeft,B.wheelStartY=$.scrollTop,B.wheelDX=l,B.wheelDY=b,setTimeout(function(){if(B.wheelStartX==null)return;var Tn=$.scrollLeft-B.wheelStartX,Kn=$.scrollTop-B.wheelStartY,Xn=Kn&&B.wheelDY&&Kn/B.wheelDY||Tn&&B.wheelDX&&Tn/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Xn)return;Si=(Si*da+Xn)/(da+1),++da},200)):(B.wheelDX+=l,B.wheelDY+=b))}var Gi=function(e,t){this.ranges=e,this.primIndex=t};Gi.prototype.primary=function(){return this.ranges[this.primIndex]},Gi.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 d=this.ranges[t],l=e.ranges[t];if(!fi(d.anchor,l.anchor)||!fi(d.head,l.head))return!1}return!0},Gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Vr(wi(this.ranges[t].anchor),wi(this.ranges[t].head));return new Gi(e,this.primIndex)},Gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Gi.prototype.contains=function(e,t){t||(t=e);for(var d=0;d<this.ranges.length;d++){var l=this.ranges[d];if(rr(t,l.from())>=0&&rr(e,l.to())<=0)return d}return-1};var Vr=function(e,t){this.anchor=e,this.head=t};Vr.prototype.from=function(){return ri(this.anchor,this.head)},Vr.prototype.to=function(){return ni(this.anchor,this.head)},Vr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Sr(e,t,d){var l=e&&e.options.selectionsMayTouch,b=t[d];t.sort(function(bt,ft){return rr(bt.from(),ft.from())}),d=le(t,b);for(var B=1;B<t.length;B++){var $=t[B],ee=t[B-1],te=rr(ee.to(),$.from());if(l&&!$.empty()?te>0:te>=0){var ue=ri(ee.from(),$.from()),ke=ni(ee.to(),$.to()),Ke=ee.empty()?$.from()==$.head:ee.from()==ee.head;B<=d&&--d,t.splice(--B,2,new Vr(Ke?ke:ue,Ke?ue:ke))}}return new Gi(t,d)}function Jn(e,t){return new Gi([new Vr(e,t||e)],0)}function dr(e){return e.text?dn(e.from.line+e.text.length-1,at(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function kr(e,t){if(rr(e,t.from)<0)return e;if(rr(e,t.to)<=0)return dr(t);var d=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=dr(t).ch-t.to.ch),dn(d,l)}function pi(e,t){for(var d=[],l=0;l<e.sel.ranges.length;l++){var b=e.sel.ranges[l];d.push(new Vr(kr(b.anchor,t),kr(b.head,t)))}return Sr(e.cm,d,e.sel.primIndex)}function ga(e,t,d){return e.line==t.line?dn(d.line,e.ch-t.ch+d.ch):dn(d.line+(e.line-t.line),e.ch)}function aa(e,t,d){for(var l=[],b=dn(e.first,0),B=b,$=0;$<t.length;$++){var ee=t[$],te=ga(ee.from,b,B),ue=ga(dr(ee),b,B);if(b=ee.to,B=ue,d=="around"){var ke=e.sel.ranges[$],Ke=rr(ke.head,ke.anchor)<0;l[$]=new Vr(Ke?ue:te,Ke?te:ue)}else l[$]=new Vr(te,te)}return new Gi(l,e.sel.primIndex)}function Mi(e){e.doc.mode=et(e.options,e.doc.modeOption),$i(e)}function $i(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,Na(e,100),e.state.modeGen++,e.curOp&&qr(e)}function va(e,t){return t.from.ch==0&&t.to.ch==0&&at(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,t,d,l){function b(er){return d?d[er]:null}function B(er,$n,or){Mn(er,$n,or,l),Dt(er,"change",er,t)}function $(er,$n){for(var or=[],Cr=er;Cr<$n;++Cr)or.push(new Nn(ue[Cr],b(Cr),l));return or}var ee=t.from,te=t.to,ue=t.text,ke=_n(e,ee.line),Ke=_n(e,te.line),bt=at(ue),ft=b(ue.length-1),sn=te.line-ee.line;if(t.full)e.insert(0,$(0,ue.length)),e.remove(ue.length,e.size-ue.length);else if(va(e,t)){var Tn=$(0,ue.length-1);B(Ke,Ke.text,ft),sn&&e.remove(ee.line,sn),Tn.length&&e.insert(ee.line,Tn)}else if(ke==Ke)if(ue.length==1)B(ke,ke.text.slice(0,ee.ch)+bt+ke.text.slice(te.ch),ft);else{var Kn=$(1,ue.length-1);Kn.push(new Nn(bt+ke.text.slice(te.ch),ft,l)),B(ke,ke.text.slice(0,ee.ch)+ue[0],b(0)),e.insert(ee.line+1,Kn)}else if(ue.length==1)B(ke,ke.text.slice(0,ee.ch)+ue[0]+Ke.text.slice(te.ch),b(0)),e.remove(ee.line+1,sn);else{B(ke,ke.text.slice(0,ee.ch)+ue[0],b(0)),B(Ke,bt+Ke.text.slice(te.ch),ft);var Xn=$(1,ue.length-1);sn>1&&e.remove(ee.line+1,sn-1),e.insert(ee.line+1,Xn)}Dt(e,"change",e,t)}function Ai(e,t,d){function l(b,B,$){if(b.linked)for(var ee=0;ee<b.linked.length;++ee){var te=b.linked[ee];if(te.doc==B)continue;var ue=$&&te.sharedHist;if(d&&!ue)continue;t(te.doc,ue),l(te.doc,b,ue)}}l(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ji(e),Mi(e),_s(e),e.options.lineWrapping||On(e),e.options.mode=t.modeOption,qr(e)}function _s(e){(e.doc.direction=="rtl"?F:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ki(e,function(){_s(e),qr(e)})}function Go(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 rs(e,t){var d={from:wi(t.from),to:dr(t),text:br(e,t.from,t.to)};return Es(e,d,t.from.line,t.to.line+1),Ai(e,function(l){return Es(l,d,t.from.line,t.to.line+1)},!0),d}function ys(e){for(;e.length;){var t=at(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),at(e.done);if(e.done.length&&!at(e.done).ranges)return at(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),at(e.done)}function bs(e,t,d,l){var b=e.history;b.undone.length=0;var B=+new Date,$,ee;if((b.lastOp==l||b.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&b.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(b,b.lastOp==l)))ee=at($.changes),rr(t.from,t.to)==0&&rr(t.from,ee.to)==0?ee.to=dr(t):$.changes.push(rs(e,t));else{var te=at(b.done);for((!te||!te.ranges)&&zo(e.sel,b.done),$={changes:[rs(e,t)],generation:b.generation},b.done.push($);b.done.length>b.undoDepth;)b.done.shift(),b.done[0].ranges||b.done.shift()}b.done.push(d),b.generation=++b.maxGeneration,b.lastModTime=b.lastSelTime=B,b.lastOp=b.lastSelOp=l,b.lastOrigin=b.lastSelOrigin=t.origin,ee||nt(e,"historyAdded")}function ml(e,t,d,l){var b=t.charAt(0);return b=="*"||b=="+"&&d.ranges.length==l.ranges.length&&d.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,d,l){var b=e.history,B=l&&l.origin;d==b.lastSelOp||B&&b.lastSelOrigin==B&&(b.lastModTime==b.lastSelTime&&b.lastOrigin==B||ml(e,B,at(b.done),t))?b.done[b.done.length-1]=t:zo(t,b.done),b.lastSelTime=+new Date,b.lastSelOrigin=B,b.lastSelOp=d,l&&l.clearRedo!==!1&&ys(b.undone)}function zo(e,t){var d=at(t);d&&d.ranges&&d.equals(e)||t.push(e)}function Es(e,t,d,l){var b=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,d),Math.min(e.first+e.size,l),function($){$.markedSpans&&((b||(b=t["spans_"+e.id]={}))[B]=$.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,d=0;d<e.length;++d)e[d].marker.explicitlyCleared?t||(t=e.slice(0,d)):t&&t.push(e[d]);return t?t.length?t:null:e}function _l(e,t){var d=t["spans_"+e.id];if(!d)return null;for(var l=[],b=0;b<t.text.length;++b)l.push(vl(d[b]));return l}function xs(e,t){var d=_l(e,t),l=sr(e,t);if(!d)return l;if(!l)return d;for(var b=0;b<d.length;++b){var B=d[b],$=l[b];if(B&&$){e:for(var ee=0;ee<$.length;++ee){for(var te=$[ee],ue=0;ue<B.length;++ue)if(B[ue].marker==te.marker)continue e;B.push(te)}}else $&&(d[b]=$)}return d}function vo(e,t,d){for(var l=[],b=0;b<e.length;++b){var B=e[b];if(B.ranges){l.push(d?Gi.prototype.deepCopy.call(B):B);continue}var $=B.changes,ee=[];l.push({changes:ee});for(var te=0;te<$.length;++te){var ue=$[te],ke=void 0;if(ee.push({from:ue.from,to:ue.to,text:ue.text}),t)for(var Ke in ue)(ke=Ke.match(/^spans_(\d+)$/))&&(le(t,Number(ke[1]))>-1&&(at(ee)[Ke]=ue[Ke],delete ue[Ke]))}}return l}function is(e,t,d,l){if(l){var b=e.anchor;if(d){var B=rr(t,b)<0;B!=rr(d,b)<0?(b=t,t=d):B!=rr(t,d)<0&&(t=d)}return new Vr(b,t)}else return new Vr(d||t,t)}function Vo(e,t,d,l,b){b==null&&(b=e.cm&&(e.cm.display.shift||e.extend)),Yi(e,new Gi([is(e.sel.primary(),t,d,b)],0),l)}function ws(e,t,d){for(var l=[],b=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)l[B]=is(e.sel.ranges[B],t[B],null,b);var $=Sr(e.cm,l,e.sel.primIndex);Yi(e,$,d)}function as(e,t,d,l){var b=e.sel.ranges.slice(0);b[t]=d,Yi(e,Sr(e.cm,b,e.sel.primIndex),l)}function Cs(e,t,d,l){Yi(e,Jn(t,d),l)}function yl(e,t,d){var l={ranges:t.ranges,update:function(b){this.ranges=[];for(var B=0;B<b.length;B++)this.ranges[B]=new Vr(L(e,b[B].anchor),L(e,b[B].head))},origin:d&&d.origin};return nt(e,"beforeSelectionChange",e,l),e.cm&&nt(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?Sr(e.cm,l.ranges,l.ranges.length-1):t}function Ts(e,t,d){var l=e.history.done,b=at(l);b&&b.ranges?(l[l.length-1]=t,Yo(e,t,d)):Yi(e,t,d)}function Yi(e,t,d){Yo(e,t,d),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,d)}function Yo(e,t,d){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,d));var l=d&&d.bias||(rr(t.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,Rs(e,t,l,!0)),!(d&&d.scroll===!1)&&e.cm&&_a(e.cm)}function Ss(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ae(e.cm)),Dt(e,"cursorActivity",e)}function Os(e){Ss(e,Rs(e,e.sel,null,!1))}function Rs(e,t,d,l){for(var b,B=0;B<t.ranges.length;B++){var $=t.ranges[B],ee=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],te=Xo(e,$.anchor,ee&&ee.anchor,d,l),ue=Xo(e,$.head,ee&&ee.head,d,l);(b||te!=$.anchor||ue!=$.head)&&(b||(b=t.ranges.slice(0,B)),b[B]=new Vr(te,ue))}return b?Sr(e.cm,b,t.primIndex):t}function _o(e,t,d,l,b){var B=_n(e,t.line);if(B.markedSpans)for(var $=0;$<B.markedSpans.length;++$){var ee=B.markedSpans[$],te=ee.marker,ue="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,ke="selectRight"in te?!te.selectRight:te.inclusiveRight;if((ee.from==null||(ue?ee.from<=t.ch:ee.from<t.ch))&&(ee.to==null||(ke?ee.to>=t.ch:ee.to>t.ch))){if(b&&(nt(te,"beforeCursorEnter"),te.explicitlyCleared))if(B.markedSpans){--$;continue}else break;if(!te.atomic)continue;if(d){var Ke=te.find(l<0?1:-1),bt=void 0;if((l<0?ke:ue)&&(Ke=As(e,Ke,-l,Ke&&Ke.line==t.line?B:null)),Ke&&Ke.line==t.line&&(bt=rr(Ke,d))&&(l<0?bt<0:bt>0))return _o(e,Ke,t,l,b)}var ft=te.find(l<0?-1:1);return(l<0?ue:ke)&&(ft=As(e,ft,l,ft.line==t.line?B:null)),ft?_o(e,ft,t,l,b):null}}return t}function Xo(e,t,d,l,b){var B=l||1,$=_o(e,t,d,B,b)||!b&&_o(e,t,d,B,!0)||_o(e,t,d,-B,b)||!b&&_o(e,t,d,-B,!0);return $||(e.cantEdit=!0,dn(e.first,0))}function As(e,t,d,l){return d<0&&t.ch==0?t.line>e.first?L(e,dn(t.line-1)):null:d>0&&t.ch==(l||_n(e,t.line)).text.length?t.line<e.first+e.size-1?dn(t.line+1,0):null:new dn(t.line,t.ch+d)}function Ds(e){e.setSelection(dn(e.firstLine(),0),dn(e.lastLine()),Ee)}function Ls(e,t,d){var l={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return l.canceled=!0}};return d&&(l.update=function(b,B,$,ee){b&&(l.from=L(e,b)),B&&(l.to=L(e,B)),$&&(l.text=$),ee!==void 0&&(l.origin=ee)}),nt(e,"beforeChange",e,l),e.cm&&nt(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function yo(e,t,d){if(e.cm){if(!e.cm.curOp)return bi(e.cm,yo)(e,t,d);if(e.cm.state.suppressEdits)return}if((ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))&&(t=Ls(e,t,!0),!t))return;var l=Vi&&!d&&de(e,t.from,t.to);if(l)for(var b=l.length-1;b>=0;--b)Ps(e,{from:l[b].from,to:l[b].to,text:b?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&rr(t.from,t.to)==0)return;var d=pi(e,t);bs(e,t,d,e.cm?e.cm.curOp.id:NaN),Lo(e,t,d,sr(e,t));var l=[];Ai(e,function(b,B){!B&&le(l,b.history)==-1&&(Ns(b.history,t),l.push(b.history)),Lo(b,t,null,sr(b,t))})}function $o(e,t,d){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!d)return;for(var b=e.history,B,$=e.sel,ee=t=="undo"?b.done:b.undone,te=t=="undo"?b.undone:b.done,ue=0;ue<ee.length&&!(B=ee[ue],d?B.ranges&&!B.equals(e.sel):!B.ranges);ue++);if(ue==ee.length)return;for(b.lastOrigin=b.lastSelOrigin=null;;)if(B=ee.pop(),B.ranges){if(zo(B,te),d&&!B.equals(e.sel)){Yi(e,B,{clearRedo:!1});return}$=B}else if(l){ee.push(B);return}else break;var ke=[];zo($,te),te.push({changes:ke,generation:b.generation}),b.generation=B.generation||++b.maxGeneration;for(var Ke=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),bt=function(Tn){var Kn=B.changes[Tn];if(Kn.origin=t,Ke&&!Ls(e,Kn,!1))return ee.length=0,{};ke.push(rs(e,Kn));var Xn=Tn?pi(e,Kn):at(ee);Lo(e,Kn,Xn,xs(e,Kn)),!Tn&&e.cm&&e.cm.scrollIntoView({from:Kn.from,to:dr(Kn)});var er=[];Ai(e,function($n,or){!or&&le(er,$n.history)==-1&&(Ns($n.history,Kn),er.push($n.history)),Lo($n,Kn,null,xs($n,Kn))})},ft=B.changes.length-1;ft>=0;--ft){var sn=bt(ft);if(sn)return sn.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new Gi(Qt(e.sel.ranges,function(b){return new Vr(dn(b.anchor.line+t,b.anchor.ch),dn(b.head.line+t,b.head.ch))}),e.sel.primIndex),e.cm){qr(e.cm,e.first,e.first-t,t);for(var d=e.cm.display,l=d.viewFrom;l<d.viewTo;l++)ai(e.cm,l,"gutter")}}function Lo(e,t,d,l){if(e.cm&&!e.cm.curOp)return bi(e.cm,Lo)(e,t,d,l);if(t.to.line<e.first){Ms(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 b=t.text.length-1-(e.first-t.from.line);Ms(e,b),t={from:dn(e.first,0),to:dn(t.to.line+b,t.to.ch),text:[at(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:dn(B,_n(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=br(e,t.from,t.to),d||(d=pi(e,t)),e.cm?bl(e.cm,t,l):Wa(e,t,l),Yo(e,d,Ee),e.cantEdit&&Xo(e,dn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,d){var l=e.doc,b=e.display,B=t.from,$=t.to,ee=!1,te=B.line;e.options.lineWrapping||(te=Qn(ot(_n(l,B.line))),l.iter(te,$.line+1,function(ft){if(ft==b.maxLine)return ee=!0,!0})),l.sel.contains(t.from,t.to)>-1&&Ae(e),Wa(l,t,d,Qi(e)),e.options.lineWrapping||(l.iter(te,B.line+t.text.length,function(ft){var sn=Gn(ft);sn>b.maxLineLength&&(b.maxLine=ft,b.maxLineLength=sn,b.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),Li(l,B.line),Na(e,400);var ue=t.text.length-($.line-B.line)-1;t.full?qr(e):B.line==$.line&&t.text.length==1&&!va(e.doc,t)?ai(e,B.line,"text"):qr(e,B.line,$.line+1,ue);var ke=ve(e,"changes"),Ke=ve(e,"change");if(Ke||ke){var bt={from:B,to:$,text:t.text,removed:t.removed,origin:t.origin};Ke&&Dt(e,"change",e,bt),ke&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(bt)}e.display.selForContextMenu=null}function bo(e,t,d,l,b){var B;l||(l=d),rr(l,d)<0&&(B=[l,d],d=B[0],l=B[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:d,to:l,text:t,origin:b})}function ks(e,t,d,l){d<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,d,l){for(var b=0;b<e.length;++b){var B=e[b],$=!0;if(B.ranges){B.copied||(B=e[b]=B.deepCopy(),B.copied=!0);for(var ee=0;ee<B.ranges.length;ee++)ks(B.ranges[ee].anchor,t,d,l),ks(B.ranges[ee].head,t,d,l);continue}for(var te=0;te<B.changes.length;++te){var ue=B.changes[te];if(d<ue.from.line)ue.from=dn(ue.from.line+l,ue.from.ch),ue.to=dn(ue.to.line+l,ue.to.ch);else if(t<=ue.to.line){$=!1;break}}$||(e.splice(0,b+1),b=0)}}function Ns(e,t){var d=t.from.line,l=t.to.line,b=t.text.length-(l-d)-1;Is(e.done,d,l,b),Is(e.undone,d,l,b)}function Po(e,t,d,l){var b=t,B=t;return typeof t=="number"?B=_n(e,X(e,t)):b=Qn(t),b==null?null:(l(B,b)&&e.cm&&ai(e.cm,b,d),B)}function Mo(e){this.lines=e,this.parent=null;for(var t=0,d=0;d<e.length;++d)e[d].parent=this,t+=e[d].height;this.height=t}Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var d=e,l=e+t;d<l;++d){var b=this.lines[d];this.height-=b.height,Pt(b),Dt(b,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,d){this.height+=d,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var l=0;l<t.length;++l)t[l].parent=this},iterN:function(e,t,d){for(var l=e+t;e<l;++e)if(d(this.lines[e]))return!0}};function ko(e){this.children=e;for(var t=0,d=0,l=0;l<e.length;++l){var b=e[l];t+=b.chunkSize(),d+=b.height,b.parent=this}this.size=t,this.height=d,this.parent=null}ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var d=0;d<this.children.length;++d){var l=this.children[d],b=l.chunkSize();if(e<b){var B=Math.min(t,b-e),$=l.height;if(l.removeInner(e,B),this.height-=$-l.height,b==B&&(this.children.splice(d--,1),l.parent=null),(t-=B)==0)break;e=0}else e-=b}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var ee=[];this.collapse(ee),this.children=[new Mo(ee)],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,d){this.size+=t.length,this.height+=d;for(var l=0;l<this.children.length;++l){var b=this.children[l],B=b.chunkSize();if(e<=B){if(b.insertInner(e,t,d),b.lines&&b.lines.length>50){for(var $=b.lines.length%25+25,ee=$;ee<b.lines.length;){var te=new Mo(b.lines.slice(ee,ee+=25));b.height-=te.height,this.children.splice(++l,0,te),te.parent=this}b.lines=b.lines.slice(0,$),this.maybeSpill()}break}e-=B}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),d=new ko(t);if(e.parent){e.size-=d.size,e.height-=d.height;var b=le(e.parent.children,e);e.parent.children.splice(b+1,0,d)}else{var l=new ko(e.children);l.parent=e,e.children=[l,d],e=l}d.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,d){for(var l=0;l<this.children.length;++l){var b=this.children[l],B=b.chunkSize();if(e<B){var $=Math.min(t,B-e);if(b.iterN(e,$,d))return!0;if((t-=$)==0)break;e=0}else e-=B}}};var Io=function(e,t,d){if(d)for(var l in d)d.hasOwnProperty(l)&&(this[l]=d[l]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,d=this.line,l=Qn(d);if(l==null||!t)return;for(var b=0;b<t.length;++b)t[b]==this&&t.splice(b--,1);t.length||(d.widgets=null);var B=Jr(this);hr(d,Math.max(0,d.height-B)),e&&(Ki(e,function(){Us(e,d,-B),ai(e,l,"widget")}),Dt(e,"lineWidgetCleared",e,this,l))},Io.prototype.changed=function(){var e=this,t=this.height,d=this.doc.cm,l=this.line;this.height=null;var b=Jr(this)-t;if(!b)return;$t(this.doc,l)||hr(l,l.height+b),d&&Ki(d,function(){d.curOp.forceUpdate=!0,Us(d,l,b),Dt(d,"lineWidgetChanged",d,e,Qn(l))})},we(Io);function Us(e,t,d){Pn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,d)}function El(e,t,d,l){var b=new Io(e,d,l),B=e.cm;return B&&b.noHScroll&&(B.display.alignWidgets=!0),Po(e,t,"widget",function($){var ee=$.widgets||($.widgets=[]);if(b.insertAt==null?ee.push(b):ee.splice(Math.min(ee.length-1,Math.max(0,b.insertAt)),0,b),b.line=$,B&&!$t(e,$)){var te=Pn($)<e.scrollTop;hr($,$.height+Jr(b)),te&&Va(B,b.height),B.curOp.forceUpdate=!0}return!0}),B&&Dt(B,"lineWidgetAdded",B,b,typeof t=="number"?t:Qn(t)),b}var js=0,qa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};qa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ua(e),ve(this,"clear")){var d=this.find();d&&Dt(this,"clear",d.from,d.to)}for(var l=null,b=null,B=0;B<this.lines.length;++B){var $=this.lines[B],ee=Hn($.markedSpans,this);e&&!this.collapsed?ai(e,Qn($),"text"):e&&(ee.to!=null&&(b=Qn($)),ee.from!=null&&(l=Qn($))),$.markedSpans=yn($.markedSpans,ee),ee.from==null&&this.collapsed&&!$t(this.doc,$)&&e&&hr($,Wr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var ue=ot(this.lines[te]),ke=Gn(ue);ke>e.display.maxLineLength&&(e.display.maxLine=ue,e.display.maxLineLength=ke,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&qr(e,l,b+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Dt(e,"markerCleared",e,this,l,b),t&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var d,l,b=0;b<this.lines.length;++b){var B=this.lines[b],$=Hn(B.markedSpans,this);if($.from!=null&&(d=dn(t?B:Qn(B),$.from),e==-1))return d;if($.to!=null&&(l=dn(t?B:Qn(B),$.to),e==1))return l}return d&&{from:d,to:l}},qa.prototype.changed=function(){var e=this,t=this.find(-1,!0),d=this,l=this.doc.cm;if(!t||!l)return;Ki(l,function(){var b=t.line,B=Qn(t.line),$=qe(l,B);if($&&(fr($),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!$t(d.doc,b)&&d.height!=null){var ee=d.height;d.height=null;var te=Jr(d)-ee;te&&hr(b,b.height+te)}Dt(l,"markerChanged",l,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||le(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice(le(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},we(qa);function Eo(e,t,d,l,b){if(l&&l.shared)return xl(e,t,d,l,b);if(e.cm&&!e.cm.curOp)return bi(e.cm,Eo)(e,t,d,l,b);var B=new qa(e,b),$=rr(t,d);if(l&&C(l,B,!1),$>0||$==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=y("span",[B.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(gt(e,t.line,t,d,B)||t.line!=d.line&>(e,d.line,t,d,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");ii()}B.addToHistory&&bs(e,{from:t,to:d,origin:"markText"},e.sel,NaN);var ee=t.line,te=e.cm,ue;if(e.iter(ee,d.line+1,function(Ke){te&&B.collapsed&&!te.options.lineWrapping&&ot(Ke)==te.display.maxLine&&(ue=!0),B.collapsed&&ee!=t.line&&hr(Ke,0),Sn(Ke,new Br(B,ee==t.line?t.ch:null,ee==d.line?d.ch:null)),++ee}),B.collapsed&&e.iter(t.line,d.line+1,function(Ke){$t(e,Ke)&&hr(Ke,0)}),B.clearOnEnter&&He(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(Tr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++js,B.atomic=!0),te){if(ue&&(te.curOp.updateMaxLine=!0),B.collapsed)qr(te,t.line,d.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var ke=t.line;ke<=d.line;ke++)ai(te,ke,"text");B.atomic&&Os(te.doc),Dt(te,"markerAdded",te,B)}return B}var No=function(e,t){this.markers=e,this.primary=t;for(var d=0;d<e.length;++d)e[d].parent=this};No.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Dt(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},we(No);function xl(e,t,d,l,b){l=C(l),l.shared=!1;var B=[Eo(e,t,d,l,b)],$=B[0],ee=l.widgetNode;return Ai(e,function(te){ee&&(l.widgetNode=ee.cloneNode(!0)),B.push(Eo(te,L(te,t),L(te,d),l,b));for(var ue=0;ue<te.linked.length;++ue)if(te.linked[ue].isParent)return;$=at(B)}),new No(B,$)}function Fs(e){return e.findMarks(dn(e.first,0),e.clipPos(dn(e.lastLine())),function(t){return t.parent})}function wl(e,t){for(var d=0;d<t.length;d++){var l=t[d],b=l.find(),B=e.clipPos(b.from),$=e.clipPos(b.to);if(rr(B,$)){var ee=Eo(e,B,$,l.primary,l.primary.type);l.markers.push(ee),ee.parent=l}}}function Cl(e){for(var t=function(l){var b=e[l],B=[b.primary.doc];Ai(b.primary.doc,function(te){return B.push(te)});for(var $=0;$<b.markers.length;$++){var ee=b.markers[$];le(B,ee.doc)==-1&&(ee.parent=null,b.markers.splice($--,1))}},d=0;d<e.length;d++)t(d)}var Tl=0,ta=function(e,t,d,l,b){if(!(this instanceof ta))return new ta(e,t,d,l,b);d==null&&(d=0),ko.call(this,[new Mo([new Nn("",null)])]),this.first=d,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=d;var B=dn(d,0);this.sel=Jn(B),this.history=new Go(null),this.id=++Tl,this.modeOption=t,this.lineSep=l,this.direction=b=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:B,to:B,text:e}),Yi(this,Jn(B),Ee)};ta.prototype=Ve(ko.prototype,{constructor:ta,iter:function(e,t,d){d?this.iterN(e-this.first,t-e,d):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var d=0,l=0;l<t.length;++l)d+=t[l].height;this.insertInner(e-this.first,t,d)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Fr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ei(function(e){var t=dn(this.first,0),d=this.first+this.size-1;yo(this,{from:t,to:dn(d,_n(this,d).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),Yi(this,Jn(t),Ee)}),replaceRange:function(e,t,d,l){t=L(this,t),d=d?L(this,d):t,bo(this,e,t,d,l)},getRange:function(e,t,d){var l=br(this,L(this,e),L(this,t));return d===!1?l:l.join(d||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Kr(this,e))return _n(this,e)},getLineNumber:function(e){return Qn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=_n(this,e)),ot(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return L(this,e)},getCursor:function(e){var t=this.sel.primary(),d;return e==null||e=="head"?d=t.head:e=="anchor"?d=t.anchor:e=="end"||e=="to"||e===!1?d=t.to():d=t.from(),d},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ei(function(e,t,d){Cs(this,L(this,typeof e=="number"?dn(e,t||0):e),null,d)}),setSelection:Ei(function(e,t,d){Cs(this,L(this,e),L(this,t||e),d)}),extendSelection:Ei(function(e,t,d){Vo(this,L(this,e),t&&L(this,t),d)}),extendSelections:Ei(function(e,t){ws(this,V(this,e),t)}),extendSelectionsBy:Ei(function(e,t){var d=Qt(this.sel.ranges,e);ws(this,V(this,d),t)}),setSelections:Ei(function(e,t,d){if(!e.length)return;for(var l=[],b=0;b<e.length;b++)l[b]=new Vr(L(this,e[b].anchor),L(this,e[b].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Yi(this,Sr(this.cm,l,t),d)}),addSelection:Ei(function(e,t,d){var l=this.sel.ranges.slice(0);l.push(new Vr(L(this,e),L(this,t||e))),Yi(this,Sr(this.cm,l,l.length-1),d)}),getSelection:function(e){for(var t=this.sel.ranges,d,l=0;l<t.length;l++){var b=br(this,t[l].from(),t[l].to());d=d?d.concat(b):b}return e===!1?d:d.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],d=this.sel.ranges,l=0;l<d.length;l++){var b=br(this,d[l].from(),d[l].to());e!==!1&&(b=b.join(e||this.lineSeparator())),t[l]=b}return t},replaceSelection:function(e,t,d){for(var l=[],b=0;b<this.sel.ranges.length;b++)l[b]=e;this.replaceSelections(l,t,d||"+input")},replaceSelections:Ei(function(e,t,d){for(var l=[],b=this.sel,B=0;B<b.ranges.length;B++){var $=b.ranges[B];l[B]={from:$.from(),to:$.to(),text:this.splitLines(e[B]),origin:d}}for(var ee=t&&t!="end"&&aa(this,l,t),te=l.length-1;te>=0;te--)yo(this,l[te]);ee?Ts(this,ee):this.cm&&_a(this.cm)}),undo:Ei(function(){$o(this,"undo")}),redo:Ei(function(){$o(this,"redo")}),undoSelection:Ei(function(){$o(this,"undo",!0)}),redoSelection:Ei(function(){$o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,d=0,l=0;l<e.done.length;l++)e.done[l].ranges||++t;for(var b=0;b<e.undone.length;b++)e.undone[b].ranges||++d;return{undo:t,redo:d}},clearHistory:function(){var e=this;this.history=new Go(this.history.maxGeneration),Ai(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:vo(this.history.done),undone:vo(this.history.undone)}},setHistory:function(e){var t=this.history=new Go(this.history.maxGeneration);t.done=vo(e.done.slice(0),null,!0),t.undone=vo(e.undone.slice(0),null,!0)},setGutterMarker:Ei(function(e,t,d){return Po(this,e,"gutter",function(l){var b=l.gutterMarkers||(l.gutterMarkers={});return b[t]=d,!d&&oe(b)&&(l.gutterMarkers=null),!0})}),clearGutter:Ei(function(e){var t=this;this.iter(function(d){d.gutterMarkers&&d.gutterMarkers[e]&&Po(t,d,"gutter",function(){return d.gutterMarkers[e]=null,oe(d.gutterMarkers)&&(d.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Kr(this,e))return null;if(t=e,e=_n(this,e),!e)return null}else if(t=Qn(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:Ei(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(l){var b=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[b])l[b]=d;else{if(S(d).test(l[b]))return!1;l[b]+=" "+d}return!0})}),removeLineClass:Ei(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(l){var b=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=l[b];if(B)if(d==null)l[b]=null;else{var $=B.match(S(d));if(!$)return!1;var ee=$.index+$[0].length;l[b]=B.slice(0,$.index)+(!$.index||ee==B.length?"":" ")+B.slice(ee)||null}else return!1;return!0})}),addLineWidget:Ei(function(e,t,d){return El(this,e,t,d)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,d){return Eo(this,L(this,e),L(this,t),d,d&&d.type||"range")},setBookmark:function(e,t){var d={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=L(this,e),Eo(this,e,e,d,"bookmark")},findMarksAt:function(e){e=L(this,e);var t=[],d=_n(this,e.line).markedSpans;if(d)for(var l=0;l<d.length;++l){var b=d[l];(b.from==null||b.from<=e.ch)&&(b.to==null||b.to>=e.ch)&&t.push(b.marker.parent||b.marker)}return t},findMarks:function(e,t,d){e=L(this,e),t=L(this,t);var l=[],b=e.line;return this.iter(e.line,t.line+1,function(B){var $=B.markedSpans;if($)for(var ee=0;ee<$.length;ee++){var te=$[ee];!(te.to!=null&&b==e.line&&e.ch>=te.to||te.from==null&&b!=e.line||te.from!=null&&b==t.line&&te.from>=t.ch)&&(!d||d(te.marker))&&l.push(te.marker.parent||te.marker)}++b}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var d=t.markedSpans;if(d)for(var l=0;l<d.length;++l)d[l].from!=null&&e.push(d[l].marker)}),e},posFromIndex:function(e){var t,d=this.first,l=this.lineSeparator().length;return this.iter(function(b){var B=b.text.length+l;if(B>e)return t=e,!0;e-=B,++d}),L(this,dn(d,t))},indexFromPos:function(e){e=L(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var d=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){t+=l.text.length+d}),t},copy:function(e){var t=new ta(Fr(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,d=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<d&&(d=e.to);var l=new ta(Fr(this,t,d),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(l,Fs(this)),l},unlinkDoc:function(e){if(e instanceof xi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var d=this.linked[t];if(d.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(Fs(this));break}if(e.history==this.history){var l=[e.id];Ai(e,function(b){return l.push(b.id)},!0),e.history=new Go(null),e.history.done=vo(this.history.done,l),e.history.undone=vo(this.history.undone,l)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_t(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Ei(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),ta.prototype.eachLine=ta.prototype.iter;var Bs=0;function Sl(e){var t=this;if(Hs(t),xt(t,e)||vi(t.display,e))return;ie(e),K&&(Bs=+new Date);var d=Ri(t,e,!0),l=e.dataTransfer.files;if(!d||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var b=l.length,B=Array(b),$=0,ee=function(){++$==b&&bi(t,function(){d=L(t.doc,d);var ft={from:d,to:d,text:t.doc.splitLines(B.filter(function(sn){return sn!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,ft),Ts(t.doc,Jn(L(t.doc,d),L(t.doc,dr(ft))))})()},te=function(ft,sn){if(t.options.allowDropFileTypes&&le(t.options.allowDropFileTypes,ft.type)==-1){ee();return}var Tn=new FileReader;Tn.onerror=function(){return ee()},Tn.onload=function(){var Kn=Tn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Kn)){ee();return}B[sn]=Kn,ee()},Tn.readAsText(ft)},ue=0;ue<l.length;ue++)te(l[ue],ue);else{if(t.state.draggingText&&t.doc.sel.contains(d)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ke=e.dataTransfer.getData("Text");if(ke){var Ke;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ke=t.listSelections()),Yo(t.doc,Jn(d,d)),Ke)for(var bt=0;bt<Ke.length;++bt)bo(t.doc,"",Ke[bt].anchor,Ke[bt].head,"drag");t.replaceSelection(ke,"around","paste"),t.display.input.focus()}}catch(ft){}}}function Ol(e,t){if(K&&(!e.state.draggingText||+new Date-Bs<100)){be(t);return}if(xt(e,t)||vi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var d=h("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(d.width=d.height=1,e.display.wrapper.appendChild(d),d._top=d.offsetTop),t.dataTransfer.setDragImage(d,0,0),p&&d.parentNode.removeChild(d)}}function Rl(e,t){var d=Ri(e,t);if(!d)return;var l=document.createDocumentFragment();qi(e,d,l),e.display.dragCursor||(e.display.dragCursor=h("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,l)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),d=[],l=0;l<t.length;l++){var b=t[l].CodeMirror;b&&d.push(b)}d.length&&d[0].operation(function(){for(var B=0;B<d.length;B++)e(d[B])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;He(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ll)},100))}),He(window,"blur",function(){return Ws(Ca)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var eo={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"},Uo=0;Uo<10;Uo++)eo[Uo+48]=eo[Uo+96]=String(Uo);for(var Jo=65;Jo<=90;Jo++)eo[Jo]=String.fromCharCode(Jo);for(var jo=1;jo<=12;jo++)eo[jo+111]=eo[jo+63235]="F"+jo;var Ka={};Ka.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"},Ka.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"},Ka.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"},Ka.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"]},Ka.default=i?Ka.macDefault:Ka.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var d,l,b,B,$=0;$<t.length-1;$++){var ee=t[$];if(/^(cmd|meta|m)$/i.test(ee))B=!0;else if(/^a(lt)?$/i.test(ee))d=!0;else if(/^(c|ctrl|control)$/i.test(ee))l=!0;else if(/^s(hift)?$/i.test(ee))b=!0;else throw new Error("Unrecognized modifier name: "+ee)}return d&&(e="Alt-"+e),l&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),b&&(e="Shift-"+e),e}function Ml(e){var t={};for(var d in e)if(e.hasOwnProperty(d)){var l=e[d];if(/^(name|fallthrough|(de|at)tach)$/.test(d))continue;if(l=="..."){delete e[d];continue}for(var b=Qt(d.split(" "),Pl),B=0;B<b.length;B++){var $=void 0,ee=void 0;B==b.length-1?(ee=b.join(" "),$=l):(ee=b.slice(0,B+1).join(" "),$="...");var te=t[ee];if(!te)t[ee]=$;else if(te!=$)throw new Error("Inconsistent bindings for "+ee)}delete e[d]}for(var ue in t)e[ue]=t[ue];return e}function xo(e,t,d,l){t=Qo(t);var b=t.call?t.call(e,l):t[e];if(b===!1)return"nothing";if(b==="...")return"multi";if(b!=null&&d(b))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return xo(e,t.fallthrough,d,l);for(var B=0;B<t.fallthrough.length;B++){var $=xo(e,t.fallthrough[B],d,l);if($)return $}}}function Gs(e){var t=typeof e=="string"?e:eo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function zs(e,t,d){var l=e;return t.altKey&&l!="Alt"&&(e="Alt-"+e),(w?t.metaKey:t.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(w?t.ctrlKey:t.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!d&&t.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(p&&e.keyCode==34&&e.char)return!1;var d=eo[e.keyCode];return d==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(d=e.code),zs(d,e,t))}function Qo(e){return typeof e=="string"?Ka[e]:e}function wo(e,t){for(var d=e.doc.sel.ranges,l=[],b=0;b<d.length;b++){for(var B=t(d[b]);l.length&&rr(B.from,at(l).to)<=0;){var $=l.pop();if(rr($.from,B.from)<0){B.from=$.from;break}}l.push(B)}Ki(e,function(){for(var ee=l.length-1;ee>=0;ee--)bo(e.doc,"",l[ee].from,l[ee].to,"+delete");_a(e)})}function os(e,t,d){var l=$e(e.text,t+d,d);return l<0||l>e.text.length?null:l}function ss(e,t,d){var l=os(e,t.ch,d);return l==null?null:new dn(t.line,l,d<0?"after":"before")}function ls(e,t,d,l,b){if(e){t.doc.direction=="rtl"&&(b=-b);var B=xn(d,t.doc.direction);if(B){var $=b<0?at(B):B[0],ee=b<0==($.level==1),te=ee?"after":"before",ue;if($.level>0||t.doc.direction=="rtl"){var ke=Ne(t,d);ue=b<0?d.text.length-1:0;var Ke=lt(t,ke,ue).top;ue=Bt(function(bt){return lt(t,ke,bt).top==Ke},b<0==($.level==1)?$.from:$.to-1,ue),te=="before"&&(ue=os(d,ue,1))}else ue=b<0?$.to:$.from;return new dn(l,ue,te)}}return new dn(l,b<0?d.text.length:0,b<0?"before":"after")}function kl(e,t,d,l){var b=xn(t,e.doc.direction);if(!b)return ss(t,d,l);d.ch>=t.text.length?(d.ch=t.text.length,d.sticky="before"):d.ch<=0&&(d.ch=0,d.sticky="after");var B=tt(b,d.ch,d.sticky),$=b[B];if(e.doc.direction=="ltr"&&$.level%2==0&&(l>0?$.to>d.ch:$.from<d.ch))return ss(t,d,l);var ee=function(Xn,er){return os(t,Xn instanceof dn?Xn.ch:Xn,er)},te,ue=function(Xn){return e.options.lineWrapping?(te=te||Ne(e,t),ar(e,t,te,Xn)):{begin:0,end:t.text.length}},ke=ue(d.sticky=="before"?ee(d,-1):d.ch);if(e.doc.direction=="rtl"||$.level==1){var Ke=$.level==1==l<0,bt=ee(d,Ke?1:-1);if(bt!=null&&(Ke?bt<=$.to&&bt<=ke.end:bt>=$.from&&bt>=ke.begin)){var ft=Ke?"before":"after";return new dn(d.line,bt,ft)}}var sn=function(Xn,er,$n){for(var or=function(mi,Hi){return Hi?new dn(d.line,ee(mi,1),"before"):new dn(d.line,mi,"after")};Xn>=0&&Xn<b.length;Xn+=er){var Cr=b[Xn],_r=er>0==(Cr.level!=1),jr=_r?$n.begin:ee($n.end,-1);if(Cr.from<=jr&&jr<Cr.to)return or(jr,_r);if(jr=_r?Cr.from:ee(Cr.to,-1),$n.begin<=jr&&jr<$n.end)return or(jr,_r)}},Tn=sn(B+l,l,ke);if(Tn)return Tn;var Kn=l>0?ke.end:ee(ke.begin,-1);return Kn!=null&&!(l>0&&Kn==t.text.length)&&(Tn=sn(l>0?0:b.length-1,l,ue(Kn)),Tn)?Tn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return wo(e,function(t){if(t.empty()){var d=_n(e.doc,t.head.line).text.length;return t.head.ch==d&&t.head.line<e.lastLine()?{from:t.head,to:dn(t.head.line+1,0)}:{from:t.head,to:dn(t.head.line,d)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return wo(e,function(t){return{from:dn(t.from().line,0),to:L(e.doc,dn(t.to().line+1,0))}})},delLineLeft:function(e){return wo(e,function(t){return{from:dn(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return{from:l,to:t.from()}})},delWrappedLineRight:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div");return{from:t.from(),to:l}})},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(dn(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(dn(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 Xs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div")},Qe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:d},"div")},Qe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return l.ch<e.getLine(l.line).search(/\S/)?Xs(e,t.head):l},Qe)},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=[],d=e.listSelections(),l=e.options.tabSize,b=0;b<d.length;b++){var B=d[b].from(),$=z(e.getLine(B.line),B.ch,l);t.push(pe(l-$%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ki(e,function(){for(var t=e.listSelections(),d=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var b=t[l].head,B=_n(e.doc,b.line).text;if(B){if(b.ch==B.length&&(b=new dn(b.line,b.ch-1)),b.ch>0)b=new dn(b.line,b.ch+1),e.replaceRange(B.charAt(b.ch-1)+B.charAt(b.ch-2),dn(b.line,b.ch-2),b,"+transpose");else if(b.line>e.doc.first){var $=_n(e.doc,b.line-1).text;$&&(b=new dn(b.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),dn(b.line-1,$.length-1),b,"+transpose"))}}d.push(new Vr(b,b))}e.setSelections(d)})},newlineAndIndent:function(e){return Ki(e,function(){for(var t=e.listSelections(),d=t.length-1;d>=0;d--)e.replaceRange(e.doc.lineSeparator(),t[d].anchor,t[d].head,"+input");t=e.listSelections();for(var l=0;l<t.length;l++)e.indentLine(t[l].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var d=_n(e.doc,t),l=ot(d);return l!=d&&(t=Qn(l)),ls(!0,e,l,t,1)}function Il(e,t){var d=_n(e.doc,t),l=dt(d);return l!=d&&(t=Qn(l)),ls(!0,e,d,t,-1)}function Xs(e,t){var d=Ys(e,t.line),l=_n(e.doc,d.line),b=xn(l,e.doc.direction);if(!b||b[0].level==0){var B=Math.max(d.ch,l.text.search(/\S/)),$=t.line==d.line&&t.ch<=B&&t.ch;return dn(d.line,$?0:B,d.sticky)}return d}function Zo(e,t,d){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var l=e.display.shift,b=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d&&(e.display.shift=!1),b=t(e)!=Ce}finally{e.display.shift=l,e.state.suppressEdits=!1}return b}function Nl(e,t,d){for(var l=0;l<e.state.keyMaps.length;l++){var b=xo(t,e.state.keyMaps[l],d,e);if(b)return b}return e.options.extraKeys&&xo(t,e.options.extraKeys,d,e)||xo(t,e.options.keyMap,d,e)}var Ul=new Z;function Bo(e,t,d,l){var b=e.state.keySeq;if(b){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==b&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,b+" "+t,d,l))return!0}return $s(e,t,d,l)}function $s(e,t,d,l){var b=Nl(e,t,l);return b=="multi"&&(e.state.keySeq=t),b=="handled"&&Dt(e,"keyHandled",e,t,d),(b=="handled"||b=="multi")&&(ie(d),Ti(e)),!!b}function Js(e,t){var d=Vs(t,!0);return d?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+d,t,function(l){return Zo(e,l,!0)})||Bo(e,d,t,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return Zo(e,l)}):Bo(e,d,t,function(l){return Zo(e,l)}):!1}function jl(e,t,d){return Bo(e,"'"+d+"'",t,function(l){return Zo(e,l,!0)})}var us=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),xt(t,e))return;K&&I<11&&e.keyCode==27&&(e.returnValue=!1);var d=e.keyCode;t.display.shift=d==16||e.shiftKey;var l=Js(t,e);p&&(us=l?d:null,!l&&d==88&&!st&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),U&&!i&&!l&&d==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),d==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function d(l){(l.keyCode==18||!l.altKey)&&(v(t,"CodeMirror-crosshair"),Ot(document,"keyup",d),Ot(document,"mouseover",d))}He(document,"keyup",d),He(document,"mouseover",d)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),xt(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(vi(t.display,e)||xt(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var d=e.keyCode,l=e.charCode;if(p&&d==us){us=null,ie(e);return}if(p&&(!e.which||e.which<10)&&Js(t,e))return;var b=String.fromCharCode(l==null?d:l);if(b=="\b")return;if(jl(t,e,b))return;t.display.input.onKeyPress(e)}var Bl=400,cs=function(e,t,d){this.time=e,this.pos=t,this.button=d};cs.prototype.compare=function(e,t,d){return this.time+Bl>e&&rr(t,this.pos)==0&&d==this.button};var Ho,Wo;function Hl(e,t){var d=+new Date;return Wo&&Wo.compare(d,e,t)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(d,e,t)?(Wo=new cs(d,e,t),Ho=null,"double"):(Ho=new cs(d,e,t),Wo=null,"single")}function el(e){var t=this,d=t.display;if(xt(t,e)||d.activeTouch&&d.input.supportsTouch())return;if(d.input.ensurePolled(),d.shift=e.shiftKey,vi(d,e)){r||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100));return}if(ds(t,e))return;var l=Ri(t,e),b=Be(e),B=l?Hl(l,b):"single";if(window.focus(),b==1&&t.state.selectingText&&t.state.selectingText(e),l&&Wl(t,b,l,B,e))return;b==1?l?Gl(t,l,B,e):ye(e)==d.scroller&&ie(e):b==2?(l&&Vo(t.doc,l),setTimeout(function(){return d.input.focus()},20)):b==3&&(R?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,d,l,b){var B="Click";return l=="double"?B="Double"+B:l=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,Bo(e,zs(B,b),b,function($){if(typeof $=="string"&&($=Fo[$]),!$)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=$(e,d)!=Ce}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,d){var l=e.getOption("configureMouse"),b=l?l(e,t,d):{};if(b.unit==null){var B=n?d.shiftKey&&d.metaKey:d.altKey;b.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(b.extend==null||e.doc.extend)&&(b.extend=e.doc.extend||d.shiftKey),b.addNew==null&&(b.addNew=i?d.metaKey:d.ctrlKey),b.moveOnDrag==null&&(b.moveOnDrag=!(i?d.altKey:d.ctrlKey)),b}function Gl(e,t,d,l){K?setTimeout(H(Ma,e),0):e.curOp.focus=j();var b=Kl(e,d,l),B=e.doc.sel,$;e.options.dragDrop&&St&&!e.isReadOnly()&&d=="single"&&($=B.contains(t))>-1&&(rr(($=B.ranges[$]).from(),t)<0||t.xRel>0)&&(rr($.to(),t)>0||t.xRel<0)?zl(e,l,t,b):Vl(e,l,t,b)}function zl(e,t,d,l){var b=e.display,B=!1,$=bi(e,function(ue){r&&(b.scroller.draggable=!1),e.state.draggingText=!1,Ot(b.wrapper.ownerDocument,"mouseup",$),Ot(b.wrapper.ownerDocument,"mousemove",ee),Ot(b.scroller,"dragstart",te),Ot(b.scroller,"drop",$),B||(ie(ue),l.addNew||Vo(e.doc,d,null,null,l.extend),r&&!m||K&&I==9?setTimeout(function(){b.wrapper.ownerDocument.body.focus({preventScroll:!0}),b.input.focus()},20):b.input.focus())}),ee=function(ue){B=B||Math.abs(t.clientX-ue.clientX)+Math.abs(t.clientY-ue.clientY)>=10},te=function(){return B=!0};r&&(b.scroller.draggable=!0),e.state.draggingText=$,$.copy=!l.moveOnDrag,b.scroller.dragDrop&&b.scroller.dragDrop(),He(b.wrapper.ownerDocument,"mouseup",$),He(b.wrapper.ownerDocument,"mousemove",ee),He(b.scroller,"dragstart",te),He(b.scroller,"drop",$),no(e),setTimeout(function(){return b.input.focus()},20)}function tl(e,t,d){if(d=="char")return new Vr(t,t);if(d=="word")return e.findWordAt(t);if(d=="line")return new Vr(dn(t.line,0),L(e.doc,dn(t.line+1,0)));var l=d(e,t);return new Vr(l.from,l.to)}function Vl(e,t,d,l){var b=e.display,B=e.doc;ie(t);var $,ee,te=B.sel,ue=te.ranges;if(l.addNew&&!l.extend?(ee=B.sel.contains(d),ee>-1?$=ue[ee]:$=new Vr(d,d)):($=B.sel.primary(),ee=B.sel.primIndex),l.unit=="rectangle")l.addNew||($=new Vr(d,d)),d=Ri(e,t,!0,!0),ee=-1;else{var ke=tl(e,d,l.unit);l.extend?$=is($,ke.anchor,ke.head,l.extend):$=ke}l.addNew?ee==-1?(ee=ue.length,Yi(B,Sr(e,ue.concat([$]),ee),{scroll:!1,origin:"*mouse"})):ue.length>1&&ue[ee].empty()&&l.unit=="char"&&!l.extend?(Yi(B,Sr(e,ue.slice(0,ee).concat(ue.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),te=B.sel):as(B,ee,$,Ie):(ee=0,Yi(B,new Gi([$],0),Ie),te=B.sel);var Ke=d;function bt($n){if(rr(Ke,$n)==0)return;if(Ke=$n,l.unit=="rectangle"){for(var or=[],Cr=e.options.tabSize,_r=z(_n(B,d.line).text,d.ch,Cr),jr=z(_n(B,$n.line).text,$n.ch,Cr),mi=Math.min(_r,jr),Hi=Math.max(_r,jr),Ci=Math.min(d.line,$n.line),oa=Math.min(e.lastLine(),Math.max(d.line,$n.line));Ci<=oa;Ci++){var na=_n(B,Ci).text,ki=Xe(na,mi,Cr);mi==Hi?or.push(new Vr(dn(Ci,ki),dn(Ci,ki))):na.length>ki&&or.push(new Vr(dn(Ci,ki),dn(Ci,Xe(na,Hi,Cr))))}or.length||or.push(new Vr(d,d)),Yi(B,Sr(e,te.ranges.slice(0,ee).concat(or),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView($n)}else{var ra=$,zi=tl(e,$n,l.unit),Ui=ra.anchor,Ii;rr(zi.anchor,Ui)>0?(Ii=zi.head,Ui=ri(ra.from(),zi.anchor)):(Ii=zi.anchor,Ui=ni(ra.to(),zi.head));var Oi=te.ranges.slice(0);Oi[ee]=Yl(e,new Vr(L(B,Ui),Ii)),Yi(B,Sr(e,Oi,ee),Ie)}}var ft=b.wrapper.getBoundingClientRect(),sn=0;function Tn($n){var or=++sn,Cr=Ri(e,$n,!0,l.unit=="rectangle");if(!Cr)return;if(rr(Cr,Ke)!=0){e.curOp.focus=j(),bt(Cr);var _r=ka(b,B);(Cr.line>=_r.to||Cr.line<_r.from)&&setTimeout(bi(e,function(){sn==or&&Tn($n)}),150)}else{var jr=$n.clientY<ft.top?-20:$n.clientY>ft.bottom?20:0;jr&&setTimeout(bi(e,function(){if(sn!=or)return;b.scroller.scrollTop+=jr,Tn($n)}),50)}}function Kn($n){e.state.selectingText=!1,sn=Infinity,$n&&(ie($n),b.input.focus()),Ot(b.wrapper.ownerDocument,"mousemove",Xn),Ot(b.wrapper.ownerDocument,"mouseup",er),B.history.lastSelOrigin=null}var Xn=bi(e,function($n){$n.buttons===0||!Be($n)?Kn($n):Tn($n)}),er=bi(e,Kn);e.state.selectingText=er,He(b.wrapper.ownerDocument,"mousemove",Xn),He(b.wrapper.ownerDocument,"mouseup",er)}function Yl(e,t){var d=t.anchor,l=t.head,b=_n(e.doc,d.line);if(rr(d,l)==0&&d.sticky==l.sticky)return t;var B=xn(b);if(!B)return t;var $=tt(B,d.ch,d.sticky),ee=B[$];if(ee.from!=d.ch&&ee.to!=d.ch)return t;var te=$+(ee.from==d.ch==(ee.level!=1)?0:1);if(te==0||te==B.length)return t;var ue;if(l.line!=d.line)ue=(l.line-d.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ke=tt(B,l.ch,l.sticky),Ke=ke-$||(l.ch-d.ch)*(ee.level==1?-1:1);ke==te-1||ke==te?ue=Ke<0:ue=Ke>0}var bt=B[te+(ue?-1:0)],ft=ue==(bt.level==1),sn=ft?bt.from:bt.to,Tn=ft?"after":"before";return d.ch==sn&&d.sticky==Tn?t:new Vr(new dn(d.line,sn,Tn),l)}function nl(e,t,d,l){var b,B;if(t.touches)b=t.touches[0].clientX,B=t.touches[0].clientY;else try{b=t.clientX,B=t.clientY}catch(bt){return!1}if(b>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ie(t);var $=e.display,ee=$.lineDiv.getBoundingClientRect();if(B>ee.bottom||!ve(e,d))return me(t);B-=ee.top-$.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var ue=$.gutters.childNodes[te];if(ue&&ue.getBoundingClientRect().right>=b){var ke=Dr(e.doc,B),Ke=e.display.gutterSpecs[te];return nt(e,d,e,ke,Ke.className,t),me(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(vi(e.display,t)||Xl(e,t))return;if(xt(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(e,t){return ve(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),xr(e)}var Co={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function d(l,b,B,$){e.defaults[l]=b,B&&(t[l]=$?function(ee,te,ue){ue!=Co&&B(ee,te,ue)}:B)}e.defineOption=d,e.Init=Co,d("value","",function(l,b){return l.setValue(b)},!0),d("mode",null,function(l,b){l.doc.modeOption=b,Mi(l)},!0),d("indentUnit",2,Mi,!0),d("indentWithTabs",!1),d("smartIndent",!0),d("tabSize",4,function(l){$i(l),xr(l),qr(l)},!0),d("lineSeparator",null,function(l,b){if(l.doc.lineSep=b,!b)return;var B=[],$=l.doc.first;l.doc.iter(function(te){for(var ue=0;;){var ke=te.text.indexOf(b,ue);if(ke==-1)break;ue=ke+b.length,B.push(dn($,ke))}$++});for(var ee=B.length-1;ee>=0;ee--)bo(l.doc,b,B[ee],dn(B[ee].line,B[ee].ch+b.length))}),d("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,b,B){l.state.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),B!=Co&&l.refresh()}),d("specialCharPlaceholder",Rn,function(l){return l.refresh()},!0),d("electricChars",!0),d("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),d("spellcheck",!1,function(l,b){return l.getInputField().spellcheck=b},!0),d("autocorrect",!1,function(l,b){return l.getInputField().autocorrect=b},!0),d("autocapitalize",!1,function(l,b){return l.getInputField().autocapitalize=b},!0),d("rtlMoveVisually",!O),d("wholeLineUpdateBefore",!0),d("theme","default",function(l){il(l),ca(l)},!0),d("keyMap","default",function(l,b,B){var $=Qo(b),ee=B!=Co&&Qo(B);ee&&ee.detach&&ee.detach(l,$),$.attach&&$.attach(l,ee||null)}),d("extraKeys",null),d("configureMouse",null),d("lineWrapping",!1,Ql,!0),d("gutters",[],function(l,b){l.display.gutterSpecs=Bi(b,l.options.lineNumbers),ca(l)},!0),d("fixedGutter",!0,function(l,b){l.display.gutters.style.left=b?yi(l.display)+"px":"0",l.refresh()},!0),d("coverGutterNextToScrollbar",!1,function(l){return ma(l)},!0),d("scrollbarStyle","native",function(l){Ja(l),ma(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),d("lineNumbers",!1,function(l,b){l.display.gutterSpecs=Bi(l.options.gutters,b),ca(l)},!0),d("firstLineNumber",1,ca,!0),d("lineNumberFormatter",function(l){return l},ca,!0),d("showCursorWhenSelecting",!1,ei,!0),d("resetSelectionOnContextMenu",!0),d("lineWiseCopyCut",!0),d("pasteLinesPerSelection",!0),d("selectionsMayTouch",!1),d("readOnly",!1,function(l,b){b=="nocursor"&&(Ca(l),l.display.input.blur()),l.display.input.readOnlyChanged(b)}),d("screenReaderLabel",null,function(l,b){b=b===""?null:b,l.display.input.screenReaderLabelChanged(b)}),d("disableInput",!1,function(l,b){b||l.display.input.reset()},!0),d("dragDrop",!0,Jl),d("allowDropFileTypes",null),d("cursorBlinkRate",530),d("cursorScrollMargin",0),d("cursorHeight",1,ei,!0),d("singleCursorHeightPerLine",!0,ei,!0),d("workTime",100),d("workDelay",100),d("flattenSpans",!0,$i,!0),d("addModeClass",!1,$i,!0),d("pollInterval",100),d("undoDepth",200,function(l,b){return l.doc.history.undoDepth=b}),d("historyEventDelay",1250),d("viewportMargin",10,function(l){return l.refresh()},!0),d("maxHighlightLength",1e4,$i,!0),d("moveInputWithCursor",!0,function(l,b){b||l.display.input.resetPosition()}),d("tabindex",null,function(l,b){return l.display.input.getField().tabIndex=b||""}),d("autofocus",null),d("direction","ltr",function(l,b){return l.doc.setDirection(b)},!0),d("phrases",null)}function Jl(e,t,d){var l=d&&d!=Co;if(!t!=!l){var b=e.display.dragFunctions,B=t?He:Ot;B(e.display.scroller,"dragstart",b.start),B(e.display.scroller,"dragenter",b.enter),B(e.display.scroller,"dragover",b.over),B(e.display.scroller,"dragleave",b.leave),B(e.display.scroller,"drop",b.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),On(e)),ji(e),qr(e),xr(e),setTimeout(function(){return ma(e)},100)}function xi(e,t){var d=this;if(!(this instanceof xi))return new xi(e,t);this.options=t=t?C(t):{},C(al,t,!1);var l=t.value;typeof l=="string"?l=new ta(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var b=new xi.inputStyles[t.inputStyle](this),B=this.display=new ja(e,l,b,t);B.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ja(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Z,keySeq:null,specialChars:null},t.autofocus&&!s&&B.input.focus(),K&&I<11&&setTimeout(function(){return d.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,vs(this,l),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){d.hasFocus()&&!d.state.focused&&la(d)},20):Ca(this);for(var $ in qo)qo.hasOwnProperty($)&&qo[$](this,t[$],Co);gi(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee<hs.length;++ee)hs[ee](this);Ea(this),r&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}xi.defaults=al,xi.optionHandlers=qo;function Zl(e){var t=e.display;He(t.scroller,"mousedown",bi(e,el)),K&&I<11?He(t.scroller,"dblclick",bi(e,function(te){if(xt(e,te))return;var ue=Ri(e,te);if(!ue||ds(e,te)||vi(e.display,te))return;ie(te);var ke=e.findWordAt(ue);Vo(e.doc,ke.anchor,ke.head)})):He(t.scroller,"dblclick",function(te){return xt(e,te)||ie(te)}),He(t.scroller,"contextmenu",function(te){return rl(e,te)}),He(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||rl(e,te)});var d,l={end:0};function b(){t.activeTouch&&(d=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function B(te){if(te.touches.length!=1)return!1;var ue=te.touches[0];return ue.radiusX<=1&&ue.radiusY<=1}function $(te,ue){if(ue.left==null)return!0;var ke=ue.left-te.left,Ke=ue.top-te.top;return ke*ke+Ke*Ke>20*20}He(t.scroller,"touchstart",function(te){if(!xt(e,te)&&!B(te)&&!ds(e,te)){t.input.ensurePolled(),clearTimeout(d);var ue=+new Date;t.activeTouch={start:ue,moved:!1,prev:ue-l.end<=300?l:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),He(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),He(t.scroller,"touchend",function(te){var ue=t.activeTouch;if(ue&&!vi(t,te)&&ue.left!=null&&!ue.moved&&new Date-ue.start<300){var ke=e.coordsChar(t.activeTouch,"page"),Ke;!ue.prev||$(ue,ue.prev)?Ke=new Vr(ke,ke):!ue.prev.prev||$(ue,ue.prev.prev)?Ke=e.findWordAt(ke):Ke=new Vr(dn(ke.line,0),L(e.doc,dn(ke.line+1,0))),e.setSelection(Ke.anchor,Ke.head),e.focus(),ie(te)}b()}),He(t.scroller,"touchcancel",b),He(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),Ni(e,t.scroller.scrollLeft,!0),nt(e,"scroll",e))}),He(t.scroller,"mousewheel",function(te){return Ha(e,te)}),He(t.scroller,"DOMMouseScroll",function(te){return Ha(e,te)}),He(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){xt(e,te)||be(te)},over:function(te){xt(e,te)||(Rl(e,te),be(te))},start:function(te){return Ol(e,te)},drop:bi(e,Sl),leave:function(te){xt(e,te)||Hs(e)}};var ee=t.input.getField();He(ee,"keyup",function(te){return Zs.call(e,te)}),He(ee,"keydown",bi(e,Qs)),He(ee,"keypress",bi(e,qs)),He(ee,"focus",function(te){return la(e,te)}),He(ee,"blur",function(te){return Ca(e,te)})}var hs=[];xi.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,d,l){var b=e.doc,B;d==null&&(d="add"),d=="smart"&&(b.mode.indent?B=In(e,t).state:d="prev");var $=e.options.tabSize,ee=_n(b,t),te=z(ee.text,null,$);ee.stateAfter&&(ee.stateAfter=null);var ue=ee.text.match(/^\s*/)[0],ke;if(!l&&!/\S/.test(ee.text))ke=0,d="not";else if(d=="smart"&&(ke=b.mode.indent(B,ee.text.slice(ue.length),ee.text),ke==Ce||ke>150)){if(!l)return;d="prev"}d=="prev"?t>b.first?ke=z(_n(b,t-1).text,null,$):ke=0:d=="add"?ke=te+e.options.indentUnit:d=="subtract"?ke=te-e.options.indentUnit:typeof d=="number"&&(ke=te+d),ke=Math.max(0,ke);var Ke="",bt=0;if(e.options.indentWithTabs)for(var ft=Math.floor(ke/$);ft;--ft)bt+=$,Ke+=" ";if(bt<ke&&(Ke+=pe(ke-bt)),Ke!=ue)return bo(b,Ke,dn(t,0),dn(t,ue.length),"+input"),ee.stateAfter=null,!0;for(var sn=0;sn<b.sel.ranges.length;sn++){var Tn=b.sel.ranges[sn];if(Tn.head.line==t&&Tn.head.ch<ue.length){var Kn=dn(t,ue.length);as(b,sn,new Vr(Kn,Kn));break}}}var wa=null;function es(e){wa=e}function fs(e,t,d,l,b){var B=e.doc;e.display.shift=!1,l||(l=B.sel);var $=+new Date-200,ee=b=="paste"||e.state.pasteIncoming>$,te=_t(t),ue=null;if(ee&&l.ranges.length>1)if(wa&&wa.text.join(`
|
|
`)==t){if(l.ranges.length%wa.text.length==0){ue=[];for(var ke=0;ke<wa.text.length;ke++)ue.push(B.splitLines(wa.text[ke]))}}else te.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(ue=Qt(te,function(Xn){return[Xn]}));for(var Ke=e.curOp.updateInput,bt=l.ranges.length-1;bt>=0;bt--){var ft=l.ranges[bt],sn=ft.from(),Tn=ft.to();ft.empty()&&(d&&d>0?sn=dn(sn.line,sn.ch-d):e.state.overwrite&&!ee?Tn=dn(Tn.line,Math.min(_n(B,Tn.line).text.length,Tn.ch+at(te).length)):ee&&wa&&wa.lineWise&&wa.text.join(`
|
|
`)==te.join(`
|
|
`)&&(sn=Tn=dn(sn.line,0)));var Kn={from:sn,to:Tn,text:ue?ue[bt%ue.length]:te,origin:b||(ee?"paste":e.state.cutIncoming>$?"cut":"+input")};yo(e.doc,Kn),Dt(e,"inputRead",e,Kn)}t&&!ee&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ke),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var d=e.clipboardData&&e.clipboardData.getData("Text");if(d)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ki(t,function(){return fs(t,d,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var d=e.doc.sel,l=d.ranges.length-1;l>=0;l--){var b=d.ranges[l];if(b.head.ch>100||l&&d.ranges[l-1].head.line==b.head.line)continue;var B=e.getModeAt(b.head),$=!1;if(B.electricChars){for(var ee=0;ee<B.electricChars.length;ee++)if(t.indexOf(B.electricChars.charAt(ee))>-1){$=Ko(e,b.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(_n(e.doc,b.head.line).text.slice(0,b.head.ch))&&($=Ko(e,b.head.line,"smart")));$&&Dt(e,"electricInput",e,b.head.line)}}function ll(e){for(var t=[],d=[],l=0;l<e.doc.sel.ranges.length;l++){var b=e.doc.sel.ranges[l].head.line,B={anchor:dn(b,0),head:dn(b+1,0)};d.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:d}}function ul(e,t,d,l){e.setAttribute("autocorrect",d?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=h("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=h("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),o&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,d=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,b){var B=this.options,$=B[l];if(B[l]==b&&l!="mode")return;B[l]=b,t.hasOwnProperty(l)&&bi(this,t[l])(this,b,$),nt(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,b){this.state.keyMaps[b?"push":"unshift"](Qo(l))},removeKeyMap:function(l){for(var b=this.state.keyMaps,B=0;B<b.length;++B)if(b[B]==l||b[B].name==l)return b.splice(B,1),!0},addOverlay:Pi(function(l,b){var B=l.token?l:e.getMode(this.options,l);if(B.startState)throw new Error("Overlays may not be stateful.");Ft(this.state.overlays,{mode:B,modeSpec:l,opaque:b&&b.opaque,priority:b&&b.priority||0},function($){return $.priority}),this.state.modeGen++,qr(this)}),removeOverlay:Pi(function(l){for(var b=this.state.overlays,B=0;B<b.length;++B){var $=b[B].modeSpec;if($==l||typeof l=="string"&&$.name==l){b.splice(B,1),this.state.modeGen++,qr(this);return}}}),indentLine:Pi(function(l,b,B){typeof b!="string"&&typeof b!="number"&&(b==null?b=this.options.smartIndent?"smart":"prev":b=b?"add":"subtract"),Kr(this.doc,l)&&Ko(this,l,b,B)}),indentSelection:Pi(function(l){for(var b=this.doc.sel.ranges,B=-1,$=0;$<b.length;$++){var ee=b[$];if(ee.empty())ee.head.line>B&&(Ko(this,ee.head.line,l,!0),B=ee.head.line,$==this.doc.sel.primIndex&&_a(this));else{var te=ee.from(),ue=ee.to(),ke=Math.max(B,te.line);B=Math.min(this.lastLine(),ue.line-(ue.ch?0:1))+1;for(var Ke=ke;Ke<B;++Ke)Ko(this,Ke,l);var bt=this.doc.sel.ranges;te.ch==0&&b.length==bt.length&&bt[$].from().ch>0&&as(this.doc,$,new Vr(te,bt[$].to()),Ee)}}}),getTokenAt:function(l,b){return Mr(this,l,b)},getLineTokens:function(l,b){return Mr(this,dn(l),b,!0)},getTokenTypeAt:function(l){l=L(this.doc,l);var b=Jt(this,_n(this.doc,l.line)),B=0,$=(b.length-1)/2,ee=l.ch,te;if(ee==0)te=b[2];else for(;;){var ue=B+$>>1;if((ue?b[ue*2-1]:0)>=ee)$=ue;else if(b[ue*2+1]<ee)B=ue+1;else{te=b[ue*2+2];break}}var ke=te?te.indexOf("overlay "):-1;return ke<0?te:ke==0?null:te.slice(0,ke-1)},getModeAt:function(l){var b=this.doc.mode;return b.innerMode?e.innerMode(b,this.getTokenAt(l).state).mode:b},getHelper:function(l,b){return this.getHelpers(l,b)[0]},getHelpers:function(l,b){var B=[];if(!d.hasOwnProperty(b))return B;var $=d[b],ee=this.getModeAt(l);if(typeof ee[b]=="string")$[ee[b]]&&B.push($[ee[b]]);else if(ee[b])for(var te=0;te<ee[b].length;te++){var ue=$[ee[b][te]];ue&&B.push(ue)}else ee.helperType&&$[ee.helperType]?B.push($[ee.helperType]):$[ee.name]&&B.push($[ee.name]);for(var ke=0;ke<$._global.length;ke++){var Ke=$._global[ke];Ke.pred(ee,this)&&le(B,Ke.val)==-1&&B.push(Ke.val)}return B},getStateAfter:function(l,b){var B=this.doc;return l=X(B,l==null?B.first+B.size-1:l),In(this,l+1,b).state},cursorCoords:function(l,b){var B,$=this.doc.sel.primary();return l==null?B=$.head:typeof l=="object"?B=L(this.doc,l):B=l?$.from():$.to(),wn(this,B,b||"page")},charCoords:function(l,b){return rn(this,L(this.doc,l),b||"page")},coordsChar:function(l,b){return l=gn(this,l,b||"page"),pr(this,l.left,l.top)},lineAtHeight:function(l,b){return l=gn(this,{top:l,left:0},b||"page").top,Dr(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,b,B){var $=!1,ee;if(typeof l=="number"){var te=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>te&&(l=te,$=!0),ee=_n(this.doc,l)}else ee=l;return Lr(this,ee,{top:0,left:0},b||"page",B||$).top+($?this.doc.height-Pn(ee):0)},defaultTextHeight:function(){return Wr(this.display)},defaultCharWidth:function(){return Hr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,b,B,$,ee){var te=this.display;l=wn(this,L(this.doc,l));var ue=l.bottom,ke=l.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),te.sizer.appendChild(b),$=="over")ue=l.top;else if($=="above"||$=="near"){var Ke=Math.max(te.wrapper.clientHeight,this.doc.height),bt=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);($=="above"||l.bottom+b.offsetHeight>Ke)&&l.top>b.offsetHeight?ue=l.top-b.offsetHeight:l.bottom+b.offsetHeight<=Ke&&(ue=l.bottom),ke+b.offsetWidth>bt&&(ke=bt-b.offsetWidth)}b.style.top=ue+"px",b.style.left=b.style.right="",ee=="right"?(ke=te.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):(ee=="left"?ke=0:ee=="middle"&&(ke=(te.sizer.clientWidth-b.offsetWidth)/2),b.style.left=ke+"px"),B&&za(this,{left:ke,top:ue,right:ke+b.offsetWidth,bottom:ue+b.offsetHeight})},triggerOnKeyDown:Pi(Qs),triggerOnKeyPress:Pi(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Pi(el),execCommand:function(l){if(Fo.hasOwnProperty(l))return Fo[l].call(null,this)},triggerElectric:Pi(function(l){sl(this,l)}),findPosH:function(l,b,B,$){var ee=1;b<0&&(ee=-1,b=-b);for(var te=L(this.doc,l),ue=0;ue<b&&!(te=ps(this.doc,te,ee,B,$),te.hitSide);++ue);return te},moveH:Pi(function(l,b){var B=this;this.extendSelectionsBy(function($){return B.display.shift||B.doc.extend||$.empty()?ps(B.doc,$.head,l,b,B.options.rtlMoveVisually):l<0?$.from():$.to()},Qe)}),deleteH:Pi(function(l,b){var B=this.doc.sel,$=this.doc;B.somethingSelected()?$.replaceSelection("",null,"+delete"):wo(this,function(ee){var te=ps($,ee.head,l,b,!1);return l<0?{from:te,to:ee.head}:{from:ee.head,to:te}})}),findPosV:function(l,b,B,$){var ee=1,te=$;b<0&&(ee=-1,b=-b);for(var ue=L(this.doc,l),ke=0;ke<b;++ke){var Ke=wn(this,ue,"div");if(te==null?te=Ke.left:Ke.left=te,ue=dl(this,Ke,ee,B),ue.hitSide)break}return ue},moveV:Pi(function(l,b){var B=this,$=this.doc,ee=[],te=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(ke){if(te)return l<0?ke.from():ke.to();var Ke=wn(B,ke.head,"div");ke.goalColumn!=null&&(Ke.left=ke.goalColumn),ee.push(Ke.left);var bt=dl(B,Ke,l,b);return b=="page"&&ke==$.sel.primary()&&Va(B,rn(B,bt,"div").top-Ke.top),bt},Qe),ee.length)for(var ue=0;ue<$.sel.ranges.length;ue++)$.sel.ranges[ue].goalColumn=ee[ue]}),findWordAt:function(l){var b=this.doc,B=_n(b,l.line).text,$=l.ch,ee=l.ch;if(B){var te=this.getHelper(l,"wordChars");(l.sticky=="before"||ee==B.length)&&$?--$:++ee;for(var ue=B.charAt($),ke=Ut(ue,te)?function(Ke){return Ut(Ke,te)}:/\s/.test(ue)?function(Ke){return/\s/.test(Ke)}:function(Ke){return!/\s/.test(Ke)&&!Ut(Ke)};$>0&&ke(B.charAt($-1));)--$;for(;ee<B.length&&ke(B.charAt(ee));)++ee}return new Vr(dn(l.line,$),dn(l.line,ee))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),nt(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Pi(function(l,b){Ra(this,l,b)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Ye(this)-this.display.barHeight,width:l.scrollWidth-Ye(this)-this.display.barWidth,clientHeight:re(this),clientWidth:Oe(this)}},scrollIntoView:Pi(function(l,b){l==null?(l={from:this.doc.sel.primary().head,to:null},b==null&&(b=this.options.cursorScrollMargin)):typeof l=="number"?l={from:dn(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=b||0,l.from.line!=null?ho(this,l):Aa(this,l.from,l.to,l.margin)}),setSize:Pi(function(l,b){var B=this,$=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};l!=null&&(this.display.wrapper.style.width=$(l)),b!=null&&(this.display.wrapper.style.height=$(b)),this.options.lineWrapping&&cr(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(te){if(te.widgets){for(var ue=0;ue<te.widgets.length;ue++)if(te.widgets[ue].noHScroll){ai(B,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,nt(this,"refresh",this)}),operation:function(l){return Ki(this,l)},startOperation:function(){return ua(this)},endOperation:function(){return Ea(this)},refresh:Pi(function(){var l=this.display.cachedTextHeight;qr(this),this.curOp.forceUpdate=!0,xr(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(l==null||Math.abs(l-Wr(this.display))>.5||this.options.lineWrapping)&&ji(this),nt(this,"refresh",this)}),swapDoc:Pi(function(l){var b=this.doc;return b.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,l),xr(this),this.display.input.reset(),Ra(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Dt(this,"swapDoc",this,b),b}),phrase:function(l){var b=this.options.phrases;return b&&Object.prototype.hasOwnProperty.call(b,l)?b[l]:l},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}},we(e),e.registerHelper=function(l,b,B){d.hasOwnProperty(l)||(d[l]=e[l]={_global:[]}),d[l][b]=B},e.registerGlobalHelper=function(l,b,B,$){e.registerHelper(l,b,$),d[l]._global.push({pred:B,val:$})}}function ps(e,t,d,l,b){var B=t,$=d,ee=_n(e,t.line),te=b&&e.direction=="rtl"?-d:d;function ue(){var er=t.line+te;return er<e.first||er>=e.first+e.size?!1:(t=new dn(er,t.ch,t.sticky),ee=_n(e,er))}function ke(er){var $n;if(l=="codepoint"){var or=ee.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(or)?$n=null:$n=new dn(t.line,Math.max(0,Math.min(ee.text.length,t.ch+d*(or>=55296&&or<56320?2:1))),-d)}else b?$n=kl(e.cm,ee,t,d):$n=ss(ee,t,d);if($n==null)if(!er&&ue())t=ls(b,e.cm,ee,t.line,te);else return!1;else t=$n;return!0}if(l=="char"||l=="codepoint")ke();else if(l=="column")ke(!0);else if(l=="word"||l=="group")for(var Ke=null,bt=l=="group",ft=e.cm&&e.cm.getHelper(t,"wordChars"),sn=!0;!(d<0&&!ke(!sn));sn=!1){var Tn=ee.text.charAt(t.ch)||`
|
|
`,Kn=Ut(Tn,ft)?"w":bt&&Tn==`
|
|
`?"n":!bt||/\s/.test(Tn)?null:"p";if(bt&&!sn&&!Kn&&(Kn="s"),Ke&&Ke!=Kn){d<0&&(d=1,ke(),t.sticky="after");break}if(Kn&&(Ke=Kn),d>0&&!ke(!sn))break}var Xn=Xo(e,t,B,$,!0);return fi(B,Xn)&&(Xn.hitSide=!0),Xn}function dl(e,t,d,l){var b=e.doc,B=t.left,$;if(l=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(ee-.5*Wr(e.display),3);$=(d>0?t.bottom:t.top)+d*te}else l=="line"&&($=d>0?t.bottom+3:t.top-3);for(var ue;!(ue=pr(e,B,$),!ue.outside);){if(d<0?$<=0:$>=b.height){ue.hitSide=!0;break}$+=d*5}return ue}var hi=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};hi.prototype.init=function(e){var t=this,d=this,l=d.cm,b=d.div=e.lineDiv;ul(b,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function B(ee){for(var te=ee.target;te;te=te.parentNode){if(te==b)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}He(b,"paste",function(ee){if(!B(ee)||xt(l,ee)||ol(ee,l))return;I<=11&&setTimeout(bi(l,function(){return t.updateFromDOM()}),20)}),He(b,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),He(b,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),He(b,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),He(b,"touchstart",function(){return d.forceCompositionEnd()}),He(b,"input",function(){t.composing||t.readFromDOMSoon()});function $(ee){if(!B(ee)||xt(l,ee))return;if(l.somethingSelected())es({lineWise:!1,text:l.getSelections()}),ee.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var te=ll(l);es({lineWise:!0,text:te.text}),ee.type=="cut"&&l.operation(function(){l.setSelections(te.ranges,0,Ee),l.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var ue=wa.text.join(`
|
|
`);if(ee.clipboardData.setData("Text",ue),ee.clipboardData.getData("Text")==ue){ee.preventDefault();return}}var ke=cl(),Ke=ke.firstChild;l.display.lineSpace.insertBefore(ke,l.display.lineSpace.firstChild),Ke.value=wa.text.join(`
|
|
`);var bt=document.activeElement;W(Ke),setTimeout(function(){l.display.lineSpace.removeChild(ke),bt.focus(),bt==b&&d.showPrimarySelection()},50)}He(b,"copy",$),He(b,"cut",$)},hi.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},hi.prototype.prepareSelection=function(){var e=Zi(this.cm,!1);return e.focus=document.activeElement==this.div,e},hi.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},hi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},hi.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,d=t.doc.sel.primary(),l=d.from(),b=d.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||b.line<t.display.viewFrom){e.removeAllRanges();return}var B=ts(t,e.anchorNode,e.anchorOffset),$=ts(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&$&&!$.bad&&rr(ri(B,$),l)==0&&rr(ni(B,$),b)==0)return;var ee=t.display.view,te=l.line>=t.display.viewFrom&&hl(t,l)||{node:ee[0].measure.map[2],offset:0},ue=b.line<t.display.viewTo&&hl(t,b);if(!ue){var ke=ee[ee.length-1].measure,Ke=ke.maps?ke.maps[ke.maps.length-1]:ke.map;ue={node:Ke[Ke.length-1],offset:Ke[Ke.length-2]-Ke[Ke.length-3]}}if(!te||!ue){e.removeAllRanges();return}var bt=e.rangeCount&&e.getRangeAt(0),ft;try{ft=g(te.node,te.offset,ue.offset,ue.node)}catch(sn){}ft&&(!U&&t.state.focused?(e.collapse(te.node,te.offset),ft.collapsed||(e.removeAllRanges(),e.addRange(ft))):(e.removeAllRanges(),e.addRange(ft)),bt&&e.anchorNode==null?e.addRange(bt):U&&this.startGracePeriod()),this.rememberSelection()},hi.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)},hi.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},hi.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},hi.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},hi.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},hi.prototype.blur=function(){this.div.blur()},hi.prototype.getField=function(){return this.div},hi.prototype.supportsTouch=function(){return!0},hi.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ki(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)},hi.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},hi.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&_&&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 d=ts(t,e.anchorNode,e.anchorOffset),l=ts(t,e.focusNode,e.focusOffset);d&&l&&Ki(t,function(){Yi(t.doc,Jn(d,l),Ee),(d.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},hi.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,d=e.doc.sel.primary(),l=d.from(),b=d.to();if(l.ch==0&&l.line>e.firstLine()&&(l=dn(l.line-1,_n(e.doc,l.line-1).length)),b.ch==_n(e.doc,b.line).text.length&&b.line<e.lastLine()&&(b=dn(b.line+1,0)),l.line<t.viewFrom||b.line>t.viewTo-1)return!1;var B,$,ee;l.line==t.viewFrom||(B=ci(e,l.line))==0?($=Qn(t.view[0].line),ee=t.view[0].node):($=Qn(t.view[B].line),ee=t.view[B-1].node.nextSibling);var te=ci(e,b.line),ue,ke;if(te==t.view.length-1?(ue=t.viewTo-1,ke=t.lineDiv.lastChild):(ue=Qn(t.view[te+1].line)-1,ke=t.view[te+1].node.previousSibling),!ee)return!1;for(var Ke=e.doc.splitLines(tu(e,ee,ke,$,ue)),bt=br(e.doc,dn($,0),dn(ue,_n(e.doc,ue).text.length));Ke.length>1&&bt.length>1;)if(at(Ke)==at(bt))Ke.pop(),bt.pop(),ue--;else if(Ke[0]==bt[0])Ke.shift(),bt.shift(),$++;else break;for(var ft=0,sn=0,Tn=Ke[0],Kn=bt[0],Xn=Math.min(Tn.length,Kn.length);ft<Xn&&Tn.charCodeAt(ft)==Kn.charCodeAt(ft);)++ft;for(var er=at(Ke),$n=at(bt),or=Math.min(er.length-(Ke.length==1?ft:0),$n.length-(bt.length==1?ft:0));sn<or&&er.charCodeAt(er.length-sn-1)==$n.charCodeAt($n.length-sn-1);)++sn;if(Ke.length==1&&bt.length==1&&$==l.line)for(;ft&&ft>l.ch&&er.charCodeAt(er.length-sn-1)==$n.charCodeAt($n.length-sn-1);)ft--,sn++;Ke[Ke.length-1]=er.slice(0,er.length-sn).replace(/^\u200b+/,""),Ke[0]=Ke[0].slice(ft).replace(/\u200b+$/,"");var Cr=dn($,ft),_r=dn(ue,bt.length?at(bt).length-sn:0);if(Ke.length>1||Ke[0]||rr(Cr,_r))return bo(e.doc,Ke,Cr,_r,"+input"),!0},hi.prototype.ensurePolled=function(){this.forceCompositionEnd()},hi.prototype.reset=function(){this.forceCompositionEnd()},hi.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},hi.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)},hi.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ki(this.cm,function(){return qr(e.cm)})},hi.prototype.setUneditable=function(e){e.contentEditable="false"},hi.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||bi(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},hi.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},hi.prototype.onContextMenu=function(){},hi.prototype.resetPosition=function(){},hi.prototype.needsContentAttribute=!0;function hl(e,t){var d=qe(e,t.line);if(!d||d.hidden)return null;var l=_n(e.doc,t.line),b=ce(d,l,t.line),B=xn(l,e.doc.direction),$="left";if(B){var ee=tt(B,t.ch);$=ee%2?"right":"left"}var te=on(b.map,t.ch,$);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function To(e,t){return t&&(e.bad=!0),e}function tu(e,t,d,l,b){var B="",$=!1,ee=e.doc.lineSeparator(),te=!1;function ue(ft){return function(sn){return sn.id==ft}}function ke(){$&&(B+=ee,te&&(B+=ee),$=te=!1)}function Ke(ft){ft&&(ke(),B+=ft)}function bt(ft){if(ft.nodeType==1){var sn=ft.getAttribute("cm-text");if(sn){Ke(sn);return}var Tn=ft.getAttribute("cm-marker"),Kn;if(Tn){var Xn=e.findMarks(dn(l,0),dn(b+1,0),ue(+Tn));Xn.length&&(Kn=Xn[0].find(0))&&Ke(br(e.doc,Kn.from,Kn.to).join(ee));return}if(ft.getAttribute("contenteditable")=="false")return;var er=/^(pre|div|p|li|table|br)$/i.test(ft.nodeName);if(!/^br$/i.test(ft.nodeName)&&ft.textContent.length==0)return;er&&ke();for(var $n=0;$n<ft.childNodes.length;$n++)bt(ft.childNodes[$n]);/^(pre|p)$/i.test(ft.nodeName)&&(te=!0),er&&($=!0)}else ft.nodeType==3&&Ke(ft.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(bt(t),t==d);)t=t.nextSibling,te=!1;return B}function ts(e,t,d){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[d],!l)return To(e.clipPos(dn(e.display.viewTo-1)),!0);t=null,d=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var b=0;b<e.display.view.length;b++){var B=e.display.view[b];if(B.node==l)return nu(B,t,d)}}function nu(e,t,d){var l=e.text.firstChild,b=!1;if(!t||!x(l,t))return To(dn(Qn(e.line),0),!0);if(t==l&&(b=!0,t=l.childNodes[d],d=0,!t)){var B=e.rest?at(e.rest):e.line;return To(dn(Qn(B),B.text.length),b)}var $=t.nodeType==3?t:null,ee=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,d&&(d=$.nodeValue.length));ee.parentNode!=l;)ee=ee.parentNode;var te=e.measure,ue=te.maps;function ke(Kn,Xn,er){for(var $n=-1;$n<(ue?ue.length:0);$n++)for(var or=$n<0?te.map:ue[$n],Cr=0;Cr<or.length;Cr+=3){var _r=or[Cr+2];if(_r==Kn||_r==Xn){var jr=Qn($n<0?e.line:e.rest[$n]),mi=or[Cr]+er;return(er<0||_r!=Kn)&&(mi=or[Cr+(er?1:0)]),dn(jr,mi)}}}var Ke=ke($,ee,d);if(Ke)return To(Ke,b);for(var bt=ee.nextSibling,ft=$?$.nodeValue.length-d:0;bt;bt=bt.nextSibling){if(Ke=ke(bt,bt.firstChild,0),Ke)return To(dn(Ke.line,Ke.ch-ft),b);ft+=bt.textContent.length}for(var sn=ee.previousSibling,Tn=d;sn;sn=sn.previousSibling){if(Ke=ke(sn,sn.firstChild,-1),Ke)return To(dn(Ke.line,Ke.ch+Tn),b);Tn+=sn.textContent.length}}var Di=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};Di.prototype.init=function(e){var t=this,d=this,l=this.cm;this.createField(e);var b=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),o&&(b.style.width="0px"),He(b,"input",function(){K&&I>=9&&t.hasSelection&&(t.hasSelection=null),d.poll()}),He(b,"paste",function($){if(xt(l,$)||ol($,l))return;l.state.pasteIncoming=+new Date,d.fastPoll()});function B($){if(xt(l,$))return;if(l.somethingSelected())es({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ee=ll(l);es({lineWise:!0,text:ee.text}),$.type=="cut"?l.setSelections(ee.ranges,null,Ee):(d.prevInput="",b.value=ee.text.join(`
|
|
`),W(b))}else return;$.type=="cut"&&(l.state.cutIncoming=+new Date)}He(b,"cut",B),He(b,"copy",B),He(e.scroller,"paste",function($){if(vi(e,$)||xt(l,$))return;if(!b.dispatchEvent){l.state.pasteIncoming=+new Date,d.focus();return}var ee=new Event("paste");ee.clipboardData=$.clipboardData,b.dispatchEvent(ee)}),He(e.lineSpace,"selectstart",function($){vi(e,$)||ie($)}),He(b,"compositionstart",function(){var $=l.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:$,range:l.markText($,l.getCursor("to"),{className:"CodeMirror-composing"})}}),He(b,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},Di.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Di.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Di.prototype.prepareSelection=function(){var e=this.cm,t=e.display,d=e.doc,l=Zi(e);if(e.options.moveInputWithCursor){var b=wn(e,d.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,b.top+$.top-B.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,b.left+$.left-B.left))}return l},Di.prototype.showSelection=function(e){var t=this.cm,d=t.display;f(d.cursorDiv,e.cursors),f(d.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Di.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var d=t.getSelection();this.textarea.value=d,t.state.focused&&W(this.textarea),K&&I>=9&&(this.hasSelection=d)}else e||(this.prevInput=this.textarea.value="",K&&I>=9&&(this.hasSelection=null))},Di.prototype.getField=function(){return this.textarea},Di.prototype.supportsTouch=function(){return!1},Di.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},Di.prototype.blur=function(){this.textarea.blur()},Di.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Di.prototype.receivedFocus=function(){this.slowPoll()},Di.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()})},Di.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function d(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,d)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,d)},Di.prototype.poll=function(){var e=this,t=this.cm,d=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||Et(d)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var b=d.value;if(b==l&&!t.somethingSelected())return!1;if(K&&I>=9&&this.hasSelection===b||i&&/[\uf700-\uf7ff]/.test(b))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=b.charCodeAt(0);if(B==8203&&!l&&(l="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,ee=Math.min(l.length,b.length);$<ee&&l.charCodeAt($)==b.charCodeAt($);)++$;return Ki(t,function(){fs(t,b.slice($),l.length-$,null,e.composing?"*compose":null),b.length>1e3||b.indexOf(`
|
|
`)>-1?d.value=e.prevInput="":e.prevInput=b,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Di.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Di.prototype.onKeyPress=function(){K&&I>=9&&(this.hasSelection=null),this.fastPoll()},Di.prototype.onContextMenu=function(e){var t=this,d=t.cm,l=d.display,b=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=Ri(d,e),$=l.scroller.scrollTop;if(!B||p)return;var ee=d.options.resetSelectionOnContextMenu;ee&&d.doc.sel.contains(B)==-1&&bi(d,Yi)(d.doc,Jn(B),Ee);var te=b.style.cssText,ue=t.wrapper.style.cssText,ke=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",b.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ke.top-5)+"px; left: "+(e.clientX-ke.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 Ke;r&&(Ke=window.scrollY),l.input.focus(),r&&window.scrollTo(null,Ke),l.input.reset(),d.somethingSelected()||(b.value=t.prevInput=" "),t.contextMenuPending=ft,l.selForContextMenu=d.doc.sel,clearTimeout(l.detectingSelectAll);function bt(){if(b.selectionStart!=null){var Tn=d.somethingSelected(),Kn="\u200B"+(Tn?b.value:"");b.value="\u21DA",b.value=Kn,t.prevInput=Tn?"":"\u200B",b.selectionStart=1,b.selectionEnd=Kn.length,l.selForContextMenu=d.doc.sel}}function ft(){if(t.contextMenuPending!=ft)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ue,b.style.cssText=te,K&&I<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=$),b.selectionStart!=null){(!K||K&&I<9)&&bt();var Tn=0,Kn=function(){l.selForContextMenu==d.doc.sel&&b.selectionStart==0&&b.selectionEnd>0&&t.prevInput=="\u200B"?bi(d,Ds)(d):Tn++<10?l.detectingSelectAll=setTimeout(Kn,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(Kn,200)}}if(K&&I>=9&&bt(),R){be(e);var sn=function(){Ot(window,"mouseup",sn),setTimeout(ft,20)};He(window,"mouseup",sn)}else setTimeout(ft,50)},Di.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Di.prototype.setUneditable=function(){},Di.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?C(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 d=j();t.autofocus=d==e||e.getAttribute("autofocus")!=null&&d==document.body}function l(){e.value=ee.getValue()}var b;if(e.form&&(He(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var B=e.form;b=B.submit;try{var $=B.submit=function(){l(),B.submit=b,B.submit(),B.submit=$}}catch(te){}}t.finishInit=function(te){te.save=l,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,l(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(Ot(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=b))}},e.style.display="none";var ee=xi(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return ee}function iu(e){e.off=Ot,e.on=He,e.wheelEventPixels=Ba,e.Doc=ta,e.splitLines=_t,e.countColumn=z,e.findColumn=Xe,e.isWordChar=ut,e.Pass=Ce,e.signal=nt,e.Line=Nn,e.changeEnd=dr,e.scrollbarModel=$a,e.Pos=dn,e.cmpPos=rr,e.modes=Lt,e.mimeModes=ct,e.resolveMode=Pe,e.getMode=et,e.modeExtensions=jt,e.extendMode=bn,e.copyState=Kt,e.startState=Yn,e.innerMode=Xt,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=Bn,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ie,e.e_stopPropagation=ae,e.e_stop=be,e.addClass=F,e.contains=x,e.rmClass=v,e.keyNames=eo}$l(xi),ql(xi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ta.prototype)ta.prototype.hasOwnProperty(ns)&&le(au,ns)<0&&(xi.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ta.prototype[ns]));return we(ta),xi.inputStyles={textarea:Di,contenteditable:hi},xi.defineMode=function(e){!xi.defaults.mode&&e!="null"&&(xi.defaults.mode=e),tn.apply(this,arguments)},xi.defineMIME=un,xi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xi.defineMIME("text/plain","null"),xi.defineExtension=function(e,t){xi.prototype[e]=t},xi.defineDocExtension=function(e,t){ta.prototype[e]=t},xi.fromTextArea=ru,iu(xi),xi.version="5.58.2",xi})},WaYH:function(Gt,fe,D){"use strict";var q=D("rePB"),Y=D("Ff2n"),U=D("VTBJ"),G=D("1OyB"),M=D("vuIU"),k=D("JX7q"),K=D("Ji7U"),I=D("LK+K"),r=D("q1tI"),P=D("TSYQ"),_=D.n(P),p=D("sboe"),m=D("OZM5"),u=function(R){var S=R.prefixCls,v=R.level,E=R.isStart,f=R.isEnd;if(!v)return null;for(var h="".concat(S,"-indent-unit"),y=[],g=0;g<v;g+=1){var x;y.push(r.createElement("span",{key:g,className:_()(h,(x={},Object(q.a)(x,"".concat(h,"-start"),E[g+1]),Object(q.a)(x,"".concat(h,"-end"),f[g+1]),Object(q.a)(x,"".concat(h,"-end-first-level"),!g&&f[0]),x))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(S,"-indent")},y)},a=u,o=D("815F"),c="open",s="close",i="---",n=function(w){Object(K.a)(S,w);var R=Object(I.a)(S);function S(){var v;return Object(G.a)(this,S),v=R.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(E){var f=v.props.context.onNodeClick;f(E,Object(o.b)(v.props)),v.isSelectable()?v.onSelect(E):v.onCheck(E)},v.onSelectorDoubleClick=function(E){var f=v.props.context.onNodeDoubleClick;f(E,Object(o.b)(v.props))},v.onSelect=function(E){if(v.isDisabled())return;var f=v.props.context.onNodeSelect;E.preventDefault(),f(E,Object(o.b)(v.props))},v.onCheck=function(E){if(v.isDisabled())return;var f=v.props,h=f.disableCheckbox,y=f.checked,g=v.props.context.onNodeCheck;if(!v.isCheckable()||h)return;E.preventDefault();var x=!y;g(E,Object(o.b)(v.props),x)},v.onMouseEnter=function(E){var f=v.props.context.onNodeMouseEnter;f(E,Object(o.b)(v.props))},v.onMouseLeave=function(E){var f=v.props.context.onNodeMouseLeave;f(E,Object(o.b)(v.props))},v.onContextMenu=function(E){var f=v.props.context.onNodeContextMenu;f(E,Object(o.b)(v.props))},v.onDragStart=function(E){var f=v.props.context.onNodeDragStart;E.stopPropagation(),v.setState({dragNodeHighlight:!0}),f(E,Object(k.a)(v));try{E.dataTransfer.setData("text/plain","")}catch(h){}},v.onDragEnter=function(E){var f=v.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),f(E,Object(k.a)(v))},v.onDragOver=function(E){var f=v.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),f(E,Object(k.a)(v))},v.onDragLeave=function(E){var f=v.props.context.onNodeDragLeave;E.stopPropagation(),f(E,Object(k.a)(v))},v.onDragEnd=function(E){var f=v.props.context.onNodeDragEnd;E.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(E,Object(k.a)(v))},v.onDrop=function(E){var f=v.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(E,Object(k.a)(v))},v.onExpand=function(E){var f=v.props.context.onNodeExpand;f(E,Object(o.b)(v.props))},v.setSelectHandle=function(E){v.selectHandle=E},v.getNodeState=function(){var E=v.props.expanded;return v.isLeaf()?null:E?c:s},v.hasChildren=function(){var E=v.props.eventKey,f=v.props.context.keyEntities,h=f[E]||{},y=h.children;return!!(y||[]).length},v.isLeaf=function(){var E=v.props,f=E.isLeaf,h=E.loaded,y=v.props.context.loadData,g=v.hasChildren();return f===!1?!1:f||!y&&!g||y&&h&&!g},v.isDisabled=function(){var E=v.props.disabled,f=v.props.context.disabled;return!!(f||E)},v.isCheckable=function(){var E=v.props.checkable,f=v.props.context.checkable;return!f||E===!1?!1:f},v.syncLoadData=function(E){var f=E.expanded,h=E.loading,y=E.loaded,g=v.props.context,x=g.loadData,j=g.onNodeLoad;if(h)return;x&&f&&!v.isLeaf()&&(!v.hasChildren()&&!y&&j(Object(o.b)(v.props)))},v.renderSwitcher=function(){var E=v.props,f=E.expanded,h=E.switcherIcon,y=v.props.context,g=y.prefixCls,x=y.switcherIcon,j=h||x;if(v.isLeaf())return r.createElement("span",{className:_()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof j=="function"?j(Object(U.a)(Object(U.a)({},v.props),{},{isLeaf:!0})):j);var F=_()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(f?c:s));return r.createElement("span",{onClick:v.onExpand,className:F},typeof j=="function"?j(Object(U.a)(Object(U.a)({},v.props),{},{isLeaf:!1})):j)},v.renderCheckbox=function(){var E=v.props,f=E.checked,h=E.halfChecked,y=E.disableCheckbox,g=v.props.context.prefixCls,x=v.isDisabled(),j=v.isCheckable();if(!j)return null;var F=typeof j!="boolean"?j:null;return r.createElement("span",{className:_()("".concat(g,"-checkbox"),f&&"".concat(g,"-checkbox-checked"),!f&&h&&"".concat(g,"-checkbox-indeterminate"),(x||y)&&"".concat(g,"-checkbox-disabled")),onClick:v.onCheck},F)},v.renderIcon=function(){var E=v.props.loading,f=v.props.context.prefixCls;return r.createElement("span",{className:_()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(v.getNodeState()||"docu"),E&&"".concat(f,"-icon_loading"))})},v.renderSelector=function(){var E=v.state.dragNodeHighlight,f=v.props,h=f.title,y=f.selected,g=f.icon,x=f.loading,j=f.data,F=v.props.context,A=F.prefixCls,W=F.showIcon,H=F.icon,C=F.draggable,z=F.loadData,Z=F.titleRender,le=v.isDisabled(),se="".concat(A,"-node-content-wrapper"),Ce;if(W){var Ee=g||H;Ce=Ee?r.createElement("span",{className:_()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof Ee=="function"?Ee(v.props):Ee):v.renderIcon()}else z&&x&&(Ce=v.renderIcon());var Ie;typeof h=="function"?Ie=h(j):Z?Ie=Z(j):Ie=h;var Qe=r.createElement("span",{className:"".concat(A,"-title")},Ie);return r.createElement("span",{ref:v.setSelectHandle,title:typeof h=="string"?h:"",className:_()("".concat(se),"".concat(se,"-").concat(v.getNodeState()||"normal"),!le&&(y||E)&&"".concat(A,"-node-selected"),!le&&C&&"draggable"),draggable:!le&&C||void 0,"aria-grabbed":!le&&C||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:C?v.onDragStart:void 0},Ce,Qe)},v}return Object(M.a)(S,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var E=this.props.selectable,f=this.props.context.selectable;return typeof E=="boolean"?E:f}},{key:"render",value:function(){var E,f=this.props,h=f.eventKey,y=f.className,g=f.style,x=f.dragOver,j=f.dragOverGapTop,F=f.dragOverGapBottom,A=f.isLeaf,W=f.isStart,H=f.isEnd,C=f.expanded,z=f.selected,Z=f.checked,le=f.halfChecked,se=f.loading,Ce=f.domRef,Ee=f.active,Ie=f.onMouseMove,Qe=Object(Y.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Xe=this.props.context,_e=Xe.prefixCls,pe=Xe.filterTreeNode,at=Xe.draggable,Qt=Xe.keyEntities,Ft=this.isDisabled(),Tt=Object(m.f)(Qe),Ve=Qt[h]||{},pt=Ve.level,ut=H[H.length-1];return r.createElement("div",Object.assign({ref:Ce,className:_()(y,"".concat(_e,"-treenode"),(E={},Object(q.a)(E,"".concat(_e,"-treenode-disabled"),Ft),Object(q.a)(E,"".concat(_e,"-treenode-switcher-").concat(C?"open":"close"),!A),Object(q.a)(E,"".concat(_e,"-treenode-checkbox-checked"),Z),Object(q.a)(E,"".concat(_e,"-treenode-checkbox-indeterminate"),le),Object(q.a)(E,"".concat(_e,"-treenode-selected"),z),Object(q.a)(E,"".concat(_e,"-treenode-loading"),se),Object(q.a)(E,"".concat(_e,"-treenode-active"),Ee),Object(q.a)(E,"".concat(_e,"-treenode-leaf-last"),ut),Object(q.a)(E,"drag-over",!Ft&&x),Object(q.a)(E,"drag-over-gap-top",!Ft&&j),Object(q.a)(E,"drag-over-gap-bottom",!Ft&&F),Object(q.a)(E,"filter-node",pe&&pe(Object(o.b)(this.props))),E)),style:g,onDragEnter:at?this.onDragEnter:void 0,onDragOver:at?this.onDragOver:void 0,onDragLeave:at?this.onDragLeave:void 0,onDrop:at?this.onDrop:void 0,onDragEnd:at?this.onDragEnd:void 0,onMouseMove:Ie},Tt),r.createElement(a,{prefixCls:_e,level:pt,isStart:W,isEnd:H}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),S}(r.Component),O=function(R){return r.createElement(p.a.Consumer,null,function(S){return r.createElement(n,Object.assign({},R,{context:S}))})};O.displayName="TreeNode",O.defaultProps={title:i},O.isTreeNode=1;var T=fe.a=O},XpUO:function(Gt,fe,D){"use strict";var q=D("2qtc"),Y=D("kLXV"),U=D("sRBo"),G=D("kaz8"),M=D("jCWc"),k=D("kPKH"),K=D("iQDF"),I=D("+eQT"),r=D("giR+"),P=D("fyUT"),_=D("14J3"),p=D("BMrR"),m=D("7Kak"),u=D("9yH6"),a=D("miYZ"),o=D("tsqr"),c=D("jrin"),s=D("9og8"),i=D("k1fw"),n=D("oBTY"),O=D("y8nQ"),T=D("Vl3Y"),w=D("tJVT"),R=D("PpiC"),S=D("WmNS"),v=D.n(S),E=D("q1tI"),f=D.n(E),h=D("wd/R"),y=D.n(h),g=D("ErOA"),x=D("xKgJ"),j=D("1vsH"),F=D("Ty5D"),A=D("9kvl"),W=D("4wi7"),H=D("oUNq"),C=D("eozf"),z=function(le){var se,Ce,Ee,Ie,Qe,Xe,_e,pe,at,Qt,Ft,Tt,Ve,pt,ut,Ut,oe,Ue,ze,$e,Bt,Ht,qt,tt,nn,xn,Ge,He,vt,Ot,nt,xt,Ae,ve,we,ie,ae,me,be,ye=le.classroomList,Be=le.dispatch,St=le.courseEndTime,an=Object(R.a)(le,["classroomList","dispatch","courseEndTime"]),Dn=Object(F.i)(),yt=T.a.useForm(),en=Object(w.a)(yt,1),_t=en[0],Et=Object(E.useState)(1),st=Object(w.a)(Et,2),he=st[0],Le=st[1],Lt=Object(E.useState)([]),ct=Object(w.a)(Lt,2),tn=ct[0],un=ct[1],Pe=Object(E.useState)(0),et=Object(w.a)(Pe,2),jt=et[0],bn=et[1],Kt=Object(E.useState)(2e3),Xt=Object(w.a)(Kt,2),Yn=Xt[0],Bn=Xt[1],_n=Object(E.useState)(!0),br=Object(w.a)(_n,2),Fr=br[0],hr=br[1],Qn=Object(E.useState)(!1),Dr=Object(w.a)(Qn,2),Kr=Dr[0],ti=Dr[1],dn=Object(E.useState)(!1),rr=Object(w.a)(dn,2),fi=rr[0],wi=rr[1],ni=Object(E.useState)([]),ri=Object(w.a)(ni,2),X=ri[0],L=ri[1],N=Object(E.useState)(!0),V=Object(w.a)(N,2),ne=V[0],J=V[1],Fe=Object(E.useState)(!((se=ye.actionTabs)!==null&&se!==void 0&&(Ce=se.selectArrsAll)!==null&&Ce!==void 0&&(Ee=Ce[0])!==null&&Ee!==void 0&&Ee.send_type)),Jt=Object(w.a)(Fe,2),In=Jt[0],Zn=Jt[1],ln=Object(E.useState)([0,0,0]),ir=Object(w.a)(ln,2),tr=ir[0],Mr=ir[1];Object(E.useEffect)(function(){if(ye.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var Ar,Tr,ii,Br,Hn,yn;if((Ar=ye.actionTabs)!==null&&Ar!==void 0&&(Tr=Ar.selectArrsAll)!==null&&Tr!==void 0&&(ii=Tr[0])!==null&&ii!==void 0&&ii.can_publish){var sr,Q,de;Mr(Object(n.a)((sr=ye.actionTabs)===null||sr===void 0||((Q=sr.selectArrsAll)===null||Q===void 0||((de=Q[0])===null||de===void 0))?void 0:de.difficult_count))}else{var Sn,En,ur;Mr(Object(n.a)((Sn=ye.actionTabs)===null||Sn===void 0||((En=Sn.selectArrsAll)===null||En===void 0||((ur=En[0])===null||ur===void 0))?void 0:ur.difficult_settings))}if(Zn(!((Br=ye.actionTabs)!==null&&Br!==void 0&&(Hn=Br.selectArrsAll)!==null&&Hn!==void 0&&(yn=Hn[0])!==null&&yn!==void 0&&yn.send_type)),ui(),ye.actionTabs.type===2){var Te,Se=(Te=ye.actionTabs.selectArrsAll)===null||Te===void 0?void 0:Te[0];J(Se.unified_setting)}}},[ye.actionTabs]),Object(E.useEffect)(function(){if(Kr){if(fi)return;Be({type:"classroomList/setActionTabs",payload:{}}),Object(x.c)()?(Be({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},ye.actionTabs.params),{},{type:1})}),Be({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},Dn)})):Be({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},ye.actionTabs.params)})}},[Kr]);var ui=function(){var Ar=Object(s.a)(v.a.mark(function Tr(ii){var Br,Hn;return v.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return hr(!0),Sn.next=3,Object(H.D)(Object(i.a)(Object(i.a)({},Dn),{},{page:ii||he,limit:2e4,homework_id:ye.actionTabs.type===1?"":ye.actionTabs.selectArrs[0]}));case 3:Br=Sn.sent,Br==null||Br.course_groups.map(function(En,ur){En.key=En.id,En.title=En.name,En.disabled=En.is_published}),Br&&(un(Object(n.a)(Br==null?void 0:Br.course_groups)),bn(Br==null?void 0:Br.course_groups_count),hr(!1),ii||_t.setFieldsValue((Hn={},Object(c.a)(Hn,"publish_time",y()(y()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(c.a)(Hn,"end_time",y()(y()(new Date(Object(j.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),Hn)));case 6:case"end":return Sn.stop()}},Tr)}));return function(ii){return Ar.apply(this,arguments)}}(),oi=function(){Object(x.c)()?ye.actionTabs.detail?(Be({type:"shixunHomeworks/setActionTabs",payload:{}}),Be({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},Dn)}),Be({type:"shixunHomeworks/getWorkSetting",payload:Object(i.a)({},Dn)})):Be({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},ye.actionTabs.params),{},{type:5})}):Be({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},ye.actionTabs.params)})},Gr=function(){var Ar=Object(s.a)(v.a.mark(function Tr(){var ii,Br,Hn,yn;return v.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(Br=Object(i.a)({},_t.getFieldsValue()),!(Br.end_time<=Br.publish_time)){En.next=4;break}return o.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),En.abrupt("return");case 4:if(!((X==null?void 0:X.length)<=0&&!ne&&tn.length>0)){En.next=7;break}return o.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),En.abrupt("return");case 7:if(!(tr.reduce(function(ur,sr){return ur+sr})===0&&!In)){En.next=10;break}return o.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),En.abrupt("return");case 10:return Hn={homework_ids:Object(n.a)(ye.actionTabs.selectArrs),group_ids:X.length>0?X.map(function(ur){return ur.id}):(ii=ye.detailCommonHomeworksList)===null||ii===void 0?void 0:ii.course_groups,end_time:y()(Br.end_time).format("YYYY-MM-DD HH:mm"),publish_time:y()(Br.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:tr==null?void 0:tr.map(function(ur){return ur}),send_type:In?"0":"1",unified_setting:!X.length},En.next=13,Object(g.a)("/api/courses/".concat(Dn.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(i.a)({},Hn)});case 13:yn=En.sent,yn.status===0&&(Object(j.eb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),o.b.success("\u53D1\u5E03\u6210\u529F"),Be({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),an.onCallback&&an.onCallback(),oi(),localStorage.getItem("Noviceguide")==="0"||Be({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:f.a.createElement("div",null,"\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~")}}));case 15:case"end":return En.stop()}},Tr)}));return function(){return Ar.apply(this,arguments)}}(),Li=function(){Le(1),un([]),L([])},Vi=jt>he*Yn;return f.a.createElement(Y.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:ye.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:Gr,onCancel:function(){Li(),oi(),Be({type:"classroomList/setActionTabs",payload:{}})}},f.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",f.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),tn&&f.a.createElement(T.a,{form:_t},f.a.createElement("div",{style:{paddingLeft:0}},ye.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),f.a.createElement(u.a.Group,{value:In,disabled:!((Ie=ye.actionTabs)!==null&&Ie!==void 0&&(Qe=Ie.selectArrsAll)!==null&&Qe!==void 0&&(Xe=Qe[0])!==null&&Xe!==void 0&&Xe.can_publish),onChange:function(Tr){Zn(Tr.target.value)}},f.a.createElement(u.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),f.a.createElement(u.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!In&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{style:{marginRight:65}}),f.a.createElement("span",null,"\u7B80\u5355\u9898\u6570"," ",f.a.createElement(P.a,{value:tr[0],onChange:function(Tr){tr[0]=Tr,Mr(Object(n.a)(tr))},min:0,disabled:!((_e=ye.actionTabs)!==null&&_e!==void 0&&(pe=_e.selectArrsAll)!==null&&pe!==void 0&&(at=pe[0])!==null&&at!==void 0&&at.can_publish),placeholder:"\u6700\u5927".concat((Qt=ye.actionTabs)===null||Qt===void 0||((Ft=Qt.selectArrsAll)===null||Ft===void 0||((Tt=Ft[0])===null||Tt===void 0||((Ve=Tt.difficult_count)===null||Ve===void 0)))?void 0:Ve[0]),max:(pt=ye.actionTabs)===null||pt===void 0||((ut=pt.selectArrsAll)===null||ut===void 0||((Ut=ut[0])===null||Ut===void 0||((oe=Ut.difficult_count)===null||oe===void 0)))?void 0:oe[0],style:{width:60}})),f.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570"," ",f.a.createElement(P.a,{value:tr[1],onChange:function(Tr){tr[1]=Tr,Mr(Object(n.a)(tr))},min:0,disabled:!((Ue=ye.actionTabs)!==null&&Ue!==void 0&&(ze=Ue.selectArrsAll)!==null&&ze!==void 0&&($e=ze[0])!==null&&$e!==void 0&&$e.can_publish),max:(Bt=ye.actionTabs)===null||Bt===void 0||((Ht=Bt.selectArrsAll)===null||Ht===void 0||((qt=Ht[0])===null||qt===void 0||((tt=qt.difficult_count)===null||tt===void 0)))?void 0:tt[1],placeholder:"\u6700\u5927".concat((nn=ye.actionTabs)===null||nn===void 0||((xn=nn.selectArrsAll)===null||xn===void 0||((Ge=xn[0])===null||Ge===void 0||((He=Ge.difficult_count)===null||He===void 0)))?void 0:He[1]),style:{width:60}})),f.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570"," ",f.a.createElement(P.a,{value:tr[2],onChange:function(Tr){tr[2]=Tr,Mr(Object(n.a)(tr))},min:0,disabled:!((vt=ye.actionTabs)!==null&&vt!==void 0&&(Ot=vt.selectArrsAll)!==null&&Ot!==void 0&&(nt=Ot[0])!==null&&nt!==void 0&&nt.can_publish),placeholder:"\u6700\u5927".concat((xt=ye.actionTabs)===null||xt===void 0||((Ae=xt.selectArrsAll)===null||Ae===void 0||((ve=Ae[0])===null||ve===void 0||((we=ve.difficult_count)===null||we===void 0)))?void 0:we[2]),max:(ie=ye.actionTabs)===null||ie===void 0||((ae=ie.selectArrsAll)===null||ae===void 0||((me=ae[0])===null||me===void 0||((be=me.difficult_count)===null||be===void 0)))?void 0:be[2],style:{width:60}}))),f.a.createElement(p.a,{className:"mt30",align:"middle"},f.a.createElement(k.a,null,f.a.createElement(T.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},f.a.createElement(I.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(Tr){return Tr.parentNode},disabledDate:function(Tr){return Object(C.b)(Tr,St)},disabledTime:function(Tr){return Object(C.c)(Tr)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:y()(Object(j.f)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),f.a.createElement(k.a,{className:"ml20"},f.a.createElement(T.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},f.a.createElement(I.a,{style:{width:170},getPopupContainer:function(Tr){return Tr.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:y()(Object(j.f)(),"HH:mm")},disabledDate:function(Tr){return Object(C.b)(Tr,St,_t.getFieldValue("publish_time"))},disabledTime:function(Tr){return Object(C.c)(Tr,_t.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),ye.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),f.a.createElement(u.a.Group,{value:ne,onChange:function(Tr){J(Tr.target.value),L([])}},f.a.createElement(u.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),f.a.createElement(u.a,{className:"ml20",disabled:tn.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),tn.length<=0&&ye.actionTabs.type===2&&f.a.createElement("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},'\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03"')),(ye.actionTabs.type===1||!ne)&&tn.length>0&&f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},f.a.createElement("span",{style:{flex:1}},f.a.createElement(G.a,{checked:X.length===tn.length,onChange:function(Tr){X.length===tn.length?L([]):L(tn.filter(function(ii){return!ii.is_published}))}},"\u5168\u9009")," "),f.a.createElement("span",{style:{width:16}}),f.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",X.length||0,"\u4E2A\u5206\u73ED")),(ye.actionTabs.type===1||!ne)&&tn.length>0&&f.a.createElement(W.a,{data:tn,selectedRowKeys:X,setSelectedRowKeys:L})))};fe.a=Object(A.a)(function(Z){var le=Z.classroomList;return{classroomList:le}})(z)},Y1PL:function(Gt,fe,D){"use strict";D.r(fe),D.d(fe,"ResizableTextArea",function(){return le});var q=D("wx14"),Y=D("1OyB"),U=D("vuIU"),G=D("Ji7U"),M=D("LK+K"),k=D("q1tI"),K=D("VTBJ"),I=D("rePB"),r=D("Zm9Q"),P=D("Kwbf"),_=D("c+Xe"),p=D("m+aA"),m=D("bdgK"),u=new Map;function a(Ee){Ee.forEach(function(Ie){var Qe,Xe=Ie.target;(Qe=u.get(Xe))===null||Qe===void 0||Qe.forEach(function(_e){return _e(Xe)})})}var o=new m.default(a),c=null,s=null;function i(Ee,Ie){u.has(Ee)||(u.set(Ee,new Set),o.observe(Ee)),u.get(Ee).add(Ie)}function n(Ee,Ie){u.has(Ee)&&(u.get(Ee).delete(Ie),u.get(Ee).size||(o.unobserve(Ee),u.delete(Ee)))}var O=function(Ee){Object(G.a)(Qe,Ee);var Ie=Object(M.a)(Qe);function Qe(){return Object(Y.a)(this,Qe),Ie.apply(this,arguments)}return Object(U.a)(Qe,[{key:"render",value:function(){return this.props.children}}]),Qe}(k.Component),T=k.createContext(null);function w(Ee){var Ie=Ee.children,Qe=Ee.onBatchResize,Xe=k.useRef(0),_e=k.useRef([]),pe=k.useContext(T),at=k.useCallback(function(Qt,Ft,Tt){Xe.current+=1;var Ve=Xe.current;_e.current.push({size:Qt,element:Ft,data:Tt}),Promise.resolve().then(function(){Ve===Xe.current&&(Qe==null||Qe(_e.current),_e.current=[])}),pe==null||pe(Qt,Ft,Tt)},[Qe,pe]);return k.createElement(T.Provider,{value:at},Ie)}function R(Ee){var Ie=Ee.children,Qe=Ee.disabled,Xe=k.useRef(null),_e=k.useRef(null),pe=k.useContext(T),at=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Qt=k.isValidElement(Ie)&&Object(_.c)(Ie),Ft=Qt?Ie.ref:null,Tt=k.useMemo(function(){return Object(_.a)(Ft,Xe)},[Ft,Xe]),Ve=k.useRef(Ee);Ve.current=Ee;var pt=k.useCallback(function(ut){var Ut=Ve.current,oe=Ut.onResize,Ue=Ut.data,ze=ut.getBoundingClientRect(),$e=ze.width,Bt=ze.height,Ht=ut.offsetWidth,qt=ut.offsetHeight,tt=Math.floor($e),nn=Math.floor(Bt);if(at.current.width!==tt||at.current.height!==nn||at.current.offsetWidth!==Ht||at.current.offsetHeight!==qt){var xn={width:tt,height:nn,offsetWidth:Ht,offsetHeight:qt};at.current=xn;var Ge=Ht===Math.round($e)?$e:Ht,He=qt===Math.round(Bt)?Bt:qt,vt=Object(K.a)(Object(K.a)({},xn),{},{offsetWidth:Ge,offsetHeight:He});pe==null||pe(vt,ut,Ue),oe&&Promise.resolve().then(function(){oe(vt,ut)})}},[]);return k.useEffect(function(){var ut=Object(p.a)(Xe.current)||Object(p.a)(_e.current);return ut&&!Qe&&i(ut,pt),function(){return n(ut,pt)}},[Xe.current,Qe]),k.createElement(O,{ref:_e},Qt?k.cloneElement(Ie,{ref:Tt}):Ie)}var S="rc-observer-key";function v(Ee){var Ie=Ee.children,Qe=Object(r.a)(Ie);return Qe.map(function(Xe,_e){var pe=(Xe==null?void 0:Xe.key)||"".concat(S,"-").concat(_e);return k.createElement(R,Object(q.a)({},Ee,{key:pe}),Xe)})}v.Collection=w;var E=v,f=D("bT9E"),h=D("TSYQ"),y=D.n(h),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
|
|
`,x=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],j={},F;function A(Ee){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Qe=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(Ie&&j[Qe])return j[Qe];var Xe=window.getComputedStyle(Ee),_e=Xe.getPropertyValue("box-sizing")||Xe.getPropertyValue("-moz-box-sizing")||Xe.getPropertyValue("-webkit-box-sizing"),pe=parseFloat(Xe.getPropertyValue("padding-bottom"))+parseFloat(Xe.getPropertyValue("padding-top")),at=parseFloat(Xe.getPropertyValue("border-bottom-width"))+parseFloat(Xe.getPropertyValue("border-top-width")),Qt=x.map(function(Tt){return"".concat(Tt,":").concat(Xe.getPropertyValue(Tt))}).join(";"),Ft={sizingStyle:Qt,paddingSize:pe,borderSize:at,boxSizing:_e};return Ie&&Qe&&(j[Qe]=Ft),Ft}function W(Ee){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),Ee.getAttribute("wrap")?F.setAttribute("wrap",Ee.getAttribute("wrap")):F.removeAttribute("wrap");var _e=A(Ee,Ie),pe=_e.paddingSize,at=_e.borderSize,Qt=_e.boxSizing,Ft=_e.sizingStyle;F.setAttribute("style","".concat(Ft,";").concat(g)),F.value=Ee.value||Ee.placeholder||"";var Tt=Number.MIN_SAFE_INTEGER,Ve=Number.MAX_SAFE_INTEGER,pt=F.scrollHeight,ut;if(Qt==="border-box"?pt+=at:Qt==="content-box"&&(pt-=pe),Qe!==null||Xe!==null){F.value=" ";var Ut=F.scrollHeight-pe;Qe!==null&&(Tt=Ut*Qe,Qt==="border-box"&&(Tt=Tt+pe+at),pt=Math.max(Tt,pt)),Xe!==null&&(Ve=Ut*Xe,Qt==="border-box"&&(Ve=Ve+pe+at),ut=pt>Ve?"":"hidden",pt=Math.min(Ve,pt))}return{height:pt,minHeight:Tt,maxHeight:Ve,overflowY:ut,resize:"none"}}var H=D("Gytx"),C=D.n(H),z;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(z||(z={}));var Z=function(Ee){Object(G.a)(Qe,Ee);var Ie=Object(M.a)(Qe);function Qe(Xe){var _e;return Object(Y.a)(this,Qe),_e=Ie.call(this,Xe),_e.nextFrameActionId=void 0,_e.resizeFrameId=void 0,_e.textArea=void 0,_e.saveTextArea=function(pe){_e.textArea=pe},_e.handleResize=function(pe){var at=_e.state.resizeStatus,Qt=_e.props,Ft=Qt.autoSize,Tt=Qt.onResize;if(at!==z.NONE)return;typeof Tt=="function"&&Tt(pe),Ft&&_e.resizeOnNextFrame()},_e.resizeOnNextFrame=function(){cancelAnimationFrame(_e.nextFrameActionId),_e.nextFrameActionId=requestAnimationFrame(_e.resizeTextarea)},_e.resizeTextarea=function(){var pe=_e.props.autoSize;if(!pe||!_e.textArea)return;var at=pe.minRows,Qt=pe.maxRows,Ft=W(_e.textArea,!1,at,Qt);_e.setState({textareaStyles:Ft,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(_e.resizeFrameId),_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:z.RESIZED},function(){_e.resizeFrameId=requestAnimationFrame(function(){_e.setState({resizeStatus:z.NONE}),_e.fixFirefoxAutoScroll()})})})})},_e.renderTextArea=function(){var pe=_e.props,at=pe.prefixCls,Qt=at===void 0?"rc-textarea":at,Ft=pe.autoSize,Tt=pe.onResize,Ve=pe.className,pt=pe.disabled,ut=_e.state,Ut=ut.textareaStyles,oe=ut.resizeStatus,Ue=Object(f.a)(_e.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ze=y()(Qt,Ve,Object(I.a)({},"".concat(Qt,"-disabled"),pt));"value"in Ue&&(Ue.value=Ue.value||"");var $e=Object(K.a)(Object(K.a)(Object(K.a)({},_e.props.style),Ut),oe===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(E,{onResize:_e.handleResize,disabled:!(Ft||Tt)},k.createElement("textarea",Object(q.a)({},Ue,{className:ze,style:$e,ref:_e.saveTextArea})))},_e.state={textareaStyles:{},resizeStatus:z.NONE},_e}return Object(U.a)(Qe,[{key:"componentDidUpdate",value:function(_e){(_e.value!==this.props.value||!C()(_e.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 _e=this.textArea.selectionStart,pe=this.textArea.selectionEnd;this.textArea.setSelectionRange(_e,pe)}}catch(at){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Qe}(k.Component),le=Z,se=function(Ee){Object(G.a)(Qe,Ee);var Ie=Object(M.a)(Qe);function Qe(Xe){var _e;Object(Y.a)(this,Qe),_e=Ie.call(this,Xe),_e.resizableTextArea=void 0,_e.focus=function(){_e.resizableTextArea.textArea.focus()},_e.saveTextArea=function(at){_e.resizableTextArea=at},_e.handleChange=function(at){var Qt=_e.props.onChange;_e.setValue(at.target.value,function(){_e.resizableTextArea.resizeTextarea()}),Qt&&Qt(at)},_e.handleKeyDown=function(at){var Qt=_e.props,Ft=Qt.onPressEnter,Tt=Qt.onKeyDown;at.keyCode===13&&Ft&&Ft(at),Tt&&Tt(at)};var pe=typeof Xe.value=="undefined"||Xe.value===null?Xe.defaultValue:Xe.value;return _e.state={value:pe},_e}return Object(U.a)(Qe,[{key:"setValue",value:function(_e,pe){"value"in this.props||this.setState({value:_e},pe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return k.createElement(le,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(_e){return"value"in _e?{value:_e.value}:null}}]),Qe}(k.Component),Ce=fe.default=se},ZW9T:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return H});var q=D("k1fw"),Y=D("oBTY"),U=D("miYZ"),G=D("tsqr"),M=D("rAM+"),k=D("tJVT"),K=D("PpiC"),I=D("q1tI"),r=D.n(I),P=D("bdgK"),_=D("9og8"),p=D("WmNS"),m=D.n(p),u={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"]},a={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"]},o={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},c={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(`
|
|
`)}]},s=D("5VLF"),i=D.n(s),n={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(z,Z){return Z.map(function(le){return{label:le,kind:z.languages.CompletionItemKind.Keyword,insertText:le}})},T=function(z){return Object.keys(n.tables).map(function(Z){return{label:Z,kind:z.languages.CompletionItemKind.Variable,insertText:Z}})},w=function(z,Z){var le=n.tables[z];return le?le.map(function(se){return{label:se,kind:Z.languages.CompletionItemKind.Field,insertText:se}}):[]};function R(C,z,Z,le,se){var Ce=z.getWordUntilPosition(Z),Ee={startLineNumber:Z.lineNumber,endLineNumber:Z.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},Ie=le.map(function(Qe){return{label:Qe,kind:C.languages.CompletionItemKind.Keyword,insertText:Qe,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return se.map(function(Qe){Ie.push(Object(q.a)(Object(q.a)({},Qe),{},{range:Ee}))}),Ie}var S=function(C){n.languages.map(function(se){return C.languages.registerDocumentFormattingEditProvider(se,{provideDocumentFormattingEdits:function(Ee,Ie,Qe){return Object(_.a)(m.a.mark(function Xe(){var _e;return m.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return _e=i()(Ee.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),at.abrupt("return",[{range:Ee.getFullModelRange(),text:_e}]);case 2:case"end":return at.stop()}},Xe)}))()}}),se});var z=o.quickKey.map(function(se){return{label:se.label,kind:C.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=c.quickKey.map(function(se){return{label:se.label,kind:C.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),le=a.quickKey.map(function(se){return{label:se.label,kind:C.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}});C.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ce,Ee){var Ie=Ce.getWordUntilPosition(Ee),Qe={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn},Xe=Ce.getLineContent(Ee.lineNumber).substring(Ie.startColumn-2,Ie.endColumn);return{suggestions:[].concat(Object(Y.a)(o.keywords.map(function(_e){return{label:_e,kind:C.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})),Object(Y.a)(o.quickKey.map(function(_e){return{label:_e.label,kind:C.languages.CompletionItemKind.Function,documentation:_e.content,insertText:Xe.startsWith("#")?_e.content.replace(/#/,""):_e.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})))}}}),C.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ce,Ee){var Ie=Ce.getWordUntilPosition(Ee),Qe={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn};return{suggestions:Object(Y.a)(u.keywords.map(function(Xe){return{label:Xe,kind:C.languages.CompletionItemKind.Function,documentation:Xe,insertText:Xe,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}}))}}}),C.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ce,Ee){var Ie=Ce.getWordUntilPosition(Ee),Qe={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn},Xe=Ce.getLineContent(Ee.lineNumber).substring(Ie.startColumn-2,Ie.endColumn);return{suggestions:[].concat(Object(Y.a)(a.keywords.map(function(_e){return{label:_e,kind:C.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})),Object(Y.a)(a.quickKey.map(function(_e){return{label:_e.label,kind:C.languages.CompletionItemKind.Function,documentation:_e.content,insertText:Xe.startsWith("#")?_e.content.replace(/#/,""):_e.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})))}}}),C.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ce,Ee){var Ie=Ce.getWordUntilPosition(Ee),Qe={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn},Xe=Ce.getLineContent(Ee.lineNumber).substring(Ie.startColumn-2,Ie.endColumn);return{suggestions:[].concat(Object(Y.a)(c.keywords.map(function(_e){return{label:_e,kind:C.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})),Object(Y.a)(c.quickKey.map(function(_e){return{label:_e.label,kind:C.languages.CompletionItemKind.Function,documentation:_e.content,insertText:Xe.startsWith("#")?_e.content.replace(/#/,""):_e.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=D("fjLI"),f=D("LvDl"),h=D("+ua5");function y(C){return/^\d+$/.test(C)?"".concat(C,"px"):C}function g(){}var x=!1,j={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function F(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],z=C;if(Array.isArray(C)){for(var Z=0;Z<C.length;Z++){var le=j[C[Z]];if(le)return le}return z[0]}return j[z]||z}var A=null,W=fe.b=function(C){var z=C.width,Z=z===void 0?"100%":z,le=C.height,se=le===void 0?"100%":le,Ce=C.value,Ee=C.language,Ie=Ee===void 0?"javascript":Ee,Qe=C.style,Xe=Qe===void 0?{}:Qe,_e=C.options,pe=_e===void 0?{}:_e,at=C.overrideServices,Qt=at===void 0?{}:at,Ft=C.theme,Tt=Ft===void 0?"vs-dark":Ft,Ve=C.onEditBlur,pt=C.onSave,ut=C.autoHeight,Ut=ut===void 0?!1:ut,oe=C.forbidCopy,Ue=oe===void 0?!1:oe,ze=C.onChange,$e=ze===void 0?g:ze,Bt=C.editorDidMount,Ht=Bt===void 0?g:Bt,qt=C.onFocus,tt=qt===void 0?g:qt,nn=C.filename,xn=nn===void 0?"educoder.txt":nn,Ge=C.errorLine,He=C.errorContent,vt=He===void 0?"":He,Ot=C.customTheme,nt=Ot===void 0?null:Ot,xt=Object(K.a)(C,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent","customTheme"]),Ae=Object(I.useRef)(),ve=Object(I.useRef)({}),we=Object(I.useRef)(),ie=Object(I.useRef)(),ae=Object(I.useRef)(!1),me=Object(I.useRef)(),be=Object(I.useState)(!1),ye=Object(k.a)(be,2),Be=ye[0],St=ye[1];function an(){var Kt;return Ae.current&&(Kt=new P.default(function(Xt){var Yn=Object(M.a)(Xt),Bn;try{for(Yn.s();!(Bn=Yn.n()).done;){var _n=Bn.value;(_n.target.offsetHeight>0||_n.target.offsetWidth>0)&&ve.current.instance.layout()}}catch(br){Yn.e(br)}finally{Yn.f()}}),Kt.observe(Ae.current)),Kt}function Dn(){G.b.warn(decodeURIComponent(v))}var yt=function(){var Xt=ve.current.instance;if(Ce!=null&&Xt&&Be){var Yn=Xt.getModel();Yn&&Ce!==Yn.getValue()&&(x=!0,Yn.setValue(Ce),Xt.layout(),x=!1)}};Object(I.useEffect)(function(){ie.current&&clearTimeout(ie.current),ie.current=setTimeout(function(){yt()},500)},[Ce,Be,ve.current]),Object(I.useEffect)(function(){if(Ge&&ve.current&&ve.current.instance){var Kt=ve.current.instance;Kt.changeViewZones(function(Yn){var Bn=document.createElement("div");Bn.style.padding="10px 20px",Bn.style.width="calc(100% - 20px)",Bn.className="my-error-line-wrp",Bn.innerHTML=vt,Yn.addZone({afterLineNumber:Ge||11,heightInLines:3,domNode:Bn})});var Xt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Kt.addOverlayWidget(Xt),Kt.revealPositionInCenter({lineNumber:20,column:1})}},[Ge,ve.current,Be]);function en(){var Kt=ve.current.instance;if(Kt){var Xt=Kt.getSelection(),Yn=ve.current.pastePos||{},Bn=new A.Range(Yn.startLineNumber||Xt.endLineNumber,Yn.startColumn||Xt.endColumn,Yn.endLineNumber||Xt.endLineNumber,Yn.endColumn||Xt.endColumn);setTimeout(function(){Kt.executeEdits("",[{range:Bn,text:""}])},300)}}function _t(Kt){(window.navigator.platform.match("Mac")?Kt.metaKey:Kt.ctrlKey)&&Kt.keyCode==83&&(Kt.preventDefault(),pt())}var Et=function(){if(Ut&&ve.current.instance){var Xt=ve.current.instance.getContentHeight();jt(Xt<se?se:Xt)}else jt(se)};function st(Kt){var Xt=document.createEvent("MouseEvents");Xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Kt.dispatchEvent(Xt)}function he(Kt,Xt){var Yn=window.URL||window.webkitURL||window,Bn=new Blob([Xt]),_n=document.createElementNS("http://www.w3.org/1999/xhtml","a");_n.href=Yn.createObjectURL(Bn),_n.download=Kt,st(_n)}Object(I.useEffect)(function(){Et()},[Et]),Object(I.useEffect)(function(){Ae.current&&!Be&&Promise.all([D.e(16),D.e(29)]).then(D.t.bind(null,"M/lh",7)).then(function(Kt){try{A=Kt,ve.current.instance=A.editor.create(Ae.current,{value:Ce,language:F(Ie),theme:Tt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Qt);var Xt=ve.current.instance,Yn=E.d._menuItems,Bn=Object(Y.a)(Yn).find(function(Qn){return Qn[0]._debugName=="EditorContext"}),_n=Bn[1],br=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Fr=function(Dr,Kr){var ti=Dr._first;do{var dn,rr,fi=Kr.includes((dn=ti.element)===null||dn===void 0||((rr=dn.command)===null||rr===void 0)?void 0:rr.id);fi&&Dr._remove(ti)}while(ti=ti.next)};if(Ht(Xt,A),setTimeout(function(){Et(),ve.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){he(xn||"educoder.txt",Xt.getValue())}}),Xt.getDomNode().addEventListener("input",function(){we.current.autoFormat&&Xt.getAction("editor.action.formatDocument").run()})},500),ve.current.subscription=Xt.onDidChangeModelContent(function(Qn){ae.current?clearTimeout(me.current):(Et(),$e(Xt.getValue(),Qn)),me.current=setTimeout(function(){ae.current=!1},500)}),window.Monaco||S(A,F(Ie)),Ue&&(Fr(_n,br),Ae.current.classList.add("noCopyPaste"),Xt.onKeyDown(function(Qn){var Dr=Qn.keyCode,Kr=Qn.ctrlKey,ti=Qn.metaKey;(Dr===33||Dr===52)&&(ti||Kr)&&(Dn(),Qn.preventDefault())})),window.Monaco=A,Ve&&Xt.onDidBlurEditorWidget(function(){Ve(Xt.getValue())}),tt&&Xt.onDidFocusEditorText(function(){tt(Xt.getValue())}),Ue){Xt.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Dn(),null}),Xt.onDidPaste(function(Qn){ve.current.pastePos=Qn});try{window.addEventListener("paste",en)}catch(Qn){}}var hr=an();return St(!0),function(){var Qn=ve.current.instance;Qn.dispose();var Dr=Qn.getModel();Dr&&Dr.dispose(),ve.current.subscription&&ve.current.subscription.dispose(),Ue&&window.removeEventListener("paste",en),hr.unobserve(Ae.current)}}catch(Qn){}})},[]),Object(I.useEffect)(function(){var Kt=ve.current.instance;if(Kt&&Be)return document.addEventListener("keydown",_t,!1),function(){document.removeEventListener("keydown",_t)}},[pt,Be]),Object(I.useEffect)(function(){var Kt=ve.current.instance;if(Kt&&Be){var Xt=F(Ie);A.editor.setModelLanguage(Kt.getModel(),Xt),console.log("language:",Ie,Kt.getModel(),Xt)}},[Ie,Be]),Object(I.useEffect)(function(){var Kt=ve.current.instance;Kt&&Be&&(nt?(A.editor.defineTheme("customTheme",nt),A.editor.setTheme("customTheme")):A.editor.setTheme(Tt))},[Tt,Be,nt]),Object(I.useEffect)(function(){var Kt=ve.current.instance;we.current=pe,Kt&&Be&&(Kt.updateOptions(Object(q.a)({},pe)),setTimeout(function(){Kt.getModel().updateOptions(Object(q.a)({},pe))},200))},[JSON.stringify(pe),Be]),Object(I.useEffect)(function(){var Kt=ve.current.instance;Kt&&Be&&Kt.layout()},[Z,se,Be]);var Le=Object(I.useState)(y(Z)),Lt=Object(k.a)(Le,2),ct=Lt[0],tn=Lt[1],un=Object(I.useState)(y(se)),Pe=Object(k.a)(un,2),et=Pe[0],jt=Pe[1],bn=Object(q.a)(Object(q.a)({},Xe),{},{width:ct,height:et});return r.a.createElement("div",{className:"my-monaco-editor",ref:Ae,style:bn})};function H(C){var z=C.width,Z=z===void 0?"100%":z,le=C.height,se=le===void 0?"100%":le,Ce=C.original,Ee=C.modified,Ie=C.language,Qe=C.options,Xe=Qe===void 0?{}:Qe,_e=Object(I.useRef)(),pe=Object(I.useState)(null),at=Object(k.a)(pe,2),Qt=at[0],Ft=at[1];function Tt(Ut){var oe;return _e.current&&(oe=new P.default(function(Ue){var ze=Object(M.a)(Ue),$e;try{for(ze.s();!($e=ze.n()).done;){var Bt=$e.value;(Bt.target.offsetHeight>0||Bt.target.offsetWidth>0)&&Ut.layout()}}catch(Ht){ze.e(Ht)}finally{ze.f()}}),oe.observe(_e.current)),oe}Object(I.useEffect)(function(){_e.current&&Promise.all([D.e(16),D.e(29)]).then(D.t.bind(null,"M/lh",7)).then(function(Ut){A=Ut;var oe=A.editor.createDiffEditor(_e.current,Object(q.a)(Object(q.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},Xe),{},{wordWrap:!0}));Ft(oe);var Ue=Tt(oe);return function(){oe.dispose();var ze=oe.getModel();ze&&ze.dispose(),Ue.unobserve(_e.current)}})},[]),Object(I.useEffect)(function(){Qt&&Qt.setModel({original:A.editor.createModel(Ce,Ie),modified:A.editor.createModel(Ee,Ie)})},[Ce,Ee,Ie,Qt]);var Ve=y(Z),pt=y(se),ut={width:Ve,height:pt};return r.a.createElement("div",{className:"my-diff-editor",ref:_e,style:ut})}},ZpRC:function(Gt,fe,D){"use strict";function q(_){return typeof _=="object"&&_!=null&&_.nodeType===1}function Y(_,p){return(!p||_!=="hidden")&&_!=="visible"&&_!=="clip"}function U(_,p){if(_.clientHeight<_.scrollHeight||_.clientWidth<_.scrollWidth){var m=getComputedStyle(_,null);return Y(m.overflowY,p)||Y(m.overflowX,p)||function(u){var a=function(o){if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch(c){return null}}(u);return!!a&&(a.clientHeight<u.scrollHeight||a.clientWidth<u.scrollWidth)}(_)}return!1}function G(_,p,m,u,a,o,c,s){return o<_&&c>p||o>_&&c<p?0:o<=_&&s<=m||c>=p&&s>=m?o-_-u:c>p&&s<m||o<_&&s>m?c-p+a:0}var M=function(_,p){var m=window,u=p.scrollMode,a=p.block,o=p.inline,c=p.boundary,s=p.skipOverflowHiddenElements,i=typeof c=="function"?c:function(Ut){return Ut!==c};if(!q(_))throw new TypeError("Invalid target");for(var n=document.scrollingElement||document.documentElement,O=[],T=_;q(T)&&i(T);){if((T=T.parentElement)===n){O.push(T);break}T!=null&&T===document.body&&U(T)&&!U(document.documentElement)||T!=null&&U(T,s)&&O.push(T)}for(var w=m.visualViewport?m.visualViewport.width:innerWidth,R=m.visualViewport?m.visualViewport.height:innerHeight,S=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,E=_.getBoundingClientRect(),f=E.height,h=E.width,y=E.top,g=E.right,x=E.bottom,j=E.left,F=a==="start"||a==="nearest"?y:a==="end"?x:y+f/2,A=o==="center"?j+h/2:o==="end"?g:j,W=[],H=0;H<O.length;H++){var C=O[H],z=C.getBoundingClientRect(),Z=z.height,le=z.width,se=z.top,Ce=z.right,Ee=z.bottom,Ie=z.left;if(u==="if-needed"&&y>=0&&j>=0&&x<=R&&g<=w&&y>=se&&x<=Ee&&j>=Ie&&g<=Ce)return W;var Qe=getComputedStyle(C),Xe=parseInt(Qe.borderLeftWidth,10),_e=parseInt(Qe.borderTopWidth,10),pe=parseInt(Qe.borderRightWidth,10),at=parseInt(Qe.borderBottomWidth,10),Qt=0,Ft=0,Tt="offsetWidth"in C?C.offsetWidth-C.clientWidth-Xe-pe:0,Ve="offsetHeight"in C?C.offsetHeight-C.clientHeight-_e-at:0;if(n===C)Qt=a==="start"?F:a==="end"?F-R:a==="nearest"?G(v,v+R,R,_e,at,v+F,v+F+f,f):F-R/2,Ft=o==="start"?A:o==="center"?A-w/2:o==="end"?A-w:G(S,S+w,w,Xe,pe,S+A,S+A+h,h),Qt=Math.max(0,Qt+v),Ft=Math.max(0,Ft+S);else{Qt=a==="start"?F-se-_e:a==="end"?F-Ee+at+Ve:a==="nearest"?G(se,Ee,Z,_e,at+Ve,F,F+f,f):F-(se+Z/2)+Ve/2,Ft=o==="start"?A-Ie-Xe:o==="center"?A-(Ie+le/2)+Tt/2:o==="end"?A-Ce+pe+Tt:G(Ie,Ce,le,Xe,pe+Tt,A,A+h,h);var pt=C.scrollLeft,ut=C.scrollTop;F+=ut-(Qt=Math.max(0,Math.min(ut+Qt,C.scrollHeight-Z+Ve))),A+=pt-(Ft=Math.max(0,Math.min(pt+Ft,C.scrollWidth-le+Tt)))}W.push({el:C,top:Qt,left:Ft})}return W};function k(_){return _===Object(_)&&Object.keys(_).length!==0}function K(_,p){p===void 0&&(p="auto");var m="scrollBehavior"in document.body.style;_.forEach(function(u){var a=u.el,o=u.top,c=u.left;a.scroll&&m?a.scroll({top:o,left:c,behavior:p}):(a.scrollTop=o,a.scrollLeft=c)})}function I(_){return _===!1?{block:"end",inline:"nearest"}:k(_)?_:{block:"start",inline:"nearest"}}function r(_,p){var m=!_.ownerDocument.documentElement.contains(_);if(k(p)&&typeof p.behavior=="function")return p.behavior(m?[]:M(_,p));if(m)return;var u=I(p);return K(M(_,u),u.behavior)}var P=fe.a=r},bT9E:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return Y});var q=D("VTBJ");function Y(U,G){var M=Object(q.a)({},U);return Array.isArray(G)&&G.forEach(function(k){delete M[k]}),M}},bTeP:function(Gt,fe,D){Gt.exports={flex_box_center:"flex_box_center___14Ki3",flex_space_between:"flex_space_between___3TSad",flex_box_vertical_center:"flex_box_vertical_center___3pQXk",flex_box_center_end:"flex_box_center_end___29_cn",flex_box_column:"flex_box_column___16am0",title:"title___2mVJs",workListTabWrap:"workListTabWrap___1JlOB",workListTabButton:"workListTabButton___3umfp",tables:"tables___hLy6a",checkboxgroup:"checkboxgroup___2xMgu"}},biw7:function(Gt,fe,D){"use strict";var q=D("q1tI"),Y=D.n(q),U=q.createContext(null);fe.a=U},c5Ni:function(Gt,fe,D){},deN7:function(Gt,fe,D){"use strict";var q=D("/zsF"),Y=D("PArb"),U=D("14J3"),G=D("BMrR"),M=D("jCWc"),k=D("kPKH"),K=D("+L6B"),I=D("2/Rp"),r=D("miYZ"),P=D("tsqr"),_=D("9og8"),p=D("giR+"),m=D("fyUT"),u=D("2qtc"),a=D("kLXV"),o=D("7Kak"),c=D("9yH6"),s=D("tJVT"),i=D("k1fw"),n=D("OaEy"),O=D("2fM7"),T=D("WmNS"),w=D.n(T),R=D("q1tI"),S=D.n(R),v=D("ZW9T"),E=D("F0VM"),f=D.n(E),h=D("xKgJ"),y=D("J66h"),g=D.n(y),x=D("ErOA"),j=D("Ty5D"),F=D("9Bee"),A=D("XYT7"),W=D("RCxd"),H=D("/MfK"),C=O.a.Option,z={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},Z;(function(se){se[se.SET_PATH=0]="SET_PATH",se[se.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(Z||(Z={}));function le(se,Ce){switch(Ce.type){case Z.SET_PATH:return Object(i.a)(Object(i.a)({},se),{},{selectedPath:Ce.payload});case Z.GET_PASSED_CONTENT:return Object(i.a)(Object(i.a)({},se),{},{passedContent:Ce.payload});default:throw new Error}}fe.a=function(se){var Ce=se.language,Ee=se.dispatch,Ie=se.shixunWorkReport,Qe=se.v,Xe=se.languages,_e=se.onPathChange,pe=se.autoHeight,at=se.diff_code_count,Qt=se.data,Ft=Object(R.useState)(Xe==null?void 0:Xe[0]),Tt=Object(s.a)(Ft,2),Ve=Tt[0],pt=Tt[1],ut=Ie!="shixunWorkReport"&&Object(j.i)();return Object(R.useEffect)(function(){pt(Xe==null?void 0:Xe[0])},[]),Object(R.useEffect)(function(){var Ut;pt(Xe==null||((Ut=Xe.filter(function(oe){return oe.language===(Ve==null?void 0:Ve.language)}))===null||Ut===void 0)?void 0:Ut[0])},[Xe]),S.a.createElement(S.a.Fragment,null,S.a.createElement("h2",null," ",S.a.createElement("span",null,S.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Xe==null?void 0:Xe.length)>1&&S.a.createElement(c.a.Group,{defaultValue:Ce,style:{marginLeft:10},onChange:function(oe){var Ue;pt(Xe==null||((Ue=Xe.filter(function(ze){return ze.language===oe.target.value}))===null||Ue===void 0)?void 0:Ue[0])}},Xe==null?void 0:Xe.map(function(Ut){return S.a.createElement(c.a,{value:Ut==null?void 0:Ut.language},Ut==null?void 0:Ut.language)}))),Object(h.c)()&&Ie!="shixunWorkReport"&&S.a.createElement("span",null,S.a.createElement("span",null,"\u5F97\u5206 ",Ve==null?void 0:Ve.score,"/",Ve==null?void 0:Ve.total_score),S.a.createElement(I.a,{style:{margin:"0px 10px"},onClick:function(){var oe=Ve==null?void 0:Ve.score;a.a.confirm({title:"\u8C03\u5206",content:S.a.createElement("div",null,S.a.createElement("p",null,"\u5F97\u5206\uFF1A",Ve==null?void 0:Ve.score,"/",Ve==null?void 0:Ve.total_score),S.a.createElement("p",null,"\u8C03\u5206\uFF1A",S.a.createElement(m.a,{min:0,max:Ve==null?void 0:Ve.total_score,defaultValue:Ve==null?void 0:Ve.score,onChange:function(ze){oe=ze}}))),okText:"\u786E\u8BA4",onOk:function(){var Ue=Object(_.a)(w.a.mark(function $e(){var Bt;return w.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(x.a)("/api/courses/".concat(ut==null?void 0:ut.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:ut==null?void 0:ut.coursesId,hack_user_code_id:Ve==null?void 0:Ve.hack_user_id,score:oe}});case 2:Bt=qt.sent,Bt.status===0&&(P.b.success("\u8C03\u5206\u6210\u529F"),Ee({type:"shixunHomeworks/setActionTabs",payload:{}}),Ee({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},ut)}));case 4:case"end":return qt.stop()}},$e)}));function ze(){return Ue.apply(this,arguments)}return ze}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(h.c)()&&Ie!="shixunWorkReport"&&S.a.createElement(I.a,{onClick:function(){Ee({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:Ie.user_id,type:"1",language:Ve==null?void 0:Ve.language,v:Qe,data:Object(i.a)({},Ie)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),S.a.createElement(v.b,{height:300,language:Ve==null?void 0:Ve.language,value:y.Base64.decode(Ve==null?void 0:Ve.code),autoHeight:pe,theme:"default",options:z}),((Ve==null?void 0:Ve.comment)||(Ve==null?void 0:Ve.hidden_comment))&&S.a.createElement("div",null,S.a.createElement(G.a,{align:"middle",style:{borderTop:"1px solid #eee"}},S.a.createElement(k.a,{flex:1},S.a.createElement("h1",{className:f.a.title},"\u70B9\u8BC4\u5185\u5BB9")),S.a.createElement(k.a,{className:"pr30"},Object(h.c)()&&S.a.createElement(I.a,{onClick:Object(_.a)(w.a.mark(function Ut(){return w.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:a.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:S.a.createElement(W.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(_.a)(w.a.mark(function $e(){var Bt;return w.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(A.m)({comment_id:Ve==null?void 0:Ve.comment_id,homeworkId:ut.homeworkId,type:"hack"});case 2:Bt=qt.sent,Bt.status===0&&(P.b.success("\u5220\u9664\u6210\u529F"),Ee({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},ut)}));case 4:case"end":return qt.stop()}},$e)}))()}});case 1:case"end":return Ue.stop()}},Ut)}))},S.a.createElement(H.a,null),"\u5220\u9664"))),S.a.createElement(Y.a,{style:{margin:0}}),(Ve==null?void 0:Ve.comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(F.a,{value:Ve==null?void 0:Ve.comment})),(Ve==null?void 0:Ve.hidden_comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(F.a,{value:Ve==null?void 0:Ve.hidden_comment}))))}},dejd:function(Gt,fe,D){},dmUQ:function(Gt,fe,D){"use strict";var q=D("Ff2n"),Y=D("rePB"),U=D("1OyB"),G=D("vuIU"),M=D("Ji7U"),k=D("md7G"),K=D("foSv"),I=D("q1tI"),r=D.n(I),P=D("TSYQ"),_=D.n(P),p=D("4IlW");function m(f,h){var y=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(f,x).enumerable})),y.push.apply(y,g)}return y}function u(f){for(var h=1;h<arguments.length;h++){var y=arguments[h]!=null?arguments[h]:{};h%2?m(Object(y),!0).forEach(function(g){Object(Y.a)(f,g,y[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(y)):m(Object(y)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(y,g))})}return f}function a(f){var h=o();return function(){var g=Object(K.a)(f),x;if(h){var j=Object(K.a)(this).constructor;x=Reflect.construct(g,arguments,j)}else x=g.apply(this,arguments);return Object(k.a)(this,x)}}function o(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(f){return!1}}function c(){}function s(f){f.preventDefault()}var i=function(h){return h.replace(/[^\w.-]+/g,"")},n=200,O=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(h){return h!=null},R=function(h,y){return y===h||typeof y=="number"&&typeof h=="number"&&isNaN(y)&&isNaN(h)},S=function(f){Object(M.a)(y,f);var h=a(y);function y(g){var x;Object(U.a)(this,y),x=h.call(this,g),x.onKeyDown=function(A){var W=x.props,H=W.onKeyDown,C=W.onPressEnter;if(A.keyCode===p.a.UP){var z=x.getRatio(A);x.up(A,z,null),x.stop()}else if(A.keyCode===p.a.DOWN){var Z=x.getRatio(A);x.down(A,Z,null),x.stop()}else A.keyCode===p.a.ENTER&&C&&C(A);if(x.recordCursorPosition(),x.lastKeyCode=A.keyCode,H){for(var le=arguments.length,se=new Array(le>1?le-1:0),Ce=1;Ce<le;Ce++)se[Ce-1]=arguments[Ce];H.apply(void 0,[A].concat(se))}},x.onKeyUp=function(A){var W=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),W){for(var H=arguments.length,C=new Array(H>1?H-1:0),z=1;z<H;z++)C[z-1]=arguments[z];W.apply(void 0,[A].concat(C))}},x.onChange=function(A){var W=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(A)),x.setState({inputValue:x.rawInput}),W(x.toNumber(x.rawInput))},x.onMouseUp=function(){var A=x.props.onMouseUp;x.recordCursorPosition(),A&&A.apply(void 0,arguments)},x.onFocus=function(){var A;x.setState({focused:!0}),(A=x.props).onFocus.apply(A,arguments)},x.onBlur=function(){var A=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var W=x.getCurrentValidValue(x.state.inputValue),H=x.setValue(W,c);if(A){var C=x.input.value,z=x.getInputDisplayValue({focus:!1,value:H});x.input.value=z&&Number(z),A.apply(void 0,arguments),x.input.value=C}},x.getRatio=function(A){var W=1;return A.metaKey||A.ctrlKey?W=.1:A.shiftKey&&(W=10),W},x.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},x.getPrecision=function(A){if(w(x.props.precision))return x.props.precision;var W=String(A);if(W.indexOf("e-")>=0)return parseInt(W.slice(W.indexOf("e-")+2),10);var H=0;return W.indexOf(".")>=0&&(H=W.length-W.indexOf(".")-1),H},x.getInputDisplayValue=function(A){var W=A||x.state,H=W.focused,C=W.inputValue,z=W.value,Z;H?Z=C:Z=x.toPrecisionAsStep(z),Z==null&&(Z="");var le=x.formatWrapper(Z);return w(x.props.decimalSeparator)&&(le=le.toString().replace(".",x.props.decimalSeparator)),le},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(A){}},x.restoreByAfter=function(A){if(A===void 0)return!1;var W=x.input.value,H=W.lastIndexOf(A);if(H===-1)return!1;var C=x.cursorBefore.length;return x.lastKeyCode===p.a.DELETE&&x.cursorBefore.charAt(C-1)===A[0]?(x.fixCaret(C,C),!0):H+A.length===W.length?(x.fixCaret(H,H),!0):!1},x.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(W,H){var C=A.substring(H);return x.restoreByAfter(C)})},x.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(A,W,H){x.pressingUpOrDown=!0,x.step("down",A,W,H)},x.up=function(A,W,H){x.pressingUpOrDown=!0,x.step("up",A,W,H)},x.saveInput=function(A){x.input=A};var j=g.value;j===void 0&&(j=g.defaultValue),x.state={focused:g.autoFocus};var F=x.getValidValue(x.toNumber(j));return x.state=u(u({},x.state),{},{inputValue:x.toPrecisionAsStep(F),value:F}),x}return Object(G.a)(y,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var j=this.props,F=j.value,A=j.onChange,W=j.max,H=j.min,C=this.state.focused;if(x){if(!R(x.value,F)||!R(x.max,W)||!R(x.min,H)){var z=C?F:this.getValidValue(F),Z;this.pressingUpOrDown?Z=z:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:Z})}var le="value"in this.props?F:this.state.value;"max"in this.props&&x.max!==W&&typeof le=="number"&&le>W&&A&&A(W),"min"in this.props&&x.min!==H&&typeof le=="number"&&le<H&&A&&A(H)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?se=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(se=this.cursorStart):se=this.input.value.length,this.fixCaret(se,se)}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(Ce){}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(x){var j=x;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(x){var j=x.target.value.trim().replace(/。/g,".");return w(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(x);return isNaN(A)?x:(A<j&&(A=j),A>F&&(A=F),A)}},{key:"setValue",value:function(x,j){var F=this.props.precision,A=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),W=this.state.value,H=W===void 0?null:W,C=this.state.inputValue,z=C===void 0?null:C,Z=typeof A=="number"?A.toFixed(F):"".concat(A),le=A!==H||Z!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},j)):this.setState({value:A,inputValue:this.toPrecisionAsStep(x)},j),le&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,A=F.precision,W=F.step;if(w(A))return A;var H=this.getPrecision(j),C=this.getPrecision(W),z=this.getPrecision(x);return x?Math.max(z,H+C):H+C}},{key:"getPrecisionFactor",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(x,j);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var j=Math.abs(this.getMaxPrecision(x));return isNaN(j)?x.toString():Number(x).toFixed(j)}},{key:"toNumber",value:function(x){var j=this.props.precision,F=this.state.focused,A=x&&x.length>16&&F;return this.isNotCompleteNumber(x)||A?x:w(j)?Math.round(x*Math.pow(10,j))/Math.pow(10,j):Number(x)}},{key:"upStep",value:function(x,j){var F=this.props.step,A=this.getPrecisionFactor(x,j),W=Math.abs(this.getMaxPrecision(x,j)),H=((A*x+A*F*j)/A).toFixed(W);return this.toNumber(H)}},{key:"downStep",value:function(x,j){var F=this.props.step,A=this.getPrecisionFactor(x,j),W=Math.abs(this.getMaxPrecision(x,j)),H=((A*x-A*F*j)/A).toFixed(W);return this.toNumber(H)}},{key:"step",value:function(x,j){var F=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,W=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var H=this.props;if(H.disabled)return;var C=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(C))return;var z=this["".concat(x,"Step")](C,A),Z=z>H.max||z<H.min;if(z>H.max?z=H.max:z<H.min&&(z=H.min),this.setValue(z,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){F[x](j,A,!0)},W?n:O)}},{key:"fixCaret",value:function(x,j){if(x===void 0||j===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,A=this.input.selectionEnd;(x!==F||j!==A)&&this.input.setSelectionRange(x,j)}catch(W){}}},{key:"render",value:function(){var x,j=this.props,F=j.prefixCls,A=j.disabled,W=j.readOnly,H=j.useTouch,C=j.autoComplete,z=j.upHandler,Z=j.downHandler,le=j.className,se=j.max,Ce=j.min,Ee=j.style,Ie=j.title,Qe=j.onMouseEnter,Xe=j.onMouseLeave,_e=j.onMouseOver,pe=j.onMouseOut,at=j.required,Qt=j.onClick,Ft=j.tabIndex,Tt=j.type,Ve=j.placeholder,pt=j.id,ut=j.inputMode,Ut=j.pattern,oe=j.step,Ue=j.maxLength,ze=j.autoFocus,$e=j.name,Bt=j.onPaste,Ht=j.onInput,qt=Object(q.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),tt=this.state,nn=tt.value,xn=tt.focused,Ge=_()(F,(x={},Object(Y.a)(x,le,!!le),Object(Y.a)(x,"".concat(F,"-disabled"),A),Object(Y.a)(x,"".concat(F,"-focused"),xn),x)),He={};Object.keys(qt).forEach(function(be){(be.substr(0,5)==="data-"||be.substr(0,5)==="aria-"||be==="role")&&(He[be]=qt[be])});var vt=!W&&!A,Ot=this.getInputDisplayValue(null),nt=(nn||nn===0)&&(isNaN(nn)||Number(nn)>=se),xt=(nn||nn===0)&&(isNaN(nn)||Number(nn)<=Ce),Ae=nt||A||W,ve=xt||A||W,we=_()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(Y.a)({},"".concat(F,"-handler-up-disabled"),Ae)),ie=_()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(Y.a)({},"".concat(F,"-handler-down-disabled"),ve)),ae=H?{onTouchStart:Ae?c:this.up,onTouchEnd:this.stop}:{onMouseDown:Ae?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},me=H?{onTouchStart:ve?c:this.down,onTouchEnd:this.stop}:{onMouseDown:ve?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:Ge,style:Ee,title:Ie,onMouseEnter:Qe,onMouseLeave:Xe,onMouseOver:_e,onMouseOut:pe,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":Ae,className:we}),z||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:s})),r.a.createElement("span",Object.assign({unselectable:"on"},me,{role:"button","aria-label":"Decrease Value","aria-disabled":ve,className:ie}),Z||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:s}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ce,"aria-valuemax":se,"aria-valuenow":nn,required:at,type:Tt,placeholder:Ve,onPaste:Bt,onClick:Qt,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:Ft,autoComplete:C,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:c,onKeyUp:vt?this.onKeyUp:c,autoFocus:ze,maxLength:Ue,readOnly:W,disabled:A,max:se,min:Ce,step:oe,name:$e,title:Ie,id:pt,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ot),pattern:Ut,inputMode:ut,onInput:Ht},He))))}}]),y}(r.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:i,required:!1,autoComplete:"off"};var v=S,E=fe.a=v},eozf:function(Gt,fe,D){"use strict";D.d(fe,"b",function(){return Xe}),D.d(fe,"c",function(){return _e});var q=D("sRBo"),Y=D("kaz8"),U=D("5Dmo"),G=D("3S7+"),M=D("/zsF"),k=D("PArb"),K=D("7Kak"),I=D("9yH6"),r=D("14J3"),P=D("BMrR"),_=D("+L6B"),p=D("2/Rp"),m=D("jCWc"),u=D("kPKH"),a=D("2qtc"),o=D("kLXV"),c=D("9og8"),s=D("miYZ"),i=D("tsqr"),n=D("oBTY"),O=D("k1fw"),T=D("tJVT"),w=D("OaEy"),R=D("2fM7"),S=D("iQDF"),v=D("+eQT"),E=D("WmNS"),f=D.n(E),h=D("q1tI"),y=D.n(h),g=D("/MfK"),x=D("w5pM"),j=D("Lyp1"),F=D("wd/R"),A=D.n(F),W=D("xKgJ"),H=D("ErOA"),C=D("LvDl"),z=D.n(C),Z=D("1vsH"),le=D("zetH"),se=D.n(le),Ce=D("Ty5D"),Ee=D("9kvl"),Ie=D("AHFd");function Qe(Ft,Tt){for(var Ve=[],pt=Ft;pt<Tt;pt++)Ve.push(pt);return Ve}var Xe=function(Tt,Ve,pt){var ut=Tt<A()().startOf("day"),Ut=Tt>A()(Ve).endOf("day"),oe=Tt<A()(pt).startOf("day");return Ve?pt?A()()<=A()(pt)?oe||Ut:ut||Ut:Tt&&ut||Ut:pt&&A()()<=A()(pt)?oe:ut},_e=function(Tt,Ve){var pt=parseInt(A()(Tt).format("HH")),ut=parseInt(A()().format("HH")),Ut=parseInt(A()().format("mm"));if(!Tt)return{disabledHours:function(){return Qe(0,ut)},disabledMinutes:function(){return Qe(0,Ut)}};if(Ve){var oe=parseInt(A()(Ve).format("HH")),Ue=parseInt(A()(Ve).format("mm"));return A()(Tt).isSame(A()(Ve),"day")?{disabledHours:function(){return Qe(0,oe)},disabledMinutes:function(){return pt<=oe?Qe(0,Ue):[]}}:void 0}return A()(Tt).isSame(A()(),"day")?{disabledHours:function(){return Qe(0,ut)},disabledMinutes:function(){return A()(Tt).isSame(A()(),"hour")&&pt<=ut?Qe(0,Ut):[]}}:void 0},pe=v.a.RangePicker,at=R.a.Option,Qt=function(Tt){var Ve,pt,ut,Ut,oe,Ue,ze,$e=Tt.shixunHomeworks,Bt=Tt.loading,Ht=Tt.dispatch,qt=Object(Ce.i)(),tt=$e.workSetting,nn=$e.workList,xn=$e.changeData,Ge=Object(h.useState)(!0),He=Object(T.a)(Ge,2),vt=He[0],Ot=He[1],nt=Object(h.useState)(!1),xt=Object(T.a)(nt,2),Ae=xt[0],ve=xt[1],we=Object(h.useState)([]),ie=Object(T.a)(we,2),ae=ie[0],me=ie[1],be=Object(h.useState)([]),ye=Object(T.a)(be,2),Be=ye[0],St=ye[1],an=Object(h.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:Ie.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0}),Dn=Object(T.a)(an,2),yt=Dn[0],en=Dn[1];Object(h.useEffect)(function(){return _t(),function(){me([].concat())}},[]);var _t=function(){Ht({type:"shixunHomeworks/getWorkSetting",payload:Object(O.a)({},qt)})};Object(h.useEffect)(function(){var Pe;if(!(tt!=null&&tt.course_id))return;Object.keys(yt).map(function(et){yt[et]=tt[et]}),(!yt.allow_late||!yt.unified_late)&&(yt.late_penalty=20,yt.penalty_type=Ie.a.Percent),yt.unified_setting||(yt.unified_late=!1,yt.unified_anonymous_comment=!1,yt.unified_anonymous_appeal=!1),ae=JSON.parse(JSON.stringify(tt.group_settings.map(function(et){return Object(O.a)(Object(O.a)({},et),{},{group_name:[et.group_name]})}).filter(function(et){return et.publish_time!==null}))),Be=JSON.parse(JSON.stringify(tt.allow_late_settings.map(function(et){return Object(O.a)(Object(O.a)({},et),{},{group_name:[et.group_name]})}).filter(function(et){return et.late_time!==null}))),en(Object(O.a)({},yt)),me(Object(n.a)(ae)),((Pe=Be)===null||Pe===void 0?void 0:Pe.length)<=0?St([{penalty_type:Ie.a.Percent,late_penalty:20}]):St(Object(n.a)(Be))},[tt]);var Et=function(){var et,jt,bn=JSON.parse(JSON.stringify(yt));if(bn.challenge_settings.filter(function(Xt){return!Xt.hide}),bn.categoryId=qt.categoryId,(et=bn.challenge_settings)!==null&&et!==void 0&&et.every(function(Xt){return!Xt.checked})){i.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(yt.unified_setting||(ae=(jt=ae)===null||jt===void 0?void 0:jt.map(function(Xt){var Yn;if(!Xt.publish_time||!Xt.end_time)throw i.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Xt.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Xt.group_name=typeof(Xt==null?void 0:Xt.group_name)=="string"?[Xt==null?void 0:Xt.group_name]:Xt==null?void 0:Xt.group_name,Xt.group_id=(Yn=tt.group_settings)===null||Yn===void 0?void 0:Yn.filter(function(Bn){var _n;return Xt==null||((_n=Xt.group_name)===null||_n===void 0)?void 0:_n.includes(Bn.group_name)}).map(function(Bn){return Bn.group_id||Bn.id}).toString().split(","),Xt})),bn.group_settings=ae,yt.allow_late)if(yt.unified_late){if(yt.late_penalty===null||yt.late_penalty===void 0||yt.late_penalty<0||yt.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!yt.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var Kt;Be=(Kt=Be)===null||Kt===void 0?void 0:Kt.map(function(Xt){var Yn,Bn;if(Xt.late_penalty===null||Xt.late_penalty===void 0||Xt.late_penalty<0||Xt.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!Xt.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Xt.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Xt.group_name=typeof(Xt==null?void 0:Xt.group_name)=="string"?[Xt==null?void 0:Xt.group_name]:Xt==null?void 0:Xt.group_name,Xt.group_id=Xt==null||((Yn=Xt.group_name)===null||Yn===void 0||((Bn=Yn.map(function(_n){var br,Fr,hr=(br=tt.group_settings)===null||br===void 0||((Fr=br.filter(function(Qn){return(Qn==null?void 0:Qn.group_name)===_n}))===null||Fr===void 0)?void 0:Fr[0];return hr==null?void 0:hr.group_id}))===null||Bn===void 0))?void 0:Bn.toString().split(","),Xt}),bn.allow_late_settings=Be}st(bn)},st=function(et){var jt,bn;if(et.total_score===null){i.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(et!=null&&et.work_efficiency&&et.eff_score===null){i.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Kt=et.challenge_settings.reduce(function(Bn,_n){return Bn+Number(_n.challenge_score)},0);if((Kt==null?void 0:Kt.toFixed(10))!==((jt=et.total_score-et.eff_score)===null||jt===void 0?void 0:jt.toFixed(10))){i.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(et.total_score,"\u5206"));return}var Xt={shixun_evaluation:et.shixun_evaluation,challenge_settings:et.challenge_settings},Yn=function(){var Bn=Object(c.a)(f.a.mark(function _n(){var br;return f.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:return ve(!0),hr.next=3,Object(H.a)("/api/homework_commons/".concat(qt.categoryId,"/publish_setting.json"),{method:"post",body:Object(O.a)({},et)});case 3:br=hr.sent,br.status===0&&(i.b.success("\u66F4\u65B0\u6210\u529F"),Ot(!0),_t(),Ht({type:"shixunHomeworks/getWorkList",payload:Object(O.a)({},qt)})),ve(!1);case 6:case"end":return hr.stop()}},_n)}));return function(){return Bn.apply(this,arguments)}}();!Object(C.isEqual)(xn,Xt)&&!(nn!=null&&(bn=nn.homework_status)!==null&&bn!==void 0&&bn.includes("\u672A\u53D1\u5E03"))?o.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:Yn}):Yn()},he=function(et,jt){var bn,Kt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return jt?jt.find(function(Xt){return Xt[Kt]===et}):tt==null||((bn=tt.group_settings)===null||bn===void 0)?void 0:bn.find(function(Xt){return Xt.group_id[0]===et})},Le=(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment),Lt=function(et){var jt=he(et,tt==null?void 0:tt.allow_late_settings,"id"),bn=he(et,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.allow_late)&&jt&&(jt==null?void 0:jt.late_time)!==null||(tt==null?void 0:tt.anonymous_comment)&&bn&&(bn==null?void 0:bn.evaluation_start)!==null},ct=Object(h.useMemo)(function(){var Pe;if(tt!=null&&tt.unified_setting){var et;return!(nn!=null&&(et=nn.homework_status)!==null&&et!==void 0&&et.includes("\u5DF2\u622A\u6B62"))||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment)}var jt=tt==null||((Pe=tt.group_settings)===null||Pe===void 0)?void 0:Pe.some(function(bn){return A()(bn.end_time)<=A()()});return!jt||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.all_group_late)},[tt,nn]),tn=tt==null?void 0:tt.anonymous_comment,un=function(et){if(!et)return!1;var jt=he(et,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.anonymous_comment)&&jt&&(jt==null?void 0:jt.evaluation_start)!==null};return y.a.createElement("section",{className:[se.a.form," bg-white pl30 pr30 pt10"].join(" ")},y.a.createElement(P.a,null,y.a.createElement(u.a,{span:24},y.a.createElement(P.a,{align:"middle"},y.a.createElement(u.a,{flex:"1"}),y.a.createElement(u.a,null,Object(W.c)()&&vt&&y.a.createElement(p.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Ot(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),y.a.createElement("div",null,y.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",y.a.createElement(I.a.Group,{disabled:vt||!(nn!=null&&(Ve=nn.homework_status)!==null&&Ve!==void 0&&Ve.includes("\u672A\u53D1\u5E03")),value:yt.unified_setting,onChange:function(et){var jt;if(!(nn!=null&&(jt=nn.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03"))){i.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(yt.unified_setting=!yt.unified_setting,yt.unified_setting||(yt.unified_late=!1),en(Object.assign({},yt)),yt.unified_setting===!1&&ae==""){me(ae.concat({}));return}yt.unified_setting&&(me([]),St([{late_penalty:5}]))}},y.a.createElement(I.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),y.a.createElement(I.a,{disabled:(tt==null||((pt=tt.group_settings)===null||pt===void 0)?void 0:pt.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(tt==null||((ut=tt.group_settings)===null||ut===void 0)?void 0:ut.length)===0&&y.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09"))),yt.unified_setting&&y.a.createElement("div",null,y.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u53D1\u5E03\u65F6\u95F4:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(v.a,{disabled:vt||!(nn!=null&&(Ut=nn.homework_status)!==null&&Ut!==void 0&&Ut.includes("\u672A\u53D1\u5E03")||nn!=null&&(oe=nn.homework_status)!==null&&oe!==void 0&&oe.includes("\u672A\u5F00\u59CB")),style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(et){return Xe(et,tt==null?void 0:tt.course_end_date)},disabledTime:function(et){return _e(et)},value:yt.publish_time?A()(yt.publish_time):"",onChange:function(et,jt){yt.publish_time=jt,(yt.end_time==""||!yt.end_time)&&yt.unified_setting&&(yt.end_time=A()(et).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),en(Object.assign({},yt))}})),y.a.createElement(u.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),y.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u622A\u6B62\u65F6\u95F4:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(v.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(Z.f)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:vt||Le,disabledDate:function(et){return Xe(et,tt==null?void 0:tt.course_end_date,yt.publish_time)},disabledTime:function(et){return _e(et,yt.publish_time)},value:yt.end_time?A()(yt.end_time):"",onChange:function(et,jt){yt.end_time=jt,en(Object.assign({},yt))}})),y.a.createElement(u.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!yt.unified_setting&&((Ue=ae)===null||Ue===void 0?void 0:Ue.length)>0&&y.a.createElement(P.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},y.a.createElement(u.a,{span:24},y.a.createElement(P.a,null,y.a.createElement(u.a,{span:10}),y.a.createElement(u.a,{span:10},y.a.createElement(P.a,{className:"c-grey-c ml30"},y.a.createElement(u.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),y.a.createElement(u.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),y.a.createElement(u.a,{span:4}))),ae&&ae.map(function(Pe,et){var jt,bn,Kt,Xt,Yn;return y.a.createElement(u.a,{span:24,key:et},y.a.createElement(P.a,{gutter:[8,16]},y.a.createElement(u.a,{span:10},y.a.createElement(P.a,{gutter:[8,16]},y.a.createElement(u.a,null,"\u53D1\u5E03\u89C4\u5219 ",et+1),y.a.createElement(u.a,{flex:"1",style:{maxWidth:300}},y.a.createElement(R.a,{disabled:vt||!(nn!=null&&(jt=nn.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03"))&&Pe.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Pe.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(_n){ae[et].group_name=_n,ae[et].group_id=Pe.group_id;var br=Object(C.flattenDeep)(ae.map(function(hr){return hr.group_name})),Fr=Be.map(function(hr){var Qn=(hr==null?void 0:hr.group_name)||[];return Object(O.a)(Object(O.a)({},hr),{},{group_name:Object(C.remove)(Qn,function(Dr){return br.includes(Dr)})})});St(Fr),me(ae.slice())}},tt.group_settings&&tt.group_settings.map(function(Bn){var _n=ae.map(function(br){return br.group_name}).flat();if(!_n.includes(Bn.group_name))return y.a.createElement(at,{value:Bn.group_name,key:Bn.id},Bn.group_name)}))))),y.a.createElement(u.a,{span:10},y.a.createElement("div",{className:"ml30"},y.a.createElement(pe,{ranges:{\u6B64\u523B:[Pe.publish_time?A()(Pe.publish_time):A()(),A()()]},allowClear:!1,disabled:vt||(A()()<=A()((bn=he((Kt=Pe.group_id)===null||Kt===void 0?void 0:Kt[0]))===null||bn===void 0?void 0:bn.publish_time)?!1:[!0,Lt((Xt=Pe.group_id)===null||Xt===void 0?void 0:Xt[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(_n){return Xe(_n,tt==null?void 0:tt.course_end_date)},disabledTime:function(_n){return _e(_n)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[A()(Object(Z.f)(),"HH:mm"),A()(Object(Z.f)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Pe.publish_time&&[A()(Pe.publish_time),Pe.end_time?A()(Pe.end_time):void 0],onChange:function(_n,br){ae[et].publish_time=br[0],ae[et].end_time=br[1],me(Object(n.a)(ae))}}))),!vt&&y.a.createElement(u.a,{span:4},et>0&&!Pe.id&&y.a.createElement(g.a,{onClick:function(){ae=ae.filter(function(_n,br){return et!==br}),me(ae.slice()),setTimeout(function(){return me(ae.slice())},10)}}),ae.length<(tt==null||((Yn=tt.group_settings)===null||Yn===void 0)?void 0:Yn.length)&&y.a.createElement(x.a,{className:"c-green ml20",onClick:function(){me(ae.concat({}))}}))))})),y.a.createElement(k.a,null),y.a.createElement(P.a,null,y.a.createElement(u.a,null,y.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),y.a.createElement(G.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},y.a.createElement(j.a,{style:{marginLeft:4,cursor:"pointer"}}))),y.a.createElement(u.a,{span:24,className:"mt15 pl30"},y.a.createElement(Y.a,{checked:yt.allow_late,disabled:vt||ct,onChange:function(){yt.allow_late=!yt.allow_late,Be==""&&St([{late_penalty:5}]),en(Object.assign({},yt))}},y.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),y.a.createElement(G.a,{overlayStyle:{width:380,maxWidth:380},title:y.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},y.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),y.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),y.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},y.a.createElement(j.a,null)))),(yt==null?void 0:yt.allow_late)&&y.a.createElement("div",{style:{marginLeft:22}},y.a.createElement("div",{className:"ml30 mt20"},y.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),y.a.createElement(I.a.Group,{disabled:vt||(tt==null?void 0:tt.anonymous_comment)||(tt==null?void 0:tt.allow_late),value:yt.unified_late,onChange:function(et){yt.unified_late=et.target.value,Be==""&&!et.target.value&&St([{penalty_type:Ie.a.Percent,late_penalty:20}]),en(Object(O.a)({},yt))}},(yt==null?void 0:yt.unified_setting)&&y.a.createElement(I.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(tt==null||((ze=tt.group_settings)===null||ze===void 0)?void 0:ze.length)>0&&y.a.createElement(I.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),yt!=null&&yt.unified_late?y.a.createElement(y.a.Fragment,null,y.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u8865\u4EA4\u6263\u5206:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(Ie.b,{disabled:vt||tn,value:{type:yt.penalty_type,inputValue:yt.late_penalty},onChange:function(et){en(Object(O.a)(Object(O.a)({},yt),{},{late_penalty:et.inputValue,penalty_type:et.type}))}})),y.a.createElement(u.a,{flex:"1",className:"ml5"},y.a.createElement("span",{className:"c-grey-c ml10"},yt.penalty_type===Ie.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),y.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(v.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(Z.f)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:vt||tn,value:yt.late_time?A()(yt.late_time):"",disabledDate:function(et){return Xe(et,tt==null?void 0:tt.course_end_date)},onChange:function(et,jt){yt.late_time=jt,en(Object.assign({},yt))}})),y.a.createElement(u.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Be.map(function(Pe,et){var jt;return y.a.createElement(u.a,{span:24,key:et},y.a.createElement(P.a,{className:"mt25"},y.a.createElement(u.a,{style:{marginLeft:30}},y.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",et+1,"\uFF1A"),y.a.createElement(R.a,{disabled:vt||!(nn!=null&&(jt=nn.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03"))&&Pe.id||(tt==null?void 0:tt.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Pe.group_name=="string"?[Pe.group_name]:Pe.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Kt){Be[et].group_name=Kt,Be[et].group_id=Pe.group_id,St(Be.slice())}},tt.group_settings&&tt.group_settings.map(function(bn){var Kt=Be.map(function(Yn){return Yn.group_name}).flat(),Xt=ae.map(function(Yn){return Yn.group_name}).flat();if(yt!=null&&yt.unified_setting){if(!Kt.includes(bn.group_name))return y.a.createElement(at,{value:bn.group_name,key:bn.id},bn.group_name)}else if(Xt.includes(bn.group_name)&&(!Kt.includes(bn.group_name)&&A()(bn.end_time)<=A()()))return y.a.createElement(at,{value:bn.group_name,key:bn.id},bn.group_name)}))),y.a.createElement(u.a,{className:"ml20"},y.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),y.a.createElement(Ie.b,{disabled:vt||un(Pe.id),value:{type:Pe.penalty_type,inputValue:Pe.late_penalty},onChange:function(Kt){Be[et].late_penalty=Kt.inputValue,Be[et].penalty_type=Kt.type,St(Object(n.a)(Be))}})),y.a.createElement(u.a,{className:"ml20"},y.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),y.a.createElement(v.a,{disabled:vt||un(Pe.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:A()(Object(Z.f)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(Kt){return Xe(Kt,tt==null?void 0:tt.course_end_date)},format:"YYYY-MM-DD HH:mm",value:Pe!=null&&Pe.late_time?A()(Pe.late_time):void 0,onChange:function(Kt,Xt){Be[et].late_time=Xt,St(Object(n.a)(Be))}})),!vt&&y.a.createElement(u.a,{className:"ml20"},et>0&&!Pe.id&&y.a.createElement(g.a,{onClick:function(){Be=Be.filter(function(Kt,Xt){return et!==Xt}),St(Be.slice()),setTimeout(function(){return St(Be.slice())},10)}}),y.a.createElement(x.a,{className:"c-green ml20",onClick:function(){St(Be.concat({penalty_type:Ie.a.Percent,late_minus_score:20}))}}))))})),y.a.createElement(k.a,null),!vt&&y.a.createElement(u.a,{className:"mb50"},y.a.createElement(p.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:Ae,onClick:function(){return Et()}},"\u63D0\u4EA4"),y.a.createElement(p.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Ot(!0),_t()}},"\u53D6\u6D88")))};fe.a=Object(Ee.a)(function(Ft){var Tt=Ft.shixunHomeworks,Ve=Ft.loading;return{shixunHomeworks:Tt,loading:Ve.effects}})(Qt)},fjLI:function(Gt,fe,D){"use strict";D.d(fe,"f",function(){return m}),D.d(fe,"b",function(){return u}),D.d(fe,"a",function(){return a}),D.d(fe,"d",function(){return o}),D.d(fe,"e",function(){return c}),D.d(fe,"c",function(){return s});var q=D("8HAY"),Y=D("Vhoy"),U=D("MI8n"),G=D("JYp7"),M=D("pmY6"),k=D("24hK"),K=D("nnTU"),I=D("T8No"),r=D("Cg/j"),P=D("t9D7"),_=function(i,n,O,T){var w=arguments.length,R=w<3?n:T===null?T=Object.getOwnPropertyDescriptor(n,O):T,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(i,n,O,T);else for(var v=i.length-1;v>=0;v--)(S=i[v])&&(R=(w<3?S(R):w>3?S(n,O,R):S(n,O))||R);return w>3&&R&&Object.defineProperty(n,O,R),R},p=function(i,n){return function(O,T){n(O,T,i)}};function m(i){return i.command!==void 0}class u{constructor(i){this.id=u._idPool++,this._debugName=i}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const a=Object(r.c)("menuService"),o=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new U.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===u.CommandPalette}}addCommand(i){return this.addCommands(G.a.single(i))}addCommands(i){for(const n of i)this._commands.set(n.id,n);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(M.i)(()=>{let n=!1;for(const O of i)n=this._commands.delete(O.id)||n;n&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((n,O)=>i.set(O,n)),i}appendMenuItem(i,n){return this.appendMenuItems(G.a.single({id:i,item:n}))}appendMenuItems(i){const n=new Set,O=new k.a;for(const{id:T,item:w}of i){let R=this._menuItems.get(T);R||(R=new k.a,this._menuItems.set(T,R)),O.push(R.push(w)),n.add(T)}return this._onDidChangeMenu.fire(n),Object(M.i)(()=>{if(O.size>0){for(let T of O)T();this._onDidChangeMenu.fire(n),O.clear()}})}getMenuItems(i){let n;return this._menuItems.has(i)?n=[...this._menuItems.get(i)]:n=[],i===u.CommandPalette&&this._appendImplicitItems(n),n}_appendImplicitItems(i){const n=new Set;for(const O of i)m(O)&&(n.add(O.command.id),O.alt&&n.add(O.alt.id));this._commands.forEach((O,T)=>{n.has(T)||i.push({command:O})})}};class c extends q.e{constructor(i,n,O,T){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=n,this._contextKeyService=O,this._options=T}get actions(){const i=[],n=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=n.getActions(this._options);n.dispose();for(const[,T]of O)T.length>0&&(i.push(...T),i.push(new q.d));return i.length&&i.pop(),i}}let s=class i{constructor(n,O,T,w,R){var S,v;if(this._commandService=R,this.id=n.id,this.label=(T==null?void 0:T.renderShortTitle)&&n.shortTitle?typeof n.shortTitle=="string"?n.shortTitle:n.shortTitle.value:typeof n.title=="string"?n.title:n.title.value,this.tooltip=(v=typeof n.tooltip=="string"?n.tooltip:(S=n.tooltip)===null||S===void 0?void 0:S.value)!==null&&v!==void 0?v:"",this.enabled=!n.precondition||w.contextMatchesRules(n.precondition),this.checked=void 0,n.toggled){const E=n.toggled.condition?n.toggled:{condition:n.toggled};this.checked=w.contextMatchesRules(E.condition),this.checked&&E.tooltip&&(this.tooltip=typeof E.tooltip=="string"?E.tooltip:E.tooltip.value),E.title&&(this.label=typeof E.title=="string"?E.title:E.title.value)}this.item=n,this.alt=O?new i(O,void 0,T,w,R):void 0,this._options=T,P.d.isThemeIcon(n.icon)&&(this.class=Y.a.asClassName(n.icon))}dispose(){}run(...n){var O,T;let w=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(w=[...w,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(w=[...w,...n]),this._commandService.executeCommand(this.id,...w)}};s=_([p(3,I.b),p(4,K.b)],s)},fyJ8:function(Gt,fe,D){"use strict";var q=D("rePB"),Y=D("VTBJ"),U=D("Ff2n"),G=D("U8pU"),M=D("q1tI"),k=D.n(M),K=D("TSYQ"),I=D.n(K),r=D("c+Xe"),P=D("sR1s");function _(o){return o&&Object(G.a)(o)==="object"&&!Array.isArray(o)&&!M.isValidElement(o)}function p(o){return typeof o=="string"?!0:Object(r.c)(o)}function m(o,c){var s,i=o.prefixCls,n=o.className,O=o.record,T=o.index,w=o.dataIndex,R=o.render,S=o.children,v=o.component,E=v===void 0?"td":v,f=o.colSpan,h=o.rowSpan,y=o.fixLeft,g=o.fixRight,x=o.firstFixLeft,j=o.lastFixLeft,F=o.firstFixRight,A=o.lastFixRight,W=o.appendNode,H=o.additionalProps,C=H===void 0?{}:H,z=o.ellipsis,Z=o.align,le=o.rowType,se=o.isSticky,Ce="".concat(i,"-cell"),Ee,Ie;if(S)Ie=S;else{var Qe=Object(P.b)(O,w);if(Ie=Qe,R){var Xe=R(Qe,O,T);_(Xe)?(Ie=Xe.children,Ee=Xe.props):Ie=Xe}}Object(G.a)(Ie)==="object"&&!Array.isArray(Ie)&&!M.isValidElement(Ie)&&(Ie=null),z&&(j||F)&&(Ie=M.createElement("span",{className:"".concat(Ce,"-content")},Ie));var _e=Ee||{},pe=_e.colSpan,at=_e.rowSpan,Qt=_e.style,Ft=_e.className,Tt=Object(U.a)(_e,["colSpan","rowSpan","style","className"]),Ve=pe!==void 0?pe:f,pt=at!==void 0?at:h;if(Ve===0||pt===0)return null;var ut={},Ut=typeof y=="number",oe=typeof g=="number";Ut&&(ut.position="sticky",ut.left=y),oe&&(ut.position="sticky",ut.right=g);var Ue={};Z&&(Ue.textAlign=Z);var ze,$e=z===!0?{showTitle:!0}:z;$e&&($e.showTitle||le==="header")&&(typeof Ie=="string"||typeof Ie=="number"?ze=Ie.toString():M.isValidElement(Ie)&&typeof Ie.props.children=="string"&&(ze=Ie.props.children));var Bt=Object(Y.a)(Object(Y.a)(Object(Y.a)({title:ze},Tt),C),{},{colSpan:Ve&&Ve!==1?Ve:null,rowSpan:pt&&pt!==1?pt:null,className:I()(Ce,n,(s={},Object(q.a)(s,"".concat(Ce,"-fix-left"),Ut),Object(q.a)(s,"".concat(Ce,"-fix-left-first"),x),Object(q.a)(s,"".concat(Ce,"-fix-left-last"),j),Object(q.a)(s,"".concat(Ce,"-fix-right"),oe),Object(q.a)(s,"".concat(Ce,"-fix-right-first"),F),Object(q.a)(s,"".concat(Ce,"-fix-right-last"),A),Object(q.a)(s,"".concat(Ce,"-ellipsis"),z),Object(q.a)(s,"".concat(Ce,"-with-append"),W),Object(q.a)(s,"".concat(Ce,"-fix-sticky"),(Ut||oe)&&se),s),C.className,Ft),style:Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},C.style),Ue),ut),Qt),ref:p(E)?c:null});return M.createElement(E,Object.assign({},Bt),W,Ie)}var u=M.forwardRef(m);u.displayName="Cell";var a=M.memo(u,function(o,c){return c.shouldCellUpdate?!c.shouldCellUpdate(c.record,o.record):!1});fe.a=a},hW8S:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return G}),D.d(fe,"c",function(){return M}),D.d(fe,"b",function(){return k});var q=D("VTBJ"),Y=D("Ff2n"),U=D("Kwbf"),G="RC_TABLE_INTERNAL_COL_DEFINE";function M(K){var I=K.expandable,r=Object(Y.a)(K,["expandable"]);return"expandable"in K?Object(q.a)(Object(q.a)({},r),I):r}function k(K){return Object.keys(K).reduce(function(I,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(I[r]=K[r]),I},{})}},iF7n:function(Gt,fe,D){Gt.exports={flex_box_center:"flex_box_center___1Hyu4",flex_space_between:"flex_space_between___3ssyf",flex_box_vertical_center:"flex_box_vertical_center___1Gkv-",flex_box_center_end:"flex_box_center_end___1fs_5",flex_box_column:"flex_box_column___3KImt",top:"top___FkMRG",desc:"desc___zZgSM",liked:"liked___1eBGI",likedActive:"likedActive___1i_lJ",reply:"reply___1mww8",replyList:"replyList___3NmMj",comment:"comment___1kF3h"}},ic2d:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return G});var q=D("FWmy"),Y=D("746U");class U{constructor(){this.data=new Map}add(M,k){q.a(Y.l(M)),q.a(Y.k(k)),q.a(!this.data.has(M),"There is already an extension with this id"),this.data.set(M,k)}as(M){return this.data.get(M)||null}}const G=new U},k3GJ:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return mr});var q=D("rePB"),Y=D("ODXe"),U=D("Ff2n"),G=D("VTBJ"),M=D("q1tI"),k=D("TSYQ"),K=D.n(k),I=D("Zm9Q"),r=D("6cGi"),P=D("KQm4"),_=D("xEkU"),p=D.n(_),m=D("t23M");function u(xe){var je=Object(M.useRef)(),Ye=Object(M.useRef)(!1);function Oe(){for(var re=arguments.length,ge=new Array(re),ce=0;ce<re;ce++)ge[ce]=arguments[ce];Ye.current||(p.a.cancel(je.current),je.current=p()(function(){xe.apply(void 0,ge)}))}return Object(M.useEffect)(function(){return function(){Ye.current=!0,p.a.cancel(je.current)}},[]),Oe}function a(xe){var je=Object(M.useRef)([]),Ye=Object(M.useState)({}),Oe=Object(Y.a)(Ye,2),re=Oe[1],ge=Object(M.useRef)(typeof xe=="function"?xe():xe),ce=u(function(){var Me=ge.current;je.current.forEach(function(qe){Me=qe(Me)}),je.current=[],ge.current=Me,re({})});function Re(Me){je.current.push(Me),ce()}return[ge.current,Re]}var o=D("4IlW");function c(xe,je){var Ye,Oe=xe.prefixCls,re=xe.id,ge=xe.active,ce=xe.rtl,Re=xe.tab,Me=Re.key,qe=Re.tab,Ne=Re.disabled,lt=Re.closeIcon,Nt=xe.tabBarGutter,on=xe.tabPosition,mn=xe.closable,Wn=xe.renderWrapper,Vn=xe.removeAriaLabel,fr=xe.editable,cr=xe.onClick,xr=xe.onRemove,Rr=xe.onFocus,gr="".concat(Oe,"-tab");M.useEffect(function(){return xr},[]);var wr={};on==="top"||on==="bottom"?wr[ce?"marginLeft":"marginRight"]=Nt:wr.marginBottom=Nt;var Lr=fr&&mn!==!1&&!Ne;function gn(zt){if(Ne)return;cr(zt)}function rn(zt){zt.preventDefault(),zt.stopPropagation(),fr.onEdit("remove",{key:Me,event:zt})}var wn=M.createElement("div",{key:Me,ref:je,className:K()(gr,(Ye={},Object(q.a)(Ye,"".concat(gr,"-with-remove"),Lr),Object(q.a)(Ye,"".concat(gr,"-active"),ge),Object(q.a)(Ye,"".concat(gr,"-disabled"),Ne),Ye)),style:wr,onClick:gn},M.createElement("div",{role:"tab","aria-selected":ge,id:re&&"".concat(re,"-tab-").concat(Me),className:"".concat(gr,"-btn"),"aria-controls":re&&"".concat(re,"-panel-").concat(Me),"aria-disabled":Ne,tabIndex:Ne?null:0,onClick:function(Vt){Vt.stopPropagation(),gn(Vt)},onKeyDown:function(Vt){[o.a.SPACE,o.a.ENTER].includes(Vt.which)&&(Vt.preventDefault(),gn(Vt))},onFocus:Rr},qe),Lr&&M.createElement("button",{type:"button","aria-label":Vn||"remove",tabIndex:0,className:"".concat(gr,"-remove"),onClick:function(Vt){Vt.stopPropagation(),rn(Vt)}},lt||fr.removeIcon||"\xD7"));return Wn&&(wn=Wn(wn)),wn}var s=M.forwardRef(c),i={width:0,height:0,left:0,top:0};function n(xe,je,Ye){return Object(M.useMemo)(function(){for(var Oe,re=new Map,ge=je.get((Oe=xe[0])===null||Oe===void 0?void 0:Oe.key)||i,ce=ge.left+ge.width,Re=0;Re<xe.length;Re+=1){var Me=xe[Re].key,qe=je.get(Me);if(!qe){var Ne;qe=je.get((Ne=xe[Re-1])===null||Ne===void 0?void 0:Ne.key)||i}var lt=re.get(Me)||Object(G.a)({},qe);lt.right=ce-lt.left-lt.width,re.set(Me,lt)}return re},[xe.map(function(Oe){return Oe.key}).join("_"),je,Ye])}var O={width:0,height:0,left:0,top:0,right:0};function T(xe,je,Ye,Oe,re){var ge=re.tabs,ce=re.tabPosition,Re=re.rtl,Me,qe,Ne;["top","bottom"].includes(ce)?(Me="width",qe=Re?"right":"left",Ne=Math.abs(je.left)):(Me="height",qe="top",Ne=-je.top);var lt=je[Me],Nt=Ye[Me],on=Oe[Me],mn=lt;return Nt+on>lt&&(mn=lt-on),Object(M.useMemo)(function(){if(!ge.length)return[0,0];for(var Wn=ge.length,Vn=Wn,fr=0;fr<Wn;fr+=1){var cr=xe.get(ge[fr].key)||O;if(cr[qe]+cr[Me]>Ne+mn){Vn=fr-1;break}}for(var xr=0,Rr=Wn-1;Rr>=0;Rr-=1){var gr=xe.get(ge[Rr].key)||O;if(gr[qe]<Ne){xr=Rr+1;break}}return[xr,Vn]},[xe,Ne,mn,ce,ge.map(function(Wn){return Wn.key}).join("_"),Re])}var w=D("wx14"),R=D("1OyB"),S=D("vuIU"),v=D("JX7q"),E=D("Ji7U"),f=D("LK+K"),h=D("I8Z2"),y=D("bT9E"),g=D("2GS6"),x=D("Gytx"),j=D.n(x),F=D("U8pU"),A=/iPhone/i,W=/iPod/i,H=/iPad/i,C=/\bAndroid(?:.+)Mobile\b/i,z=/Android/i,Z=/\bAndroid(?:.+)SD4930UR\b/i,le=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,se=/Windows Phone/i,Ce=/\bWindows(?:.+)ARM\b/i,Ee=/BlackBerry/i,Ie=/BB10/i,Qe=/Opera Mini/i,Xe=/\b(CriOS|Chrome)(?:.+)Mobile/i,_e=/Mobile(?:.+)Firefox\b/i;function pe(xe,je){return xe.test(je)}function at(xe){var je=xe||(typeof navigator!="undefined"?navigator.userAgent:""),Ye=(je||"").split("[FBAN");if(typeof Ye[1]!="undefined"){var Oe=Ye,re=Object(Y.a)(Oe,1);je=re[0]}if(Ye=je.split("Twitter"),typeof Ye[1]!="undefined"){var ge=Ye,ce=Object(Y.a)(ge,1);je=ce[0]}var Re={apple:{phone:pe(A,je)&&!pe(se,je),ipod:pe(W,je),tablet:!pe(A,je)&&pe(H,je)&&!pe(se,je),device:(pe(A,je)||pe(W,je)||pe(H,je))&&!pe(se,je)},amazon:{phone:pe(Z,je),tablet:!pe(Z,je)&&pe(le,je),device:pe(Z,je)||pe(le,je)},android:{phone:!pe(se,je)&&pe(Z,je)||!pe(se,je)&&pe(C,je),tablet:!pe(se,je)&&!pe(Z,je)&&!pe(C,je)&&(pe(le,je)||pe(z,je)),device:!pe(se,je)&&(pe(Z,je)||pe(le,je)||pe(C,je)||pe(z,je))||pe(/\bokhttp\b/i,je)},windows:{phone:pe(se,je),tablet:pe(Ce,je),device:pe(se,je)||pe(Ce,je)},other:{blackberry:pe(Ee,je),blackberry10:pe(Ie,je),opera:pe(Qe,je),firefox:pe(_e,je),chrome:pe(Xe,je),device:pe(Ee,je)||pe(Ie,je)||pe(Qe,je)||pe(_e,je)||pe(Xe,je)},any:null,phone:null,tablet:null};return Re.any=Re.apple.device||Re.android.device||Re.windows.device||Re.other.device,Re.phone=Re.apple.phone||Re.android.phone||Re.windows.phone,Re.tablet=Re.apple.tablet||Re.android.tablet||Re.windows.tablet,Re}var Qt=Object(G.a)(Object(G.a)({},at()),{},{isMobile:at}),Ft=Qt;function Tt(){}function Ve(xe,je,Ye){var Oe=je||"";return xe.key||"".concat(Oe,"item_").concat(Ye)}function pt(xe){return"".concat(xe,"-menu-")}function ut(xe,je){var Ye=-1;M.Children.forEach(xe,function(Oe){Ye+=1,Oe&&Oe.type&&Oe.type.isMenuItemGroup?M.Children.forEach(Oe.props.children,function(re){Ye+=1,je(re,Ye)}):je(Oe,Ye)})}function Ut(xe,je,Ye){if(!xe||Ye.find)return;M.Children.forEach(xe,function(Oe){if(Oe){var re=Oe.type;if(!re||!(re.isSubMenu||re.isMenuItem||re.isMenuItemGroup))return;je.indexOf(Oe.key)!==-1?Ye.find=!0:Oe.props.children&&Ut(Oe.props.children,je,Ye)}})}var oe=["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"],Ue=function(je){var Ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=je&&typeof je.getBoundingClientRect=="function"&&je.getBoundingClientRect().width;if(Oe){if(Ye){var re=getComputedStyle(je),ge=re.marginLeft,ce=re.marginRight;Oe+=+ge.replace("px","")+ +ce.replace("px","")}Oe=+Oe.toFixed(6)}return Oe||0},ze=function(je,Ye,Oe){je&&Object(F.a)(je.style)==="object"&&(je.style[Ye]=Oe)},$e=function(){return Ft.any},Bt=D("bdgK"),Ht=D("i8i4"),qt=D.n(Ht),tt=D("wgJM"),nn=D("l4aY"),xn=D("m+aA"),Ge=D("c+Xe"),He=D("zT1h"),vt=D("QC+M");function Ot(xe,je,Ye){return Ye?xe[0]===je[0]:xe[0]===je[0]&&xe[1]===je[1]}function nt(xe,je,Ye){var Oe=xe[je]||{};return Object(G.a)(Object(G.a)({},Oe),Ye)}function xt(xe,je,Ye,Oe){for(var re=Ye.points,ge=Object.keys(xe),ce=0;ce<ge.length;ce+=1){var Re=ge[ce];if(Ot(xe[Re].points,re,Oe))return"".concat(je,"-placement-").concat(Re)}return""}var Ae=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var xe=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(xe)||/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(xe==null?void 0:xe.substr(0,4)))},ve=D("MNnm");function we(xe,je){var Ye={};return Ye[xe.toLowerCase()]=je.toLowerCase(),Ye["Webkit".concat(xe)]="webkit".concat(je),Ye["Moz".concat(xe)]="moz".concat(je),Ye["ms".concat(xe)]="MS".concat(je),Ye["O".concat(xe)]="o".concat(je.toLowerCase()),Ye}function ie(xe,je){var Ye={animationend:we("Animation","AnimationEnd"),transitionend:we("Transition","TransitionEnd")};return xe&&("AnimationEvent"in je||delete Ye.animationend.animation,"TransitionEvent"in je||delete Ye.transitionend.transition),Ye}var ae=ie(Object(ve.a)(),typeof window!="undefined"?window:{}),me={};if(Object(ve.a)()){var be=document.createElement("div");me=be.style}var ye={};function Be(xe){if(ye[xe])return ye[xe];var je=ae[xe];if(je)for(var Ye=Object.keys(je),Oe=Ye.length,re=0;re<Oe;re+=1){var ge=Ye[re];if(Object.prototype.hasOwnProperty.call(je,ge)&&ge in me)return ye[xe]=je[ge],ye[xe]}return""}var St=Be("animationend"),an=Be("transitionend"),Dn=!!(St&&an),yt=St||"animationend",en=an||"transitionend";function _t(xe,je){if(!xe)return null;if(Object(F.a)(xe)==="object"){var Ye=je.replace(/-\w/g,function(Oe){return Oe[1].toUpperCase()});return xe[Ye]}return"".concat(xe,"-").concat(je)}var Et="none",st="appear",he="enter",Le="leave",Lt="none",ct="prepare",tn="start",un="active",Pe="end";function et(xe){var je=Object(M.useRef)(!1),Ye=Object(M.useState)(xe),Oe=Object(Y.a)(Ye,2),re=Oe[0],ge=Oe[1];function ce(Re){je.current||ge(Re)}return Object(M.useEffect)(function(){return function(){je.current=!0}},[]),[re,ce]}var jt=Object(ve.a)()?M.useLayoutEffect:M.useEffect,bn=jt,Kt=function(){var xe=M.useRef(null);function je(){tt.a.cancel(xe.current)}function Ye(Oe){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;je();var ge=Object(tt.a)(function(){re<=1?Oe({isCanceled:function(){return ge!==xe.current}}):Ye(Oe,re-1)});xe.current=ge}return M.useEffect(function(){return function(){je()}},[]),[Ye,je]},Xt=[ct,tn,un,Pe],Yn=!1,Bn=!0;function _n(xe){return xe===un||xe===Pe}var br=function(xe,je){var Ye=M.useState(Lt),Oe=Object(Y.a)(Ye,2),re=Oe[0],ge=Oe[1],ce=Kt(),Re=Object(Y.a)(ce,2),Me=Re[0],qe=Re[1];function Ne(){ge(ct)}return bn(function(){if(re!==Lt&&re!==Pe){var lt=Xt.indexOf(re),Nt=Xt[lt+1],on=je(re);on===Yn?ge(Nt):Me(function(mn){function Wn(){if(mn.isCanceled())return;ge(Nt)}on===!0?Wn():Promise.resolve(on).then(Wn)})}},[xe,re]),M.useEffect(function(){return function(){qe()}},[]),[Ne,re]},Fr=function(xe){var je=Object(M.useRef)(),Ye=Object(M.useRef)(xe);Ye.current=xe;var Oe=M.useCallback(function(ce){Ye.current(ce)},[]);function re(ce){ce&&(ce.removeEventListener(en,Oe),ce.removeEventListener(yt,Oe))}function ge(ce){je.current&&je.current!==ce&&re(je.current),ce&&ce!==je.current&&(ce.addEventListener(en,Oe),ce.addEventListener(yt,Oe),je.current=ce)}return M.useEffect(function(){return function(){re(je.current)}},[]),[ge,re]};function hr(xe,je,Ye,Oe){var re=Oe.motionEnter,ge=re===void 0?!0:re,ce=Oe.motionAppear,Re=ce===void 0?!0:ce,Me=Oe.motionLeave,qe=Me===void 0?!0:Me,Ne=Oe.motionDeadline,lt=Oe.motionLeaveImmediately,Nt=Oe.onAppearPrepare,on=Oe.onEnterPrepare,mn=Oe.onLeavePrepare,Wn=Oe.onAppearStart,Vn=Oe.onEnterStart,fr=Oe.onLeaveStart,cr=Oe.onAppearActive,xr=Oe.onEnterActive,Rr=Oe.onLeaveActive,gr=Oe.onAppearEnd,wr=Oe.onEnterEnd,Lr=Oe.onLeaveEnd,gn=Oe.onVisibleChanged,rn=et(),wn=Object(Y.a)(rn,2),zt=wn[0],Vt=wn[1],pr=et(Et),Pr=Object(Y.a)(pr,2),ar=Pr[0],Nr=Pr[1],si=et(null),Ur=Object(Y.a)(si,2),Xr=Ur[0],zr=Ur[1],Wr=Object(M.useRef)(!1),Hr=Object(M.useRef)(null),vr=Object(M.useRef)(!1),yi=Object(M.useRef)(null);function Qi(){var li=Ye();return li||yi.current}var ji=Object(M.useRef)(!1);function Ri(li){var Qr=Qi();if(li&&!li.deadline&&li.target!==Qr)return;var Ti;ar===st&&ji.current?Ti=gr==null?void 0:gr(Qr,li):ar===he&&ji.current?Ti=wr==null?void 0:wr(Qr,li):ar===Le&&ji.current&&(Ti=Lr==null?void 0:Lr(Qr,li)),Ti!==!1&&!vr.current&&(Nr(Et),zr(null))}var ci=Fr(Ri),qr=Object(Y.a)(ci,1),ai=qr[0],di=M.useMemo(function(){var li,Qr,Ti;switch(ar){case"appear":return li={},Object(q.a)(li,ct,Nt),Object(q.a)(li,tn,Wn),Object(q.a)(li,un,cr),li;case"enter":return Qr={},Object(q.a)(Qr,ct,on),Object(q.a)(Qr,tn,Vn),Object(q.a)(Qr,un,xr),Qr;case"leave":return Ti={},Object(q.a)(Ti,ct,mn),Object(q.a)(Ti,tn,fr),Object(q.a)(Ti,un,Rr),Ti;default:return{}}},[ar]),Fi=br(ar,function(li){if(li===ct){var Qr=di[ct];return Qr?Qr(Qi()):Yn}if(ei in di){var Ti;zr(((Ti=di[ei])===null||Ti===void 0?void 0:Ti.call(di,Qi(),null))||null)}return ei===un&&(ai(Qi()),Ne>0&&(clearTimeout(Hr.current),Hr.current=setTimeout(function(){Ri({deadline:!0})},Ne))),Bn}),ha=Object(Y.a)(Fi,2),sa=ha[0],ei=ha[1],Zi=_n(ei);ji.current=Zi,bn(function(){Vt(je);var li=Wr.current;if(Wr.current=!0,!xe)return;var Qr;!li&&je&&Re&&(Qr=st),li&&je&&ge&&(Qr=he),(li&&!je&&qe||!li&<&&!je&&qe)&&(Qr=Le),Qr&&(Nr(Qr),sa())},[je]),Object(M.useEffect)(function(){(ar===st&&!Re||ar===he&&!ge||ar===Le&&!qe)&&Nr(Et)},[Re,ge,qe]),Object(M.useEffect)(function(){return function(){clearTimeout(Hr.current),vr.current=!0}},[]),Object(M.useEffect)(function(){zt!==void 0&&ar===Et&&(gn==null||gn(zt))},[zt,ar]);var qi=Xr;return di[ct]&&ei===tn&&(qi=Object(G.a)({transition:"none"},qi)),[ar,ei,qi,zt!=null?zt:je]}var Qn=function(xe){Object(E.a)(Ye,xe);var je=Object(f.a)(Ye);function Ye(){return Object(R.a)(this,Ye),je.apply(this,arguments)}return Object(S.a)(Ye,[{key:"render",value:function(){return this.props.children}}]),Ye}(M.Component),Dr=Qn;function Kr(xe){var je=xe;Object(F.a)(xe)==="object"&&(je=xe.transitionSupport);function Ye(re){return!!(re.motionName&&je)}var Oe=M.forwardRef(function(re,ge){var ce=re.visible,Re=ce===void 0?!0:ce,Me=re.removeOnLeave,qe=Me===void 0?!0:Me,Ne=re.forceRender,lt=re.children,Nt=re.motionName,on=re.leavedClassName,mn=re.eventProps,Wn=Ye(re),Vn=Object(M.useRef)(),fr=Object(M.useRef)();function cr(){try{return Object(xn.a)(Vn.current||fr.current)}catch(Nr){return null}}var xr=hr(Wn,Re,cr,re),Rr=Object(Y.a)(xr,4),gr=Rr[0],wr=Rr[1],Lr=Rr[2],gn=Rr[3],rn=M.useRef(gn);gn&&(rn.current=!0);var wn=Object(M.useRef)(ge);wn.current=ge;var zt=M.useCallback(function(Nr){Vn.current=Nr,Object(Ge.b)(wn.current,Nr)},[]),Vt,pr=Object(G.a)(Object(G.a)({},mn),{},{visible:Re});if(!lt)Vt=null;else if(gr===Et||!Ye(re))gn?Vt=lt(Object(G.a)({},pr),zt):!qe&&rn.current?Vt=lt(Object(G.a)(Object(G.a)({},pr),{},{className:on}),zt):Ne?Vt=lt(Object(G.a)(Object(G.a)({},pr),{},{style:{display:"none"}}),zt):Vt=null;else{var Pr,ar;wr===ct?ar="prepare":_n(wr)?ar="active":wr===tn&&(ar="start"),Vt=lt(Object(G.a)(Object(G.a)({},pr),{},{className:K()(_t(Nt,gr),(Pr={},Object(q.a)(Pr,_t(Nt,"".concat(gr,"-").concat(ar)),ar),Object(q.a)(Pr,Nt,typeof Nt=="string"),Pr)),style:Lr}),zt)}return M.createElement(Dr,{ref:fr},Vt)});return Oe.displayName="CSSMotion",Oe}var ti=Kr(Dn),dn="add",rr="keep",fi="remove",wi="removed";function ni(xe){var je;return xe&&Object(F.a)(xe)==="object"&&"key"in xe?je=xe:je={key:xe},Object(G.a)(Object(G.a)({},je),{},{key:String(je.key)})}function ri(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return xe.map(ni)}function X(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ye=[],Oe=0,re=je.length,ge=ri(xe),ce=ri(je);ge.forEach(function(qe){for(var Ne=!1,lt=Oe;lt<re;lt+=1){var Nt=ce[lt];if(Nt.key===qe.key){Oe<lt&&(Ye=Ye.concat(ce.slice(Oe,lt).map(function(on){return Object(G.a)(Object(G.a)({},on),{},{status:dn})})),Oe=lt),Ye.push(Object(G.a)(Object(G.a)({},Nt),{},{status:rr})),Oe+=1,Ne=!0;break}}Ne||Ye.push(Object(G.a)(Object(G.a)({},qe),{},{status:fi}))}),Oe<re&&(Ye=Ye.concat(ce.slice(Oe).map(function(qe){return Object(G.a)(Object(G.a)({},qe),{},{status:dn})})));var Re={};Ye.forEach(function(qe){var Ne=qe.key;Re[Ne]=(Re[Ne]||0)+1});var Me=Object.keys(Re).filter(function(qe){return Re[qe]>1});return Me.forEach(function(qe){Ye=Ye.filter(function(Ne){var lt=Ne.key,Nt=Ne.status;return lt!==qe||Nt!==fi}),Ye.forEach(function(Ne){Ne.key===qe&&(Ne.status=rr)})}),Ye}var L=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function N(xe){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ti,Ye=function(Oe){Object(E.a)(ge,Oe);var re=Object(f.a)(ge);function ge(){var ce;return Object(R.a)(this,ge),ce=re.apply(this,arguments),ce.state={keyEntities:[]},ce.removeKey=function(Re){ce.setState(function(Me){var qe=Me.keyEntities;return{keyEntities:qe.map(function(Ne){return Ne.key!==Re?Ne:Object(G.a)(Object(G.a)({},Ne),{},{status:wi})})}})},ce}return Object(S.a)(ge,[{key:"render",value:function(){var Re=this,Me=this.state.keyEntities,qe=this.props,Ne=qe.component,lt=qe.children,Nt=qe.onVisibleChanged,on=Object(U.a)(qe,["component","children","onVisibleChanged"]),mn=Ne||M.Fragment,Wn={};return L.forEach(function(Vn){Wn[Vn]=on[Vn],delete on[Vn]}),delete on.keys,M.createElement(mn,on,Me.map(function(Vn){var fr=Vn.status,cr=Object(U.a)(Vn,["status"]),xr=fr===dn||fr===rr;return M.createElement(je,Object(w.a)({},Wn,{key:cr.key,visible:xr,eventProps:cr,onVisibleChanged:function(gr){Nt==null||Nt(gr,{key:cr.key}),gr||Re.removeKey(cr.key)}}),lt)}))}}],[{key:"getDerivedStateFromProps",value:function(Re,Me){var qe=Re.keys,Ne=Me.keyEntities,lt=ri(qe),Nt=X(Ne,lt);return{keyEntities:Nt.filter(function(on){var mn=Ne.find(function(Wn){var Vn=Wn.key;return on.key===Vn});return!(mn&&mn.status===wi&&on.status===fi)})}}}]),ge}(M.Component);return Ye.defaultProps={component:"div"},Ye}var V=N(Dn),ne=ti;function J(xe){var je=xe.prefixCls,Ye=xe.motion,Oe=xe.animation,re=xe.transitionName;return Ye||(Oe?{motionName:"".concat(je,"-").concat(Oe)}:re?{motionName:re}:null)}function Fe(xe){var je=xe.prefixCls,Ye=xe.visible,Oe=xe.zIndex,re=xe.mask,ge=xe.maskMotion,ce=xe.maskAnimation,Re=xe.maskTransitionName;if(!re)return null;var Me={};return(ge||Re||ce)&&(Me=Object(G.a)({motionAppear:!0},J({motion:ge,prefixCls:je,transitionName:Re,animation:ce}))),M.createElement(ne,Object(w.a)({},Me,{visible:Ye,removeOnLeave:!0}),function(qe){var Ne=qe.className;return M.createElement("div",{style:{zIndex:Oe},className:K()("".concat(je,"-mask"),Ne)})})}var Jt=D("9mu1"),In=D("o0o1"),Zn=D.n(In),ln=D("HaE+"),ir=["measure","align",null,"motion"],tr=function(xe,je){var Ye=Object(M.useState)(null),Oe=Object(Y.a)(Ye,2),re=Oe[0],ge=Oe[1],ce=Object(M.useRef)(),Re=Object(M.useRef)(!1);function Me(lt){Re.current||ge(lt)}function qe(){tt.a.cancel(ce.current)}function Ne(lt){qe(),ce.current=Object(tt.a)(function(){Me(function(Nt){switch(re){case"align":return"motion";case"motion":return"stable";default:}return Nt}),lt==null||lt()})}return Object(M.useEffect)(function(){Me("measure")},[xe]),Object(M.useEffect)(function(){switch(re){case"measure":je();break;default:}re&&(ce.current=Object(tt.a)(Object(ln.a)(Zn.a.mark(function lt(){var Nt,on;return Zn.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:Nt=ir.indexOf(re),on=ir[Nt+1],on&&Nt!==-1&&Me(on);case 3:case"end":return Wn.stop()}},lt)}))))},[re]),Object(M.useEffect)(function(){return function(){Re.current=!0,qe()}},[]),[re,Ne]},Mr=function(xe){var je=M.useState({width:0,height:0}),Ye=Object(Y.a)(je,2),Oe=Ye[0],re=Ye[1];function ge(Re){re({width:Re.offsetWidth,height:Re.offsetHeight})}var ce=M.useMemo(function(){var Re={};if(xe){var Me=Oe.width,qe=Oe.height;xe.indexOf("height")!==-1&&qe?Re.height=qe:xe.indexOf("minHeight")!==-1&&qe&&(Re.minHeight=qe),xe.indexOf("width")!==-1&&Me?Re.width=Me:xe.indexOf("minWidth")!==-1&&Me&&(Re.minWidth=Me)}return Re},[xe,Oe]);return[ce,ge]},ui=M.forwardRef(function(xe,je){var Ye=xe.visible,Oe=xe.prefixCls,re=xe.className,ge=xe.style,ce=xe.children,Re=xe.zIndex,Me=xe.stretch,qe=xe.destroyPopupOnHide,Ne=xe.forceRender,lt=xe.align,Nt=xe.point,on=xe.getRootDomNode,mn=xe.getClassNameFromAlign,Wn=xe.onAlign,Vn=xe.onMouseEnter,fr=xe.onMouseLeave,cr=xe.onMouseDown,xr=xe.onTouchStart,Rr=Object(M.useRef)(),gr=Object(M.useRef)(),wr=Object(M.useState)(),Lr=Object(Y.a)(wr,2),gn=Lr[0],rn=Lr[1],wn=Mr(Me),zt=Object(Y.a)(wn,2),Vt=zt[0],pr=zt[1];function Pr(){Me&&pr(on())}var ar=tr(Ye,Pr),Nr=Object(Y.a)(ar,2),si=Nr[0],Ur=Nr[1],Xr=Object(M.useRef)();function zr(){return Nt||on}function Wr(){var ci;(ci=Rr.current)===null||ci===void 0||ci.forceAlign()}function Hr(ci,qr){var ai=mn(qr);gn!==ai&&rn(ai),si==="align"&&(gn!==ai?Promise.resolve().then(function(){Wr()}):Ur(function(){var di;(di=Xr.current)===null||di===void 0||di.call(Xr)}),Wn==null||Wn(ci,qr))}var vr=Object(G.a)({},J(xe));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ci){var qr=vr[ci];vr[ci]=function(ai,di){return Ur(),qr==null?void 0:qr(ai,di)}});function yi(){return new Promise(function(ci){Xr.current=ci})}M.useEffect(function(){!vr.motionName&&si==="motion"&&Ur()},[vr.motionName,si]),M.useImperativeHandle(je,function(){return{forceAlign:Wr,getElement:function(){return gr.current}}});var Qi=Object(G.a)(Object(G.a)({},Vt),{},{zIndex:Re,opacity:si==="motion"||si==="stable"||!Ye?void 0:0,pointerEvents:si==="stable"?void 0:"none"},ge),ji=!0;(lt==null?void 0:lt.points)&&(si==="align"||si==="stable")&&(ji=!1);var Ri=ce;return M.Children.count(ce)>1&&(Ri=M.createElement("div",{className:"".concat(Oe,"-content")},ce)),M.createElement(ne,Object(w.a)({visible:Ye,ref:gr,leavedClassName:"".concat(Oe,"-hidden")},vr,{onAppearPrepare:yi,onEnterPrepare:yi,removeOnLeave:qe,forceRender:Ne}),function(ci,qr){var ai=ci.className,di=ci.style,Fi=K()(Oe,re,gn,ai);return M.createElement(Jt.a,{target:zr(),key:"popup",ref:Rr,monitorWindowResize:!0,disabled:ji,align:lt,onAlign:Hr},M.createElement("div",{ref:qr,className:Fi,onMouseEnter:Vn,onMouseLeave:fr,onMouseDownCapture:cr,onTouchStartCapture:xr,style:Object(G.a)(Object(G.a)({},di),Qi)},Ri))})});ui.displayName="PopupInner";var oi=ui,Gr=M.forwardRef(function(xe,je){var Ye=xe.prefixCls,Oe=xe.visible,re=xe.zIndex,ge=xe.children,ce=xe.mobile;ce=ce===void 0?{}:ce;var Re=ce.popupClassName,Me=ce.popupStyle,qe=ce.popupMotion,Ne=qe===void 0?{}:qe,lt=ce.popupRender,Nt=M.useRef();M.useImperativeHandle(je,function(){return{forceAlign:function(){},getElement:function(){return Nt.current}}});var on=Object(G.a)({zIndex:re},Me),mn=ge;return M.Children.count(ge)>1&&(mn=M.createElement("div",{className:"".concat(Ye,"-content")},ge)),lt&&(mn=lt(mn)),M.createElement(ne,Object(w.a)({visible:Oe,ref:Nt,removeOnLeave:!0},Ne),function(Wn,Vn){var fr=Wn.className,cr=Wn.style,xr=K()(Ye,Re,fr);return M.createElement("div",{ref:Vn,className:xr,style:Object(G.a)(Object(G.a)({},cr),on)},mn)})});Gr.displayName="MobilePopupInner";var Li=Gr,Vi=["visible","mobile"],Ar=M.forwardRef(function(xe,je){var Ye=xe.visible,Oe=xe.mobile,re=Object(U.a)(xe,Vi),ge=Object(M.useState)(Ye),ce=Object(Y.a)(ge,2),Re=ce[0],Me=ce[1],qe=Object(M.useState)(!1),Ne=Object(Y.a)(qe,2),lt=Ne[0],Nt=Ne[1],on=Object(G.a)(Object(G.a)({},re),{},{visible:Re});Object(M.useEffect)(function(){Me(Ye),Ye&&Oe&&Nt(Ae())},[Ye,Oe]);var mn=lt?M.createElement(Li,Object(w.a)({},on,{mobile:Oe,ref:je})):M.createElement(oi,Object(w.a)({},on,{ref:je}));return M.createElement("div",null,M.createElement(Fe,on),mn)});Ar.displayName="Popup";var Tr=Ar,ii=M.createContext(null),Br=ii;function Hn(){}function yn(){return""}function Sn(xe){return xe?xe.ownerDocument:window.document}var En=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function ur(xe){var je=function(Ye){Object(E.a)(re,Ye);var Oe=Object(f.a)(re);function re(ge){var ce;Object(R.a)(this,re),ce=Oe.call(this,ge),ce.popupRef=M.createRef(),ce.triggerRef=M.createRef(),ce.attachId=void 0,ce.clickOutsideHandler=void 0,ce.touchOutsideHandler=void 0,ce.contextMenuOutsideHandler1=void 0,ce.contextMenuOutsideHandler2=void 0,ce.mouseDownTimeout=void 0,ce.focusTime=void 0,ce.preClickTime=void 0,ce.preTouchTime=void 0,ce.delayTimer=void 0,ce.hasPopupMouseDown=void 0,ce.onMouseEnter=function(Me){var qe=ce.props.mouseEnterDelay;ce.fireEvents("onMouseEnter",Me),ce.delaySetPopupVisible(!0,qe,qe?null:Me)},ce.onMouseMove=function(Me){ce.fireEvents("onMouseMove",Me),ce.setPoint(Me)},ce.onMouseLeave=function(Me){ce.fireEvents("onMouseLeave",Me),ce.delaySetPopupVisible(!1,ce.props.mouseLeaveDelay)},ce.onPopupMouseEnter=function(){ce.clearDelayTimer()},ce.onPopupMouseLeave=function(Me){var qe;if(Me.relatedTarget&&!Me.relatedTarget.setTimeout&&Object(nn.a)((qe=ce.popupRef.current)===null||qe===void 0?void 0:qe.getElement(),Me.relatedTarget))return;ce.delaySetPopupVisible(!1,ce.props.mouseLeaveDelay)},ce.onFocus=function(Me){ce.fireEvents("onFocus",Me),ce.clearDelayTimer(),ce.isFocusToShow()&&(ce.focusTime=Date.now(),ce.delaySetPopupVisible(!0,ce.props.focusDelay))},ce.onMouseDown=function(Me){ce.fireEvents("onMouseDown",Me),ce.preClickTime=Date.now()},ce.onTouchStart=function(Me){ce.fireEvents("onTouchStart",Me),ce.preTouchTime=Date.now()},ce.onBlur=function(Me){ce.fireEvents("onBlur",Me),ce.clearDelayTimer(),ce.isBlurToHide()&&ce.delaySetPopupVisible(!1,ce.props.blurDelay)},ce.onContextMenu=function(Me){Me.preventDefault(),ce.fireEvents("onContextMenu",Me),ce.setPopupVisible(!0,Me)},ce.onContextMenuClose=function(){ce.isContextMenuToShow()&&ce.close()},ce.onClick=function(Me){if(ce.fireEvents("onClick",Me),ce.focusTime){var qe;if(ce.preClickTime&&ce.preTouchTime?qe=Math.min(ce.preClickTime,ce.preTouchTime):ce.preClickTime?qe=ce.preClickTime:ce.preTouchTime&&(qe=ce.preTouchTime),Math.abs(qe-ce.focusTime)<20)return;ce.focusTime=0}ce.preClickTime=0,ce.preTouchTime=0,ce.isClickToShow()&&(ce.isClickToHide()||ce.isBlurToHide())&&Me&&Me.preventDefault&&Me.preventDefault();var Ne=!ce.state.popupVisible;(ce.isClickToHide()&&!Ne||Ne&&ce.isClickToShow())&&ce.setPopupVisible(!ce.state.popupVisible,Me)},ce.onPopupMouseDown=function(){if(ce.hasPopupMouseDown=!0,clearTimeout(ce.mouseDownTimeout),ce.mouseDownTimeout=window.setTimeout(function(){ce.hasPopupMouseDown=!1},0),ce.context){var Me;(Me=ce.context).onPopupMouseDown.apply(Me,arguments)}},ce.onDocumentClick=function(Me){if(ce.props.mask&&!ce.props.maskClosable)return;var qe=Me.target,Ne=ce.getRootDomNode(),lt=ce.getPopupDomNode();(!Object(nn.a)(Ne,qe)||ce.isContextMenuOnly())&&!Object(nn.a)(lt,qe)&&!ce.hasPopupMouseDown&&ce.close()},ce.getRootDomNode=function(){var Me=ce.props.getTriggerDOMNode;if(Me)return Me(ce.triggerRef.current);try{var qe=Object(xn.a)(ce.triggerRef.current);if(qe)return qe}catch(Ne){}return qt.a.findDOMNode(Object(v.a)(ce))},ce.getPopupClassNameFromAlign=function(Me){var qe=[],Ne=ce.props,lt=Ne.popupPlacement,Nt=Ne.builtinPlacements,on=Ne.prefixCls,mn=Ne.alignPoint,Wn=Ne.getPopupClassNameFromAlign;return lt&&Nt&&qe.push(xt(Nt,on,Me,mn)),Wn&&qe.push(Wn(Me)),qe.join(" ")},ce.getComponent=function(){var Me=ce.props,qe=Me.prefixCls,Ne=Me.destroyPopupOnHide,lt=Me.popupClassName,Nt=Me.onPopupAlign,on=Me.popupMotion,mn=Me.popupAnimation,Wn=Me.popupTransitionName,Vn=Me.popupStyle,fr=Me.mask,cr=Me.maskAnimation,xr=Me.maskTransitionName,Rr=Me.maskMotion,gr=Me.zIndex,wr=Me.popup,Lr=Me.stretch,gn=Me.alignPoint,rn=Me.mobile,wn=Me.forceRender,zt=ce.state,Vt=zt.popupVisible,pr=zt.point,Pr=ce.getPopupAlign(),ar={};return ce.isMouseEnterToShow()&&(ar.onMouseEnter=ce.onPopupMouseEnter),ce.isMouseLeaveToHide()&&(ar.onMouseLeave=ce.onPopupMouseLeave),ar.onMouseDown=ce.onPopupMouseDown,ar.onTouchStart=ce.onPopupMouseDown,M.createElement(Tr,Object(w.a)({prefixCls:qe,destroyPopupOnHide:Ne,visible:Vt,point:gn&&pr,className:lt,align:Pr,onAlign:Nt,animation:mn,getClassNameFromAlign:ce.getPopupClassNameFromAlign},ar,{stretch:Lr,getRootDomNode:ce.getRootDomNode,style:Vn,mask:fr,zIndex:gr,transitionName:Wn,maskAnimation:cr,maskTransitionName:xr,maskMotion:Rr,ref:ce.popupRef,motion:on,mobile:rn,forceRender:wn}),typeof wr=="function"?wr():wr)},ce.attachParent=function(Me){tt.a.cancel(ce.attachId);var qe=ce.props,Ne=qe.getPopupContainer,lt=qe.getDocument,Nt=ce.getRootDomNode(),on;Ne?(Nt||Ne.length===0)&&(on=Ne(Nt)):on=lt(ce.getRootDomNode()).body,on?on.appendChild(Me):ce.attachId=Object(tt.a)(function(){ce.attachParent(Me)})},ce.getContainer=function(){var Me=ce.props.getDocument,qe=Me(ce.getRootDomNode()).createElement("div");return qe.style.position="absolute",qe.style.top="0",qe.style.left="0",qe.style.width="100%",ce.attachParent(qe),qe},ce.setPoint=function(Me){var qe=ce.props.alignPoint;if(!qe||!Me)return;ce.setState({point:{pageX:Me.pageX,pageY:Me.pageY}})},ce.handlePortalUpdate=function(){ce.state.prevPopupVisible!==ce.state.popupVisible&&ce.props.afterPopupVisibleChange(ce.state.popupVisible)},ce.triggerContextValue={onPopupMouseDown:ce.onPopupMouseDown};var Re;return"popupVisible"in ge?Re=!!ge.popupVisible:Re=!!ge.defaultPopupVisible,ce.state={prevPopupVisible:Re,popupVisible:Re},En.forEach(function(Me){ce["fire".concat(Me)]=function(qe){ce.fireEvents(Me,qe)}}),ce}return Object(S.a)(re,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ce=this.props,Re=this.state;if(Re.popupVisible){var Me;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Me=ce.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(He.a)(Me,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Me=Me||ce.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(He.a)(Me,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Me=Me||ce.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(He.a)(Me,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(He.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ce;return((ce=this.popupRef.current)===null||ce===void 0?void 0:ce.getElement())||null}},{key:"getPopupAlign",value:function(){var ce=this.props,Re=ce.popupPlacement,Me=ce.popupAlign,qe=ce.builtinPlacements;return Re&&qe?nt(qe,Re,Me):Me}},{key:"setPopupVisible",value:function(ce,Re){var Me=this.props.alignPoint,qe=this.state.popupVisible;this.clearDelayTimer(),qe!==ce&&("popupVisible"in this.props||this.setState({popupVisible:ce,prevPopupVisible:qe}),this.props.onPopupVisibleChange(ce)),Me&&Re&&ce&&this.setPoint(Re)}},{key:"delaySetPopupVisible",value:function(ce,Re,Me){var qe=this,Ne=Re*1e3;if(this.clearDelayTimer(),Ne){var lt=Me?{pageX:Me.pageX,pageY:Me.pageY}:null;this.delayTimer=window.setTimeout(function(){qe.setPopupVisible(ce,lt),qe.clearDelayTimer()},Ne)}else this.setPopupVisible(ce,Me)}},{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(ce){var Re=this.props.children.props,Me=this.props;return Re[ce]&&Me[ce]?this["fire".concat(ce)]:Re[ce]||Me[ce]}},{key:"isClickToShow",value:function(){var ce=this.props,Re=ce.action,Me=ce.showAction;return Re.indexOf("click")!==-1||Me.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ce=this.props.action;return ce==="contextMenu"||ce.length===1&&ce[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ce=this.props,Re=ce.action,Me=ce.showAction;return Re.indexOf("contextMenu")!==-1||Me.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ce=this.props,Re=ce.action,Me=ce.hideAction;return Re.indexOf("click")!==-1||Me.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ce=this.props,Re=ce.action,Me=ce.showAction;return Re.indexOf("hover")!==-1||Me.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ce=this.props,Re=ce.action,Me=ce.hideAction;return Re.indexOf("hover")!==-1||Me.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ce=this.props,Re=ce.action,Me=ce.showAction;return Re.indexOf("focus")!==-1||Me.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ce=this.props,Re=ce.action,Me=ce.hideAction;return Re.indexOf("focus")!==-1||Me.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ce;(ce=this.popupRef.current)===null||ce===void 0||ce.forceAlign()}}},{key:"fireEvents",value:function(ce,Re){var Me=this.props.children.props[ce];Me&&Me(Re);var qe=this.props[ce];qe&&qe(Re)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ce=this.state.popupVisible,Re=this.props,Me=Re.children,qe=Re.forceRender,Ne=Re.alignPoint,lt=Re.className,Nt=Re.autoDestroy,on=M.Children.only(Me),mn={key:"trigger"};this.isContextMenuToShow()?mn.onContextMenu=this.onContextMenu:mn.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(mn.onClick=this.onClick,mn.onMouseDown=this.onMouseDown,mn.onTouchStart=this.onTouchStart):(mn.onClick=this.createTwoChains("onClick"),mn.onMouseDown=this.createTwoChains("onMouseDown"),mn.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(mn.onMouseEnter=this.onMouseEnter,Ne&&(mn.onMouseMove=this.onMouseMove)):mn.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?mn.onMouseLeave=this.onMouseLeave:mn.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(mn.onFocus=this.onFocus,mn.onBlur=this.onBlur):(mn.onFocus=this.createTwoChains("onFocus"),mn.onBlur=this.createTwoChains("onBlur"));var Wn=K()(on&&on.props&&on.props.className,lt);Wn&&(mn.className=Wn);var Vn=Object(G.a)({},mn);Object(Ge.c)(on)&&(Vn.ref=Object(Ge.a)(this.triggerRef,on.ref));var fr=M.cloneElement(on,Vn),cr;return(ce||this.popupRef.current||qe)&&(cr=M.createElement(xe,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ce&&Nt&&(cr=null),M.createElement(Br.Provider,{value:this.triggerContextValue},fr,cr)}}],[{key:"getDerivedStateFromProps",value:function(ce,Re){var Me=ce.popupVisible,qe={};return Me!==void 0&&Re.popupVisible!==Me&&(qe.popupVisible=Me,qe.prevPopupVisible=Re.popupVisible),qe}}]),re}(M.Component);return je.contextType=Br,je.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:yn,getDocument:Sn,onPopupVisibleChange:Hn,afterPopupVisibleChange:Hn,onPopupAlign:Hn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},je}var sr=ur(vt.a),Q={adjustX:1,adjustY:1},de={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},Te={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},Se=de,rt=0,De={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Je=function(je,Ye,Oe){var re=pt(Ye),ge=je.getState();je.setState({defaultActiveFirst:Object(G.a)(Object(G.a)({},ge.defaultActiveFirst),{},Object(q.a)({},re,Oe))})},it=function(xe){Object(E.a)(Ye,xe);var je=Object(f.a)(Ye);function Ye(Oe){var re;Object(R.a)(this,Ye),re=je.call(this,Oe),re.onDestroy=function(Ne){re.props.onDestroy(Ne)},re.onKeyDown=function(Ne){var lt=Ne.keyCode,Nt=re.menuInstance,on=re.props.store,mn=re.getVisible();if(lt===o.a.ENTER)return re.onTitleClick(Ne),Je(on,re.props.eventKey,!0),!0;if(lt===o.a.RIGHT)return mn?Nt.onKeyDown(Ne):(re.triggerOpenChange(!0),Je(on,re.props.eventKey,!0)),!0;if(lt===o.a.LEFT){var Wn;if(mn)Wn=Nt.onKeyDown(Ne);else return;return Wn||(re.triggerOpenChange(!1),Wn=!0),Wn}return mn&&(lt===o.a.UP||lt===o.a.DOWN)?Nt.onKeyDown(Ne):void 0},re.onOpenChange=function(Ne){re.props.onOpenChange(Ne)},re.onPopupVisibleChange=function(Ne){re.triggerOpenChange(Ne,Ne?"mouseenter":"mouseleave")},re.onMouseEnter=function(Ne){var lt=re.props,Nt=lt.eventKey,on=lt.onMouseEnter,mn=lt.store;Je(mn,re.props.eventKey,!1),on({key:Nt,domEvent:Ne})},re.onMouseLeave=function(Ne){var lt=re.props,Nt=lt.parentMenu,on=lt.eventKey,mn=lt.onMouseLeave;Nt.subMenuInstance=Object(v.a)(re),mn({key:on,domEvent:Ne})},re.onTitleMouseEnter=function(Ne){var lt=re.props,Nt=lt.eventKey,on=lt.onItemHover,mn=lt.onTitleMouseEnter;on({key:Nt,hover:!0}),mn({key:Nt,domEvent:Ne})},re.onTitleMouseLeave=function(Ne){var lt=re.props,Nt=lt.parentMenu,on=lt.eventKey,mn=lt.onItemHover,Wn=lt.onTitleMouseLeave;Nt.subMenuInstance=Object(v.a)(re),mn({key:on,hover:!1}),Wn({key:on,domEvent:Ne})},re.onTitleClick=function(Ne){var lt=Object(v.a)(re),Nt=lt.props;if(Nt.onTitleClick({key:Nt.eventKey,domEvent:Ne}),Nt.triggerSubMenuAction==="hover")return;re.triggerOpenChange(!re.getVisible(),"click"),Je(Nt.store,re.props.eventKey,!1)},re.onSubMenuClick=function(Ne){typeof re.props.onClick=="function"&&re.props.onClick(re.addKeyPath(Ne))},re.onSelect=function(Ne){re.props.onSelect(Ne)},re.onDeselect=function(Ne){re.props.onDeselect(Ne)},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(Ne){re.menuInstance=Ne},re.addKeyPath=function(Ne){return Object(G.a)(Object(G.a)({},Ne),{},{keyPath:(Ne.keyPath||[]).concat(re.props.eventKey)})},re.triggerOpenChange=function(Ne,lt){var Nt=re.props.eventKey,on=function(){re.onOpenChange({key:Nt,item:Object(v.a)(re),trigger:lt,open:Ne})};lt==="mouseenter"?re.mouseenterTimeout=setTimeout(function(){on()},0):on()},re.isChildrenSelected=function(){var Ne={find:!1};return Ut(re.props.children,re.props.selectedKeys,Ne),Ne.find},re.isInlineMode=function(){return re.getMode()==="inline"},re.adjustWidth=function(){if(!re.subMenuTitle||!re.menuInstance)return;var Ne=Ht.findDOMNode(re.menuInstance);if(Ne.offsetWidth>=re.subMenuTitle.offsetWidth)return;Ne.style.minWidth="".concat(re.subMenuTitle.offsetWidth,"px")},re.saveSubMenuTitle=function(Ne){re.subMenuTitle=Ne},re.getBaseProps=function(){var Ne=Object(v.a)(re),lt=Ne.props,Nt=re.getMode();return{mode:Nt==="horizontal"?"vertical":Nt,visible:re.getVisible(),level:lt.level+1,inlineIndent:lt.inlineIndent,focusable:!1,onClick:re.onSubMenuClick,onSelect:re.onSelect,onDeselect:re.onDeselect,onDestroy:re.onDestroy,selectedKeys:lt.selectedKeys,eventKey:"".concat(lt.eventKey,"-menu-"),openKeys:lt.openKeys,motion:lt.motion,onOpenChange:re.onOpenChange,subMenuOpenDelay:lt.subMenuOpenDelay,parentMenu:Object(v.a)(re),subMenuCloseDelay:lt.subMenuCloseDelay,forceSubMenuRender:lt.forceSubMenuRender,triggerSubMenuAction:lt.triggerSubMenuAction,builtinPlacements:lt.builtinPlacements,defaultActiveFirst:lt.store.getState().defaultActiveFirst[pt(lt.eventKey)],multiple:lt.multiple,prefixCls:lt.rootPrefixCls,id:re.internalMenuId,manualRef:re.saveMenuInstance,itemIcon:lt.itemIcon,expandIcon:lt.expandIcon,direction:lt.direction}},re.getMotion=function(Ne,lt){var Nt=Object(v.a)(re),on=Nt.haveRendered,mn=re.props,Wn=mn.motion,Vn=mn.rootPrefixCls,fr=Object(G.a)(Object(G.a)({},Wn),{},{leavedClassName:"".concat(Vn,"-hidden"),removeOnLeave:!1,motionAppear:on||!lt||Ne!=="inline"});return fr};var ge=Oe.store,ce=Oe.eventKey,Re=ge.getState(),Me=Re.defaultActiveFirst;re.isRootMenu=!1;var qe=!1;return Me&&(qe=Me[ce]),Je(ge,ce,qe),re.state={mode:Oe.mode,isOpen:Oe.isOpen},re}return Object(S.a)(Ye,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var re=this,ge=this.props,ce=ge.mode,Re=ge.parentMenu,Me=ge.manualRef,qe=ge.isOpen,Ne=function(){re.setState({mode:ce,isOpen:qe})},lt=qe!==this.state.isOpen,Nt=ce!==this.state.mode;if((Nt||lt)&&(tt.a.cancel(this.updateStateRaf),Nt?this.updateStateRaf=Object(tt.a)(Ne):Ne()),Me&&Me(this),ce!=="horizontal"||!(Re==null?void 0:Re.isRootMenu)||!qe)return;this.minWidthTimeout=setTimeout(function(){return re.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var re=this.props,ge=re.onDestroy,ce=re.eventKey;ge&&ge(ce),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(re,ge){var ce=this.getBaseProps();return M.createElement(On,Object(w.a)({},ce,{id:this.internalMenuId,className:re,style:ge}),this.props.children)}},{key:"renderChildren",value:function(){var re=this,ge=this.getBaseProps(),ce=ge.mode,Re=ge.visible,Me=ge.forceSubMenuRender,qe=ge.direction,Ne=this.getMotion(ce,Re);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Re||Me,!this.haveOpened)return M.createElement("div",null);var lt=K()("".concat(ge.prefixCls,"-sub"),Object(q.a)({},"".concat(ge.prefixCls,"-rtl"),qe==="rtl"));return this.isInlineMode()?M.createElement(ne,Object(w.a)({visible:ge.visible,forceRender:Me},Ne),function(Nt){var on=Nt.className,mn=Nt.style,Wn=K()(lt,on);return re.renderPopupMenu(Wn,mn)}):this.renderPopupMenu(lt)}},{key:"render",value:function(){var re,ge,ce,Re=Object(G.a)({},this.props),Me=this.getVisible(),qe=this.getPrefixCls(),Ne=this.isInlineMode(),lt=this.getMode(),Nt=K()(qe,"".concat(qe,"-").concat(lt),(re={},Object(q.a)(re,Re.className,!!Re.className),Object(q.a)(re,this.getOpenClassName(),Me),Object(q.a)(re,this.getActiveClassName(),Re.active||Me&&!Ne),Object(q.a)(re,this.getDisabledClassName(),Re.disabled),Object(q.a)(re,this.getSelectedClassName(),this.isChildrenSelected()),re));this.internalMenuId||(Re.eventKey?this.internalMenuId="".concat(Re.eventKey,"$Menu"):(rt+=1,this.internalMenuId="$__$".concat(rt,"$Menu")));var on={},mn={},Wn={};Re.disabled||(on={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mn={onClick:this.onTitleClick},Wn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Vn={},fr=Re.direction,cr=fr==="rtl";Ne&&(cr?Vn.paddingRight=Re.inlineIndent*Re.level:Vn.paddingLeft=Re.inlineIndent*Re.level);var xr={};this.getVisible()&&(xr={"aria-owns":this.internalMenuId});var Rr=null;lt!=="horizontal"&&(Rr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Rr=M.createElement(this.props.expandIcon,Object(G.a)({},this.props))));var gr=M.createElement("div",Object(w.a)({ref:this.saveSubMenuTitle,style:Vn,className:"".concat(qe,"-title"),role:"button"},Wn,mn,{"aria-expanded":Me},xr,{"aria-haspopup":"true",title:typeof Re.title=="string"?Re.title:void 0}),Re.title,Rr||M.createElement("i",{className:"".concat(qe,"-arrow")})),wr=this.renderChildren(),Lr=((ge=Re.parentMenu)===null||ge===void 0?void 0:ge.isRootMenu)?Re.parentMenu.props.getPopupContainer:function(zr){return zr.parentNode},gn=De[lt],rn=Re.popupOffset?{offset:Re.popupOffset}:{},wn=K()((ce={},Object(q.a)(ce,Re.popupClassName,Re.popupClassName&&!Ne),Object(q.a)(ce,"".concat(qe,"-rtl"),cr),ce)),zt=Re.disabled,Vt=Re.triggerSubMenuAction,pr=Re.subMenuOpenDelay,Pr=Re.forceSubMenuRender,ar=Re.subMenuCloseDelay,Nr=Re.builtinPlacements;oe.forEach(function(zr){return delete Re[zr]}),delete Re.onClick;var si=cr?Object(G.a)(Object(G.a)({},Te),Nr):Object(G.a)(Object(G.a)({},de),Nr);delete Re.direction;var Ur=this.getBaseProps(),Xr=Ne?null:this.getMotion(Ur.mode,Ur.visible);return M.createElement("li",Object(w.a)({},Re,on,{className:Nt,role:"menuitem"}),M.createElement(sr,{prefixCls:qe,popupClassName:K()("".concat(qe,"-popup"),wn),getPopupContainer:Lr,builtinPlacements:si,popupPlacement:gn,popupVisible:Ne?!1:Me,popupAlign:rn,popup:Ne?null:wr,action:zt||Ne?[]:[Vt],mouseEnterDelay:pr,mouseLeaveDelay:ar,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Pr,popupMotion:Xr},gr),Ne?wr:null)}}]),Ye}(M.Component);it.defaultProps={onMouseEnter:Tt,onMouseLeave:Tt,onTitleMouseEnter:Tt,onTitleMouseLeave:Tt,onTitleClick:Tt,manualRef:Tt,mode:"vertical",title:""};var At=Object(h.b)(function(xe,je){var Ye=xe.openKeys,Oe=xe.activeKey,re=xe.selectedKeys,ge=je.eventKey,ce=je.subMenuKey;return{isOpen:Ye.indexOf(ge)>-1,active:Oe[ce]===ge,selectedKeys:re}})(it);At.isSubMenu=!0;var Ct=At,We="menuitem-overflowed",gt=.5,ot=function(xe){Object(E.a)(Ye,xe);var je=Object(f.a)(Ye);function Ye(){var Oe;return Object(R.a)(this,Ye),Oe=je.apply(this,arguments),Oe.resizeObserver=null,Oe.mutationObserver=null,Oe.originalTotalWidth=0,Oe.overflowedItems=[],Oe.menuItemSizes=[],Oe.cancelFrameId=null,Oe.state={lastVisibleIndex:void 0},Oe.childRef=M.createRef(),Oe.getMenuItemNodes=function(){var re=Oe.props.prefixCls,ge=Oe.childRef.current;return ge?[].slice.call(ge.children).filter(function(ce){return ce.className.split(" ").indexOf("".concat(re,"-overflowed-submenu"))<0}):[]},Oe.getOverflowedSubMenuItem=function(re,ge,ce){var Re=Oe.props,Me=Re.overflowedIndicator,qe=Re.level,Ne=Re.mode,lt=Re.prefixCls,Nt=Re.theme;if(qe!==1||Ne!=="horizontal")return null;var on=Oe.props.children[0],mn=on.props,Wn=mn.children,Vn=mn.title,fr=mn.style,cr=Object(U.a)(mn,["children","title","style"]),xr=Object(G.a)({},fr),Rr="".concat(re,"-overflowed-indicator"),gr="".concat(re,"-overflowed-indicator");ge.length===0&&ce!==!0?xr=Object(G.a)(Object(G.a)({},xr),{},{display:"none"}):ce&&(xr=Object(G.a)(Object(G.a)({},xr),{},{visibility:"hidden",position:"absolute"}),Rr="".concat(Rr,"-placeholder"),gr="".concat(gr,"-placeholder"));var wr=Nt?"".concat(lt,"-").concat(Nt):"",Lr={};return oe.forEach(function(gn){cr[gn]!==void 0&&(Lr[gn]=cr[gn])}),M.createElement(Ct,Object(w.a)({title:Me,className:"".concat(lt,"-overflowed-submenu"),popupClassName:wr},Lr,{key:Rr,eventKey:gr,disabled:!1,style:xr}),ge)},Oe.setChildrenWidthAndResize=function(){if(Oe.props.mode!=="horizontal")return;var re=Oe.childRef.current;if(!re)return;var ge=re.children;if(!ge||ge.length===0)return;var ce=re.children[ge.length-1];ze(ce,"display","inline-block");var Re=Oe.getMenuItemNodes(),Me=Re.filter(function(qe){return qe.className.split(" ").indexOf(We)>=0});Me.forEach(function(qe){ze(qe,"display","inline-block")}),Oe.menuItemSizes=Re.map(function(qe){return Ue(qe,!0)}),Me.forEach(function(qe){ze(qe,"display","none")}),Oe.overflowedIndicatorWidth=Ue(re.children[re.children.length-1],!0),Oe.originalTotalWidth=Oe.menuItemSizes.reduce(function(qe,Ne){return qe+Ne},0),Oe.handleResize(),ze(ce,"display","none")},Oe.handleResize=function(){if(Oe.props.mode!=="horizontal")return;var re=Oe.childRef.current;if(!re)return;var ge=Ue(re);Oe.overflowedItems=[];var ce=0,Re;Oe.originalTotalWidth>ge+gt&&(Re=-1,Oe.menuItemSizes.forEach(function(Me){ce+=Me,ce+Oe.overflowedIndicatorWidth<=ge&&(Re+=1)})),Oe.setState({lastVisibleIndex:Re})},Oe}return Object(S.a)(Ye,[{key:"componentDidMount",value:function(){var re=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ge=this.childRef.current;if(!ge)return;this.resizeObserver=new Bt.default(function(ce){ce.forEach(function(){var Re=re.cancelFrameId;cancelAnimationFrame(Re),re.cancelFrameId=requestAnimationFrame(re.setChildrenWidthAndResize)})}),[].slice.call(ge.children).concat(ge).forEach(function(ce){re.resizeObserver.observe(ce)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){re.resizeObserver.disconnect(),[].slice.call(ge.children).concat(ge).forEach(function(ce){re.resizeObserver.observe(ce)}),re.setChildrenWidthAndResize()}),this.mutationObserver.observe(ge,{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 ge=this,ce=this.state.lastVisibleIndex;return(re||[]).reduce(function(Re,Me,qe){var Ne=Me;if(ge.props.mode==="horizontal"){var lt=ge.getOverflowedSubMenuItem(Me.props.eventKey,[]);ce!==void 0&&ge.props.className.indexOf("".concat(ge.props.prefixCls,"-root"))!==-1&&(qe>ce&&(Ne=M.cloneElement(Me,{style:{display:"none"},eventKey:"".concat(Me.props.eventKey,"-hidden"),className:"".concat(We)})),qe===ce+1&&(ge.overflowedItems=re.slice(ce+1).map(function(on){return M.cloneElement(on,{key:on.props.eventKey,mode:"vertical-left"})}),lt=ge.getOverflowedSubMenuItem(Me.props.eventKey,ge.overflowedItems)));var Nt=[].concat(Object(P.a)(Re),[lt,Ne]);return qe===re.length-1&&Nt.push(ge.getOverflowedSubMenuItem(Me.props.eventKey,[],!0)),Nt}return[].concat(Object(P.a)(Re),[Ne])},[])}},{key:"render",value:function(){var re=this.props,ge=re.visible,ce=re.prefixCls,Re=re.overflowedIndicator,Me=re.mode,qe=re.level,Ne=re.tag,lt=re.children,Nt=re.theme,on=Object(U.a)(re,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),mn=Ne;return M.createElement(mn,Object(w.a)({ref:this.childRef},on),this.renderChildren(lt))}}]),Ye}(M.Component);ot.defaultProps={tag:"div",className:""};var dt=ot;function wt(xe){return xe.length?xe.every(function(je){return!!je.props.disabled}):!0}function kt(xe,je,Ye){var Oe=xe.getState();xe.setState({activeKey:Object(G.a)(Object(G.a)({},Oe.activeKey),{},Object(q.a)({},je,Ye))})}function mt(xe){return xe.eventKey||"0-menu-"}function $t(xe,je){var Ye=je,Oe=xe.children,re=xe.eventKey;if(Ye){var ge;if(ut(Oe,function(ce,Re){ce&&ce.props&&!ce.props.disabled&&Ye===Ve(ce,re,Re)&&(ge=!0)}),ge)return Ye}return Ye=null,xe.defaultActiveFirst&&ut(Oe,function(ce,Re){!Ye&&ce&&!ce.props.disabled&&(Ye=Ve(ce,re,Re))}),Ye}function hn(xe){if(!xe)return;var je=this.instanceArray.indexOf(xe);je!==-1?this.instanceArray[je]=xe:this.instanceArray.push(xe)}var Pn=function(xe){Object(E.a)(Ye,xe);var je=Object(f.a)(Ye);function Ye(Oe){var re;return Object(R.a)(this,Ye),re=je.call(this,Oe),re.onKeyDown=function(ge,ce){var Re=ge.keyCode,Me;if(re.getFlatInstanceArray().forEach(function(Ne){Ne&&Ne.props.active&&Ne.onKeyDown&&(Me=Ne.onKeyDown(ge))}),Me)return 1;var qe=null;return(Re===o.a.UP||Re===o.a.DOWN)&&(qe=re.step(Re===o.a.UP?-1:1)),qe?(ge.preventDefault(),kt(re.props.store,mt(re.props),qe.props.eventKey),typeof ce=="function"&&ce(qe),1):void 0},re.onItemHover=function(ge){var ce=ge.key,Re=ge.hover;kt(re.props.store,mt(re.props),Re?ce:null)},re.onDeselect=function(ge){re.props.onDeselect(ge)},re.onSelect=function(ge){re.props.onSelect(ge)},re.onClick=function(ge){re.props.onClick(ge)},re.onOpenChange=function(ge){re.props.onOpenChange(ge)},re.onDestroy=function(ge){re.props.onDestroy(ge)},re.getFlatInstanceArray=function(){return re.instanceArray},re.step=function(ge){var ce=re.getFlatInstanceArray(),Re=re.props.store.getState().activeKey[mt(re.props)],Me=ce.length;if(!Me)return null;ge<0&&(ce=ce.concat().reverse());var qe=-1;if(ce.every(function(on,mn){return on&&on.props.eventKey===Re?(qe=mn,!1):!0}),!re.props.defaultActiveFirst&&qe!==-1&&wt(ce.slice(qe,Me-1)))return;var Ne=(qe+1)%Me,lt=Ne;do{var Nt=ce[lt];if(!Nt||Nt.props.disabled)lt=(lt+1)%Me;else return Nt}while(lt!==Ne);return null},re.renderCommonMenuItem=function(ge,ce,Re){var Me=re.props.store.getState(),qe=Object(v.a)(re),Ne=qe.props,lt=Ve(ge,Ne.eventKey,ce),Nt=ge.props;if(!Nt||typeof ge.type=="string")return ge;var on=lt===Me.activeKey,mn=Object(G.a)(Object(G.a)({mode:Nt.mode||Ne.mode,level:Ne.level,inlineIndent:Ne.inlineIndent,renderMenuItem:re.renderMenuItem,rootPrefixCls:Ne.prefixCls,index:ce,parentMenu:Ne.parentMenu,manualRef:Nt.disabled?void 0:Object(g.a)(ge.ref,hn.bind(Object(v.a)(re))),eventKey:lt,active:!Nt.disabled&&on,multiple:Ne.multiple,onClick:function(Vn){(Nt.onClick||Tt)(Vn),re.onClick(Vn)},onItemHover:re.onItemHover,motion:Ne.motion,subMenuOpenDelay:Ne.subMenuOpenDelay,subMenuCloseDelay:Ne.subMenuCloseDelay,forceSubMenuRender:Ne.forceSubMenuRender,onOpenChange:re.onOpenChange,onDeselect:re.onDeselect,onSelect:re.onSelect,builtinPlacements:Ne.builtinPlacements,itemIcon:Nt.itemIcon||re.props.itemIcon,expandIcon:Nt.expandIcon||re.props.expandIcon},Re),{},{direction:Ne.direction});return(Ne.mode==="inline"||$e())&&(mn.triggerSubMenuAction="click"),M.cloneElement(ge,Object(G.a)(Object(G.a)({},mn),{},{key:lt||ce}))},re.renderMenuItem=function(ge,ce,Re){if(!ge)return null;var Me=re.props.store.getState(),qe={openKeys:Me.openKeys,selectedKeys:Me.selectedKeys,triggerSubMenuAction:re.props.triggerSubMenuAction,subMenuKey:Re};return re.renderCommonMenuItem(ge,ce,qe)},Oe.store.setState({activeKey:Object(G.a)(Object(G.a)({},Oe.store.getState().activeKey),{},Object(q.a)({},Oe.eventKey,$t(Oe,Oe.activeKey)))}),re.instanceArray=[],re}return Object(S.a)(Ye,[{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||!j()(this.props.style,re.style)}},{key:"componentDidUpdate",value:function(re){var ge=this.props,ce="activeKey"in ge?ge.activeKey:ge.store.getState().activeKey[mt(ge)],Re=$t(ge,ce);if(Re!==ce)kt(ge.store,mt(ge),Re);else if("activeKey"in re){var Me=$t(re,re.activeKey);Re!==Me&&kt(ge.store,mt(ge),Re)}}},{key:"render",value:function(){var re=this,ge=Object(w.a)({},this.props);this.instanceArray=[];var ce=K()(ge.prefixCls,ge.className,"".concat(ge.prefixCls,"-").concat(ge.mode)),Re={className:ce,role:ge.role||"menu"};ge.id&&(Re.id=ge.id),ge.focusable&&(Re.tabIndex=0,Re.onKeyDown=this.onKeyDown);var Me=ge.prefixCls,qe=ge.eventKey,Ne=ge.visible,lt=ge.level,Nt=ge.mode,on=ge.overflowedIndicator,mn=ge.theme;return oe.forEach(function(Wn){return delete ge[Wn]}),delete ge.onClick,M.createElement(dt,Object(w.a)({},ge,{prefixCls:Me,mode:Nt,tag:"ul",level:lt,theme:mn,visible:Ne,overflowedIndicator:on},Re),Object(I.a)(ge.children).map(function(Wn,Vn){return re.renderMenuItem(Wn,Vn,qe||"0-menu-")}))}}]),Ye}(M.Component);Pn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Tt};var Gn=Object(h.b)()(Pn),On=Gn,Nn=D("Kwbf");function Mn(xe,je,Ye){var Oe=xe.prefixCls,re=xe.motion,ge=xe.defaultMotions,ce=ge===void 0?{}:ge,Re=xe.openAnimation,Me=xe.openTransitionName,qe=je.switchingModeFromInline;if(re)return re;if(Object(F.a)(Re)==="object"&&Re)Object(Nn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Re=="string")return{motionName:"".concat(Oe,"-open-").concat(Re)};if(Me)return{motionName:Me};var Ne=ce[Ye];return Ne||(qe?null:ce.other)}var Pt=function(xe){Object(E.a)(Ye,xe);var je=Object(f.a)(Ye);function Ye(Oe){var re;Object(R.a)(this,Ye),re=je.call(this,Oe),re.onSelect=function(Re){var Me=Object(v.a)(re),qe=Me.props;if(qe.selectable){var Ne=re.store.getState(),lt=Ne.selectedKeys,Nt=Re.key;qe.multiple?lt=lt.concat([Nt]):lt=[Nt],"selectedKeys"in qe||re.store.setState({selectedKeys:lt}),qe.onSelect(Object(G.a)(Object(G.a)({},Re),{},{selectedKeys:lt}))}},re.onClick=function(Re){var Me=re.getRealMenuMode(),qe=Object(v.a)(re),Ne=qe.store,lt=qe.props.onOpenChange;Me!=="inline"&&!("openKeys"in re.props)&&(Ne.setState({openKeys:[]}),lt([])),re.props.onClick(Re)},re.onKeyDown=function(Re,Me){re.innerMenu.getWrappedInstance().onKeyDown(Re,Me)},re.onOpenChange=function(Re){var Me=Object(v.a)(re),qe=Me.props,Ne=re.store.getState().openKeys.concat(),lt=!1,Nt=function(mn){var Wn=!1;if(mn.open)Wn=Ne.indexOf(mn.key)===-1,Wn&&Ne.push(mn.key);else{var Vn=Ne.indexOf(mn.key);Wn=Vn!==-1,Wn&&Ne.splice(Vn,1)}lt=lt||Wn};Array.isArray(Re)?Re.forEach(Nt):Nt(Re),lt&&("openKeys"in re.props||re.store.setState({openKeys:Ne}),qe.onOpenChange(Ne))},re.onDeselect=function(Re){var Me=Object(v.a)(re),qe=Me.props;if(qe.selectable){var Ne=re.store.getState().selectedKeys.concat(),lt=Re.key,Nt=Ne.indexOf(lt);Nt!==-1&&Ne.splice(Nt,1),"selectedKeys"in qe||re.store.setState({selectedKeys:Ne}),qe.onDeselect(Object(G.a)(Object(G.a)({},Re),{},{selectedKeys:Ne}))}},re.onMouseEnter=function(Re){re.restoreModeVerticalFromInline();var Me=re.props.onMouseEnter;Me&&Me(Re)},re.onTransitionEnd=function(Re){var Me=Re.propertyName==="width"&&Re.target===Re.currentTarget,qe=Re.target.className,Ne=Object.prototype.toString.call(qe)==="[object SVGAnimatedString]"?qe.animVal:qe,lt=Re.propertyName==="font-size"&&Ne.indexOf("anticon")>=0;(Me||lt)&&re.restoreModeVerticalFromInline()},re.setInnerMenu=function(Re){re.innerMenu=Re},re.isRootMenu=!0;var ge=Oe.defaultSelectedKeys,ce=Oe.defaultOpenKeys;return"selectedKeys"in Oe&&(ge=Oe.selectedKeys||[]),"openKeys"in Oe&&(ce=Oe.openKeys||[]),re.store=Object(h.c)({selectedKeys:ge,openKeys:ce,activeKey:{"0-menu-":$t(Oe,Oe.activeKey)}}),re.state={switchingModeFromInline:!1,prevProps:Oe,inlineOpenKeys:[],store:re.store},re}return Object(S.a)(Ye,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(re){var ge=this.props,ce=ge.siderCollapsed,Re=ge.inlineCollapsed,Me=ge.onOpenChange;(!re.inlineCollapsed&&Re||!re.siderCollapsed&&ce)&&Me([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var re=this.props.collapsedWidth,ge=this.store,ce=this.prevOpenKeys,Re=this.getInlineCollapsed()&&(re===0||re==="0"||re==="0px");Re?(this.prevOpenKeys=ge.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ce&&(this.store.setState({openKeys:ce}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var re=this.props.mode,ge=this.state.switchingModeFromInline,ce=this.getInlineCollapsed();return ge&&ce?"inline":ce?"vertical":re}},{key:"getInlineCollapsed",value:function(){var re=this.props,ge=re.inlineCollapsed,ce=re.siderCollapsed;return ce!==void 0?ce:ge}},{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(G.a)({},Object(y.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ge=this.getRealMenuMode();return re.className+=" ".concat(re.prefixCls,"-root"),re.direction==="rtl"&&(re.className+=" ".concat(re.prefixCls,"-rtl")),re=Object(G.a)(Object(G.a)({},re),{},{mode:ge,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Mn(this.props,this.state,ge)}),delete re.openAnimation,delete re.openTransitionName,M.createElement(h.a,{store:this.store},M.createElement(On,Object(w.a)({},re,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(re,ge){var ce=ge.prevProps,Re=ge.store,Me=Re.getState(),qe={},Ne={prevProps:re};return ce.mode==="inline"&&re.mode!=="inline"&&(Ne.switchingModeFromInline=!0),"openKeys"in re?qe.openKeys=re.openKeys||[]:((re.inlineCollapsed&&!ce.inlineCollapsed||re.siderCollapsed&&!ce.siderCollapsed)&&(Ne.switchingModeFromInline=!0,Ne.inlineOpenKeys=Me.openKeys,qe.openKeys=[]),(!re.inlineCollapsed&&ce.inlineCollapsed||!re.siderCollapsed&&ce.siderCollapsed)&&(qe.openKeys=ge.inlineOpenKeys,Ne.inlineOpenKeys=[])),Object.keys(qe).length&&Re.setState(qe),Ne}}]),Ye}(M.Component);Pt.defaultProps={selectable:!0,onClick:Tt,onSelect:Tt,onOpenChange:Tt,onDeselect:Tt,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:M.createElement("span",null,"\xB7\xB7\xB7")};var fn=Pt,Wt=function(xe){Object(E.a)(Ye,xe);var je=Object(f.a)(Ye);function Ye(){var Oe;return Object(R.a)(this,Ye),Oe=je.apply(this,arguments),Oe.onKeyDown=function(re){var ge=re.keyCode;return ge===o.a.ENTER?(Oe.onClick(re),!0):void 0},Oe.onMouseLeave=function(re){var ge=Oe.props,ce=ge.eventKey,Re=ge.onItemHover,Me=ge.onMouseLeave;Re({key:ce,hover:!1}),Me({key:ce,domEvent:re})},Oe.onMouseEnter=function(re){var ge=Oe.props,ce=ge.eventKey,Re=ge.onItemHover,Me=ge.onMouseEnter;Re({key:ce,hover:!0}),Me({key:ce,domEvent:re})},Oe.onClick=function(re){var ge=Oe.props,ce=ge.eventKey,Re=ge.multiple,Me=ge.onClick,qe=ge.onSelect,Ne=ge.onDeselect,lt=ge.isSelected,Nt={key:ce,keyPath:[ce],item:Object(v.a)(Oe),domEvent:re};Me(Nt),Re?lt?Ne(Nt):qe(Nt):lt||qe(Nt)},Oe.saveNode=function(re){Oe.node=re},Oe}return Object(S.a)(Ye,[{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,ge=Object(G.a)({},this.props),ce=K()(this.getPrefixCls(),ge.className,(re={},Object(q.a)(re,this.getActiveClassName(),!ge.disabled&&ge.active),Object(q.a)(re,this.getSelectedClassName(),ge.isSelected),Object(q.a)(re,this.getDisabledClassName(),ge.disabled),re)),Re=Object(G.a)(Object(G.a)({},ge.attribute),{},{title:typeof ge.title=="string"?ge.title:void 0,className:ce,role:ge.role||"menuitem","aria-disabled":ge.disabled});ge.role==="option"?Re=Object(G.a)(Object(G.a)({},Re),{},{role:"option","aria-selected":ge.isSelected}):(ge.role===null||ge.role==="none")&&(Re.role="none");var Me={onClick:ge.disabled?null:this.onClick,onMouseLeave:ge.disabled?null:this.onMouseLeave,onMouseEnter:ge.disabled?null:this.onMouseEnter},qe=Object(G.a)({},ge.style);ge.mode==="inline"&&(ge.direction==="rtl"?qe.paddingRight=ge.inlineIndent*ge.level:qe.paddingLeft=ge.inlineIndent*ge.level),oe.forEach(function(lt){return delete ge[lt]}),delete ge.direction;var Ne=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ne=M.createElement(this.props.itemIcon,this.props)),M.createElement("li",Object(w.a)({},Object(y.a)(ge,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Re,Me,{style:qe,ref:this.saveNode}),ge.children,Ne)}}]),Ye}(M.Component);Wt.isMenuItem=!0,Wt.defaultProps={onSelect:Tt,onMouseEnter:Tt,onMouseLeave:Tt,manualRef:Tt};var Rt=Object(h.b)(function(xe,je){var Ye=xe.activeKey,Oe=xe.selectedKeys,re=je.eventKey,ge=je.subMenuKey;return{active:Ye[ge]===re,isSelected:Array.isArray(Oe)?Oe.indexOf(re)!==-1:Oe===re}})(Wt),Un=Rt,Rn=function(xe){Object(E.a)(Ye,xe);var je=Object(f.a)(Ye);function Ye(){var Oe;return Object(R.a)(this,Ye),Oe=je.apply(this,arguments),Oe.renderInnerMenuItem=function(re){var ge=Oe.props,ce=ge.renderMenuItem,Re=ge.index;return ce(re,Re,Oe.props.subMenuKey)},Oe}return Object(S.a)(Ye,[{key:"render",value:function(){var re=Object(w.a)({},this.props),ge=re.className,ce=ge===void 0?"":ge,Re=re.rootPrefixCls,Me="".concat(Re,"-item-group-title"),qe="".concat(Re,"-item-group-list"),Ne=re.title,lt=re.children;return oe.forEach(function(Nt){return delete re[Nt]}),delete re.direction,M.createElement("li",Object(w.a)({},re,{onClick:function(on){return on.stopPropagation()},className:"".concat(ce," ").concat(Re,"-item-group")}),M.createElement("div",{className:Me,title:typeof Ne=="string"?Ne:void 0},Ne),M.createElement("ul",{className:qe},M.Children.map(lt,this.renderInnerMenuItem)))}}]),Ye}(M.Component);Rn.isMenuItemGroup=!0,Rn.defaultProps={disabled:!0};var Yt=Rn,ht=function(je){var Ye=je.className,Oe=je.rootPrefixCls,re=je.style;return M.createElement("li",{className:"".concat(Ye," ").concat(Oe,"-item-divider"),style:re})};ht.defaultProps={disabled:!0,className:"",style:{}};var jn=ht,pn=fn,qn=D("eDIo");function Zt(xe,je){var Ye=xe.prefixCls,Oe=xe.editable,re=xe.locale,ge=xe.style;return!Oe||Oe.showAdd===!1?null:M.createElement("button",{ref:je,type:"button",className:"".concat(Ye,"-nav-add"),style:ge,"aria-label":(re==null?void 0:re.addAriaLabel)||"Add tab",onClick:function(Re){Oe.onEdit("add",{event:Re})}},Oe.addIcon||"+")}var An=M.forwardRef(Zt);function Fn(xe,je){var Ye=xe.prefixCls,Oe=xe.id,re=xe.tabs,ge=xe.locale,ce=xe.mobile,Re=xe.moreIcon,Me=Re===void 0?"More":Re,qe=xe.moreTransitionName,Ne=xe.style,lt=xe.className,Nt=xe.editable,on=xe.tabBarGutter,mn=xe.rtl,Wn=xe.onTabClick,Vn=Object(M.useState)(!1),fr=Object(Y.a)(Vn,2),cr=fr[0],xr=fr[1],Rr=Object(M.useState)(null),gr=Object(Y.a)(Rr,2),wr=gr[0],Lr=gr[1],gn="".concat(Oe,"-more-popup"),rn="".concat(Ye,"-dropdown"),wn=wr!==null?"".concat(gn,"-").concat(wr):null,zt=ge==null?void 0:ge.dropdownAriaLabel,Vt=M.createElement(pn,{onClick:function(Xr){var zr=Xr.key,Wr=Xr.domEvent;Wn(zr,Wr),xr(!1)},id:gn,tabIndex:-1,role:"listbox","aria-activedescendant":wn,selectedKeys:[wr],"aria-label":zt!==void 0?zt:"expanded dropdown"},re.map(function(Ur){return M.createElement(Un,{key:Ur.key,id:"".concat(gn,"-").concat(Ur.key),role:"option","aria-controls":Oe&&"".concat(Oe,"-panel-").concat(Ur.key),disabled:Ur.disabled},Ur.tab)}));function pr(Ur){for(var Xr=re.filter(function(yi){return!yi.disabled}),zr=Xr.findIndex(function(yi){return yi.key===wr})||0,Wr=Xr.length,Hr=0;Hr<Wr;Hr+=1){zr=(zr+Ur+Wr)%Wr;var vr=Xr[zr];if(!vr.disabled){Lr(vr.key);return}}}function Pr(Ur){var Xr=Ur.which;if(!cr){[o.a.DOWN,o.a.SPACE,o.a.ENTER].includes(Xr)&&(xr(!0),Ur.preventDefault());return}switch(Xr){case o.a.UP:pr(-1),Ur.preventDefault();break;case o.a.DOWN:pr(1),Ur.preventDefault();break;case o.a.ESC:xr(!1);break;case o.a.SPACE:case o.a.ENTER:wr!==null&&Wn(wr,Ur);break}}Object(M.useEffect)(function(){var Ur=document.getElementById(wn);Ur&&Ur.scrollIntoView&&Ur.scrollIntoView(!1)},[wr]),Object(M.useEffect)(function(){cr||Lr(null)},[cr]);var ar=Object(q.a)({},mn?"marginLeft":"marginRight",on);re.length||(ar.visibility="hidden",ar.order=1);var Nr=K()(Object(q.a)({},"".concat(rn,"-rtl"),mn)),si=ce?null:M.createElement(qn.a,{prefixCls:rn,overlay:Vt,trigger:["hover"],visible:cr,transitionName:qe,onVisibleChange:xr,overlayClassName:Nr,mouseEnterDelay:.1,mouseLeaveDelay:.1},M.createElement("button",{type:"button",className:"".concat(Ye,"-nav-more"),style:ar,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":gn,id:"".concat(Oe,"-more"),"aria-expanded":cr,onKeyDown:Pr},Me));return M.createElement("div",{className:K()("".concat(Ye,"-nav-operations"),lt),style:Ne,ref:je},si,M.createElement(An,{prefixCls:Ye,locale:ge,editable:Nt}))}var vn=M.forwardRef(Fn),yr=Object(M.createContext)(null),Ln=.1,Cn=.01,Dt=20,Ze=Math.pow(.995,Dt);function It(){var xe=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(xe)||/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(xe.substr(0,4)))}function Mt(xe,je){var Ye=Object(M.useState)(),Oe=Object(Y.a)(Ye,2),re=Oe[0],ge=Oe[1],ce=Object(M.useState)(0),Re=Object(Y.a)(ce,2),Me=Re[0],qe=Re[1],Ne=Object(M.useState)(0),lt=Object(Y.a)(Ne,2),Nt=lt[0],on=lt[1],mn=Object(M.useState)(),Wn=Object(Y.a)(mn,2),Vn=Wn[0],fr=Wn[1],cr=Object(M.useRef)();function xr(zt){var Vt=zt.touches[0],pr=Vt.screenX,Pr=Vt.screenY;ge({x:pr,y:Pr}),window.clearInterval(cr.current)}function Rr(zt){if(!re)return;zt.preventDefault();var Vt=zt.touches[0],pr=Vt.screenX,Pr=Vt.screenY;ge({x:pr,y:Pr});var ar=pr-re.x,Nr=Pr-re.y;je(ar,Nr);var si=Date.now();qe(si),on(si-Me),fr({x:ar,y:Nr})}function gr(){if(!re)return;if(ge(null),fr(null),Vn){var zt=Vn.x/Nt,Vt=Vn.y/Nt,pr=Math.abs(zt),Pr=Math.abs(Vt);if(Math.max(pr,Pr)<Ln)return;var ar=zt,Nr=Vt;cr.current=window.setInterval(function(){if(Math.abs(ar)<Cn&&Math.abs(Nr)<Cn){window.clearInterval(cr.current);return}ar*=Ze,Nr*=Ze,je(ar*Dt,Nr*Dt)},Dt)}}var wr=Object(M.useRef)(0),Lr=Object(M.useRef)(!1),gn=Object(M.useRef)();function rn(zt){var Vt=zt.deltaX,pr=zt.deltaY,Pr=0,ar=Math.abs(Vt),Nr=Math.abs(pr);ar===Nr?Pr=gn.current==="x"?Vt:pr:ar>Nr?(Pr=Vt,gn.current="x"):(Pr=pr,gn.current="y");var si=Date.now();si-wr.current>100&&(Lr.current=!1),(je(-Pr,-Pr)||Lr.current)&&(zt.preventDefault(),Lr.current=!0),wr.current=si}var wn=Object(M.useRef)(null);wn.current={onTouchStart:xr,onTouchMove:Rr,onTouchEnd:gr,onWheel:rn},M.useEffect(function(){function zt(ar){wn.current.onTouchStart(ar)}function Vt(ar){wn.current.onTouchMove(ar)}function pr(ar){wn.current.onTouchEnd(ar)}function Pr(ar){wn.current.onWheel(ar)}return document.addEventListener("touchmove",Vt,{passive:!1}),document.addEventListener("touchend",pr,{passive:!1}),xe.current.addEventListener("touchstart",zt,{passive:!1}),xe.current.addEventListener("wheel",Pr),function(){document.removeEventListener("touchmove",Vt),document.removeEventListener("touchend",pr)}},[])}function cn(){var xe=Object(M.useRef)(new Map);function je(Oe){return xe.current.has(Oe)||xe.current.set(Oe,M.createRef()),xe.current.get(Oe)}function Ye(Oe){xe.current.delete(Oe)}return[je,Ye]}function zn(xe,je){var Ye=M.useRef(xe),Oe=M.useState({}),re=Object(Y.a)(Oe,2),ge=re[1];function ce(Re){var Me=typeof Re=="function"?Re(Ye.current):Re;Me!==Ye.current&&je(Me,Ye.current),Ye.current=Me,ge({})}return[Ye.current,ce]}var kn=function(je){var Ye=je.position,Oe=je.prefixCls,re=je.extra;if(!re)return null;var ge,ce=re;return Ye==="right"&&(ge=ce.right||!ce.left&&ce||null),Ye==="left"&&(ge=ce.left||null),ge?M.createElement("div",{className:"".concat(Oe,"-extra-content")},ge):null};function lr(xe,je){var Ye,Oe=M.useContext(yr),re=Oe.prefixCls,ge=Oe.tabs,ce=xe.className,Re=xe.style,Me=xe.id,qe=xe.animated,Ne=xe.activeKey,lt=xe.rtl,Nt=xe.extra,on=xe.editable,mn=xe.locale,Wn=xe.tabPosition,Vn=xe.tabBarGutter,fr=xe.children,cr=xe.onTabClick,xr=xe.onTabScroll,Rr=Object(M.useRef)(),gr=Object(M.useRef)(),wr=Object(M.useRef)(),Lr=Object(M.useRef)(),gn=cn(),rn=Object(Y.a)(gn,2),wn=rn[0],zt=rn[1],Vt=Wn==="top"||Wn==="bottom",pr=zn(0,function($r,Ir){Vt&&xr&&xr({direction:$r>Ir?"left":"right"})}),Pr=Object(Y.a)(pr,2),ar=Pr[0],Nr=Pr[1],si=zn(0,function($r,Ir){!Vt&&xr&&xr({direction:$r>Ir?"top":"bottom"})}),Ur=Object(Y.a)(si,2),Xr=Ur[0],zr=Ur[1],Wr=Object(M.useState)(0),Hr=Object(Y.a)(Wr,2),vr=Hr[0],yi=Hr[1],Qi=Object(M.useState)(0),ji=Object(Y.a)(Qi,2),Ri=ji[0],ci=ji[1],qr=Object(M.useState)(0),ai=Object(Y.a)(qr,2),di=ai[0],Fi=ai[1],ha=Object(M.useState)(0),sa=Object(Y.a)(ha,2),ei=sa[0],Zi=sa[1],qi=Object(M.useState)(null),li=Object(Y.a)(qi,2),Qr=li[0],Ti=li[1],Ma=Object(M.useState)(null),no=Object(Y.a)(Ma,2),la=no[0],Ca=no[1],Ta=Object(M.useState)(0),Sa=Object(Y.a)(Ta,2),ka=Sa[0],co=Sa[1],Ro=Object(M.useState)(0),za=Object(Y.a)(Ro,2),Oa=za[0],Va=za[1],_a=a(new Map),Ra=Object(Y.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=n(ge,ho,vr),Da="".concat(re,"-nav-operations-hidden"),ya=0,Ni=0;Vt?lt?(ya=0,Ni=Math.max(0,vr-Qr)):(ya=Math.min(0,Qr-vr),Ni=0):(ya=Math.min(0,la-Ri),Ni=0);function fa($r){return $r<ya?[ya,!1]:$r>Ni?[Ni,!1]:[$r,!0]}var pa=Object(M.useRef)(),ba=Object(M.useState)(),ma=Object(Y.a)(ba,2),Xa=ma[0],$a=ma[1];function Ja(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}Mt(Rr,function($r,Ir){var gi=!1;function Bi(La,ca){La(function(ja){var da=fa(ja+ca),Si=Object(Y.a)(da,2),Fa=Si[0],Ba=Si[1];return gi=Ba,Fa})}if(Vt){if(Qr>=vr)return gi;Bi(Nr,$r)}else{if(la>=Ri)return gi;Bi(zr,Ir)}return Ia(),Ja(),gi}),Object(M.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ua(){var $r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ne,Ir=Aa.get($r);if(!Ir)return;if(Vt){var gi=ar;lt?Ir.right<ar?gi=Ir.right:Ir.right+Ir.width>ar+Qr&&(gi=Ir.right+Ir.width-Qr):Ir.left<-ar?gi=-Ir.left:Ir.left+Ir.width>-ar+Qr&&(gi=-(Ir.left+Ir.width-Qr)),zr(0),Nr(fa(gi)[0])}else{var Bi=Xr;Ir.top<-Xr?Bi=-Ir.top:Ir.top+Ir.height>-Xr+la&&(Bi=-(Ir.top+Ir.height-la)),Nr(0),zr(fa(Bi)[0])}}var Ea=T(Aa,{width:Qr,height:la,left:ar,top:Xr},{width:di,height:ei},{width:ka,height:Oa},Object(G.a)(Object(G.a)({},xe),{},{tabs:ge})),ro=Object(Y.a)(Ea,2),Ao=ro[0],Do=ro[1],fo=ge.map(function($r){var Ir=$r.key;return M.createElement(s,{id:Me,prefixCls:re,key:Ir,rtl:lt,tab:$r,closable:$r.closable,editable:on,active:Ir===Ne,tabPosition:Wn,tabBarGutter:Vn,renderWrapper:fr,removeAriaLabel:mn==null?void 0:mn.removeAriaLabel,ref:wn(Ir),onClick:function(Bi){cr(Ir,Bi)},onRemove:function(){zt(Ir)},onFocus:function(){ua(Ir),Ja(),lt||(Rr.current.scrollLeft=0),Rr.current.scrollTop=0}})}),io=u(function(){var $r,Ir,gi,Bi,La,ca,ja,da,Si,Fa=(($r=Rr.current)===null||$r===void 0?void 0:$r.offsetWidth)||0,Ba=((Ir=Rr.current)===null||Ir===void 0?void 0:Ir.offsetHeight)||0,Ha=((gi=Lr.current)===null||gi===void 0?void 0:gi.offsetWidth)||0,Gi=((Bi=Lr.current)===null||Bi===void 0?void 0:Bi.offsetHeight)||0,Vr=((La=wr.current)===null||La===void 0?void 0:La.offsetWidth)||0,Sr=((ca=wr.current)===null||ca===void 0?void 0:ca.offsetHeight)||0;Ti(Fa),Ca(Ba),co(Ha),Va(Gi);var Jn=(((ja=gr.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,dr=(((da=gr.current)===null||da===void 0?void 0:da.offsetHeight)||0)-Gi;yi(Jn),ci(dr);var kr=(Si=wr.current)===null||Si===void 0?void 0:Si.className.includes(Da);Fi(Jn-(kr?0:Vr)),Zi(dr-(kr?0:Sr)),Ya(function(){var pi=new Map;return ge.forEach(function(ga){var aa=ga.key,Mi=wn(aa).current;Mi&&pi.set(aa,{width:Mi.offsetWidth,height:Mi.offsetHeight,left:Mi.offsetLeft,top:Mi.offsetTop})}),pi})}),po=ge.slice(0,Ao),Ki=ge.slice(Do+1),bi=[].concat(Object(P.a)(po),Object(P.a)(Ki)),Pi=Object(M.useState)(),Ei=Object(Y.a)(Pi,2),Na=Ei[0],mo=Ei[1],ea=Aa.get(Ne),ao=Object(M.useRef)();function oo(){p.a.cancel(ao.current)}Object(M.useEffect)(function(){var $r={};return ea&&(Vt?(lt?$r.right=ea.right:$r.left=ea.left,$r.width=ea.width):($r.top=ea.top,$r.height=ea.height)),oo(),ao.current=p()(function(){mo($r)}),oo},[ea,Vt,lt]),Object(M.useEffect)(function(){ua()},[Ne,ea,Aa,Vt]),Object(M.useEffect)(function(){io()},[lt,Vn,Ne,ge.map(function($r){return $r.key}).join("_")]);var so=!!bi.length,xa="".concat(re,"-nav-wrap"),Qa,Ua,go,Za;return Vt?lt?(Ua=ar>0,Qa=ar+Qr<vr):(Qa=ar<0,Ua=-ar+Qr<vr):(go=Xr<0,Za=-Xr+la<Ri),M.createElement("div",{ref:je,role:"tablist",className:K()("".concat(re,"-nav"),ce),style:Re,onKeyDown:function(){Ja()}},M.createElement(kn,{position:"left",extra:Nt,prefixCls:re}),M.createElement(m.a,{onResize:io},M.createElement("div",{className:K()(xa,(Ye={},Object(q.a)(Ye,"".concat(xa,"-ping-left"),Qa),Object(q.a)(Ye,"".concat(xa,"-ping-right"),Ua),Object(q.a)(Ye,"".concat(xa,"-ping-top"),go),Object(q.a)(Ye,"".concat(xa,"-ping-bottom"),Za),Ye)),ref:Rr},M.createElement(m.a,{onResize:io},M.createElement("div",{ref:gr,className:"".concat(re,"-nav-list"),style:{transform:"translate(".concat(ar,"px, ").concat(Xr,"px)"),transition:Xa?"none":void 0}},fo,M.createElement(An,{ref:Lr,prefixCls:re,locale:mn,editable:on,style:{visibility:so?"hidden":null}}),M.createElement("div",{className:K()("".concat(re,"-ink-bar"),Object(q.a)({},"".concat(re,"-ink-bar-animated"),qe.inkBar)),style:Na}))))),M.createElement(vn,Object.assign({},xe,{ref:wr,prefixCls:re,tabs:bi,className:!so&&Da})),M.createElement(kn,{position:"right",extra:Nt,prefixCls:re}))}var nr=M.forwardRef(lr);function Or(xe){var je=xe.id,Ye=xe.activeKey,Oe=xe.animated,re=xe.tabPosition,ge=xe.rtl,ce=xe.destroyInactiveTabPane,Re=M.useContext(yr),Me=Re.prefixCls,qe=Re.tabs,Ne=Oe.tabPane,lt=qe.findIndex(function(Nt){return Nt.key===Ye});return M.createElement("div",{className:K()("".concat(Me,"-content-holder"))},M.createElement("div",{className:K()("".concat(Me,"-content"),"".concat(Me,"-content-").concat(re),Object(q.a)({},"".concat(Me,"-content-animated"),Ne)),style:lt&&Ne?Object(q.a)({},ge?"marginRight":"marginLeft","-".concat(lt,"00%")):null},qe.map(function(Nt){return M.cloneElement(Nt.node,{key:Nt.key,prefixCls:Me,tabKey:Nt.key,id:je,animated:Ne,active:Nt.key===Ye,destroyInactiveTabPane:ce})})))}function mr(xe){var je=xe.prefixCls,Ye=xe.forceRender,Oe=xe.className,re=xe.style,ge=xe.id,ce=xe.active,Re=xe.animated,Me=xe.destroyInactiveTabPane,qe=xe.tabKey,Ne=xe.children,lt=M.useState(Ye),Nt=Object(Y.a)(lt,2),on=Nt[0],mn=Nt[1];M.useEffect(function(){ce?mn(!0):Me&&mn(!1)},[ce,Me]);var Wn={};return ce||(Re?(Wn.visibility="hidden",Wn.height=0,Wn.overflowY="hidden"):Wn.display="none"),M.createElement("div",{id:ge&&"".concat(ge,"-panel-").concat(qe),role:"tabpanel",tabIndex:ce?0:-1,"aria-labelledby":ge&&"".concat(ge,"-tab-").concat(qe),"aria-hidden":!ce,style:Object(G.a)(Object(G.a)({},Wn),re),className:K()("".concat(je,"-tabpane"),ce&&"".concat(je,"-tabpane-active"),Oe)},(ce||on||Ye)&&Ne)}var Er=0;function Zr(xe){return Object(I.a)(xe).map(function(je){if(M.isValidElement(je)){var Ye=je.key!==void 0?String(je.key):void 0;return Object(G.a)(Object(G.a)({key:Ye},je.props),{},{node:je})}return null}).filter(function(je){return je})}function Yr(xe,je){var Ye,Oe=xe.id,re=xe.prefixCls,ge=re===void 0?"rc-tabs":re,ce=xe.className,Re=xe.children,Me=xe.direction,qe=xe.activeKey,Ne=xe.defaultActiveKey,lt=xe.editable,Nt=xe.animated,on=xe.tabPosition,mn=on===void 0?"top":on,Wn=xe.tabBarGutter,Vn=xe.tabBarStyle,fr=xe.tabBarExtraContent,cr=xe.locale,xr=xe.moreIcon,Rr=xe.moreTransitionName,gr=xe.destroyInactiveTabPane,wr=xe.renderTabBar,Lr=xe.onChange,gn=xe.onTabClick,rn=xe.onTabScroll,wn=Object(U.a)(xe,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),zt=Zr(Re),Vt=Me==="rtl",pr;Nt===!1?pr={inkBar:!1,tabPane:!1}:pr=Object(G.a)({inkBar:!0,tabPane:!1},Nt!==!0?Nt:null);var Pr=Object(M.useState)(!1),ar=Object(Y.a)(Pr,2),Nr=ar[0],si=ar[1];Object(M.useEffect)(function(){si(It())},[]);var Ur=Object(r.a)(function(){var ei;return(ei=zt[0])===null||ei===void 0?void 0:ei.key},{value:qe,defaultValue:Ne}),Xr=Object(Y.a)(Ur,2),zr=Xr[0],Wr=Xr[1],Hr=Object(M.useState)(function(){return zt.findIndex(function(ei){return ei.key===zr})}),vr=Object(Y.a)(Hr,2),yi=vr[0],Qi=vr[1];Object(M.useEffect)(function(){var ei=zt.findIndex(function(qi){return qi.key===zr});if(ei===-1){var Zi;ei=Math.max(0,Math.min(yi,zt.length-1)),Wr((Zi=zt[ei])===null||Zi===void 0?void 0:Zi.key)}Qi(ei)},[zt.map(function(ei){return ei.key}).join("_"),zr,yi]);var ji=Object(r.a)(null,{value:Oe}),Ri=Object(Y.a)(ji,2),ci=Ri[0],qr=Ri[1],ai=mn;Nr&&!["left","right"].includes(mn)&&(ai="top"),Object(M.useEffect)(function(){Oe||(qr("rc-tabs-".concat(Er)),Er+=1)},[]);function di(ei,Zi){gn==null||gn(ei,Zi),Wr(ei),Lr==null||Lr(ei)}var Fi={id:ci,activeKey:zr,animated:pr,tabPosition:ai,rtl:Vt,mobile:Nr},ha,sa=Object(G.a)(Object(G.a)({},Fi),{},{editable:lt,locale:cr,moreIcon:xr,moreTransitionName:Rr,tabBarGutter:Wn,onTabClick:di,onTabScroll:rn,extra:fr,style:Vn,panes:Re});return wr?ha=wr(sa,nr):ha=M.createElement(nr,Object.assign({},sa)),M.createElement(yr.Provider,{value:{tabs:zt,prefixCls:ge}},M.createElement("div",Object.assign({ref:je,id:Oe,className:K()(ge,"".concat(ge,"-").concat(ai),(Ye={},Object(q.a)(Ye,"".concat(ge,"-mobile"),Nr),Object(q.a)(Ye,"".concat(ge,"-editable"),lt),Object(q.a)(Ye,"".concat(ge,"-rtl"),Vt),Ye),ce)},wn),ha,M.createElement(Or,Object.assign({destroyInactiveTabPane:gr},Fi,{animated:pr}))))}var Jr=M.forwardRef(Yr);Jr.TabPane=mr;var vi=Jr,_i=fe.b=vi},kSUc:function(Gt,fe,D){},lZu9:function(Gt,fe,D){(function(q){q(D("VrN/"),D("1eCo"),D("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(Y,U){var G=q.getMode(Y,"text/html"),M=G.name=="null";function k(H){if(q.findModeByName){var C=q.findModeByName(H);C&&(H=C.mime||C.mimes[0])}var z=q.getMode(Y,H);return z.name=="null"?null:z}U.highlightFormatting===void 0&&(U.highlightFormatting=!1),U.maxBlockquoteDepth===void 0&&(U.maxBlockquoteDepth=0),U.taskLists===void 0&&(U.taskLists=!1),U.strikethrough===void 0&&(U.strikethrough=!1),U.emoji===void 0&&(U.emoji=!1),U.fencedCodeBlockHighlighting===void 0&&(U.fencedCodeBlockHighlighting=!0),U.fencedCodeBlockDefaultMode===void 0&&(U.fencedCodeBlockDefaultMode="text/plain"),U.xml===void 0&&(U.xml=!0),U.tokenTypeOverrides===void 0&&(U.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 I in K)K.hasOwnProperty(I)&&U.tokenTypeOverrides[I]&&(K[I]=U.tokenTypeOverrides[I]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,_=/^\[(x| )\](?=\s)/i,p=U.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,o=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,s=" ";function i(H,C,z){return C.f=C.inline=z,z(H,C)}function n(H,C,z){return C.f=C.block=z,z(H,C)}function O(H){return!H||!/\S/.test(H.string)}function T(H){if(H.linkTitle=!1,H.linkHref=!1,H.linkText=!1,H.em=!1,H.strong=!1,H.strikethrough=!1,H.quote=0,H.indentedCode=!1,H.f==R){var C=M;if(!C){var z=q.innerMode(G,H.htmlState);C=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}C&&(H.f=f,H.block=w,H.htmlState=null)}return H.trailingSpace=0,H.trailingSpaceNewLine=!1,H.prevLine=H.thisLine,H.thisLine={stream:null},null}function w(H,C){var z=H.column()===C.indentation,Z=O(C.prevLine.stream),le=C.indentedCode,se=C.prevLine.hr,Ce=C.list!==!1,Ee=(C.listStack[C.listStack.length-1]||0)+3;C.indentedCode=!1;var Ie=C.indentation;if(C.indentationDiff===null&&(C.indentationDiff=C.indentation,Ce)){for(C.list=null;Ie<C.listStack[C.listStack.length-1];)C.listStack.pop(),C.listStack.length?C.indentation=C.listStack[C.listStack.length-1]:C.list=!1;C.list!==!1&&(C.indentationDiff=Ie-C.listStack[C.listStack.length-1])}var Qe=!Z&&!se&&!C.prevLine.header&&(!Ce||!le)&&!C.prevLine.fencedCodeEnd,Xe=(C.list===!1||se||Z)&&C.indentation<=Ee&&H.match(r),_e=null;if(C.indentationDiff>=4&&(le||C.prevLine.fencedCodeEnd||C.prevLine.header||Z))return H.skipToEnd(),C.indentedCode=!0,K.code;if(H.eatSpace())return null;if(z&&C.indentation<=Ee&&(_e=H.match(p))&&_e[1].length<=6)return C.quote=0,C.header=_e[1].length,C.thisLine.header=!0,U.highlightFormatting&&(C.formatting="header"),C.f=C.inline,v(C);if(C.indentation<=Ee&&H.eat(">"))return C.quote=z?1:C.quote+1,U.highlightFormatting&&(C.formatting="quote"),H.eatSpace(),v(C);if(!Xe&&!C.setext&&z&&C.indentation<=Ee&&(_e=H.match(P))){var pe=_e[1]?"ol":"ul";return C.indentation=Ie+H.current().length,C.list=!0,C.quote=0,C.listStack.push(C.indentation),C.em=!1,C.strong=!1,C.code=!1,C.strikethrough=!1,U.taskLists&&H.match(_,!1)&&(C.taskList=!0),C.f=C.inline,U.highlightFormatting&&(C.formatting=["list","list-"+pe]),v(C)}else{if(z&&C.indentation<=Ee&&(_e=H.match(a,!0)))return C.quote=0,C.fencedEndRE=new RegExp(_e[1]+"+ *$"),C.localMode=U.fencedCodeBlockHighlighting&&k(_e[2]||U.fencedCodeBlockDefaultMode),C.localMode&&(C.localState=q.startState(C.localMode)),C.f=C.block=S,U.highlightFormatting&&(C.formatting="code-block"),C.code=-1,v(C);if(C.setext||(!Qe||!Ce)&&!C.quote&&C.list===!1&&!C.code&&!Xe&&!o.test(H.string)&&(_e=H.lookAhead(1))&&(_e=_e.match(m)))return C.setext?(C.header=C.setext,C.setext=0,H.skipToEnd(),U.highlightFormatting&&(C.formatting="header")):(C.header=_e[0].charAt(0)=="="?1:2,C.setext=C.header),C.thisLine.header=!0,C.f=C.inline,v(C);if(Xe)return H.skipToEnd(),C.hr=!0,C.thisLine.hr=!0,K.hr;if(H.peek()==="[")return i(H,C,j)}return i(H,C,C.inline)}function R(H,C){var z=G.token(H,C.htmlState);if(!M){var Z=q.innerMode(G,C.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||C.md_inside&&H.current().indexOf(">")>-1)&&(C.f=f,C.block=w,C.htmlState=null)}return z}function S(H,C){var z=C.listStack[C.listStack.length-1]||0,Z=C.indentation<z,le=z+3;if(C.fencedEndRE&&C.indentation<=le&&(Z||H.match(C.fencedEndRE))){U.highlightFormatting&&(C.formatting="code-block");var se;return Z||(se=v(C)),C.localMode=C.localState=null,C.block=w,C.f=f,C.fencedEndRE=null,C.code=0,C.thisLine.fencedCodeEnd=!0,Z?n(H,C,C.block):se}else return C.localMode?C.localMode.token(H,C.localState):(H.skipToEnd(),K.code)}function v(H){var C=[];if(H.formatting){C.push(K.formatting),typeof H.formatting=="string"&&(H.formatting=[H.formatting]);for(var z=0;z<H.formatting.length;z++)C.push(K.formatting+"-"+H.formatting[z]),H.formatting[z]==="header"&&C.push(K.formatting+"-"+H.formatting[z]+"-"+H.header),H.formatting[z]==="quote"&&(!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=H.quote?C.push(K.formatting+"-"+H.formatting[z]+"-"+H.quote):C.push("error"))}if(H.taskOpen)return C.push("meta"),C.length?C.join(" "):null;if(H.taskClosed)return C.push("property"),C.length?C.join(" "):null;if(H.linkHref?C.push(K.linkHref,"url"):(H.strong&&C.push(K.strong),H.em&&C.push(K.em),H.strikethrough&&C.push(K.strikethrough),H.emoji&&C.push(K.emoji),H.linkText&&C.push(K.linkText),H.code&&C.push(K.code),H.image&&C.push(K.image),H.imageAltText&&C.push(K.imageAltText,"link"),H.imageMarker&&C.push(K.imageMarker)),H.header&&C.push(K.header,K.header+"-"+H.header),H.quote&&(C.push(K.quote),!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=H.quote?C.push(K.quote+"-"+H.quote):C.push(K.quote+"-"+U.maxBlockquoteDepth)),H.list!==!1){var Z=(H.listStack.length-1)%3;Z?Z===1?C.push(K.list2):C.push(K.list3):C.push(K.list1)}return H.trailingSpaceNewLine?C.push("trailing-space-new-line"):H.trailingSpace&&C.push("trailing-space-"+(H.trailingSpace%2?"a":"b")),C.length?C.join(" "):null}function E(H,C){return H.match(u,!0)?v(C):void 0}function f(H,C){var z=C.text(H,C);if(typeof z!="undefined")return z;if(C.list)return C.list=null,v(C);if(C.taskList){var Z=H.match(_,!0)[1]===" ";return Z?C.taskOpen=!0:C.taskClosed=!0,U.highlightFormatting&&(C.formatting="task"),C.taskList=!1,v(C)}if(C.taskOpen=!1,C.taskClosed=!1,C.header&&H.match(/^#+$/,!0))return U.highlightFormatting&&(C.formatting="header"),v(C);var le=H.next();if(C.linkTitle){C.linkTitle=!1;var se=le;le==="("&&(se=")"),se=(se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ce="^\\s*(?:[^"+se+"\\\\]+|\\\\\\\\|\\\\.)"+se;if(H.match(new RegExp(Ce),!0))return K.linkHref}if(le==="`"){var Ee=C.formatting;U.highlightFormatting&&(C.formatting="code"),H.eatWhile("`");var Ie=H.current().length;if(C.code==0&&(!C.quote||Ie==1))return C.code=Ie,v(C);if(Ie==C.code){var Qe=v(C);return C.code=0,Qe}else return C.formatting=Ee,v(C)}else if(C.code)return v(C);if(le==="\\"&&(H.next(),U.highlightFormatting)){var Xe=v(C),_e=K.formatting+"-escape";return Xe?Xe+" "+_e:_e}if(le==="!"&&H.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return C.imageMarker=!0,C.image=!0,U.highlightFormatting&&(C.formatting="image"),v(C);if(le==="["&&C.imageMarker&&H.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return C.imageMarker=!1,C.imageAltText=!0,U.highlightFormatting&&(C.formatting="image"),v(C);if(le==="]"&&C.imageAltText){U.highlightFormatting&&(C.formatting="image");var Xe=v(C);return C.imageAltText=!1,C.image=!1,C.inline=C.f=y,Xe}if(le==="["&&!C.image)return C.linkText&&H.match(/^.*?\]/)||(C.linkText=!0,U.highlightFormatting&&(C.formatting="link")),v(C);if(le==="]"&&C.linkText){U.highlightFormatting&&(C.formatting="link");var Xe=v(C);return C.linkText=!1,C.inline=C.f=H.match(/\(.*?\)| ?\[.*?\]/,!1)?y:f,Xe}if(le==="<"&&H.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){C.f=C.inline=h,U.highlightFormatting&&(C.formatting="link");var Xe=v(C);return Xe?Xe+=" ":Xe="",Xe+K.linkInline}if(le==="<"&&H.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){C.f=C.inline=h,U.highlightFormatting&&(C.formatting="link");var Xe=v(C);return Xe?Xe+=" ":Xe="",Xe+K.linkEmail}if(U.xml&&le==="<"&&H.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var pe=H.string.indexOf(">",H.pos);if(pe!=-1){var at=H.string.substring(H.start,pe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(at)&&(C.md_inside=!0)}return H.backUp(1),C.htmlState=q.startState(G),n(H,C,R)}if(U.xml&&le==="<"&&H.match(/^\/\w*?>/))return C.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var Qt=1,Ft=H.pos==1?" ":H.string.charAt(H.pos-2);Qt<3&&H.eat(le);)Qt++;var Tt=H.peek()||" ",Ve=!/\s/.test(Tt)&&(!c.test(Tt)||/\s/.test(Ft)||c.test(Ft)),pt=!/\s/.test(Ft)&&(!c.test(Ft)||/\s/.test(Tt)||c.test(Tt)),ut=null,Ut=null;if(Qt%2&&(!C.em&&Ve&&(le==="*"||!pt||c.test(Ft))?ut=!0:C.em==le&&pt&&(le==="*"||!Ve||c.test(Tt))&&(ut=!1)),Qt>1&&(!C.strong&&Ve&&(le==="*"||!pt||c.test(Ft))?Ut=!0:C.strong==le&&pt&&(le==="*"||!Ve||c.test(Tt))&&(Ut=!1)),Ut!=null||ut!=null){U.highlightFormatting&&(C.formatting=ut==null?"strong":Ut==null?"em":"strong em"),ut===!0&&(C.em=le),Ut===!0&&(C.strong=le);var Qe=v(C);return ut===!1&&(C.em=!1),Ut===!1&&(C.strong=!1),Qe}}else if(le===" "&&(H.eat("*")||H.eat("_"))){if(H.peek()===" ")return v(C);H.backUp(1)}if(U.strikethrough){if(le==="~"&&H.eatWhile(le)){if(C.strikethrough){U.highlightFormatting&&(C.formatting="strikethrough");var Qe=v(C);return C.strikethrough=!1,Qe}else if(H.match(/^[^\s]/,!1))return C.strikethrough=!0,U.highlightFormatting&&(C.formatting="strikethrough"),v(C)}else if(le===" "&&H.match(/^~~/,!0)){if(H.peek()===" ")return v(C);H.backUp(2)}}if(U.emoji&&le===":"&&H.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){C.emoji=!0,U.highlightFormatting&&(C.formatting="emoji");var oe=v(C);return C.emoji=!1,oe}return le===" "&&(H.match(/^ +$/,!1)?C.trailingSpace++:C.trailingSpace&&(C.trailingSpaceNewLine=!0)),v(C)}function h(H,C){var z=H.next();if(z===">"){C.f=C.inline=f,U.highlightFormatting&&(C.formatting="link");var Z=v(C);return Z?Z+=" ":Z="",Z+K.linkInline}return H.match(/^[^>]+/,!0),K.linkInline}function y(H,C){if(H.eatSpace())return null;var z=H.next();return z==="("||z==="["?(C.f=C.inline=x(z==="("?")":"]"),U.highlightFormatting&&(C.formatting="link-string"),C.linkHref=!0,v(C)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(H){return function(C,z){var Z=C.next();if(Z===H){z.f=z.inline=f,U.highlightFormatting&&(z.formatting="link-string");var le=v(z);return z.linkHref=!1,le}return C.match(g[H]),z.linkHref=!0,v(z)}}function j(H,C){return H.match(/^([^\]\\]|\\.)*\]:/,!1)?(C.f=F,H.next(),U.highlightFormatting&&(C.formatting="link"),C.linkText=!0,v(C)):i(H,C,f)}function F(H,C){if(H.match(/^\]:/,!0)){C.f=C.inline=A,U.highlightFormatting&&(C.formatting="link");var z=v(C);return C.linkText=!1,z}return H.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function A(H,C){return H.eatSpace()?null:(H.match(/^[^\s]+/,!0),H.peek()===void 0?C.linkTitle=!0:H.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),C.f=C.inline=f,K.linkHref+" url")}var W={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:f,text:E,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(H){return{f:H.f,prevLine:H.prevLine,thisLine:H.thisLine,block:H.block,htmlState:H.htmlState&&q.copyState(G,H.htmlState),indentation:H.indentation,localMode:H.localMode,localState:H.localMode?q.copyState(H.localMode,H.localState):null,inline:H.inline,text:H.text,formatting:!1,linkText:H.linkText,linkTitle:H.linkTitle,linkHref:H.linkHref,code:H.code,em:H.em,strong:H.strong,strikethrough:H.strikethrough,emoji:H.emoji,header:H.header,setext:H.setext,hr:H.hr,taskList:H.taskList,list:H.list,listStack:H.listStack.slice(0),quote:H.quote,indentedCode:H.indentedCode,trailingSpace:H.trailingSpace,trailingSpaceNewLine:H.trailingSpaceNewLine,md_inside:H.md_inside,fencedEndRE:H.fencedEndRE}},token:function(H,C){if(C.formatting=!1,H!=C.thisLine.stream){if(C.header=0,C.hr=!1,H.match(/^\s*$/,!0))return T(C),null;if(C.prevLine=C.thisLine,C.thisLine={stream:H},C.taskList=!1,C.trailingSpace=0,C.trailingSpaceNewLine=!1,!C.localState&&(C.f=C.block,C.f!=R)){var z=H.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(C.indentation=z,C.indentationDiff=null,z>0)return null}}return C.f(H,C)},innerMode:function(H){return H.block==R?{state:H.htmlState,mode:G}:H.localState?{state:H.localState,mode:H.localMode}:{state:H,mode:W}},indent:function(H,C,z){return H.block==R&&G.indent?G.indent(H.htmlState,C,z):H.localState&&H.localMode.indent?H.localMode.indent(H.localState,C,z):q.Pass},blankLine:T,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return W},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},mgmH:function(Gt,fe,D){"use strict";D.d(fe,"d",function(){return m}),D.d(fe,"b",function(){return u}),D.d(fe,"e",function(){return a}),D.d(fe,"c",function(){return o}),D.d(fe,"n",function(){return c}),D.d(fe,"g",function(){return s}),D.d(fe,"h",function(){return i}),D.d(fe,"j",function(){return O}),D.d(fe,"a",function(){return T}),D.d(fe,"l",function(){return w}),D.d(fe,"f",function(){return R}),D.d(fe,"k",function(){return S}),D.d(fe,"m",function(){return v}),D.d(fe,"i",function(){return E}),D.d(fe,"p",function(){return f}),D.d(fe,"v",function(){return h}),D.d(fe,"u",function(){return y}),D.d(fe,"r",function(){return g}),D.d(fe,"s",function(){return x}),D.d(fe,"t",function(){return j}),D.d(fe,"x",function(){return F}),D.d(fe,"w",function(){return A}),D.d(fe,"o",function(){return W}),D.d(fe,"q",function(){return H});var q=D("miYZ"),Y=D("tsqr"),U=D("k1fw"),G=D("9og8"),M=D("WmNS"),k=D.n(M),K=D("oUNq"),I=D("9kvl"),r=D("1vsH"),P=D("m3rI"),_=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},m=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return _(),Ce.next=3,Object(K.t)(Object(U.a)({},Z));case 3:if(le=Ce.sent,!(le.status===0)){Ce.next=7;break}return Ce.next=7,Object(r.y)("",Object(r.ab)({url:P.a.API_SERVER+"/api/courses/".concat(Z.coursesId,"/export_couser_info.json"),query:Z}));case 7:p();case 8:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),u=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(K.r)(Object(U.a)({},Z));case 2:if(le=Ce.sent,!(le.status===0)){Ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_member_act_score")),Ce.next=13;break;case 8:if(!(le.status===-2)){Ce.next=12;break}return Ce.abrupt("return",le);case 12:le.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),a=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(K.u)(Object(U.a)({},Z));case 2:if(le=Ce.sent,!(le.status===0)){Ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_score")),Ce.next=13;break;case 8:if(!(le.status===-2)){Ce.next=12;break}return Ce.abrupt("return",le);case 12:le.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_score")));case 13:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),o=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(K.s)(Object(U.a)({},Z));case 2:if(le=Ce.sent,!(le.status===0)){Ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_exercise_and_other")),Ce.next=13;break;case 8:if(!(le.status===-2)){Ce.next=12;break}return Ce.abrupt("return",le);case 12:le.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),c=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(K.z)(Object(U.a)({},Z));case 2:if(le=Ce.sent,!(le.status===0)){Ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_exercise_and_other")),Ce.next=13;break;case 8:if(!(le.status===-2)){Ce.next=12;break}return Ce.abrupt("return",le);case 12:le.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),s=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(K.v)(Object(U.a)({},Z));case 2:if(le=Ce.sent,!(le.status===0)){Ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_homework")),Ce.next=13;break;case 8:if(!(le.status===-2)){Ce.next=12;break}return Ce.abrupt("return",le);case 12:le.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),i=function(){var C=Object(G.a)(k.a.mark(function z(Z,le){var se;return k.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return Ee.next=2,Object(K.x)(Object(U.a)({},Z));case 2:se=Ee.sent,se.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/").concat(le))):se.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/").concat(le)));case 4:case"end":return Ee.stop()}},z)}));return function(Z,le){return C.apply(this,arguments)}}(),n=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return _(),Ce.next=3,Object(K.w)(Object(U.a)({},Z));case 3:if(le=Ce.sent,!(le.status===0)){Ce.next=7;break}return Ce.next=7,Object(r.y)("",Object(r.ab)({url:P.a.API_SERVER+"/api/homework_commons/".concat(Z.categoryId,"/works_list.zip"),query:Z}));case 7:p();case 8:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),O=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return _(),Ce.next=3,Object(K.A)(Object(U.a)({},Z));case 3:if(le=Ce.sent,!(le.status===0)){Ce.next=7;break}return Ce.next=7,Object(r.y)("",Object(r.ab)({url:P.a.API_SERVER+"/api/polls/".concat(Z.categoryId,"/commit_result.xlsx"),query:Z}));case 7:p();case 8:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),T=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/courses/".concat(Z.coursesId,"/attendances/export_xlsx_data.xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),w=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/courses/".concat(Z.coursesId,"/video_study_statics.xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),R=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/courses/".concat(Z.coursesId,"/export_course_students_info.xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),S=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/item_banks/export.xlsx",query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),v=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),E=function(){var C=Object(G.a)(k.a.mark(function z(Z){var le;return k.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(K.y)(Object(U.a)({},Z));case 2:le=Ce.sent,le.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/exercise_score"))):le.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(Z.coursesId,"/exportlist/exercise_score")));case 4:case"end":return Ce.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),f=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),se.next=3,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/export_records/".concat(Z.id,".xlsx"),query:Z}));case 3:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),h=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),y=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/ec_years/".concat(Z==null?void 0:Z.ec_year_id,"/ec_training_objectives.xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),g=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)(Z==null?void 0:Z.name,Object(r.ab)({url:P.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),x=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/ec_years/".concat(Z==null?void 0:Z.ec_year_id,"/ec_courses.xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),j=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/ec_years/".concat(Z==null?void 0:Z.ec_year_id,"/ec_graduation_requirements.xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),F=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/courses/rank_list.xlsx",query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),A=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.x)("",Object(r.ab)({url:P.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),W=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.y)("",Object(r.ab)({url:P.a.API_SERVER+"/api/shixun_collects/".concat(Z.id,"/details.").concat(Z.is_json?"json":"xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}(),H=function(){var C=Object(G.a)(k.a.mark(function z(Z){return k.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(r.y)("",Object(r.ab)({url:P.a.API_SERVER+"/api/shixun_collects/test_two_list.".concat(Z.is_json?"json":"xlsx"),query:Z}));case 2:case"end":return se.stop()}},z)}));return function(Z){return C.apply(this,arguments)}}()},n6Qo:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return I});var q=D("q1tI"),Y=D("biw7"),U=D("fyJ8");function G(r){var P=r.className,_=r.index,p=r.children,m=r.colSpan,u=r.rowSpan,a=q.useContext(Y.a),o=a.prefixCls,c=a.fixedInfoList,s=c[_];return q.createElement(U.a,Object.assign({className:P,index:_,component:"td",prefixCls:o,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:m,rowSpan:u}}}},s))}function M(r){return q.createElement("tr",Object.assign({},r))}function k(r){var P=r.children,_=q.useContext(Y.a),p=_.prefixCls;return q.createElement("tfoot",{className:"".concat(p,"-summary")},P)}var K=fe.b=k,I={Cell:G,Row:M}},nEHx:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return q});var q;(function(Y){Y.DARK="dark",Y.LIGHT="light",Y.HIGH_CONTRAST="hc"})(q||(q={}))},nPLb:function(Gt,fe,D){"use strict";var q=D("2qtc"),Y=D("kLXV"),U=D("g9YV"),G=D("wCAj"),M=D("5NDa"),k=D("5rEg"),K=D("14J3"),I=D("BMrR"),r=D("iQDF"),P=D("+eQT"),_=D("miYZ"),p=D("tsqr"),m=D("jrin"),u=D("oBTY"),a=D("k1fw"),o=D("9og8"),c=D("y8nQ"),s=D("Vl3Y"),i=D("tJVT"),n=D("PpiC"),O=D("WmNS"),T=D.n(O),w=D("q1tI"),R=D.n(w),S=D("wd/R"),v=D.n(S),E=D("ErOA"),f=D("1vsH"),h=D("Ty5D"),y=D("9kvl"),g=D("oUNq"),x=D("xKgJ"),j=D("eozf"),F=function(W){var H=W.classroomList,C=W.dispatch,z=W.courseEndTime,Z=Object(n.a)(W,["classroomList","dispatch","courseEndTime"]),le=Object(h.i)(),se=s.a.useForm(),Ce=Object(i.a)(se,1),Ee=Ce[0],Ie=Object(w.useState)(1),Qe=Object(i.a)(Ie,2),Xe=Qe[0],_e=Qe[1],pe=Object(w.useState)([]),at=Object(i.a)(pe,2),Qt=at[0],Ft=at[1],Tt=Object(w.useState)(0),Ve=Object(i.a)(Tt,2),pt=Ve[0],ut=Ve[1],Ut=Object(w.useState)(2e4),oe=Object(i.a)(Ut,2),Ue=oe[0],ze=oe[1],$e=Object(w.useState)(!0),Bt=Object(i.a)($e,2),Ht=Bt[0],qt=Bt[1],tt=Object(w.useState)(),nn=Object(i.a)(tt,2),xn=nn[0],Ge=nn[1],He=Object(w.useState)([]),vt=Object(i.a)(He,2),Ot=vt[0],nt=vt[1];le.id=le.coursesId,Object(w.useEffect)(function(){H.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?xt():(nt([]),Ft([]))},[H.actionTabs.key]);var xt=function(){var ie=Object(o.a)(T.a.mark(function ae(me){var be,ye,Be;return T.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return qt(!0),an.next=3,Object(g.D)(Object(a.a)(Object(a.a)({},le),{},{page:me||Xe,limit:Ue,homework_id:H.actionTabs.type===1?"":H.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:be=an.sent,be==null||be.course_groups.map(function(Dn){Dn.key=Dn.id}),be&&(Ft([].concat(Object(u.a)(Qt),Object(u.a)(be==null?void 0:be.course_groups))),ut(be==null?void 0:be.group_count),Ge(be==null?void 0:be.course_groups),qt(!1),me||Ee.setFieldsValue((Be={},Object(m.a)(Be,"group_ids",be==null||((ye=be.course_groups)===null||ye===void 0)?void 0:ye.map(function(Dn){return String(Dn.id)})),Object(m.a)(Be,"end_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Be)));case 6:case"end":return an.stop()}},ae)}));return function(me){return ie.apply(this,arguments)}}(),Ae=function(){var ie=Object(o.a)(T.a.mark(function ae(){var me,be,ye,Be;return T.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(me=Object(a.a)({},Ee.getFieldsValue()),console.log("----",me.group_ids),!(xn!=null&&xn.length&&!(Ot!=null&&Ot.length))){an.next=5;break}return p.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),an.abrupt("return");case 5:return an.next=7,Object(E.a)("/api/courses/".concat(le.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(u.a)(H.actionTabs.selectArrs),group_ids:(Ot==null?void 0:Ot.length)>0?Ot:[],unified_setting:!(Qt!=null&&Qt.length),end_time:v()(me.end_time).format("YYYY-MM-DD HH:mm")}});case 7:be=an.sent,be.status===0&&(ve(),Object(f.eb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),p.b.success("\u64CD\u4F5C\u6210\u529F"),C({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Z.onCallback&&Z.onCallback(),Object(x.c)()?(C({type:"classroomList/setActionTabs",payload:{}}),(H==null||((ye=H.actionTabs)===null||ye===void 0||((Be=ye.selectArrsAll)===null||Be===void 0))?void 0:Be.length)>0?C({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},H.actionTabs.params),{},{type:5})}):C({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},le)})):C({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},H.actionTabs.params)}));case 9:case"end":return an.stop()}},ae)}));return function(){return ie.apply(this,arguments)}}(),ve=function(){_e(1),Ft([])},we=H.detailCommonHomeworksList;return R.a.createElement(Y.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:H.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:Ae,onCancel:function(){ve(),C({type:"classroomList/setActionTabs",payload:{}})}},R.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",R.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),Qt&&R.a.createElement(s.a,{form:Ee},R.a.createElement(I.a,null,R.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),R.a.createElement(s.a.Item,{name:"end_time"},R.a.createElement(P.a,{style:{width:170},getPopupContainer:function(ae){return ae.parentNode},disabledDate:function(ae){return Object(j.b)(ae,z)},disabledTime:function(ae){return Object(j.c)(ae)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(f.f)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(xn==null?void 0:xn.length)>0&&R.a.createElement(I.a,null,R.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),R.a.createElement(k.a.Search,{style:{width:"300px"},onChange:function(ae){Ft(xn.filter(function(me){return me.name.indexOf(ae.target.value)>-1}))}})),(Qt==null?void 0:Qt.length)>0&&H.actionTabs.type===1&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ae,me){nt(ae)}},rowKey:"id",pagination:!1,dataSource:Qt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(Qt==null?void 0:Qt.length)>0&&H.actionTabs.type===2&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ae,me){nt(ae)}},rowKey:"id",pagination:!1,dataSource:Qt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]})))};fe.a=Object(y.a)(function(A){var W=A.classroomList;return{classroomList:W}})(F)},nnTU:function(Gt,fe,D){"use strict";D.d(fe,"b",function(){return K}),D.d(fe,"a",function(){return I});var q=D("MI8n"),Y=D("JYp7"),U=D("pmY6"),G=D("24hK"),M=D("746U"),k=D("Cg/j");const K=Object(k.c)("commandService"),I=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,P){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!P)throw new Error("invalid command");return this.registerCommand({id:r,handler:P})}if(r.description){const a=[];for(let c of r.description.args)a.push(c.constraint);const o=r.handler;r.handler=function(c,...s){return Object(M.o)(s,a),o(c,...s)}}const{id:_}=r;let p=this._commands.get(_);p||(p=new G.a,this._commands.set(_,p));let m=p.unshift(r),u=Object(U.i)(()=>{m();const a=this._commands.get(_);(a==null?void 0:a.isEmpty())&&this._commands.delete(_)});return this._onDidRegisterCommand.fire(_),u}registerCommandAlias(r,P){return I.registerCommand(r,(_,...p)=>_.get(K).executeCommand(P,...p))}getCommand(r){const P=this._commands.get(r);return!P||P.isEmpty()?void 0:Y.a.first(P)}getCommands(){const r=new Map;for(const P of this._commands.keys()){const _=this.getCommand(P);_&&r.set(P,_)}return r}};I.registerCommand("noop",()=>{})},oOBs:function(Gt,fe,D){Gt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return ur});var q=D("1OyB"),Y=D("vuIU"),U=D("Ji7U"),G=D("LK+K"),M=D("rePB"),k=D("VTBJ"),K=D("ODXe"),I=D("q1tI"),r=D("TSYQ"),P=D.n(r),_=D("Kwbf"),p=D("6cGi"),m=D("U8pU"),u=D("4IlW"),a=I.createContext({}),o=a,c={visibility:"hidden"};function s(Q){var de=Q.prefixCls,Te=Q.prevIcon,Se=Te===void 0?"\u2039":Te,rt=Q.nextIcon,De=rt===void 0?"\u203A":rt,Je=Q.superPrevIcon,it=Je===void 0?"\xAB":Je,At=Q.superNextIcon,Ct=At===void 0?"\xBB":At,We=Q.onSuperPrev,gt=Q.onSuperNext,ot=Q.onPrev,dt=Q.onNext,wt=Q.children,kt=I.useContext(o),mt=kt.hideNextBtn,$t=kt.hidePrevBtn;return I.createElement("div",{className:de},We&&I.createElement("button",{type:"button",onClick:We,tabIndex:-1,className:"".concat(de,"-super-prev-btn"),style:$t?c:{}},it),ot&&I.createElement("button",{type:"button",onClick:ot,tabIndex:-1,className:"".concat(de,"-prev-btn"),style:$t?c:{}},Se),I.createElement("div",{className:"".concat(de,"-view")},wt),dt&&I.createElement("button",{type:"button",onClick:dt,tabIndex:-1,className:"".concat(de,"-next-btn"),style:mt?c:{}},De),gt&&I.createElement("button",{type:"button",onClick:gt,tabIndex:-1,className:"".concat(de,"-super-next-btn"),style:mt?c:{}},Ct))}var i=s;function n(Q){var de=I.useContext(o),Te=de.hideHeader;if(Te)return null;var Se=Q.prefixCls,rt=Q.generateConfig,De=Q.locale,Je=Q.value,it=Q.format,At="".concat(Se,"-header");return I.createElement(i,{prefixCls:At},Je?rt.locale.format(De.locale,Je,it):"\xA0")}var O=n,T=D("YrtM"),w=D("KQm4"),R=new Map;function S(Q,de,Te){if(R.get(Q)&&cancelAnimationFrame(R.get(Q)),Te<=0){R.set(Q,requestAnimationFrame(function(){Q.scrollTop=de}));return}var Se=de-Q.scrollTop,rt=Se/Te*10;R.set(Q,requestAnimationFrame(function(){Q.scrollTop+=rt,Q.scrollTop!==de&&S(Q,de,Te-10)}))}function v(Q,de){var Te=de.onLeftRight,Se=de.onCtrlLeftRight,rt=de.onUpDown,De=de.onPageUpDown,Je=de.onEnter,it=Q.which,At=Q.ctrlKey,Ct=Q.metaKey;switch(it){case u.a.LEFT:if(At||Ct){if(Se)return Se(-1),!0}else if(Te)return Te(-1),!0;break;case u.a.RIGHT:if(At||Ct){if(Se)return Se(1),!0}else if(Te)return Te(1),!0;break;case u.a.UP:if(rt)return rt(-1),!0;break;case u.a.DOWN:if(rt)return rt(1),!0;break;case u.a.PAGE_UP:if(De)return De(-1),!0;break;case u.a.PAGE_DOWN:if(De)return De(1),!0;break;case u.a.ENTER:if(Je)return Je(),!0;break}return!1}function E(Q,de,Te,Se){var rt=Q;if(!rt)switch(de){case"time":rt=Se?"hh:mm:ss a":"HH:mm:ss";break;case"week":rt="gggg-wo";break;case"month":rt="YYYY-MM";break;case"quarter":rt="YYYY-[Q]Q";break;case"year":rt="YYYY";break;default:rt=Te?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return rt}function f(Q,de){var Te=Q==="time"?8:10;return Math.max(Te,de.length)+2}var h=null,y=new Set;function g(Q){return!h&&typeof window!="undefined"&&window.addEventListener&&(h=function(Te){Object(w.a)(y).forEach(function(Se){Se(Te)})},window.addEventListener("mousedown",h)),y.add(Q),function(){y.delete(Q),y.size===0&&(window.removeEventListener("mousedown",h),h=null)}}var x=function(de){return de==="month"||de==="date"?"year":de},j=function(de){return de==="date"?"month":de},F=function(de){return de==="month"||de==="date"?"quarter":de},A=function(de){return de==="date"?"week":de},W={year:x,month:j,quarter:F,week:A,time:null,date:null};function H(Q,de){return Q.some(function(Te){return Te&&Te.contains(de)})}function C(Q){var de=Q.prefixCls,Te=Q.units,Se=Q.onSelect,rt=Q.value,De=Q.active,Je=Q.hideDisabledOptions,it="".concat(de,"-cell"),At=I.useContext(o),Ct=At.open,We=I.useRef(null),gt=I.useRef(new Map);return I.useLayoutEffect(function(){var ot=gt.current.get(rt);ot&&Ct!==!1&&S(We.current,ot.offsetTop,120)},[rt]),I.useLayoutEffect(function(){if(Ct){var ot=gt.current.get(rt);ot&&S(We.current,ot.offsetTop,0)}},[Ct]),I.createElement("ul",{className:P()("".concat(de,"-column"),Object(M.a)({},"".concat(de,"-column-active"),De)),ref:We,style:{position:"relative"}},Te.map(function(ot){var dt;return Je&&ot.disabled?null:I.createElement("li",{key:ot.value,ref:function(kt){gt.current.set(ot.value,kt)},className:P()(it,(dt={},Object(M.a)(dt,"".concat(it,"-disabled"),ot.disabled),Object(M.a)(dt,"".concat(it,"-selected"),rt===ot.value),dt)),onClick:function(){if(ot.disabled)return;Se(ot.value)}},I.createElement("div",{className:"".concat(it,"-inner")},ot.label))}))}var z=C;function Z(Q,de){for(var Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Se=String(Q);Se.length<de;)Se="".concat(Te).concat(Q);return Se}var le=function(){for(var de=arguments.length,Te=new Array(de),Se=0;Se<de;Se++)Te[Se]=arguments[Se];return Te};function se(Q){return Q==null?[]:Array.isArray(Q)?Q:[Q]}function Ce(Q){var de={};return Object.keys(Q).forEach(function(Te){(Te.substr(0,5)==="data-"||Te.substr(0,5)==="aria-"||Te==="role"||Te==="name")&&Te.substr(0,7)!=="data-__"&&(de[Te]=Q[Te])}),de}function Ee(Q,de){return Q?Q[de]:null}function Ie(Q,de,Te){var Se=[Ee(Q,0),Ee(Q,1)];return Se[Te]=typeof de=="function"?de(Se[Te]):de,!Se[0]&&!Se[1]?null:Se}function Qe(Q,de,Te,Se,rt){var De=Q.setHour(de,Te);return De=Q.setMinute(De,Se),De=Q.setSecond(De,rt),De}function Xe(Q,de,Te,Se,rt,De){var Je=Math.floor(Q/Se)*Se;if(Je<Q)return[Je,60-rt,60-De];var it=Math.floor(de/rt)*rt;if(it<de)return[Je,it,60-De];var At=Math.floor(Te/De)*De;return[Je,it,At]}function _e(Q,de){if(Q.length!==de.length)return!0;for(var Te=0;Te<Q.length;Te+=1)if(Q[Te].disabled!==de[Te].disabled)return!0;return!1}function pe(Q,de,Te,Se){for(var rt=[],De=Q;De<=de;De+=Te)rt.push({label:Z(De,2),value:De,disabled:(Se||[]).includes(De)});return rt}function at(Q){var de=Q.generateConfig,Te=Q.prefixCls,Se=Q.operationRef,rt=Q.activeColumnIndex,De=Q.value,Je=Q.showHour,it=Q.showMinute,At=Q.showSecond,Ct=Q.use12Hours,We=Q.hourStep,gt=We===void 0?1:We,ot=Q.minuteStep,dt=ot===void 0?1:ot,wt=Q.secondStep,kt=wt===void 0?1:wt,mt=Q.disabledHours,$t=Q.disabledMinutes,hn=Q.disabledSeconds,Pn=Q.hideDisabledOptions,Gn=Q.onSelect,On=[],Nn="".concat(Te,"-content"),Mn="".concat(Te,"-time-panel"),Pt,fn=De?de.getHour(De):-1,Wt=De?de.getMinute(De):-1,Rt=De?de.getSecond(De):-1,Un=function(Cn,Dt,Ze,It){var Mt=De||de.getNow(),cn=Math.max(0,Dt),zn=Math.max(0,Ze),kn=Math.max(0,It);return Mt=Qe(de,Mt,!Ct||!Cn?cn:cn+12,zn,kn),Mt},Rn=pe(0,23,gt,mt&&mt()),Yt=Object(T.a)(function(){return Rn},Rn,_e);Ct&&(Pt=fn>=12,fn%=12);var ht=I.useMemo(function(){if(!Ct)return[!1,!1];var Ln=[!0,!0];return Yt.forEach(function(Cn){var Dt=Cn.disabled,Ze=Cn.value;if(Dt)return;Ze>=12?Ln[1]=!1:Ln[0]=!1}),Ln},[Ct,Yt]),jn=Object(K.a)(ht,2),pn=jn[0],qn=jn[1],Zt=I.useMemo(function(){return Ct?Yt.filter(Pt?function(Ln){return Ln.value>=12}:function(Ln){return Ln.value<12}).map(function(Ln){var Cn=Ln.value%12,Dt=Cn===0?"12":Z(Cn,2);return Object(k.a)(Object(k.a)({},Ln),{},{label:Dt,value:Cn})}):Yt},[Ct,Yt]),An=pe(0,59,dt,$t&&$t(fn)),Fn=pe(0,59,kt,hn&&hn(fn,Wt));Se.current={onUpDown:function(Cn){var Dt=On[rt];if(Dt)for(var Ze=Dt.units.findIndex(function(zn){return zn.value===Dt.value}),It=Dt.units.length,Mt=1;Mt<It;Mt+=1){var cn=Dt.units[(Ze+Cn*Mt+It)%It];if(cn.disabled!==!0){Dt.onSelect(cn.value);break}}}};function vn(Ln,Cn,Dt,Ze,It){Ln!==!1&&On.push({node:I.cloneElement(Cn,{prefixCls:Mn,value:Dt,active:rt===On.length,onSelect:It,units:Ze,hideDisabledOptions:Pn}),onSelect:It,value:Dt,units:Ze})}vn(Je,I.createElement(z,{key:"hour"}),fn,Zt,function(Ln){Gn(Un(Pt,Ln,Wt,Rt),"mouse")}),vn(it,I.createElement(z,{key:"minute"}),Wt,An,function(Ln){Gn(Un(Pt,fn,Ln,Rt),"mouse")}),vn(At,I.createElement(z,{key:"second"}),Rt,Fn,function(Ln){Gn(Un(Pt,fn,Wt,Ln),"mouse")});var yr=-1;return typeof Pt=="boolean"&&(yr=Pt?1:0),vn(Ct===!0,I.createElement(z,{key:"12hours"}),yr,[{label:"AM",value:0,disabled:pn},{label:"PM",value:1,disabled:qn}],function(Ln){Gn(Un(!!Ln,fn,Wt,Rt),"mouse")}),I.createElement("div",{className:Nn},On.map(function(Ln){var Cn=Ln.node;return Cn}))}var Qt=at,Ft=function(de){return de.filter(function(Te){return Te!==!1}).length};function Tt(Q){var de=Q.generateConfig,Te=Q.format,Se=Te===void 0?"HH:mm:ss":Te,rt=Q.prefixCls,De=Q.active,Je=Q.operationRef,it=Q.showHour,At=Q.showMinute,Ct=Q.showSecond,We=Q.use12Hours,gt=We===void 0?!1:We,ot=Q.onSelect,dt=Q.value,wt="".concat(rt,"-time-panel"),kt=I.useRef(),mt=I.useState(-1),$t=Object(K.a)(mt,2),hn=$t[0],Pn=$t[1],Gn=Ft([it,At,Ct,gt]);return Je.current={onKeyDown:function(Nn){return v(Nn,{onLeftRight:function(Pt){Pn((hn+Pt+Gn)%Gn)},onUpDown:function(Pt){hn===-1?Pn(0):kt.current&&kt.current.onUpDown(Pt)},onEnter:function(){ot(dt||de.getNow(),"key"),Pn(-1)}})},onBlur:function(){Pn(-1)}},I.createElement("div",{className:P()(wt,Object(M.a)({},"".concat(wt,"-active"),De))},I.createElement(O,Object.assign({},Q,{format:Se,prefixCls:rt})),I.createElement(Qt,Object.assign({},Q,{prefixCls:rt,activeColumnIndex:hn,operationRef:kt})))}var Ve=Tt,pt=7;function ut(Q,de){return!Q&&!de?!0:!Q||!de?!1:void 0}function Ut(Q,de,Te){var Se=ut(de,Te);if(typeof Se=="boolean")return Se;var rt=Math.floor(Q.getYear(de)/10),De=Math.floor(Q.getYear(Te)/10);return rt===De}function oe(Q,de,Te){var Se=ut(de,Te);return typeof Se=="boolean"?Se:Q.getYear(de)===Q.getYear(Te)}function Ue(Q,de){var Te=Math.floor(Q.getMonth(de)/3);return Te+1}function ze(Q,de,Te){var Se=ut(de,Te);return typeof Se=="boolean"?Se:oe(Q,de,Te)&&Ue(Q,de)===Ue(Q,Te)}function $e(Q,de,Te){var Se=ut(de,Te);return typeof Se=="boolean"?Se:oe(Q,de,Te)&&Q.getMonth(de)===Q.getMonth(Te)}function Bt(Q,de,Te){var Se=ut(de,Te);return typeof Se=="boolean"?Se:Q.getYear(de)===Q.getYear(Te)&&Q.getMonth(de)===Q.getMonth(Te)&&Q.getDate(de)===Q.getDate(Te)}function Ht(Q,de,Te){var Se=ut(de,Te);return typeof Se=="boolean"?Se:Q.getHour(de)===Q.getHour(Te)&&Q.getMinute(de)===Q.getMinute(Te)&&Q.getSecond(de)===Q.getSecond(Te)}function qt(Q,de,Te,Se){var rt=ut(Te,Se);return typeof rt=="boolean"?rt:Q.locale.getWeek(de,Te)===Q.locale.getWeek(de,Se)}function tt(Q,de,Te){return Bt(Q,de,Te)&&Ht(Q,de,Te)}function nn(Q,de,Te,Se){return!de||!Te||!Se?!1:!Bt(Q,de,Se)&&!Bt(Q,Te,Se)&&Q.isAfter(Se,de)&&Q.isAfter(Te,Se)}function xn(Q,de,Te){var Se=de.locale.getWeekFirstDay(Q),rt=de.setDate(Te,1),De=de.getWeekDay(rt),Je=de.addDate(rt,Se-De);return de.getMonth(Je)===de.getMonth(Te)&&de.getDate(Je)>1&&(Je=de.addDate(Je,-7)),Je}function Ge(Q,de,Te){var Se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(de){case"year":return Te.addYear(Q,Se*10);case"quarter":case"month":return Te.addYear(Q,Se);default:return Te.addMonth(Q,Se)}}var He=I.createContext({}),vt=He;function Ot(Q){var de=Q.cellPrefixCls,Te=Q.generateConfig,Se=Q.rangedValue,rt=Q.hoverRangedValue,De=Q.isInView,Je=Q.isSameCell,it=Q.offsetCell,At=Q.today,Ct=Q.value;function We(gt){var ot,dt=it(gt,-1),wt=it(gt,1),kt=Ee(Se,0),mt=Ee(Se,1),$t=Ee(rt,0),hn=Ee(rt,1),Pn=nn(Te,$t,hn,gt);function Gn(Wt){return Je(kt,Wt)}function On(Wt){return Je(mt,Wt)}var Nn=Je($t,gt),Mn=Je(hn,gt),Pt=(Pn||Mn)&&(!De(dt)||On(dt)),fn=(Pn||Nn)&&(!De(wt)||Gn(wt));return ot={},Object(M.a)(ot,"".concat(de,"-in-view"),De(gt)),Object(M.a)(ot,"".concat(de,"-in-range"),nn(Te,kt,mt,gt)),Object(M.a)(ot,"".concat(de,"-range-start"),Gn(gt)),Object(M.a)(ot,"".concat(de,"-range-end"),On(gt)),Object(M.a)(ot,"".concat(de,"-range-start-single"),Gn(gt)&&!mt),Object(M.a)(ot,"".concat(de,"-range-end-single"),On(gt)&&!kt),Object(M.a)(ot,"".concat(de,"-range-start-near-hover"),Gn(gt)&&(Je(dt,$t)||nn(Te,$t,hn,dt))),Object(M.a)(ot,"".concat(de,"-range-end-near-hover"),On(gt)&&(Je(wt,hn)||nn(Te,$t,hn,wt))),Object(M.a)(ot,"".concat(de,"-range-hover"),Pn),Object(M.a)(ot,"".concat(de,"-range-hover-start"),Nn),Object(M.a)(ot,"".concat(de,"-range-hover-end"),Mn),Object(M.a)(ot,"".concat(de,"-range-hover-edge-start"),Pt),Object(M.a)(ot,"".concat(de,"-range-hover-edge-end"),fn),Object(M.a)(ot,"".concat(de,"-range-hover-edge-start-near-range"),Pt&&Je(dt,mt)),Object(M.a)(ot,"".concat(de,"-range-hover-edge-end-near-range"),fn&&Je(wt,kt)),Object(M.a)(ot,"".concat(de,"-today"),Je(At,gt)),Object(M.a)(ot,"".concat(de,"-selected"),Je(Ct,gt)),ot}return We}function nt(Q){for(var de=Q.prefixCls,Te=Q.disabledDate,Se=Q.onSelect,rt=Q.rowNum,De=Q.colNum,Je=Q.prefixColumn,it=Q.rowClassName,At=Q.baseDate,Ct=Q.getCellClassName,We=Q.getCellText,gt=Q.getCellNode,ot=Q.getCellDate,dt=Q.titleCell,wt=Q.headerCells,kt=I.useContext(o),mt=kt.onDateMouseEnter,$t=kt.onDateMouseLeave,hn="".concat(de,"-cell"),Pn=[],Gn=0;Gn<rt;Gn+=1){for(var On=[],Nn=void 0,Mn=function(Wt){var Rt=Gn*De+Wt,Un=ot(At,Rt),Rn=Te&&Te(Un);Wt===0&&(Nn=Un,Je&&On.push(Je(Nn))),On.push(I.createElement("td",{key:Wt,title:dt&&dt(Un),className:P()(hn,Object(k.a)(Object(M.a)({},"".concat(hn,"-disabled"),Rn),Ct(Un))),onClick:function(){Rn||Se(Un)},onMouseEnter:function(){!Rn&&mt&&mt(Un)},onMouseLeave:function(){!Rn&&$t&&$t(Un)}},gt?gt(Un):I.createElement("div",{className:"".concat(hn,"-inner")},We(Un))))},Pt=0;Pt<De;Pt+=1)Mn(Pt);Pn.push(I.createElement("tr",{key:Gn,className:it&&it(Nn)},On))}return I.createElement("div",{className:"".concat(de,"-body")},I.createElement("table",{className:"".concat(de,"-content")},wt&&I.createElement("thead",null,I.createElement("tr",null,wt)),I.createElement("tbody",null,Pn)))}function xt(Q){var de=Q.prefixCls,Te=Q.generateConfig,Se=Q.prefixColumn,rt=Q.locale,De=Q.rowCount,Je=Q.viewDate,it=Q.value,At=Q.dateRender,Ct=I.useContext(vt),We=Ct.rangedValue,gt=Ct.hoverRangedValue,ot=xn(rt.locale,Te,Je),dt="".concat(de,"-cell"),wt=Te.locale.getWeekFirstDay(rt.locale),kt=Te.getNow(),mt=[],$t=rt.shortWeekDays||(Te.locale.getShortWeekDays?Te.locale.getShortWeekDays(rt.locale):[]);Se&&mt.push(I.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var hn=0;hn<pt;hn+=1)mt.push(I.createElement("th",{key:hn},$t[(hn+wt)%pt]));var Pn=Ot({cellPrefixCls:dt,today:kt,value:it,generateConfig:Te,rangedValue:Se?null:We,hoverRangedValue:Se?null:gt,isSameCell:function(Nn,Mn){return Bt(Te,Nn,Mn)},isInView:function(Nn){return $e(Te,Nn,Je)},offsetCell:function(Nn,Mn){return Te.addDate(Nn,Mn)}}),Gn=At?function(On){return At(On,kt)}:void 0;return I.createElement(nt,Object.assign({},Q,{rowNum:De,colNum:pt,baseDate:ot,getCellNode:Gn,getCellText:Te.getDate,getCellClassName:Pn,getCellDate:Te.addDate,titleCell:function(Nn){return Te.locale.format(rt.locale,Nn,"YYYY-MM-DD")},headerCells:mt}))}var Ae=xt;function ve(Q){var de=Q.prefixCls,Te=Q.generateConfig,Se=Q.locale,rt=Q.viewDate,De=Q.onNextMonth,Je=Q.onPrevMonth,it=Q.onNextYear,At=Q.onPrevYear,Ct=Q.onYearClick,We=Q.onMonthClick,gt=I.useContext(o),ot=gt.hideHeader;if(ot)return null;var dt="".concat(de,"-header"),wt=Se.shortMonths||(Te.locale.getShortMonths?Te.locale.getShortMonths(Se.locale):[]),kt=Te.getMonth(rt),mt=I.createElement("button",{type:"button",key:"year",onClick:Ct,tabIndex:-1,className:"".concat(de,"-year-btn")},Te.locale.format(Se.locale,rt,Se.yearFormat)),$t=I.createElement("button",{type:"button",key:"month",onClick:We,tabIndex:-1,className:"".concat(de,"-month-btn")},Se.monthFormat?Te.locale.format(Se.locale,rt,Se.monthFormat):wt[kt]),hn=Se.monthBeforeYear?[$t,mt]:[mt,$t];return I.createElement(i,Object.assign({},Q,{prefixCls:dt,onSuperPrev:At,onPrev:Je,onNext:De,onSuperNext:it}),hn)}var we=ve,ie=6;function ae(Q){var de=Q.prefixCls,Te=Q.panelName,Se=Te===void 0?"date":Te,rt=Q.keyboardConfig,De=Q.active,Je=Q.operationRef,it=Q.generateConfig,At=Q.value,Ct=Q.viewDate,We=Q.onViewDateChange,gt=Q.onPanelChange,ot=Q.onSelect,dt="".concat(de,"-").concat(Se,"-panel");Je.current={onKeyDown:function($t){return v($t,Object(k.a)({onLeftRight:function(Pn){ot(it.addDate(At||Ct,Pn),"key")},onCtrlLeftRight:function(Pn){ot(it.addYear(At||Ct,Pn),"key")},onUpDown:function(Pn){ot(it.addDate(At||Ct,Pn*pt),"key")},onPageUpDown:function(Pn){ot(it.addMonth(At||Ct,Pn),"key")}},rt))}};var wt=function($t){var hn=it.addYear(Ct,$t);We(hn),gt(null,hn)},kt=function($t){var hn=it.addMonth(Ct,$t);We(hn),gt(null,hn)};return I.createElement("div",{className:P()(dt,Object(M.a)({},"".concat(dt,"-active"),De))},I.createElement(we,Object.assign({},Q,{prefixCls:de,value:At,viewDate:Ct,onPrevYear:function(){wt(-1)},onNextYear:function(){wt(1)},onPrevMonth:function(){kt(-1)},onNextMonth:function(){kt(1)},onMonthClick:function(){gt("month",Ct)},onYearClick:function(){gt("year",Ct)}})),I.createElement(Ae,Object.assign({},Q,{onSelect:function($t){return ot($t,"mouse")},prefixCls:de,value:At,viewDate:Ct,rowCount:ie})))}var me=ae;function be(Q,de,Te){if(!Te)return de;var Se=de;return Se=Q.setHour(Se,Q.getHour(Te)),Se=Q.setMinute(Se,Q.getMinute(Te)),Se=Q.setSecond(Se,Q.getSecond(Te)),Se}var ye=le("date","time");function Be(Q){var de=Q.prefixCls,Te=Q.operationRef,Se=Q.generateConfig,rt=Q.value,De=Q.defaultValue,Je=Q.disabledTime,it=Q.showTime,At=Q.onSelect,Ct="".concat(de,"-datetime-panel"),We=I.useState(null),gt=Object(K.a)(We,2),ot=gt[0],dt=gt[1],wt=I.useRef({}),kt=I.useRef({}),mt=Object(m.a)(it)==="object"?Object(k.a)({},it):{};function $t(On){var Nn=ye.indexOf(ot)+On,Mn=ye[Nn]||null;return Mn}var hn=function(Nn){kt.current.onBlur&&kt.current.onBlur(Nn),dt(null)};Te.current={onKeyDown:function(Nn){if(Nn.which===u.a.TAB){var Mn=$t(Nn.shiftKey?-1:1);return dt(Mn),Mn&&Nn.preventDefault(),!0}if(ot){var Pt=ot==="date"?wt:kt;return Pt.current&&Pt.current.onKeyDown&&Pt.current.onKeyDown(Nn),!0}return[u.a.LEFT,u.a.RIGHT,u.a.UP,u.a.DOWN].includes(Nn.which)?(dt("date"),!0):!1},onBlur:hn,onClose:hn};var Pn=function(Nn,Mn){var Pt=Nn;Mn==="date"&&!rt&&mt.defaultValue?(Pt=Se.setHour(Pt,Se.getHour(mt.defaultValue)),Pt=Se.setMinute(Pt,Se.getMinute(mt.defaultValue)),Pt=Se.setSecond(Pt,Se.getSecond(mt.defaultValue))):Mn==="time"&&!rt&&De&&(Pt=Se.setYear(Pt,Se.getYear(De)),Pt=Se.setMonth(Pt,Se.getMonth(De)),Pt=Se.setDate(Pt,Se.getDate(De))),At&&At(Pt,"mouse")},Gn=Je?Je(rt||null):{};return I.createElement("div",{className:P()(Ct,Object(M.a)({},"".concat(Ct,"-active"),ot))},I.createElement(me,Object.assign({},Q,{operationRef:wt,active:ot==="date",onSelect:function(Nn){Pn(be(Se,Nn,it&&Object(m.a)(it)==="object"?it.defaultValue:null),"date")}})),I.createElement(Ve,Object.assign({},Q,{format:void 0},mt,Gn,{defaultValue:void 0,operationRef:kt,active:ot==="time",onSelect:function(Nn){Pn(Nn,"time")}})))}var St=Be;function an(Q){var de=Q.prefixCls,Te=Q.generateConfig,Se=Q.locale,rt=Q.value,De="".concat(de,"-cell"),Je=function(We){return I.createElement("td",{key:"week",className:P()(De,"".concat(De,"-week"))},Te.locale.getWeek(Se.locale,We))},it="".concat(de,"-week-panel-row"),At=function(We){return P()(it,Object(M.a)({},"".concat(it,"-selected"),qt(Te,Se.locale,rt,We)))};return I.createElement(me,Object.assign({},Q,{panelName:"week",prefixColumn:Je,rowClassName:At,keyboardConfig:{onLeftRight:null}}))}var Dn=an;function yt(Q){var de=Q.prefixCls,Te=Q.generateConfig,Se=Q.locale,rt=Q.viewDate,De=Q.onNextYear,Je=Q.onPrevYear,it=Q.onYearClick,At=I.useContext(o),Ct=At.hideHeader;if(Ct)return null;var We="".concat(de,"-header");return I.createElement(i,Object.assign({},Q,{prefixCls:We,onSuperPrev:Je,onSuperNext:De}),I.createElement("button",{type:"button",onClick:it,className:"".concat(de,"-year-btn")},Te.locale.format(Se.locale,rt,Se.yearFormat)))}var en=yt,_t=3,Et=4;function st(Q){var de=Q.prefixCls,Te=Q.locale,Se=Q.value,rt=Q.viewDate,De=Q.generateConfig,Je=Q.monthCellRender,it=I.useContext(vt),At=it.rangedValue,Ct=it.hoverRangedValue,We="".concat(de,"-cell"),gt=Ot({cellPrefixCls:We,value:Se,generateConfig:De,rangedValue:At,hoverRangedValue:Ct,isSameCell:function(mt,$t){return $e(De,mt,$t)},isInView:function(){return!0},offsetCell:function(mt,$t){return De.addMonth(mt,$t)}}),ot=Te.shortMonths||(De.locale.getShortMonths?De.locale.getShortMonths(Te.locale):[]),dt=De.setMonth(rt,0),wt=Je?function(kt){return Je(kt,Te)}:void 0;return I.createElement(nt,Object.assign({},Q,{rowNum:Et,colNum:_t,baseDate:dt,getCellNode:wt,getCellText:function(mt){return Te.monthFormat?De.locale.format(Te.locale,mt,Te.monthFormat):ot[De.getMonth(mt)]},getCellClassName:gt,getCellDate:De.addMonth,titleCell:function(mt){return De.locale.format(Te.locale,mt,"YYYY-MM")}}))}var he=st;function Le(Q){var de=Q.prefixCls,Te=Q.operationRef,Se=Q.onViewDateChange,rt=Q.generateConfig,De=Q.value,Je=Q.viewDate,it=Q.onPanelChange,At=Q.onSelect,Ct="".concat(de,"-month-panel");Te.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(wt){At(rt.addMonth(De||Je,wt),"key")},onCtrlLeftRight:function(wt){At(rt.addYear(De||Je,wt),"key")},onUpDown:function(wt){At(rt.addMonth(De||Je,wt*_t),"key")},onEnter:function(){it("date",De||Je)}})}};var We=function(ot){var dt=rt.addYear(Je,ot);Se(dt),it(null,dt)};return I.createElement("div",{className:Ct},I.createElement(en,Object.assign({},Q,{prefixCls:de,onPrevYear:function(){We(-1)},onNextYear:function(){We(1)},onYearClick:function(){it("year",Je)}})),I.createElement(he,Object.assign({},Q,{prefixCls:de,onSelect:function(ot){At(ot,"mouse"),it("date",ot)}})))}var Lt=Le;function ct(Q){var de=Q.prefixCls,Te=Q.generateConfig,Se=Q.locale,rt=Q.viewDate,De=Q.onNextYear,Je=Q.onPrevYear,it=Q.onYearClick,At=I.useContext(o),Ct=At.hideHeader;if(Ct)return null;var We="".concat(de,"-header");return I.createElement(i,Object.assign({},Q,{prefixCls:We,onSuperPrev:Je,onSuperNext:De}),I.createElement("button",{type:"button",onClick:it,className:"".concat(de,"-year-btn")},Te.locale.format(Se.locale,rt,Se.yearFormat)))}var tn=ct,un=4,Pe=1;function et(Q){var de=Q.prefixCls,Te=Q.locale,Se=Q.value,rt=Q.viewDate,De=Q.generateConfig,Je=I.useContext(vt),it=Je.rangedValue,At=Je.hoverRangedValue,Ct="".concat(de,"-cell"),We=Ot({cellPrefixCls:Ct,value:Se,generateConfig:De,rangedValue:it,hoverRangedValue:At,isSameCell:function(dt,wt){return ze(De,dt,wt)},isInView:function(){return!0},offsetCell:function(dt,wt){return De.addMonth(dt,wt*3)}}),gt=De.setDate(De.setMonth(rt,0),1);return I.createElement(nt,Object.assign({},Q,{rowNum:Pe,colNum:un,baseDate:gt,getCellText:function(dt){return De.locale.format(Te.locale,dt,Te.quarterFormat||"[Q]Q")},getCellClassName:We,getCellDate:function(dt,wt){return De.addMonth(dt,wt*3)},titleCell:function(dt){return De.locale.format(Te.locale,dt,"YYYY-[Q]Q")}}))}var jt=et;function bn(Q){var de=Q.prefixCls,Te=Q.operationRef,Se=Q.onViewDateChange,rt=Q.generateConfig,De=Q.value,Je=Q.viewDate,it=Q.onPanelChange,At=Q.onSelect,Ct="".concat(de,"-quarter-panel");Te.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(wt){At(rt.addMonth(De||Je,wt*3),"key")},onCtrlLeftRight:function(wt){At(rt.addYear(De||Je,wt),"key")},onUpDown:function(wt){At(rt.addYear(De||Je,wt),"key")}})}};var We=function(ot){var dt=rt.addYear(Je,ot);Se(dt),it(null,dt)};return I.createElement("div",{className:Ct},I.createElement(tn,Object.assign({},Q,{prefixCls:de,onPrevYear:function(){We(-1)},onNextYear:function(){We(1)},onYearClick:function(){it("year",Je)}})),I.createElement(jt,Object.assign({},Q,{prefixCls:de,onSelect:function(ot){At(ot,"mouse")}})))}var Kt=bn;function Xt(Q){var de=Q.prefixCls,Te=Q.generateConfig,Se=Q.viewDate,rt=Q.onPrevDecade,De=Q.onNextDecade,Je=Q.onDecadeClick,it=I.useContext(o),At=it.hideHeader;if(At)return null;var Ct="".concat(de,"-header"),We=Te.getYear(Se),gt=Math.floor(We/hr)*hr,ot=gt+hr-1;return I.createElement(i,Object.assign({},Q,{prefixCls:Ct,onSuperPrev:rt,onSuperNext:De}),I.createElement("button",{type:"button",onClick:Je,className:"".concat(de,"-decade-btn")},gt,"-",ot))}var Yn=Xt,Bn=3,_n=4;function br(Q){var de=Q.prefixCls,Te=Q.value,Se=Q.viewDate,rt=Q.locale,De=Q.generateConfig,Je=I.useContext(vt),it=Je.rangedValue,At=Je.hoverRangedValue,Ct="".concat(de,"-cell"),We=De.getYear(Se),gt=Math.floor(We/hr)*hr,ot=gt+hr-1,dt=De.setYear(Se,gt-Math.ceil((Bn*_n-hr)/2)),wt=function($t){var hn=De.getYear($t);return gt<=hn&&hn<=ot},kt=Ot({cellPrefixCls:Ct,value:Te,generateConfig:De,rangedValue:it,hoverRangedValue:At,isSameCell:function($t,hn){return oe(De,$t,hn)},isInView:wt,offsetCell:function($t,hn){return De.addYear($t,hn)}});return I.createElement(nt,Object.assign({},Q,{rowNum:_n,colNum:Bn,baseDate:dt,getCellText:De.getYear,getCellClassName:kt,getCellDate:De.addYear,titleCell:function($t){return De.locale.format(rt.locale,$t,"YYYY")}}))}var Fr=br,hr=10;function Qn(Q){var de=Q.prefixCls,Te=Q.operationRef,Se=Q.onViewDateChange,rt=Q.generateConfig,De=Q.value,Je=Q.viewDate,it=Q.sourceMode,At=Q.onSelect,Ct=Q.onPanelChange,We="".concat(de,"-year-panel");Te.current={onKeyDown:function(dt){return v(dt,{onLeftRight:function(kt){At(rt.addYear(De||Je,kt),"key")},onCtrlLeftRight:function(kt){At(rt.addYear(De||Je,kt*hr),"key")},onUpDown:function(kt){At(rt.addYear(De||Je,kt*Bn),"key")},onEnter:function(){Ct(it==="date"?"date":"month",De||Je)}})}};var gt=function(dt){var wt=rt.addYear(Je,dt*10);Se(wt),Ct(null,wt)};return I.createElement("div",{className:We},I.createElement(Yn,Object.assign({},Q,{prefixCls:de,onPrevDecade:function(){gt(-1)},onNextDecade:function(){gt(1)},onDecadeClick:function(){Ct("decade",Je)}})),I.createElement(Fr,Object.assign({},Q,{prefixCls:de,onSelect:function(dt){Ct(it==="date"?"date":"month",dt),At(dt,"mouse")}})))}var Dr=Qn;function Kr(Q){var de=Q.prefixCls,Te=Q.generateConfig,Se=Q.viewDate,rt=Q.onPrevDecades,De=Q.onNextDecades,Je=I.useContext(o),it=Je.hideHeader;if(it)return null;var At="".concat(de,"-header"),Ct=Te.getYear(Se),We=Math.floor(Ct/ri)*ri,gt=We+ri-1;return I.createElement(i,Object.assign({},Q,{prefixCls:At,onSuperPrev:rt,onSuperNext:De}),We,"-",gt)}var ti=Kr,dn=3,rr=4;function fi(Q){var de=ni-1,Te=Q.prefixCls,Se=Q.viewDate,rt=Q.generateConfig,De=Q.disabledDate,Je="".concat(Te,"-cell"),it=rt.getYear(Se),At=Math.floor(it/ni)*ni,Ct=Math.floor(it/ri)*ri,We=Ct+ri-1,gt=rt.setYear(Se,Ct-Math.ceil((dn*rr*ni-ri)/2)),ot=function(wt){var kt,mt=De&&De(wt),$t=rt.getYear(wt),hn=$t+de;return kt={},Object(M.a)(kt,"".concat(Je,"-disabled"),mt),Object(M.a)(kt,"".concat(Je,"-in-view"),Ct<=$t&&hn<=We),Object(M.a)(kt,"".concat(Je,"-selected"),$t===At),kt};return I.createElement(nt,Object.assign({},Q,{rowNum:rr,colNum:dn,baseDate:gt,getCellText:function(wt){var kt=rt.getYear(wt);return"".concat(kt,"-").concat(kt+de)},getCellClassName:ot,getCellDate:function(wt,kt){return rt.addYear(wt,kt*ni)}}))}var wi=fi,ni=10,ri=ni*10;function X(Q){var de=Q.prefixCls,Te=Q.onViewDateChange,Se=Q.generateConfig,rt=Q.viewDate,De=Q.operationRef,Je=Q.onSelect,it=Q.onPanelChange,At="".concat(de,"-decade-panel");De.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(wt){Je(Se.addYear(rt,wt*ni),"key")},onCtrlLeftRight:function(wt){Je(Se.addYear(rt,wt*ri),"key")},onUpDown:function(wt){Je(Se.addYear(rt,wt*ni*dn),"key")},onEnter:function(){it("year",rt)}})}};var Ct=function(ot){var dt=Se.addYear(rt,ot*ri);Te(dt),it(null,dt)},We=function(ot){Je(ot,"mouse"),it("year",ot)};return I.createElement("div",{className:At},I.createElement(ti,Object.assign({},Q,{prefixCls:de,onPrevDecades:function(){Ct(-1)},onNextDecades:function(){Ct(1)}})),I.createElement(wi,Object.assign({},Q,{prefixCls:de,onSelect:We})))}var L=X;function N(Q,de,Te){return Te?I.createElement("div",{className:"".concat(Q,"-footer-extra")},Te(de)):null}function V(Q){var de=Q.prefixCls,Te=Q.rangeList,Se=Te===void 0?[]:Te,rt=Q.components,De=rt===void 0?{}:rt,Je=Q.needConfirmButton,it=Q.onNow,At=Q.onOk,Ct=Q.okDisabled,We=Q.showNow,gt=Q.locale,ot,dt;if(Se.length){var wt=De.rangeItem||"span";ot=I.createElement(I.Fragment,null,Se.map(function(mt){var $t=mt.label,hn=mt.onClick,Pn=mt.onMouseEnter,Gn=mt.onMouseLeave;return I.createElement("li",{key:$t,className:"".concat(de,"-preset")},I.createElement(wt,{onClick:hn,onMouseEnter:Pn,onMouseLeave:Gn},$t))}))}if(Je){var kt=De.button||"button";it&&!ot&&We!==!1&&(ot=I.createElement("li",{className:"".concat(de,"-now")},I.createElement("a",{className:"".concat(de,"-now-btn"),onClick:it},gt.now))),dt=Je&&I.createElement("li",{className:"".concat(de,"-ok")},I.createElement(kt,{disabled:Ct,onClick:At},gt.ok))}return!ot&&!dt?null:I.createElement("ul",{className:"".concat(de,"-ranges")},ot,dt)}function ne(Q){var de,Te=Q.prefixCls,Se=Te===void 0?"rc-picker":Te,rt=Q.className,De=Q.style,Je=Q.locale,it=Q.generateConfig,At=Q.value,Ct=Q.defaultValue,We=Q.pickerValue,gt=Q.defaultPickerValue,ot=Q.disabledDate,dt=Q.mode,wt=Q.picker,kt=wt===void 0?"date":wt,mt=Q.tabIndex,$t=mt===void 0?0:mt,hn=Q.showNow,Pn=Q.showTime,Gn=Q.showToday,On=Q.renderExtraFooter,Nn=Q.hideHeader,Mn=Q.onSelect,Pt=Q.onChange,fn=Q.onPanelChange,Wt=Q.onMouseDown,Rt=Q.onPickerValueChange,Un=Q.onOk,Rn=Q.components,Yt=Q.direction,ht=Q.hourStep,jn=ht===void 0?1:ht,pn=Q.minuteStep,qn=pn===void 0?1:pn,Zt=Q.secondStep,An=Zt===void 0?1:Zt,Fn=kt==="date"&&!!Pn||kt==="time",vn=24%jn===0,yr=60%qn===0,Ln=60%An===0,Cn=I.useContext(o),Dt=Cn.operationRef,Ze=Cn.panelRef,It=Cn.onSelect,Mt=Cn.hideRanges,cn=Cn.defaultOpenValue,zn=I.useContext(vt),kn=zn.inRange,lr=zn.panelPosition,nr=zn.rangedValue,Or=zn.hoverRangedValue,mr=I.useRef({}),Er=I.useRef(!0),Zr=Object(p.a)(null,{value:At,defaultValue:Ct,postState:function(zt){return!zt&&cn&&kt==="time"?cn:zt}}),Yr=Object(K.a)(Zr,2),Jr=Yr[0],vi=Yr[1],_i=Object(p.a)(null,{value:We,defaultValue:gt||Jr,postState:function(zt){return zt||it.getNow()}}),xe=Object(K.a)(_i,2),je=xe[0],Ye=xe[1],Oe=function(zt){Ye(zt),Rt&&Rt(zt)},re=function(zt){var Vt=W[kt];return Vt?Vt(zt):zt},ge=Object(p.a)(function(){return kt==="time"?"time":re("date")},{value:dt}),ce=Object(K.a)(ge,2),Re=ce[0],Me=ce[1];I.useEffect(function(){Me(kt)},[kt]);var qe=I.useState(function(){return Re}),Ne=Object(K.a)(qe,2),lt=Ne[0],Nt=Ne[1],on=function(zt,Vt){var pr=re(zt||Re);Nt(Re),Me(pr),fn&&(Re!==pr||tt(it,je,je))&&fn(Vt,pr)},mn=function(zt,Vt){var pr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Re===kt||pr)&&(vi(zt),Mn&&Mn(zt),It&&It(zt,Vt),Pt&&!tt(it,zt,Jr)&&Pt(zt))},Wn=function(zt){return mr.current&&mr.current.onKeyDown?([u.a.LEFT,u.a.RIGHT,u.a.UP,u.a.DOWN,u.a.PAGE_UP,u.a.PAGE_DOWN,u.a.ENTER].includes(zt.which)&&zt.preventDefault(),mr.current.onKeyDown(zt)):(Object(_.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Vn=function(zt){mr.current&&mr.current.onBlur&&mr.current.onBlur(zt)};Dt&&lr!=="right"&&(Dt.current={onKeyDown:Wn,onClose:function(){mr.current&&mr.current.onClose&&mr.current.onClose()}}),I.useEffect(function(){At&&!Er.current&&Ye(At)},[At]),I.useEffect(function(){Er.current=!1},[]);var fr,cr=Object(k.a)(Object(k.a)({},Q),{},{operationRef:mr,prefixCls:Se,viewDate:je,value:Jr,onViewDateChange:Oe,sourceMode:lt,onPanelChange:on,disabledDate:Re!=="decade"?ot:void 0});delete cr.onChange,delete cr.onSelect;switch(Re){case"decade":fr=I.createElement(L,Object.assign({},cr,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}}));break;case"year":fr=I.createElement(Dr,Object.assign({},cr,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}}));break;case"month":fr=I.createElement(Lt,Object.assign({},cr,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}}));break;case"quarter":fr=I.createElement(Kt,Object.assign({},cr,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}}));break;case"week":fr=I.createElement(Dn,Object.assign({},cr,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}}));break;case"time":delete cr.showTime,fr=I.createElement(Ve,Object.assign({},cr,Object(m.a)(Pn)==="object"?Pn:null,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}}));break;default:Pn?fr=I.createElement(St,Object.assign({},cr,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}})):fr=I.createElement(me,Object.assign({},cr,{onSelect:function(zt,Vt){Oe(zt),mn(zt,Vt)}}))}var xr,Rr,gr=function(){var zt=it.getNow(),Vt=Xe(it.getHour(zt),it.getMinute(zt),it.getSecond(zt),vn?jn:1,yr?qn:1,Ln?An:1),pr=Qe(it,zt,Vt[0],Vt[1],Vt[2]);mn(pr,"submit")};Mt||(xr=N(Se,Re,On),Rr=V({prefixCls:Se,components:Rn,needConfirmButton:Fn,okDisabled:!Jr||ot&&ot(Jr),locale:Je,showNow:hn,onNow:Fn&&gr,onOk:function(){Jr&&(mn(Jr,"submit",!0),Un&&Un(Jr))}}));var wr;if(Gn&&Re==="date"&&kt==="date"&&!Pn){var Lr=it.getNow(),gn="".concat(Se,"-today-btn"),rn=ot&&ot(Lr);wr=I.createElement("a",{className:P()(gn,rn&&"".concat(gn,"-disabled")),"aria-disabled":rn,onClick:function(){rn||mn(Lr,"mouse",!0)}},Je.today)}return I.createElement(o.Provider,{value:Object(k.a)(Object(k.a)({},Cn),{},{hideHeader:"hideHeader"in Q?Nn:Cn.hideHeader,hidePrevBtn:kn&&lr==="right",hideNextBtn:kn&&lr==="left"})},I.createElement("div",{tabIndex:$t,className:P()("".concat(Se,"-panel"),rt,(de={},Object(M.a)(de,"".concat(Se,"-panel-has-range"),nr&&nr[0]&&nr[1]),Object(M.a)(de,"".concat(Se,"-panel-has-range-hover"),Or&&Or[0]&&Or[1]),Object(M.a)(de,"".concat(Se,"-panel-rtl"),Yt==="rtl"),de)),style:De,onKeyDown:Wn,onBlur:Vn,onMouseDown:Wt,ref:Ze},fr,xr||Rr||wr?I.createElement("div",{className:"".concat(Se,"-footer")},xr,Rr,wr):null))}var J=ne,Fe=D("uciX"),Jt={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function In(Q){var de,Te=Q.prefixCls,Se=Q.popupElement,rt=Q.popupStyle,De=Q.visible,Je=Q.dropdownClassName,it=Q.dropdownAlign,At=Q.transitionName,Ct=Q.getPopupContainer,We=Q.children,gt=Q.range,ot=Q.popupPlacement,dt=Q.direction,wt="".concat(Te,"-dropdown"),kt=function(){return ot!==void 0?ot:dt==="rtl"?"bottomRight":"bottomLeft"};return I.createElement(Fe.a,{showAction:[],hideAction:[],popupPlacement:kt(),builtinPlacements:Jt,prefixCls:wt,popupTransitionName:At,popup:Se,popupAlign:it,popupVisible:De,popupClassName:P()(Je,(de={},Object(M.a)(de,"".concat(wt,"-range"),gt),Object(M.a)(de,"".concat(wt,"-rtl"),dt==="rtl"),de)),popupStyle:rt,getPopupContainer:Ct},We)}var Zn=In;function ln(Q){var de=Q.open,Te=Q.value,Se=Q.isClickOutside,rt=Q.triggerOpen,De=Q.forwardKeyDown,Je=Q.blurToCancel,it=Q.onSubmit,At=Q.onCancel,Ct=Q.onFocus,We=Q.onBlur,gt=Object(I.useState)(!1),ot=Object(K.a)(gt,2),dt=ot[0],wt=ot[1],kt=Object(I.useState)(!1),mt=Object(K.a)(kt,2),$t=mt[0],hn=mt[1],Pn=Object(I.useRef)(!1),Gn=Object(I.useRef)(!1),On={onMouseDown:function(){wt(!0),rt(!0)},onKeyDown:function(Mn){switch(Mn.which){case u.a.ENTER:{de?it()!==!1&&wt(!0):rt(!0),Mn.preventDefault();return}case u.a.TAB:{dt&&de&&!Mn.shiftKey?(wt(!1),Mn.preventDefault()):!dt&&de&&(!De(Mn)&&Mn.shiftKey&&(wt(!0),Mn.preventDefault()));return}case u.a.ESC:{wt(!0),At();return}}!de&&![u.a.SHIFT].includes(Mn.which)?rt(!0):dt||De(Mn)},onFocus:function(Mn){wt(!0),hn(!0),Ct&&Ct(Mn)},onBlur:function(Mn){if(Pn.current||!Se(document.activeElement)){Pn.current=!1;return}Je?setTimeout(function(){Se(document.activeElement)&&At()},0):de&&(rt(!1),Gn.current&&it()),hn(!1),We&&We(Mn)}};return Object(I.useEffect)(function(){Gn.current=!1},[de]),Object(I.useEffect)(function(){Gn.current=!0},[Te]),Object(I.useEffect)(function(){return g(function(Nn){var Mn=Nn.target;de&&(Se(Mn)?$t||rt(!1):(Pn.current=!0,requestAnimationFrame(function(){Pn.current=!1})))})}),[On,{focused:$t,typing:dt}]}function ir(Q){var de=Q.valueTexts,Te=Q.onTextChange,Se=I.useState(""),rt=Object(K.a)(Se,2),De=rt[0],Je=rt[1],it=I.useRef([]);it.current=de;function At(We){Je(We),Te(We)}function Ct(){Je(it.current[0])}return I.useEffect(function(){de.every(function(We){return We!==De})&&Ct()},[de.join("||")]),[De,At,Ct]}var tr=D("Gytx"),Mr=D.n(tr);function ui(Q,de){var Te=de.formatList,Se=de.generateConfig,rt=de.locale;return Object(T.a)(function(){if(!Q)return[[""],""];for(var De="",Je=[],it=0;it<Te.length;it+=1){var At=Te[it],Ct=Se.locale.format(rt.locale,Q,At);Je.push(Ct),it===0&&(De=Ct)}return[Je,De]},[Q,Te],function(De,Je){return De[0]!==Je[0]||!Mr()(De[1],Je[1])})}function oi(Q,de){var Te=de.formatList,Se=de.generateConfig,rt=de.locale,De=Object(I.useState)(null),Je=Object(K.a)(De,2),it=Je[0],At=Je[1],Ct=Object(I.useRef)(null);function We(mt){var $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Ct.current),$t){At(mt);return}Ct.current=requestAnimationFrame(function(){At(mt)})}var gt=ui(it,{formatList:Te,generateConfig:Se,locale:rt}),ot=Object(K.a)(gt,2),dt=ot[1];function wt(mt){We(mt)}function kt(){var mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;We(null,mt)}return Object(I.useEffect)(function(){kt(!0)},[Q]),Object(I.useEffect)(function(){return function(){return cancelAnimationFrame(Ct.current)}},[]),[dt,wt,kt]}function Gr(Q){var de,Te=Q.prefixCls,Se=Te===void 0?"rc-picker":Te,rt=Q.id,De=Q.tabIndex,Je=Q.style,it=Q.className,At=Q.dropdownClassName,Ct=Q.dropdownAlign,We=Q.popupStyle,gt=Q.transitionName,ot=Q.generateConfig,dt=Q.locale,wt=Q.inputReadOnly,kt=Q.allowClear,mt=Q.autoFocus,$t=Q.showTime,hn=Q.picker,Pn=hn===void 0?"date":hn,Gn=Q.format,On=Q.use12Hours,Nn=Q.value,Mn=Q.defaultValue,Pt=Q.open,fn=Q.defaultOpen,Wt=Q.defaultOpenValue,Rt=Q.suffixIcon,Un=Q.clearIcon,Rn=Q.disabled,Yt=Q.disabledDate,ht=Q.placeholder,jn=Q.getPopupContainer,pn=Q.pickerRef,qn=Q.panelRender,Zt=Q.onChange,An=Q.onOpenChange,Fn=Q.onFocus,vn=Q.onBlur,yr=Q.onMouseDown,Ln=Q.onMouseUp,Cn=Q.onMouseEnter,Dt=Q.onMouseLeave,Ze=Q.onContextMenu,It=Q.onClick,Mt=Q.direction,cn=Q.autoComplete,zn=cn===void 0?"off":cn,kn=I.useRef(null),lr=Pn==="date"&&!!$t||Pn==="time",nr=se(E(Gn,Pn,$t,On)),Or=I.useRef(null),mr=I.useRef(null),Er=Object(p.a)(null,{value:Nn,defaultValue:Mn}),Zr=Object(K.a)(Er,2),Yr=Zr[0],Jr=Zr[1],vi=I.useState(Yr),_i=Object(K.a)(vi,2),xe=_i[0],je=_i[1],Ye=I.useRef(null),Oe=Object(p.a)(!1,{value:Pt,defaultValue:fn,postState:function(vr){return Rn?!1:vr},onChange:function(vr){An&&An(vr),!vr&&Ye.current&&Ye.current.onClose&&Ye.current.onClose()}}),re=Object(K.a)(Oe,2),ge=re[0],ce=re[1],Re=ui(xe,{formatList:nr,generateConfig:ot,locale:dt}),Me=Object(K.a)(Re,2),qe=Me[0],Ne=Me[1],lt=ir({valueTexts:qe,onTextChange:function(vr){var yi=ot.locale.parse(dt.locale,vr,nr);yi&&(!Yt||!Yt(yi))&&je(yi)}}),Nt=Object(K.a)(lt,3),on=Nt[0],mn=Nt[1],Wn=Nt[2],Vn=function(vr){je(vr),Jr(vr),Zt&&!tt(ot,Yr,vr)&&Zt(vr,vr?ot.locale.format(dt.locale,vr,nr[0]):"")},fr=function(vr){if(Rn&&vr)return;ce(vr)},cr=function(vr){return ge&&Ye.current&&Ye.current.onKeyDown?Ye.current.onKeyDown(vr):(Object(_.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},xr=function(){Ln&&Ln.apply(void 0,arguments),kn.current&&(kn.current.focus(),fr(!0))},Rr=ln({blurToCancel:lr,open:ge,value:on,triggerOpen:fr,forwardKeyDown:cr,isClickOutside:function(vr){return!H([Or.current,mr.current],vr)},onSubmit:function(){return Yt&&Yt(xe)?!1:(Vn(xe),fr(!1),Wn(),!0)},onCancel:function(){fr(!1),je(Yr),Wn()},onFocus:Fn,onBlur:vn}),gr=Object(K.a)(Rr,2),wr=gr[0],Lr=gr[1],gn=Lr.focused,rn=Lr.typing;I.useEffect(function(){ge||(je(Yr),!qe.length||qe[0]===""?mn(""):Ne!==on&&Wn())},[ge,qe]),I.useEffect(function(){ge||Wn()},[Pn]),I.useEffect(function(){je(Yr)},[Yr]),pn&&(pn.current={focus:function(){kn.current&&kn.current.focus()},blur:function(){kn.current&&kn.current.blur()}});var wn=Object(k.a)(Object(k.a)({},Q),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),zt=I.createElement(J,Object.assign({},wn,{generateConfig:ot,className:P()(Object(M.a)({},"".concat(Se,"-panel-focused"),!rn)),value:xe,locale:dt,tabIndex:-1,onChange:je,direction:Mt}));qn&&(zt=qn(zt));var Vt=I.createElement("div",{className:"".concat(Se,"-panel-container"),onMouseDown:function(vr){vr.preventDefault()}},zt),pr;Rt&&(pr=I.createElement("span",{className:"".concat(Se,"-suffix")},Rt));var Pr;kt&&Yr&&!Rn&&(Pr=I.createElement("span",{onMouseDown:function(vr){vr.preventDefault(),vr.stopPropagation()},onMouseUp:function(vr){vr.preventDefault(),vr.stopPropagation(),Vn(null),fr(!1)},className:"".concat(Se,"-clear")},Un||I.createElement("span",{className:"".concat(Se,"-clear-btn")})));var ar=function(vr,yi){(yi==="submit"||yi!=="key"&&!lr)&&(Vn(vr),fr(!1))},Nr=Mt==="rtl"?"bottomRight":"bottomLeft",si=oi(on,{formatList:nr,generateConfig:ot,locale:dt}),Ur=Object(K.a)(si,3),Xr=Ur[0],zr=Ur[1],Wr=Ur[2];return I.createElement(o.Provider,{value:{operationRef:Ye,hideHeader:Pn==="time",panelRef:Or,onSelect:ar,open:ge,defaultOpenValue:Wt,onDateMouseEnter:zr,onDateMouseLeave:Wr}},I.createElement(Zn,{visible:ge,popupElement:Vt,popupStyle:We,prefixCls:Se,dropdownClassName:At,dropdownAlign:Ct,getPopupContainer:jn,transitionName:gt,popupPlacement:Nr,direction:Mt},I.createElement("div",{className:P()(Se,it,(de={},Object(M.a)(de,"".concat(Se,"-disabled"),Rn),Object(M.a)(de,"".concat(Se,"-focused"),gn),Object(M.a)(de,"".concat(Se,"-rtl"),Mt==="rtl"),de)),style:Je,onMouseDown:yr,onMouseUp:xr,onMouseEnter:Cn,onMouseLeave:Dt,onContextMenu:Ze,onClick:It},I.createElement("div",{className:P()("".concat(Se,"-input"),Object(M.a)({},"".concat(Se,"-input-placeholder"),!!Xr)),ref:mr},I.createElement("input",Object.assign({id:rt,tabIndex:De,disabled:Rn,readOnly:wt||!rn,value:Xr||on,onChange:function(vr){mn(vr.target.value)},autoFocus:mt,placeholder:ht,ref:kn,title:on},wr,{size:f(Pn,nr[0])},Ce(Q),{autoComplete:zn})),pr,Pr))))}var Li=function(Q){Object(U.a)(Te,Q);var de=Object(G.a)(Te);function Te(){var Se;return Object(q.a)(this,Te),Se=de.apply(this,arguments),Se.pickerRef=I.createRef(),Se.focus=function(){Se.pickerRef.current&&Se.pickerRef.current.focus()},Se.blur=function(){Se.pickerRef.current&&Se.pickerRef.current.blur()},Se}return Object(Y.a)(Te,[{key:"render",value:function(){return I.createElement(Gr,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Te}(I.Component),Vi=Li;function Ar(Q,de,Te){var Se=Q.picker,rt=Q.locale,De=Q.selectedValue,Je=Q.disabledDate,it=Q.disabled,At=Q.generateConfig,Ct=Ee(De,0),We=Ee(De,1);function gt(mt){var $t=At.getYear(mt),hn=At.locale.getWeek(rt.locale,mt);return $t*100+hn}function ot(mt){var $t=At.getYear(mt),hn=At.getMonth(mt);return $t*100+hn}function dt(mt){var $t=At.getYear(mt),hn=Ue(At,mt);return $t*10+hn}var wt=I.useCallback(function(mt){if(Je&&Je(mt))return!0;if(it[1]&&We)return!Bt(At,mt,We)&&At.isAfter(mt,We);if(de&&We)switch(Se){case"quarter":return dt(mt)>dt(We);case"month":return ot(mt)>ot(We);case"week":return gt(mt)>gt(We);default:return!Bt(At,mt,We)&&At.isAfter(mt,We)}return!1},[Je,it[1],We,de]),kt=I.useCallback(function(mt){if(Je&&Je(mt))return!0;if(it[0]&&Ct)return!Bt(At,mt,We)&&At.isAfter(Ct,mt);if(Te&&Ct)switch(Se){case"quarter":return dt(mt)<dt(Ct);case"month":return ot(mt)<ot(Ct);case"week":return gt(mt)<gt(Ct);default:return!Bt(At,mt,Ct)&&At.isAfter(Ct,mt)}return!1},[Je,it[0],Ct,Te]);return[wt,kt]}function Tr(Q,de,Te,Se){var rt=Ge(Q,Te,Se,1);function De(Je){return Je(Q,de)?"same":Je(rt,de)?"closing":"far"}switch(Te){case"year":return De(function(Je,it){return Ut(Se,Je,it)});case"quarter":case"month":return De(function(Je,it){return oe(Se,Je,it)});default:return De(function(Je,it){return $e(Se,Je,it)})}}function ii(Q,de,Te,Se){var rt=Ee(Q,0),De=Ee(Q,1);if(de===0)return rt;if(rt&&De){var Je=Tr(rt,De,Te,Se);switch(Je){case"same":return rt;case"closing":return rt;default:return Ge(De,Te,Se,-1)}}return rt}function Br(Q){var de=Q.values,Te=Q.picker,Se=Q.defaultDates,rt=Q.generateConfig,De=I.useState(function(){return[Ee(Se,0),Ee(Se,1)]}),Je=Object(K.a)(De,2),it=Je[0],At=Je[1],Ct=I.useState(null),We=Object(K.a)(Ct,2),gt=We[0],ot=We[1],dt=Ee(de,0),wt=Ee(de,1);function kt($t){return it[$t]?it[$t]:Ee(gt,$t)||ii(de,$t,Te,rt)||dt||wt||rt.getNow()}function mt($t,hn){if($t){var Pn=Ie(gt,$t,hn);At(Ie(it,null,hn)||[null,null]);var Gn=(hn+1)%2;Ee(de,Gn)||(Pn=Ie(Pn,$t,Gn)),ot(Pn)}else(dt||wt)&&ot(null)}return[kt,mt]}function Hn(Q,de){return Q&&Q[0]&&Q[1]&&de.isAfter(Q[0],Q[1])?[Q[1],Q[0]]:Q}function yn(Q,de,Te,Se){return Q||Se&&Se[de]?!0:!!Te[(de+1)%2]}function Sn(Q){var de,Te,Se,rt=Q.prefixCls,De=rt===void 0?"rc-picker":rt,Je=Q.id,it=Q.style,At=Q.className,Ct=Q.popupStyle,We=Q.dropdownClassName,gt=Q.transitionName,ot=Q.dropdownAlign,dt=Q.getPopupContainer,wt=Q.generateConfig,kt=Q.locale,mt=Q.placeholder,$t=Q.autoFocus,hn=Q.disabled,Pn=Q.format,Gn=Q.picker,On=Gn===void 0?"date":Gn,Nn=Q.showTime,Mn=Q.use12Hours,Pt=Q.separator,fn=Pt===void 0?"~":Pt,Wt=Q.value,Rt=Q.defaultValue,Un=Q.defaultPickerValue,Rn=Q.open,Yt=Q.defaultOpen,ht=Q.disabledDate,jn=Q.disabledTime,pn=Q.dateRender,qn=Q.panelRender,Zt=Q.ranges,An=Q.allowEmpty,Fn=Q.allowClear,vn=Q.suffixIcon,yr=Q.clearIcon,Ln=Q.pickerRef,Cn=Q.inputReadOnly,Dt=Q.mode,Ze=Q.renderExtraFooter,It=Q.onChange,Mt=Q.onOpenChange,cn=Q.onPanelChange,zn=Q.onCalendarChange,kn=Q.onFocus,lr=Q.onBlur,nr=Q.onOk,Or=Q.components,mr=Q.order,Er=Q.direction,Zr=Q.activePickerIndex,Yr=Q.autoComplete,Jr=Yr===void 0?"off":Yr,vi=On==="date"&&!!Nn||On==="time",_i=Object(I.useRef)({}),xe=Object(I.useRef)(null),je=Object(I.useRef)(null),Ye=Object(I.useRef)(null),Oe=Object(I.useRef)(null),re=Object(I.useRef)(null),ge=Object(I.useRef)(null),ce=Object(I.useRef)(null),Re=se(E(Pn,On,Nn,Mn)),Me=Object(p.a)(0,{value:Zr}),qe=Object(K.a)(Me,2),Ne=qe[0],lt=qe[1],Nt=Object(I.useRef)(null),on=I.useMemo(function(){return Array.isArray(hn)?hn:[hn||!1,hn||!1]},[hn]),mn=Object(p.a)(null,{value:Wt,defaultValue:Rt,postState:function(Jn){return On==="time"&&!mr?Jn:Hn(Jn,wt)}}),Wn=Object(K.a)(mn,2),Vn=Wn[0],fr=Wn[1],cr=Br({values:Vn,picker:On,defaultDates:Un,generateConfig:wt}),xr=Object(K.a)(cr,2),Rr=xr[0],gr=xr[1],wr=Object(p.a)(Vn,{postState:function(Jn){var dr=Jn;if(on[0]&&on[1])return dr;for(var kr=0;kr<2;kr+=1)on[kr]&&!Ee(dr,kr)&&!Ee(An,kr)&&(dr=Ie(dr,wt.getNow(),kr));return dr}}),Lr=Object(K.a)(wr,2),gn=Lr[0],rn=Lr[1],wn=Object(p.a)([On,On],{value:Dt}),zt=Object(K.a)(wn,2),Vt=zt[0],pr=zt[1];Object(I.useEffect)(function(){pr([On,On])},[On]);var Pr=function(Jn,dr){pr(Jn),cn&&cn(dr,Jn)},ar=Ar({picker:On,selectedValue:gn,locale:kt,disabled:on,disabledDate:ht,generateConfig:wt},_i.current[1],_i.current[0]),Nr=Object(K.a)(ar,2),si=Nr[0],Ur=Nr[1],Xr=Object(p.a)(!1,{value:Rn,defaultValue:Yt,postState:function(Jn){return on[Ne]?!1:Jn},onChange:function(Jn){Mt&&Mt(Jn),!Jn&&Nt.current&&Nt.current.onClose&&Nt.current.onClose()}}),zr=Object(K.a)(Xr,2),Wr=zr[0],Hr=zr[1],vr=Wr&&Ne===0,yi=Wr&&Ne===1,Qi=Object(I.useState)(0),ji=Object(K.a)(Qi,2),Ri=ji[0],ci=ji[1];Object(I.useEffect)(function(){!Wr&&xe.current&&ci(xe.current.offsetWidth)},[Wr]);var qr=I.useRef();function ai(Sr,Jn){if(Sr)clearTimeout(qr.current),_i.current[Jn]=!0,lt(Jn),Hr(Sr),Wr||gr(null,Jn);else if(Ne===Jn){Hr(Sr);var dr=_i.current;qr.current=setTimeout(function(){dr===_i.current&&(_i.current={})})}}function di(Sr){ai(!0,Sr),setTimeout(function(){var Jn=[ge,ce][Sr];Jn.current&&Jn.current.focus()},0)}function Fi(Sr,Jn){var dr=Sr,kr=Ee(dr,0),pi=Ee(dr,1);kr&&pi&&wt.isAfter(kr,pi)&&(On==="week"&&!qt(wt,kt.locale,kr,pi)||On==="quarter"&&!ze(wt,kr,pi)||On!=="week"&&On!=="quarter"&&On!=="time"&&!Bt(wt,kr,pi)?(Jn===0?(dr=[kr,null],pi=null):(kr=null,dr=[null,pi]),_i.current=Object(M.a)({},Jn,!0)):(On!=="time"||mr!==!1)&&(dr=Hn(dr,wt))),rn(dr);var ga=dr&&dr[0]?wt.locale.format(kt.locale,dr[0],Re[0]):"",aa=dr&&dr[1]?wt.locale.format(kt.locale,dr[1],Re[0]):"";if(zn){var Mi={range:Jn===0?"start":"end"};zn(dr,[ga,aa],Mi)}var $i=yn(kr,0,on,An),va=yn(pi,1,on,An),Wa=dr===null||$i&&va;Wa&&(fr(dr),It&&(!tt(wt,Ee(Vn,0),kr)||!tt(wt,Ee(Vn,1),pi))&&It(dr,[ga,aa]));var Ai=null;Jn===0&&!on[1]?Ai=1:Jn===1&&!on[0]&&(Ai=0),Ai!==null&&Ai!==Ne&&(!_i.current[Ai]||!Ee(dr,Ai))&&Ee(dr,Jn)?di(Ai):ai(!1,Jn)}var ha=function(Jn){return Wr&&Nt.current&&Nt.current.onKeyDown?Nt.current.onKeyDown(Jn):(Object(_.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sa={formatList:Re,generateConfig:wt,locale:kt},ei=ui(Ee(gn,0),sa),Zi=Object(K.a)(ei,2),qi=Zi[0],li=Zi[1],Qr=ui(Ee(gn,1),sa),Ti=Object(K.a)(Qr,2),Ma=Ti[0],no=Ti[1],la=function(Jn,dr){var kr=wt.locale.parse(kt.locale,Jn,Re),pi=dr===0?si:Ur;kr&&!pi(kr)&&(rn(Ie(gn,kr,dr)),gr(kr,dr))},Ca=ir({valueTexts:qi,onTextChange:function(Jn){return la(Jn,0)}}),Ta=Object(K.a)(Ca,3),Sa=Ta[0],ka=Ta[1],co=Ta[2],Ro=ir({valueTexts:Ma,onTextChange:function(Jn){return la(Jn,1)}}),za=Object(K.a)(Ro,3),Oa=za[0],Va=za[1],_a=za[2],Ra=Object(I.useState)(null),ho=Object(K.a)(Ra,2),Ya=ho[0],Aa=ho[1],Da=Object(I.useState)(null),ya=Object(K.a)(Da,2),Ni=ya[0],fa=ya[1],pa=oi(Sa,{formatList:Re,generateConfig:wt,locale:kt}),ba=Object(K.a)(pa,3),ma=ba[0],Xa=ba[1],$a=ba[2],Ja=oi(Oa,{formatList:Re,generateConfig:wt,locale:kt}),Ia=Object(K.a)(Ja,3),ua=Ia[0],Ea=Ia[1],ro=Ia[2],Ao=function(Jn){fa(Ie(gn,Jn,Ne)),Ne===0?Xa(Jn):Ea(Jn)},Do=function(){fa(Ie(gn,null,Ne)),Ne===0?$a():ro()},fo=function(Jn,dr){return{blurToCancel:vi,forwardKeyDown:ha,onBlur:lr,isClickOutside:function(pi){return!H([je.current,Ye.current,Oe.current],pi)},onFocus:function(pi){lt(Jn),kn&&kn(pi)},triggerOpen:function(pi){ai(pi,Jn)},onSubmit:function(){Fi(gn,Jn),dr()},onCancel:function(){ai(!1,Jn),rn(Vn),dr()}}},io=ln(Object(k.a)(Object(k.a)({},fo(0,co)),{},{open:vr,value:Sa})),po=Object(K.a)(io,2),Ki=po[0],bi=po[1],Pi=bi.focused,Ei=bi.typing,Na=ln(Object(k.a)(Object(k.a)({},fo(1,_a)),{},{open:yi,value:Oa})),mo=Object(K.a)(Na,2),ea=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function(Jn){!Wr&&!ge.current.contains(Jn.target)&&!ce.current.contains(Jn.target)&&(on[0]?on[1]||di(1):di(0))},Qa=function(Jn){Wr&&(Pi||oo)&&!ge.current.contains(Jn.target)&&!ce.current.contains(Jn.target)&&Jn.preventDefault()},Ua=Vn&&Vn[0]?wt.locale.format(kt.locale,Vn[0],"YYYYMMDDHHmmss"):"",go=Vn&&Vn[1]?wt.locale.format(kt.locale,Vn[1],"YYYYMMDDHHmmss"):"";Object(I.useEffect)(function(){Wr||(rn(Vn),!qi.length||qi[0]===""?ka(""):li!==Sa&&co(),!Ma.length||Ma[0]===""?Va(""):no!==Oa&&_a())},[Wr,qi,Ma]),Object(I.useEffect)(function(){rn(Vn)},[Ua,go]),Ln&&(Ln.current={focus:function(){ge.current&&ge.current.focus()},blur:function(){ge.current&&ge.current.blur(),ce.current&&ce.current.blur()}});var Za=Object.keys(Zt||{}),$r=Za.map(function(Sr){var Jn=Zt[Sr],dr=typeof Jn=="function"?Jn():Jn;return{label:Sr,onClick:function(){Fi(dr,null),ai(!1,Ne)},onMouseEnter:function(){Aa(dr)},onMouseLeave:function(){Aa(null)}}});function Ir(){var Sr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},dr=null;Wr&&Ni&&Ni[0]&&Ni[1]&&wt.isAfter(Ni[1],Ni[0])&&(dr=Ni);var kr=Nn;if(Nn&&Object(m.a)(Nn)==="object"&&Nn.defaultValue){var pi=Nn.defaultValue;kr=Object(k.a)(Object(k.a)({},Nn),{},{defaultValue:Ee(pi,Ne)||void 0})}var ga=null;return pn&&(ga=function(Mi,$i){return pn(Mi,$i,{range:Ne?"end":"start"})}),I.createElement(vt.Provider,{value:{inRange:!0,panelPosition:Sr,rangedValue:Ya||gn,hoverRangedValue:dr}},I.createElement(J,Object.assign({},Q,Jn,{dateRender:ga,showTime:kr,mode:Vt[Ne],generateConfig:wt,style:void 0,direction:Er,disabledDate:Ne===0?si:Ur,disabledTime:function(Mi){return jn?jn(Mi,Ne===0?"start":"end"):!1},className:P()(Object(M.a)({},"".concat(De,"-panel-focused"),Ne===0?!Ei:!so)),value:Ee(gn,Ne),locale:kt,tabIndex:-1,onPanelChange:function(Mi,$i){Pr(Ie(Vt,$i,Ne),Ie(gn,Mi,Ne));var va=Mi;Sr==="right"&&Vt[Ne]===$i&&(va=Ge(va,$i,wt,-1)),gr(va,Ne)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var gi=0,Bi=0;Ne&&Ye.current&&re.current&&je.current&&(gi=Ye.current.offsetWidth+re.current.offsetWidth,je.current.offsetWidth&&gi>je.current.offsetWidth&&(Bi=gi));var La=Er==="rtl"?{right:gi}:{left:gi};function ca(){var Sr,Jn=N(De,Vt[Ne],Ze),dr=V({prefixCls:De,components:Or,needConfirmButton:vi,okDisabled:!Ee(gn,Ne)||ht&&ht(gn[Ne]),locale:kt,rangeList:$r,onOk:function(){Ee(gn,Ne)&&(Fi(gn,Ne),nr&&nr(gn))}});if(On!=="time"&&!Nn){var kr=Rr(Ne),pi=Ge(kr,On,wt),ga=Vt[Ne],aa=ga===On,Mi=Ir(aa?"left":!1,{pickerValue:kr,onPickerValueChange:function(Ai){gr(Ai,Ne)}}),$i=Ir("right",{pickerValue:pi,onPickerValueChange:function(Ai){gr(Ge(Ai,On,wt,-1),Ne)}});Er==="rtl"?Sr=I.createElement(I.Fragment,null,$i,aa&&Mi):Sr=I.createElement(I.Fragment,null,Mi,aa&&$i)}else Sr=Ir();var va=I.createElement(I.Fragment,null,I.createElement("div",{className:"".concat(De,"-panels")},Sr),(Jn||dr)&&I.createElement("div",{className:"".concat(De,"-footer")},Jn,dr));return qn&&(va=qn(va)),I.createElement("div",{className:"".concat(De,"-panel-container"),style:{marginLeft:Bi},ref:je,onMouseDown:function(Ai){Ai.preventDefault()}},va)}var ja=I.createElement("div",{className:P()("".concat(De,"-range-wrapper"),"".concat(De,"-").concat(On,"-range-wrapper")),style:{minWidth:Ri}},I.createElement("div",{className:"".concat(De,"-range-arrow"),style:La}),ca()),da;vn&&(da=I.createElement("span",{className:"".concat(De,"-suffix")},vn));var Si;Fn&&(Ee(Vn,0)&&!on[0]||Ee(Vn,1)&&!on[1])&&(Si=I.createElement("span",{onMouseDown:function(Jn){Jn.preventDefault(),Jn.stopPropagation()},onMouseUp:function(Jn){Jn.preventDefault(),Jn.stopPropagation();var dr=Vn;on[0]||(dr=Ie(dr,null,0)),on[1]||(dr=Ie(dr,null,1)),Fi(dr,null),ai(!1,Ne)},className:"".concat(De,"-clear")},yr||I.createElement("span",{className:"".concat(De,"-clear-btn")})));var Fa={size:f(On,Re[0])},Ba=0,Ha=0;Ye.current&&Oe.current&&re.current&&(Ne===0?Ha=Ye.current.offsetWidth:(Ba=gi,Ha=Oe.current.offsetWidth));var Gi=Er==="rtl"?{right:Ba}:{left:Ba},Vr=function(Jn,dr){var kr=Ie(gn,Jn,Ne);dr==="submit"||dr!=="key"&&!vi?(Fi(kr,Ne),Ne===0?$a():ro()):rn(kr)};return I.createElement(o.Provider,{value:{operationRef:Nt,hideHeader:On==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Vr,open:Wr}},I.createElement(Zn,{visible:Wr,popupElement:ja,popupStyle:Ct,prefixCls:De,dropdownClassName:We,dropdownAlign:ot,getPopupContainer:dt,transitionName:gt,range:!0,direction:Er},I.createElement("div",Object.assign({ref:xe,className:P()(De,"".concat(De,"-range"),At,(de={},Object(M.a)(de,"".concat(De,"-disabled"),on[0]&&on[1]),Object(M.a)(de,"".concat(De,"-focused"),Ne===0?Pi:oo),Object(M.a)(de,"".concat(De,"-rtl"),Er==="rtl"),de)),style:it,onClick:xa,onMouseDown:Qa},Ce(Q)),I.createElement("div",{className:P()("".concat(De,"-input"),(Te={},Object(M.a)(Te,"".concat(De,"-input-active"),Ne===0),Object(M.a)(Te,"".concat(De,"-input-placeholder"),!!ma),Te)),ref:Ye},I.createElement("input",Object.assign({id:Je,disabled:on[0],readOnly:Cn||!Ei,value:ma||Sa,onChange:function(Jn){ka(Jn.target.value)},autoFocus:$t,placeholder:Ee(mt,0)||"",ref:ge},Ki,Fa,{autoComplete:Jr}))),I.createElement("div",{className:"".concat(De,"-range-separator"),ref:re},fn),I.createElement("div",{className:P()("".concat(De,"-input"),(Se={},Object(M.a)(Se,"".concat(De,"-input-active"),Ne===1),Object(M.a)(Se,"".concat(De,"-input-placeholder"),!!ua),Se)),ref:Oe},I.createElement("input",Object.assign({disabled:on[1],readOnly:Cn||!so,value:ua||Oa,onChange:function(Jn){Va(Jn.target.value)},placeholder:Ee(mt,1)||"",ref:ce},ea,Fa,{autoComplete:Jr}))),I.createElement("div",{className:"".concat(De,"-active-bar"),style:Object(k.a)(Object(k.a)({},Gi),{},{width:Ha,position:"absolute"})}),da,Si)))}var En=function(Q){Object(U.a)(Te,Q);var de=Object(G.a)(Te);function Te(){var Se;return Object(q.a)(this,Te),Se=de.apply(this,arguments),Se.pickerRef=I.createRef(),Se.focus=function(){Se.pickerRef.current&&Se.pickerRef.current.focus()},Se.blur=function(){Se.pickerRef.current&&Se.pickerRef.current.blur()},Se}return Object(Y.a)(Te,[{key:"render",value:function(){return I.createElement(Sn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Te}(I.Component),ur=En,sr=fe.b=Vi},osHv:function(Gt,fe,D){(function(q){q(D("VrN/"))})(function(q){"use strict";var Y=q.Pos;function U(c,s){return c.line-s.line||c.ch-s.ch}var G="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",M=G+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",k=new RegExp("<(/?)(["+G+"]["+M+"]*)","g");function K(c,s,i,n){this.line=s,this.ch=i,this.cm=c,this.text=c.getLine(s),this.min=n?Math.max(n.from,c.firstLine()):c.firstLine(),this.max=n?Math.min(n.to-1,c.lastLine()):c.lastLine()}function I(c,s){var i=c.cm.getTokenTypeAt(Y(c.line,s));return i&&/\btag\b/.test(i)}function r(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function P(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function _(c){for(;;){var s=c.text.indexOf(">",c.ch);if(s==-1){if(r(c))continue;return}if(!I(c,s+1)){c.ch=s+1;continue}var i=c.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(c.text.slice(i+1,s));return c.ch=s+1,n?"selfClose":"regular"}}function p(c){for(;;){var s=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(s==-1){if(P(c))continue;return}if(!I(c,s+1)){c.ch=s;continue}k.lastIndex=s,c.ch=s;var i=k.exec(c.text);if(i&&i.index==s)return i}}function m(c){for(;;){k.lastIndex=c.ch;var s=k.exec(c.text);if(!s){if(r(c))continue;return}if(!I(c,s.index+1)){c.ch=s.index+1;continue}return c.ch=s.index+s[0].length,s}}function u(c){for(;;){var s=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(s==-1){if(P(c))continue;return}if(!I(c,s+1)){c.ch=s;continue}var i=c.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(c.text.slice(i+1,s));return c.ch=s+1,n?"selfClose":"regular"}}function a(c,s){for(var i=[];;){var n=m(c),O,T=c.line,w=c.ch-(n?n[0].length:0);if(!n||!(O=_(c)))return;if(O=="selfClose")continue;if(n[1]){for(var R=i.length-1;R>=0;--R)if(i[R]==n[2]){i.length=R;break}if(R<0&&(!s||s==n[2]))return{tag:n[2],from:Y(T,w),to:Y(c.line,c.ch)}}else i.push(n[2])}}function o(c,s){for(var i=[];;){var n=u(c);if(!n)return;if(n=="selfClose"){p(c);continue}var O=c.line,T=c.ch,w=p(c);if(!w)return;if(w[1])i.push(w[2]);else{for(var R=i.length-1;R>=0;--R)if(i[R]==w[2]){i.length=R;break}if(R<0&&(!s||s==w[2]))return{tag:w[2],from:Y(c.line,c.ch),to:Y(O,T)}}}}q.registerHelper("fold","xml",function(c,s){for(var i=new K(c,s.line,0);;){var n=m(i);if(!n||i.line!=s.line)return;var O=_(i);if(!O)return;if(!n[1]&&O!="selfClose"){var T=Y(i.line,i.ch),w=a(i,n[2]);return w&&U(w.from,T)>0?{from:T,to:w.from}:null}}}),q.findMatchingTag=function(c,s,i){var n=new K(c,s.line,s.ch,i);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var O=_(n),T=O&&Y(n.line,n.ch),w=O&&p(n);if(!O||!w||U(n,s)>0)return;var R={from:Y(n.line,n.ch),to:T,tag:w[2]};return O=="selfClose"?{open:R,close:null,at:"open"}:w[1]?{open:o(n,w[2]),close:R,at:"close"}:(n=new K(c,T.line,T.ch,i),{open:R,close:a(n,w[2]),at:"open"})},q.findEnclosingTag=function(c,s,i,n){for(var O=new K(c,s.line,s.ch,i);;){var T=o(O,n);if(!T)break;var w=new K(c,s.line,s.ch,i),R=a(w,T.tag);if(R)return{open:T,close:R}}},q.scanForClosingTag=function(c,s,i,n){var O=new K(c,s.line,s.ch,n?{from:0,to:n}:null);return a(O,i)}})},p5ED:function(Gt,fe,D){"use strict";var q=D("+L6B"),Y=D("2/Rp"),U=D("5Dmo"),G=D("3S7+"),M=D("k1fw"),k=D("9og8"),K=D("tJVT"),I=D("WmNS"),r=D.n(I),P=D("q1tI"),_=D.n(P),p=D("vHTk"),m=D.n(p),u=D("yEEn"),a=D("ZW9T"),o=D("1vsH"),c=D("V0Rq"),s=D("m3rI");fe.a=function(i){var n,O,T,w,R,S,v,E=i.editOffice,f=E===void 0?"view":E,h=i.data,y=i.theme,g=i.type,x=i.filename,j=i.monacoEditor,F=i.className,A=i.style,W=i.close,H=i.onClose,C=i.hasMask,z=i.disabledDownload,Z=Object(P.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),le=Object(K.a)(Z,2),se=le[0],Ce=le[1],Ee=Object(P.useState)(""),Ie=Object(K.a)(Ee,2),Qe=Ie[0],Xe=Ie[1],_e=Object(P.useState)(),pe=Object(K.a)(_e,2),at=pe[0],Qt=pe[1],Ft=window.ENV==="build"?"/react/build":"",Tt=s.a.PROXY_SERVER||location.origin,Ve,pt=1024*1024,ut=10*pt,Ut=Object(P.useRef)();(n=h)!==null&&n!==void 0&&n.startsWith("/api")&&g!=="txt"&&(h=s.a.API_SERVER+h),g==="office"&&(Ve=Object(o.V)(h).filesize,Ve>ut&&(g="other")),x&&j&&(j.filename=x),Object(P.useEffect)(function(){var $e,Bt,Ht=($e=document.cookie)===null||$e===void 0||((Bt=$e.replace(/\s/g,""))===null||Bt===void 0)?void 0:Bt.split(";");Ht==null||Ht.map(function(qt){var tt=qt.split("=");tt[0]==="_educoder_session"&&Xe(tt[1])})},[]),Object(P.useEffect)(function(){g==="office"&&oe()},[g,h]);var oe=function(){var $e=Object(k.a)(r.a.mark(function Bt(){var Ht,qt,tt;return r.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return console.log("data:",h),Ht=h,h.startsWith("http")||(Ht=location.origin+Ht),qt=new URL(Ht).pathname.split("/").pop(),xn.next=6,Object(c.V)({attachment_id:qt});case 6:tt=xn.sent,Qt(tt);case 8:case"end":return xn.stop()}},Bt)}));return function(){return $e.apply(this,arguments)}}(),Ue=function(){if(h.startsWith("http")||h.startsWith("blob:")){ze();return}Object(o.B)(x||"educoder",h,x)},ze=function(){Object(o.z)(x||"educoder",decodeURIComponent(h))};return _.a.createElement("div",{style:Object(M.a)({},A||{}),className:"".concat(C&&m.a.bgBlack," ").concat(g?m.a.wrp:"hide")},W&&_.a.createElement("div",{className:m.a.close,ref:Ut},!z&&_.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ut.current}},_.a.createElement("span",{onClick:ze},_.a.createElement("i",{className:"icon-quxiaozhiding"}))),_.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ut.current}},_.a.createElement("span",{className:"",onClick:H},_.a.createElement("i",{className:"icon-guanbi1"})))),_.a.createElement("div",{className:"".concat(m.a[F]," ").concat(F," ").concat(m.a.monaco," ").concat(g==="txt"?"show":"hide")},g==="txt"&&_.a.createElement(a.b,j)),g==="audio"&&_.a.createElement("audio",{src:"".concat(((O=h)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((T=h)===null||T===void 0?void 0:T.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),g==="video"&&_.a.createElement(_.a.Fragment,null,((w=h)===null||w===void 0?void 0:w.indexOf("http"))>-1?_.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):_.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),g==="office"&&at&&_.a.createElement("iframe",{src:"".concat(Ft,"/office.html?key=").concat(at.key,"&url=").concat(Tt+at.url,"&callbackUrl=").concat(Tt+at.callbackUrl,"&fileType=").concat(at.fileType,"&title=").concat(at.title,"&model=").concat(f,"&officeServer=").concat(s.a.OFFICE_SERVER,"&disabledDownload=").concat(!!z)}),g==="html"&&_.a.createElement("iframe",{src:h+"&disposition=inline"}),g==="pdf"&&_.a.createElement("iframe",{src:"".concat(Ft,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!z)}),g==="image"&&_.a.createElement("img",{src:"".concat(((R=h)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((S=h)===null||S===void 0?void 0:S.indexOf("https://"))>-1||(v=h)!==null&&v!==void 0&&v.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),g==="other"&&_.a.createElement("div",null,_.a.createElement(Y.a,{type:"primary",size:"large",onClick:Ue},_.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),g==="download"&&_.a.createElement(Y.a,{type:"primary",size:"large",onClick:Ue},_.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Gt,fe,D){},pmY6:function(Gt,fe,D){"use strict";D.d(fe,"h",function(){return P}),D.d(fe,"g",function(){return p}),D.d(fe,"f",function(){return m}),D.d(fe,"e",function(){return u}),D.d(fe,"i",function(){return a}),D.d(fe,"b",function(){return o}),D.d(fe,"a",function(){return c}),D.d(fe,"d",function(){return s}),D.d(fe,"c",function(){return i});var q=D("C/vA"),Y=D("JYp7");const U=!1;let G=null;function M(n){G=n}if(U){const n="__is_disposable_tracked__";M(new class{trackDisposable(O){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[n]||console.log(T)},3e3)}setParent(O,T){if(O&&O!==c.None)try{O[n]=!0}catch(w){}}markAsDisposed(O){if(O&&O!==c.None)try{O[n]=!0}catch(T){}}markAsSingleton(O){}})}function k(n){return G==null||G.trackDisposable(n),n}function K(n){G==null||G.markAsDisposed(n)}function I(n,O){G==null||G.setParent(n,O)}function r(n,O){if(!G)return;for(const T of n)G.setParent(T,O)}function P(n){return G==null||G.markAsSingleton(n),n}class _ extends Error{constructor(n){super(`Encountered errors while disposing of store. Errors: [${n.join(", ")}]`);this.errors=n}}function p(n){return typeof n.dispose=="function"&&n.dispose.length===0}function m(n){if(Y.a.is(n)){let O=[];for(const T of n)if(T)try{T.dispose()}catch(w){O.push(w)}if(O.length===1)throw O[0];if(O.length>1)throw new _(O);return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function u(...n){const O=a(()=>m(n));return r(n,O),O}function a(n){const O=k({dispose:Object(q.a)(()=>{K(O),n()})});return O}class o{constructor(){this._toDispose=new Set,this._isDisposed=!1,k(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return I(n,this),this._isDisposed?o.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}}o.DISABLE_DISPOSED_WARNING=!1;class c{constructor(){this._store=new o,k(this),I(this._store,this)}dispose(){K(this),this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}}c.None=Object.freeze({dispose(){}});class s{constructor(){this._isDisposed=!1,k(this)}get value(){return this._isDisposed?void 0:this._value}set value(n){var O;if(this._isDisposed||n===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),n&&I(n,this),this._value=n}clear(){this.value=void 0}dispose(){var n;this._isDisposed=!0,K(this),(n=this._value)===null||n===void 0||n.dispose(),this._value=void 0}clearAndLeak(){const n=this._value;return this._value=void 0,n&&I(n,null),n}}class i{constructor(n){this.object=n}dispose(){}}},psGv:function(Gt,fe,D){var q,Y;(function(){var U;(function(){"use strict";var K=[,,function(_){function p(a){this.__parent=a,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 a=new p(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},p.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},p.prototype.has_match=function(a){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(a))return!0;return!1},p.prototype.set_indent=function(a,o){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=o||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 a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__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(a){this.__items.push(a);var o=a.lastIndexOf(`
|
|
`);o!==-1?this.__character_count=a.length-o:this.__character_count+=a.length},p.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},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 a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function m(a,o){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),o=o||"",a.indent_level>0&&(o=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(a,o){var c=this.__base_string_length;return o=o||0,a<0&&(c=0),c+=a*this.__indent_size,c+=o,c},m.prototype.get_indent_string=function(a,o){var c=this.__base_string;return o=o||0,a<0&&(a=0,c=""),o+=a*this.__indent_size,this.__ensure_cache(o),c+=this.__cache[o],c},m.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var a=this.__cache.length,o=0,c="";this.__indent_size&&a>=this.__indent_size&&(o=Math.floor(a/this.__indent_size),a-=o*this.__indent_size,c=new Array(o+1).join(this.__indent_string)),a&&(c+=new Array(a+1).join(" ")),this.__cache.push(c)};function u(a,o){this.__indent_cache=new m(a,o),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.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()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(a,o){return this.__indent_cache.get_indent_string(a,o)},u.prototype.get_indent_size=function(a,o){return this.__indent_cache.get_indent_size(a,o)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(a){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
|
|
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
|
|
`);return a!==`
|
|
`&&(c=c.replace(/[\n]/g,a)),c},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(a,o){return a=a||0,o=o||0,this.next_line.set_indent(a,o),this.__lines.length>1?(this.current_line.set_indent(a,o),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(a){for(var o=0;o<a.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.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(" "))},u.prototype.remove_indent=function(a){for(var o=this.__lines.length;a<o;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(a,o){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(a)!==0&&s.item(-1)!==o){this.__lines.splice(c+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},_.exports.Output=u},function(_){function p(m,u,a,o){this.type=m,this.text=u,this.comments_before=null,this.newlines=a||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}_.exports.Token=p},,,function(_){function p(a,o){this.raw_options=m(a,o),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(a,o){var c=this.raw_options[a],s=o||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},p.prototype._get_boolean=function(a,o){var c=this.raw_options[a],s=c===void 0?!!o:!!c;return s},p.prototype._get_characters=function(a,o){var c=this.raw_options[a],s=o||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},p.prototype._get_number=function(a,o){var c=this.raw_options[a];o=parseInt(o,10),isNaN(o)&&(o=0);var s=parseInt(c,10);return isNaN(s)&&(s=o),s},p.prototype._get_selection=function(a,o,c){var s=this._get_selection_list(a,o,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+o+`
|
|
You passed in: '`+this.raw_options[a]+"'");return s[0]},p.prototype._get_selection_list=function(a,o,c){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[o[0]],!this._is_valid_selection(c,o))throw new Error("Invalid Default Value!");var s=this._get_array(a,c);if(!this._is_valid_selection(s,o))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+o+`
|
|
You passed in: '`+this.raw_options[a]+"'");return s},p.prototype._is_valid_selection=function(a,o){return a.length&&o.length&&!a.some(function(c){return o.indexOf(c)===-1})};function m(a,o){var c={};a=u(a);var s;for(s in a)s!==o&&(c[s]=a[s]);if(o&&a[o])for(s in a[o])c[s]=a[o][s];return c}function u(a){var o={},c;for(c in a){var s=c.replace(/-/g,"_");o[s]=a[c]}return o}_.exports.Options=p,_.exports.normalizeOpts=u,_.exports.mergeOpts=m},,function(_){var p=RegExp.prototype.hasOwnProperty("sticky");function m(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},m.prototype.peek=function(u){var a=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(a=this.__input.charAt(u)),a},m.prototype.__match=function(u,a){u.lastIndex=a;var o=u.exec(this.__input);return o&&!(p&&u.sticky)&&(o.index!==a&&(o=null)),o},m.prototype.test=function(u,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(u,a):!1},m.prototype.testChar=function(u,a){var o=this.peek(a);return u.lastIndex=0,o!==null&&u.test(o)},m.prototype.match=function(u){var a=this.__match(u,this.__position);return a?this.__position+=a[0].length:a=null,a},m.prototype.read=function(u,a,o){var c="",s;return u&&(s=this.match(u),s&&(c+=s[0])),a&&(s||!u)&&(c+=this.readUntil(a,o)),c},m.prototype.readUntil=function(u,a){var o="",c=this.__position;u.lastIndex=this.__position;var s=u.exec(this.__input);return s?(c=s.index,a&&(c+=s[0].length)):c=this.__input_length,o=this.__input.substring(this.__position,c),this.__position=c,o},m.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},m.prototype.get_regexp=function(u,a){var o=null,c="g";return a&&p&&(c="y"),typeof u=="string"&&u!==""?o=new RegExp(u,c):u&&(o=new RegExp(u.source,c)),o},m.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(u){var a=this.__position,o=this.readUntilAfter(u);return this.__position=a,o},m.prototype.lookBack=function(u){var a=this.__position-1;return a>=u.length&&this.__input.substring(a-u.length,a).toLowerCase()===u},_.exports.InputScanner=m},function(_,p,m){var u=m(8).InputScanner,a=m(3).Token,o=m(10).TokenStream,c=m(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(n,O){this._input=new u(n),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var n,O=new a(s.START,""),T=null,w=[],R=new o;O.type!==s.EOF;){for(n=this._get_next_token(O,T);this._is_comment(n);)R.add(n),n=this._get_next_token(O,T);R.isEmpty()||(n.comments_before=R,R=new o),n.parent=T,this._is_opening(n)?(w.push(T),T=n):T&&this._is_closing(n,T)&&(n.opened=T,T.closed=n,T=w.pop(),n.parent=T),n.previous=O,O.next=n,this.__tokens.add(n),O=n}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(n,O){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(s.RAW,T):this._create_token(s.EOF,"")},i.prototype._is_comment=function(n){return!1},i.prototype._is_opening=function(n){return!1},i.prototype._is_closing=function(n,O){return!1},i.prototype._create_token=function(n,O){var T=new a(n,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},_.exports.Tokenizer=i,_.exports.TOKEN=s},function(_){function p(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}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 m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},p.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(u=this.__tokens[m]),u},p.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},_.exports.TokenStream=p},function(_,p,m){var u=m(12).Pattern;function a(o,c){u.call(this,o,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new u,a.prototype.__set_whitespace_patterns=function(o,c){o+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var c=this.__split(this._newline_regexp,o);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return o},a.prototype.matching=function(o,c){var s=this._create();return s.__set_whitespace_patterns(o,c),s._update(),s},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(o,c){o.lastIndex=0;for(var s=0,i=[],n=o.exec(c);n;)i.push(c.substring(s,n.index)),s=n.index+n[0].length,n=o.exec(c);return s<c.length?i.push(c.substring(s,c.length)):i.push(""),i},_.exports.WhitespacePattern=a},function(_){function p(m,u){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}p.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(m){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.until=function(m){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.starting_with=function(m){var u=this._create();return u._starting_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype.matching=function(m){var u=this._create();return u._match_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},_.exports.Pattern=p},function(_){function p(m,u){m=typeof m=="string"?m:m.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+u,"g")}p.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(m);a;)u[a[1]]=a[2],a=this.__directive_pattern.exec(m);return u},p.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},_.exports.Directives=p},function(_,p,m){var u=m(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(c,s){u.call(this,c,s),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var i=new u(c);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new u,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(c){var s=this._create();return s._disabled[c]=!0,s._update(),s},o.prototype.read_options=function(c){var s=this._create();for(var i in a)s._disabled[i]=c.templating.indexOf(i)===-1;return s._update(),s},o.prototype.exclude=function(c){var s=this._create();return s._excluded[c]=!0,s._update(),s},o.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),c+=s,s=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},o.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},o.prototype._read_template=function(){var c="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(c=c||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},_.exports.TemplatablePattern=o},,,,function(_,p,m){var u=m(19).Beautifier,a=m(20).Options;function o(c,s,i,n){var O=new u(c,s,i,n);return O.beautify()}_.exports=o,_.exports.defaultOptions=function(){return new a}},function(_,p,m){var u=m(20).Options,a=m(2).Output,o=m(21).Tokenizer,c=m(21).TOKEN,s=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,n=function(y,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=y.max_preserve_newlines,this.preserve_newlines=y.preserve_newlines,this._output=new a(y,g)};n.prototype.current_line_has_match=function(y){return this._output.current_line.has_match(y)},n.prototype.set_space_before_token=function(y,g){this._output.space_before_token=y,this._output.non_breaking_space=g},n.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},n.prototype.add_raw_token=function(y){this._output.add_raw_token(y)},n.prototype.print_preserved_newlines=function(y){var g=0;y.type!==c.TEXT&&y.previous.type!==c.TEXT&&(g=y.newlines?1:0),this.preserve_newlines&&(g=y.newlines<this.max_preserve_newlines+1?y.newlines:this.max_preserve_newlines+1);for(var x=0;x<g;x++)this.print_newline(x>0);return g!==0},n.prototype.traverse_whitespace=function(y){return y.whitespace_before||y.newlines?(this.print_preserved_newlines(y)||(this._output.space_before_token=!0),!0):!1},n.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},n.prototype.print_newline=function(y){this._output.add_new_line(y)},n.prototype.print_token=function(y){y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(y.text))},n.prototype.indent=function(){this.indent_level++},n.prototype.get_full_indent=function(y){return y=this.indent_level+(y||0),y<1?"":this._output.get_indent_string(y)};var O=function(y){for(var g=null,x=y.next;x.type!==c.EOF&&y.closed!==x;){if(x.type===c.ATTRIBUTE&&x.text==="type"){x.next&&x.next.type===c.EQUALS&&x.next.next&&x.next.next.type===c.VALUE&&(g=x.next.next.text);break}x=x.next}return g},T=function(y,g){var x=null,j=null;return g.closed?(y==="script"?x="text/javascript":y==="style"&&(x="text/css"),x=O(g)||x,x.search("text/css")>-1?j="css":x.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":x.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":x.search(/test\/null/)>-1&&(j="null"),j):null};function w(y,g){return g.indexOf(y)!==-1}function R(y,g,x){this.parent=y||null,this.tag=g?g.tag_name:"",this.indent_level=x||0,this.parser_token=g||null}function S(y){this._printer=y,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(y){var g=new R(this._current_frame,y,this._printer.indent_level);this._current_frame=g},S.prototype._try_pop_frame=function(y){var g=null;return y&&(g=y.parser_token,this._printer.indent_level=y.indent_level,this._current_frame=y.parent),g},S.prototype._get_frame=function(y,g){for(var x=this._current_frame;x&&!(y.indexOf(x.tag)!==-1);){if(g&&g.indexOf(x.tag)!==-1){x=null;break}x=x.parent}return x},S.prototype.try_pop=function(y,g){var x=this._get_frame([y],g);return this._try_pop_frame(x)},S.prototype.indent_to_tag=function(y){var g=this._get_frame(y);g&&(this._printer.indent_level=g.indent_level)};function v(y,g,x,j){this._source_text=y||"",g=g||{},this._js_beautify=x,this._css_beautify=j,this._tag_stack=null;var F=new u(g,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
|
|
`,y&&s.test(y)&&(g=y.match(s)[0])),y=y.replace(i,`
|
|
`);var x=y.match(/^[\t ]*/)[0],j={text:"",type:""},F=new E,A=new n(this._options,x),W=new o(y,this._options).tokenize();this._tag_stack=new S(A);for(var H=null,C=W.next();C.type!==c.EOF;)C.type===c.TAG_OPEN||C.type===c.COMMENT?(H=this._handle_tag_open(A,C,F,j),F=H):C.type===c.ATTRIBUTE||C.type===c.EQUALS||C.type===c.VALUE||C.type===c.TEXT&&!F.tag_complete?H=this._handle_inside_tag(A,C,F,W):C.type===c.TAG_CLOSE?H=this._handle_tag_close(A,C,F):C.type===c.TEXT?H=this._handle_text(A,C,F):A.add_raw_token(C),j=H,C=W.next();var z=A._output.get_code(g);return z},v.prototype._handle_tag_close=function(y,g,x){var j={text:g.text,type:g.type};return y.alignment_size=0,x.tag_complete=!0,y.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),x.is_unformatted?y.add_raw_token(g):(x.tag_start_char==="<"&&(y.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&x.has_wrapped_attrs&&y.print_newline(!1)),y.print_token(g)),x.indent_content&&!(x.is_unformatted||x.is_content_unformatted)&&(y.indent(),x.indent_content=!1),!x.is_inline_element&&!(x.is_unformatted||x.is_content_unformatted)&&y.set_wrap_point(),j},v.prototype._handle_inside_tag=function(y,g,x,j){var F=x.has_wrapped_attrs,A={text:g.text,type:g.type};if(y.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),x.is_unformatted)y.add_raw_token(g);else if(x.tag_start_char==="{"&&g.type===c.TEXT)y.print_preserved_newlines(g)?(g.newlines=0,y.add_raw_token(g)):y.print_token(g);else{if(g.type===c.ATTRIBUTE?(y.set_space_before_token(!0),x.attr_count+=1):(g.type===c.EQUALS||g.type===c.VALUE&&g.previous.type===c.EQUALS)&&y.set_space_before_token(!1),g.type===c.ATTRIBUTE&&x.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(y.traverse_whitespace(g),F=F||g.newlines!==0),this._is_wrap_attributes_force)){var W=x.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&x.attr_count===1){var H=!0,C=0,z;do{if(z=j.peek(C),z.type===c.ATTRIBUTE){H=!1;break}C+=1}while(C<4&&z.type!==c.EOF&&z.type!==c.TAG_CLOSE);W=!H}W&&(y.print_newline(!1),F=!0)}y.print_token(g),F=F||y.previous_token_wrapped(),x.has_wrapped_attrs=F}return A},v.prototype._handle_text=function(y,g,x){var j={text:g.text,type:"TK_CONTENT"};return x.custom_beautifier_name?this._print_custom_beatifier_text(y,g,x):x.is_unformatted||x.is_content_unformatted?y.add_raw_token(g):(y.traverse_whitespace(g),y.print_token(g)),j},v.prototype._print_custom_beatifier_text=function(y,g,x){var j=this;if(g.text!==""){var F=g.text,A,W=1,H="",C="";x.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:x.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:x.custom_beautifier_name==="html"&&(A=function(Ee,Ie){var Qe=new v(Ee,Ie,j._js_beautify,j._css_beautify);return Qe.beautify()}),this._options.indent_scripts==="keep"?W=0:this._options.indent_scripts==="separate"&&(W=-y.indent_level);var z=y.get_full_indent(W);if(F=F.replace(/\n[ \t]*$/,""),x.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var Z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!Z){y.add_raw_token(g);return}H=z+Z[1]+`
|
|
`,F=Z[4],Z[5]&&(C=z+Z[5]),F=F.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(`
|
|
`)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(g.whitespace_before=Z[0]))}if(F)if(A){var le=function(){this.eol=`
|
|
`};le.prototype=this._options.raw_options;var se=new le;F=A(z+F,se)}else{var Ce=g.whitespace_before;Ce&&(F=F.replace(new RegExp(`
|
|
(`+Ce+")?","g"),`
|
|
`)),F=z+F.replace(/\n/g,`
|
|
`+z)}H&&(F?F=H+F+`
|
|
`+C:F=H+C),y.print_newline(!1),F&&(g.text=F,g.whitespace_before="",g.newlines=0,y.add_raw_token(g),y.print_newline(!0))}},v.prototype._handle_tag_open=function(y,g,x,j){var F=this._get_tag_open_token(g);return(x.is_unformatted||x.is_content_unformatted)&&!x.is_empty_element&&g.type===c.TAG_OPEN&&g.text.indexOf("</")===0?(y.add_raw_token(g),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(y.traverse_whitespace(g),this._set_tag_position(y,g,F,x,j),F.is_inline_element||y.set_wrap_point(),y.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=g.text.length+1),!F.tag_complete&&!F.is_unformatted&&(y.alignment_size=F.alignment_size),F};var E=function(y,g){if(this.parent=y||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 x;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(x=g.text.match(/^<([^\s>]*)/),this.tag_check=x?x[1]:""):(x=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=x?x[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===c.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 j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};v.prototype._get_tag_open_token=function(y){var g=new E(this._tag_stack.get_parser_token(),y);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||w(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&&w(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&w(g.tag_check,this._options.content_unformatted),g.is_inline_element=w(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},v.prototype._set_tag_position=function(y,g,x,j,F){if(x.is_empty_element||(x.is_end_tag?x.start_tag_token=this._tag_stack.try_pop(x.tag_name):(this._do_optional_end_element(x)&&(x.is_inline_element||y.print_newline(!1)),this._tag_stack.record_tag(x),(x.tag_name==="script"||x.tag_name==="style")&&!(x.is_unformatted||x.is_content_unformatted)&&(x.custom_beautifier_name=T(x.tag_check,g)))),w(x.tag_check,this._options.extra_liners)&&(y.print_newline(!1),y._output.just_added_blankline()||y.print_newline(!0)),x.is_empty_element){if(x.tag_start_char==="{"&&x.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),x.indent_content=!0;var A=y.current_line_has_match(/{{#if/);A||y.print_newline(!1)}x.tag_name==="!--"&&F.type===c.TAG_CLOSE&&j.is_end_tag&&x.text.indexOf(`
|
|
`)===-1||(x.is_inline_element||x.is_unformatted||y.print_newline(!1),this._calcluate_parent_multiline(y,x))}else if(x.is_end_tag){var W=!1;W=x.start_tag_token&&x.start_tag_token.multiline_content,W=W||!x.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(F.type===c.TAG_CLOSE&&x.start_tag_token===j)&&F.type!=="TK_CONTENT",(x.is_content_unformatted||x.is_unformatted)&&(W=!1),W&&y.print_newline(!1)}else x.indent_content=!x.custom_beautifier_name,x.tag_start_char==="<"&&(x.tag_name==="html"?x.indent_content=this._options.indent_inner_html:x.tag_name==="head"?x.indent_content=this._options.indent_head_inner_html:x.tag_name==="body"&&(x.indent_content=this._options.indent_body_inner_html)),!(x.is_inline_element||x.is_unformatted)&&(F.type!=="TK_CONTENT"||x.is_content_unformatted)&&y.print_newline(!1),this._calcluate_parent_multiline(y,x)},v.prototype._calcluate_parent_multiline=function(y,g){g.parent&&y._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var f=["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"],h=["a","audio","del","ins","map","noscript","video"];v.prototype._do_optional_end_element=function(y){var g=null;if(y.is_empty_element||!y.is_start_tag||!y.parent)return;if(y.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(y.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(y.tag_name==="dd"||y.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(y.parent.tag_name==="p"&&f.indexOf(y.tag_name)!==-1){var x=y.parent.parent;(!x||h.indexOf(x.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else y.tag_name==="rp"||y.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):y.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):y.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):y.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):y.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):y.tag_name==="tbody"||y.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"])):y.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"])):(y.tag_name==="th"||y.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 y.parent=this._tag_stack.get_parser_token(),g},_.exports.Beautifier=v},function(_,p,m){var u=m(6).Options;function a(o){u.call(this,o,"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"])}a.prototype=new u,_.exports.Options=a},function(_,p,m){var u=m(9).Tokenizer,a=m(9).TOKEN,o=m(13).Directives,c=m(14).TemplatablePattern,s=m(12).Pattern,i={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:a.START,RAW:a.RAW,EOF:a.EOF},n=new o(/<\!--/,/-->/),O=function(T,w){u.call(this,T,w),this._current_tag_name="";var R=new c(this._input).read_options(this._options),S=new s(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.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 v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(v).until_after(v)}};O.prototype=new u,O.prototype._is_comment=function(T){return!1},O.prototype._is_opening=function(T){return T.type===i.TAG_OPEN},O.prototype._is_closing=function(T,w){return T.type===i.TAG_CLOSE&&w&&((T.text===">"||T.text==="/>")&&w.text[0]==="<"||T.text==="}}"&&w.text[0]==="{"&&w.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(T,w){var R=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(i.EOF,""):(R=R||this._read_open_handlebars(S,w),R=R||this._read_attribute(S,T,w),R=R||this._read_close(S,w),R=R||this._read_raw_content(S,T,w),R=R||this._read_content_word(S),R=R||this._read_comment_or_cdata(S),R=R||this._read_processing(S),R=R||this._read_open(S,w),R=R||this._create_token(i.UNKNOWN,this._input.next()),R)},O.prototype._read_comment_or_cdata=function(T){var w=null,R=null,S=null;if(T==="<"){var v=this._input.peek(1);v==="!"&&(R=this.__patterns.comment.read(),R?(S=n.get_directives(R),S&&S.ignore==="start"&&(R+=n.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(w=this._create_token(i.COMMENT,R),w.directives=S)}return w},O.prototype._read_processing=function(T){var w=null,R=null,S=null;if(T==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(w=this._create_token(i.COMMENT,R),w.directives=S)}return w},O.prototype._read_open=function(T,w){var R=null,S=null;return w||T==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),S=this._create_token(i.TAG_OPEN,R)),S},O.prototype._read_open_handlebars=function(T,w){var R=null,S=null;return w||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),S=this._create_token(i.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),S=this._create_token(i.TAG_OPEN,R))),S},O.prototype._read_close=function(T,w){var R=null,S=null;return w&&(w.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(R=this._input.next(),T==="/"&&(R+=this._input.next()),S=this._create_token(i.TAG_CLOSE,R)):w.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(i.TAG_CLOSE,"}}"))),S},O.prototype._read_attribute=function(T,w,R){var S=null,v="";if(R&&R.text[0]==="<")if(T==="=")S=this._create_token(i.EQUALS,this._input.next());else if(T==='"'||T==="'"){var E=this._input.next();T==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),S=this._create_token(i.VALUE,E)}else v=this.__patterns.attribute.read(),v&&(w.type===i.EQUALS?S=this._create_token(i.VALUE,v):S=this._create_token(i.ATTRIBUTE,v));return S},O.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},O.prototype._read_raw_content=function(T,w,R){var S="";if(R&&R.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(w.type===i.TAG_CLOSE&&w.opened.text[0]==="<"&&w.text[0]!=="/"){var v=w.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var E=this._read_comment_or_cdata(T);if(E)return E.type=i.TEXT,E;S=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(S=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(i.TEXT,S):null},O.prototype._read_content_word=function(T){var w="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(w=this.__patterns.unformatted_content_delimiter.read())),w||(w=this.__patterns.word.read()),w)return this._create_token(i.TEXT,w)},_.exports.Tokenizer=O,_.exports.TOKEN=i}],I={};function r(_){var p=I[_];if(p!==void 0)return p.exports;var m=I[_]={exports:{}};return K[_](m,m.exports,r),m.exports}var P=r(18);U=P})();var G=U;if(!0)!(q=[D,D("6UM0"),D("TXwP")],Y=function(K){var I=D("6UM0"),r=D("TXwP");return{html_beautify:function(P,_){return G(P,_,I.js_beautify,r.css_beautify)}}}.apply(fe,q),Y!==void 0&&(Gt.exports=Y));else var M,k})()},rUJ1:function(Gt,fe){const D=/[&<>"']/,q=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,G={"&":"&","<":"<",">":">",'"':""","'":"'"},M=S=>G[S];function k(S,v){if(v){if(D.test(S))return S.replace(q,M)}else if(Y.test(S))return S.replace(U,M);return S}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(S){return S.replace(K,(v,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const r=/(^|[^\[])\^/g;function P(S,v){S=S.source||S,v=v||"";const E={replace:(f,h)=>(h=h.source||h,h=h.replace(r,"$1"),S=S.replace(f,h),E),getRegex:()=>new RegExp(S,v)};return E}const _=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(S,v,E){if(S){let f;try{f=decodeURIComponent(I(E)).replace(_,"").toLowerCase()}catch(h){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}v&&!p.test(E)&&(E=s(v,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(f){return null}return E}const u={},a=/^[^:]+:\/*[^/]*$/,o=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(S,v){u[" "+S]||(a.test(S)?u[" "+S]=S+"/":u[" "+S]=T(S,"/",!0)),S=u[" "+S];const E=S.indexOf(":")===-1;return v.substring(0,2)==="//"?E?v:S.replace(o,"$1")+v:v.charAt(0)==="/"?E?v:S.replace(c,"$1")+v:S+v}const i={exec:function(){}};function n(S){let v=1,E,f;for(;v<arguments.length;v++){E=arguments[v];for(f in E)Object.prototype.hasOwnProperty.call(E,f)&&(S[f]=E[f])}return S}function O(S,v){const E=S.replace(/\|/g,(y,g,x)=>{let j=!1,F=g;for(;--F>=0&&x[F]==="\\";)j=!j;return j?"|":" |"}),f=E.split(/ \|/);let h=0;if(f.length>v)f.splice(v);else for(;f.length<v;)f.push("");for(;h<f.length;h++)f[h]=f[h].trim().replace(/\\\|/g,"|");return f}function T(S,v,E){const f=S.length;if(f===0)return"";let h=0;for(;h<f;){const y=S.charAt(f-h-1);if(y===v&&!E)h++;else if(y!==v&&E)h++;else break}return S.substr(0,f-h)}function w(S,v){if(S.indexOf(v[1])===-1)return-1;const E=S.length;let f=0,h=0;for(;h<E;h++)if(S[h]==="\\")h++;else if(S[h]===v[0])f++;else if(S[h]===v[1]&&(f--,f<0))return h;return-1}function R(S){S&&S.sanitize&&!S.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")}Gt.exports={escape:k,unescape:I,edit:P,cleanUrl:m,resolveUrl:s,noopTest:i,merge:n,splitCells:O,rtrim:T,findClosingBracket:w,checkSanitizeDeprecation:R}},sR1s:function(Gt,fe,D){"use strict";D.d(fe,"b",function(){return G}),D.d(fe,"a",function(){return M}),D.d(fe,"c",function(){return k}),D.d(fe,"d",function(){return K});var q=D("U8pU"),Y="RC_TABLE_KEY";function U(I){return I==null?[]:Array.isArray(I)?I:[I]}function G(I,r){if(!r&&typeof r!="number")return I;for(var P=U(r),_=I,p=0;p<P.length;p+=1){if(!_)return null;var m=P[p];_=_[m]}return _}function M(I){var r=[],P={};return I.forEach(function(_){for(var p=_||{},m=p.key,u=p.dataIndex,a=m||U(u).join("-")||Y;P[a];)a="".concat(a,"_next");P[a]=!0,r.push(a)}),r}function k(){var I={};function r(m,u){u&&Object.keys(u).forEach(function(a){var o=u[a];o&&Object(q.a)(o)==="object"?(m[a]=m[a]||{},r(m[a],o)):m[a]=o})}for(var P=arguments.length,_=new Array(P),p=0;p<P;p++)_[p]=arguments[p];return _.forEach(function(m){r(I,m)}),I}function K(I){return I!=null}},sboe:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return U});var q=D("q1tI"),Y=D.n(q),U=q.createContext(null)},t23M:function(Gt,fe,D){"use strict";var q=D("VTBJ"),Y=D("1OyB"),U=D("vuIU"),G=D("Ji7U"),M=D("LK+K"),k=D("q1tI"),K=D.n(k),I=D("m+aA"),r=D("Zm9Q"),P=D("Kwbf"),_=D("c+Xe"),p=D("bdgK"),m="rc-observer-key",u=function(a){Object(G.a)(c,a);var o=Object(M.a)(c);function c(){var s;return Object(Y.a)(this,c),s=o.apply(this,arguments),s.resizeObserver=null,s.childNode=null,s.currentElement=null,s.state={width:0,height:0,offsetHeight:0,offsetWidth:0},s.onResize=function(i){var n=s.props.onResize,O=i[0].target,T=O.getBoundingClientRect(),w=T.width,R=T.height,S=O.offsetWidth,v=O.offsetHeight,E=Math.floor(w),f=Math.floor(R);if(s.state.width!==E||s.state.height!==f||s.state.offsetWidth!==S||s.state.offsetHeight!==v){var h={width:E,height:f,offsetWidth:S,offsetHeight:v};s.setState(h),n&&Promise.resolve().then(function(){n(Object(q.a)(Object(q.a)({},h),{},{offsetWidth:S,offsetHeight:v}))})}},s.setChildNode=function(i){s.childNode=i},s}return Object(U.a)(c,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var n=Object(I.a)(this.childNode||this),O=n!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=n),!this.resizeObserver&&n&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(n))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,n=Object(r.a)(i);if(n.length>1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(n.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=n[0];if(k.isValidElement(O)&&Object(_.c)(O)){var T=O.ref;n[0]=k.cloneElement(O,{ref:Object(_.a)(T,this.setChildNode)})}return n.length===1?n[0]:n.map(function(w,R){return!k.isValidElement(w)||"key"in w&&w.key!==null?w:k.cloneElement(w,{key:"".concat(m,"-").concat(R)})})}}]),c}(k.Component);u.displayName="ResizeObserver",fe.a=u},t9D7:function(Gt,fe,D){"use strict";D.d(fe,"b",function(){return K}),D.d(fe,"g",function(){return r}),D.d(fe,"d",function(){return P}),D.d(fe,"e",function(){return _}),D.d(fe,"a",function(){return p}),D.d(fe,"f",function(){return a}),D.d(fe,"c",function(){return o});var q=D("Vhoy"),Y=D("MI8n"),U=D("pmY6"),G=D("Cg/j"),M=D("ic2d"),k=D("nEHx");const K=Object(G.c)("themeService");var I;(function(c){function s(i){return i&&typeof i=="object"&&typeof i.id=="string"}c.isThemeColor=s})(I||(I={}));function r(c){return{id:c}}var P;(function(c){function s(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||I.isThemeColor(R.color))}c.isThemeIcon=s;const i=new RegExp(`^\\$\\((${q.a.iconNameExpression}(?:${q.a.iconModifierExpression})?)\\)$`);function n(R){const S=i.exec(R);if(!S)return;let[,v]=S;return{id:v}}c.fromString=n;function O(R,S){let v=R.id;const E=v.lastIndexOf("~");return E!==-1&&(v=v.substring(0,E)),S&&(v=`${v}~${S}`),{id:v}}c.modify=O;function T(R,S){var v,E;return R.id===S.id&&((v=R.color)===null||v===void 0?void 0:v.id)===((E=S.color)===null||E===void 0?void 0:E.id)}c.isEqual=T;function w(R,S){return{id:R.id,color:S?r(S):void 0}}c.asThemeIcon=w,c.asClassNameArray=q.a.asClassNameArray,c.asClassName=q.a.asClassName,c.asCSSSelector=q.a.asCSSSelector})(P||(P={}));function _(c){switch(c){case k.a.DARK:return"vs-dark";case k.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Y.b}onColorThemeChange(c){return this.themingParticipants.push(c),this.onThemingParticipantAddedEmitter.fire(c),Object(U.i)(()=>{const s=this.themingParticipants.indexOf(c);this.themingParticipants.splice(s,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;M.a.add(p.ThemingContribution,u);function a(c){return u.onColorThemeChange(c)}class o extends U.a{constructor(c){super();this.themeService=c,this.theme=c.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(s=>this.onThemeChange(s)))}onThemeChange(c){this.theme=c,this.updateStyles()}updateStyles(){}}},ulZh:function(Gt,fe,D){typeof window!="undefined"&&function(Y,U){Gt.exports=U()}(this,function(){return function(q){var Y={};function U(G){if(Y[G])return Y[G].exports;var M=Y[G]={i:G,l:!1,exports:{}};return q[G].call(M.exports,M,M.exports,U),M.l=!0,M.exports}return U.m=q,U.c=Y,U.d=function(G,M,k){U.o(G,M)||Object.defineProperty(G,M,{enumerable:!0,get:k})},U.r=function(G){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},U.t=function(G,M){if(M&1&&(G=U(G)),M&8)return G;if(M&4&&typeof G=="object"&&G&&G.__esModule)return G;var k=Object.create(null);if(U.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:G}),M&2&&typeof G!="string")for(var K in G)U.d(k,K,function(I){return G[I]}.bind(null,K));return k},U.n=function(G){var M=G&&G.__esModule?function(){return G.default}:function(){return G};return U.d(M,"a",M),M},U.o=function(G,M){return Object.prototype.hasOwnProperty.call(G,M)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,Y,U){"use strict";var G=Object.prototype.hasOwnProperty,M="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(M=!1));function K(_,p,m){this.fn=_,this.context=p,this.once=m||!1}function I(_,p,m,u,a){if(typeof m!="function")throw new TypeError("The listener must be a function");var o=new K(m,u||_,a),c=M?M+p:p;return _._events[c]?_._events[c].fn?_._events[c]=[_._events[c],o]:_._events[c].push(o):(_._events[c]=o,_._eventsCount++),_}function r(_,p){--_._eventsCount===0?_._events=new k:delete _._events[p]}function P(){this._events=new k,this._eventsCount=0}P.prototype.eventNames=function(){var p=[],m,u;if(this._eventsCount===0)return p;for(u in m=this._events)G.call(m,u)&&p.push(M?u.slice(1):u);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},P.prototype.listeners=function(p){var m=M?M+p:p,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var a=0,o=u.length,c=new Array(o);a<o;a++)c[a]=u[a].fn;return c},P.prototype.listenerCount=function(p){var m=M?M+p:p,u=this._events[m];return u?u.fn?1:u.length:0},P.prototype.emit=function(p,m,u,a,o,c){var s=M?M+p:p;if(!this._events[s])return!1;var i=this._events[s],n=arguments.length,O,T;if(i.fn){i.once&&this.removeListener(p,i.fn,void 0,!0);switch(n){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,m),!0;case 3:return i.fn.call(i.context,m,u),!0;case 4:return i.fn.call(i.context,m,u,a),!0;case 5:return i.fn.call(i.context,m,u,a,o),!0;case 6:return i.fn.call(i.context,m,u,a,o,c),!0}for(T=1,O=new Array(n-1);T<n;T++)O[T-1]=arguments[T];i.fn.apply(i.context,O)}else{var w=i.length,R;for(T=0;T<w;T++){i[T].once&&this.removeListener(p,i[T].fn,void 0,!0);switch(n){case 1:i[T].fn.call(i[T].context);break;case 2:i[T].fn.call(i[T].context,m);break;case 3:i[T].fn.call(i[T].context,m,u);break;case 4:i[T].fn.call(i[T].context,m,u,a);break;default:if(!O)for(R=1,O=new Array(n-1);R<n;R++)O[R-1]=arguments[R];i[T].fn.apply(i[T].context,O)}}}return!0},P.prototype.on=function(p,m,u){return I(this,p,m,u,!1)},P.prototype.once=function(p,m,u){return I(this,p,m,u,!0)},P.prototype.removeListener=function(p,m,u,a){var o=M?M+p:p;if(!this._events[o])return this;if(!m)return r(this,o),this;var c=this._events[o];if(c.fn)c.fn===m&&(!a||c.once)&&(!u||c.context===u)&&r(this,o);else{for(var s=0,i=[],n=c.length;s<n;s++)(c[s].fn!==m||a&&!c[s].once||u&&c[s].context!==u)&&i.push(c[s]);i.length?this._events[o]=i.length===1?i[0]:i:r(this,o)}return this},P.prototype.removeAllListeners=function(p){var m;return p?(m=M?M+p:p,this._events[m]&&r(this,m)):(this._events=new k,this._eventsCount=0),this},P.prototype.off=P.prototype.removeListener,P.prototype.addListener=P.prototype.on,P.prefixed=M,P.EventEmitter=P,q.exports=P},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,Y,U){(function(G){var M=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,k=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,I=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(P,_,p){if(p=p||{},P=P.trim(),_=_.trim(),!_){if(!p.alwaysNormalize)return P;var m=r.parseURL(P);if(!m)throw new Error("Error trying to parse base URL.");return m.path=r.normalizePath(m.path),r.buildURLFromParts(m)}var u=r.parseURL(_);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return p.alwaysNormalize?(u.path=r.normalizePath(u.path),r.buildURLFromParts(u)):_;var a=r.parseURL(P);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var o=k.exec(a.path);a.netLoc=o[1],a.path=o[2]}a.netLoc&&!a.path&&(a.path="/");var c={scheme:a.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(c.netLoc=a.netLoc,u.path[0]!=="/"))if(!u.path)c.path=a.path,u.params||(c.params=a.params,u.query||(c.query=a.query));else{var s=a.path,i=s.substring(0,s.lastIndexOf("/")+1)+u.path;c.path=r.normalizePath(i)}return c.path===null&&(c.path=p.alwaysNormalize?r.normalizePath(u.path):u.path),r.buildURLFromParts(c)},parseURL:function(P){var _=M.exec(P);return _?{scheme:_[1]||"",netLoc:_[2]||"",path:_[3]||"",params:_[4]||"",query:_[5]||"",fragment:_[6]||""}:null},normalizePath:function(P){for(P=P.split("").reverse().join("").replace(K,"");P.length!==(P=P.replace(I,"")).length;);return P.split("").reverse().join("")},buildURLFromParts:function(P){return P.scheme+P.netLoc+P.path+P.params+P.query+P.fragment}};q.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(q,Y,U){function G(p){var m={};function u(o){if(m[o])return m[o].exports;var c=m[o]={i:o,l:!1,exports:{}};return p[o].call(c.exports,c,c.exports,u),c.l=!0,c.exports}u.m=p,u.c=m,u.i=function(o){return o},u.d=function(o,c,s){u.o(o,c)||Object.defineProperty(o,c,{configurable:!1,enumerable:!0,get:s})},u.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},u.n=function(o){var c=o&&o.__esModule?function(){return o.default}:function(){return o};return u.d(c,"a",c),c},u.o=function(o,c){return Object.prototype.hasOwnProperty.call(o,c)},u.p="/",u.oe=function(o){throw console.error(o),o};var a=u(u.s=ENTRY_MODULE);return a.default||a}var M="[\\.|\\-|\\+|\\w|/|@]+",k="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+M+").*?\\)";function K(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function I(p){return!isNaN(1*p)}function r(p,m,u){var a={};a[u]=[];var o=m.toString(),c=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return a;for(var s=c[1],i=new RegExp("(\\\\n|\\W)"+K(s)+k,"g"),n;n=i.exec(o);){if(n[3]==="dll-reference")continue;a[u].push(n[3])}for(i=new RegExp("\\("+K(s)+'\\("(dll-reference\\s('+M+'))"\\)\\)'+k,"g");n=i.exec(o);)p[n[2]]||(a[u].push(n[1]),p[n[2]]=U(n[1]).m),a[n[2]]=a[n[2]]||[],a[n[2]].push(n[4]);for(var O=Object.keys(a),T=0;T<O.length;T++)for(var w=0;w<a[O[T]].length;w++)I(a[O[T]][w])&&(a[O[T]][w]=1*a[O[T]][w]);return a}function P(p){var m=Object.keys(p);return m.reduce(function(u,a){return u||p[a].length>0},!1)}function _(p,m){for(var u={main:[m]},a={main:[]},o={main:{}};P(u);)for(var c=Object.keys(u),s=0;s<c.length;s++){var i=c[s],n=u[i],O=n.pop();if(o[i]=o[i]||{},o[i][O]||!p[i][O])continue;o[i][O]=!0,a[i]=a[i]||[],a[i].push(O);for(var T=r(p,p[i][O],i),w=Object.keys(T),R=0;R<w.length;R++)u[w[R]]=u[w[R]]||[],u[w[R]]=u[w[R]].concat(T[w[R]])}return a}q.exports=function(p,m){m=m||{};var u={main:U.m},a=m.all?{main:Object.keys(u.main)}:_(u,p),o="";Object.keys(a).filter(function(O){return O!=="main"}).forEach(function(O){for(var T=0;a[O][T];)T++;a[O].push(T),u[O][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+O+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+a[O].map(function(w){return""+JSON.stringify(w)+": "+u[O][w].toString()}).join(",")+`});
|
|
`}),o=o+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+a.main.map(function(O){return""+JSON.stringify(O)+": "+u.main[O].toString()}).join(",")+"}))(self);";var c=new window.Blob([o],{type:"text/javascript"});if(m.bare)return c;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,i=s.createObjectURL(c),n=new window.Worker(i);return n.objectURL=i,n}},"./src/config.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"hlsDefaultConfig",function(){return R}),U.d(Y,"mergeConfig",function(){return v}),U.d(Y,"enableStreamingMode",function(){return E});var G=U("./src/controller/abr-controller.ts"),M=U("./src/controller/audio-stream-controller.ts"),k=U("./src/controller/audio-track-controller.ts"),K=U("./src/controller/subtitle-stream-controller.ts"),I=U("./src/controller/subtitle-track-controller.ts"),r=U("./src/controller/buffer-controller.ts"),P=U("./src/controller/timeline-controller.ts"),_=U("./src/controller/cap-level-controller.ts"),p=U("./src/controller/fps-controller.ts"),m=U("./src/controller/eme-controller.ts"),u=U("./src/controller/cmcd-controller.ts"),a=U("./src/utils/xhr-loader.ts"),o=U("./src/utils/fetch-loader.ts"),c=U("./src/utils/cues.ts"),s=U("./src/utils/mediakeys-helper.ts"),i=U("./src/utils/logger.ts");function n(){return n=Object.assign||function(f){for(var h=1;h<arguments.length;h++){var y=arguments[h];for(var g in y)Object.prototype.hasOwnProperty.call(y,g)&&(f[g]=y[g])}return f},n.apply(this,arguments)}function O(f,h){var y=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(f,x).enumerable})),y.push.apply(y,g)}return y}function T(f){for(var h=1;h<arguments.length;h++){var y=arguments[h]!=null?arguments[h]:{};h%2?O(Object(y),!0).forEach(function(g){w(f,g,y[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(y)):O(Object(y)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(y,g))})}return f}function w(f,h,y){return h in f?Object.defineProperty(f,h,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[h]=y,f}var R=T(T({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:r.default,capLevelController:_.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:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},S()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:I.default,timelineController:P.TimelineController,audioStreamController:M.default,audioTrackController:k.default,emeController:m.default,cmcdController:u.default});function S(){return{cueHandler:c.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function v(f,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},f,h)}function E(f){var h=f.loader;if(h!==o.default&&h!==a.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var y=Object(o.fetchSupported)();y&&(f.loader=o.default,f.progressive=!0,f.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/polyfills/number.ts"),M=U("./src/utils/ewma-bandwidth-estimator.ts"),k=U("./src/events.ts"),K=U("./src/utils/buffer-helper.ts"),I=U("./src/errors.ts"),r=U("./src/types/loader.ts"),P=U("./src/utils/logger.ts");function _(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function p(u,a,o){return a&&_(u.prototype,a),o&&_(u,o),u}var m=function(){function u(o){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=o;var c=o.config;this.bwEstimator=new M.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var a=u.prototype;return a.registerListeners=function(){var c=this.hls;c.on(k.Events.FRAG_LOADING,this.onFragLoading,this),c.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(k.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var c=this.hls;c.off(k.Events.FRAG_LOADING,this.onFragLoading,this),c.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(k.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(c,s){var i=s.frag;if(i.type===r.PlaylistLevelType.MAIN&&!this.timer){var n;this.fragCurrent=i,this.partCurrent=(n=s.part)!=null?n:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(c,s){var i=this.hls.config;s.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.autoLevelEnabled,O=i.config,T=i.media;if(!c||!T)return;var w=s?s.stats:c.stats,R=s?s.duration:c.duration;if(w.aborted){P.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||T.paused||!T.playbackRate||!T.readyState)return;var S=performance.now()-w.loading.start,v=Math.abs(T.playbackRate);if(S<=500*R/v)return;var E=i.levels,f=i.minAutoLevel,h=E[c.level],y=w.total||Math.max(w.loaded,Math.round(R*h.maxBitrate/8)),g=Math.max(1,w.bwEstimate?w.bwEstimate/8:w.loaded*1e3/S),x=(y-w.loaded)/g,j=T.currentTime,F=(K.BufferHelper.bufferInfo(T,j,O.maxBufferHole).end-j)/v;if(F>=2*R/v||x<=F)return;var A=Number.POSITIVE_INFINITY,W;for(W=c.level-1;W>f;W--){var H=E[W].maxBitrate;if(A=R*H/(8*.8*g),A<F)break}if(A>=x)return;var C=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+c.sn+(s?" part "+s.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
|
|
Current BW estimate: `+(Object(G.isFiniteNumber)(C)?(C/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+x.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+A.toFixed(3)+` s
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),i.nextLoadLevel=W,this.bwEstimator.sample(S,w.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),i.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:s,stats:w})},a.onFragLoaded=function(c,s){var i=s.frag,n=s.part;if(i.type===r.PlaylistLevelType.MAIN&&Object(G.isFiniteNumber)(i.sn)){var O=n?n.stats:i.stats,T=n?n.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[i.level],R=(w.loaded?w.loaded.bytes:0)+O.loaded,S=(w.loaded?w.loaded.duration:0)+T;w.loaded={bytes:R,duration:S},w.realBitrate=Math.round(8*R/S)}if(i.bitrateTest){var v={stats:O,frag:i,part:n,id:i.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,v),i.bitrateTest=!1}}},a.onFragBuffered=function(c,s){var i=s.frag,n=s.part,O=n?n.stats:i.stats;if(O.aborted)return;if(i.type!==r.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var T=O.parsing.end-O.loading.start;this.bwEstimator.sample(T,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},a.onError=function(c,s){switch(s.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.maxAutoLevel,O=i.config,T=i.minAutoLevel,w=i.media,R=s?s.duration:c?c.duration:0,S=w?w.currentTime:0,v=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,f=(K.BufferHelper.bufferInfo(w,S,O.maxBufferHole).end-S)/v,h=this.findBestLevel(E,T,n,f,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(h>=0)return h;P.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var y=R?Math.min(R,O.maxStarvationDelay):O.maxStarvationDelay,g=O.abrBandWidthFactor,x=O.abrBandWidthUpFactor;if(!f){var j=this.bitrateTestDelay;if(j){var F=R?Math.min(R,O.maxLoadingDelay):O.maxLoadingDelay;y=F-j,P.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*y)+" ms"),g=x=1}}return h=this.findBestLevel(E,T,n,f+y,g,x),Math.max(h,0)},a.findBestLevel=function(c,s,i,n,O,T){for(var w,R=this.fragCurrent,S=this.partCurrent,v=this.lastLoadedFragLevel,E=this.hls.levels,f=E[v],h=!!(f!=null&&(w=f.details)!==null&&w!==void 0&&w.live),y=f==null?void 0:f.codecSet,g=S?S.duration:R?R.duration:0,x=i;x>=s;x--){var j=E[x];if(!j||y&&j.codecSet!==y)continue;var F=j.details,A=(S?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||g,W=void 0;x<=v?W=O*c:W=T*c;var H=E[x].maxBitrate,C=H*A/W;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(W)+"/"+H+"/"+A+"/"+n+"/"+C),W>H&&(!C||h&&!this.bitrateTestDelay||C<n))return x}return-1},p(u,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,s=this.bwEstimator;if(c!==-1&&(!s||!s.canEstimate()))return c;var i=this.getNextABRAutoLevel();return c!==-1&&(i=Math.min(c,i)),i},set:function(c){this._nextAutoLevel=c}}]),u}();Y.default=m},"./src/controller/audio-stream-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/polyfills/number.ts"),M=U("./src/controller/base-stream-controller.ts"),k=U("./src/events.ts"),K=U("./src/utils/buffer-helper.ts"),I=U("./src/controller/fragment-tracker.ts"),r=U("./src/types/level.ts"),P=U("./src/types/loader.ts"),_=U("./src/loader/fragment.ts"),p=U("./src/demux/chunk-cache.ts"),m=U("./src/demux/transmuxer-interface.ts"),u=U("./src/types/transmuxer.ts"),a=U("./src/controller/fragment-finders.ts"),o=U("./src/utils/discontinuities.ts"),c=U("./src/errors.ts"),s=U("./src/utils/logger.ts");function i(){return i=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var v=arguments[S];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E])}return R},i.apply(this,arguments)}function n(R,S){R.prototype=Object.create(S.prototype),R.prototype.constructor=R,O(R,S)}function O(R,S){return O=Object.setPrototypeOf||function(E,f){return E.__proto__=f,E},O(R,S)}var T=100,w=function(R){n(S,R);function S(E,f){var h;return h=R.call(this,E,f,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var v=S.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var f=this.hls;f.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(k.Events.ERROR,this.onError,this),f.on(k.Events.BUFFER_RESET,this.onBufferReset,this),f.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var f=this.hls;f.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(k.Events.ERROR,this.onError,this),f.off(k.Events.BUFFER_RESET,this.onBufferReset,this),f.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(f,h){var y=h.frag,g=h.id,x=h.initPTS;if(g==="main"){var j=y.cc;this.initPTS[y.cc]=x,this.log("InitPTS for cc: "+j+" found from main: "+x),this.videoTrackCC=j,this.state===M.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=M.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,h>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=M.State.IDLE):(this.loadedmetadata=!1,this.state=M.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},v.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_TRACK:{var f,h=this.levels,y=this.trackId,g=h==null||((f=h[y])===null||f===void 0)?void 0:f.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=M.State.WAITING_INIT_PTS}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var x,j=performance.now(),F=this.retryDate;(!F||j>=F||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=M.State.IDLE);break}case M.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var W=A.frag,H=A.part,C=A.cache,z=A.complete;if(this.initPTS[W.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.FRAG_LOADING;var Z=C.flush(),le={frag:W,part:H,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(le),z&&R.prototype._handleFragmentLoadComplete.call(this,le)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+W.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var se=this.getLoadPosition(),Ce=K.BufferHelper.bufferInfo(this.mediaBuffer,se,this.config.maxBufferHole),Ee=Object(a.fragmentWithinToleranceTest)(Ce.end,this.config.maxFragLookUpTolerance,W);Ee<0&&(s.logger.log("Waiting fragment cc ("+W.cc+") @ "+W.start+" cancelled because another fragment at "+Ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=M.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.IDLE)},v.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:f,y=h.buffered;!this.loadedmetadata&&y.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},v.doTickIdle=function(){var f,h,y=this.hls,g=this.levels,x=this.media,j=this.trackId,F=y.config;if(!g||!g[j])return;if(!x&&(this.startFragRequested||!F.startFragPrefetch))return;var A=g[j],W=A.details;if(!W||W.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(W)){this.state=M.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,_.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(H===null)return;var C=H.len,z=this.getMaxBufferLength(),Z=this.audioSwitch;if(C>=z&&!Z)return;if(!Z&&this._streamEnded(H,W)){y.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=M.State.ENDED;return}var le=W.fragments,se=le[0].start,Ce=H.end;if(Z){var Ee=this.getLoadPosition();Ce=Ee,W.PTSKnown&&Ee<se&&((H.end>se||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=se+.05))}var Ie=this.getNextFragment(Ce,W);if(!Ie){this.bufferFlushed=!0;return}((f=Ie.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((h=Ie.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(Ie,W):this.loadFragment(Ie,W,Ce)},v.getMaxBufferLength=function(){var f=R.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return h===null?f:Math.max(f,h.len)},v.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(f,h){var y=h.audioTracks;this.resetTransmuxer(),this.levels=y.map(function(g){return new r.Level(g)})},v.onAudioTrackSwitching=function(f,h){var y=!!h.url;this.trackId=h.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),y?this.setInterval(T):this.resetTransmuxer(),y?(this.audioSwitch=!0,this.state=M.State.IDLE):this.state=M.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(f,h){this.mainDetails=h.details},v.onAudioTrackLoaded=function(f,h){var y,g=this.levels,x=h.details,j=h.id;if(!g){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var F=g[j],A=0;if(x.live||(y=F.details)!==null&&y!==void 0&&y.live){var W=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!W)return;!F.details&&x.hasProgramDateTime&&W.hasProgramDateTime?(Object(o.alignMediaPlaylistByPDT)(x,W),A=x.fragments[0].start):A=this.alignPlaylists(x,F.details)}F.details=x,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(F.details,A),this.state===M.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=M.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(f){var h,y=f.frag,g=f.part,x=f.payload,j=this.config,F=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+y.sn+" of level "+y.level+" will not be buffered");return}var W=A[F];console.assert(W,"Audio track is defined on fragment load progress");var H=W.details;console.assert(H,"Audio track details are defined on fragment load progress");var C=j.defaultAudioCodec||W.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new m.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[y.cc],le=(h=y.initSegment)===null||h===void 0?void 0:h.data;if(Z!==void 0){var se=!1,Ce=g?g.index:-1,Ee=Ce!==-1,Ie=new u.ChunkMetadata(y.level,y.sn,y.stats.chunkCount,x.byteLength,Ce,Ee);z.push(x,le,C,"",y,g,H.totalduration,se,Ie,Z)}else{s.logger.log("Unknown video PTS for cc "+y.cc+", waiting for video PTS before demuxing audio frag "+y.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+F);var Qe=this.waitingData=this.waitingData||{frag:y,part:g,cache:new p.default,complete:!1},Xe=Qe.cache;Xe.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=M.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,f)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(f,h){var y=h.tracks.audio;y&&(this.mediaBuffer=y.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},v.onFragBuffered=function(f,h){var y=h.frag,g=h.part;if(y.type!==P.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(y)){this.warn("Fragment "+y.sn+(g?" p: "+g.index:"")+" of level "+y.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}y.sn!=="initSegment"&&(this.fragPrevious=y,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(y,g)},v.onError=function(f,h){switch(h.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.AUDIO,h);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==M.State.ERROR&&this.state!==M.State.STOPPED&&(this.state=h.fatal?M.State.ERROR:M.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var y=!0,g=this.getFwdBufferInfo(this.mediaBuffer,P.PlaylistLevelType.AUDIO);g&&g.len>.5&&(y=!this.reduceMaxBufferLength(g.len)),y&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(f,h){var y=h.type;y===_.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(f){var h,y="audio",g=this.hls,x=f.remuxResult,j=f.chunkMeta,F=this.getCurrentContext(j);if(!F){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var A=F.frag,W=F.part,H=x.audio,C=x.text,z=x.id3,Z=x.initSegment;if(this.fragContextChanged(A))return;if(this.state=M.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,A,j),g.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:y,tracks:Z.tracks})),H){var le=H.startPTS,se=H.endPTS,Ce=H.startDTS,Ee=H.endDTS;W&&(W.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:se,startDTS:Ce,endDTS:Ee}),A.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,le,se,Ce,Ee),this.bufferFragmentData(H,A,W,j)}if(z!=null&&(h=z.samples)!==null&&h!==void 0&&h.length){var Ie=i({frag:A,id:y},z);g.trigger(k.Events.FRAG_PARSING_METADATA,Ie)}if(C){var Qe=i({frag:A,id:y},C);g.trigger(k.Events.FRAG_PARSING_USERDATA,Qe)}},v._bufferInitSegment=function(f,h,y){if(this.state!==M.State.PARSING)return;f.video&&delete f.video;var g=f.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(k.Events.BUFFER_CODECS,f);var x=g.initSegment;if(x!=null&&x.byteLength){var j={type:"audio",frag:h,part:null,chunkMeta:y,parent:h.type,data:x};this.hls.trigger(k.Events.BUFFER_APPENDING,j)}this.tick()},v.loadFragment=function(f,h,y){var g=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||g===I.FragmentState.NOT_LOADED||g===I.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):h.live&&!Object(G.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=M.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,f,h,y)))},v.completeAudioSwitch=function(){var f=this.hls,h=this.media,y=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:y})},S}(M.default);Y.default=w},"./src/controller/audio-track-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/events.ts"),M=U("./src/errors.ts"),k=U("./src/controller/base-playlist-controller.ts"),K=U("./src/types/loader.ts");function I(m,u){for(var a=0;a<u.length;a++){var o=u[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}function r(m,u,a){return u&&I(m.prototype,u),a&&I(m,a),m}function P(m,u){m.prototype=Object.create(u.prototype),m.prototype.constructor=m,_(m,u)}function _(m,u){return _=Object.setPrototypeOf||function(o,c){return o.__proto__=c,o},_(m,u)}var p=function(m){P(u,m);function u(o){var c;return c=m.call(this,o,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var a=u.prototype;return a.registerListeners=function(){var c=this.hls;c.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(G.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var c=this.hls;c.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(G.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(c,s){this.tracks=s.audioTracks||[]},a.onAudioTrackLoaded=function(c,s){var i=s.id,n=s.details,O=this.tracksInGroup[i];if(!O){this.warn("Invalid audio track id "+i);return}var T=O.details;O.details=s.details,this.log("audioTrack "+i+" loaded ["+n.startSN+"-"+n.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,s,T))},a.onLevelLoading=function(c,s){this.switchLevel(s.level)},a.onLevelSwitching=function(c,s){this.switchLevel(s.level)},a.switchLevel=function(c){var s=this.hls.levels[c];if(!(s!=null&&s.audioGroupIds))return;var i=s.audioGroupIds[s.urlId];if(this.groupId!==i){this.groupId=i;var n=this.tracks.filter(function(T){return!i||T.groupId===i});this.selectDefaultTrack&&!n.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var O={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(G.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},a.onError=function(c,s){if(m.prototype.onError.call(this,c,s),s.fatal||!s.context)return;s.context.type===K.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},a.setAudioTrack=function(c){var s=this.tracksInGroup;if(c<0||c>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=s[this.trackId];this.log("Now switching to audio-track index "+c);var n=s[c],O=n.id,T=n.groupId,w=T===void 0?"":T,R=n.name,S=n.type,v=n.url;if(this.trackId=c,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(G.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:w,name:R,type:S,url:v}),n.details&&!n.details.live)return;var E=this.switchParams(n.url,i==null?void 0:i.details);this.loadPlaylist(E)},a.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,i=this.findTrackId(s)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(c){for(var s=this.tracksInGroup,i=0;i<s.length;i++){var n=s[i];if((!this.selectDefaultTrack||n.default)&&(!c||c===n.name))return n.id}return-1},a.loadPlaylist=function(c){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var i=s.id,n=s.groupId,O=s.url;if(c)try{O=c.addDirectives(O)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(G.Events.AUDIO_TRACK_LOADING,{url:O,id:i,groupId:n,deliveryDirectives:c||null})}},r(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),u}(k.default);Y.default=p},"./src/controller/base-playlist-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return r});var G=U("./src/polyfills/number.ts"),M=U("./src/types/level.ts"),k=U("./src/controller/level-helper.ts"),K=U("./src/utils/logger.ts"),I=U("./src/errors.ts"),r=function(){function P(p,m){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,m+":"),this.warn=K.logger.warn.bind(K.logger,m+":"),this.hls=p}var _=P.prototype;return _.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},_.onError=function(m,u){u.fatal&&u.type===I.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},_.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},_.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},_.stopLoad=function(){this.canLoad=!1,this.clearTimer()},_.switchParams=function(m,u){var a=u==null?void 0:u.renditionReports;if(a)for(var o=0;o<a.length;o++){var c=a[o],s=""+c.URI;if(s===m.substr(-s.length)){var i=parseInt(c["LAST-MSN"]),n=parseInt(c["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var O=Math.min(u.age-u.partTarget,u.targetduration);n!==void 0&&O>u.partTarget&&(n+=1)}if(Object(G.isFiniteNumber)(i))return new M.HlsUrlParameters(i,Object(G.isFiniteNumber)(n)?n:void 0,M.HlsSkip.No)}}},_.loadPlaylist=function(m){},_.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},_.playlistLoaded=function(m,u,a){var o=this,c=u.details,s=u.stats,i=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(c.advancedDateTime=Date.now()-i,c.live||a!=null&&a.live){if(c.reloaded(a),a&&this.log("live playlist "+m+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),a&&c.fragments.length>0&&Object(k.mergeDetails)(a,c),!this.canLoad||!c.live)return;var n,O=void 0,T=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var w=this.hls.config.lowLatencyMode,R=c.lastPartSn,S=c.endSN,v=c.lastPartIndex,E=v!==-1,f=R===S,h=w?0:v;E?(O=f?S+1:R,T=f?h:v+1):O=S+1;var y=c.age,g=y+c.ageHeader,x=Math.min(g-c.partTarget,c.targetduration*1.5);if(x>0){if(a&&x>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+x+" with playlist age: "+c.age),x=0;else{var j=Math.floor(x/c.targetduration);if(O+=j,T!==void 0){var F=Math.round(x%c.targetduration/c.partTarget);T+=F}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+y.toFixed(2)+"s goal: "+x+" skip sn "+j+" to part "+T)}c.tuneInGoal=x}if(n=this.getDeliveryDirectives(c,u.deliveryDirectives,O,T),w||!f){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(c,u.deliveryDirectives,O,T);var A=Object(k.computeReloadInterval)(c,s);O!==void 0&&c.canBlockReload&&(A-=c.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return o.loadPlaylist(n)},A)}else this.clearTimer()},_.getDeliveryDirectives=function(m,u,a,o){var c=Object(M.getSkipValue)(m,a);return u!=null&&u.skip&&m.deltaUpdateFailed&&(a=u.msn,o=u.part,c=M.HlsSkip.No),new M.HlsUrlParameters(a,o,c)},_.retryLoadingOrFail=function(m){var u=this,a=this.hls.config,o=this.retryCount<a.levelLoadingMaxRetry;if(o){var c;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(c=m.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return o},P}()},"./src/controller/base-stream-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"State",function(){return S}),U.d(Y,"default",function(){return v});var G=U("./src/polyfills/number.ts"),M=U("./src/task-loop.ts"),k=U("./src/controller/fragment-tracker.ts"),K=U("./src/utils/buffer-helper.ts"),I=U("./src/utils/logger.ts"),r=U("./src/events.ts"),P=U("./src/errors.ts"),_=U("./src/types/transmuxer.ts"),p=U("./src/utils/mp4-tools.ts"),m=U("./src/utils/discontinuities.ts"),u=U("./src/controller/fragment-finders.ts"),a=U("./src/controller/level-helper.ts"),o=U("./src/loader/fragment-loader.ts"),c=U("./src/crypt/decrypter.ts"),s=U("./src/utils/time-ranges.ts"),i=U("./src/types/loader.ts");function n(E,f){for(var h=0;h<f.length;h++){var y=f[h];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}function O(E,f,h){return f&&n(E.prototype,f),h&&n(E,h),E}function T(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function w(E,f){E.prototype=Object.create(f.prototype),E.prototype.constructor=E,R(E,f)}function R(E,f){return R=Object.setPrototypeOf||function(y,g){return y.__proto__=g,y},R(E,f)}var S={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"},v=function(E){w(f,E);function f(y,g,x){var j;return j=E.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=S.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=x,j.log=I.logger.log.bind(I.logger,x+":"),j.warn=I.logger.warn.bind(I.logger,x+":"),j.hls=y,j.fragmentLoader=new o.default(y.config),j.fragmentTracker=g,j.config=y.config,j.decrypter=new c.default(y,y.config),y.on(r.Events.KEY_LOADED,j.onKeyLoaded,T(j)),j}var h=f.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(g){},h.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=S.STOPPED},h._streamEnded=function(g,x){var j=this.fragCurrent,F=this.fragmentTracker;if(!x.live&&j&&j.sn===x.endSN&&!g.nextStart){var A=F.getState(j);return A===k.FragmentState.PARTIAL||A===k.FragmentState.OK}return!1},h.onMediaAttached=function(g,x){var j=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(F.startPosition)},h.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()},h.onMediaSeeking=function(){var g=this.config,x=this.fragCurrent,j=this.media,F=this.mediaBuffer,A=this.state,W=j?j.currentTime:0,H=K.BufferHelper.bufferInfo(F||j,W,g.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(W)?W.toFixed(3):W)+", state: "+A),A===S.ENDED)this.resetLoadingState();else if(x&&!H.len){var C=g.maxFragLookUpTolerance,z=x.start-C,Z=x.start+x.duration+C,le=W>Z;(W<z||le)&&(le&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=W),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=W),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(g,x){if(this.state!==S.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=S.IDLE;var j=this.levels[x.frag.level].details;j&&this.loadFragment(x.frag,j,x.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,E.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(g,x){this.log("Loading key for "+g.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=S.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(r.Events.KEY_LOADING,{frag:g})},h.loadFragment=function(g,x,j){this._loadFragForPlayback(g,x,j)},h._loadFragForPlayback=function(g,x,j){var F=this,A=function(H){if(F.fragContextChanged(g)){F.warn("Fragment "+g.sn+(H.part?" p: "+H.part.index:"")+" of level "+g.level+" was dropped during download."),F.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,F._handleFragmentLoadProgress(H)};this._doFragLoad(g,x,j,A).then(function(W){if(!W)return;F.fragLoadError=0;var H=F.state;if(F.fragContextChanged(g)){(H===S.FRAG_LOADING||H===S.BACKTRACKING||!F.fragCurrent&&H===S.PARSING)&&(F.fragmentTracker.removeFragment(g),F.state=S.IDLE);return}if("payload"in W&&(F.log("Loaded fragment "+g.sn+" of level "+g.level),F.hls.trigger(r.Events.FRAG_LOADED,W),F.state===S.BACKTRACKING)){F.fragmentTracker.backtrack(g,W),F.resetFragmentLoading(g);return}F._handleFragmentLoadComplete(W)}).catch(function(W){F.warn(W),F.resetFragmentLoading(g)})},h.flushMainBuffer=function(g,x,j){if(j===void 0&&(j=null),!(g-x))return;var F={startOffset:g,endOffset:x,type:j};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,F)},h._loadInitSegment=function(g){var x=this;this._doFragLoad(g).then(function(j){if(!j||x.fragContextChanged(g)||!x.levels)throw new Error("init load aborted");return j}).then(function(j){var F=x.hls,A=j.payload,W=g.decryptdata;if(A&&A.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var H=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(A),W.key.buffer,W.iv.buffer).then(function(C){var z=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:g,payload:C,stats:{tstart:H,tdecrypt:z}}),j.payload=C,j})}return j}).then(function(j){var F=x.fragCurrent,A=x.hls,W=x.levels;if(!W)throw new Error("init load aborted, missing levels");var H=W[g.level].details;console.assert(H,"Level details are defined when init segment is loaded");var C=g.stats;x.state=S.IDLE,x.fragLoadError=0,g.data=new Uint8Array(j.payload),C.parsing.start=C.buffering.start=self.performance.now(),C.parsing.end=C.buffering.end=self.performance.now(),j.frag===F&&A.trigger(r.Events.FRAG_BUFFERED,{stats:C,frag:F,part:null,id:g.type}),x.tick()}).catch(function(j){x.warn(j),x.resetFragmentLoading(g)})},h.fragContextChanged=function(g){var x=this.fragCurrent;return!g||!x||g.level!==x.level||g.sn!==x.sn||g.urlId!==x.urlId},h.fragBufferedComplete=function(g,x){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+s.default.toString(K.BufferHelper.getBuffered(j))),this.state=S.IDLE,this.tick()},h._handleFragmentLoadComplete=function(g){var x=this.transmuxer;if(!x)return;var j=g.frag,F=g.part,A=g.partsLoaded,W=!A||A.length===0||A.some(function(C){return!C}),H=new _.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,F?F.index:-1,!W);x.flush(H)},h._handleFragmentLoadProgress=function(g){},h._doFragLoad=function(g,x,j,F){var A=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(g.start,j||0),this.config.lowLatencyMode&&x){var W=x.partList;if(W&&F){j>g.end&&x.fragmentHint&&(g=x.fragmentHint);var H=this.getNextPart(W,g,j);if(H>-1){var C=W[H];return this.log("Loading part sn: "+g.sn+" p: "+C.index+" cc: "+g.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+H+"-"+(W.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=C.start+C.duration,this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,part:W[H],targetBufferTime:j}),this.doFragPartsLoad(g,W,H,F).catch(function(z){return A.handleFragLoadError(z)})}else if(!g.url||this.loadedEndOfParts(W,j))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(j.toFixed(3))),Object(G.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,targetBufferTime:j}),this.fragmentLoader.load(g,F).catch(function(z){return A.handleFragLoadError(z)})},h.doFragPartsLoad=function(g,x,j,F){var A=this;return new Promise(function(W,H){var C=[],z=function Z(le){var se=x[le];A.fragmentLoader.loadPart(g,se,F).then(function(Ce){C[se.index]=Ce;var Ee=Ce.part;A.hls.trigger(r.Events.FRAG_LOADED,Ce);var Ie=x[le+1];if(Ie&&Ie.fragment===g)Z(le+1);else return W({frag:g,part:Ee,partsLoaded:C})}).catch(H)};z(j)})},h.handleFragLoadError=function(g){var x=g.data;return x&&x.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(r.Events.ERROR,x),null},h._handleTransmuxerFlush=function(g){var x=this.getCurrentContext(g);if(!x||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var j=x.frag,F=x.part,A=x.level,W=self.performance.now();j.stats.parsing.end=W,F&&(F.stats.parsing.end=W),this.updateLevelTiming(j,F,A,g.partial)},h.getCurrentContext=function(g){var x=this.levels,j=g.level,F=g.sn,A=g.part;if(!x||!x[j])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+j+". The current chunk will not be buffered."),null;var W=x[j],H=A>-1?Object(a.getPartWith)(W,F,A):null,C=H?H.fragment:Object(a.getFragmentWithSN)(W,F,this.fragCurrent);return C?{frag:C,part:H,level:W}:null},h.bufferFragmentData=function(g,x,j,F){if(!g||this.state!==S.PARSING)return;var A=g.data1,W=g.data2,H=A;if(A&&W&&(H=Object(p.appendUint8Array)(A,W)),!H||!H.length)return;var C={type:g.type,frag:x,part:j,chunkMeta:F,parent:x.type,data:H};this.hls.trigger(r.Events.BUFFER_APPENDING,C),g.dropped&&g.independent&&!j&&this.flushBufferGap(x)},h.flushBufferGap=function(g){var x=this.media;if(!x)return;if(!K.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,g.start);return}var j=x.currentTime,F=K.BufferHelper.bufferInfo(x,j,0),A=g.duration,W=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),H=Math.max(Math.min(g.start-W,F.end-W),j+W);g.start-H>W&&this.flushMainBuffer(H,g.start)},h.getFwdBufferInfo=function(g,x){var j=this.config,F=this.getLoadPosition();if(!Object(G.isFiniteNumber)(F))return null;var A=K.BufferHelper.bufferInfo(g,F,j.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var W=this.fragmentTracker.getBufferedFrag(F,x);if(W&&A.nextStart<W.end)return K.BufferHelper.bufferInfo(g,F,Math.max(A.nextStart,j.maxBufferHole))}return A},h.getMaxBufferLength=function(g){var x=this.config,j;return g?j=Math.max(8*x.maxBufferSize/g,x.maxBufferLength):j=x.maxBufferLength,Math.min(j,x.maxMaxBufferLength)},h.reduceMaxBufferLength=function(g){var x=this.config,j=g||x.maxBufferLength;return x.maxMaxBufferLength>=j?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(g,x){var j,F,A=x.fragments,W=A.length;if(!W)return null;var H=this.config,C=A[0].start,z;if(x.live){var Z=H.initialLiveManifestSize;if(W<Z)return this.warn("Not enough fragments to start playback (have: "+W+", need: "+Z+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(x,A),this.startPosition=z?this.hls.liveSyncPosition||z.start:g)}else g<=C&&(z=A[0]);if(!z){var le=H.lowLatencyMode?x.partEnd:x.fragmentEnd;z=this.getFragmentAtPosition(g,le,x)}return(j=z)!==null&&j!==void 0&&j.initSegment&&!((F=z)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},h.getNextPart=function(g,x,j){for(var F=-1,A=!1,W=!0,H=0,C=g.length;H<C;H++){var z=g[H];if(W=W&&!z.independent,F>-1&&j<z.start)break;var Z=z.loaded;!Z&&(A||z.independent||W)&&z.fragment===x&&(F=H),A=Z}return F},h.loadedEndOfParts=function(g,x){var j=g[g.length-1];return j&&x>j.start&&j.loaded},h.getInitialLiveFragment=function(g,x){var j=this.fragPrevious,F=null;if(j){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),F=Object(u.findFragmentByPDT)(x,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var A=j.sn+1;if(A>=g.startSN&&A<=g.endSN){var W=x[A-g.startSN];j.cc===W.cc&&(F=W,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(u.findFragWithCC)(x,j.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(F=this.getFragmentAtPosition(H,this.bitrateTest?g.fragmentEnd:g.edge,g))}return F},h.getFragmentAtPosition=function(g,x,j){var F=this.config,A=this.fragPrevious,W=j.fragments,H=j.endSN,C=j.fragmentHint,z=F.maxFragLookUpTolerance,Z=!!(F.lowLatencyMode&&j.partList&&C);Z&&C&&!this.bitrateTest&&(W=W.concat(C),H=C.sn);var le;if(g<x){var se=g>x-z?0:z;le=Object(u.findFragmentByPTS)(A,W,g,se)}else le=W[W.length-1];if(le){var Ce=le.sn-j.startSN,Ee=A&&le.level===A.level,Ie=W[Ce+1],Qe=this.fragmentTracker.getState(le);if(Qe===k.FragmentState.BACKTRACKED){le=null;for(var Xe=Ce;W[Xe]&&this.fragmentTracker.getState(W[Xe])===k.FragmentState.BACKTRACKED;)A?le=W[Xe--]:le=W[--Xe];le||(le=Ie)}else A&&le.sn===A.sn&&!Z&&(Ee&&(le.sn<H&&this.fragmentTracker.getState(Ie)!==k.FragmentState.OK?(this.log("SN "+le.sn+" just loaded, load next one: "+Ie.sn),le=Ie):le=null))}return le},h.synchronizeToLiveEdge=function(g){var x=this.config,j=this.media;if(!j)return;var F=this.hls.liveSyncPosition,A=j.currentTime,W=g.fragments[0].start,H=g.edge,C=A>=W-x.maxFragLookUpTolerance&&A<=H;if(F!==null&&j.duration>F&&(A<F||!C)){var z=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*g.targetduration;(!C&&j.readyState<4||A<H-z)&&(this.loadedmetadata||(this.nextLoadPosition=F),j.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+F.toFixed(3)),j.currentTime=F))}},h.alignPlaylists=function(g,x){var j=this.levels,F=this.levelLastLoaded,A=this.fragPrevious,W=F!==null?j[F]:null,H=g.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var C=g.fragments[0].start,z=!x,Z=g.alignedSliding&&Object(G.isFiniteNumber)(C);if(z||!Z&&!C){Object(m.alignStream)(A,W,g);var le=g.fragments[0].start;return this.log("Live playlist sliding: "+le.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+g.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+H),le}return C},h.waitForCdnTuneIn=function(g){var x=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*x)},h.setStartPosition=function(g,x){var j=this.startPosition;if(j<x&&(j=-1),j===-1||this.lastCurrentTime===-1){var F=g.startTimeOffset;Object(G.isFiniteNumber)(F)?(j=x+F,F<0&&(j+=g.totalduration),j=Math.min(Math.max(x,j),x+g.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+j),this.startPosition=j):g.live?j=this.hls.liveSyncPosition||x:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},h.getLoadPosition=function(){var g=this.media,x=0;return this.loadedmetadata&&g?x=g.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},h.handleFragLoadAborted=function(g,x){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(x?" part"+x.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},h.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=S.IDLE)},h.onFragmentOrKeyLoadError=function(g,x){if(x.fatal)return;var j=x.frag;if(!j||j.type!==g)return;var F=this.fragCurrent;console.assert(F&&j.sn===F.sn&&j.level===F.level&&j.urlId===F.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var W=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+g+" "+j.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(g===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(I.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)},h.afterBufferFlushed=function(g,x,j){if(!g)return;var F=K.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(x,F,j),this.state===S.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},h.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[g].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(g,x,j,F){var A=this,W=j.details;console.assert(!!W,"level.details must be defined");var H=Object.keys(g.elementaryStreams).reduce(function(C,z){var Z=g.elementaryStreams[z];if(Z){var le=Z.endPTS-Z.startPTS;if(le<=0)return A.warn("Could not parse fragment "+g.sn+" "+z+" duration reliably ("+le+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),C||!1;var se=F?0:Object(a.updateFragPTSDTS)(W,g,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return A.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:W,level:j,drift:se,type:z,frag:g,start:Z.startPTS,end:Z.endPTS}),!0}return C},!1);H?(this.state=S.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:g,part:x})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(f,[{key:"state",get:function(){return this._state},set:function(g){var x=this._state;x!==g&&(this._state=g,this.log(x+"->"+g))}}]),f}(M.default)},"./src/controller/buffer-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return u});var G=U("./src/polyfills/number.ts"),M=U("./src/events.ts"),k=U("./src/utils/logger.ts"),K=U("./src/errors.ts"),I=U("./src/utils/buffer-helper.ts"),r=U("./src/utils/mediasource-helper.ts"),P=U("./src/loader/fragment.ts"),_=U("./src/controller/buffer-operation-queue.ts"),p=Object(r.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function a(c){var s=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 i=s.hls,n=s.media,O=s.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),n&&(s.updateMediaElementDuration(),i.trigger(M.Events.MEDIA_ATTACHED,{media:n})),O&&O.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){k.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){k.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var o=a.prototype;return o.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},o.destroy=function(){this.unregisterListeners(),this.details=null},o.registerListeners=function(){var s=this.hls;s.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(M.Events.BUFFER_RESET,this.onBufferReset,this),s.on(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(M.Events.BUFFER_EOS,this.onBufferEos,this),s.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(M.Events.FRAG_PARSED,this.onFragParsed,this),s.on(M.Events.FRAG_CHANGED,this.onFragChanged,this)},o.unregisterListeners=function(){var s=this.hls;s.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(M.Events.BUFFER_RESET,this.onBufferReset,this),s.off(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(M.Events.BUFFER_EOS,this.onBufferEos,this),s.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(M.Events.FRAG_PARSED,this.onFragParsed,this),s.off(M.Events.FRAG_CHANGED,this.onFragChanged,this)},o._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new _.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},o.onManifestParsed=function(s,i){var n=2;(i.audio&&!i.video||!i.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},o.onMediaAttaching=function(s,i){var n=this.media=i.media;if(n&&p){var O=this.mediaSource=new p;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(O),this._objectUrl=n.src}},o.onMediaDetaching=function(){var s=this.media,i=this.mediaSource,n=this._objectUrl;if(i){if(k.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(O){k.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(n&&self.URL.revokeObjectURL(n),s.src===n?(s.removeAttribute("src"),s.load()):k.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(M.Events.MEDIA_DETACHED,void 0)},o.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(i){var n=s.sourceBuffer[i];try{n&&(s.removeBufferListeners(i),s.mediaSource&&s.mediaSource.removeSourceBuffer(n),s.sourceBuffer[i]=void 0)}catch(O){k.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",O)}}),this._initSourceBuffer()},o.onBufferCodecs=function(s,i){var n=this,O=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(T){if(O){var w=n.tracks[T];if(w&&typeof w.buffer.changeType=="function"){var R=i[T],S=R.codec,v=R.levelCodec,E=R.container,f=(w.levelCodec||w.codec).replace(m,"$1"),h=(v||S).replace(m,"$1");if(f!==h){var y=E+";codecs="+(v||S);n.appendChangeType(T,y)}}}else n.pendingTracks[T]=i[T]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},o.appendChangeType=function(s,i){var n=this,O=this.operationQueue,T={execute:function(){var R=n.sourceBuffer[s];R&&(k.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+i),R.changeType(i)),O.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(R){k.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",R)}};O.append(T,s)},o.onBufferAppending=function(s,i){var n=this,O=this.hls,T=this.operationQueue,w=this.tracks,R=i.data,S=i.type,v=i.frag,E=i.part,f=i.chunkMeta,h=f.buffering[S],y=self.performance.now();h.start=y;var g=v.stats.buffering,x=E?E.stats.buffering:null;g.start===0&&(g.start=y),x&&x.start===0&&(x.start=y);var j=w.audio,F=S==="audio"&&f.id===1&&(j==null?void 0:j.container)==="audio/mpeg",A={execute:function(){if(h.executeStart=self.performance.now(),F){var H=n.sourceBuffer[S];if(H){var C=v.start-H.timestampOffset;Math.abs(C)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+C+") sn: "+v.sn+")"),H.timestampOffset=v.start)}}n.appendExecutor(R,S)},onStart:function(){},onComplete:function(){var H=self.performance.now();h.executeEnd=h.end=H,g.first===0&&(g.first=H),x&&x.first===0&&(x.first=H);var C=n.sourceBuffer,z={};for(var Z in C)z[Z]=I.BufferHelper.getBuffered(C[Z]);n.appendError=0,n.hls.trigger(M.Events.BUFFER_APPENDED,{type:S,frag:v,part:E,chunkMeta:f,parent:v.type,timeRanges:z})},onError:function(H){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",H);var C={type:K.ErrorTypes.MEDIA_ERROR,parent:v.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=K.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,C.details=K.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>O.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),C.fatal=!0)),O.trigger(M.Events.ERROR,C)}};T.append(A,S)},o.onBufferFlushing=function(s,i){var n=this,O=this.operationQueue,T=function(R){return{execute:n.removeExecutor.bind(n,R,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(M.Events.BUFFER_FLUSHED,{type:R})},onError:function(v){k.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",v)}}};i.type?O.append(T(i.type),i.type):this.getSourceBufferTypes().forEach(function(w){O.append(T(w),w)})},o.onFragParsed=function(s,i){var n=this,O=i.frag,T=i.part,w=[],R=T?T.elementaryStreams:O.elementaryStreams;R[P.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(R[P.ElementaryStreamTypes.AUDIO]&&w.push("audio"),R[P.ElementaryStreamTypes.VIDEO]&&w.push("video"));var S=function(){var E=self.performance.now();O.stats.buffering.end=E,T&&(T.stats.buffering.end=E);var f=T?T.stats:O.stats;n.hls.trigger(M.Events.FRAG_BUFFERED,{frag:O,part:T,stats:f,id:O.type})};w.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(S,w)},o.onFragChanged=function(s,i){this.flushBackBuffer()},o.onBufferEos=function(s,i){var n=this,O=this.getSourceBufferTypes().reduce(function(T,w){var R=n.sourceBuffer[w];return(!i.type||i.type===w)&&(R&&!R.ended&&(R.ended=!0,k.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),T&&!!(!R||R.ended)},!0);O&&this.blockBuffers(function(){var T=n.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},o.onLevelUpdated=function(s,i){var n=i.details;if(!n.fragments.length)return;this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},o.flushBackBuffer=function(){var s=this.hls,i=this.details,n=this.media,O=this.sourceBuffer;if(!n||i===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var w=i.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(G.isFiniteNumber)(w)||w<0)return;var R=n.currentTime,S=i.levelTargetDuration,v=Math.max(w,S),E=Math.floor(R/S)*S-v;T.forEach(function(f){var h=O[f];if(h){var y=I.BufferHelper.getBuffered(h);y.length>0&&E>y.start(0)&&(s.trigger(M.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),i.live&&s.trigger(M.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),s.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:f}))}})},o.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,i=this.hls,n=this.media,O=this.mediaSource,T=s.fragments[0].start+s.totalduration,w=n.duration,R=Object(G.isFiniteNumber)(O.duration)?O.duration:0;s.live&&i.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(s)):(T>R&&T>w||!Object(G.isFiniteNumber)(w))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),O.duration=T)},o.updateSeekableRange=function(s){var i=this.mediaSource,n=s.fragments,O=n.length;if(O&&s.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var T=Math.max(0,n[0].start),w=Math.max(T,T+s.totalduration);i.setLiveSeekableRange(T,w)}},o.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,i=this.operationQueue,n=this.pendingTracks,O=Object.keys(n).length;if(O&&!s||O===2){this.createSourceBuffers(n),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(w){i.executeNext(w)})}},o.createSourceBuffers=function(s){var i=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var T in s)if(!i[T]){var w=s[T];if(!w)throw Error("source buffer exists for track "+T+", however track does not");var R=w.levelCodec||w.codec,S=w.container+";codecs="+R;k.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var v=i[T]=n.addSourceBuffer(S),E=T;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[T]={buffer:v,codec:R,container:w.container,levelCodec:w.levelCodec,id:w.id},O++}catch(f){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:S})}}O&&this.hls.trigger(M.Events.BUFFER_CREATED,{tracks:this.tracks})},o._onSBUpdateStart=function(s){var i=this.operationQueue,n=i.current(s);n.onStart()},o._onSBUpdateEnd=function(s){var i=this.operationQueue,n=i.current(s);n.onComplete(),i.shiftAndExecuteNext(s)},o._onSBUpdateError=function(s,i){k.logger.error("[buffer-controller]: "+s+" SourceBuffer error",i),this.hls.trigger(M.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(s);n&&n.onError(i)},o.removeExecutor=function(s,i,n){var O=this.media,T=this.mediaSource,w=this.operationQueue,R=this.sourceBuffer,S=R[s];if(!O||!T||!S){k.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(s);return}var v=Object(G.isFiniteNumber)(O.duration)?O.duration:Infinity,E=Object(G.isFiniteNumber)(T.duration)?T.duration:Infinity,f=Math.max(0,i),h=Math.min(n,v,E);h>f?(k.logger.log("[buffer-controller]: Removing ["+f+","+h+"] from the "+s+" SourceBuffer"),console.assert(!S.updating,s+" sourceBuffer must not be updating"),S.remove(f,h)):w.shiftAndExecuteNext(s)},o.appendExecutor=function(s,i){var n=this.operationQueue,O=this.sourceBuffer,T=O[i];if(!T){k.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(i);return}T.ended=!1,console.assert(!T.updating,i+" sourceBuffer must not be updating"),T.appendBuffer(s)},o.blockBuffers=function(s,i){var n=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var O=this.operationQueue,T=i.map(function(w){return O.appendBlocker(w)});Promise.all(T).then(function(){s(),i.forEach(function(w){var R=n.sourceBuffer[w];(!R||!R.updating)&&O.shiftAndExecuteNext(w)})})},o.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},o.addBufferListener=function(s,i,n){var O=this.sourceBuffer[s];if(!O)return;var T=n.bind(this,s);this.listeners[s].push({event:i,listener:T}),O.addEventListener(i,T)},o.removeBufferListeners=function(s){var i=this.sourceBuffer[s];if(!i)return;this.listeners[s].forEach(function(n){i.removeEventListener(n.event,n.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return M});var G=U("./src/utils/logger.ts"),M=function(){function k(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var K=k.prototype;return K.append=function(r,P){var _=this.queues[P];_.push(r),_.length===1&&this.buffers[P]&&this.executeNext(P)},K.insertAbort=function(r,P){var _=this.queues[P];_.unshift(r),this.executeNext(P)},K.appendBlocker=function(r){var P,_=new Promise(function(m){P=m}),p={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,r),_},K.executeNext=function(r){var P=this.buffers,_=this.queues,p=P[r],m=_[r];if(m.length){var u=m[0];try{u.execute()}catch(a){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(a),(!p||!p.updating)&&(m.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},k}()},"./src/controller/cap-level-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/events.ts");function M(I,r){for(var P=0;P<r.length;P++){var _=r[P];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(I,_.key,_)}}function k(I,r,P){return r&&M(I.prototype,r),P&&M(I,P),I}var K=function(){function I(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 r=I.prototype;return r.setStreamController=function(_){this.streamController=_},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var _=this.hls;_.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var _=this.hls;_.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(_,p){I.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},r.onMediaAttaching=function(_,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},r.onManifestParsed=function(_,p){var m=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onBufferCodecs=function(_,p){var m=this.hls;m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var _=this.hls.levels;if(_.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(_.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},r.getMaxLevel=function(_){var p=this,m=this.hls.levels;if(!m.length)return-1;var u=m.filter(function(a,o){return I.isLevelAllowed(o,p.restrictedLevels)&&o<=_});return this.clientRect=null,I.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var _=this.media,p={width:0,height:0};if(_){var m=_.getBoundingClientRect();p.width=m.width,p.height=m.height,!p.width&&!p.height&&(p.width=m.right-m.left||_.width||0,p.height=m.bottom-m.top||_.height||0)}return this.clientRect=p,p},I.isLevelAllowed=function(_,p){return p===void 0&&(p=[]),p.indexOf(_)===-1},I.getMaxLevelByMediaSize=function(_,p,m){if(!_||!_.length)return-1;for(var u=function(i,n){return n?i.width!==n.width||i.height!==n.height:!0},a=_.length-1,o=0;o<_.length;o+=1){var c=_[o];if((c.width>=p||c.height>=m)&&u(c,_[o+1])){a=o;break}}return a},k(I,[{key:"mediaWidth",get:function(){return this.getDimensions().width*I.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*I.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var _=1;try{_=self.devicePixelRatio}catch(p){}return _}}]),I}();Y.default=K},"./src/controller/cmcd-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return u});var G=U("./src/events.ts"),M=U("./src/types/cmcd.ts"),k=U("./src/utils/buffer-helper.ts"),K=U("./src/utils/logger.ts");function I(a,o){for(var c=0;c<o.length;c++){var s=o[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function r(a,o,c){return o&&I(a.prototype,o),c&&I(a,c),a}function P(a,o){var c=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(c)return(c=c.call(a)).next.bind(c);if(Array.isArray(a)||(c=_(a))||o&&a&&typeof a.length=="number"){c&&(a=c);var s=0;return function(){return s>=a.length?{done:!0}:{done:!1,value:a[s++]}}}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 _(a,o){if(!a)return;if(typeof a=="string")return p(a,o);var c=Object.prototype.toString.call(a).slice(8,-1);if(c==="Object"&&a.constructor&&(c=a.constructor.name),c==="Map"||c==="Set")return Array.from(a);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return p(a,o)}function p(a,o){(o==null||o>a.length)&&(o=a.length);for(var c=0,s=new Array(o);c<o;c++)s[c]=a[c];return s}function m(){return m=Object.assign||function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(a[s]=c[s])}return a},m.apply(this,arguments)}var u=function(){function a(c){var s=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(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(O){try{s.apply(O,{ot:M.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(T){K.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(O){try{var T=O.frag,w=s.hls.levels[T.level],R=s.getObjectType(T),S={d:T.duration*1e3,ot:R};(R===M.CMCDObjectType.VIDEO||R===M.CMCDObjectType.AUDIO||R==M.CMCDObjectType.MUXED)&&(S.br=w.bitrate/1e3,S.tb=s.getTopBandwidth(R),S.bl=s.getBufferLength(R)),s.apply(O,S)}catch(v){K.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=c;var i=this.config=c.config,n=i.cmcd;n!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||a.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var o=a.prototype;return o.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this)},o.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},o.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},o.onMediaAttached=function(s,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},o.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},o.onBufferCreated=function(s,i){var n,O;this.audioBuffer=(n=i.tracks.audio)===null||n===void 0?void 0:n.buffer,this.videoBuffer=(O=i.tracks.video)===null||O===void 0?void 0:O.buffer},o.createData=function(){var s;return{v:M.CMCDVersion,sf:M.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},o.apply=function(s,i){i===void 0&&(i={}),m(i,this.createData());var n=i.ot===M.CMCDObjectType.INIT||i.ot===M.CMCDObjectType.VIDEO||i.ot===M.CMCDObjectType.MUXED;if(this.starved&&n&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var O=a.toHeaders(i);if(!Object.keys(O).length)return;s.headers||(s.headers={}),m(s.headers,O)}else{var T=a.toQuery(i);if(!T)return;s.url=a.appendQueryToUri(s.url,T)}},o.getObjectType=function(s){var i=s.type;return i==="subtitle"?M.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?M.CMCDObjectType.INIT:i==="audio"?M.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?M.CMCDObjectType.VIDEO:M.CMCDObjectType.MUXED:void 0},o.getTopBandwidth=function(s){for(var i=0,n=s===M.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=P(n),T;!(T=O()).done;){var w=T.value;w.bitrate>i&&(i=w.bitrate)}return i>0?i:NaN},o.getBufferLength=function(s){var i=this.hls.media,n=s===M.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!i)return NaN;var O=k.BufferHelper.bufferInfo(n,i.currentTime,this.config.maxBufferHole);return O.len*1e3},o.createPlaylistLoader=function(){var s=this.config.pLoader,i=this.applyPlaylistData,n=s||this.config.loader;return function(){function O(w){this.loader=void 0,this.loader=new n(w)}var T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(R,S,v){i(R),this.loader.load(R,S,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},o.createFragmentLoader=function(){var s=this.config.fLoader,i=this.applyFragmentData,n=s||this.config.loader;return function(){function O(w){this.loader=void 0,this.loader=new n(w)}var T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(R,S,v){i(R),this.loader.load(R,S,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},a.uuid=function(){var s=URL.createObjectURL(new Blob),i=s.toString();return URL.revokeObjectURL(s),i.substr(i.lastIndexOf("/")+1)},a.serialize=function(s){for(var i=[],n=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},O=function(F){return Math.round(F)},T=function(F){return O(F/100)*100},w=function(F){return encodeURIComponent(F)},R={br:O,d:O,bl:T,dl:T,mtp:T,nor:w,rtp:T,tb:O},S=Object.keys(s||{}).sort(),v=P(S),E;!(E=v()).done;){var f=E.value,h=s[f];if(!n(h))continue;if(f==="v"&&h===1)continue;if(f=="pr"&&h===1)continue;var y=R[f];y&&(h=y(h));var g=typeof h,x=void 0;f==="ot"||f==="sf"||f==="st"?x=f+"="+h:g==="boolean"?x=f:g==="number"?x=f+"="+h:x=f+"="+JSON.stringify(h),i.push(x)}return i.join(",")},a.toHeaders=function(s){for(var i=Object.keys(s),n={},O=["Object","Request","Session","Status"],T=[{},{},{},{}],w={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},R=0,S=i;R<S.length;R++){var v=S[R],E=w[v]!=null?w[v]:1;T[E][v]=s[v]}for(var f=0;f<T.length;f++){var h=a.serialize(T[f]);h&&(n["CMCD-"+O[f]]=h)}return n},a.toQuery=function(s){return"CMCD="+encodeURIComponent(a.serialize(s))},a.appendQueryToUri=function(s,i){if(!i)return s;var n=s.includes("?")?"&":"?";return""+s+n+i},a}()},"./src/controller/eme-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/events.ts"),M=U("./src/errors.ts"),k=U("./src/utils/logger.ts"),K=U("./src/utils/mediakeys-helper.ts");function I(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function r(u,a,o){return a&&I(u.prototype,a),o&&I(u,o),u}var P=3,_=function(a,o,c){var s={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(i){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:c.audioRobustness||""})}),o.forEach(function(i){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:c.videoRobustness||""})}),[s]},p=function(a,o,c,s){switch(a){case K.KeySystems.WIDEVINE:return _(o,c,s);default:throw new Error("Unknown key-system: "+a)}},m=function(){function u(o){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=o,this._config=o.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 a=u.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(c){switch(c){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},a._attemptKeySystemAccess=function(c,s,i){var n=this,O=p(c,s,i,this._drmSystemOptions);k.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(c,O);this.mediaKeysPromise=T.then(function(w){return n._onMediaKeySystemAccessObtained(c,w)}),T.catch(function(w){k.logger.error('Failed to obtain key-system "'+c+'" access:',w)})},a._onMediaKeySystemAccessObtained=function(c,s){var i=this;k.logger.log('Access for key-system "'+c+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:c};this._mediaKeysList.push(n);var O=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(T){return n.mediaKeys=T,k.logger.log('Media-keys created for key-system "'+c+'"'),i._onMediaKeysCreated(),T});return O.catch(function(T){k.logger.error("Failed to create media-keys:",T)}),O},a._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),c._onNewMediaKeySession(s.mediaKeysSession))})},a._onNewMediaKeySession=function(c){var s=this;k.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(i){s._onKeySessionMessage(c,i.message)},!1)},a._onKeySessionMessage=function(c,s){k.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(i){k.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),c.update(i)})},a.onMediaEncrypted=function(c){var s=this;if(k.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(O){if(!s._media)return;s._attemptSetMediaKeys(O),s._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(i).catch(i)},a._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}k.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(c,s){var i=this,n=this._mediaKeysList[0];if(!n){k.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(n.mediaKeysSessionInitialized){k.logger.warn("Key-Session already initialized but requested again");return}var O=n.mediaKeysSession;if(!O){k.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){k.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}k.logger.log('Generating key-session request for "'+c+'" init data type'),n.mediaKeysSessionInitialized=!0,O.generateRequest(c,s).then(function(){k.logger.debug("Key-session generation succeeded")}).catch(function(T){k.logger.error("Error generating key-session request:",T),i.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(c,s,i){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,c,s,i);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,n,c),O=void 0}catch(T){k.logger.error(T)}try{n.readyState||n.open("POST",c,!0),O&&O.call(this.hls,n,c)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return n},a._onLicenseRequestReadyStageChange=function(c,s,i,n){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,k.logger.log("License request succeeded");var O=c.response,T=this._licenseResponseCallback;if(T)try{O=T.call(this.hls,c,s)}catch(R){k.logger.error(R)}n(O)}else{if(k.logger.error("License Request XHR failed ("+s+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>P){this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=P-this._requestLicenseFailureCount+1;k.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(i,n)}break}},a._generateLicenseRequestChallenge=function(c,s){switch(c.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},a._requestLicense=function(c,s){k.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){k.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(i.mediaKeySystemDomain),O=this._createLicenseXhr(n,c,s);k.logger.log("Sending license request to URL: "+n);var T=this._generateLicenseRequestChallenge(i,c);O.send(T)}catch(w){k.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(c,s){if(!this._emeEnabled)return;var i=s.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var c=this._media,s=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(c,s){if(!this._emeEnabled)return;var i=s.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),n=s.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,i,n)},r(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();Y.default=m},"./src/controller/fps-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/events.ts"),M=U("./src/utils/logger.ts"),k=function(){function K(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var I=K.prototype;return I.setStreamController=function(P){this.streamController=P},I.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},I.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching)},I.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},I.onMediaAttaching=function(P,_){var p=this.hls.config;if(p.capLevelOnFPSDrop){var m=_.media instanceof self.HTMLVideoElement?_.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},I.checkFPS=function(P,_,p){var m=performance.now();if(_){if(this.lastTime){var u=m-this.lastTime,a=p-this.lastDroppedFrames,o=_-this.lastDecodedFrames,c=1e3*a/u,s=this.hls;if(s.trigger(G.Events.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:p}),c>0&&a>s.config.fpsDroppedMonitoringThreshold*o){var i=s.currentLevel;M.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=i)&&(i=i-1,s.trigger(G.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:s.currentLevel}),s.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=p,this.lastDecodedFrames=_}},I.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var _=P.getVideoPlaybackQuality();this.checkFPS(P,_.totalVideoFrames,_.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},K}();Y.default=k},"./src/controller/fragment-finders.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"findFragmentByPDT",function(){return k}),U.d(Y,"findFragmentByPTS",function(){return K}),U.d(Y,"fragmentWithinToleranceTest",function(){return I}),U.d(Y,"pdtWithinToleranceTest",function(){return r}),U.d(Y,"findFragWithCC",function(){return P});var G=U("./src/polyfills/number.ts"),M=U("./src/utils/binary-search.ts");function k(_,p,m){if(p===null||!Array.isArray(_)||!_.length||!Object(G.isFiniteNumber)(p))return null;var u=_[0].programDateTime;if(p<(u||0))return null;var a=_[_.length-1].endProgramDateTime;if(p>=(a||0))return null;m=m||0;for(var o=0;o<_.length;++o){var c=_[o];if(r(p,m,c))return c}return null}function K(_,p,m,u){m===void 0&&(m=0),u===void 0&&(u=0);var a=null;if(_?a=p[_.sn-p[0].sn+1]||null:m===0&&p[0].start===0&&(a=p[0]),a&&I(m,u,a)===0)return a;var o=M.default.search(p,I.bind(null,m,u));return o||a}function I(_,p,m){_===void 0&&(_=0),p===void 0&&(p=0);var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-u<=_?1:m.start-u>_&&m.start?-1:0}function r(_,p,m){var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,a=m.endProgramDateTime||0;return a-u>_}function P(_,p){return M.default.search(_,function(m){return m.cc<p?1:m.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"FragmentState",function(){return k}),U.d(Y,"FragmentTracker",function(){return K});var G=U("./src/events.ts"),M=U("./src/types/loader.ts"),k;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(k||(k={}));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 _=P.prototype;return _._registerListeners=function(){var m=this.hls;m.on(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(G.Events.FRAG_LOADED,this.onFragLoaded,this)},_._unregisterListeners=function(){var m=this.hls;m.off(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(G.Events.FRAG_LOADED,this.onFragLoaded,this)},_.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},_.getAppendedFrag=function(m,u){if(u===M.PlaylistLevelType.MAIN){var a=this.activeFragment,o=this.activeParts;if(!a)return null;if(o)for(var c=o.length;c--;){var s=o[c],i=s?s.end:a.appendedPTS;if(s.start<=m&&i!==void 0&&m<=i)return c>9&&(this.activeParts=o.slice(c-9)),s}else if(a.start<=m&&a.appendedPTS!==void 0&&m<=a.appendedPTS)return a}return this.getBufferedFrag(m,u)},_.getBufferedFrag=function(m,u){for(var a=this.fragments,o=Object.keys(a),c=o.length;c--;){var s=a[o[c]];if((s==null?void 0:s.body.type)===u&&s.buffered){var i=s.body;if(i.start<=m&&m<=i.end)return i}}return null},_.detectEvictedFragments=function(m,u,a){var o=this;Object.keys(this.fragments).forEach(function(c){var s=o.fragments[c];if(!s)return;if(!s.buffered){s.body.type===a&&o.removeFragment(s.body);return}var i=s.range[m];if(!i)return;i.time.some(function(n){var O=!o.isTimeBuffered(n.startPTS,n.endPTS,u);return O&&o.removeFragment(s.body),O})})},_.detectPartialFragments=function(m){var u=this,a=this.timeRanges,o=m.frag,c=m.part;if(!a||o.sn==="initSegment")return;var s=r(o),i=this.fragments[s];if(!i)return;Object.keys(a).forEach(function(n){var O=o.elementaryStreams[n];if(!O)return;var T=a[n],w=c!==null||O.partial===!0;i.range[n]=u.getBufferedTimes(o,c,w,T)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},_.fragBuffered=function(m){var u=r(m),a=this.fragments[u];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},_.getBufferedTimes=function(m,u,a,o){for(var c={time:[],partial:a},s=u?u.start:m.start,i=u?u.end:m.end,n=m.minEndPTS||i,O=m.maxStartPTS||s,T=0;T<o.length;T++){var w=o.start(T)-this.bufferPadding,R=o.end(T)+this.bufferPadding;if(O>=w&&n<=R){c.time.push({startPTS:Math.max(s,o.start(T)),endPTS:Math.min(i,o.end(T))});break}else if(s<R&&i>w)c.partial=!0,c.time.push({startPTS:Math.max(s,o.start(T)),endPTS:Math.min(i,o.end(T))});else if(i<=w)break}return c},_.getPartialFragment=function(m){var u=null,a,o,c,s=0,i=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(O){var T=n[O];if(!T)return;I(T)&&(o=T.body.start-i,c=T.body.end+i,m>=o&&m<=c&&(a=Math.min(m-o,c-m),s<=a&&(u=T.body,s=a)))}),u},_.getState=function(m){var u=r(m),a=this.fragments[u];return a?a.buffered?I(a)?k.PARTIAL:k.OK:a.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},_.backtrack=function(m,u){var a=r(m),o=this.fragments[a];if(!o||o.backtrack)return null;var c=o.backtrack=u||o.loaded;return o.loaded=null,c},_.getBacktrackData=function(m){var u=r(m),a=this.fragments[u];if(a){var o,c=a.backtrack;if(c!=null&&(o=c.payload)!==null&&o!==void 0&&o.byteLength)return c;this.removeFragment(m)}return null},_.isTimeBuffered=function(m,u,a){for(var o,c,s=0;s<a.length;s++){if(o=a.start(s)-this.bufferPadding,c=a.end(s)+this.bufferPadding,m>=o&&u<=c)return!0;if(u<=o)return!1}return!1},_.onFragLoaded=function(m,u){var a=u.frag,o=u.part;if(a.sn==="initSegment"||a.bitrateTest||o)return;var c=r(a);this.fragments[c]={body:a,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},_.onBufferAppended=function(m,u){var a=this,o=u.frag,c=u.part,s=u.timeRanges;if(o.type===M.PlaylistLevelType.MAIN)if(this.activeFragment=o,c){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(c)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(n){var O=s[n];if(a.detectEvictedFragments(n,O),!c)for(var T=0;T<O.length;T++)o.appendedPTS=Math.max(O.end(T),o.appendedPTS||0)})},_.onFragBuffered=function(m,u){this.detectPartialFragments(u)},_.hasFragment=function(m){var u=r(m);return!!this.fragments[u]},_.removeFragmentsInRange=function(m,u,a){var o=this;Object.keys(this.fragments).forEach(function(c){var s=o.fragments[c];if(!s)return;if(s.buffered){var i=s.body;i.type===a&&i.start<u&&i.end>m&&o.removeFragment(i)}})},_.removeFragment=function(m){var u=r(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},_.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function I(P){var _,p;return P.buffered&&(((_=P.range.video)===null||_===void 0?void 0:_.partial)||((p=P.range.audio)===null||p===void 0?void 0:p.partial))}function r(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return I}),U.d(Y,"MAX_START_GAP_JUMP",function(){return r}),U.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),U.d(Y,"SKIP_BUFFER_RANGE_START",function(){return _}),U.d(Y,"default",function(){return p});var G=U("./src/utils/buffer-helper.ts"),M=U("./src/errors.ts"),k=U("./src/events.ts"),K=U("./src/utils/logger.ts"),I=250,r=2,P=.1,_=.05,p=function(){function m(a,o,c,s){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=a,this.media=o,this.fragmentTracker=c,this.hls=s}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(o){var c=this.config,s=this.media,i=this.stalled,n=s.currentTime,O=s.seeking,T=this.seeking&&!O,w=!this.seeking&&O;if(this.seeking=O,n!==o){if(this.moved=!0,i!==null){if(this.stallReported){var R=self.performance.now()-i;K.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||T)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!G.BufferHelper.getBuffered(s).length)return;var S=G.BufferHelper.bufferInfo(s,n,0),v=S.len>0,E=S.nextStart||0;if(!v&&!E)return;if(O){var f=S.len>r,h=!E||E-n>r&&!this.fragmentTracker.getPartialFragment(n);if(f||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var y,g=Math.max(E,S.start||0)-n,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=x==null||((y=x.details)===null||y===void 0)?void 0:y.live,F=j?x.details.targetduration*2:r;if(g>0&&g<=F){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(i===null){this.stalled=A;return}var W=A-i;!O&&W>=I&&this._reportStall(S.len);var H=G.BufferHelper.bufferInfo(s,n,c.maxBufferHole);this._tryFixBufferStall(H,W)},u._tryFixBufferStall=function(o,c){var s=this.config,i=this.fragmentTracker,n=this.media,O=n.currentTime,T=i.getPartialFragment(O);if(T){var w=this._trySkipBufferHole(T);if(w)return}o.len>s.maxBufferHole&&c>s.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(o){var c=this.hls,s=this.media,i=this.stallReported;i||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+o+")"),c.trigger(k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},u._trySkipBufferHole=function(o){for(var c=this.config,s=this.hls,i=this.media,n=i.currentTime,O=0,T=G.BufferHelper.getBuffered(i),w=0;w<T.length;w++){var R=T.start(w);if(n+c.maxBufferHole>=O&&n<R){var S=Math.max(R+_,i.currentTime+P);return K.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+S),this.moved=!0,this.stalled=null,i.currentTime=S,o&&s.trigger(k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+S,frag:o}),S}O=T.end(w)}return 0},u._tryNudgeBuffer=function(){var o=this.config,c=this.hls,s=this.media,i=s.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<o.nudgeMaxRetry){var O=i+n*o.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+i+" to "+O),s.currentTime=O,c.trigger(k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+o.nudgeMaxRetry+" nudges"),c.trigger(k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/events.ts"),M=U("./src/utils/texttrack-utils.ts"),k=U("./src/demux/id3.ts"),K=.25,I=function(){function r(_){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=_,this._registerListeners()}var P=r.prototype;return P.destroy=function(){this._unregisterListeners()},P._registerListeners=function(){var p=this.hls;p.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P._unregisterListeners=function(){var p=this.hls;p.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},P.onMediaAttached=function(p,m){this.media=m.media},P.onMediaDetaching=function(){if(!this.id3Track)return;Object(M.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},P.getID3Track=function(p){if(!this.media)return;for(var m=0;m<p.length;m++){var u=p[m];if(u.kind==="metadata"&&u.label==="id3")return Object(M.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},P.onFragParsingMetadata=function(p,m){if(!this.media)return;var u=m.frag,a=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var o=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<a.length;c++){var s=k.getID3Frames(a[c].data);if(s){var i=a[c].pts,n=c<a.length-1?a[c+1].pts:u.end,O=n-i;O<=0&&(n=i+K);for(var T=0;T<s.length;T++){var w=s[T];if(!k.isTimeStampFrame(w)){var R=new o(i,n,"");R.value=w,this.id3Track.addCue(R)}}}}},P.onBufferFlushing=function(p,m){var u=m.startOffset,a=m.endOffset,o=m.type;if(!o||o==="audio"){var c=this.id3Track;c&&Object(M.removeCuesInRange)(c,u,a)}},r}();Y.default=I},"./src/controller/latency-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return r});var G=U("./src/errors.ts"),M=U("./src/events.ts"),k=U("./src/utils/logger.ts");function K(P,_){for(var p=0;p<_.length;p++){var m=_[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function I(P,_,p){return _&&K(P.prototype,_),p&&K(P,p),P}var r=function(){function P(p){var m=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return m.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var _=P.prototype;return _.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},_.registerListeners=function(){this.hls.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(M.Events.ERROR,this.onError,this)},_.unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(M.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(M.Events.ERROR,this.onError)},_.onMediaAttached=function(m,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},_.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},_.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},_.onLevelUpdated=function(m,u){var a=u.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},_.onError=function(m,u){if(u.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,k.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},_.timeupdate=function(){var m=this.media,u=this.levelDetails;if(!m||!u)return;this.currentTime=m.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var o=this.config,c=o.lowLatencyMode,s=o.maxLiveSyncPlaybackRate;if(!c||s===1)return;var i=this.targetLatency;if(i===null)return;var n=a-i,O=Math.min(this.maxLatency,i+u.targetduration),T=n<O;if(u.live&&T&&n>.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,s)),R=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;m.playbackRate=Math.min(w,Math.max(1,R))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},_.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},_.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},I(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,u=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:u?m.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var u=m.holdBack,a=m.partHoldBack,o=m.targetduration,c=this.config,s=c.liveSyncDuration,i=c.liveSyncDurationCount,n=c.lowLatencyMode,O=this.hls.userConfig,T=n&&a||u;(O.liveSyncDuration||O.liveSyncDurationCount||T===0)&&(T=s!==void 0?s:i*o);var w=o,R=1;return T+Math.min(this.stallCount*R,w)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,a=this.levelDetails;if(m===null||u===null||a===null)return null;var o=a.edge,c=m-u-this.edgeStalled,s=o-a.totalduration,i=o-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(s,c),i)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var u=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-u,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,u=this.levelDetails;if(!m||!u)return 0;var a=m.buffered.length;return a?m.buffered.end(a-1):u.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return c});var G=U("./src/types/level.ts"),M=U("./src/events.ts"),k=U("./src/errors.ts"),K=U("./src/utils/codecs.ts"),I=U("./src/controller/level-helper.ts"),r=U("./src/controller/base-playlist-controller.ts"),P=U("./src/types/loader.ts");function _(){return _=Object.assign||function(s){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var O in n)Object.prototype.hasOwnProperty.call(n,O)&&(s[O]=n[O])}return s},_.apply(this,arguments)}function p(s,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(s,O.key,O)}}function m(s,i,n){return i&&p(s.prototype,i),n&&p(s,n),s}function u(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,a(s,i)}function a(s,i){return a=Object.setPrototypeOf||function(O,T){return O.__proto__=T,O},a(s,i)}var o=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(s){u(i,s);function i(O){var T;return T=s.call(this,O,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var n=i.prototype;return n._registerListeners=function(){var T=this.hls;T.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(M.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var T=this.hls;T.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(M.Events.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},n.startLoad=function(){var T=this._levels;T.forEach(function(w){w.loadError=0}),s.prototype.startLoad.call(this)},n.onManifestLoaded=function(T,w){var R=[],S=[],v=[],E,f={},h,y=!1,g=!1,x=!1;if(w.levels.forEach(function(W){var H=W.attrs;y=y||!!(W.width&&W.height),g=g||!!W.videoCodec,x=x||!!W.audioCodec,o&&W.audioCodec&&W.audioCodec.indexOf("mp4a.40.34")!==-1&&(W.audioCodec=void 0);var C=W.bitrate+"-"+W.attrs.RESOLUTION+"-"+W.attrs.CODECS;h=f[C],h?h.url.push(W.url):(h=new G.Level(W),f[C]=h,R.push(h)),H&&(H.AUDIO&&Object(I.addGroupId)(h,"audio",H.AUDIO),H.SUBTITLES&&Object(I.addGroupId)(h,"text",H.SUBTITLES))}),(y||g)&&x&&(R=R.filter(function(W){var H=W.videoCodec,C=W.width,z=W.height;return!!H||!!(C&&z)})),R=R.filter(function(W){var H=W.audioCodec,C=W.videoCodec;return(!H||Object(K.isCodecSupportedInMp4)(H,"audio"))&&(!C||Object(K.isCodecSupportedInMp4)(C,"video"))}),w.audioTracks&&(S=w.audioTracks.filter(function(W){return!W.audioCodec||Object(K.isCodecSupportedInMp4)(W.audioCodec,"audio")}),Object(I.assignTrackIdsByGroup)(S)),w.subtitles&&(v=w.subtitles,Object(I.assignTrackIdsByGroup)(v)),R.length>0){E=R[0].bitrate,R.sort(function(W,H){return W.bitrate-H.bitrate}),this._levels=R;for(var j=0;j<R.length;j++)if(R[j].bitrate===E){this._firstLevel=j,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+E);break}var F=x&&!g,A={levels:R,audioTracks:S,subtitleTracks:v,firstLevel:this._firstLevel,stats:w.stats,audio:x,video:g,altAudio:!F&&S.some(function(W){return!!W.url})};this.hls.trigger(M.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(M.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:w.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(T,w){if(s.prototype.onError.call(this,T,w),w.fatal)return;var R=w.context,S=this._levels[this.currentLevelIndex];if(R&&(R.type===P.PlaylistContextType.AUDIO_TRACK&&S.audioGroupIds&&R.groupId===S.audioGroupIds[S.urlId]||R.type===P.PlaylistContextType.SUBTITLE_TRACK&&S.textGroupIds&&R.groupId===S.textGroupIds[S.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,E=!0,f;switch(w.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:case k.ErrorDetails.KEY_LOAD_ERROR:case k.ErrorDetails.KEY_LOAD_TIMEOUT:if(w.frag){var h=this._levels[w.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=w.frag.level)):f=w.frag.level}break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(E=!1),f=R.level),v=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:f=w.level,v=!0;break}f!==void 0&&this.recoverLevel(w,f,v,E)},n.recoverLevel=function(T,w,R,S){var v=T.details,E=this._levels[w];if(E.loadError++,R){var f=this.retryLoadingOrFail(T);if(f)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var h=E.url.length;if(h>1&&E.loadError<h)T.levelRetry=!0,this.redundantFailover(w);else if(this.manualLevelIndex===-1){var y=w===0?this._levels.length-1:w-1;this.currentLevelIndex!==y&&this._levels[y].loadError===0&&(this.warn(v+": switch to "+y),T.levelRetry=!0,this.hls.nextAutoLevel=y)}}},n.redundantFailover=function(T){var w=this._levels[T],R=w.url.length;if(R>1){var S=(w.urlId+1)%R;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(v){v.urlId=S}),this.level=T}},n.onFragLoaded=function(T,w){var R=w.frag;if(R!==void 0&&R.type===P.PlaylistLevelType.MAIN){var S=this._levels[R.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},n.onLevelLoaded=function(T,w){var R,S=w.level,v=w.details,E=this._levels[S];if(!E){var f;this.warn("Invalid level index "+S),(f=w.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(v.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(S,w,E.details)):(R=w.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(v.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(T,w){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var S=-1,v=this.hls.audioTracks[w.id].groupId,E=0;E<R.audioGroupIds.length;E++)if(R.audioGroupIds[E]===v){S=E;break}S!==R.urlId&&(R.urlId=S,this.startLoad())}},n.loadPlaylist=function(T){var w=this.currentLevelIndex,R=this._levels[w];if(this.canLoad&&R&&R.url.length>0){var S=R.urlId,v=R.url[S];if(T)try{v=T.addDirectives(v)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+w+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+S+" "+v),this.clearTimer(),this.hls.trigger(M.Events.LEVEL_LOADING,{url:v,level:w,id:S,deliveryDirectives:T||null})}},n.removeLevel=function(T,w){var R=function(E,f){return f!==w},S=this._levels.filter(function(v,E){return E!==T?!0:v.url.length>1&&w!==void 0?(v.url=v.url.filter(R),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(R)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(R)),v.urlId=0,!0):!1}).map(function(v,E){var f=v.details;return f!=null&&f.fragments&&f.fragments.forEach(function(h){h.level=E}),v});this._levels=S,this.hls.trigger(M.Events.LEVELS_UPDATED,{levels:S})},m(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var w,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===T&&(w=R[T])!==null&&w!==void 0&&w.details)return;if(T<0||T>=R.length){var S=T<0;if(this.hls.trigger(M.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:S,reason:"invalid level idx"}),S)return;T=Math.min(T,R.length-1)}this.clearTimer();var v=this.currentLevelIndex,E=R[v],f=R[T];this.log("switching to level "+T+" from "+v),this.currentLevelIndex=T;var h=_({},f,{level:T,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete h._urlId,this.hls.trigger(M.Events.LEVEL_SWITCHING,h);var y=f.details;if(!y||y.live){var g=this.switchParams(f.uri,E==null?void 0:E.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),i}(r.default)},"./src/controller/level-helper.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"addGroupId",function(){return k}),U.d(Y,"assignTrackIdsByGroup",function(){return K}),U.d(Y,"updatePTS",function(){return I}),U.d(Y,"updateFragPTSDTS",function(){return P}),U.d(Y,"mergeDetails",function(){return _}),U.d(Y,"mapPartIntersection",function(){return p}),U.d(Y,"mapFragmentIntersection",function(){return m}),U.d(Y,"adjustSliding",function(){return u}),U.d(Y,"addSliding",function(){return a}),U.d(Y,"computeReloadInterval",function(){return o}),U.d(Y,"getFragmentWithSN",function(){return c}),U.d(Y,"getPartWith",function(){return s});var G=U("./src/polyfills/number.ts"),M=U("./src/utils/logger.ts");function k(i,n,O){switch(n){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(O);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(O);break}}function K(i){var n={};i.forEach(function(O){var T=O.groupId||"";O.id=n[T]=n[T]||0,n[T]++})}function I(i,n,O){var T=i[n],w=i[O];r(T,w)}function r(i,n){var O=n.startPTS;if(Object(G.isFiniteNumber)(O)){var T=0,w;n.sn>i.sn?(T=O-i.start,w=i):(T=i.start-O,w=n),w.duration!==T&&(w.duration=T)}else if(n.sn>i.sn){var R=i.cc===n.cc;R&&i.minEndPTS?n.start=i.start+(i.minEndPTS-i.start):n.start=i.start+i.duration}else n.start=Math.max(i.start-n.duration,0)}function P(i,n,O,T,w,R){var S=T-O;S<=0&&(M.logger.warn("Fragment should have a positive duration",n),T=O+n.duration,R=w+n.duration);var v=O,E=T,f=n.startPTS,h=n.endPTS;if(Object(G.isFiniteNumber)(f)){var y=Math.abs(f-O);Object(G.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(y,n.deltaPTS):n.deltaPTS=y,v=Math.max(O,f),O=Math.min(O,f),w=Math.min(w,n.startDTS),E=Math.min(T,h),T=Math.max(T,h),R=Math.max(R,n.endDTS)}n.duration=T-O;var g=O-n.start;n.appendedPTS=T,n.start=n.startPTS=O,n.maxStartPTS=v,n.startDTS=w,n.endPTS=T,n.minEndPTS=E,n.endDTS=R;var x=n.sn;if(!i||x<i.startSN||x>i.endSN)return 0;var j,F=x-i.startSN,A=i.fragments;for(A[F]=n,j=F;j>0;j--)r(A[j],A[j-1]);for(j=F;j<A.length-1;j++)r(A[j],A[j+1]);return i.fragmentHint&&r(A[A.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,g}function _(i,n){for(var O=null,T=i.fragments,w=T.length-1;w>=0;w--){var R=T[w].initSegment;if(R){O=R;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var S=0,v;if(m(i,n,function(j,F){j.relurl&&(S=j.cc-F.cc),Object(G.isFiniteNumber)(j.startPTS)&&Object(G.isFiniteNumber)(j.endPTS)&&(F.start=F.startPTS=j.startPTS,F.startDTS=j.startDTS,F.appendedPTS=j.appendedPTS,F.maxStartPTS=j.maxStartPTS,F.endPTS=j.endPTS,F.endDTS=j.endDTS,F.minEndPTS=j.minEndPTS,F.duration=j.endPTS-j.startPTS,F.duration&&(v=F),n.PTSKnown=n.alignedSliding=!0),F.elementaryStreams=j.elementaryStreams,F.loader=j.loader,F.stats=j.stats,F.urlId=j.urlId,j.initSegment&&(F.initSegment=j.initSegment,O=j.initSegment)}),O){var E=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;E.forEach(function(j){var F;(!j.initSegment||j.initSegment.relurl===((F=O)===null||F===void 0?void 0:F.relurl))&&(j.initSegment=O)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(j){return!j}),n.deltaUpdateFailed)){M.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=n.skippedSegments;f--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var h=n.fragments;if(S){M.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y<h.length;y++)h[y].cc+=S}n.skippedSegments&&(n.startCC=n.fragments[0].cc),p(i.partList,n.partList,function(j,F){F.elementaryStreams=j.elementaryStreams,F.stats=j.stats}),v?P(n,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):u(i,n),h.length&&(n.totalduration=n.edge-h[0].start),n.driftStartTime=i.driftStartTime,n.driftStart=i.driftStart;var g=n.advancedDateTime;if(n.advanced&&g){var x=n.edge;n.driftStart||(n.driftStartTime=g,n.driftStart=x),n.driftEndTime=g,n.driftEnd=x}else n.driftEndTime=i.driftEndTime,n.driftEnd=i.driftEnd,n.advancedDateTime=i.advancedDateTime}function p(i,n,O){if(i&&n)for(var T=0,w=0,R=i.length;w<=R;w++){var S=i[w],v=n[w+T];S&&v&&S.index===v.index&&S.fragment.sn===v.fragment.sn?O(S,v):T--}}function m(i,n,O){for(var T=n.skippedSegments,w=Math.max(i.startSN,n.startSN)-n.startSN,R=(i.fragmentHint?1:0)+(T?n.endSN:Math.min(i.endSN,n.endSN))-n.startSN,S=n.startSN-i.startSN,v=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,E=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,f=w;f<=R;f++){var h=E[S+f],y=v[f];T&&!y&&f<T&&(y=n.fragments[f]=h),h&&y&&O(h,y)}}function u(i,n){var O=n.startSN+n.skippedSegments-i.startSN,T=i.fragments;if(O<0||O>=T.length)return;a(n,T[O].start)}function a(i,n){if(n){for(var O=i.fragments,T=i.skippedSegments;T<O.length;T++)O[T].start+=n;i.fragmentHint&&(i.fragmentHint.start+=n)}}function o(i,n){var O=1e3*i.levelTargetDuration,T=O/2,w=i.age,R=w>0&&w<O*3,S=n.loading.end-n.loading.start,v,E=i.availabilityDelay;if(i.updated===!1)if(R){var f=333*i.misses;v=Math.max(Math.min(T,S*2),f),i.availabilityDelay=(i.availabilityDelay||0)+v}else v=T;else R?(E=Math.min(E||O/2,w),i.availabilityDelay=E,v=E+O-w):v=O-S;return Math.round(v)}function c(i,n,O){if(!i||!i.details)return null;var T=i.details,w=T.fragments[n-T.startSN];return w||(w=T.fragmentHint,w&&w.sn===n?w:n<T.startSN&&O&&O.sn===n?O:null)}function s(i,n,O){if(!i||!i.details)return null;var T=i.details.partList;if(T)for(var w=T.length;w--;){var R=T[w];if(R.index===O&&R.fragment.sn===n)return R}return null}},"./src/controller/stream-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return T});var G=U("./src/polyfills/number.ts"),M=U("./src/controller/base-stream-controller.ts"),k=U("./src/is-supported.ts"),K=U("./src/events.ts"),I=U("./src/utils/buffer-helper.ts"),r=U("./src/controller/fragment-tracker.ts"),P=U("./src/types/loader.ts"),_=U("./src/loader/fragment.ts"),p=U("./src/demux/transmuxer-interface.ts"),m=U("./src/types/transmuxer.ts"),u=U("./src/controller/gap-controller.ts"),a=U("./src/errors.ts"),o=U("./src/utils/logger.ts");function c(w,R){for(var S=0;S<R.length;S++){var v=R[S];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}function s(w,R,S){return R&&c(w.prototype,R),S&&c(w,S),w}function i(w,R){w.prototype=Object.create(R.prototype),w.prototype.constructor=w,n(w,R)}function n(w,R){return n=Object.setPrototypeOf||function(v,E){return v.__proto__=E,v},n(w,R)}var O=100,T=function(w){i(R,w);function R(v,E){var f;return f=w.call(this,v,E,"[stream-controller]")||this,f.audioCodecSwap=!1,f.gapController=null,f.level=-1,f._forceStartLoad=!1,f.altAudio=!1,f.audioOnly=!1,f.fragPlaying=null,f.onvplaying=null,f.onvseeked=null,f.fragLastKbps=0,f.stalled=!1,f.couldBacktrack=!1,f.audioCodecSwitch=!1,f.videoBuffer=null,f._registerListeners(),f}var S=R.prototype;return S._registerListeners=function(){var E=this.hls;E.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(K.Events.ERROR,this.onError,this),E.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var E=this.hls;E.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(K.Events.ERROR,this.onError,this),E.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(E){if(this.levels){var f=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var y=h.startLevel;y===-1&&(h.config.testBandwidth?(y=0,this.bitrateTest=!0):y=h.nextAutoLevel),this.level=h.nextLoadLevel=y,this.loadedmetadata=!1}f>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),E=f),this.state=M.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=M.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_LEVEL:{var E,f=this.levels,h=this.level,y=f==null||((E=f[h])===null||E===void 0)?void 0:E.details;if(y&&(!y.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(y))break;this.state=M.State.IDLE;break}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var g,x=self.performance.now(),j=this.retryDate;(!j||x>=j||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=M.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var E,f,h=this.hls,y=this.levelLastLoaded,g=this.levels,x=this.media,j=h.config,F=h.nextLoadLevel;if(y===null||!x&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[F])return;var A=g[F];this.level=h.nextLoadLevel=F;var W=A.details;if(!W||this.state===M.State.WAITING_LEVEL||W.live&&this.levelLastLoaded!==F){this.state=M.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:x,P.PlaylistLevelType.MAIN);if(H===null)return;var C=H.len,z=this.getMaxBufferLength(A.maxBitrate);if(C>=z)return;if(this._streamEnded(H,W)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,Z),this.state=M.State.ENDED;return}var le=H.end,se=this.getNextFragment(le,W);if(this.couldBacktrack&&!this.fragPrevious&&se&&se.sn!=="initSegment"){var Ce=se.sn-W.startSN;Ce>1&&(se=W.fragments[Ce-1],this.fragmentTracker.removeFragment(se))}if(se&&this.fragmentTracker.getState(se)===r.FragmentState.OK&&this.nextLoadPosition>le){var Ee=this.audioOnly&&!this.altAudio?_.ElementaryStreamTypes.AUDIO:_.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,Ee,P.PlaylistLevelType.MAIN),se=this.getNextFragment(this.nextLoadPosition,W)}if(!se)return;se.initSegment&&!se.initSegment.data&&!this.bitrateTest&&(se=se.initSegment),((E=se.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((f=se.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(se,W):this.loadFragment(se,W,le)},S.loadFragment=function(E,f,h){var y,g=this.fragmentTracker.getState(E);if(this.fragCurrent=E,g===r.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(E);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);return}else g=r.FragmentState.NOT_LOADED}g===r.FragmentState.NOT_LOADED||g===r.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,E,f,h)):g===r.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((y=this.media)===null||y===void 0?void 0:y.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(E){var f=this.fragmentTracker.getAppendedFrag(E,P.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},S.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,P.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var E=this.levels,f=this.media;if(f!=null&&f.readyState){var h,y=this.getAppendedFrag(f.currentTime);if(y&&y.start>1&&this.flushMainBuffer(0,y.start-1),!f.paused&&E){var g=this.hls.nextLoadLevel,x=E[g],j=this.fragLastKbps;j&&this.fragCurrent?h=this.fragCurrent.duration*x.maxBitrate/(1e3*j)+1:h=0}else h=0;var F=this.getBufferedFrag(f.currentTime+h);if(F){var A=this.followingBufferedFrag(F);if(A){this.abortCurrentFrag();var W=A.maxStartPTS?A.maxStartPTS:A.start,H=A.duration,C=Math.max(F.end,W+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(C,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===M.State.KEY_LOADING&&(this.state=M.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(E,f){w.prototype.flushMainBuffer.call(this,E,f,this.altAudio?"video":null)},S.onMediaAttached=function(E,f){w.prototype.onMediaAttached.call(this,E,f);var h=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,h,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var E=this.media,f=E?E.currentTime:null;Object(G.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},S.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},S.onManifestParsed=function(E,f){var h=!1,y=!1,g;f.levels.forEach(function(x){g=x.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(h=!0),g.indexOf("mp4a.40.5")!==-1&&(y=!0))}),this.audioCodecSwitch=h&&y&&!Object(k.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},S.onLevelLoading=function(E,f){var h=this.levels;if(!h||this.state!==M.State.IDLE)return;var y=h[f.level];(!y.details||y.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(y.details))&&(this.state=M.State.WAITING_LEVEL)},S.onLevelLoaded=function(E,f){var h,y=this.levels,g=f.level,x=f.details,j=x.totalduration;if(!y){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+j);var F=this.fragCurrent;F&&(this.state===M.State.FRAG_LOADING||this.state===M.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==f.level&&F.loader&&(this.state=M.State.IDLE,F.loader.abort()));var A=y[g],W=0;if(x.live||(h=A.details)!==null&&h!==void 0&&h.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;W=this.alignPlaylists(x,A.details)}if(A.details=x,this.levelLastLoaded=g,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:x,level:g}),this.state===M.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=M.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,W),this.tick()},S._handleFragmentLoadProgress=function(E){var f,h=E.frag,y=E.part,g=E.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var j=x[h.level],F=j.details;if(!F){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var A=j.videoCodec,W=F.PTSKnown||!F.live,H=(f=h.initSegment)===null||f===void 0?void 0:f.data,C=this._getAudioCodec(j),z=this.transmuxer=this.transmuxer||new p.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=y?y.index:-1,le=Z!==-1,se=new m.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,g.byteLength,Z,le),Ce=this.initPTS[h.cc];z.push(g,H,C,A,h,y,F.totalduration,W,se,Ce)},S.onAudioTrackSwitching=function(E,f){var h=this.altAudio,y=!!f.url,g=f.id;if(!y){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;h&&j.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:g})}},S.onAudioTrackSwitched=function(E,f){var h=f.id,y=!!this.hls.audioTracks[h].url;if(y){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=y,this.tick()},S.onBufferCreated=function(E,f){var h=f.tracks,y,g,x=!1;for(var j in h){var F=h[j];if(F.id==="main"){if(g=j,y=F,j==="video"){var A=h[j];A&&(this.videoBuffer=A.buffer)}}else x=!0}x&&y?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(E,f){var h=f.frag,y=f.part;if(h&&h.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(y?" p: "+y.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===M.State.PARSED&&(this.state=M.State.IDLE);return}var g=y?y.stats:h.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,y)},S.onError=function(E,f){switch(f.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.MAIN,f);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==M.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=M.State.ERROR):!f.levelRetry&&this.state===M.State.WAITING_LEVEL&&(this.state=M.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var h=!0,y=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);y&&y.len>.5&&(h=!this.reduceMaxBufferLength(y.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var E=this.media,f=this.gapController;if(!E||!f||!E.readyState)return;var h=I.BufferHelper.getBuffered(E);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=M.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(E,f){var h=f.type;if(h!==_.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var y=(h===_.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(y,h,P.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(E,f){this.levels=f.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var E=this.media,f=E.currentTime,h=this.startPosition;if(h>=0&&f<h){if(E.seeking){o.logger.log("could not seek to "+h+", already seeking at "+f);return}var y=I.BufferHelper.getBuffered(E),g=y.length?y.start(0):0,x=g-h;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(o.logger.log("adjusting start position by "+x+" to match buffer start"),h+=x,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+f),E.currentTime=h}},S._getAudioCodec=function(E){var f=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},S._loadBitrateTestFrag=function(E){var f=this;this._doFragLoad(E).then(function(h){var y=f.hls;if(!h||y.nextLoadLevel||f.fragContextChanged(E))return;f.fragLoadError=0,f.state=M.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var g=E.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),y.trigger(K.Events.FRAG_LOADED,h)})},S._handleTransmuxComplete=function(E){var f,h="main",y=this.hls,g=E.remuxResult,x=E.chunkMeta,j=this.getCurrentContext(x);if(!j){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var F=j.frag,A=j.part,W=j.level,H=g.video,C=g.text,z=g.id3,Z=g.initSegment,le=this.altAudio?void 0:g.audio;if(this.fragContextChanged(F))return;if(this.state=M.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(W,Z.tracks,F,x),y.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:h,tracks:Z.tracks}));var se=Z.initPTS,Ce=Z.timescale;Object(G.isFiniteNumber)(se)&&(this.initPTS[F.cc]=se,y.trigger(K.Events.INIT_PTS_FOUND,{frag:F,id:h,initPTS:se,timescale:Ce}))}if(H&&g.independent!==!1){if(W.details){var Ee=H.startPTS,Ie=H.endPTS,Qe=H.startDTS,Xe=H.endDTS;if(A)A.elementaryStreams[H.type]={startPTS:Ee,endPTS:Ie,startDTS:Qe,endDTS:Xe};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var _e=this.getLoadPosition()+this.config.maxBufferHole;if(_e<Ee){this.backtrack(F);return}F.setElementaryStreamInfo(H.type,F.start,Ie,F.start,Xe,!0)}F.setElementaryStreamInfo(H.type,Ee,Ie,Qe,Xe),this.bufferFragmentData(H,F,A,x)}}else if(g.independent===!1){this.backtrack(F);return}if(le){var pe=le.startPTS,at=le.endPTS,Qt=le.startDTS,Ft=le.endDTS;A&&(A.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:pe,endPTS:at,startDTS:Qt,endDTS:Ft}),F.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,pe,at,Qt,Ft),this.bufferFragmentData(le,F,A,x)}if(z!=null&&(f=z.samples)!==null&&f!==void 0&&f.length){var Tt={frag:F,id:h,samples:z.samples};y.trigger(K.Events.FRAG_PARSING_METADATA,Tt)}if(C){var Ve={frag:F,id:h,samples:C.samples};y.trigger(K.Events.FRAG_PARSING_USERDATA,Ve)}},S._bufferInitSegment=function(E,f,h,y){var g=this;if(this.state!==M.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var x=f.audio,j=f.video,F=f.audiovideo;if(x){var A=E.audioCodec,W=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),x.metadata.channelCount!==1&&W.indexOf("firefox")===-1&&(A="mp4a.40.5")),W.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),E.audioCodec&&E.audioCodec!==A&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+A+'"'),x.levelCodec=A,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(E.audioCodec||"")+"/"+x.codec+"]")}j&&(j.levelCodec=E.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+j.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(H){var C=f[H],z=C.initSegment;z!=null&&z.byteLength&&g.hls.trigger(K.Events.BUFFER_APPENDING,{type:H,data:z,frag:h,part:null,chunkMeta:y,parent:h.type})}),this.tick()},S.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var f=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,f?this.resetFragmentLoading(E):this.state=M.State.BACKTRACKING},S.checkFragmentChanged=function(){var E=this.media,f=null;if(E&&E.readyState>1&&E.seeking===!1){var h=E.currentTime;if(I.BufferHelper.isBuffered(E,h)?f=this.getAppendedFrag(h):I.BufferHelper.isBuffered(E,h+.1)&&(f=this.getAppendedFrag(h+.1)),f){var y=this.fragPlaying,g=f.level;(!y||f.sn!==y.sn||y.level!==g||f.urlId!==y.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:f}),(!y||y.level!==g)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=f)}}},s(R,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var f=this.getAppendedFrag(E.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var f=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(M.default)},"./src/controller/subtitle-stream-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"SubtitleStreamController",function(){return i});var G=U("./src/events.ts"),M=U("./src/utils/logger.ts"),k=U("./src/utils/buffer-helper.ts"),K=U("./src/controller/fragment-finders.ts"),I=U("./src/utils/discontinuities.ts"),r=U("./src/controller/level-helper.ts"),P=U("./src/controller/fragment-tracker.ts"),_=U("./src/controller/base-stream-controller.ts"),p=U("./src/types/loader.ts"),m=U("./src/types/level.ts");function u(n,O){for(var T=0;T<O.length;T++){var w=O[T];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(n,w.key,w)}}function a(n,O,T){return O&&u(n.prototype,O),T&&u(n,T),n}function o(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,c(n,O)}function c(n,O){return c=Object.setPrototypeOf||function(w,R){return w.__proto__=R,w},c(n,O)}var s=500,i=function(n){o(O,n);function O(w,R){var S;return S=n.call(this,w,R,"[subtitle-stream-controller]")||this,S.levels=[],S.currentTrackId=-1,S.tracksBuffered=[],S.mainDetails=null,S._registerListeners(),S}var T=O.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var R=this.hls;R.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(G.Events.ERROR,this.onError,this),R.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var R=this.hls;R.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(G.Events.ERROR,this.onError,this),R.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=_.State.IDLE,this.setInterval(s),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(R,S){this.mainDetails=S.details},T.onSubtitleFragProcessed=function(R,S){var v=S.frag,E=S.success;if(this.fragPrevious=v,this.state=_.State.IDLE,!E)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var h,y=v.start,g=0;g<f.length;g++)if(y>=f[g].start&&y<=f[g].end){h=f[g];break}var x=v.start+v.duration;h?h.end=x:(h={start:y,end:x},f.push(h)),this.fragmentTracker.fragBuffered(v)},T.onBufferFlushing=function(R,S){var v=S.startOffset,E=S.endOffset;if(v===0&&E!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,h=this.levels;if(!h.length||!h[f]||!h[f].details)return;var y=h[f].details,g=y.targetduration,x=E-g;if(x<=0)return;S.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(j){for(var F=0;F<j.length;){if(j[F].end<=x){j.shift();continue}else if(j[F].start<x)j[F].start=x;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(v,x,p.PlaylistLevelType.SUBTITLE)}},T.onError=function(R,S){var v,E=S.frag;if(!E||E.type!==p.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=_.State.IDLE},T.onSubtitleTracksUpdated=function(R,S){var v=this,E=S.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(f){return new m.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){v.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(R,S){if(this.currentTrackId=S.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var v=this.levels[this.currentTrackId];v!=null&&v.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,v&&this.setInterval(s)},T.onSubtitleTrackLoaded=function(R,S){var v,E=S.details,f=S.id,h=this.currentTrackId,y=this.levels;if(!y.length)return;var g=y[h];if(f>=y.length||f!==h||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(v=g.details)!==null&&v!==void 0&&v.live){var x=this.mainDetails;if(E.deltaUpdateFailed||!x)return;var j=x.fragments[0];if(!g.details)E.hasProgramDateTime&&x.hasProgramDateTime?Object(I.alignMediaPlaylistByPDT)(E,x):j&&Object(r.addSliding)(E,j.start);else{var F=this.alignPlaylists(E,g.details);F===0&&j&&Object(r.addSliding)(E,j.start)}}if(g.details=E,this.levelLastLoaded=f,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===_.State.IDLE){var A=Object(K.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},T._handleFragmentLoadComplete=function(R){var S=R.frag,v=R.payload,E=S.decryptdata,f=this.hls;if(this.fragContextChanged(S))return;if(v&&v.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),E.key.buffer,E.iv.buffer).then(function(y){var g=performance.now();f.trigger(G.Events.FRAG_DECRYPTED,{frag:S,payload:y,stats:{tstart:h,tdecrypt:g}})})}},T.doTick=function(){if(!this.media){this.state=_.State.IDLE;return}if(this.state===_.State.IDLE){var R,S=this.currentTrackId,v=this.levels;if(!v.length||!v[S]||!v[S].details)return;var E=v[S].details,f=E.targetduration,h=this.config,y=this.media,g=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,y.currentTime-f,h.maxBufferHole),x=g.end,j=g.len,F=this.getMaxBufferLength()+f;if(j>F)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var A=E.fragments,W=A.length,H=E.edge,C,z=this.fragPrevious;if(x<H){var Z=h.maxFragLookUpTolerance;z&&E.hasProgramDateTime&&(C=Object(K.findFragmentByPDT)(A,z.endProgramDateTime,Z)),C||(C=Object(K.findFragmentByPTS)(z,A,x,Z),!C&&z&&z.start<A[0].start&&(C=A[0]))}else C=A[W-1];(R=C)!==null&&R!==void 0&&R.encrypted?(M.logger.log("Loading key for "+C.sn),this.state=_.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:C})):C&&this.fragmentTracker.getState(C)===P.FragmentState.NOT_LOADED&&this.loadFragment(C,E,x)}},T.loadFragment=function(R,S,v){this.fragCurrent=R,n.prototype.loadFragment.call(this,R,S,v)},a(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(_.default)},"./src/controller/subtitle-track-controller.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/events.ts"),M=U("./src/utils/texttrack-utils.ts"),k=U("./src/controller/base-playlist-controller.ts"),K=U("./src/types/loader.ts");function I(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function r(u,a,o){return a&&I(u.prototype,a),o&&I(u,o),u}function P(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,_(u,a)}function _(u,a){return _=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},_(u,a)}var p=function(u){P(a,u);function a(c){var s;return s=u.call(this,c,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var o=a.prototype;return o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},o.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(G.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(G.Events.ERROR,this.onError,this)},o.onMediaAttached=function(s,i){if(this.media=i.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)},o.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},o.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 s=m(this.media.textTracks);s.forEach(function(i){Object(M.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(s,i){this.tracks=i.subtitleTracks},o.onSubtitleTrackLoaded=function(s,i){var n=i.id,O=i.details,T=this.trackId,w=this.tracksInGroup[T];if(!w){this.warn("Invalid subtitle track id "+n);return}var R=w.details;w.details=i.details,this.log("subtitle track "+n+" loaded ["+O.startSN+"-"+O.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,i,R))},o.onLevelLoading=function(s,i){this.switchLevel(i.level)},o.onLevelSwitching=function(s,i){this.switchLevel(i.level)},o.switchLevel=function(s){var i=this.hls.levels[s];if(!(i!=null&&i.textGroupIds))return;var n=i.textGroupIds[i.urlId];if(this.groupId!==n){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(S){return!n||S.groupId===n});this.tracksInGroup=T;var w=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=n;var R={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,R),w!==-1&&this.setSubtitleTrack(w,O)}},o.findTrackId=function(s){for(var i=this.tracksInGroup,n=0;n<i.length;n++){var O=i[n];if((!this.selectDefaultTrack||O.default)&&(!s||s===O.name))return O.id}return-1},o.onError=function(s,i){if(u.prototype.onError.call(this,s,i),i.fatal||!i.context)return;i.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},o.loadPlaylist=function(s){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var n=i.id,O=i.groupId,T=i.url;if(s)try{T=s.addDirectives(T)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADING,{url:T,id:n,groupId:O,deliveryDirectives:s||null})}},o.toggleTrackModes=function(s){var i=this,n=this.media,O=this.subtitleDisplay,T=this.trackId;if(!n)return;var w=m(n.textTracks),R=w.filter(function(E){return E.groupId===i.groupId});if(s===-1)[].slice.call(w).forEach(function(E){E.mode="disabled"});else{var S=R[T];S&&(S.mode="disabled")}var v=R[s];v&&(v.mode=O?"showing":"hidden")},o.setSubtitleTrack=function(s,i){var n,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(n=O[s])!==null&&n!==void 0&&n.details)||s<-1||s>=O.length)return;this.clearTimer();var T=O[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,T){var w=T.id,R=T.groupId,S=R===void 0?"":R,v=T.name,E=T.type,f=T.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:S,name:v,type:E,url:f});var h=this.switchParams(T.url,i==null?void 0:i.details);this.loadPlaylist(h)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:s})},o.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,i=m(this.media.textTracks),n=0;n<i.length;n++)if(i[n].mode==="hidden")s=n;else if(i[n].mode==="showing"){s=n;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},r(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,i)}}]),a}(k.default);function m(u){for(var a=[],o=0;o<u.length;o++){var c=u[o];c.kind==="subtitles"&&c.label&&a.push(u[o])}return a}Y.default=p},"./src/controller/timeline-controller.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"TimelineController",function(){return m});var G=U("./src/polyfills/number.ts"),M=U("./src/events.ts"),k=U("./src/utils/cea-608-parser.ts"),K=U("./src/utils/output-filter.ts"),I=U("./src/utils/webvtt-parser.ts"),r=U("./src/utils/texttrack-utils.ts"),P=U("./src/utils/imsc1-ttml-parser.ts"),_=U("./src/types/loader.ts"),p=U("./src/utils/logger.ts"),m=function(){function c(i){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=o(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.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 n=new K.default(this,"textTrack1"),O=new K.default(this,"textTrack2"),T=new K.default(this,"textTrack3"),w=new K.default(this,"textTrack4");this.cea608Parser1=new k.default(1,n,O),this.cea608Parser2=new k.default(3,T,w)}i.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(M.Events.FRAG_LOADING,this.onFragLoading,this),i.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=c.prototype;return s.destroy=function(){var n=this.hls;n.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.off(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.off(M.Events.FRAG_LOADING,this.onFragLoading,this),n.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.off(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(n,O,T,w,R){for(var S=!1,v=R.length;v--;){var E=R[v],f=a(E[0],E[1],O,T);if(f>=0&&(E[0]=Math.min(E[0],O),E[1]=Math.max(E[1],T),S=!0,f/(T-O)>.5))return}if(S||R.push([O,T]),this.config.renderTextTracksNatively){var h=this.captionsTracks[n];this.Cues.newCue(h,O,T,w)}else{var y=this.Cues.newCue(null,O,T,w);this.hls.trigger(M.Events.CUES_PARSED,{type:"captions",cues:y,track:n})}},s.onInitPtsFound=function(n,O){var T=this,w=O.frag,R=O.id,S=O.initPTS,v=O.timescale,E=this.unparsedVttFrags;R==="main"&&(this.initPTS[w.cc]=S,this.timescale[w.cc]=v),E.length&&(this.unparsedVttFrags=[],E.forEach(function(f){T.onFragLoaded(M.Events.FRAG_LOADED,f)}))},s.getExistingTrack=function(n){var O=this.media;if(O)for(var T=0;T<O.textTracks.length;T++){var w=O.textTracks[T];if(w[n])return w}return null},s.createCaptionsTrack=function(n){this.config.renderTextTracksNatively?this.createNativeTrack(n):this.createNonNativeTrack(n)},s.createNativeTrack=function(n){if(this.captionsTracks[n])return;var O=this.captionsProperties,T=this.captionsTracks,w=this.media,R=O[n],S=R.label,v=R.languageCode,E=this.getExistingTrack(n);if(E)T[n]=E,Object(r.clearCurrentCues)(T[n]),Object(r.sendAddTrackEvent)(T[n],w);else{var f=this.createTextTrack("captions",S,v);f&&(f[n]=!0,T[n]=f)}},s.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var O=this.captionsProperties[n];if(!O)return;var T=O.label,w={_id:n,label:T,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[n]=w,this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[w]})},s.createTextTrack=function(n,O,T){var w=this.media;return w?w.addTextTrack(n,O,T):void 0},s.onMediaAttaching=function(n,O){this.media=O.media,this._cleanTracks()},s.onMediaDetaching=function(){var n=this.captionsTracks;Object.keys(n).forEach(function(O){Object(r.clearCurrentCues)(n[O]),delete n[O]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),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())},s._cleanTracks=function(){var n=this.media;if(!n)return;var O=n.textTracks;if(O)for(var T=0;T<O.length;T++)Object(r.clearCurrentCues)(O[T])},s.onSubtitleTracksUpdated=function(n,O){var T=this;this.textTracks=[];var w=O.subtitleTracks||[],R=w.some(function(f){return f.textCodec===P.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var S=this.tracks&&w&&this.tracks.length===w.length;if(this.tracks=w||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,h){var y;if(h<v.length){for(var g=null,x=0;x<v.length;x++)if(u(v[x],f)){g=v[x];break}g&&(y=g)}y?Object(r.clearCurrentCues)(y):(y=T.createTextTrack("subtitles",f.name,f.lang),y&&(y.mode="disabled")),y&&(y.groupId=f.groupId,T.textTracks.push(y))})}else if(!S&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},s.onManifestLoaded=function(n,O){var T=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(w){var R=/(?:CC|SERVICE)([1-4])/.exec(w.instreamId);if(!R)return;var S="textTrack"+R[1],v=T.captionsProperties[S];if(!v)return;v.label=w.name,w.lang&&(v.languageCode=w.lang),v.media=w})},s.onFragLoading=function(n,O){var T=this.cea608Parser1,w=this.cea608Parser2,R=this.lastSn,S=this.lastPartIndex;if(!this.enabled||!(T&&w))return;if(O.frag.type===_.PlaylistLevelType.MAIN){var v,E,f=O.frag.sn,h=(v=O==null||((E=O.part)===null||E===void 0)?void 0:E.index)!=null?v:-1;f===R+1||f===R&&h===S+1||(T.reset(),w.reset()),this.lastSn=f,this.lastPartIndex=h}},s.onFragLoaded=function(n,O){var T=O.frag,w=O.payload,R=this.initPTS,S=this.unparsedVttFrags;if(T.type===_.PlaylistLevelType.SUBTITLE)if(w.byteLength){if(!Object(G.isFiniteNumber)(R[T.cc])){S.push(O),R.length&&this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var v=T.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var E=this.tracks[T.level],f=this.vttCCs;f[T.cc]||(f[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),E&&E.textCodec===P.IMSC1_CODEC?this._parseIMSC1(T,w):this._parseVTTs(T,w,f)}}else this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(n,O){var T=this,w=this.hls;Object(P.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(R){T._appendCues(R,n.level),w.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(R){p.logger.log("Failed to parse IMSC1: "+R),w.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:R})})},s._parseVTTs=function(n,O,T){var w=this,R=this.hls;Object(I.parseWebVTT)(O,this.initPTS[n.cc],this.timescale[n.cc],T,n.cc,n.start,function(S){w._appendCues(S,n.level),R.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(S){w._fallbackToIMSC1(n,O),p.logger.log("Failed to parse VTT cue: "+S),R.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:S})})},s._fallbackToIMSC1=function(n,O){var T=this,w=this.tracks[n.level];w.textCodec||Object(P.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(){w.textCodec=P.IMSC1_CODEC,T._parseIMSC1(n,O)},function(){w.textCodec="wvtt"})},s._appendCues=function(n,O){var T=this.hls;if(this.config.renderTextTracksNatively){var w=this.textTracks[O];if(w.mode==="disabled")return;n.forEach(function(v){return Object(r.addCueToTrack)(w,v)})}else{var R=this.tracks[O],S=R.default?"default":"subtitles"+O;T.trigger(M.Events.CUES_PARSED,{type:"subtitles",cues:n,track:S})}},s.onFragDecrypted=function(n,O){var T=O.frag;if(T.type===_.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(M.Events.FRAG_LOADED,O)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(n,O){var T=this.cea608Parser1,w=this.cea608Parser2;if(!this.enabled||!(T&&w))return;for(var R=0;R<O.samples.length;R++){var S=O.samples[R].bytes;if(S){var v=this.extractCea608Data(S);T.addData(O.samples[R].pts,v[0]),w.addData(O.samples[R].pts,v[1])}}},s.onBufferFlushing=function(n,O){var T=O.startOffset,w=O.endOffset,R=O.endOffsetSubtitles,S=O.type,v=this.media;if(!v||v.currentTime<w)return;if(!S||S==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(h){return Object(r.removeCuesInRange)(E[h],T,w)})}if(this.config.renderTextTracksNatively&&(T===0&&R!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(h){return Object(r.removeCuesInRange)(f[h],T,R)})}},s.extractCea608Data=function(n){for(var O=n[0]&31,T=2,w=[[],[]],R=0;R<O;R++){var S=n[T++],v=127&n[T++],E=127&n[T++],f=(4&S)!==0,h=3&S;if(v===0&&E===0)continue;f&&((h===0||h===1)&&(w[h].push(v),w[h].push(E)))}return w},c}();function u(c,s){return c&&c.label===s.name&&!(c.textTrack1||c.textTrack2)}function a(c,s,i,n){return Math.min(s,n)-Math.max(c,i)}function o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return G});var G=function(){function M(K,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=I}var k=M.prototype;return k.decrypt=function(I,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,I)},M}()},"./src/crypt/aes-decryptor.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"removePadding",function(){return M}),U.d(Y,"default",function(){return k});var G=U("./src/utils/typed-array.ts");function M(K){var I=K.byteLength,r=I&&new DataView(K.buffer).getUint8(I-1);return r?Object(G.sliceUint8)(K,0,I-r):K}var k=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 I=K.prototype;return I.uint8ArrayToUint32Array_=function(P){for(var _=new DataView(P),p=new Uint32Array(4),m=0;m<4;m++)p[m]=_.getUint32(m*4);return p},I.initTable=function(){var P=this.sBox,_=this.invSBox,p=this.subMix,m=p[0],u=p[1],a=p[2],o=p[3],c=this.invSubMix,s=c[0],i=c[1],n=c[2],O=c[3],T=new Uint32Array(256),w=0,R=0,S=0;for(S=0;S<256;S++)S<128?T[S]=S<<1:T[S]=S<<1^283;for(S=0;S<256;S++){var v=R^R<<1^R<<2^R<<3^R<<4;v=v>>>8^v&255^99,P[w]=v,_[v]=w;var E=T[w],f=T[E],h=T[f],y=T[v]*257^v*16843008;m[w]=y<<24|y>>>8,u[w]=y<<16|y>>>16,a[w]=y<<8|y>>>24,o[w]=y,y=h*16843009^f*65537^E*257^w*16843008,s[v]=y<<24|y>>>8,i[v]=y<<16|y>>>16,n[v]=y<<8|y>>>24,O[v]=y,w?(w=E^T[T[T[h^E]]],R^=T[T[R]]):w=R=1}},I.expandKey=function(P){for(var _=this.uint8ArrayToUint32Array_(P),p=!0,m=0;m<_.length&&p;)p=_[m]===this.key[m],m++;if(p)return;this.key=_;var u=this.keySize=_.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var a=this.ksRows=(u+6+1)*4,o,c,s=this.keySchedule=new Uint32Array(a),i=this.invKeySchedule=new Uint32Array(a),n=this.sBox,O=this.rcon,T=this.invSubMix,w=T[0],R=T[1],S=T[2],v=T[3],E,f;for(o=0;o<a;o++){if(o<u){E=s[o]=_[o];continue}f=E,o%u===0?(f=f<<8|f>>>24,f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255],f^=O[o/u|0]<<24):u>6&&o%u===4&&(f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255]),s[o]=E=(s[o-u]^f)>>>0}for(c=0;c<a;c++)o=a-c,c&3?f=s[o]:f=s[o-4],c<4||o<=4?i[c]=f:i[c]=w[n[f>>>24]]^R[n[f>>>16&255]]^S[n[f>>>8&255]]^v[n[f&255]],i[c]=i[c]>>>0},I.networkToHostOrderSwap=function(P){return P<<24|(P&65280)<<8|(P&16711680)>>8|P>>>24},I.decrypt=function(P,_,p){for(var m=this.keySize+6,u=this.invKeySchedule,a=this.invSBox,o=this.invSubMix,c=o[0],s=o[1],i=o[2],n=o[3],O=this.uint8ArrayToUint32Array_(p),T=O[0],w=O[1],R=O[2],S=O[3],v=new Int32Array(P),E=new Int32Array(v.length),f,h,y,g,x,j,F,A,W,H,C,z,Z,le,se=this.networkToHostOrderSwap;_<v.length;){for(W=se(v[_]),H=se(v[_+1]),C=se(v[_+2]),z=se(v[_+3]),x=W^u[0],j=z^u[1],F=C^u[2],A=H^u[3],Z=4,le=1;le<m;le++)f=c[x>>>24]^s[j>>16&255]^i[F>>8&255]^n[A&255]^u[Z],h=c[j>>>24]^s[F>>16&255]^i[A>>8&255]^n[x&255]^u[Z+1],y=c[F>>>24]^s[A>>16&255]^i[x>>8&255]^n[j&255]^u[Z+2],g=c[A>>>24]^s[x>>16&255]^i[j>>8&255]^n[F&255]^u[Z+3],x=f,j=h,F=y,A=g,Z=Z+4;f=a[x>>>24]<<24^a[j>>16&255]<<16^a[F>>8&255]<<8^a[A&255]^u[Z],h=a[j>>>24]<<24^a[F>>16&255]<<16^a[A>>8&255]<<8^a[x&255]^u[Z+1],y=a[F>>>24]<<24^a[A>>16&255]<<16^a[x>>8&255]<<8^a[j&255]^u[Z+2],g=a[A>>>24]<<24^a[x>>16&255]<<16^a[j>>8&255]<<8^a[F&255]^u[Z+3],E[_]=se(f^T),E[_+1]=se(g^w),E[_+2]=se(y^R),E[_+3]=se(h^S),T=W,w=H,R=C,S=z,_=_+4}return E.buffer},K}()},"./src/crypt/decrypter.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return _});var G=U("./src/crypt/aes-crypto.ts"),M=U("./src/crypt/fast-aes-key.ts"),k=U("./src/crypt/aes-decryptor.ts"),K=U("./src/utils/logger.ts"),I=U("./src/utils/mp4-tools.ts"),r=U("./src/utils/typed-array.ts"),P=16,_=function(){function p(u,a,o){var c=o===void 0?{}:o,s=c.removePKCS7Padding,i=s===void 0?!0:s;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=u,this.config=a,this.removePKCS7Padding=i,i)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=p.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var o=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(k.removePadding)(o):o},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(a,o,c,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),o,c);var i=this.flush();i&&s(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),o,c).then(s)},m.softwareDecrypt=function(a,o,c){var s=this.currentIV,i=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(a=Object(I.appendUint8Array)(n,a),this.remainderData=null);var O=this.getValidChunk(a);if(!O.length)return null;s&&(c=s);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new k.default),T.expandKey(o);var w=i;return this.currentResult=T.decrypt(O.buffer,0,c),this.currentIV=Object(r.sliceUint8)(O,-16).buffer,w||null},m.webCryptoDecrypt=function(a,o,c){var s=this,i=this.subtle;return(this.key!==o||!this.fastAesKey)&&(this.key=o,this.fastAesKey=new M.default(i,o)),this.fastAesKey.expandKey().then(function(n){if(!i)return Promise.reject(new Error("web crypto not initialized"));var O=new G.default(i,c);return O.decrypt(a.buffer,n)}).catch(function(n){return s.onWebCryptoError(n,a,o,c)})},m.onWebCryptoError=function(a,o,c,s){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(o,c,s)},m.getValidChunk=function(a){var o=a,c=a.length-a.length%P;return c!==a.length&&(o=Object(r.sliceUint8)(a,0,c),this.remainderData=Object(r.sliceUint8)(a,c)),o},m.logOnce=function(a){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return G});var G=function(){function M(K,I){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=I}var k=M.prototype;return k.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},M}()},"./src/demux/aacdemuxer.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/demux/base-audio-demuxer.ts"),M=U("./src/demux/adts.ts"),k=U("./src/utils/logger.ts"),K=U("./src/demux/id3.ts");function I(_,p){_.prototype=Object.create(p.prototype),_.prototype.constructor=_,r(_,p)}function r(_,p){return r=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},r(_,p)}var P=function(_){I(p,_);function p(u,a){var o;return o=_.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=u,o.config=a,o}var m=p.prototype;return m.resetInitSegment=function(a,o,c){_.prototype.resetInitSegment.call(this,a,o,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:c,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var o=K.getID3Data(a,0)||[],c=o.length,s=a.length;c<s;c++)if(M.probe(a,c))return k.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(a,o){return M.canParse(a,o)},m.appendFrame=function(a,o,c){M.initTrackConfig(a,this.observer,o,c,a.manifestCodec);var s=M.appendFrame(a,o,c,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},p}(G.default);P.minProbeByteLength=9,Y.default=P},"./src/demux/adts.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"getAudioConfig",function(){return K}),U.d(Y,"isHeaderPattern",function(){return I}),U.d(Y,"getHeaderLength",function(){return r}),U.d(Y,"getFullFrameLength",function(){return P}),U.d(Y,"canGetFrameLength",function(){return _}),U.d(Y,"isHeader",function(){return p}),U.d(Y,"canParse",function(){return m}),U.d(Y,"probe",function(){return u}),U.d(Y,"initTrackConfig",function(){return a}),U.d(Y,"getFrameDuration",function(){return o}),U.d(Y,"parseFrameHeader",function(){return c}),U.d(Y,"appendFrame",function(){return s});var G=U("./src/utils/logger.ts"),M=U("./src/errors.ts"),k=U("./src/events.ts");function K(i,n,O,T){var w,R,S,v,E=navigator.userAgent.toLowerCase(),f=T,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];w=((n[O+2]&192)>>>6)+1;var y=(n[O+2]&60)>>>2;if(y>h.length-1){i.trigger(k.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+y});return}return S=(n[O+2]&1)<<2,S|=(n[O+3]&192)>>>6,G.logger.log("manifest codec:"+T+", ADTS type:"+w+", samplingIndex:"+y),/firefox/i.test(E)?y>=6?(w=5,v=new Array(4),R=y-3):(w=2,v=new Array(2),R=y):E.indexOf("android")!==-1?(w=2,v=new Array(2),R=y):(w=5,v=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&y>=6?R=y-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(y>=6&&S===1||/vivaldi/i.test(E))||!T&&S===1)&&(w=2,v=new Array(2)),R=y)),v[0]=w<<3,v[0]|=(y&14)>>1,v[1]|=(y&1)<<7,v[1]|=S<<3,w===5&&(v[1]|=(R&14)>>1,v[2]=(R&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:h[y],channelCount:S,codec:"mp4a.40."+w,manifestCodec:f}}function I(i,n){return i[n]===255&&(i[n+1]&246)===240}function r(i,n){return i[n+1]&1?7:9}function P(i,n){return(i[n+3]&3)<<11|i[n+4]<<3|(i[n+5]&224)>>>5}function _(i,n){return n+5<i.length}function p(i,n){return n+1<i.length&&I(i,n)}function m(i,n){return _(i,n)&&I(i,n)&&P(i,n)<=i.length-n}function u(i,n){if(p(i,n)){var O=r(i,n);if(n+O>=i.length)return!1;var T=P(i,n);if(T<=O)return!1;var w=n+T;return w===i.length||p(i,w)}return!1}function a(i,n,O,T,w){if(!i.samplerate){var R=K(n,O,T,w);if(!R)return;i.config=R.config,i.samplerate=R.samplerate,i.channelCount=R.channelCount,i.codec=R.codec,i.manifestCodec=R.manifestCodec,G.logger.log("parsed codec:"+i.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function o(i){return 1024*9e4/i}function c(i,n,O,T,w){var R=r(i,n),S=P(i,n);if(S-=R,S>0){var v=O+T*w;return{headerLength:R,frameLength:S,stamp:v}}}function s(i,n,O,T,w){var R=o(i.samplerate),S=c(n,O,T,w,R);if(S){var v=S.frameLength,E=S.headerLength,f=S.stamp,h=E+v,y=Math.max(0,O+h-n.length),g;y?(g=new Uint8Array(h-E),g.set(n.subarray(O+E,n.length),0)):g=n.subarray(O+E,O+h);var x={unit:g,pts:f};return y||i.samples.push(x),{sample:x,length:h,missing:y}}}},"./src/demux/base-audio-demuxer.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"initPTSFn",function(){return P});var G=U("./src/polyfills/number.ts"),M=U("./src/demux/id3.ts"),k=U("./src/demux/dummy-demuxed-track.ts"),K=U("./src/utils/mp4-tools.ts"),I=U("./src/utils/typed-array.ts"),r=function(){function _(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=_.prototype;return p.resetInitSegment=function(u,a,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(u,a){return!1},p.appendFrame=function(u,a,o){},p.demux=function(u,a){this.cachedData&&(u=Object(K.appendUint8Array)(this.cachedData,u),this.cachedData=null);var o=M.getID3Data(u,0),c=o?o.length:0,s,i,n=this._audioTrack,O=this._id3Track,T=o?M.getTimeStamp(o):void 0,w=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(T,a)),o&&o.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:o}),i=this.initPTS;c<w;){if(this.canParse(u,c)){var R=this.appendFrame(n,u,c);R?(this.frameIndex++,i=R.sample.pts,c+=R.length,s=c):c=w}else M.canParse(u,c)?(o=M.getID3Data(u,c),O.samples.push({pts:i,dts:i,data:o}),c+=o.length,s=c):c++;if(c===w&&s!==w){var S=Object(I.sliceUint8)(u,s);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,S):this.cachedData=S}}return{audioTrack:n,avcTrack:Object(k.dummyTrack)(),id3Track:O,textTrack:Object(k.dummyTrack)()}},p.demuxSampleAes=function(u,a,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(u){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(k.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(k.dummyTrack)()}},p.destroy=function(){},_}(),P=function(p,m){return Object(G.isFiniteNumber)(p)?p*90:m*9e4};Y.default=r},"./src/demux/chunk-cache.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return G});var G=function(){function k(){this.chunks=[],this.dataLength=0}var K=k.prototype;return K.push=function(r){this.chunks.push(r),this.dataLength+=r.length},K.flush=function(){var r=this.chunks,P=this.dataLength,_;if(r.length)r.length===1?_=r[0]:_=M(r,P);else return new Uint8Array(0);return this.reset(),_},K.reset=function(){this.chunks.length=0,this.dataLength=0},k}();function M(k,K){for(var I=new Uint8Array(K),r=0,P=0;P<k.length;P++){var _=k[P];I.set(_,r),r+=_.length}return I}},"./src/demux/dummy-demuxed-track.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"dummyTrack",function(){return G});function G(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/utils/logger.ts"),M=function(){function k(I){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=I,this.bytesAvailable=I.byteLength,this.word=0,this.bitsAvailable=0}var K=k.prototype;return K.loadWord=function(){var r=this.data,P=this.bytesAvailable,_=r.byteLength-P,p=new Uint8Array(4),m=Math.min(4,P);if(m===0)throw new Error("no bytes available");p.set(r.subarray(_,_+m)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},K.skipBits=function(r){var P;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,P=r>>3,r-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var P=Math.min(this.bitsAvailable,r),_=this.word>>>32-P;return r>32&&G.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=r-P,P>0&&this.bitsAvailable?_<<P|this.readBits(P):_},K.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var P=8,_=8,p,m=0;m<r;m++)_!==0&&(p=this.readEG(),_=(P+p+256)%256),P=_===0?P:_},K.readSPS=function(){var r=0,P=0,_=0,p=0,m,u,a,o=this.readUByte.bind(this),c=this.readBits.bind(this),s=this.readUEG.bind(this),i=this.readBoolean.bind(this),n=this.skipBits.bind(this),O=this.skipEG.bind(this),T=this.skipUEG.bind(this),w=this.skipScalingList.bind(this);o();var R=o();if(c(5),n(3),o(),T(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var S=s();if(S===3&&n(1),T(),T(),n(1),i())for(u=S!==3?8:12,a=0;a<u;a++)i()&&(a<6?w(16):w(64))}T();var v=s();if(v===0)s();else if(v===1)for(n(1),O(),O(),m=s(),a=0;a<m;a++)O();T(),n(1);var E=s(),f=s(),h=c(1);h===0&&n(1),n(1),i()&&(r=s(),P=s(),_=s(),p=s());var y=[1,1];if(i()&&i()){var g=o();switch(g){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:{y=[o()<<8|o(),o()<<8|o()];break}}}return{width:Math.ceil((E+1)*16-r*2-P*2),height:(2-h)*(f+1)*16-(h?2:4)*(_+p),pixelRatio:y}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},k}();Y.default=M},"./src/demux/id3.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"isHeader",function(){return G}),U.d(Y,"isFooter",function(){return M}),U.d(Y,"getID3Data",function(){return k}),U.d(Y,"canParse",function(){return I}),U.d(Y,"getTimeStamp",function(){return r}),U.d(Y,"isTimeStampFrame",function(){return P}),U.d(Y,"getID3Frames",function(){return p}),U.d(Y,"decodeFrame",function(){return m}),U.d(Y,"utf8ArrayToStr",function(){return s}),U.d(Y,"testables",function(){return i});var G=function(w,R){return R+10<=w.length&&(w[R]===73&&w[R+1]===68&&w[R+2]===51&&(w[R+3]<255&&w[R+4]<255&&(w[R+6]<128&&w[R+7]<128&&w[R+8]<128&&w[R+9]<128)))},M=function(w,R){return R+10<=w.length&&(w[R]===51&&w[R+1]===68&&w[R+2]===73&&(w[R+3]<255&&w[R+4]<255&&(w[R+6]<128&&w[R+7]<128&&w[R+8]<128&&w[R+9]<128)))},k=function(w,R){for(var S=R,v=0;G(w,R);){v+=10;var E=K(w,R+6);v+=E,M(w,R+10)&&(v+=10),R+=v}return v>0?w.subarray(S,S+v):void 0},K=function(w,R){var S=0;return S=(w[R]&127)<<21,S|=(w[R+1]&127)<<14,S|=(w[R+2]&127)<<7,S|=w[R+3]&127,S},I=function(w,R){return G(w,R)&&K(w,R+6)+10<=w.length-R},r=function(w){for(var R=p(w),S=0;S<R.length;S++){var v=R[S];if(P(v))return c(v)}return},P=function(w){return w&&w.key==="PRIV"&&w.info==="com.apple.streaming.transportStreamTimestamp"},_=function(w){var R=String.fromCharCode(w[0],w[1],w[2],w[3]),S=K(w,4),v=10;return{type:R,size:S,data:w.subarray(v,v+S)}},p=function(w){for(var R=0,S=[];G(w,R);){var v=K(w,R+6);R+=10;for(var E=R+v;R+8<E;){var f=_(w.subarray(R)),h=m(f);h&&S.push(h),R+=f.size+10}M(w,R)&&(R+=10)}return S},m=function(w){return w.type==="PRIV"?u(w):w.type[0]==="W"?o(w):a(w)},u=function(w){if(w.size<2)return;var R=s(w.data,!0),S=new Uint8Array(w.data.subarray(R.length+1));return{key:w.type,info:R,data:S.buffer}},a=function(w){if(w.size<2)return;if(w.type==="TXXX"){var R=1,S=s(w.data.subarray(R),!0);R+=S.length+1;var v=s(w.data.subarray(R));return{key:w.type,info:S,data:v}}var E=s(w.data.subarray(1));return{key:w.type,data:E}},o=function(w){if(w.type==="WXXX"){if(w.size<2)return;var R=1,S=s(w.data.subarray(R),!0);R+=S.length+1;var v=s(w.data.subarray(R));return{key:w.type,info:S,data:v}}var E=s(w.data);return{key:w.type,data:E}},c=function(w){if(w.data.byteLength===8){var R=new Uint8Array(w.data),S=R[3]&1,v=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return v/=45,S&&(v+=4772185884e-2),Math.round(v)}return},s=function(w,R){R===void 0&&(R=!1);var S=O();if(S){var v=S.decode(w);if(R){var E=v.indexOf("\0");return E!==-1?v.substring(0,E):v}return v.replace(/\0/g,"")}for(var f=w.length,h,y,g,x="",j=0;j<f;){if(h=w[j++],h===0&&R)return x;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(h);break;case 12:case 13:y=w[j++],x+=String.fromCharCode((h&31)<<6|y&63);break;case 14:y=w[j++],g=w[j++],x+=String.fromCharCode((h&15)<<12|(y&63)<<6|(g&63)<<0);break;default:}}return x},i={decodeTextFrame:a},n;function O(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/demux/base-audio-demuxer.ts"),M=U("./src/demux/id3.ts"),k=U("./src/utils/logger.ts"),K=U("./src/demux/mpegaudio.ts");function I(_,p){_.prototype=Object.create(p.prototype),_.prototype.constructor=_,r(_,p)}function r(_,p){return r=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},r(_,p)}var P=function(_){I(p,_);function p(){return _.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(a,o,c){_.prototype.resetInitSegment.call(this,a,o,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:c,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var o=M.getID3Data(a,0)||[],c=o.length,s=a.length;c<s;c++)if(K.probe(a,c))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(a,o){return K.canParse(a,o)},m.appendFrame=function(a,o,c){return this.initPTS===null?void 0:K.appendFrame(a,o,c,this.initPTS,this.frameIndex)},p}(G.default);P.minProbeByteLength=4,Y.default=P},"./src/demux/mp4demuxer.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/utils/mp4-tools.ts"),M=U("./src/demux/dummy-demuxed-track.ts"),k=function(){function K(r,P){this.remainderData=null,this.config=void 0,this.config=P}var I=K.prototype;return I.resetTimeStamp=function(){},I.resetInitSegment=function(){},I.resetContiguity=function(){},K.probe=function(P){return Object(G.findBox)({data:P,start:0,end:Math.min(P.length,16384)},["moof"]).length>0},I.demux=function(P){var _=P,p=Object(M.dummyTrack)();if(this.config.progressive){this.remainderData&&(_=Object(G.appendUint8Array)(this.remainderData,P));var m=Object(G.segmentValidRange)(_);this.remainderData=m.remainder,p.samples=m.valid||new Uint8Array}else p.samples=_;return{audioTrack:Object(M.dummyTrack)(),avcTrack:p,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},I.flush=function(){var P=Object(M.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(M.dummyTrack)(),avcTrack:P,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},I.demuxSampleAes=function(P,_,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},I.destroy=function(){},K}();k.minProbeByteLength=1024,Y.default=k},"./src/demux/mpegaudio.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"appendFrame",function(){return r}),U.d(Y,"parseHeader",function(){return P}),U.d(Y,"isHeaderPattern",function(){return _}),U.d(Y,"isHeader",function(){return p}),U.d(Y,"canParse",function(){return m}),U.d(Y,"probe",function(){return u});var G=null,M=[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],k=[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]],I=[0,1,1,4];function r(a,o,c,s,i){if(c+24>o.length)return;var n=P(o,c);if(n&&c+n.frameLength<=o.length){var O=n.samplesPerFrame*9e4/n.sampleRate,T=s+i*O,w={unit:o.subarray(c,c+n.frameLength),pts:T,dts:T};return a.config=[],a.channelCount=n.channelCount,a.samplerate=n.sampleRate,a.samples.push(w),{sample:w,length:n.frameLength,missing:0}}}function P(a,o){var c=a[o+1]>>3&3,s=a[o+1]>>1&3,i=a[o+2]>>4&15,n=a[o+2]>>2&3;if(c!==1&&i!==0&&i!==15&&n!==3){var O=a[o+2]>>1&1,T=a[o+3]>>6,w=c===3?3-s:s===3?3:4,R=M[w*14+i-1]*1e3,S=c===3?0:c===2?1:2,v=k[S*3+n],E=T===3?1:2,f=K[c][s],h=I[s],y=f*8*h,g=Math.floor(f*R/v+O)*h;if(G===null){var x=navigator.userAgent||"",j=x.match(/Chrome\/(\d+)/i);G=j?parseInt(j[1]):0}var F=!!G&&G<=87;return F&&s===2&&R>=224e3&&T===0&&(a[o+3]=a[o+3]|128),{sampleRate:v,channelCount:E,frameLength:g,samplesPerFrame:y}}}function _(a,o){return a[o]===255&&(a[o+1]&224)===224&&(a[o+1]&6)!==0}function p(a,o){return o+1<a.length&&_(a,o)}function m(a,o){var c=4;return _(a,o)&&c<=a.length-o}function u(a,o){if(o+1<a.length&&_(a,o)){var c=4,s=P(a,o),i=c;s!=null&&s.frameLength&&(i=s.frameLength);var n=o+i;return n===a.length||p(a,n)}return!1}},"./src/demux/sample-aes.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/crypt/decrypter.ts"),M=U("./src/demux/tsdemuxer.ts"),k=function(){function K(r,P,_){this.keyData=void 0,this.decrypter=void 0,this.keyData=_,this.decrypter=new G.default(r,P,{removePKCS7Padding:!1})}var I=K.prototype;return I.decryptBuffer=function(P,_){this.decrypter.decrypt(P,this.keyData.key.buffer,this.keyData.iv.buffer,_)},I.decryptAacSample=function(P,_,p,m){var u=P[_].unit,a=u.subarray(16,u.length-u.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),c=this;this.decryptBuffer(o,function(s){var i=new Uint8Array(s);u.set(i,16),m||c.decryptAacSamples(P,_+1,p)})},I.decryptAacSamples=function(P,_,p){for(;;_++){if(_>=P.length){p();return}if(P[_].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(P,_,p,m),!m)return}},I.getAvcEncryptedData=function(P){for(var _=Math.floor((P.length-48)/160)*16+16,p=new Int8Array(_),m=0,u=32;u<=P.length-16;u+=160,m+=16)p.set(P.subarray(u,u+16),m);return p},I.getAvcDecryptedUnit=function(P,_){for(var p=new Uint8Array(_),m=0,u=32;u<=P.length-16;u+=160,m+=16)P.set(p.subarray(m,m+16),u);return P},I.decryptAvcSample=function(P,_,p,m,u,a){var o=Object(M.discardEPB)(u.data),c=this.getAvcEncryptedData(o),s=this;this.decryptBuffer(c.buffer,function(i){u.data=s.getAvcDecryptedUnit(o,i),a||s.decryptAvcSamples(P,_,p+1,m)})},I.decryptAvcSamples=function(P,_,p,m){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;_++,p=0){if(_>=P.length){m();return}for(var u=P[_].units;!(p>=u.length);p++){var a=u[p];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var o=this.decrypter.isSync();if(this.decryptAvcSample(P,_,p,m,a,o),!o)return}}},K}();Y.default=k},"./src/demux/transmuxer-interface.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return u});var G=U("./node_modules/webworkify-webpack/index.js"),M=U.n(G),k=U("./src/events.ts"),K=U("./src/demux/transmuxer.ts"),I=U("./src/utils/logger.ts"),r=U("./src/errors.ts"),P=U("./src/utils/mediasource-helper.ts"),_=U("./node_modules/eventemitter3/index.js"),p=U.n(_),m=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function a(c,s,i,n){var O=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=c,this.id=s,this.onTransmuxComplete=i,this.onFlush=n;var T=c.config,w=function(f,h){h=h||{},h.frag=O.frag,h.id=O.id,c.trigger(f,h)};this.observer=new _.EventEmitter,this.observer.on(k.Events.FRAG_DECRYPTED,w),this.observer.on(k.Events.ERROR,w);var R={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){I.logger.log("demuxing in webworker");var v;try{v=this.worker=G("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(E){c.trigger(k.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},v.postMessage({cmd:"init",typeSupported:R,vendor:S,id:s,config:JSON.stringify(T)})}catch(E){I.logger.warn("Error in worker:",E),I.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new K.default(this.observer,R,T,S,s),this.worker=null}}else this.transmuxer=new K.default(this.observer,R,T,S,s)}var o=a.prototype;return o.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},o.push=function(s,i,n,O,T,w,R,S,v,E){var f=this;v.transmuxing.start=self.performance.now();var h=this.transmuxer,y=this.worker,g=w?w.start:T.start,x=T.decryptdata,j=this.frag,F=!(j&&T.cc===j.cc),A=!(j&&v.level===j.level),W=j?v.sn-j.sn:-1,H=this.part?v.part-this.part.index:1,C=!A&&(W===1||W===0&&H===1),z=self.performance.now();(A||W||T.stats.parsing.start===0)&&(T.stats.parsing.start=z),w&&(H||!C)&&(w.stats.parsing.start=z);var Z=new K.TransmuxState(F,C,S,A,g);if(!C||F){I.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
|
|
discontinuity: `+F+`
|
|
trackSwitch: `+A+`
|
|
contiguous: `+C+`
|
|
accurateTimeOffset: `+S+`
|
|
timeOffset: `+g);var le=new K.TransmuxConfig(n,O,i,R,E);this.configureTransmuxer(le)}if(this.frag=T,this.part=w,y)y.postMessage({cmd:"demux",data:s,decryptdata:x,chunkMeta:v,state:Z},s instanceof ArrayBuffer?[s]:[]);else if(h){var se=h.push(s,x,v,Z);Object(K.isPromise)(se)?se.then(function(Ce){f.handleTransmuxComplete(Ce)}):this.handleTransmuxComplete(se)}},o.flush=function(s){var i=this;s.transmuxing.start=self.performance.now();var n=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:s});else if(n){var T=n.flush(s);Object(K.isPromise)(T)?T.then(function(w){i.handleFlushResult(w,s)}):this.handleFlushResult(T,s)}},o.handleFlushResult=function(s,i){var n=this;s.forEach(function(O){n.handleTransmuxComplete(O)}),this.onFlush(i)},o.onWorkerMessage=function(s){var i=s.data,n=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,n.trigger(i.event,i.data);break}}},o.configureTransmuxer=function(s){var i=this.worker,n=this.transmuxer;i?i.postMessage({cmd:"configure",config:s}):n&&n.configure(s)},o.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},a}()},"./src/demux/transmuxer-worker.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return r});var G=U("./src/demux/transmuxer.ts"),M=U("./src/events.ts"),k=U("./src/utils/logger.ts"),K=U("./node_modules/eventemitter3/index.js"),I=U.n(K);function r(u){var a=new K.EventEmitter,o=function(s,i){u.postMessage({event:s,data:i})};a.on(M.Events.FRAG_DECRYPTED,o),a.on(M.Events.ERROR,o),u.addEventListener("message",function(c){var s=c.data;switch(s.cmd){case"init":{var i=JSON.parse(s.config);u.transmuxer=new G.default(a,s.typeSupported,i,s.vendor,s.id),Object(k.enableLogs)(i.debug),o("init",null);break}case"configure":{u.transmuxer.configure(s.config);break}case"demux":{var n=u.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(G.isPromise)(n)?n.then(function(w){P(u,w)}):P(u,n);break}case"flush":{var O=s.chunkMeta,T=u.transmuxer.flush(O);Object(G.isPromise)(T)?T.then(function(w){p(u,w,O)}):p(u,T,O);break}default:break}})}function P(u,a){if(m(a.remuxResult))return;var o=[],c=a.remuxResult,s=c.audio,i=c.video;s&&_(o,s),i&&_(o,i),u.postMessage({event:"transmuxComplete",data:a},o)}function _(u,a){a.data1&&u.push(a.data1.buffer),a.data2&&u.push(a.data2.buffer)}function p(u,a,o){a.forEach(function(c){P(u,c)}),u.postMessage({event:"flush",data:o})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return i}),U.d(Y,"isPromise",function(){return T}),U.d(Y,"TransmuxConfig",function(){return w}),U.d(Y,"TransmuxState",function(){return R});var G=U("./src/events.ts"),M=U("./src/errors.ts"),k=U("./src/crypt/decrypter.ts"),K=U("./src/demux/aacdemuxer.ts"),I=U("./src/demux/mp4demuxer.ts"),r=U("./src/demux/tsdemuxer.ts"),P=U("./src/demux/mp3demuxer.ts"),_=U("./src/remux/mp4-remuxer.ts"),p=U("./src/remux/passthrough-remuxer.ts"),m=U("./src/demux/chunk-cache.ts"),u=U("./src/utils/mp4-tools.ts"),a=U("./src/utils/logger.ts"),o;try{o=self.performance.now.bind(self.performance)}catch(S){a.logger.debug("Unable to use Performance API on this environment"),o=self.Date.now}var c=[{demux:r.default,remux:_.default},{demux:I.default,remux:p.default},{demux:K.default,remux:_.default},{demux:P.default,remux:_.default}],s=1024;c.forEach(function(S){var v=S.demux;s=Math.max(s,v.minProbeByteLength)});var i=function(){function S(E,f,h,y,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 m.default,this.observer=E,this.typeSupported=f,this.config=h,this.vendor=y,this.id=g}var v=S.prototype;return v.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},v.push=function(f,h,y,g){var x=this,j=y.transmuxing;j.executeStart=o();var F=new Uint8Array(f),A=this.cache,W=this.config,H=this.currentTransmuxState,C=this.transmuxConfig;g&&(this.currentTransmuxState=g);var z=n(F,h);if(z&&z.method==="AES-128"){var Z=this.getDecrypter();if(W.enableSoftwareAES){var le=Z.softwareDecrypt(F,z.key.buffer,z.iv.buffer);if(!le)return j.executeEnd=o(),O(y);F=new Uint8Array(le)}else return this.decryptionPromise=Z.webCryptoDecrypt(F,z.key.buffer,z.iv.buffer).then(function(ut){var Ut=x.push(ut,null,y);return x.decryptionPromise=null,Ut}),this.decryptionPromise}var se=g||H,Ce=se.contiguous,Ee=se.discontinuity,Ie=se.trackSwitch,Qe=se.accurateTimeOffset,Xe=se.timeOffset,_e=C.audioCodec,pe=C.videoCodec,at=C.defaultInitPts,Qt=C.duration,Ft=C.initSegmentData;if((Ee||Ie)&&this.resetInitSegment(Ft,_e,pe,Qt),Ee&&this.resetInitialTimestamp(at),Ce||this.resetContiguity(),this.needsProbing(F,Ee,Ie)){if(A.dataLength){var Tt=A.flush();F=Object(u.appendUint8Array)(Tt,F)}this.configureTransmuxer(F,C)}var Ve=this.transmux(F,z,Xe,Qe,y),pt=this.currentTransmuxState;return pt.contiguous=!0,pt.discontinuity=!1,pt.trackSwitch=!1,j.executeEnd=o(),Ve},v.flush=function(f){var h=this,y=f.transmuxing;y.executeStart=o();var g=this.decrypter,x=this.cache,j=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return h.flush(f)});var A=[],W=j.timeOffset;if(g){var H=g.flush();H&&A.push(this.push(H,null,f))}var C=x.dataLength;x.reset();var z=this.demuxer,Z=this.remuxer;if(!z||!Z)return C>=s&&this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),y.executeEnd=o(),[O(f)];var le=z.flush(W);return T(le)?le.then(function(se){return h.flushRemux(A,se,f),A}):(this.flushRemux(A,le,f),A)},v.flushRemux=function(f,h,y){var g=h.audioTrack,x=h.avcTrack,j=h.id3Track,F=h.textTrack,A=this.currentTransmuxState,W=A.accurateTimeOffset,H=A.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+y.sn+(y.part>-1?" p: "+y.part:"")+" of level "+y.level);var C=this.remuxer.remux(g,x,j,F,H,W,!0,this.id);f.push({remuxResult:C,chunkMeta:y}),y.transmuxing.executeEnd=o()},v.resetInitialTimestamp=function(f){var h=this.demuxer,y=this.remuxer;if(!h||!y)return;h.resetTimeStamp(f),y.resetTimeStamp(f)},v.resetContiguity=function(){var f=this.demuxer,h=this.remuxer;if(!f||!h)return;f.resetContiguity(),h.resetNextTimestamp()},v.resetInitSegment=function(f,h,y,g){var x=this.demuxer,j=this.remuxer;if(!x||!j)return;x.resetInitSegment(h,y,g),j.resetInitSegment(f,h,y)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(f,h,y,g,x){var j;return h&&h.method==="SAMPLE-AES"?j=this.transmuxSampleAes(f,h,y,g,x):j=this.transmuxUnencrypted(f,y,g,x),j},v.transmuxUnencrypted=function(f,h,y,g){var x=this.demuxer.demux(f,h,!1,!this.config.progressive),j=x.audioTrack,F=x.avcTrack,A=x.id3Track,W=x.textTrack,H=this.remuxer.remux(j,F,A,W,h,y,!1,this.id);return{remuxResult:H,chunkMeta:g}},v.transmuxSampleAes=function(f,h,y,g,x){var j=this;return this.demuxer.demuxSampleAes(f,h,y).then(function(F){var A=j.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,y,g,!1,j.id);return{remuxResult:A,chunkMeta:x}})},v.configureTransmuxer=function(f,h){for(var y=this.config,g=this.observer,x=this.typeSupported,j=this.vendor,F=h.audioCodec,A=h.defaultInitPts,W=h.duration,H=h.initSegmentData,C=h.videoCodec,z,Z=0,le=c.length;Z<le;Z++)if(c[Z].demux.probe(f)){z=c[Z];break}z||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:I.default,remux:p.default});var se=this.demuxer,Ce=this.remuxer,Ee=z.remux,Ie=z.demux;(!Ce||!(Ce instanceof Ee))&&(this.remuxer=new Ee(g,y,x,j)),(!se||!(se instanceof Ie))&&(this.demuxer=new Ie(g,y,x),this.probe=Ie.probe),this.resetInitSegment(H,F,C,W),this.resetInitialTimestamp(A)},v.needsProbing=function(f,h,y){return!this.demuxer||!this.remuxer||h||y},v.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new k.default(this.observer,this.config)),f},S}();function n(S,v){var E=null;return S.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(E=v),E}var O=function(v){return{remuxResult:{},chunkMeta:v}};function T(S){return"then"in S&&S.then instanceof Function}var w=function(v,E,f,h,y){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=E,this.initSegmentData=f,this.duration=h,this.defaultInitPts=y},R=function(v,E,f,h,y){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=E,this.accurateTimeOffset=f,this.trackSwitch=h,this.timeOffset=y}},"./src/demux/tsdemuxer.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"discardEPB",function(){return O});var G=U("./src/demux/adts.ts"),M=U("./src/demux/mpegaudio.ts"),k=U("./src/demux/exp-golomb.ts"),K=U("./src/demux/id3.ts"),I=U("./src/demux/sample-aes.ts"),r=U("./src/events.ts"),P=U("./src/utils/mp4-tools.ts"),_=U("./src/utils/logger.ts"),p=U("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},u=function(){function T(R,S,v){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=R,this.config=S,this.typeSupported=v}T.probe=function(S){var v=T.syncOffset(S);return v<0?!1:(v&&_.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},T.syncOffset=function(S){for(var v=Math.min(1e3,S.length-3*188),E=0;E<v;){if(S[E]===71&&S[E+188]===71&&S[E+2*188]===71)return E;E++}return-1},T.createTrack=function(S,v){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:m[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?v:void 0}};var w=T.prototype;return w.resetInitSegment=function(S,v,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",E),this._audioTrack=T.createTrack("audio",E),this._id3Track=T.createTrack("id3",E),this._txtTrack=T.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=S,this.videoCodec=v,this._duration=E},w.resetTimeStamp=function(){},w.resetContiguity=function(){var S=this._audioTrack,v=this._avcTrack,E=this._id3Track;S&&(S.pesData=null),v&&(v.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},w.demux=function(S,v,E,f){E===void 0&&(E=!1),f===void 0&&(f=!1),E||(this.sampleAes=null);var h,y=this._avcTrack,g=this._audioTrack,x=this._id3Track,j=y.pid,F=y.pesData,A=g.pid,W=x.pid,H=g.pesData,C=x.pesData,z=!1,Z=this.pmtParsed,le=this._pmtId,se=S.length;if(this.remainderData&&(S=Object(P.appendUint8Array)(this.remainderData,S),se=S.length,this.remainderData=null),se<188&&!f)return this.remainderData=S,{audioTrack:g,avcTrack:y,id3Track:x,textTrack:this._txtTrack};var Ce=Math.max(0,T.syncOffset(S));se-=(se+Ce)%188,se<S.byteLength&&!f&&(this.remainderData=new Uint8Array(S.buffer,se,S.buffer.byteLength-se));for(var Ee=Ce;Ee<se;Ee+=188)if(S[Ee]===71){var Ie=!!(S[Ee+1]&64),Qe=((S[Ee+1]&31)<<8)+S[Ee+2],Xe=(S[Ee+3]&48)>>4,_e=void 0;if(Xe>1){if(_e=Ee+5+S[Ee+4],_e===Ee+188)continue}else _e=Ee+4;switch(Qe){case j:Ie&&(F&&(h=s(F))&&this.parseAVCPES(h,!1),F={data:[],size:0}),F&&(F.data.push(S.subarray(_e,Ee+188)),F.size+=Ee+188-_e);break;case A:Ie&&(H&&(h=s(H))&&(g.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),H={data:[],size:0}),H&&(H.data.push(S.subarray(_e,Ee+188)),H.size+=Ee+188-_e);break;case W:Ie&&(C&&(h=s(C))&&this.parseID3PES(h),C={data:[],size:0}),C&&(C.data.push(S.subarray(_e,Ee+188)),C.size+=Ee+188-_e);break;case 0:Ie&&(_e+=S[_e]+1),le=this._pmtId=o(S,_e);break;case le:{Ie&&(_e+=S[_e]+1);var pe=c(S,_e,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);j=pe.avc,j>0&&(y.pid=j),A=pe.audio,A>0&&(g.pid=A,g.isAAC=pe.isAAC),W=pe.id3,W>0&&(x.pid=W),z&&!Z&&(_.logger.log("reparse from beginning"),z=!1,Ee=Ce-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});y.pesData=F,g.pesData=H,x.pesData=C;var at={audioTrack:g,avcTrack:y,id3Track:x,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(at),at},w.flush=function(){var S=this.remainderData;this.remainderData=null;var v;return S?v=this.demux(S,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},w.extractRemainingSamples=function(S){var v=S.audioTrack,E=S.avcTrack,f=S.id3Track,h=E.pesData,y=v.pesData,g=f.pesData,x;h&&(x=s(h))?(this.parseAVCPES(x,!0),E.pesData=null):E.pesData=h,y&&(x=s(y))?(v.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),v.pesData=null):(y!=null&&y.size&&_.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=y),g&&(x=s(g))?(this.parseID3PES(x),f.pesData=null):f.pesData=g},w.demuxSampleAes=function(S,v,E){var f=this.demux(S,E,!0,!this.config.progressive),h=this.sampleAes=new I.default(this.observer,this.config,v);return this.decrypt(f,h)},w.decrypt=function(S,v){return new Promise(function(E){var f=S.audioTrack,h=S.avcTrack;f.samples&&f.isAAC?v.decryptAacSamples(f.samples,0,function(){h.samples?v.decryptAvcSamples(h.samples,0,0,function(){E(S)}):E(S)}):h.samples&&v.decryptAvcSamples(h.samples,0,0,function(){E(S)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(S,v){var E=this,f=this._avcTrack,h=this.parseAVCNALu(S.data),y=!1,g=this.avcSample,x,j=!1;S.data=null,g&&h.length&&!f.audFound&&(i(g,f),g=this.avcSample=a(!1,S.pts,S.dts,"")),h.forEach(function(F){switch(F.type){case 1:{x=!0,g||(g=E.avcSample=a(!0,S.pts,S.dts,"")),y&&(g.debug+="NDR "),g.frame=!0;var A=F.data;if(j&&A.length>4){var W=new k.default(A).readSliceType();(W===2||W===4||W===7||W===9)&&(g.key=!0)}break}case 5:x=!0,g||(g=E.avcSample=a(!0,S.pts,S.dts,"")),y&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{x=!0,y&&g&&(g.debug+="SEI ");var H=new k.default(O(F.data));H.readUByte();for(var C=0,z=0,Z=!1,le=0;!Z&&H.bytesAvailable>1;){C=0;do le=H.readUByte(),C+=le;while(le===255);z=0;do le=H.readUByte(),z+=le;while(le===255);if(C===4&&H.bytesAvailable!==0){Z=!0;var se=H.readUByte();if(se===181){var Ce=H.readUShort();if(Ce===49){var Ee=H.readUInt();if(Ee===1195456820){var Ie=H.readUByte();if(Ie===3){for(var Qe=H.readUByte(),Xe=H.readUByte(),_e=31&Qe,pe=[Qe,Xe],at=0;at<_e;at++)pe.push(H.readUByte()),pe.push(H.readUByte()),pe.push(H.readUByte());n(E._txtTrack.samples,{type:3,pts:S.pts,bytes:pe})}}}}}else if(C===5&&H.bytesAvailable!==0){if(Z=!0,z>16){for(var Qt=[],Ft=0;Ft<16;Ft++)Qt.push(H.readUByte().toString(16)),(Ft===3||Ft===5||Ft===7||Ft===9)&&Qt.push("-");for(var Tt=z-16,Ve=new Uint8Array(Tt),pt=0;pt<Tt;pt++)Ve[pt]=H.readUByte();n(E._txtTrack.samples,{pts:S.pts,payloadType:C,uuid:Qt.join(""),userData:Object(K.utf8ArrayToStr)(Ve),userDataBytes:Ve})}}else if(z<H.bytesAvailable)for(var ut=0;ut<z;ut++)H.readUByte()}break}case 7:if(x=!0,j=!0,y&&g&&(g.debug+="SPS "),!f.sps){var Ut=new k.default(F.data),oe=Ut.readSPS();f.width=oe.width,f.height=oe.height,f.pixelRatio=oe.pixelRatio,f.sps=[F.data],f.duration=E._duration;for(var Ue=F.data.subarray(1,4),ze="avc1.",$e=0;$e<3;$e++){var Bt=Ue[$e].toString(16);Bt.length<2&&(Bt="0"+Bt),ze+=Bt}f.codec=ze}break;case 8:x=!0,y&&g&&(g.debug+="PPS "),f.pps||(f.pps=[F.data]);break;case 9:x=!1,f.audFound=!0,g&&i(g,f),g=E.avcSample=a(!1,S.pts,S.dts,y?"AUD ":"");break;case 12:x=!1;break;default:x=!1,g&&(g.debug+="unknown NAL "+F.type+" ");break}if(g&&x){var Ht=g.units;Ht.push(F)}}),v&&g&&(i(g,f),this.avcSample=null)},w.getLastNalUnit=function(){var S,v=this.avcSample,E;if(!v||v.units.length===0){var f=this._avcTrack.samples;v=f[f.length-1]}if((S=v)!==null&&S!==void 0&&S.units){var h=v.units;E=h[h.length-1]}return E},w.parseAVCNALu=function(S){var v=S.byteLength,E=this._avcTrack,f=E.naluState||0,h=f,y=[],g=0,x,j,F,A=-1,W=0;for(f===-1&&(A=0,W=S[0]&31,f=0,g=1);g<v;){if(x=S[g++],!f){f=x?0:1;continue}if(f===1){f=x?0:2;continue}if(!x)f=3;else if(x===1){if(A>=0){var H={data:S.subarray(A,g-f-1),type:W};y.push(H)}else{var C=this.getLastNalUnit();if(C&&(h&&g<=4-h&&(C.state&&(C.data=C.data.subarray(0,C.data.byteLength-h))),j=g-f-1,j>0)){var z=new Uint8Array(C.data.byteLength+j);z.set(C.data,0),z.set(S.subarray(0,j),C.data.byteLength),C.data=z,C.state=0}}g<v?(F=S[g]&31,A=g,W=F,f=0):f=-1}else f=0}if(A>=0&&f>=0){var Z={data:S.subarray(A,v),type:W,state:f};y.push(Z)}if(y.length===0){var le=this.getLastNalUnit();if(le){var se=new Uint8Array(le.data.byteLength+S.byteLength);se.set(le.data,0),se.set(S,le.data.byteLength),le.data=se}}return E.naluState=f,y},w.parseAACPES=function(S){var v=0,E=this._audioTrack,f=this.aacOverFlow,h=S.data;if(f){this.aacOverFlow=null;var y=f.sample.unit.byteLength,g=Math.min(f.missing,y),x=y-g;f.sample.unit.set(h.subarray(0,g),x),E.samples.push(f.sample),v=f.missing}var j,F;for(j=v,F=h.length;j<F-1&&!G.isHeader(h,j);j++);if(j!==v){var A,W;if(j<F-1?(A="AAC PES did not start with ADTS header,offset:"+j,W=!1):(A="no ADTS header found in AAC PES",W=!0),_.logger.warn("parsing error:"+A),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:W,reason:A}),W)return}G.initTrackConfig(E,this.observer,h,j,this.audioCodec);var H;if(S.pts!==void 0)H=S.pts;else if(f){var C=G.getFrameDuration(E.samplerate);H=f.sample.pts+C}else{_.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;j<F;)if(G.isHeader(h,j)){if(j+5<F){var Z=G.appendFrame(E,h,j,H,z);if(Z)if(Z.missing)this.aacOverFlow=Z;else{j+=Z.length,z++;continue}}break}else j++},w.parseMPEGPES=function(S){var v=S.data,E=v.length,f=0,h=0,y=S.pts;if(y===void 0){_.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<E;)if(M.isHeader(v,h)){var g=M.appendFrame(this._audioTrack,v,h,y,f);if(g)h+=g.length,f++;else break}else h++},w.parseID3PES=function(S){if(S.pts===void 0){_.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(S)},T}();u.minProbeByteLength=188;function a(T,w,R,S){return{key:T,frame:!1,pts:w,dts:R,units:[],debug:S,length:0}}function o(T,w){return(T[w+10]&31)<<8|T[w+11]}function c(T,w,R,S){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(T[w+1]&15)<<8|T[w+2],f=w+3+E-4,h=(T[w+10]&15)<<8|T[w+11];for(w+=12+h;w<f;){var y=(T[w+1]&31)<<8|T[w+2];switch(T[w]){case 207:if(!S){_.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=y);break;case 21:v.id3===-1&&(v.id3=y);break;case 219:if(!S){_.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=y);break;case 3:case 4:R?v.audio===-1&&(v.audio=y,v.isAAC=!1):_.logger.log("MPEG audio found, not supported in this browser");break;case 36:_.logger.warn("Unsupported HEVC stream type found");break;default:break}w+=((T[w+3]&15)<<8|T[w+4])+5}return v}function s(T){var w=0,R,S,v,E,f,h=T.data;if(!T||T.size===0)return null;for(;h[0].length<19&&h.length>1;){var y=new Uint8Array(h[0].length+h[1].length);y.set(h[0]),y.set(h[1],h[0].length),h[0]=y,h.splice(1,1)}R=h[0];var g=(R[0]<<16)+(R[1]<<8)+R[2];if(g===1){if(S=(R[4]<<8)+R[5],S&&S>T.size-6)return null;var x=R[7];x&192&&(E=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,x&64?(f=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,E-f>60*9e4&&(_.logger.warn(Math.round((E-f)/9e4)+"s delta between PTS and DTS, align them"),E=f)):f=E),v=R[8];var j=v+9;if(T.size<=j)return null;T.size-=j;for(var F=new Uint8Array(T.size),A=0,W=h.length;A<W;A++){R=h[A];var H=R.byteLength;if(j)if(j>H){j-=H;continue}else R=R.subarray(j),H-=j,j=0;F.set(R,w),w+=H}return S&&(S-=v+3),{data:F,pts:E,dts:f,len:S}}return null}function i(T,w){if(T.units.length&&T.frame){if(T.pts===void 0){var R=w.samples,S=R.length;if(S){var v=R[S-1];T.pts=v.pts,T.dts=v.dts}else{w.dropped++;return}}w.samples.push(T)}T.debug.length&&_.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function n(T,w){var R=T.length;if(R>0){if(w.pts>=T[R-1].pts)T.push(w);else for(var S=R-1;S>=0;S--)if(w.pts<T[S].pts){T.splice(S,0,w);break}}else T.push(w)}function O(T){for(var w=T.byteLength,R=[],S=1;S<w-2;)T[S]===0&&T[S+1]===0&&T[S+2]===3?(R.push(S+2),S+=2):S++;if(R.length===0)return T;var v=w-R.length,E=new Uint8Array(v),f=0;for(S=0;S<v;f++,S++)f===R[0]&&(f++,R.shift()),E[S]=T[f];return E}Y.default=u},"./src/errors.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"ErrorTypes",function(){return G}),U.d(Y,"ErrorDetails",function(){return M});var G;(function(k){k.NETWORK_ERROR="networkError",k.MEDIA_ERROR="mediaError",k.KEY_SYSTEM_ERROR="keySystemError",k.MUX_ERROR="muxError",k.OTHER_ERROR="otherError"})(G||(G={}));var M;(function(k){k.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",k.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",k.KEY_SYSTEM_NO_SESSION="keySystemNoSession",k.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",k.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",k.MANIFEST_LOAD_ERROR="manifestLoadError",k.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",k.MANIFEST_PARSING_ERROR="manifestParsingError",k.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",k.LEVEL_EMPTY_ERROR="levelEmptyError",k.LEVEL_LOAD_ERROR="levelLoadError",k.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",k.LEVEL_SWITCH_ERROR="levelSwitchError",k.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",k.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",k.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",k.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",k.FRAG_LOAD_ERROR="fragLoadError",k.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",k.FRAG_DECRYPT_ERROR="fragDecryptError",k.FRAG_PARSING_ERROR="fragParsingError",k.REMUX_ALLOC_ERROR="remuxAllocError",k.KEY_LOAD_ERROR="keyLoadError",k.KEY_LOAD_TIMEOUT="keyLoadTimeOut",k.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",k.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",k.BUFFER_APPEND_ERROR="bufferAppendError",k.BUFFER_APPENDING_ERROR="bufferAppendingError",k.BUFFER_STALLED_ERROR="bufferStalledError",k.BUFFER_FULL_ERROR="bufferFullError",k.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",k.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",k.INTERNAL_EXCEPTION="internalException",k.INTERNAL_ABORTED="aborted",k.UNKNOWN="unknown"})(M||(M={}))},"./src/events.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"Events",function(){return G});var G;(function(M){M.MEDIA_ATTACHING="hlsMediaAttaching",M.MEDIA_ATTACHED="hlsMediaAttached",M.MEDIA_DETACHING="hlsMediaDetaching",M.MEDIA_DETACHED="hlsMediaDetached",M.BUFFER_RESET="hlsBufferReset",M.BUFFER_CODECS="hlsBufferCodecs",M.BUFFER_CREATED="hlsBufferCreated",M.BUFFER_APPENDING="hlsBufferAppending",M.BUFFER_APPENDED="hlsBufferAppended",M.BUFFER_EOS="hlsBufferEos",M.BUFFER_FLUSHING="hlsBufferFlushing",M.BUFFER_FLUSHED="hlsBufferFlushed",M.MANIFEST_LOADING="hlsManifestLoading",M.MANIFEST_LOADED="hlsManifestLoaded",M.MANIFEST_PARSED="hlsManifestParsed",M.LEVEL_SWITCHING="hlsLevelSwitching",M.LEVEL_SWITCHED="hlsLevelSwitched",M.LEVEL_LOADING="hlsLevelLoading",M.LEVEL_LOADED="hlsLevelLoaded",M.LEVEL_UPDATED="hlsLevelUpdated",M.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",M.LEVELS_UPDATED="hlsLevelsUpdated",M.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",M.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",M.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",M.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",M.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",M.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",M.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",M.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",M.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",M.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",M.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",M.CUES_PARSED="hlsCuesParsed",M.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",M.INIT_PTS_FOUND="hlsInitPtsFound",M.FRAG_LOADING="hlsFragLoading",M.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",M.FRAG_LOADED="hlsFragLoaded",M.FRAG_DECRYPTED="hlsFragDecrypted",M.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",M.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",M.FRAG_PARSING_METADATA="hlsFragParsingMetadata",M.FRAG_PARSED="hlsFragParsed",M.FRAG_BUFFERED="hlsFragBuffered",M.FRAG_CHANGED="hlsFragChanged",M.FPS_DROP="hlsFpsDrop",M.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",M.ERROR="hlsError",M.DESTROYING="hlsDestroying",M.KEY_LOADING="hlsKeyLoading",M.KEY_LOADED="hlsKeyLoaded",M.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",M.BACK_BUFFER_REACHED="hlsBackBufferReached"})(G||(G={}))},"./src/hls.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return T});var G=U("./node_modules/url-toolkit/src/url-toolkit.js"),M=U.n(G),k=U("./src/loader/playlist-loader.ts"),K=U("./src/loader/key-loader.ts"),I=U("./src/controller/id3-track-controller.ts"),r=U("./src/controller/latency-controller.ts"),P=U("./src/controller/level-controller.ts"),_=U("./src/controller/fragment-tracker.ts"),p=U("./src/controller/stream-controller.ts"),m=U("./src/is-supported.ts"),u=U("./src/utils/logger.ts"),a=U("./src/config.ts"),o=U("./node_modules/eventemitter3/index.js"),c=U.n(o),s=U("./src/events.ts"),i=U("./src/errors.ts");function n(w,R){for(var S=0;S<R.length;S++){var v=R[S];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}function O(w,R,S){return R&&n(w.prototype,R),S&&n(w,S),w}var T=function(){w.isSupported=function(){return Object(m.isSupported)()};function w(S){S===void 0&&(S={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new o.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 v=this.config=Object(a.mergeConfig)(w.DefaultConfig,S);this.userConfig=S,Object(u.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(a.enableStreamingMode)(v);var E=v.abrController,f=v.bufferController,h=v.capLevelController,y=v.fpsController,g=this.abrController=new E(this),x=this.bufferController=new f(this),j=this.capLevelController=new h(this),F=new y(this),A=new k.default(this),W=new K.default(this),H=new I.default(this),C=this.levelController=new P.default(this),z=new _.FragmentTracker(this),Z=this.streamController=new p.default(this,z);j.setStreamController(Z),F.setStreamController(Z);var le=[C,Z];this.networkControllers=le;var se=[A,W,g,x,j,F,H,z];this.audioTrackController=this.createController(v.audioTrackController,null,le),this.createController(v.audioStreamController,z,le),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,le),this.createController(v.subtitleStreamController,z,le),this.createController(v.timelineController,null,se),this.emeController=this.createController(v.emeController,null,se),this.cmcdController=this.createController(v.cmcdController,null,se),this.latencyController=this.createController(r.default,null,se),this.coreComponents=se}var R=w.prototype;return R.createController=function(v,E,f){if(v){var h=E?new v(this,E):new v(this);return f&&f.push(h),h}return null},R.on=function(v,E,f){f===void 0&&(f=this),this._emitter.on(v,E,f)},R.once=function(v,E,f){f===void 0&&(f=this),this._emitter.once(v,E,f)},R.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},R.off=function(v,E,f,h){f===void 0&&(f=this),this._emitter.off(v,E,f,h)},R.listeners=function(v){return this._emitter.listeners(v)},R.emit=function(v,E,f){return this._emitter.emit(v,E,f)},R.trigger=function(v,E){if(this.config.debug)return this.emit(v,v,E);try{return this.emit(v,v,E)}catch(f){u.logger.error("An internal error happened while handling event "+v+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(s.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:f})}return!1},R.listenerCount=function(v){return this._emitter.listenerCount(v)},R.destroy=function(){u.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(v){return v.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(v){return v.destroy()}),this.coreComponents.length=0},R.attachMedia=function(v){u.logger.log("attachMedia"),this._media=v,this.trigger(s.Events.MEDIA_ATTACHING,{media:v})},R.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(v){this.stopLoad();var E=this.media,f=this.url,h=this.url=G.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});u.logger.log("loadSource:"+h),E&&f&&f!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(s.Events.MANIFEST_LOADING,{url:v})},R.startLoad=function(v){v===void 0&&(v=-1),u.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(E){E.startLoad(v)})},R.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},R.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){u.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},R.removeLevel=function(v,E){E===void 0&&(E=0),this.levelController.removeLevel(v,E)},O(w,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){u.logger.log("set currentLevel:"+v),this.loadLevel=v,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(v){u.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){u.logger.log("set loadLevel:"+v),this.levelController.manualLevel=v}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(v){this.levelController.nextLoadLevel=v}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(v){u.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){u.logger.log("set startLevel:"+v),v!==-1&&(v=Math.max(v,this.minAutoLevel)),this.levelController.startLevel=v}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(v){var E=!!v;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(v){this._autoLevelCapping!==v&&(u.logger.log("set autoLevelCapping:"+v),this._autoLevelCapping=v)}},{key:"bandwidthEstimate",get:function(){var v=this.abrController.bwEstimator;return v?v.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var v=this.levels,E=this.config.minAutoBitrate;if(!v)return 0;for(var f=v.length,h=0;h<f;h++)if(v[h].maxBitrate>E)return h;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,E=this.autoLevelCapping,f;return E===-1&&v&&v.length?f=v.length-1:f=E,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var E=this.audioTrackController;E&&(E.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var E=this.subtitleTrackController;E&&(E.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{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 s.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:a.hlsDefaultConfig},set:function(v){w.defaultConfig=v}}]),w}();T.defaultConfig=void 0},"./src/is-supported.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"isSupported",function(){return k}),U.d(Y,"changeTypeSupported",function(){return K});var G=U("./src/utils/mediasource-helper.ts");function M(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var I=Object(G.getMediaSource)();if(!I)return!1;var r=M(),P=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),_=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!P&&!!_}function K(){var I,r=M();return typeof(r==null||((I=r.prototype)===null||I===void 0)?void 0:I.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return u}),U.d(Y,"LoadError",function(){return o});var G=U("./src/polyfills/number.ts"),M=U("./src/errors.ts");function k(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,_(c,s)}function K(c){var s=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!P(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(n))return s.get(n);s.set(n,O)}function O(){return I(n,arguments,p(this).constructor)}return O.prototype=Object.create(n.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),_(O,n)},K(c)}function I(c,s,i){return r()?I=Reflect.construct:I=function(O,T,w){var R=[null];R.push.apply(R,T);var S=Function.bind.apply(O,R),v=new S;return w&&_(v,w.prototype),v},I.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function P(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function _(c,s){return _=Object.setPrototypeOf||function(n,O){return n.__proto__=O,n},_(c,s)}function p(c){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},p(c)}var m=Math.pow(2,17),u=function(){function c(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var s=c.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(n,O){var T=this,w=n.url;if(!w)return Promise.reject(new o({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var R=this.config,S=R.fLoader,v=R.loader;return new Promise(function(E,f){T.loader&&T.loader.destroy();var h=T.loader=n.loader=S?new S(R):new v(R),y=a(n),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};n.stats=h.stats,h.load(y,g,{onSuccess:function(j,F,A,W){T.resetLoader(n,h),E({frag:n,part:null,payload:j.data,networkDetails:W})},onError:function(j,F,A){T.resetLoader(n,h),f(new o({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:j,networkDetails:A}))},onAbort:function(j,F,A){T.resetLoader(n,h),f(new o({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:A}))},onTimeout:function(j,F,A){T.resetLoader(n,h),f(new o({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:A}))},onProgress:function(j,F,A,W){O&&O({frag:n,part:null,payload:A,networkDetails:W})}})})},s.loadPart=function(n,O,T){var w=this;this.abort();var R=this.config,S=R.fLoader,v=R.loader;return new Promise(function(E,f){w.loader&&w.loader.destroy();var h=w.loader=n.loader=S?new S(R):new v(R),y=a(n,O),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};O.stats=h.stats,h.load(y,g,{onSuccess:function(j,F,A,W){w.resetLoader(n,h),w.updateStatsFromPart(n,O);var H={frag:n,part:O,payload:j.data,networkDetails:W};T(H),E(H)},onError:function(j,F,A){w.resetLoader(n,h),f(new o({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:O,response:j,networkDetails:A}))},onAbort:function(j,F,A){n.stats.aborted=O.stats.aborted,w.resetLoader(n,h),f(new o({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:O,networkDetails:A}))},onTimeout:function(j,F,A){w.resetLoader(n,h),f(new o({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:O,networkDetails:A}))}})})},s.updateStatsFromPart=function(n,O){var T=n.stats,w=O.stats,R=w.total;if(T.loaded+=w.loaded,R){var S=Math.round(n.duration/O.duration),v=Math.min(Math.round(T.loaded/R),S),E=S-v,f=E*Math.round(T.loaded/v);T.total=T.loaded+f}else T.total=Math.max(T.loaded,T.total);var h=T.loading,y=w.loading;h.start?h.first+=y.first-y.start:(h.start=y.start,h.first=y.first),h.end=y.end},s.resetLoader=function(n,O){n.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},c}();function a(c,s){s===void 0&&(s=null);var i=s||c,n={frag:c,part:s,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},O=i.byteRangeStartOffset,T=i.byteRangeEndOffset;return Object(G.isFiniteNumber)(O)&&Object(G.isFiniteNumber)(T)&&(n.rangeStart=O,n.rangeEnd=T),n}var o=function(c){k(s,c);function s(i){for(var n,O=arguments.length,T=new Array(O>1?O-1:0),w=1;w<O;w++)T[w-1]=arguments[w];return n=c.call.apply(c,[this].concat(T))||this,n.data=void 0,n.data=i,n}return s}(K(Error))},"./src/loader/fragment.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"ElementaryStreamTypes",function(){return u}),U.d(Y,"BaseSegment",function(){return a}),U.d(Y,"Fragment",function(){return o}),U.d(Y,"Part",function(){return c});var G=U("./src/polyfills/number.ts"),M=U("./node_modules/url-toolkit/src/url-toolkit.js"),k=U.n(M),K=U("./src/utils/logger.ts"),I=U("./src/loader/level-key.ts"),r=U("./src/loader/load-stats.ts");function P(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,_(s,i)}function _(s,i){return _=Object.setPrototypeOf||function(O,T){return O.__proto__=T,O},_(s,i)}function p(s,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(s,O.key,O)}}function m(s,i,n){return i&&p(s.prototype,i),n&&p(s,n),s}var u;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(u||(u={}));var a=function(){function s(n){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[u.AUDIO]=null,O[u.VIDEO]=null,O[u.AUDIOVIDEO]=null,O),this.baseurl=n}var i=s.prototype;return i.setByteRange=function(O,T){var w=O.split("@",2),R=[];w.length===1?R[0]=T?T.byteRangeEndOffset:0:R[0]=parseInt(w[1]),R[1]=parseInt(w[0])+R[0],this._byteRange=R},m(s,[{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(M.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(O){this._url=O}}]),s}(),o=function(s){P(i,s);function i(O,T){var w;return w=s.call(this,T)||this,w._decryptdata=null,w.rawProgramDateTime=null,w.programDateTime=null,w.tagList=[],w.duration=0,w.sn=0,w.levelkey=void 0,w.type=void 0,w.loader=null,w.level=-1,w.cc=0,w.startPTS=void 0,w.endPTS=void 0,w.appendedPTS=void 0,w.startDTS=void 0,w.endDTS=void 0,w.start=0,w.deltaPTS=void 0,w.maxStartPTS=void 0,w.minEndPTS=void 0,w.stats=new r.LoadStats,w.urlId=0,w.data=void 0,w.bitrateTest=!1,w.title=null,w.initSegment=null,w.type=O,w}var n=i.prototype;return n.createInitializationVector=function(T){for(var w=new Uint8Array(16),R=12;R<16;R++)w[R]=T>>8*(15-R)&255;return w},n.setDecryptDataFromLevelKey=function(T,w){var R=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(R=I.LevelKey.fromURI(T.uri),R.method=T.method,R.iv=this.createInitializationVector(w),R.keyFormat="identity"),R},n.setElementaryStreamInfo=function(T,w,R,S,v,E){E===void 0&&(E=!1);var f=this.elementaryStreams,h=f[T];if(!h){f[T]={startPTS:w,endPTS:R,startDTS:S,endDTS:v,partial:E};return}h.startPTS=Math.min(h.startPTS,w),h.endPTS=Math.max(h.endPTS,R),h.startDTS=Math.min(h.startDTS,S),h.endDTS=Math.max(h.endDTS,v)},n.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[u.AUDIO]=null,T[u.VIDEO]=null,T[u.AUDIOVIDEO]=null},m(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(G.isFiniteNumber)(this.programDateTime))return null;var T=Object(G.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),i}(a),c=function(s){P(i,s);function i(n,O,T,w,R){var S;S=s.call(this,T)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new r.LoadStats,S.duration=n.decimalFloatingPoint("DURATION"),S.gap=n.bool("GAP"),S.independent=n.bool("INDEPENDENT"),S.relurl=n.enumeratedString("URI"),S.fragment=O,S.index=w;var v=n.enumeratedString("BYTERANGE");return v&&S.setByteRange(v,R),R&&(S.fragOffset=R.fragOffset+R.duration),S}return m(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),i}(a)},"./src/loader/key-loader.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return K});var G=U("./src/events.ts"),M=U("./src/errors.ts"),k=U("./src/utils/logger.ts"),K=function(){function I(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var r=I.prototype;return r._registerListeners=function(){this.hls.on(G.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(G.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var _ in this.loaders){var p=this.loaders[_];p&&p.destroy()}this.loaders={}},r.onKeyLoading=function(_,p){var m=p.frag,u=m.type,a=this.loaders[u];if(!m.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var o=m.decryptdata.uri;if(o!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(a&&(k.logger.warn("abort previous key loader for type:"+u),a.abort()),!o){k.logger.warn("key uri is falsy");return}var s=c.loader,i=m.loader=this.loaders[u]=new s(c);this.decrypturl=o,this.decryptkey=null;var n={url:o,frag:m,responseType:"arraybuffer"},O={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(n,O,T)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:m}))},r.loadsuccess=function(_,p,m){var u=m.frag;if(!u.decryptdata){k.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(_.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:u})},r.loaderror=function(_,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:_})},r.loadtimeout=function(_,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},I}()},"./src/loader/level-details.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"LevelDetails",function(){return I});var G=U("./src/polyfills/number.ts");function M(r,P){for(var _=0;_<P.length;_++){var p=P[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function k(r,P,_){return P&&M(r.prototype,P),_&&M(r,_),r}var K=10,I=function(){function r(_){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=_}var P=r.prototype;return P.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-p.lastPartSn,u=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!u||!!m,this.advanced=this.endSN>p.endSN||m>0||m===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},k(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(G.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 m=this.driftEnd-this.driftStart;return m*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}}]),r}()},"./src/loader/level-key.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"LevelKey",function(){return I});var G=U("./node_modules/url-toolkit/src/url-toolkit.js"),M=U.n(G);function k(r,P){for(var _=0;_<P.length;_++){var p=P[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function K(r,P,_){return P&&k(r.prototype,P),_&&k(r,_),r}var I=function(){r.fromURL=function(_,p){return new r(_,p)},r.fromURI=function(_){return new r(_)};function r(P,_){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,_?this._uri=Object(G.buildAbsoluteURL)(P,_,{alwaysNormalize:!0}):this._uri=P}return K(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"LoadStats",function(){return G});var G=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(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return i});var G=U("./src/polyfills/number.ts"),M=U("./node_modules/url-toolkit/src/url-toolkit.js"),k=U.n(M),K=U("./src/loader/fragment.ts"),I=U("./src/loader/level-details.ts"),r=U("./src/loader/level-key.ts"),P=U("./src/utils/attr-list.ts"),_=U("./src/utils/logger.ts"),p=U("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),o=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function s(R){var S,v;return c.test((S=(v=M.parseURL(R))===null||v===void 0?void 0:v.path)!=null?S:"")}var i=function(){function R(){}return R.findGroup=function(v,E){for(var f=0;f<v.length;f++){var h=v[f];if(h.id===E)return h}},R.convertAVC1ToAVCOTI=function(v){var E=v.split(".");if(E.length>2){var f=E.shift()+".";return f+=parseInt(E.shift()).toString(16),f+=("000"+parseInt(E.shift()).toString(16)).substr(-4),f}return v},R.resolve=function(v,E){return M.buildAbsoluteURL(E,v,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(v,E){var f=[],h={},y=!1;m.lastIndex=0;for(var g;(g=m.exec(v))!=null;)if(g[1]){var x=new P.AttrList(g[1]),j={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:R.resolve(g[2],E)},F=x.decimalResolution("RESOLUTION");F&&(j.width=F.width,j.height=F.height),n((x.CODECS||"").split(/[ ,]+/).filter(function(W){return W}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=R.convertAVC1ToAVCOTI(j.videoCodec)),f.push(j)}else if(g[3]){var A=new P.AttrList(g[3]);A["DATA-ID"]&&(y=!0,h[A["DATA-ID"]]=A)}return{levels:f,sessionData:y?h:null}},R.parseMasterPlaylistMedia=function(v,E,f,h){h===void 0&&(h=[]);var y,g=[],x=0;for(u.lastIndex=0;(y=u.exec(v))!==null;){var j=new P.AttrList(y[1]);if(j.TYPE===f){var F={attrs:j,bitrate:0,id:x++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:f,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?R.resolve(j.URI,E):""};if(h.length){var A=R.findGroup(h,F.groupId)||h[0];O(F,A,"audioCodec"),O(F,A,"textCodec")}g.push(F)}}return g},R.parseLevelPlaylist=function(v,E,f,h,y){var g=new I.LevelDetails(E),x=g.fragments,j=null,F=0,A=0,W=0,H=0,C=null,z=new K.Fragment(h,E),Z,le,se,Ce=-1,Ee=!1;for(a.lastIndex=0,g.m3u8=v;(Z=a.exec(v))!==null;){Ee&&(Ee=!1,z=new K.Fragment(h,E),z.start=W,z.sn=F,z.cc=H,z.level=f,j&&(z.initSegment=j,z.rawProgramDateTime=j.rawProgramDateTime));var Ie=Z[1];if(Ie){z.duration=parseFloat(Ie);var Qe=(" "+Z[2]).slice(1);z.title=Qe||null,z.tagList.push(Qe?["INF",Ie,Qe]:["INF",Ie])}else if(Z[3])Object(G.isFiniteNumber)(z.duration)&&(z.start=W,se&&(z.levelkey=se),z.sn=F,z.level=f,z.cc=H,z.urlId=y,x.push(z),z.relurl=(" "+Z[3]).slice(1),w(z,C),C=z,W+=z.duration,F++,A=0,Ee=!0);else if(Z[4]){var Xe=(" "+Z[4]).slice(1);C?z.setByteRange(Xe,C):z.setByteRange(Xe)}else if(Z[5])z.rawProgramDateTime=(" "+Z[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),Ce===-1&&(Ce=x.length);else{if(Z=Z[0].match(o),!Z){_.logger.warn("No matches on slow regex match for level playlist!");continue}for(le=1;le<Z.length&&!(typeof Z[le]!="undefined");le++);var _e=(" "+Z[le]).slice(1),pe=(" "+Z[le+1]).slice(1),at=Z[le+2]?(" "+Z[le+2]).slice(1):"";switch(_e){case"PLAYLIST-TYPE":g.type=pe.toUpperCase();break;case"MEDIA-SEQUENCE":F=g.startSN=parseInt(pe);break;case"SKIP":{var Qt=new P.AttrList(pe),Ft=Qt.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)(Ft)){g.skippedSegments=Ft;for(var Tt=Ft;Tt--;)x.unshift(null);F+=Ft}var Ve=Qt.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ve&&(g.recentlyRemovedDateranges=Ve.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(pe);break;case"VERSION":g.version=parseInt(pe);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(pe||at)&&z.tagList.push(at?[pe,at]:[pe]);break;case"DIS":H++;case"GAP":z.tagList.push([_e]);break;case"BITRATE":z.tagList.push([_e,pe]);break;case"DISCONTINUITY-SEQ":H=parseInt(pe);break;case"KEY":{var pt,ut=new P.AttrList(pe),Ut=ut.enumeratedString("METHOD"),oe=ut.URI,Ue=ut.hexadecimalInteger("IV"),ze=ut.enumeratedString("KEYFORMATVERSIONS"),$e=ut.enumeratedString("KEYID"),Bt=(pt=ut.enumeratedString("KEYFORMAT"))!=null?pt:"identity",Ht=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ht.indexOf(Bt)>-1){_.logger.warn("Keyformat "+Bt+" is not supported from the manifest");continue}else if(Bt!=="identity")continue;Ut&&(se=r.LevelKey.fromURL(E,oe),oe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ut)>=0&&(se.method=Ut,se.keyFormat=Bt,$e&&(se.keyID=$e),ze&&(se.keyFormatVersions=ze),se.iv=Ue));break}case"START":{var qt=new P.AttrList(pe),tt=qt.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(tt)&&(g.startTimeOffset=tt);break}case"MAP":{var nn=new P.AttrList(pe);z.relurl=nn.URI,nn.BYTERANGE&&z.setByteRange(nn.BYTERANGE),z.level=f,z.sn="initSegment",se&&(z.levelkey=se),z.initSegment=null,j=z,Ee=!0;break}case"SERVER-CONTROL":{var xn=new P.AttrList(pe);g.canBlockReload=xn.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=xn.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&xn.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=xn.optionalFloat("PART-HOLD-BACK",0),g.holdBack=xn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ge=new P.AttrList(pe);g.partTarget=Ge.decimalFloatingPoint("PART-TARGET");break}case"PART":{var He=g.partList;He||(He=g.partList=[]);var vt=A>0?He[He.length-1]:void 0,Ot=A++,nt=new K.Part(new P.AttrList(pe),z,E,Ot,vt);He.push(nt),z.duration+=nt.duration;break}case"PRELOAD-HINT":{var xt=new P.AttrList(pe);g.preloadHint=xt;break}case"RENDITION-REPORT":{var Ae=new P.AttrList(pe);g.renditionReports=g.renditionReports||[],g.renditionReports.push(Ae);break}default:_.logger.warn("line parsed but not handled: "+Z);break}}}C&&!C.relurl?(x.pop(),W-=C.duration,g.partList&&(g.fragmentHint=C)):g.partList&&(w(z,C),z.cc=H,g.fragmentHint=z);var ve=x.length,we=x[0],ie=x[ve-1];if(W+=g.skippedSegments*g.targetduration,W>0&&ve&&ie){g.averagetargetduration=W/ve;var ae=ie.sn;g.endSN=ae!=="initSegment"?ae:0,we&&(g.startCC=we.cc,we.initSegment||g.fragments.every(function(me){return me.relurl&&s(me.relurl)})&&(_.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new K.Fragment(h,E),z.relurl=ie.relurl,z.level=f,z.sn="initSegment",we.initSegment=z,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(W+=g.fragmentHint.duration),g.totalduration=W,g.endCC=H,Ce>0&&T(x,Ce),g},R}();function n(R,S){["video","audio","text"].forEach(function(v){var E=R.filter(function(h){return Object(p.isCodecType)(h,v)});if(E.length){var f=E.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});S[v+"Codec"]=f.length>0?f[0]:E[0],R=R.filter(function(h){return E.indexOf(h)===-1})}}),S.unknownCodecs=R}function O(R,S,v){var E=S[v];E&&(R[v]=E)}function T(R,S){for(var v=R[S],E=S;E--;){var f=R[E];if(!f)return;f.programDateTime=v.programDateTime-f.duration*1e3,v=f}}function w(R,S){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):S!=null&&S.programDateTime&&(R.programDateTime=S.endProgramDateTime),Object(G.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/polyfills/number.ts"),M=U("./src/events.ts"),k=U("./src/errors.ts"),K=U("./src/utils/logger.ts"),I=U("./src/utils/mp4-tools.ts"),r=U("./src/loader/m3u8-parser.ts"),P=U("./src/types/loader.ts"),_=U("./src/utils/attr-list.ts");function p(a){var o=a.type;switch(o){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function m(a,o){var c=a.url;return(c===void 0||c.indexOf("data:")===0)&&(c=o.url),c}var u=function(){function a(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var o=a.prototype;return o.registerListeners=function(){var s=this.hls;s.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.unregisterListeners=function(){var s=this.hls;s.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.createInternalLoader=function(s){var i=this.hls.config,n=i.pLoader,O=i.loader,T=n||O,w=new T(i);return s.loader=w,this.loaders[s.type]=w,w},o.getInternalLoader=function(s){return this.loaders[s.type]},o.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},o.destroyInternalLoaders=function(){for(var s in this.loaders){var i=this.loaders[s];i&&i.destroy(),this.resetInternalLoader(s)}},o.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},o.onManifestLoading=function(s,i){var n=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},o.onLevelLoading=function(s,i){var n=i.id,O=i.level,T=i.url,w=i.deliveryDirectives;this.load({id:n,groupId:null,level:O,responseType:"text",type:P.PlaylistContextType.LEVEL,url:T,deliveryDirectives:w})},o.onAudioTrackLoading=function(s,i){var n=i.id,O=i.groupId,T=i.url,w=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:w})},o.onSubtitleTrackLoading=function(s,i){var n=i.id,O=i.groupId,T=i.url,w=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:w})},o.load=function(s){var i,n=this.hls.config,O=this.getInternalLoader(s);if(O){var T=O.context;if(T&&T.url===s.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),O.abort()}var w,R,S,v;switch(s.type){case P.PlaylistContextType.MANIFEST:w=n.manifestLoadingMaxRetry,R=n.manifestLoadingTimeOut,S=n.manifestLoadingRetryDelay,v=n.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:w=0,R=n.levelLoadingTimeOut;break;default:w=n.levelLoadingMaxRetry,R=n.levelLoadingTimeOut,S=n.levelLoadingRetryDelay,v=n.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(s),(i=s.deliveryDirectives)!==null&&i!==void 0&&i.part){var E;if(s.type===P.PlaylistContextType.LEVEL&&s.level!==null?E=this.hls.levels[s.level].details:s.type===P.PlaylistContextType.AUDIO_TRACK&&s.id!==null?E=this.hls.audioTracks[s.id].details:s.type===P.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(E=this.hls.subtitleTracks[s.id].details),E){var f=E.partTarget,h=E.targetduration;f&&h&&(R=Math.min(Math.max(f*3,h*.8)*1e3,R))}}var y={timeout:R,maxRetry:w,retryDelay:S,maxRetryDelay:v,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(s,y,g)},o.loadsuccess=function(s,i,n,O){if(O===void 0&&(O=null),n.isSidxRequest){this.handleSidxRequest(s,n),this.handlePlaylistLoaded(s,i,n,O);return}this.resetInternalLoader(n.type);var T=s.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,n,"no EXTM3U delimiter",O);return}i.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,i,n,O):this.handleMasterPlaylist(s,i,n,O)},o.loaderror=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!1,s)},o.loadtimeout=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!0)},o.handleMasterPlaylist=function(s,i,n,O){var T=this.hls,w=s.data,R=m(s,n),S=r.default.parseMasterPlaylist(w,R),v=S.levels,E=S.sessionData;if(!v.length){this.handleManifestParsingError(s,n,"no level found in manifest",O);return}var f=v.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),h=v.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),y=r.default.parseMasterPlaylistMedia(w,R,"AUDIO",f),g=r.default.parseMasterPlaylistMedia(w,R,"SUBTITLES",h),x=r.default.parseMasterPlaylistMedia(w,R,"CLOSED-CAPTIONS");if(y.length){var j=y.some(function(F){return!F.url});!j&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new _.AttrList({}),bitrate:0,url:""}))}T.trigger(M.Events.MANIFEST_LOADED,{levels:v,audioTracks:y,subtitles:g,captions:x,url:R,stats:i,networkDetails:O,sessionData:E})},o.handleTrackOrLevelPlaylist=function(s,i,n,O){var T=this.hls,w=n.id,R=n.level,S=n.type,v=m(s,n),E=Object(G.isFiniteNumber)(w)?w:0,f=Object(G.isFiniteNumber)(R)?R:E,h=p(n),y=r.default.parseLevelPlaylist(s.data,v,f,h,E);if(!y.fragments.length){T.trigger(M.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(S===P.PlaylistContextType.MANIFEST){var g={attrs:new _.AttrList({}),bitrate:0,details:y,name:"",url:v};T.trigger(M.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:v,stats:i,networkDetails:O,sessionData:null})}if(i.parsing.end=performance.now(),y.needSidxRanges){var x,j=(x=y.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:j,isSidxRequest:!0,type:S,level:R,levelDetails:y,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=y,this.handlePlaylistLoaded(s,i,n,O)},o.handleSidxRequest=function(s,i){var n=Object(I.parseSegmentIndex)(new Uint8Array(s.data));if(!n)return;var O=n.references,T=i.levelDetails;O.forEach(function(w,R){var S=w.info,v=T.fragments[R];v.byteRange.length===0&&v.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),v.initSegment&&v.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},o.handleManifestParsingError=function(s,i,n,O){this.hls.trigger(M.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===P.PlaylistContextType.MANIFEST,url:s.url,reason:n,response:s,context:i,networkDetails:O})},o.handleNetworkError=function(s,i,n,O){n===void 0&&(n=!1),K.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var T=k.ErrorDetails.UNKNOWN,w=!1,R=this.getInternalLoader(s);switch(s.type){case P.PlaylistContextType.MANIFEST:T=n?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case P.PlaylistContextType.LEVEL:T=n?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case P.PlaylistContextType.AUDIO_TRACK:T=n?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:T=n?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}R&&this.resetInternalLoader(s.type);var S={type:k.ErrorTypes.NETWORK_ERROR,details:T,fatal:w,url:s.url,loader:R,context:s,networkDetails:i};O&&(S.response=O),this.hls.trigger(M.Events.ERROR,S)},o.handlePlaylistLoaded=function(s,i,n,O){var T=n.type,w=n.level,R=n.id,S=n.groupId,v=n.loader,E=n.levelDetails,f=n.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(s,n,"invalid target duration",O);return}if(!v)return;E.live&&(v.getCacheAge&&(E.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(T){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(M.Events.LEVEL_LOADED,{details:E,level:w||0,id:R||0,stats:i,networkDetails:O,deliveryDirectives:f});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:f});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(M.Events.SUBTITLE_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:f});break}},a}();Y.default=u},"./src/polyfills/number.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"isFiniteNumber",function(){return G}),U.d(Y,"MAX_SAFE_INTEGER",function(){return M});var G=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},M=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,Y,U){"use strict";U.r(Y);var G=function(){function M(){}return M.getSilentFrame=function(K,I){switch(K){case"mp4a.40.2":if(I===1)return new Uint8Array([0,200,0,128,35,128]);if(I===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(I===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(I===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(I===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(I===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(I===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(I===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(I===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},M}();Y.default=G},"./src/remux/mp4-generator.ts":function(q,Y,U){"use strict";U.r(Y);var G=Math.pow(2,32)-1,M=function(){function k(){}return k.init=function(){k.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 I;for(I in k.types)k.types.hasOwnProperty(I)&&(k.types[I]=[I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2),I.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),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]);k.HDLR_TYPES={video:r,audio:P};var _=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]);k.STTS=k.STSC=k.STCO=p,k.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),k.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),k.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),k.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,m,a,m,u),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,_))},k.box=function(I){for(var r=8,P=arguments.length,_=new Array(P>1?P-1:0),p=1;p<P;p++)_[p-1]=arguments[p];for(var m=_.length,u=m;m--;)r+=_[m].byteLength;var a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(I,4),m=0,r=8;m<u;m++)a.set(_[m],r),r+=_[m].byteLength;return a},k.hdlr=function(I){return k.box(k.types.hdlr,k.HDLR_TYPES[I])},k.mdat=function(I){return k.box(k.types.mdat,I)},k.mdhd=function(I,r){r*=I;var P=Math.floor(r/(G+1)),_=Math.floor(r%(G+1));return k.box(k.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,P>>24,P>>16&255,P>>8&255,P&255,_>>24,_>>16&255,_>>8&255,_&255,85,196,0,0]))},k.mdia=function(I){return k.box(k.types.mdia,k.mdhd(I.timescale,I.duration),k.hdlr(I.type),k.minf(I))},k.mfhd=function(I){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255]))},k.minf=function(I){return I.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(I)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(I))},k.moof=function(I,r,P){return k.box(k.types.moof,k.mfhd(I),k.traf(P,r))},k.moov=function(I){for(var r=I.length,P=[];r--;)P[r]=k.trak(I[r]);return k.box.apply(null,[k.types.moov,k.mvhd(I[0].timescale,I[0].duration)].concat(P).concat(k.mvex(I)))},k.mvex=function(I){for(var r=I.length,P=[];r--;)P[r]=k.trex(I[r]);return k.box.apply(null,[k.types.mvex].concat(P))},k.mvhd=function(I,r){r*=I;var P=Math.floor(r/(G+1)),_=Math.floor(r%(G+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,P>>24,P>>16&255,P>>8&255,P&255,_>>24,_>>16&255,_>>8&255,_&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 k.box(k.types.mvhd,p)},k.sdtp=function(I){var r=I.samples||[],P=new Uint8Array(4+r.length),_,p;for(_=0;_<r.length;_++)p=r[_].flags,P[_+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return k.box(k.types.sdtp,P)},k.stbl=function(I){return k.box(k.types.stbl,k.stsd(I),k.box(k.types.stts,k.STTS),k.box(k.types.stsc,k.STSC),k.box(k.types.stsz,k.STSZ),k.box(k.types.stco,k.STCO))},k.avc1=function(I){var r=[],P=[],_,p,m;for(_=0;_<I.sps.length;_++)p=I.sps[_],m=p.byteLength,r.push(m>>>8&255),r.push(m&255),r=r.concat(Array.prototype.slice.call(p));for(_=0;_<I.pps.length;_++)p=I.pps[_],m=p.byteLength,P.push(m>>>8&255),P.push(m&255),P=P.concat(Array.prototype.slice.call(p));var u=k.box(k.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|I.sps.length].concat(r).concat([I.pps.length]).concat(P))),a=I.width,o=I.height,c=I.pixelRatio[0],s=I.pixelRatio[1];return k.box(k.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,a>>8&255,a&255,o>>8&255,o&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]),u,k.box(k.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),k.box(k.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255])))},k.esds=function(I){var r=I.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(I.config).concat([6,1,2]))},k.mp4a=function(I){var r=I.samplerate;return k.box(k.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),k.box(k.types.esds,k.esds(I)))},k.mp3=function(I){var r=I.samplerate;return k.box(k.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},k.stsd=function(I){return I.type==="audio"?!I.isAAC&&I.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(I)):k.box(k.types.stsd,k.STSD,k.mp4a(I)):k.box(k.types.stsd,k.STSD,k.avc1(I))},k.tkhd=function(I){var r=I.id,P=I.duration*I.timescale,_=I.width,p=I.height,m=Math.floor(P/(G+1)),u=Math.floor(P%(G+1));return k.box(k.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&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,_>>8&255,_&255,0,0,p>>8&255,p&255,0,0]))},k.traf=function(I,r){var P=k.sdtp(I),_=I.id,p=Math.floor(r/(G+1)),m=Math.floor(r%(G+1));return k.box(k.types.traf,k.box(k.types.tfhd,new Uint8Array([0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255])),k.box(k.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])),k.trun(I,P.length+16+20+8+16+8+8),P)},k.trak=function(I){return I.duration=I.duration||4294967295,k.box(k.types.trak,k.tkhd(I),k.mdia(I))},k.trex=function(I){var r=I.id;return k.box(k.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},k.trun=function(I,r){var P=I.samples||[],_=P.length,p=12+16*_,m=new Uint8Array(p),u,a,o,c,s,i;for(r+=8+p,m.set([0,0,15,1,_>>>24&255,_>>>16&255,_>>>8&255,_&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),u=0;u<_;u++)a=P[u],o=a.duration,c=a.size,s=a.flags,i=a.cts,m.set([o>>>24&255,o>>>16&255,o>>>8&255,o&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*u);return k.box(k.types.trun,m)},k.initSegment=function(I){k.types||k.init();var r=k.moov(I),P=new Uint8Array(k.FTYP.byteLength+r.byteLength);return P.set(k.FTYP),P.set(r,k.FTYP.byteLength),P},k}();M.types=void 0,M.HDLR_TYPES=void 0,M.STTS=void 0,M.STSC=void 0,M.STCO=void 0,M.STSZ=void 0,M.VMHD=void 0,M.SMHD=void 0,M.STSD=void 0,M.FTYP=void 0,M.DINF=void 0,Y.default=M},"./src/remux/mp4-remuxer.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return i}),U.d(Y,"normalizePts",function(){return n});var G=U("./src/polyfills/number.ts"),M=U("./src/remux/aac-helper.ts"),k=U("./src/remux/mp4-generator.ts"),K=U("./src/events.ts"),I=U("./src/errors.ts"),r=U("./src/utils/logger.ts"),P=U("./src/types/loader.ts"),_=U("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var v=arguments[S];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E])}return R},p.apply(this,arguments)}var m=10*1e3,u=1024,a=1152,o=null,c=null,s=!1,i=function(){function R(v,E,f,h){if(h===void 0&&(h=""),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=v,this.config=E,this.typeSupported=f,this.ISGenerated=!1,o===null){var y=navigator.userAgent||"",g=y.match(/Chrome\/(\d+)/i);o=g?parseInt(g[1]):0}if(c===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);c=x?parseInt(x[1]):0}s=!!o&&o<75||!!c&&c<600}var S=R.prototype;return S.destroy=function(){},S.resetTimeStamp=function(E){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},S.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},S.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},S.getVideoStartPts=function(E){var f=!1,h=E.reduce(function(y,g){var x=g.pts-y;return x<-4294967296?(f=!0,n(y,g.pts)):x>0?y:g.pts},E[0].pts);return f&&r.logger.debug("PTS rollover detected"),h},S.remux=function(E,f,h,y,g,x,j,F){var A,W,H,C,z,Z,le=g,se=g,Ce=E.pid>-1,Ee=f.pid>-1,Ie=f.samples.length,Qe=E.samples.length>0,Xe=Ie>1,_e=(!Ce||Qe)&&(!Ee||Xe)||this.ISGenerated||j;if(_e){this.ISGenerated||(H=this.generateIS(E,f,g));var pe=this.isVideoContiguous,at=-1;if(Xe&&(at=O(f.samples),!pe&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,at>0){r.logger.warn("[mp4-remuxer]: Dropped "+at+" out of "+Ie+" video samples due to a missing keyframe");var Qt=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(at),f.dropped+=at,se+=(f.samples[0].pts-Qt)/(f.timescale||9e4)}else at===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ie+" video samples"),Z=!1);if(this.ISGenerated){if(Qe&&Xe){var Ft=this.getVideoStartPts(f.samples),Tt=n(E.samples[0].pts,Ft)-Ft,Ve=Tt/f.inputTimeScale;le+=Math.max(0,Ve),se+=Math.max(0,-Ve)}if(Qe){if(E.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(E,f,g)),W=this.remuxAudio(E,le,this.isAudioContiguous,x,Ee||Xe||F===P.PlaylistLevelType.AUDIO?se:void 0),Xe){var pt=W?W.endPTS-W.startPTS:0;f.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(E,f,g)),A=this.remuxVideo(f,se,pe,pt)}}else Xe&&(A=this.remuxVideo(f,se,pe,0));A&&(A.firstKeyFrame=at,A.independent=at!==-1)}}return this.ISGenerated&&(h.samples.length&&(z=this.remuxID3(h,g)),y.samples.length&&(C=this.remuxText(y,g))),{audio:W,video:A,initSegment:H,independent:Z,text:C,id3:z}},S.generateIS=function(E,f,h){var y=E.samples,g=f.samples,x=this.typeSupported,j={},F=!Object(G.isFiniteNumber)(this._initPTS),A="audio/mp4",W,H,C;if(F&&(W=H=Infinity),E.config&&y.length&&(E.timescale=E.samplerate,E.isAAC||(x.mpeg?(A="audio/mpeg",E.codec=""):x.mp3&&(E.codec="mp3")),j.audio={id:"audio",container:A,codec:E.codec,initSegment:!E.isAAC&&x.mpeg?new Uint8Array(0):k.default.initSegment([E]),metadata:{channelCount:E.channelCount}},F&&(C=E.inputTimeScale,W=H=y[0].pts-Math.round(C*h))),f.sps&&f.pps&&g.length&&(f.timescale=f.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:k.default.initSegment([f]),metadata:{width:f.width,height:f.height}},F)){C=f.inputTimeScale;var z=this.getVideoStartPts(g),Z=Math.round(C*h);H=Math.min(H,n(g[0].dts,z)-Z),W=Math.min(W,z-Z)}if(Object.keys(j).length)return this.ISGenerated=!0,F&&(this._initPTS=W,this._initDTS=H),{tracks:j,initPTS:W,timescale:C}},S.remuxVideo=function(E,f,h,y){var g=E.inputTimeScale,x=E.samples,j=[],F=x.length,A=this._initPTS,W=this.nextAvcDts,H=8,C,z,Z,le=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,Ce=0,Ee=!1;if(!h||W===null){var Ie=f*g,Qe=x[0].pts-n(x[0].dts,x[0].pts);W=Ie-Qe}for(var Xe=0;Xe<F;Xe++){var _e=x[Xe];if(_e.pts=n(_e.pts-A,W),_e.dts=n(_e.dts-A,W),_e.dts>_e.pts){var pe=9e4*.2;Ce=Math.max(Math.min(Ce,_e.pts-_e.dts),-1*pe)}_e.dts<x[Xe>0?Xe-1:Xe].dts&&(Ee=!0)}Ee&&x.sort(function(en,_t){var Et=en.dts-_t.dts,st=en.pts-_t.pts;return Et||st}),z=x[0].dts,Z=x[x.length-1].dts;var at=Math.round((Z-z)/(F-1));if(Ce<0){if(Ce<at*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(_.toMsFromMpegTsClock)(-at,!0)+" ms");for(var Qt=Ce,Ft=0;Ft<F;Ft++)x[Ft].dts=Qt=Math.max(Qt,x[Ft].pts-at),x[Ft].pts=Math.max(Qt,x[Ft].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(_.toMsFromMpegTsClock)(Ce,!0)+" ms to overcome this issue");for(var Tt=0;Tt<F;Tt++)x[Tt].dts=x[Tt].dts+Ce}z=x[0].dts}if(h){var Ve=z-W,pt=Ve>at,ut=Ve<-1;if(pt||ut){pt?r.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(Ve,!0)+" ms ("+Ve+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(-Ve,!0)+" ms ("+Ve+"dts) overlapping between fragments detected"),z=W;var Ut=x[0].pts-Ve;x[0].dts=z,x[0].pts=Ut,r.logger.log("Video: First PTS/DTS adjusted: "+Object(_.toMsFromMpegTsClock)(Ut,!0)+"/"+Object(_.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(_.toMsFromMpegTsClock)(Ve,!0)+" ms")}}s&&(z=Math.max(0,z));for(var oe=0,Ue=0,ze=0;ze<F;ze++){for(var $e=x[ze],Bt=$e.units,Ht=Bt.length,qt=0,tt=0;tt<Ht;tt++)qt+=Bt[tt].data.length;Ue+=qt,oe+=Ht,$e.length=qt,$e.dts=Math.max($e.dts,z),$e.pts=Math.max($e.pts,$e.dts,0),le=Math.min($e.pts,le),se=Math.max($e.pts,se)}Z=x[F-1].dts;var nn=Ue+4*oe+8,xn;try{xn=new Uint8Array(nn)}catch(en){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:nn,reason:"fail allocating video mdat "+nn});return}var Ge=new DataView(xn.buffer);Ge.setUint32(0,nn),xn.set(k.default.types.mdat,4);for(var He=0;He<F;He++){for(var vt=x[He],Ot=vt.units,nt=0,xt=0,Ae=Ot.length;xt<Ae;xt++){var ve=Ot[xt],we=ve.data,ie=ve.data.byteLength;Ge.setUint32(H,ie),H+=4,xn.set(we,H),H+=ie,nt+=4+ie}if(He<F-1)C=x[He+1].dts-vt.dts;else{var ae=this.config,me=vt.dts-x[He>0?He-1:He].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var be=Math.floor(ae.maxBufferHole*g),ye=(y?le+y*g:this.nextAudioPts)-vt.pts;ye>be?(C=ye-me,C<0&&(C=me),r.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+C/90+" ms for the last video frame.")):C=me}else C=me}var Be=Math.round(vt.pts-vt.dts);j.push(new T(vt.key,C,nt,Be))}if(j.length&&o&&o<70){var St=j[0].flags;St.dependsOn=2,St.isNonSync=0}console.assert(C!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=W=Z+C,this.isVideoContiguous=!0;var an=k.default.moof(E.sequenceNumber++,z,p({},E,{samples:j})),Dn="video",yt={data1:an,data2:xn,startPTS:le/g,endPTS:(se+C)/g,startDTS:z/g,endDTS:W/g,type:Dn,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(xn.length,"MDAT length must not be zero"),yt},S.remuxAudio=function(E,f,h,y,g){var x=E.inputTimeScale,j=E.samplerate?E.samplerate:x,F=x/j,A=E.isAAC?u:a,W=A*F,H=this._initPTS,C=!E.isAAC&&this.typeSupported.mpeg,z=[],Z=E.samples,le=C?0:8,se=this.nextAudioPts||-1,Ce=f*x;if(this.isAudioContiguous=h=h||Z.length&&se>0&&(y&&Math.abs(Ce-se)<9e3||Math.abs(n(Z[0].pts-H,Ce)-se)<20*W),Z.forEach(function(we){we.pts=n(we.pts-H,Ce)}),!h||se<0){if(Z=Z.filter(function(we){return we.pts>=0}),!Z.length)return;g===0?se=0:y?se=Math.max(0,Ce):se=Z[0].pts}if(E.isAAC)for(var Ee=g!==void 0,Ie=this.config.maxAudioFramesDrift,Qe=0,Xe=se;Qe<Z.length;Qe++){var _e=Z[Qe],pe=_e.pts,at=pe-Xe,Qt=Math.abs(1e3*at/x);if(at<=-Ie*W&&Ee)Qe===0&&(r.logger.warn("Audio frame @ "+(pe/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*at/x)+" ms."),this.nextAudioPts=se=Xe=pe);else if(at>=Ie*W&&Qt<m&&Ee){var Ft=Math.round(at/W);Xe=pe-Ft*W,Xe<0&&(Ft--,Xe+=W),Qe===0&&(this.nextAudioPts=se=Xe),r.logger.warn("[mp4-remuxer]: Injecting "+Ft+" audio frame @ "+(Xe/x).toFixed(3)+"s due to "+Math.round(1e3*at/x)+" ms gap.");for(var Tt=0;Tt<Ft;Tt++){var Ve=Math.max(Xe,0),pt=M.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);pt||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),pt=_e.unit.subarray()),Z.splice(Qe,0,{unit:pt,pts:Ve}),Xe+=W,Qe++}}_e.pts=Xe,Xe+=W}for(var ut=null,Ut=null,oe,Ue=0,ze=Z.length;ze--;)Ue+=Z[ze].unit.byteLength;for(var $e=0,Bt=Z.length;$e<Bt;$e++){var Ht=Z[$e],qt=Ht.unit,tt=Ht.pts;if(Ut!==null){var nn=z[$e-1];nn.duration=Math.round((tt-Ut)/F)}else if(h&&E.isAAC&&(tt=se),ut=tt,Ue>0){Ue+=le;try{oe=new Uint8Array(Ue)}catch(we){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ue,reason:"fail allocating audio mdat "+Ue});return}if(!C){var xn=new DataView(oe.buffer);xn.setUint32(0,Ue),oe.set(k.default.types.mdat,4)}}else return;oe.set(qt,le);var Ge=qt.byteLength;le+=Ge,z.push(new T(!0,A,Ge,0)),Ut=tt}var He=z.length;if(!He)return;var vt=z[z.length-1];this.nextAudioPts=se=Ut+F*vt.duration;var Ot=C?new Uint8Array(0):k.default.moof(E.sequenceNumber++,ut/F,p({},E,{samples:z}));E.samples=[];var nt=ut/x,xt=se/x,Ae="audio",ve={data1:Ot,data2:oe,startPTS:nt,endPTS:xt,startDTS:nt,endDTS:xt,type:Ae,hasAudio:!0,hasVideo:!1,nb:He};return this.isAudioContiguous=!0,console.assert(oe.length,"MDAT length must not be zero"),ve},S.remuxEmptyAudio=function(E,f,h,y){var g=E.inputTimeScale,x=E.samplerate?E.samplerate:g,j=g/x,F=this.nextAudioPts,A=(F!==null?F:y.startDTS*g)+this._initDTS,W=y.endDTS*g+this._initDTS,H=j*u,C=Math.ceil((W-A)/H),z=M.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],le=0;le<C;le++){var se=A+le*H;Z.push({unit:z,pts:se,dts:se})}return E.samples=Z,this.remuxAudio(E,f,h,!1)},S.remuxID3=function(E,f){var h=E.samples.length;if(!h)return;for(var y=E.inputTimeScale,g=this._initPTS,x=this._initDTS,j=0;j<h;j++){var F=E.samples[j];F.pts=n(F.pts-g,f*y)/y,F.dts=n(F.dts-x,f*y)/y}var A=E.samples;return E.samples=[],{samples:A}},S.remuxText=function(E,f){var h=E.samples.length;if(!h)return;for(var y=E.inputTimeScale,g=this._initPTS,x=0;x<h;x++){var j=E.samples[x];j.pts=n(j.pts-g,f*y)/y}E.samples.sort(function(A,W){return A.pts-W.pts});var F=E.samples;return E.samples=[],{samples:F}},R}();function n(R,S){var v;if(S===null)return R;for(S<R?v=-8589934592:v=8589934592;Math.abs(R-S)>4294967296;)R+=v;return R}function O(R){for(var S=0;S<R.length;S++)if(R[S].key)return S;return-1}var T=function(S,v,E,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=E,this.cts=f,this.flags=new w(S)},w=function(S){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=S?2:1,this.isNonSync=S?0:1}},"./src/remux/passthrough-remuxer.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/polyfills/number.ts"),M=U("./src/utils/mp4-tools.ts"),k=U("./src/loader/fragment.ts"),K=U("./src/utils/logger.ts"),I=function(){function _(){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=_.prototype;return p.destroy=function(){},p.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(u,a,o){this.audioCodec=a,this.videoCodec=o,this.generateInitSegment(u),this.emitInitSegment=!0},p.generateInitSegment=function(u){var a=this.audioCodec,o=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(M.parseInitSegment)(u);a||(a=P(c.audio,k.ElementaryStreamTypes.AUDIO)),o||(o=P(c.video,k.ElementaryStreamTypes.VIDEO));var s={};c.audio&&c.video?s.audiovideo={container:"video/mp4",codec:a+","+o,initSegment:u,id:"main"}:c.audio?s.audio={container:"audio/mp4",codec:a,initSegment:u,id:"audio"}:c.video?s.video={container:"video/mp4",codec:o,initSegment:u,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},p.remux=function(u,a,o,c,s){var i=this.initPTS,n=this.lastEndDTS,O={audio:void 0,video:void 0,text:c,id3:o,initSegment:void 0};Object(G.isFiniteNumber)(n)||(n=this.lastEndDTS=s||0);var T=a.samples;if(!T||!T.length)return O;var w={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(T),R=this.initData),!R||!R.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1),Object(G.isFiniteNumber)(i)||(this.initPTS=w.initPTS=i=r(R,T,n));var S=Object(M.getDuration)(T,R),v=n,E=S+v;Object(M.offsetStartDTS)(R,T,i),S>0?this.lastEndDTS=E:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!R.audio,h=!!R.video,y="";f&&(y+="audio"),h&&(y+="video");var g={data1:T,startPTS:v,startDTS:v,endPTS:E,endDTS:E,type:y,hasAudio:f,hasVideo:h,nb:1,dropped:0};return O.audio=g.type==="audio"?g:void 0,O.video=g.type!=="audio"?g:void 0,O.text=c,O.id3=o,O.initSegment=w,O},_}(),r=function(p,m,u){return Object(M.getStartDTS)(p,m)-u};function P(_,p){var m=_==null?void 0:_.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||p===k.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=I},"./src/task-loop.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return G});var G=function(){function M(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var k=M.prototype;return k.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},k.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},k.onHandlerDestroyed=function(){},k.hasInterval=function(){return!!this._tickInterval},k.hasNextTick=function(){return!!this._tickTimer},k.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},k.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},k.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},k.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},k.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},k.doTick=function(){},M}()},"./src/types/cmcd.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"CMCDVersion",function(){return G}),U.d(Y,"CMCDObjectType",function(){return M}),U.d(Y,"CMCDStreamingFormat",function(){return k}),U.d(Y,"CMCDStreamType",function(){return K});var G=1,M;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(M||(M={}));var k;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(k||(k={}));var K;(function(I){I.VOD="v",I.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"HlsSkip",function(){return k}),U.d(Y,"getSkipValue",function(){return K}),U.d(Y,"HlsUrlParameters",function(){return I}),U.d(Y,"Level",function(){return r});function G(P,_){for(var p=0;p<_.length;p++){var m=_[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function M(P,_,p){return _&&G(P.prototype,_),p&&G(P,p),P}var k;(function(P){P.No="",P.Yes="YES",P.v2="v2"})(k||(k={}));function K(P,_){var p=P.canSkipUntil,m=P.canSkipDateRanges,u=P.endSN,a=_!==void 0?_-u:0;return p&&a<p?m?k.v2:k.Yes:k.No}var I=function(){function P(p,m,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=m,this.skip=u}var _=P.prototype;return _.addDirectives=function(m){var u=new self.URL(m);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},P}(),r=function(){function P(_){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=[_.url],this.attrs=_.attrs,this.bitrate=_.bitrate,_.details&&(this.details=_.details),this.id=_.id||0,this.name=_.name,this.width=_.width||0,this.height=_.height||0,this.audioCodec=_.audioCodec,this.videoCodec=_.videoCodec,this.unknownCodecs=_.unknownCodecs,this.codecSet=[_.videoCodec,_.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return M(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 m=p%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),P}()},"./src/types/loader.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"PlaylistContextType",function(){return G}),U.d(Y,"PlaylistLevelType",function(){return M});var G;(function(k){k.MANIFEST="manifest",k.LEVEL="level",k.AUDIO_TRACK="audioTrack",k.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var M;(function(k){k.MAIN="main",k.AUDIO="audio",k.SUBTITLE="subtitle"})(M||(M={}))},"./src/types/transmuxer.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"ChunkMetadata",function(){return G});var G=function(K,I,r,P,_,p){P===void 0&&(P=0),_===void 0&&(_=-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=M(),this.buffering={audio:M(),video:M(),audiovideo:M()},this.level=K,this.sn=I,this.id=r,this.size=P,this.part=_,this.partial=p};function M(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"AttrList",function(){return k});var G=/^(\d+)x(\d+)$/,M=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,k=function(){function K(r){typeof r=="string"&&(r=K.parseAttrList(r));for(var P in r)r.hasOwnProperty(P)&&(this[P]=r[P])}var I=K.prototype;return I.decimalInteger=function(P){var _=parseInt(this[P],10);return _>Number.MAX_SAFE_INTEGER?Infinity:_},I.hexadecimalInteger=function(P){if(this[P]){var _=(this[P]||"0x").slice(2);_=(_.length&1?"0":"")+_;for(var p=new Uint8Array(_.length/2),m=0;m<_.length/2;m++)p[m]=parseInt(_.slice(m*2,m*2+2),16);return p}else return null},I.hexadecimalIntegerAsNumber=function(P){var _=parseInt(this[P],16);return _>Number.MAX_SAFE_INTEGER?Infinity:_},I.decimalFloatingPoint=function(P){return parseFloat(this[P])},I.optionalFloat=function(P,_){var p=this[P];return p?parseFloat(p):_},I.enumeratedString=function(P){return this[P]},I.bool=function(P){return this[P]==="YES"},I.decimalResolution=function(P){var _=G.exec(this[P]);return _===null?void 0:{width:parseInt(_[1],10),height:parseInt(_[2],10)}},K.parseAttrList=function(P){var _,p={},m='"';for(M.lastIndex=0;(_=M.exec(P))!==null;){var u=_[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),p[_[1]]=u}return p},K}()},"./src/utils/binary-search.ts":function(q,Y,U){"use strict";U.r(Y);var G={search:function(k,K){for(var I=0,r=k.length-1,P=null,_=null;I<=r;){P=(I+r)/2|0,_=k[P];var p=K(_);if(p>0)I=P+1;else if(p<0)r=P-1;else return _}return null}};Y.default=G},"./src/utils/buffer-helper.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"BufferHelper",function(){return k});var G=U("./src/utils/logger.ts"),M={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function K(){}return K.isBuffered=function(r,P){try{if(r){for(var _=K.getBuffered(r),p=0;p<_.length;p++)if(P>=_.start(p)&&P<=_.end(p))return!0}}catch(m){}return!1},K.bufferInfo=function(r,P,_){try{if(r){var p=K.getBuffered(r),m=[],u;for(u=0;u<p.length;u++)m.push({start:p.start(u),end:p.end(u)});return this.bufferedInfo(m,P,_)}}catch(a){}return{len:0,start:P,end:P,nextStart:void 0}},K.bufferedInfo=function(r,P,_){P=Math.max(0,P),r.sort(function(w,R){var S=w.start-R.start;return S||R.end-w.end});var p=[];if(_)for(var m=0;m<r.length;m++){var u=p.length;if(u){var a=p[u-1].end;r[m].start-a<_?r[m].end>a&&(p[u-1].end=r[m].end):p.push(r[m])}else p.push(r[m])}else p=r;for(var o=0,c,s=P,i=P,n=0;n<p.length;n++){var O=p[n].start,T=p[n].end;if(P+_>=O&&P<T)s=O,i=T,o=i-P;else if(P+_<O){c=O;break}}return{len:o,start:s||0,end:i||0,nextStart:c}},K.getBuffered=function(r){try{return r.buffered}catch(P){return G.logger.log("failed to get media.buffered",P),M}},K}()},"./src/utils/cea-608-parser.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"Row",function(){return i}),U.d(Y,"CaptionScreen",function(){return n});var G=U("./src/utils/logger.ts"),M={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},k=function(E){var f=E;return M.hasOwnProperty(E)&&(f=M[E]),String.fromCharCode(f)},K=15,I=100,r={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},_={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},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(u||(u={}));var a=function(){function v(){this.time=null,this.verboseLevel=u.ERROR}var E=v.prototype;return E.log=function(h,y){this.verboseLevel>=h&&G.logger.log(this.time+" ["+h+"] "+y)},v}(),o=function(E){for(var f=[],h=0;h<E.length;h++)f.push(E[h].toString(16));return f},c=function(){function v(f,h,y,g,x){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=h||!1,this.italics=y||!1,this.background=g||"black",this.flash=x||!1}var E=v.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(h){for(var y=["foreground","underline","italics","background","flash"],g=0;g<y.length;g++){var x=y[g];h.hasOwnProperty(x)&&(this[x]=h[x])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},E.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),s=function(){function v(f,h,y,g,x,j){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new c(h,y,g,x,j)}var E=v.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(h,y){this.uchar=h,this.penState.copy(y)},E.setPenState=function(h){this.penState.copy(h)},E.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},E.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),i=function(){function v(f){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<I;h++)this.chars.push(new s);this.logger=f,this.pos=0,this.currPenState=new c}var E=v.prototype;return E.equals=function(h){for(var y=!0,g=0;g<I;g++)if(!this.chars[g].equals(h.chars[g])){y=!1;break}return y},E.copy=function(h){for(var y=0;y<I;y++)this.chars[y].copy(h.chars[y])},E.isEmpty=function(){for(var h=!0,y=0;y<I;y++)if(!this.chars[y].isEmpty()){h=!1;break}return h},E.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},E.moveCursor=function(h){var y=this.pos+h;if(h>1)for(var g=this.pos+1;g<y+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(y)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(h){h>=144&&this.backSpace();var y=k(h);if(this.pos>=I){this.logger.log(u.ERROR,"Cannot insert "+h.toString(16)+" ("+y+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(y,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(h){var y;for(y=h;y<I;y++)this.chars[y].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var h=[],y=!0,g=0;g<I;g++){var x=this.chars[g].uchar;x!==" "&&(y=!1),h.push(x)}return y?"":h.join("")},E.setPenStyles=function(h){this.currPenState.setStyles(h);var y=this.chars[this.pos];y.setPenState(this.currPenState)},v}(),n=function(){function v(f){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<K;h++)this.rows.push(new i(f));this.logger=f,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=v.prototype;return E.reset=function(){for(var h=0;h<K;h++)this.rows[h].clear();this.currRow=K-1},E.equals=function(h){for(var y=!0,g=0;g<K;g++)if(!this.rows[g].equals(h.rows[g])){y=!1;break}return y},E.copy=function(h){for(var y=0;y<K;y++)this.rows[y].copy(h.rows[y])},E.isEmpty=function(){for(var h=!0,y=0;y<K;y++)if(!this.rows[y].isEmpty()){h=!1;break}return h},E.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},E.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},E.insertChar=function(h){var y=this.rows[this.currRow];y.insertChar(h)},E.setPen=function(h){var y=this.rows[this.currRow];y.setPenStyles(h)},E.moveCursor=function(h){var y=this.rows[this.currRow];y.moveCursor(h)},E.setCursor=function(h){this.logger.log(u.INFO,"setCursor: "+h);var y=this.rows[this.currRow];y.setCursor(h)},E.setPAC=function(h){this.logger.log(u.INFO,"pacData = "+JSON.stringify(h));var y=h.row-1;if(this.nrRollUpRows&&y<this.nrRollUpRows-1&&(y=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==y){for(var g=0;g<K;g++)this.rows[g].clear();var x=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var F=j.rows[x].cueStartTime,A=this.logger.time;if(F&&A!==null&&F<A)for(var W=0;W<this.nrRollUpRows;W++)this.rows[y-this.nrRollUpRows+W+1].copy(j.rows[x+W])}}this.currRow=y;var H=this.rows[this.currRow];if(h.indent!==null){var C=h.indent,z=Math.max(C-1,0);H.setCursor(h.indent),h.color=H.chars[z].penState.foreground}var Z={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(Z)},E.setBkgData=function(h){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},E.setRollUpRows=function(h){this.nrRollUpRows=h},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,y=this.rows.splice(h,1)[0];y.clear(),this.rows.splice(this.currRow,0,y),this.logger.log(u.INFO,"Rolling up")},E.getDisplayText=function(h){h=h||!1;for(var y=[],g="",x=-1,j=0;j<K;j++){var F=this.rows[j].getTextString();F&&(x=j+1,h?y.push("Row "+x+": '"+F+"'"):y.push(F.trim()))}return y.length>0&&(h?g="["+y.join(" | ")+"]":g=y.join(`
|
|
`)),g},E.getTextAndFormat=function(){return this.rows},v}(),O=function(){function v(f,h,y){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=f,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new n(y),this.nonDisplayedMemory=new n(y),this.lastOutputScreen=new n(y),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=y}var E=v.prototype;return E.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},E.getHandler=function(){return this.outputFilter},E.setHandler=function(h){this.outputFilter=h},E.setPAC=function(h){this.writeScreen.setPAC(h)},E.setBkgData=function(h){this.writeScreen.setBkgData(h)},E.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(u.INFO,"MODE="+h),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=h},E.insertChars=function(h){for(var y=0;y<h.length;y++)this.writeScreen.insertChar(h[y]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(h){this.logger.log(u.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},E.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(h){this.logger.log(u.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},E.ccMIDROW=function(h){var y={flash:!1};if(y.underline=h%2===1,y.italics=h>=46,y.italics)y.foreground="white";else{var g=Math.floor(h/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];y.foreground=x[g]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(y)),this.writeScreen.setPen(y)},E.outputDataUpdate=function(h){h===void 0&&(h=!1);var y=this.logger.time;if(y===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=y:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,y,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:y),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},v}(),T=function(){function v(f,h,y){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new a;this.channels=[null,new O(f,h,g),new O(f+1,y,g)],this.cmdHistory=S(),this.logger=g}var E=v.prototype;return E.getHandler=function(h){return this.channels[h].getHandler()},E.setHandler=function(h,y){this.channels[h].setHandler(y)},E.addData=function(h,y){var g,x,j,F=!1;this.logger.time=h;for(var A=0;A<y.length;A+=2){if(x=y[A]&127,j=y[A+1]&127,x===0&&j===0)continue;if(this.logger.log(u.DATA,"["+o([y[A],y[A+1]])+"] -> ("+o([x,j])+")"),g=this.parseCmd(x,j),g||(g=this.parseMidrow(x,j)),g||(g=this.parsePAC(x,j)),g||(g=this.parseBackgroundAttributes(x,j)),!g&&(F=this.parseChars(x,j),F)){var W=this.currentChannel;if(W&&W>0){var H=this.channels[W];H.insertChars(F)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!F&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+o([x,j])+" orig: "+o([y[A],y[A+1]]))}},E.parseCmd=function(h,y){var g=this.cmdHistory,x=(h===20||h===28||h===21||h===29)&&y>=32&&y<=47,j=(h===23||h===31)&&y>=33&&y<=35;if(!(x||j))return!1;if(R(h,y,g))return w(null,null,g),this.logger.log(u.DEBUG,"Repeated command ("+o([h,y])+") is dropped"),!0;var F=h===20||h===21||h===23?1:2,A=this.channels[F];return h===20||h===21||h===28||h===29?y===32?A.ccRCL():y===33?A.ccBS():y===34?A.ccAOF():y===35?A.ccAON():y===36?A.ccDER():y===37?A.ccRU(2):y===38?A.ccRU(3):y===39?A.ccRU(4):y===40?A.ccFON():y===41?A.ccRDC():y===42?A.ccTR():y===43?A.ccRTD():y===44?A.ccEDM():y===45?A.ccCR():y===46?A.ccENM():y===47&&A.ccEOC():A.ccTO(y-32),w(h,y,g),this.currentChannel=F,!0},E.parseMidrow=function(h,y){var g=0;if((h===17||h===25)&&y>=32&&y<=47){if(h===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[g];return x?(x.ccMIDROW(y),this.logger.log(u.DEBUG,"MIDROW ("+o([h,y])+")"),!0):!1}return!1},E.parsePAC=function(h,y){var g,x=this.cmdHistory,j=(h>=17&&h<=23||h>=25&&h<=31)&&y>=64&&y<=127,F=(h===16||h===24)&&y>=64&&y<=95;if(!(j||F))return!1;if(R(h,y,x))return w(null,null,x),!0;var A=h<=23?1:2;y>=64&&y<=95?g=A===1?r[h]:_[h]:g=A===1?P[h]:p[h];var W=this.channels[A];return W?(W.setPAC(this.interpretPAC(g,y)),w(h,y,x),this.currentChannel=A,!0):!1},E.interpretPAC=function(h,y){var g,x={color:null,italics:!1,indent:null,underline:!1,row:h};return y>95?g=y-96:g=y-64,x.underline=(g&1)===1,g<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((g-16)/2)*4,x},E.parseChars=function(h,y){var g,x=null,j=null;if(h>=25?(g=2,j=h-8):(g=1,j=h),j>=17&&j<=19){var F;j===17?F=y+80:j===18?F=y+112:F=y+144,this.logger.log(u.INFO,"Special char '"+k(F)+"' in channel "+g),x=[F]}else h>=32&&h<=127&&(x=y===0?[h]:[h,y]);if(x){var A=o(x);this.logger.log(u.DEBUG,"Char codes = "+A.join(",")),w(h,y,this.cmdHistory)}return x},E.parseBackgroundAttributes=function(h,y){var g=(h===16||h===24)&&y>=32&&y<=47,x=(h===23||h===31)&&y>=45&&y<=47;if(!(g||x))return!1;var j,F={};h===16||h===24?(j=Math.floor((y-32)/2),F.background=m[j],y%2===1&&(F.background=F.background+"_semi")):y===45?F.background="transparent":(F.foreground="black",y===47&&(F.underline=!0));var A=h<=23?1:2,W=this.channels[A];return W.setBkgData(F),w(h,y,this.cmdHistory),!0},E.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var y=this.channels[h];y&&y.reset()}this.cmdHistory=S()},E.cueSplitAtTime=function(h){for(var y=0;y<this.channels.length;y++){var g=this.channels[y];g&&g.cueSplitAtTime(h)}},v}();function w(v,E,f){f.a=v,f.b=E}function R(v,E,f){return f.a===v&&f.b===E}function S(){return{a:null,b:null}}Y.default=T},"./src/utils/codecs.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"isCodecType",function(){return M}),U.d(Y,"isCodecSupportedInMp4",function(){return k});var G={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 M(K,I){var r=G[I];return!!r&&r[K.slice(0,4)]===!0}function k(K,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/utils/vttparser.ts"),M=U("./src/utils/webvtt-parser.ts"),k=U("./src/utils/texttrack-utils.ts"),K=/\s/,I={newCue:function(P,_,p,m){for(var u=[],a,o,c,s,i,n=self.VTTCue||self.TextTrackCue,O=0;O<m.rows.length;O++)if(a=m.rows[O],c=!0,s=0,i="",!a.isEmpty()){for(var T=0;T<a.chars.length;T++)K.test(a.chars[T].uchar)&&c?s++:(i+=a.chars[T].uchar,c=!1);a.cueStartTime=_,_===p&&(p+=1e-4),s>=16?s--:s++;var w=Object(G.fixLineBreaks)(i.trim()),R=Object(M.generateCueId)(_,p,w);(!P||!P.cues||!P.cues.getCueById(R))&&(o=new n(_,p,w),o.id=R,o.line=O+1,o.align="left",o.position=10+Math.min(80,Math.floor(s*8/32)*10),u.push(o))}return P&&u.length&&(u.sort(function(S,v){return S.line==="auto"||v.line==="auto"?0:S.line>8&&v.line>8?v.line-S.line:S.line-v.line}),u.forEach(function(S){return Object(k.addCueToTrack)(P,S)})),u}};Y.default=I},"./src/utils/discontinuities.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"findFirstFragWithCC",function(){return K}),U.d(Y,"shouldAlignOnDiscontinuities",function(){return I}),U.d(Y,"findDiscontinuousReferenceFrag",function(){return r}),U.d(Y,"adjustSlidingStart",function(){return _}),U.d(Y,"alignStream",function(){return p}),U.d(Y,"alignPDT",function(){return u}),U.d(Y,"alignFragmentByPDTDelta",function(){return a}),U.d(Y,"alignMediaPlaylistByPDT",function(){return o});var G=U("./src/polyfills/number.ts"),M=U("./src/utils/logger.ts"),k=U("./src/controller/level-helper.ts");function K(c,s){for(var i=null,n=0,O=c.length;n<O;n++){var T=c[n];if(T&&T.cc===s){i=T;break}}return i}function I(c,s,i){return!!(s.details&&(i.endCC>i.startCC||c&&c.cc<i.startCC))}function r(c,s){var i=c.fragments,n=s.fragments;if(!n.length||!i.length){M.logger.log("No fragments to align");return}var O=K(i,n[0].cc);if(!O||O&&!O.startPTS){M.logger.log("No frag in previous level to align on");return}return O}function P(c,s){if(c){var i=c.start+s;c.start=c.startPTS=i,c.endPTS=i+c.duration}}function _(c,s){for(var i=s.fragments,n=0,O=i.length;n<O;n++)P(i[n],c);s.fragmentHint&&P(s.fragmentHint,c),s.alignedSliding=!0}function p(c,s,i){if(!s)return;m(c,i,s),!i.alignedSliding&&s.details&&u(i,s.details),!i.alignedSliding&&s.details&&!i.skippedSegments&&Object(k.adjustSliding)(s.details,i)}function m(c,s,i){if(I(c,i,s)){var n=r(i.details,s);n&&Object(G.isFiniteNumber)(n.start)&&(M.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),_(n.start,s))}}function u(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=c.fragments[0].programDateTime,O=(n-i)/1e3+s.fragments[0].start;O&&Object(G.isFiniteNumber)(O)&&(M.logger.log("Adjusting PTS using programDateTime delta "+(n-i)+"ms, sliding:"+O.toFixed(3)+" "+c.url+" "),_(O,c))}function a(c,s){var i=c.programDateTime;if(!i)return;var n=(i-s)/1e3;c.start=c.startPTS=n,c.endPTS=n+c.duration}function o(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=s.fragments[0].start,O=i-n*1e3;c.fragments.forEach(function(T){a(T,O)}),c.fragmentHint&&a(c.fragmentHint,O),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/utils/ewma.ts"),M=function(){function k(I,r,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 G.default(I),this.fast_=new G.default(r)}var K=k.prototype;return K.update=function(r,P){var _=this.slow_,p=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new G.default(r,_.getEstimate(),_.getTotalWeight())),this.fast_.halfLife!==P&&(this.fast_=new G.default(P,p.getEstimate(),p.getTotalWeight()))},K.sample=function(r,P){r=Math.max(r,this.minDelayMs_);var _=8*P,p=r/1e3,m=_/p;this.fast_.sample(p,m),this.slow_.sample(p,m)},K.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},k}();Y.default=M},"./src/utils/ewma.ts":function(q,Y,U){"use strict";U.r(Y);var G=function(){function M(K,I,r){I===void 0&&(I=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=I,this.totalWeight_=r}var k=M.prototype;return k.sample=function(I,r){var P=Math.pow(this.alpha_,I);this.estimate_=r*(1-P)+P*this.estimate_,this.totalWeight_+=I},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var I=1-Math.pow(this.alpha_,this.totalWeight_);if(I)return this.estimate_/I}return this.estimate_},M}();Y.default=G},"./src/utils/fetch-loader.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"fetchSupported",function(){return a});var G=U("./src/polyfills/number.ts"),M=U("./src/loader/load-stats.ts"),k=U("./src/demux/chunk-cache.ts");function K(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,p(n,O)}function I(n){var O=typeof Map=="function"?new Map:void 0;return I=function(w){if(w===null||!_(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(w))return O.get(w);O.set(w,R)}function R(){return r(w,arguments,m(this).constructor)}return R.prototype=Object.create(w.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),p(R,w)},I(n)}function r(n,O,T){return P()?r=Reflect.construct:r=function(R,S,v){var E=[null];E.push.apply(E,S);var f=Function.bind.apply(R,E),h=new f;return v&&p(h,v.prototype),h},r.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(n){return!1}}function _(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function p(n,O){return p=Object.setPrototypeOf||function(w,R){return w.__proto__=R,w},p(n,O)}function m(n){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},m(n)}function u(){return u=Object.assign||function(n){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var w in T)Object.prototype.hasOwnProperty.call(T,w)&&(n[w]=T[w])}return n},u.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var o=function(){function n(T){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=T.fetchSetup||s,this.controller=new self.AbortController,this.stats=new M.LoadStats}var O=n.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var w=this.response;(!w||!w.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var w;this.abortInternal(),(w=this.callbacks)!==null&&w!==void 0&&w.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(w,R,S){var v=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var f=c(w,this.controller.signal),h=S.onProgress,y=w.responseType==="arraybuffer",g=y?"byteLength":"length";this.context=w,this.config=R,this.callbacks=S,this.request=this.fetchSetup(w,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),S.onTimeout(E,w,v.response)},R.timeout),self.fetch(this.request).then(function(x){if(v.response=v.loader=x,!x.ok){var j=x.status,F=x.statusText;throw new i(F||"fetch, bad network response",j,x)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(x.headers.get("Content-Length")||"0"),h&&Object(G.isFiniteNumber)(R.highWaterMark)?v.loadProgressively(x,E,w,R.highWaterMark,h):y?x.arrayBuffer():x.text()}).then(function(x){var j=v.response;self.clearTimeout(v.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=x[g];var F={url:j.url,data:x};h&&!Object(G.isFiniteNumber)(R.highWaterMark)&&h(E,w,x,j),S.onSuccess(F,E,w,j)}).catch(function(x){if(self.clearTimeout(v.requestTimeout),E.aborted)return;var j=x.code||0;S.onError({code:j,text:x.message},w,x.details)})},O.getCacheAge=function(){var w=null;if(this.response){var R=this.response.headers.get("age");w=R?parseFloat(R):null}return w},O.loadProgressively=function(w,R,S,v,E){v===void 0&&(v=0);var f=new k.default,h=w.body.getReader(),y=function g(){return h.read().then(function(x){if(x.done)return f.dataLength&&E(R,S,f.flush(),w),Promise.resolve(new ArrayBuffer(0));var j=x.value,F=j.length;return R.loaded+=F,F<v||f.dataLength?(f.push(j),f.dataLength>=v&&E(R,S,f.flush(),w)):E(R,S,j,w),g()}).catch(function(){return Promise.reject()})};return y()},n}();function c(n,O){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(u({},n.headers))};return n.rangeEnd&&T.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),T}function s(n,O){return new self.Request(n.url,O)}var i=function(n){K(O,n);function O(T,w,R){var S;return S=n.call(this,T)||this,S.code=void 0,S.details=void 0,S.code=w,S.details=R,S}return O}(I(Error));Y.default=o},"./src/utils/imsc1-ttml-parser.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"IMSC1_CODEC",function(){return _}),U.d(Y,"parseIMSC1",function(){return a});var G=U("./src/utils/mp4-tools.ts"),M=U("./src/utils/vttparser.ts"),k=U("./src/utils/vttcue.ts"),K=U("./src/demux/id3.ts"),I=U("./src/utils/timescale-conversion.ts"),r=U("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(v){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(v[h]=f[h])}return v},P.apply(this,arguments)}var _="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(v,E,f,h,y){var g=Object(G.findBox)(new Uint8Array(v),["mdat"]);if(g.length===0){y(new Error("Could not parse IMSC1 mdat"));return}var x=g[0],j=Object(K.utf8ArrayToStr)(new Uint8Array(v,x.start,x.end-x.start)),F=Object(I.toTimescaleFromScale)(E,1,f);try{h(o(j,F))}catch(A){y(A)}}function o(v,E){var f=new DOMParser,h=f.parseFromString(v,"text/xml"),y=h.getElementsByTagName("tt")[0];if(!y)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(g).reduce(function(H,C){return H[C]=y.getAttribute("ttp:"+C)||g[C],H},{}),j=y.getAttribute("xml:space")!=="preserve",F=s(c(y,"styling","style")),A=s(c(y,"layout","region")),W=c(y,"body","[begin]");return[].map.call(W,function(H){var C=i(H,j);if(!C||!H.hasAttribute("begin"))return null;var z=w(H.getAttribute("begin"),x),Z=w(H.getAttribute("dur"),x),le=w(H.getAttribute("end"),x);if(z===null)throw T(H);if(le===null){if(Z===null)throw T(H);le=z+Z}var se=new k.default(z-E,le-E,C);se.id=Object(r.generateCueId)(se.startTime,se.endTime,se.text);var Ce=A[H.getAttribute("region")],Ee=F[H.getAttribute("style")];se.position=10,se.size=80;var Ie=n(Ce,Ee),Qe=Ie.textAlign;if(Qe){var Xe=u[Qe];Xe&&(se.lineAlign=Xe),se.align=Qe}return P(se,Ie),se}).filter(function(H){return H!==null})}function c(v,E,f){var h=v.getElementsByTagName(E)[0];return h?[].slice.call(h.querySelectorAll(f)):[]}function s(v){return v.reduce(function(E,f){var h=f.getAttribute("xml:id");return h&&(E[h]=f),E},{})}function i(v,E){return[].slice.call(v.childNodes).reduce(function(f,h,y){var g;return h.nodeName==="br"&&y?f+`
|
|
`:(g=h.childNodes)!==null&&g!==void 0&&g.length?i(h,E):E?f+h.textContent.trim().replace(/\s+/g," "):f+h.textContent},"")}function n(v,E){var f="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(y,g){var x=O(E,f,g)||O(v,f,g);return x&&(y[g]=x),y},{})}function O(v,E,f){return v.hasAttributeNS(E,f)?v.getAttributeNS(E,f):null}function T(v){return new Error("Could not parse ttml timestamp "+v)}function w(v,E){if(!v)return null;var f=Object(M.parseTimeStamp)(v);return f===null&&(p.test(v)?f=R(v,E):m.test(v)&&(f=S(v,E))),f}function R(v,E){var f=p.exec(v),h=(f[4]|0)+(f[5]|0)/E.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+h/E.frameRate}function S(v,E){var f=m.exec(v),h=Number(f[1]),y=f[2];switch(y){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/E.frameRate;case"t":return h/E.tickRate}return h}},"./src/utils/logger.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"enableLogs",function(){return r}),U.d(Y,"logger",function(){return P});var G=function(){},M={trace:G,debug:G,log:G,warn:G,info:G,error:G},k=M;function K(_){var p=self.console[_];return p?p.bind(self.console,"["+_+"] >"):G}function I(_){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];m.forEach(function(a){k[a]=_[a]?_[a].bind(_):K(a)})}function r(_){if(self.console&&_===!0||typeof _=="object"){I(_,"debug","log","info","warn","error");try{k.log()}catch(p){k=M}}else k=M}var P=k},"./src/utils/mediakeys-helper.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"KeySystems",function(){return G}),U.d(Y,"requestMediaKeySystemAccess",function(){return M});var G;(function(k){k.WIDEVINE="com.widevine.alpha",k.PLAYREADY="com.microsoft.playready"})(G||(G={}));var M=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"bin2str",function(){return I}),U.d(Y,"readUint16",function(){return r}),U.d(Y,"readUint32",function(){return P}),U.d(Y,"writeUint32",function(){return _}),U.d(Y,"findBox",function(){return p}),U.d(Y,"parseSegmentIndex",function(){return m}),U.d(Y,"parseInitSegment",function(){return u}),U.d(Y,"getStartDTS",function(){return a}),U.d(Y,"getDuration",function(){return o}),U.d(Y,"computeRawDurationFromSamples",function(){return c}),U.d(Y,"offsetStartDTS",function(){return s}),U.d(Y,"segmentValidRange",function(){return i}),U.d(Y,"appendUint8Array",function(){return n});var G=U("./src/utils/typed-array.ts"),M=U("./src/loader/fragment.ts"),k=Math.pow(2,32)-1,K=[].push;function I(O){return String.fromCharCode.apply(null,O)}function r(O,T){"data"in O&&(T+=O.start,O=O.data);var w=O[T]<<8|O[T+1];return w<0?65536+w:w}function P(O,T){"data"in O&&(T+=O.start,O=O.data);var w=O[T]<<24|O[T+1]<<16|O[T+2]<<8|O[T+3];return w<0?4294967296+w:w}function _(O,T,w){"data"in O&&(T+=O.start,O=O.data),O[T]=w>>24,O[T+1]=w>>16&255,O[T+2]=w>>8&255,O[T+3]=w&255}function p(O,T){var w=[];if(!T.length)return w;var R,S,v;"data"in O?(R=O.data,S=O.start,v=O.end):(R=O,S=0,v=R.byteLength);for(var E=S;E<v;){var f=P(R,E),h=I(R.subarray(E+4,E+8)),y=f>1?E+f:v;if(h===T[0])if(T.length===1)w.push({data:R,start:E+8,end:y});else{var g=p({data:R,start:E+8,end:y},T.slice(1));g.length&&K.apply(w,g)}E=y}return w}function m(O){var T=p(O,["moov"]),w=T[0],R=w?w.end:null,S=p(O,["sidx"]);if(!S||!S[0])return null;var v=[],E=S[0],f=E.data[0],h=f===0?8:16,y=P(E,h);h+=4;var g=0,x=0;f===0?h+=8:h+=16,h+=2;var j=E.end+x,F=r(E,h);h+=2;for(var A=0;A<F;A++){var W=h,H=P(E,W);W+=4;var C=H&2147483647,z=(H&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=P(E,W);W+=4,v.push({referenceSize:C,subsegmentDuration:Z,info:{duration:Z/y,start:j,end:j+C-1}}),j+=C,W+=4,h=W}return{earliestPresentationTime:g,timescale:y,version:f,referencesCount:F,references:v,moovEndOffset:R}}function u(O){for(var T=[],w=p(O,["moov","trak"]),R=0;R<w.length;R++){var S=w[R],v=p(S,["tkhd"])[0];if(v){var E=v.data[v.start],f=E===0?12:20,h=P(v,f),y=p(S,["mdia","mdhd"])[0];if(y){E=y.data[y.start],f=E===0?12:20;var g=P(y,f),x=p(S,["mdia","hdlr"])[0];if(x){var j=I(x.data.subarray(x.start+8,x.start+12)),F={soun:M.ElementaryStreamTypes.AUDIO,vide:M.ElementaryStreamTypes.VIDEO}[j];if(F){var A=p(S,["mdia","minf","stbl","stsd"])[0],W=void 0;A&&(W=I(A.data.subarray(A.start+12,A.start+16))),T[h]={timescale:g,type:F},T[F]={timescale:g,id:h,codec:W}}}}}}var H=p(O,["moov","mvex","trex"]);return H.forEach(function(C){var z=P(C,4),Z=T[z];Z&&(Z.default={duration:P(C,12),flags:P(C,20)})}),T}function a(O,T){return p(T,["moof","traf"]).reduce(function(w,R){var S=p(R,["tfdt"])[0],v=S.data[S.start],E=p(R,["tfhd"]).reduce(function(f,h){var y=P(h,4),g=O[y];if(g){var x=P(S,4);v===1&&(x*=Math.pow(2,32),x+=P(S,8));var j=g.timescale||9e4,F=x/j;if(isFinite(F)&&(f===null||F<f))return F}return f},null);return E!==null&&isFinite(E)&&(w===null||E<w)?E:w},null)||0}function o(O,T){for(var w=0,R=0,S=0,v=p(O,["moof","traf"]),E=0;E<v.length;E++){var f=v[E],h=p(f,["tfhd"])[0],y=P(h,4),g=T[y];if(!g)continue;var x=g.default,j=P(h,0)|(x==null?void 0:x.flags),F=x==null?void 0:x.duration;j&8&&(j&2?F=P(h,12):F=P(h,8));for(var A=g.timescale||9e4,W=p(f,["trun"]),H=0;H<W.length;H++){if(F){var C=P(W[H],4);w=F*C}else w=c(W[H]);g.type===M.ElementaryStreamTypes.VIDEO?R+=w/A:g.type===M.ElementaryStreamTypes.AUDIO&&(S+=w/A)}}if(R===0&&S===0){var z=m(O);if(z!=null&&z.references)return z.references.reduce(function(Z,le){return Z+le.info.duration||0},0)}return R||S}function c(O){var T=P(O,0),w=8;T&1&&(w+=4),T&4&&(w+=4);for(var R=0,S=P(O,4),v=0;v<S;v++){if(T&256){var E=P(O,w);R+=E,w+=4}T&512&&(w+=4),T&1024&&(w+=4),T&2048&&(w+=4)}return R}function s(O,T,w){p(T,["moof","traf"]).forEach(function(R){p(R,["tfhd"]).forEach(function(S){var v=P(S,4),E=O[v];if(!E)return;var f=E.timescale||9e4;p(R,["tfdt"]).forEach(function(h){var y=h.data[h.start],g=P(h,4);if(y===0)_(h,4,g-w*f);else{g*=Math.pow(2,32),g+=P(h,8),g-=w*f,g=Math.max(g,0);var x=Math.floor(g/(k+1)),j=Math.floor(g%(k+1));_(h,4,x),_(h,8,j)}})})})}function i(O){var T={valid:null,remainder:null},w=p(O,["moof"]);if(w){if(w.length<2)return T.remainder=O,T}else return T;var R=w[w.length-1];return T.valid=Object(G.sliceUint8)(O,0,R.start-8),T.remainder=Object(G.sliceUint8)(O,R.start-8),T}function n(O,T){var w=new Uint8Array(O.length+T.length);return w.set(O),w.set(T,O.length),w}},"./src/utils/output-filter.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"default",function(){return G});var G=function(){function M(K,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=I}var k=M.prototype;return k.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},k.newCue=function(I,r,P){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=r,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[]},M}()},"./src/utils/texttrack-utils.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"sendAddTrackEvent",function(){return M}),U.d(Y,"addCueToTrack",function(){return k}),U.d(Y,"clearCurrentCues",function(){return K}),U.d(Y,"removeCuesInRange",function(){return I}),U.d(Y,"getCuesInRange",function(){return P});var G=U("./src/utils/logger.ts");function M(_,p){var m;try{m=new Event("addtrack")}catch(u){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=_,p.dispatchEvent(m)}function k(_,p){var m=_.mode;if(m==="disabled"&&(_.mode="hidden"),_.cues&&!_.cues.getCueById(p.id))try{if(_.addCue(p),!_.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(a){G.logger.debug("[texttrack-utils]: "+a);var u=new self.TextTrackCue(p.startTime,p.endTime,p.text);u.id=p.id,_.addCue(u)}m==="disabled"&&(_.mode=m)}function K(_){var p=_.mode;if(p==="disabled"&&(_.mode="hidden"),_.cues)for(var m=_.cues.length;m--;)_.removeCue(_.cues[m]);p==="disabled"&&(_.mode=p)}function I(_,p,m){var u=_.mode;if(u==="disabled"&&(_.mode="hidden"),_.cues&&_.cues.length>0)for(var a=P(_.cues,p,m),o=0;o<a.length;o++)_.removeCue(a[o]);u==="disabled"&&(_.mode=u)}function r(_,p){if(p<_[0].startTime)return 0;var m=_.length-1;if(p>_[m].endTime)return-1;for(var u=0,a=m;u<=a;){var o=Math.floor((a+u)/2);if(p<_[o].startTime)a=o-1;else if(p>_[o].startTime&&u<m)u=o+1;else return o}return _[u].startTime-p<p-_[a].startTime?u:a}function P(_,p,m){var u=[],a=r(_,p);if(a>-1)for(var o=a,c=_.length;o<c;o++){var s=_[o];if(s.startTime>=p&&s.endTime<=m)u.push(s);else if(s.startTime>m)return u}return u}},"./src/utils/time-ranges.ts":function(q,Y,U){"use strict";U.r(Y);var G={toString:function(k){for(var K="",I=k.length,r=0;r<I;r++)K+="["+k.start(r).toFixed(3)+","+k.end(r).toFixed(3)+"]";return K}};Y.default=G},"./src/utils/timescale-conversion.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"toTimescaleFromBase",function(){return M}),U.d(Y,"toTimescaleFromScale",function(){return k}),U.d(Y,"toMsFromMpegTsClock",function(){return K}),U.d(Y,"toMpegTsClockFromTimescale",function(){return I});var G=9e4;function M(r,P,_,p){_===void 0&&(_=1),p===void 0&&(p=!1);var m=r*P*_;return p?Math.round(m):m}function k(r,P,_,p){return _===void 0&&(_=1),p===void 0&&(p=!1),M(r,P,1/_,p)}function K(r,P){return P===void 0&&(P=!1),M(r,1e3,1/G,P)}function I(r,P){return P===void 0&&(P=1),M(r,G,1/P)}},"./src/utils/typed-array.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"sliceUint8",function(){return G});function G(M,k,K){return Uint8Array.prototype.slice?M.slice(k,K):new Uint8Array(Array.prototype.slice.call(M,k,K))}},"./src/utils/vttcue.ts":function(q,Y,U){"use strict";U.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var G=["","lr","rl"],M=["start","middle","end","left","right"];function k(_,p){if(typeof p!="string")return!1;if(!Array.isArray(_))return!1;var m=p.toLowerCase();return~_.indexOf(m)?m:!1}function K(_){return k(G,_)}function I(_){return k(M,_)}function r(_){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];for(var a=1;a<arguments.length;a++){var o=arguments[a];for(var c in o)_[c]=o[c]}return _}function P(_,p,m){var u=this,a={enumerable:!0};u.hasBeenReset=!1;var o="",c=!1,s=_,i=p,n=m,O=null,T="",w=!0,R="auto",S="start",v=50,E="middle",f=50,h="middle";Object.defineProperty(u,"id",r({},a,{get:function(){return o},set:function(g){o=""+g}})),Object.defineProperty(u,"pauseOnExit",r({},a,{get:function(){return c},set:function(g){c=!!g}})),Object.defineProperty(u,"startTime",r({},a,{get:function(){return s},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");s=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",r({},a,{get:function(){return i},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");i=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",r({},a,{get:function(){return n},set:function(g){n=""+g,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",r({},a,{get:function(){return O},set:function(g){O=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",r({},a,{get:function(){return T},set:function(g){var x=K(g);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",r({},a,{get:function(){return w},set:function(g){w=!!g,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",r({},a,{get:function(){return R},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",r({},a,{get:function(){return S},set:function(g){var x=I(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");S=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",r({},a,{get:function(){return v},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");v=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",r({},a,{get:function(){return E},set:function(g){var x=I(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");E=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",r({},a,{get:function(){return f},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");f=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",r({},a,{get:function(){return h},set:function(g){var x=I(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");h=x,this.hasBeenReset=!0}})),u.displayState=void 0}return P.prototype.getCueAsHTML=function(){var _=self.WebVTT;return _.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"parseTimeStamp",function(){return k}),U.d(Y,"fixLineBreaks",function(){return p}),U.d(Y,"VTTParser",function(){return m});var G=U("./src/utils/vttcue.ts"),M=function(){function u(){}var a=u.prototype;return a.decode=function(c,s){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},u}();function k(u){function a(c,s,i,n){return(c|0)*3600+(s|0)*60+(i|0)+parseFloat(n||0)}var o=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?a(o[2],o[3],0,o[4]):a(o[1],o[2],o[3],o[4]):null}var K=function(){function u(){this.values=Object.create(null)}var a=u.prototype;return a.set=function(c,s){!this.get(c)&&s!==""&&(this.values[c]=s)},a.get=function(c,s,i){return i?this.has(c)?this.values[c]:s[i]:this.has(c)?this.values[c]:s},a.has=function(c){return c in this.values},a.alt=function(c,s,i){for(var n=0;n<i.length;++n)if(s===i[n]){this.set(c,s);break}},a.integer=function(c,s){/^-?\d+$/.test(s)&&this.set(c,parseInt(s,10))},a.percent=function(c,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var i=parseFloat(s);if(i>=0&&i<=100)return this.set(c,i),!0}return!1},u}();function I(u,a,o,c){var s=c?u.split(c):[u];for(var i in s){if(typeof s[i]!="string")continue;var n=s[i].split(o);if(n.length!==2)continue;var O=n[0],T=n[1];a(O,T)}}var r=new G.default(0,0,""),P=r.align==="middle"?"middle":"center";function _(u,a,o){var c=u;function s(){var O=k(u);if(O===null)throw new Error("Malformed timestamp: "+c);return u=u.replace(/^[^\sa-zA-Z-]+/,""),O}function i(O,T){var w=new K;I(O,function(v,E){var f;switch(v){case"region":for(var h=o.length-1;h>=0;h--)if(o[h].id===E){w.set(v,o[h].region);break}break;case"vertical":w.alt(v,E,["rl","lr"]);break;case"line":f=E.split(","),w.integer(v,f[0]),w.percent(v,f[0])&&w.set("snapToLines",!1),w.alt(v,f[0],["auto"]),f.length===2&&w.alt("lineAlign",f[1],["start",P,"end"]);break;case"position":f=E.split(","),w.percent(v,f[0]),f.length===2&&w.alt("positionAlign",f[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":w.percent(v,E);break;case"align":w.alt(v,E,["start",P,"end","left","right"]);break}},/:/,/\s/),T.region=w.get("region",null),T.vertical=w.get("vertical","");var R=w.get("line","auto");R==="auto"&&r.line===-1&&(R=-1),T.line=R,T.lineAlign=w.get("lineAlign","start"),T.snapToLines=w.get("snapToLines",!0),T.size=w.get("size",100),T.align=w.get("align",P);var S=w.get("position","auto");S==="auto"&&r.position===50&&(S=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=S}function n(){u=u.replace(/^\s+/,"")}if(n(),a.startTime=s(),n(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);u=u.substr(3),n(),a.endTime=s(),n(),i(u,a)}function p(u){return u.replace(/<br(?: \/)?>/gi,`
|
|
`)}var m=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new M,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=u.prototype;return a.parse=function(c){var s=this;c&&(s.buffer+=s.decoder.decode(c,{stream:!0}));function i(){var S=s.buffer,v=0;for(S=p(S);v<S.length&&S[v]!=="\r"&&S[v]!==`
|
|
`;)++v;var E=S.substr(0,v);return S[v]==="\r"&&++v,S[v]===`
|
|
`&&++v,s.buffer=S.substr(v),E}function n(S){I(S,function(v,E){},/:/)}try{var O="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;O=i();var T=O.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var w=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;w?w=!1:O=i();switch(s.state){case"HEADER":/:/.test(O)?n(O):O||(s.state="ID");continue;case"NOTE":O||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){s.state="NOTE";break}if(!O)continue;if(s.cue=new G.default(0,0,""),s.state="CUE",O.indexOf("-->")===-1){s.cue.id=O;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{_(O,s.cue,s.regionList)}catch(S){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var R=O.indexOf("-->")!==-1;if(!O||R&&(w=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=`
|
|
`),s.cue.text+=O}continue;case"BADCUE":O||(s.state="ID")}}}catch(S){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=`
|
|
|
|
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){c.onparsingerror&&c.onparsingerror(s)}return c.onflush&&c.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(q,Y,U){"use strict";U.r(Y),U.d(Y,"generateCueId",function(){return m}),U.d(Y,"parseWebVTT",function(){return a});var G=U("./src/polyfills/number.ts"),M=U("./src/utils/vttparser.ts"),k=U("./src/demux/id3.ts"),K=U("./src/utils/timescale-conversion.ts"),I=U("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,P=function(c,s,i){return i===void 0&&(i=0),c.substr(i,s.length)===s},_=function(c){var s=parseInt(c.substr(-3)),i=parseInt(c.substr(-6,2)),n=parseInt(c.substr(-9,2)),O=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(G.isFiniteNumber)(s)||!Object(G.isFiniteNumber)(i)||!Object(G.isFiniteNumber)(n)||!Object(G.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return s+=1e3*i,s+=60*1e3*n,s+=60*60*1e3*O,s},p=function(c){for(var s=5381,i=c.length;i;)s=s*33^c.charCodeAt(--i);return(s>>>0).toString()};function m(o,c,s){return p(o.toString())+p(c.toString())+p(s)}var u=function(c,s,i){var n=c[s],O=c[n.prevCC];if(!O||!O.new&&n.new){c.ccOffset=c.presentationOffset=n.start,n.new=!1;return}for(;(T=O)!==null&&T!==void 0&&T.new;){var T;c.ccOffset+=n.start-O.start,n.new=!1,n=O,O=c[n.prevCC]}c.presentationOffset=i};function a(o,c,s,i,n,O,T,w){var R=new M.VTTParser,S=Object(k.utf8ArrayToStr)(new Uint8Array(o)).trim().replace(r,`
|
|
`).split(`
|
|
`),v=[],E=Object(K.toMpegTsClockFromTimescale)(c,s),f="00:00.000",h=0,y=0,g,x=!0,j=!1;R.oncue=function(F){var A=i[n],W=i.ccOffset,H=(h-E)/9e4;if(A!=null&&A.new&&(y!==void 0?W=i.ccOffset=A.start:u(i,n,H)),H&&(W=H-i.presentationOffset),j){var C=F.endTime-F.startTime,z=Object(I.normalizePts)((F.startTime+W-y)*9e4,O*9e4)/9e4;F.startTime=z,F.endTime=z+C}var Z=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Z)),F.id||(F.id=m(F.startTime,F.endTime,Z)),F.endTime>0&&v.push(F)},R.onparsingerror=function(F){g=F},R.onflush=function(){if(g){w(g);return}T(v)},S.forEach(function(F){if(x)if(P(F,"X-TIMESTAMP-MAP=")){x=!1,j=!0,F.substr(16).split(",").forEach(function(A){P(A,"LOCAL:")?f=A.substr(6):P(A,"MPEGTS:")&&(h=parseInt(A.substr(7)))});try{y=_(f)/1e3}catch(A){j=!1,g=A}return}else F===""&&(x=!1);R.parse(F+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(q,Y,U){"use strict";U.r(Y);var G=U("./src/utils/logger.ts"),M=U("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,K=function(){function I(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 M.LoadStats,this.retryDelay=0}var r=I.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var _=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),_&&(_.onreadystatechange=null,_.onprogress=null,_.readyState!==4&&(this.stats.aborted=!0,_.abort()))},r.abort=function(){var _;this.abortInternal(),(_=this.callbacks)!==null&&_!==void 0&&_.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(_,p,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=_,this.config=p,this.callbacks=m,this.retryDelay=p.retryDelay,this.loadInternal()},r.loadInternal=function(){var _=this.config,p=this.context;if(!_)return;var m=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var a=this.xhrSetup;try{if(a)try{a(m,p.url)}catch(s){m.open("GET",p.url,!0),a(m,p.url)}m.readyState||m.open("GET",p.url,!0);var o=this.context.headers;if(o)for(var c in o)m.setRequestHeader(c,o[c])}catch(s){this.callbacks.onError({code:m.status,text:s.message},p,m);return}p.rangeEnd&&m.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),_.timeout),m.send()},r.readystatechange=function(){var _=this.context,p=this.loader,m=this.stats;if(!_||!p)return;var u=p.readyState,a=this.config;if(m.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),u===4){p.onreadystatechange=null,p.onprogress=null;var o=p.status;if(o>=200&&o<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var c,s;if(_.responseType==="arraybuffer"?(c=p.response,s=c.byteLength):(c=p.responseText,s=c.length),m.loaded=m.total=s,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(m,_,c,p),!this.callbacks)return;var n={url:p.responseURL,data:c};this.callbacks.onSuccess(n,m,_,p)}else m.retry>=a.maxRetry||o>=400&&o<499?(G.logger.error(o+" while loading "+_.url),this.callbacks.onError({code:o,text:p.statusText},_,p)):(G.logger.warn(o+" while loading "+_.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,a.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},r.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var _=this.callbacks;_&&(this.abortInternal(),_.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(_){var p=this.stats;p.loaded=_.loaded,_.lengthComputable&&(p.total=_.total)},r.getCacheAge=function(){var _=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");_=p?parseFloat(p):null}return _},I}();Y.default=K}}).default})},vHTk:function(Gt,fe,D){Gt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return qt});var q=D("rePB"),Y=D("VTBJ"),U=D("KQm4"),G=D("U8pU"),M=D("ODXe"),k=D("q1tI"),K=D("TSYQ"),I=D.n(K),r=D("Gytx"),P=D.n(r),_=D("Kwbf"),p=D("t23M"),m=D("qx4F"),u=D("6eGT"),a=D("IBYe"),o=D("Ff2n"),c=D("c+Xe"),s=D("fyJ8"),i=D("biw7");function n(Ge,He,vt,Ot,nt){var xt=vt[Ge]||{},Ae=vt[He]||{},ve,we;xt.fixed==="left"?ve=Ot.left[Ge]:Ae.fixed==="right"&&(we=Ot.right[He]);var ie=!1,ae=!1,me=!1,be=!1,ye=vt[He+1],Be=vt[Ge-1];if(nt==="rtl"){if(ve!==void 0){var St=Be&&Be.fixed==="left";be=!St}else if(we!==void 0){var an=ye&&ye.fixed==="right";me=!an}}else if(ve!==void 0){var Dn=ye&&ye.fixed==="left";ie=!Dn}else if(we!==void 0){var yt=Be&&Be.fixed==="right";ae=!yt}return{fixLeft:ve,fixRight:we,lastFixLeft:ie,firstFixRight:ae,lastFixRight:me,firstFixLeft:be,isSticky:Ot.isSticky}}var O=D("sR1s");function T(Ge){var He=Ge.cells,vt=Ge.stickyOffsets,Ot=Ge.flattenColumns,nt=Ge.rowComponent,xt=Ge.cellComponent,Ae=Ge.onHeaderRow,ve=Ge.index,we=k.useContext(i.a),ie=we.prefixCls,ae=we.direction,me;Ae&&(me=Ae(He.map(function(ye){return ye.column}),ve));var be=Object(O.a)(He.map(function(ye){return ye.column}));return k.createElement(nt,Object.assign({},me),He.map(function(ye,Be){var St=ye.column,an=n(ye.colStart,ye.colEnd,Ot,vt,ae),Dn;return St&&St.onHeaderCell&&(Dn=ye.column.onHeaderCell(St)),k.createElement(s.a,Object.assign({},ye,{ellipsis:St.ellipsis,align:St.align,component:xt,prefixCls:ie,key:be[Be]},an,{additionalProps:Dn,rowType:"header"}))}))}T.displayName="HeaderRow";var w=T;function R(Ge){var He=[];function vt(Ae,ve){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;He[we]=He[we]||[];var ie=ve,ae=Ae.filter(Boolean).map(function(me){var be={key:me.key,className:me.className||"",children:me.title,column:me,colStart:ie},ye=1,Be=me.children;return Be&&Be.length>0&&(ye=vt(Be,ie,we+1).reduce(function(St,an){return St+an},0),be.hasSubColumns=!0),"colSpan"in me&&(ye=me.colSpan),"rowSpan"in me&&(be.rowSpan=me.rowSpan),be.colSpan=ye,be.colEnd=be.colStart+ye-1,He[we].push(be),ie+=ye,ye});return ae}vt(Ge,0);for(var Ot=He.length,nt=function(ve){He[ve].forEach(function(we){!("rowSpan"in we)&&!we.hasSubColumns&&(we.rowSpan=Ot-ve)})},xt=0;xt<Ot;xt+=1)nt(xt);return He}function S(Ge){var He=Ge.stickyOffsets,vt=Ge.columns,Ot=Ge.flattenColumns,nt=Ge.onHeaderRow,xt=k.useContext(i.a),Ae=xt.prefixCls,ve=xt.getComponent,we=k.useMemo(function(){return R(vt)},[vt]),ie=ve(["header","wrapper"],"thead"),ae=ve(["header","row"],"tr"),me=ve(["header","cell"],"th");return k.createElement(ie,{className:"".concat(Ae,"-thead")},we.map(function(be,ye){var Be=k.createElement(w,{key:ye,flattenColumns:Ot,cells:be,stickyOffsets:He,rowComponent:ae,cellComponent:me,onHeaderRow:nt,index:ye});return Be}))}var v=S,E=D("hW8S");function f(Ge){for(var He=Ge.colWidths,vt=Ge.columns,Ot=Ge.columCount,nt=[],xt=Ot||vt.length,Ae=!1,ve=xt-1;ve>=0;ve-=1){var we=He[ve],ie=vt&&vt[ve],ae=ie&&ie[E.a];(we||ae||Ae)&&(nt.unshift(k.createElement("col",Object.assign({key:ve,style:{width:we,minWidth:we}},ae))),Ae=!0)}return k.createElement("colgroup",null,nt)}var h=f;function y(Ge,He){return Object(k.useMemo)(function(){for(var vt=[],Ot=0;Ot<He;Ot+=1){var nt=Ge[Ot];if(nt!==void 0)vt[Ot]=nt;else return null}return vt},[Ge.join("_"),He])}var g=k.forwardRef(function(Ge,He){var vt=Ge.noData,Ot=Ge.columns,nt=Ge.flattenColumns,xt=Ge.colWidths,Ae=Ge.columCount,ve=Ge.stickyOffsets,we=Ge.direction,ie=Ge.fixHeader,ae=Ge.offsetHeader,me=Ge.stickyClassName,be=Ge.onScroll,ye=Object(o.a)(Ge,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Be=k.useContext(i.a),St=Be.prefixCls,an=Be.scrollbarSize,Dn=Be.isSticky,yt=Dn&&!ie?0:an,en=k.useRef(null),_t=k.useCallback(function(tn){Object(c.b)(He,tn),Object(c.b)(en,tn)},[]);k.useEffect(function(){var tn;function un(Pe){var et=Pe.currentTarget,jt=Pe.deltaX;jt&&(be({currentTarget:et,scrollLeft:et.scrollLeft+jt}),Pe.preventDefault())}return(tn=en.current)===null||tn===void 0||tn.addEventListener("wheel",un),function(){var Pe;(Pe=en.current)===null||Pe===void 0||Pe.removeEventListener("wheel",un)}},[]);var Et=nt[nt.length-1],st={fixed:Et?Et.fixed:null,onHeaderCell:function(){return{className:"".concat(St,"-cell-scrollbar")}}},he=Object(k.useMemo)(function(){return yt?[].concat(Object(U.a)(Ot),[st]):Ot},[yt,Ot]),Le=Object(k.useMemo)(function(){return yt?[].concat(Object(U.a)(nt),[st]):nt},[yt,nt]),Lt=Object(k.useMemo)(function(){var tn=ve.right,un=ve.left;return Object(Y.a)(Object(Y.a)({},ve),{},{left:we==="rtl"?[].concat(Object(U.a)(un.map(function(Pe){return Pe+yt})),[0]):un,right:we==="rtl"?tn:[].concat(Object(U.a)(tn.map(function(Pe){return Pe+yt})),[0]),isSticky:Dn})},[yt,ve,Dn]),ct=y(xt,Ae);return k.createElement("div",{style:Object(Y.a)({overflow:"hidden"},Dn?{top:ae}:{}),ref:_t,className:I()("".concat(St,"-header"),Object(q.a)({},me,!!me))},k.createElement("table",{style:{tableLayout:"fixed",visibility:vt||ct?null:"hidden"}},k.createElement(h,{colWidths:ct?[].concat(Object(U.a)(ct),[yt]):[],columCount:Ae+1,columns:Le}),k.createElement(v,Object.assign({},ye,{stickyOffsets:Lt,columns:he,flattenColumns:Le}))))});g.displayName="FixedHeader";var x=g,j=k.createContext(null),F=j;function A(Ge){var He=Ge.prefixCls,vt=Ge.children,Ot=Ge.component,nt=Ge.cellComponent,xt=Ge.fixHeader,Ae=Ge.fixColumn,ve=Ge.horizonScroll,we=Ge.className,ie=Ge.expanded,ae=Ge.componentWidth,me=Ge.colSpan,be=k.useContext(i.a),ye=be.scrollbarSize;return k.useMemo(function(){var Be=vt;return Ae&&(Be=k.createElement("div",{style:{width:ae-(xt?ye:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(He,"-expanded-row-fixed")},Be)),k.createElement(Ot,{className:we,style:{display:ie?null:"none"}},k.createElement(s.a,{component:nt,prefixCls:He,colSpan:me},Be))},[vt,Ot,xt,ve,we,ie,ae,me,ye])}var W=A;function H(Ge){var He=Ge.className,vt=Ge.style,Ot=Ge.record,nt=Ge.index,xt=Ge.rowKey,Ae=Ge.getRowKey,ve=Ge.rowExpandable,we=Ge.expandedKeys,ie=Ge.onRow,ae=Ge.indent,me=ae===void 0?0:ae,be=Ge.rowComponent,ye=Ge.cellComponent,Be=Ge.childrenColumnName,St=k.useContext(i.a),an=St.prefixCls,Dn=St.fixedInfoList,yt=k.useContext(F),en=yt.fixHeader,_t=yt.fixColumn,Et=yt.horizonScroll,st=yt.componentWidth,he=yt.flattenColumns,Le=yt.expandableType,Lt=yt.expandRowByClick,ct=yt.onTriggerExpand,tn=yt.rowClassName,un=yt.expandedRowClassName,Pe=yt.indentSize,et=yt.expandIcon,jt=yt.expandedRowRender,bn=yt.expandIconColumnIndex,Kt=k.useState(!1),Xt=Object(M.a)(Kt,2),Yn=Xt[0],Bn=Xt[1],_n=we&&we.has(Ge.recordKey);k.useEffect(function(){_n&&Bn(!0)},[_n]);var br=Le==="row"&&(!ve||ve(Ot)),Fr=Le==="nest",hr=Be&&Ot&&Ot[Be],Qn=br||Fr,Dr;ie&&(Dr=ie(Ot,nt));var Kr=function(L){if(Lt&&Qn&&ct(Ot,L),Dr&&Dr.onClick){for(var N,V=arguments.length,ne=new Array(V>1?V-1:0),J=1;J<V;J++)ne[J-1]=arguments[J];(N=Dr).onClick.apply(N,[L].concat(ne))}},ti;typeof tn=="string"?ti=tn:typeof tn=="function"&&(ti=tn(Ot,nt,me));var dn=Object(O.a)(he),rr=k.createElement(be,Object.assign({},Dr,{"data-row-key":xt,className:I()(He,"".concat(an,"-row"),"".concat(an,"-row-level-").concat(me),ti,Dr&&Dr.className),style:Object(Y.a)(Object(Y.a)({},vt),Dr?Dr.style:null),onClick:Kr}),he.map(function(X,L){var N=X.render,V=X.dataIndex,ne=X.className,J=dn[L],Fe=Dn[L],Jt;L===(bn||0)&&Fr&&(Jt=k.createElement(k.Fragment,null,k.createElement("span",{style:{paddingLeft:"".concat(Pe*me,"px")},className:"".concat(an,"-row-indent indent-level-").concat(me)}),et({prefixCls:an,expanded:_n,expandable:hr,record:Ot,onExpand:ct})));var In;return X.onCell&&(In=X.onCell(Ot,nt)),k.createElement(s.a,Object.assign({className:ne,ellipsis:X.ellipsis,align:X.align,component:ye,prefixCls:an,key:J,record:Ot,index:nt,dataIndex:V,render:N,shouldCellUpdate:X.shouldCellUpdate},Fe,{appendNode:Jt,additionalProps:In}))})),fi;if(br&&(Yn||_n)){var wi=jt(Ot,nt,me+1,_n),ni=un&&un(Ot,nt,me);fi=k.createElement(W,{expanded:_n,className:I()("".concat(an,"-expanded-row"),"".concat(an,"-expanded-row-level-").concat(me+1),ni),prefixCls:an,fixHeader:en,fixColumn:_t,horizonScroll:Et,component:be,componentWidth:st,cellComponent:ye,colSpan:he.length},wi)}var ri;return hr&&_n&&(ri=(Ot[Be]||[]).map(function(X,L){var N=Ae(X,L);return k.createElement(H,Object.assign({},Ge,{key:N,rowKey:N,record:X,recordKey:N,index:L,indent:me+1}))})),k.createElement(k.Fragment,null,rr,fi,ri)}H.displayName="BodyRow";var C=H,z=k.createContext(null),Z=z;function le(Ge){var He=Ge.columnKey,vt=Ge.onColumnResize,Ot=k.useRef();return k.useEffect(function(){Ot.current&&vt(He,Ot.current.offsetWidth)},[]),k.createElement(p.a,{onResize:function(xt){var Ae=xt.offsetWidth;vt(He,Ae)}},k.createElement("td",{ref:Ot,style:{padding:0,border:0,height:0}},k.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function se(Ge){var He=Ge.data,vt=Ge.getRowKey,Ot=Ge.measureColumnWidth,nt=Ge.expandedKeys,xt=Ge.onRow,Ae=Ge.rowExpandable,ve=Ge.emptyNode,we=Ge.childrenColumnName,ie=k.useContext(Z),ae=ie.onColumnResize,me=k.useContext(i.a),be=me.prefixCls,ye=me.getComponent,Be=k.useContext(F),St=Be.fixHeader,an=Be.horizonScroll,Dn=Be.flattenColumns,yt=Be.componentWidth;return k.useMemo(function(){var en=ye(["body","wrapper"],"tbody"),_t=ye(["body","row"],"tr"),Et=ye(["body","cell"],"td"),st;He.length?st=He.map(function(Le,Lt){var ct=vt(Le,Lt);return k.createElement(C,{key:ct,rowKey:ct,record:Le,recordKey:ct,index:Lt,rowComponent:_t,cellComponent:Et,expandedKeys:nt,onRow:xt,getRowKey:vt,rowExpandable:Ae,childrenColumnName:we})}):st=k.createElement(W,{expanded:!0,className:"".concat(be,"-placeholder"),prefixCls:be,fixHeader:St,fixColumn:an,horizonScroll:an,component:_t,componentWidth:yt,cellComponent:Et,colSpan:Dn.length},ve);var he=Object(O.a)(Dn);return k.createElement(en,{className:"".concat(be,"-tbody")},Ot&&k.createElement("tr",{"aria-hidden":"true",className:"".concat(be,"-measure-row"),style:{height:0}},he.map(function(Le){return k.createElement(le,{key:Le,columnKey:Le,onColumnResize:ae})})),st)},[He,be,xt,Ot,nt,vt,ye,yt,ve,Dn])}var Ce=k.memo(se);Ce.displayName="Body";var Ee=Ce,Ie=D("wRmb"),Qe=D("xEkU"),Xe=D.n(Qe);function _e(Ge){var He=Object(k.useRef)(Ge),vt=Object(k.useState)({}),Ot=Object(M.a)(vt,2),nt=Ot[1],xt=Object(k.useRef)(null),Ae=Object(k.useRef)([]);function ve(we){xt.current===null&&(Ae.current=[],xt.current=Xe()(function(){Ae.current.forEach(function(ie){He.current=ie(He.current)}),xt.current=null,nt({})})),Ae.current.push(we)}return Object(k.useEffect)(function(){return function(){Xe.a.cancel(xt.current)}},[]),[He.current,ve]}function pe(Ge){var He=Object(k.useRef)(Ge),vt=Object(k.useRef)(null);function Ot(){window.clearTimeout(vt.current)}function nt(Ae){He.current=Ae,Ot(),vt.current=window.setTimeout(function(){He.current=null,vt.current=null},100)}function xt(){return He.current}return Object(k.useEffect)(function(){return Ot},[]),[nt,xt]}function at(Ge,He,vt){var Ot=Object(k.useMemo)(function(){for(var nt=[],xt=[],Ae=0,ve=0,we=0;we<He;we+=1)if(vt==="rtl"){xt[we]=ve,ve+=Ge[we]||0;var ie=He-we-1;nt[ie]=Ae,Ae+=Ge[ie]||0}else{nt[we]=Ae,Ae+=Ge[we]||0;var ae=He-we-1;xt[ae]=ve,ve+=Ge[ae]||0}return{left:nt,right:xt}},[Ge,He,vt]);return Ot}var Qt=at;function Ft(Ge){var He=Ge.className,vt=Ge.children;return k.createElement("div",{className:He},vt)}var Tt=Ft,Ve=D("n6Qo");function pt(Ge){var He,vt=Ge.prefixCls,Ot=Ge.record,nt=Ge.onExpand,xt=Ge.expanded,Ae=Ge.expandable,ve="".concat(vt,"-row-expand-icon");if(!Ae)return k.createElement("span",{className:I()(ve,"".concat(vt,"-row-spaced"))});var we=function(ae){nt(Ot,ae),ae.stopPropagation()};return k.createElement("span",{className:I()(ve,(He={},Object(q.a)(He,"".concat(vt,"-row-expanded"),xt),Object(q.a)(He,"".concat(vt,"-row-collapsed"),!xt),He)),onClick:we})}function ut(Ge,He,vt){var Ot=[];function nt(xt){(xt||[]).forEach(function(Ae,ve){Ot.push(He(Ae,ve)),nt(Ae[vt])})}return nt(Ge),Ot}var Ut=D("zT1h"),oe=D("y0+3"),Ue=function(He,vt){var Ot,nt,xt=He.scrollBodyRef,Ae=He.onScroll,ve=He.offsetScroll,we=k.useContext(i.a),ie=we.prefixCls,ae=((Ot=xt.current)===null||Ot===void 0?void 0:Ot.scrollWidth)||0,me=((nt=xt.current)===null||nt===void 0?void 0:nt.clientWidth)||0,be=ae&&me*(me/ae),ye=k.useRef(),Be=_e({scrollLeft:0,isHiddenScrollBar:!1}),St=Object(M.a)(Be,2),an=St[0],Dn=St[1],yt=k.useRef({delta:0,x:0}),en=k.useState(!1),_t=Object(M.a)(en,2),Et=_t[0],st=_t[1],he=function(){st(!1)},Le=function(Pe){Pe.persist(),yt.current.delta=Pe.pageX-an.scrollLeft,yt.current.x=0,st(!0),Pe.preventDefault()},Lt=function(Pe){var et,jt=Pe||((et=window)===null||et===void 0?void 0:et.event),bn=jt.buttons;if(!Et||bn===0){Et&&st(!1);return}var Kt=yt.current.x+Pe.pageX-yt.current.x-yt.current.delta;Kt<=0&&(Kt=0),Kt+be>=me&&(Kt=me-be),Ae({scrollLeft:Kt/me*(ae+2)}),yt.current.x=Pe.pageX},ct=function(){var Pe=Object(oe.b)(xt.current).top,et=Pe+xt.current.offsetHeight,jt=document.documentElement.scrollTop+window.innerHeight;et-Object(m.a)()<=jt||Pe>=jt-ve?Dn(function(bn){return Object(Y.a)(Object(Y.a)({},bn),{},{isHiddenScrollBar:!0})}):Dn(function(bn){return Object(Y.a)(Object(Y.a)({},bn),{},{isHiddenScrollBar:!1})})},tn=function(Pe){Dn(function(et){return Object(Y.a)(Object(Y.a)({},et),{},{scrollLeft:Pe/ae*me||0})})};return k.useImperativeHandle(vt,function(){return{setScrollLeft:tn}}),k.useEffect(function(){var un=Object(Ut.a)(document.body,"mouseup",he,!1),Pe=Object(Ut.a)(document.body,"mousemove",Lt,!1);return ct(),function(){un.remove(),Pe.remove()}},[be,Et]),k.useEffect(function(){var un=Object(Ut.a)(window,"scroll",ct,!1),Pe=Object(Ut.a)(window,"resize",ct,!1);return function(){un.remove(),Pe.remove()}},[]),k.useEffect(function(){an.isHiddenScrollBar||Dn(function(un){var Pe,et;return Object(Y.a)(Object(Y.a)({},un),{},{scrollLeft:xt.current.scrollLeft/((Pe=xt.current)===null||Pe===void 0?void 0:Pe.scrollWidth)*((et=xt.current)===null||et===void 0?void 0:et.clientWidth)})})},[an.isHiddenScrollBar]),ae<=me||!be||an.isHiddenScrollBar?null:k.createElement("div",{style:{height:Object(m.a)(),width:me,bottom:ve},className:"".concat(ie,"-sticky-scroll")},k.createElement("div",{onMouseDown:Le,ref:ye,className:I()("".concat(ie,"-sticky-scroll-bar"),Object(q.a)({},"".concat(ie,"-sticky-scroll-bar-active"),Et)),style:{width:"".concat(be,"px"),transform:"translate3d(".concat(an.scrollLeft,"px, 0, 0)")}}))},ze=k.forwardRef(Ue);function $e(Ge,He){return k.useMemo(function(){var vt=!!Ge;return{isSticky:vt,stickyClassName:vt?"".concat(He,"-sticky-header"):"",offsetHeader:Object(G.a)(Ge)==="object"&&Ge.offsetHeader||0,offsetScroll:Object(G.a)(Ge)==="object"&&Ge.offsetScroll||0}},[Ge,He])}var Bt=[],Ht={},qt="rc-table-internal-hook",tt=k.memo(function(Ge){var He=Ge.children;return He},function(Ge,He){return P()(Ge.props,He.props)?Ge.pingLeft!==He.pingLeft||Ge.pingRight!==He.pingRight:!1});function nn(Ge){var He,vt=Ge.prefixCls,Ot=Ge.className,nt=Ge.rowClassName,xt=Ge.style,Ae=Ge.data,ve=Ge.rowKey,we=Ge.scroll,ie=Ge.tableLayout,ae=Ge.direction,me=Ge.title,be=Ge.footer,ye=Ge.summary,Be=Ge.id,St=Ge.showHeader,an=Ge.components,Dn=Ge.emptyText,yt=Ge.onRow,en=Ge.onHeaderRow,_t=Ge.internalHooks,Et=Ge.transformColumns,st=Ge.internalRefs,he=Ge.sticky,Le=Ae||Bt,Lt=!!Le.length,ct=k.useState(0),tn=Object(M.a)(ct,2),un=tn[0],Pe=tn[1];k.useEffect(function(){Pe(Object(m.a)())});var et=k.useMemo(function(){return Object(O.c)(an,{})},[an]),jt=k.useCallback(function(Ln,Cn){return Object(O.b)(et,Ln)||Cn},[et]),bn=k.useMemo(function(){return typeof ve=="function"?ve:function(Ln){var Cn=Ln&&Ln[ve];return Cn}},[ve]),Kt=Object(E.c)(Ge),Xt=Kt.expandIcon,Yn=Kt.expandedRowKeys,Bn=Kt.defaultExpandedRowKeys,_n=Kt.defaultExpandAllRows,br=Kt.expandedRowRender,Fr=Kt.onExpand,hr=Kt.onExpandedRowsChange,Qn=Kt.expandRowByClick,Dr=Kt.rowExpandable,Kr=Kt.expandIconColumnIndex,ti=Kt.expandedRowClassName,dn=Kt.childrenColumnName,rr=Kt.indentSize,fi=Xt||pt,wi=dn||"children",ni=k.useMemo(function(){return br?"row":Ge.expandable&&_t===qt&&Ge.expandable.__PARENT_RENDER_ICON__||Le.some(function(Ln){return Ln&&Object(G.a)(Ln)==="object"&&Ln[wi]})?"nest":!1},[!!br,Le]),ri=k.useState(function(){return Bn||(_n?ut(Le,bn,wi):[])}),X=Object(M.a)(ri,2),L=X[0],N=X[1],V=k.useMemo(function(){return new Set(Yn||L||[])},[Yn,L]),ne=k.useCallback(function(Ln){var Cn=bn(Ln,Le.indexOf(Ln)),Dt,Ze=V.has(Cn);Ze?(V.delete(Cn),Dt=Object(U.a)(V)):Dt=[].concat(Object(U.a)(V),[Cn]),N(Dt),Fr&&Fr(!Ze,Ln),hr&&hr(Dt)},[bn,V,Le,Fr,hr]),J=k.useState(0),Fe=Object(M.a)(J,2),Jt=Fe[0],In=Fe[1],Zn=Object(Ie.b)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},Ge),Kt),{},{expandable:!!br,expandedKeys:V,getRowKey:bn,onTriggerExpand:ne,expandIcon:fi,expandIconColumnIndex:Kr,direction:ae}),_t===qt?Et:null),ln=Object(M.a)(Zn,2),ir=ln[0],tr=ln[1],Mr=k.useMemo(function(){return{columns:ir,flattenColumns:tr}},[ir,tr]),ui=k.useRef(),oi=k.useRef(),Gr=k.useRef(),Li=k.useState(!1),Vi=Object(M.a)(Li,2),Ar=Vi[0],Tr=Vi[1],ii=k.useState(!1),Br=Object(M.a)(ii,2),Hn=Br[0],yn=Br[1],Sn=_e(new Map),En=Object(M.a)(Sn,2),ur=En[0],sr=En[1],Q=Object(O.a)(tr),de=Q.map(function(Ln){return ur.get(Ln)}),Te=k.useMemo(function(){return de},[de.join("_")]),Se=Qt(Te,tr.length,ae),rt=we&&Object(O.d)(we.y),De=we&&Object(O.d)(we.x),Je=De&&tr.some(function(Ln){var Cn=Ln.fixed;return Cn}),it=k.useRef(),At=$e(he,vt),Ct=At.isSticky,We=At.offsetHeader,gt=At.offsetScroll,ot=At.stickyClassName,dt,wt,kt;rt&&(wt={overflowY:"scroll",maxHeight:we.y}),De&&(dt={overflowX:"auto"},rt||(wt={overflowY:"hidden"}),kt={width:we.x===!0?"auto":we.x,minWidth:"100%"});var mt=k.useCallback(function(Ln,Cn){sr(function(Dt){var Ze=new Map(Dt);return Ze.set(Ln,Cn),Ze})},[]),$t=pe(null),hn=Object(M.a)($t,2),Pn=hn[0],Gn=hn[1];function On(Ln,Cn){if(!Cn)return;typeof Cn=="function"?Cn(Ln):Cn.scrollLeft!==Ln&&(Cn.scrollLeft=Ln)}var Nn=function(Cn){var Dt=Cn.currentTarget,Ze=Cn.scrollLeft,It=typeof Ze=="number"?Ze:Dt.scrollLeft,Mt=Dt||Ht;if(!Gn()||Gn()===Mt){var cn;Pn(Mt),On(It,oi.current),On(It,Gr.current),On(It,(cn=it.current)===null||cn===void 0?void 0:cn.setScrollLeft)}if(Dt){var zn=Dt.scrollWidth,kn=Dt.clientWidth;Tr(It>0),yn(It<zn-kn)}},Mn=function(){Gr.current&&Nn({currentTarget:Gr.current})},Pt=function(Cn){var Dt=Cn.width;Mn(),In(ui.current?ui.current.offsetWidth:Dt)};k.useEffect(function(){return Mn},[]),k.useEffect(function(){De&&Mn()},[De]),k.useEffect(function(){_t===qt&&st&&(st.body.current=Gr.current)});var fn=jt(["table"],"table"),Wt=k.useMemo(function(){return ie||(Je?we.x==="max-content"?"auto":"fixed":rt||tr.some(function(Ln){var Cn=Ln.ellipsis;return Cn})?"fixed":"auto")},[rt,Je,tr,ie]),Rt,Un={colWidths:Te,columCount:tr.length,stickyOffsets:Se,onHeaderRow:en,fixHeader:rt},Rn=k.useMemo(function(){return Lt?null:typeof Dn=="function"?Dn():Dn},[Lt,Dn]),Yt=k.createElement(Ee,{data:Le,measureColumnWidth:rt||De||Ct,expandedKeys:V,rowExpandable:Dr,getRowKey:bn,onRow:yt,emptyNode:Rn,childrenColumnName:wi}),ht=k.createElement(h,{colWidths:tr.map(function(Ln){var Cn=Ln.width;return Cn}),columns:tr}),jn=ye&&k.createElement(Ve.b,null,ye(Le)),pn=jt(["body"]);if(rt||Ct){var qn;typeof pn=="function"?(qn=pn(Le,{scrollbarSize:un,ref:Gr,onScroll:Nn}),Un.colWidths=tr.map(function(Ln,Cn){var Dt=Ln.width,Ze=Cn===ir.length-1?Dt-un:Dt;return typeof Ze=="number"&&!Number.isNaN(Ze)?Ze:(Object(_.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):qn=k.createElement("div",{style:Object(Y.a)(Object(Y.a)({},dt),wt),onScroll:Nn,ref:Gr,className:I()("".concat(vt,"-body"))},k.createElement(fn,{style:Object(Y.a)(Object(Y.a)({},kt),{},{tableLayout:Wt})},ht,Yt,jn),Ct&&k.createElement(ze,{ref:it,offsetScroll:gt,scrollBodyRef:Gr,onScroll:Nn})),Rt=k.createElement(k.Fragment,null,St!==!1&&k.createElement(x,Object.assign({noData:!Le.length},Un,Mr,{direction:ae,offsetHeader:We,stickyClassName:ot,ref:oi,onScroll:Nn})),qn)}else Rt=k.createElement("div",{style:Object(Y.a)(Object(Y.a)({},dt),wt),className:I()("".concat(vt,"-content")),onScroll:Nn,ref:Gr},k.createElement(fn,{style:Object(Y.a)(Object(Y.a)({},kt),{},{tableLayout:Wt})},ht,St!==!1&&k.createElement(v,Object.assign({},Un,Mr)),Yt,jn));var Zt=Object(E.b)(Ge),An=k.createElement("div",Object.assign({className:I()(vt,Ot,(He={},Object(q.a)(He,"".concat(vt,"-rtl"),ae==="rtl"),Object(q.a)(He,"".concat(vt,"-ping-left"),Ar),Object(q.a)(He,"".concat(vt,"-ping-right"),Hn),Object(q.a)(He,"".concat(vt,"-layout-fixed"),ie==="fixed"),Object(q.a)(He,"".concat(vt,"-fixed-header"),rt),Object(q.a)(He,"".concat(vt,"-fixed-column"),Je),Object(q.a)(He,"".concat(vt,"-scroll-horizontal"),De),Object(q.a)(He,"".concat(vt,"-has-fix-left"),tr[0]&&tr[0].fixed),Object(q.a)(He,"".concat(vt,"-has-fix-right"),tr[tr.length-1]&&tr[tr.length-1].fixed==="right"),He)),style:xt,id:Be,ref:ui},Zt),k.createElement(tt,{pingLeft:Ar,pingRight:Hn,props:Object(Y.a)(Object(Y.a)({},Ge),{},{stickyOffsets:Se,mergedExpandedKeys:V})},me&&k.createElement(Tt,{className:"".concat(vt,"-title")},me(Le)),k.createElement("div",{className:"".concat(vt,"-container")},Rt),be&&k.createElement(Tt,{className:"".concat(vt,"-footer")},be(Le))));De&&(An=k.createElement(p.a,{onResize:Pt},An));var Fn=k.useMemo(function(){return{prefixCls:vt,getComponent:jt,scrollbarSize:un,direction:ae,fixedInfoList:tr.map(function(Ln,Cn){return n(Cn,Cn,tr,Se,ae)}),isSticky:Ct}},[vt,jt,un,ae,tr,Se,ae,Ct]),vn=k.useMemo(function(){return Object(Y.a)(Object(Y.a)({},Mr),{},{tableLayout:Wt,rowClassName:nt,expandedRowClassName:ti,componentWidth:Jt,fixHeader:rt,fixColumn:Je,horizonScroll:De,expandIcon:fi,expandableType:ni,expandRowByClick:Qn,expandedRowRender:br,onTriggerExpand:ne,expandIconColumnIndex:Kr,indentSize:rr})},[Mr,Wt,nt,ti,Jt,rt,Je,De,fi,ni,Qn,br,ne,Kr,rr]),yr=k.useMemo(function(){return{onColumnResize:mt}},[mt]);return k.createElement(i.a.Provider,{value:Fn},k.createElement(F.Provider,{value:vn},k.createElement(Z.Provider,{value:yr},An)))}nn.Column=a.a,nn.ColumnGroup=u.a,nn.Summary=Ve.a,nn.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var xn=fe.b=nn},wRmb:function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return P});var q=D("rePB"),Y=D("KQm4"),U=D("VTBJ"),G=D("Ff2n"),M=D("q1tI"),k=D.n(M),K=D("Kwbf"),I=D("Zm9Q"),r=D("hW8S");function P(a){return Object(I.a)(a).filter(function(o){return M.isValidElement(o)}).map(function(o){var c=o.key,s=o.props,i=s.children,n=Object(G.a)(s,["children"]),O=Object(U.a)({key:c},n);return i&&(O.children=P(i)),O})}function _(a){return a.reduce(function(o,c){var s=c.fixed,i=s===!0?"left":s,n=c.children;return n&&n.length>0?[].concat(Object(Y.a)(o),Object(Y.a)(_(n).map(function(O){return Object(U.a)({fixed:i},O)}))):[].concat(Object(Y.a)(o),[Object(U.a)(Object(U.a)({},c),{},{fixed:i})])},[])}function p(a){for(var o=!0,c=0;c<a.length;c+=1){var s=a[c];if(o&&s.fixed!=="left")o=!1;else if(!o&&s.fixed==="left"){Object(K.a)(!1,"Index ".concat(c-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,n=a.length-1;n>=0;n-=1){var O=a[n];if(i&&O.fixed!=="right")i=!1;else if(!i&&O.fixed==="right"){Object(K.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function m(a){return a.map(function(o){var c=o.fixed,s=Object(G.a)(o,["fixed"]),i=c;return c==="left"?i="right":c==="right"&&(i="left"),Object(U.a)({fixed:i},s)})}function u(a,o){var c=a.prefixCls,s=a.columns,i=a.children,n=a.expandable,O=a.expandedKeys,T=a.getRowKey,w=a.onTriggerExpand,R=a.expandIcon,S=a.rowExpandable,v=a.expandIconColumnIndex,E=a.direction,f=a.expandRowByClick,h=M.useMemo(function(){return s||P(i)},[s,i]),y=M.useMemo(function(){if(n){var j,F=v||0,A=h[F],W=(j={},Object(q.a)(j,r.a,{className:"".concat(c,"-expand-icon-col")}),Object(q.a)(j,"title",""),Object(q.a)(j,"fixed",A?A.fixed:null),Object(q.a)(j,"className","".concat(c,"-row-expand-icon-cell")),Object(q.a)(j,"render",function(z,Z,le){var se=T(Z,le),Ce=O.has(se),Ee=S?S(Z):!0,Ie=R({prefixCls:c,expanded:Ce,expandable:Ee,record:Z,onExpand:w});return f?M.createElement("span",{onClick:function(Xe){return Xe.stopPropagation()}},Ie):Ie}),j),H=h.slice();return F>=0&&H.splice(F,0,W),H}return h},[n,h,T,O,R,E]),g=M.useMemo(function(){var j=y;return o&&(j=o(j)),j.length||(j=[{render:function(){return null}}]),j},[o,y,E]),x=M.useMemo(function(){return E==="rtl"?m(_(g)):_(g)},[g,E]);return[g,x]}fe.b=u},wwSX:function(Gt,fe,D){Gt.exports=D.p+"static/b2.2c844a2a.svg"},xOL1:function(Gt,fe){Gt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(Gt,fe,D){Gt.exports={flex_box_center:"flex_box_center___2oNqn",flex_space_between:"flex_space_between___eTRhm",flex_box_vertical_center:"flex_box_vertical_center___1jD6_",flex_box_center_end:"flex_box_center_end___3s_Sd",flex_box_column:"flex_box_column___11Wn_",form:"form___34z-w",btns:"btns___3O6K5",hackList:"hackList___2L3co",title:"title___2fVFF",subtitle:"subtitle___Ydv-g",efficiency:"efficiency___1wrjh"}},"y0+3":function(Gt,fe,D){"use strict";D.d(fe,"a",function(){return _}),D.d(fe,"b",function(){return m});var q=/margin|padding|width|height|max|min|offset/,Y={left:!0,top:!0},U={cssFloat:1,styleFloat:1,float:1};function G(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function M(u,a,o){if(a=a.toLowerCase(),o==="auto"){if(a==="height")return u.offsetHeight;if(a==="width")return u.offsetWidth}return a in Y||(Y[a]=q.test(a)),Y[a]?parseFloat(o)||0:o}function k(u,a){var o=arguments.length,c=G(u);return a=U[a]?"cssFloat"in u.style?"cssFloat":"styleFloat":a,o===1?c:M(u,a,c[a]||u.style[a])}function K(u,a,o){var c=arguments.length;if(a=U[a]?"cssFloat"in u.style?"cssFloat":"styleFloat":a,c===3)return typeof o=="number"&&q.test(a)&&(o="".concat(o,"px")),u.style[a]=o,o;for(var s in a)a.hasOwnProperty(s)&&K(u,s,a[s]);return G(u)}function I(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function r(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function P(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:a}}function _(){var u=document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return{width:u,height:a}}function p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(u){var a=u.getBoundingClientRect(),o=document.documentElement;return{left:a.left+(window.pageXOffset||o.scrollLeft)-(o.clientLeft||document.body.clientLeft||0),top:a.top+(window.pageYOffset||o.scrollTop)-(o.clientTop||document.body.clientTop||0)}}},"yTi+":function(Gt,fe,D){Gt.exports=D.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(Gt,fe,D){Gt.exports={flex_box_center:"flex_box_center___Joa_H",flex_space_between:"flex_space_between___3VhCy",flex_box_vertical_center:"flex_box_vertical_center___3wSNZ",flex_box_center_end:"flex_box_center_end___3z8HR",flex_box_column:"flex_box_column___KdHzx",form:"form___3KoYn",efficiency:"efficiency___1LMk4"}},zlzj:function(Gt,fe,D){Gt.exports=D.p+"static/b3.30079151.svg"}}]);
|