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.
206 lines
1.3 MiB
206 lines
1.3 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[105,3,5,7,8,13],{"+92d":function(zt,Ke,M){zt.exports=M.p+"static/b1.8d46544a.svg"},"+NIl":function(zt,Ke,M){(function(Q){Q(M("VrN/"))})(function(Q){"use strict";Q.defineMode("stex",function(z,I){"use strict";function B(d,o){d.cmdState.push(o)}function R(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function P(d){var o=d.cmdState.pop();o&&o.closeBracket()}function F(d){for(var o=d.cmdState,a=o.length-1;a>=0;a--){var u=o[a];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function D(d,o,a){return function(){this.name=d,this.bracketNo=0,this.style=o,this.styles=a,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var L={};L.importmodule=D("importmodule","tag",["string","builtin"]),L.documentclass=D("documentclass","tag",["","atom"]),L.usepackage=D("usepackage","tag",["atom"]),L.begin=D("begin","tag",["atom"]),L.end=D("end","tag",["atom"]),L.label=D("label","tag",["atom"]),L.ref=D("ref","tag",["atom"]),L.eqref=D("eqref","tag",["atom"]),L.cite=D("cite","tag",["atom"]),L.bibitem=D("bibitem","tag",["atom"]),L.Bibitem=D("Bibitem","tag",["atom"]),L.RBibitem=D("RBibitem","tag",["atom"]),L.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(d,o){d.f=o}function b(d,o){var a;if(d.match(/^\\[a-zA-Z@]+/)){var u=d.current().slice(1);return a=L.hasOwnProperty(u)?L[u]:L.DEFAULT,a=new a,B(o,a),A(o,h),a.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return A(o,function(i,n){return m(i,n,"\\]")}),"keyword";if(d.match("\\("))return A(o,function(i,n){return m(i,n,"\\)")}),"keyword";if(d.match("$$"))return A(o,function(i,n){return m(i,n,"$$")}),"keyword";if(d.match("$"))return A(o,function(i,n){return m(i,n,"$")}),"keyword";var s=d.next();if(s=="%")return d.skipToEnd(),"comment";if(s=="}"||s=="]"){if(a=R(o),a)a.closeBracket(s),A(o,h);else return"error";return"bracket"}else return s=="{"||s=="["?(a=L.DEFAULT,a=new a,B(o,a),"bracket"):/\d/.test(s)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),a=F(o),a.name=="begin"&&(a.argument=d.current()),a.styleIdentifier())}function m(d,o,a){if(d.eatSpace())return null;if(a&&d.match(a))return A(o,b),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=d.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(d.skipToEnd(),"comment"):"error"}function h(d,o){var a=d.peek(),u;return a=="{"||a=="["?(u=R(o),u.openBracket(a),d.eat(a),A(o,b),"bracket"):/[ \t\r]/.test(a)?(d.eat(a),null):(A(o,b),P(o),b(d,o))}return{startState:function(){var d=I.inMathMode?function(o,a){return m(o,a)}:b;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,o){return o.f(d,o)},blankLine:function(d){d.f=b,d.cmdState.length=0},lineComment:"%"}}),Q.defineMIME("text/x-stex","stex"),Q.defineMIME("text/x-latex","stex")})},"+ua5":function(zt,Ke,M){},"19Vz":function(zt,Ke,M){(function(Q){Q(M("VrN/"))})(function(Q){Q.defineOption("placeholder","",function(D,L,A){var b=A&&A!=Q.Init;if(L&&!b)D.on("blur",R),D.on("change",P),D.on("swapDoc",P),Q.on(D.getInputField(),"compositionupdate",D.state.placeholderCompose=function(){B(D)}),P(D);else if(!L&&b){D.off("blur",R),D.off("change",P),D.off("swapDoc",P),Q.off(D.getInputField(),"compositionupdate",D.state.placeholderCompose),z(D);var m=D.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}L&&!D.hasFocus()&&R(D)});function z(D){D.state.placeholder&&(D.state.placeholder.parentNode.removeChild(D.state.placeholder),D.state.placeholder=null)}function I(D){z(D);var L=D.state.placeholder=document.createElement("pre");L.style.cssText="height: 0; overflow: visible",L.style.direction=D.getOption("direction"),L.className="CodeMirror-placeholder CodeMirror-line-like";var A=D.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),L.appendChild(A),D.display.lineSpace.insertBefore(L,D.display.lineSpace.firstChild)}function B(D){setTimeout(function(){var L=!1,A=D.getInputField();A.nodeName=="TEXTAREA"?L=!A.value:D.lineCount()==1&&(L=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),L?I(D):z(D)},20)}function R(D){F(D)&&I(D)}function P(D){var L=D.getWrapperElement(),A=F(D);L.className=L.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?I(D):z(D)}function F(D){return D.lineCount()===1&&D.getLine(0)===""}})},"1ZF9":function(zt,Ke,M){zt.exports=M.p+"static/Authorize.cc9c212f.png"},"1eCo":function(zt,Ke,M){(function(Q){Q(M("VrN/"))})(function(Q){"use strict";var z={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Q.defineMode("xml",function(B,R){var P=B.indentUnit,F={},D=R.htmlMode?z:I;for(var L in D)F[L]=D[L];for(var L in R)F[L]=R[L];var A,b;function m(c,v){function p(U){return v.tokenize=U,U(c,v)}var E=c.next();if(E=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?p(o("atom","]]>")):null:c.match("--")?p(o("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),p(a(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),v.tokenize=o("meta","?>"),"meta"):(A=c.eat("/")?"closeTag":"openTag",v.tokenize=h,"tag bracket");if(E=="&"){var k;return c.eat("#")?c.eat("x")?k=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):k=c.eatWhile(/[\d]/)&&c.eat(";"):k=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),k?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function h(c,v){var p=c.next();if(p==">"||p=="/"&&c.eat(">"))return v.tokenize=m,A=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return A="equals",null;if(p=="<"){v.tokenize=m,v.state=n,v.tagName=v.tagStart=null;var E=v.tokenize(c,v);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(p)?(v.tokenize=d(p),v.stringStartCol=c.column(),v.tokenize(c,v)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(c){var v=function(p,E){for(;!p.eol();)if(p.next()==c){E.tokenize=h;break}return"string"};return v.isInAttribute=!0,v}function o(c,v){return function(p,E){for(;!p.eol();){if(p.match(v)){E.tokenize=m;break}p.next()}return c}}function a(c){return function(v,p){for(var E;(E=v.next())!=null;){if(E=="<")return p.tokenize=a(c+1),p.tokenize(v,p);if(E==">")if(c==1){p.tokenize=m;break}else return p.tokenize=a(c-1),p.tokenize(v,p)}return"meta"}}function u(c,v,p){this.prev=c.context,this.tagName=v,this.indent=c.indented,this.startOfLine=p,(F.doNotIndent.hasOwnProperty(v)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function s(c){c.context&&(c.context=c.context.prev)}function i(c,v){for(var p;;){if(!c.context)return;if(p=c.context.tagName,!F.contextGrabbers.hasOwnProperty(p)||!F.contextGrabbers[p].hasOwnProperty(v))return;s(c)}}function n(c,v,p){return c=="openTag"?(p.tagStart=v.column(),S):c=="closeTag"?C:n}function S(c,v,p){return c=="word"?(p.tagName=v.current(),b="tag",T):F.allowMissingTagName&&c=="endTag"?(b="tag bracket",T(c,v,p)):(b="error",S)}function C(c,v,p){if(c=="word"){var E=v.current();return p.context&&p.context.tagName!=E&&F.implicitlyClosed.hasOwnProperty(p.context.tagName)&&s(p),p.context&&p.context.tagName==E||F.matchClosing===!1?(b="tag",x):(b="tag error",w)}else return F.allowMissingTagName&&c=="endTag"?(b="tag bracket",x(c,v,p)):(b="error",w)}function x(c,v,p){return c!="endTag"?(b="error",x):(s(p),n)}function w(c,v,p){return b="error",x(c,v,p)}function T(c,v,p){if(c=="word")return b="attribute",_;if(c=="endTag"||c=="selfcloseTag"){var E=p.tagName,k=p.tagStart;return p.tagName=p.tagStart=null,c=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(E)?i(p,E):(i(p,E),p.context=new u(p,E,k==p.indented)),n}return b="error",T}function _(c,v,p){return c=="equals"?y:(F.allowMissing||(b="error"),T(c,v,p))}function y(c,v,p){return c=="string"?f:c=="word"&&F.allowUnquoted?(b="string",T):(b="error",T(c,v,p))}function f(c,v,p){return c=="string"?f:T(c,v,p)}return{startState:function(c){var v={tokenize:m,state:n,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(v.baseIndent=c),v},token:function(c,v){if(!v.tagName&&c.sol()&&(v.indented=c.indentation()),c.eatSpace())return null;A=null;var p=v.tokenize(c,v);return(p||A)&&p!="comment"&&(b=null,v.state=v.state(A||p,c,v),b&&(p=b=="error"?p+" error":b)),p},indent:function(c,v,p){var E=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+P;if(E&&E.noIndent)return Q.Pass;if(c.tokenize!=h&&c.tokenize!=m)return p?p.match(/^(\s*)/)[0].length:0;if(c.tagName)return F.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+P*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/<!\[CDATA\[/.test(v))return 0;var k=v&&/^<(\/)?([\w_:\.-]*)/.exec(v);if(k&&k[1])for(;E;)if(E.tagName==k[2]){E=E.prev;break}else if(F.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(k)for(;E;){var U=F.contextGrabbers[E.tagName];if(U&&U.hasOwnProperty(k[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+P:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(c){c.state==y&&(c.state=T)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var v=[],p=c.context;p;p=p.prev)p.tagName&&v.push(p.tagName);return v.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(zt,Ke,M){"use strict";M.d(Ke,"d",function(){return bn}),M.d(Ke,"b",function(){return de}),M.d(Ke,"c",function(){return ct}),M.d(Ke,"a",function(){return an});var Q=M("VTBJ"),z=M("1OyB"),I=M("vuIU"),B=M("JX7q"),R=M("Ji7U"),P=M("LK+K"),F=M("cDcd"),D=M("I8Z2"),L=M("BGR+"),A=M("wx14"),b=M("rePB"),m=M("4IlW"),h=M("2GS6"),d=M("Gytx"),o=M.n(d),a=M("TSYQ"),u=M.n(a),s=M("U8pU"),i=M("ODXe"),n=/iPhone/i,S=/iPod/i,C=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,w=/Android/i,T=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,y=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,v=/BB10/i,p=/Opera Mini/i,E=/\b(CriOS|Chrome)(?:.+)Mobile/i,k=/Mobile(?:.+)Firefox\b/i;function U(qt,st){return qt.test(st)}function H(qt){var st=qt||(typeof navigator!="undefined"?navigator.userAgent:""),pt=st.split("[FBAN");if(typeof pt[1]!="undefined"){var Qe=pt,ie=Object(i.a)(Qe,1);st=ie[0]}if(pt=st.split("Twitter"),typeof pt[1]!="undefined"){var be=pt,Ot=Object(i.a)(be,1);st=Ot[0]}var qe={apple:{phone:U(n,st)&&!U(y,st),ipod:U(S,st),tablet:!U(n,st)&&U(C,st)&&!U(y,st),device:(U(n,st)||U(S,st)||U(C,st))&&!U(y,st)},amazon:{phone:U(T,st),tablet:!U(T,st)&&U(_,st),device:U(T,st)||U(_,st)},android:{phone:!U(y,st)&&U(T,st)||!U(y,st)&&U(x,st),tablet:!U(y,st)&&!U(T,st)&&!U(x,st)&&(U(_,st)||U(w,st)),device:!U(y,st)&&(U(T,st)||U(_,st)||U(x,st)||U(w,st))||U(/\bokhttp\b/i,st)},windows:{phone:U(y,st),tablet:U(f,st),device:U(y,st)||U(f,st)},other:{blackberry:U(c,st),blackberry10:U(v,st),opera:U(p,st),firefox:U(k,st),chrome:U(E,st),device:U(c,st)||U(v,st)||U(p,st)||U(k,st)||U(E,st)},any:null,phone:null,tablet:null};return qe.any=qe.apple.device||qe.android.device||qe.windows.device||qe.other.device,qe.phone=qe.apple.phone||qe.android.phone||qe.windows.phone,qe.tablet=qe.apple.tablet||qe.android.tablet||qe.windows.tablet,qe}var W=Object(Q.a)(Object(Q.a)({},H()),{},{isMobile:H}),j=W;function O(){}function K(qt,st,pt){var Qe=st||"";return qt.key||"".concat(Qe,"item_").concat(pt)}function Y(qt){return"".concat(qt,"-menu-")}function ee(qt,st){var pt=-1;F.Children.forEach(qt,function(Qe){pt+=1,Qe&&Qe.type&&Qe.type.isMenuItemGroup?F.Children.forEach(Qe.props.children,function(ie){pt+=1,st(ie,pt)}):st(Qe,pt)})}function se(qt,st,pt){if(!qt||pt.find)return;F.Children.forEach(qt,function(Qe){if(Qe){var ie=Qe.type;if(!ie||!(ie.isSubMenu||ie.isMenuItem||ie.isMenuItemGroup))return;st.indexOf(Qe.key)!==-1?pt.find=!0:Qe.props.children&&se(Qe.props.children,st,pt)}})}var Be=["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"],me=function(st){var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Qe=st&&typeof st.getBoundingClientRect=="function"&&st.getBoundingClientRect().width;if(Qe){if(pt){var ie=getComputedStyle(st),be=ie.marginLeft,Ot=ie.marginRight;Qe+=+be.replace("px","")+ +Ot.replace("px","")}Qe=+Qe.toFixed(6)}return Qe||0},xe=function(st,pt,Qe){st&&Object(s.a)(st.style)==="object"&&(st.style[pt]=Qe)},Le=function(){return j.any},Ae=M("KQm4"),le=M("Ff2n"),fe=M("faye"),Ve=M("bdgK"),Lt=M("uciX"),Pt=M("8XRh"),vt={adjustX:1,adjustY:1},Fe={topLeft:{points:["bl","tl"],overflow:vt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:vt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:vt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:vt,offset:[4,0]}},_t={topLeft:{points:["bl","tl"],overflow:vt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:vt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:vt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:vt,offset:[4,0]}},tt=Fe,Rt=0,Ge={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ft=function(st,pt,Qe){var ie=Y(pt),be=st.getState();st.setState({defaultActiveFirst:Object(Q.a)(Object(Q.a)({},be.defaultActiveFirst),{},Object(b.a)({},ie,Qe))})},wt=function(qt){Object(R.a)(pt,qt);var st=Object(P.a)(pt);function pt(Qe){var ie;Object(z.a)(this,pt),ie=st.call(this,Qe),ie.onDestroy=function(Ce){ie.props.onDestroy(Ce)},ie.onKeyDown=function(Ce){var De=Ce.keyCode,mt=ie.menuInstance,Jt=ie.props,cn=Jt.isOpen,wn=Jt.store;if(De===m.a.ENTER)return ie.onTitleClick(Ce),Ft(wn,ie.props.eventKey,!0),!0;if(De===m.a.RIGHT)return cn?mt.onKeyDown(Ce):(ie.triggerOpenChange(!0),Ft(wn,ie.props.eventKey,!0)),!0;if(De===m.a.LEFT){var sa;if(cn)sa=mt.onKeyDown(Ce);else return;return sa||(ie.triggerOpenChange(!1),sa=!0),sa}return cn&&(De===m.a.UP||De===m.a.DOWN)?mt.onKeyDown(Ce):void 0},ie.onOpenChange=function(Ce){ie.props.onOpenChange(Ce)},ie.onPopupVisibleChange=function(Ce){ie.triggerOpenChange(Ce,Ce?"mouseenter":"mouseleave")},ie.onMouseEnter=function(Ce){var De=ie.props,mt=De.eventKey,Jt=De.onMouseEnter,cn=De.store;Ft(cn,ie.props.eventKey,!1),Jt({key:mt,domEvent:Ce})},ie.onMouseLeave=function(Ce){var De=ie.props,mt=De.parentMenu,Jt=De.eventKey,cn=De.onMouseLeave;mt.subMenuInstance=Object(B.a)(ie),cn({key:Jt,domEvent:Ce})},ie.onTitleMouseEnter=function(Ce){var De=ie.props,mt=De.eventKey,Jt=De.onItemHover,cn=De.onTitleMouseEnter;Jt({key:mt,hover:!0}),cn({key:mt,domEvent:Ce})},ie.onTitleMouseLeave=function(Ce){var De=ie.props,mt=De.parentMenu,Jt=De.eventKey,cn=De.onItemHover,wn=De.onTitleMouseLeave;mt.subMenuInstance=Object(B.a)(ie),cn({key:Jt,hover:!1}),wn({key:Jt,domEvent:Ce})},ie.onTitleClick=function(Ce){var De=Object(B.a)(ie),mt=De.props;if(mt.onTitleClick({key:mt.eventKey,domEvent:Ce}),mt.triggerSubMenuAction==="hover")return;ie.triggerOpenChange(!mt.isOpen,"click"),Ft(mt.store,ie.props.eventKey,!1)},ie.onSubMenuClick=function(Ce){typeof ie.props.onClick=="function"&&ie.props.onClick(ie.addKeyPath(Ce))},ie.onSelect=function(Ce){ie.props.onSelect(Ce)},ie.onDeselect=function(Ce){ie.props.onDeselect(Ce)},ie.getPrefixCls=function(){return"".concat(ie.props.rootPrefixCls,"-submenu")},ie.getActiveClassName=function(){return"".concat(ie.getPrefixCls(),"-active")},ie.getDisabledClassName=function(){return"".concat(ie.getPrefixCls(),"-disabled")},ie.getSelectedClassName=function(){return"".concat(ie.getPrefixCls(),"-selected")},ie.getOpenClassName=function(){return"".concat(ie.props.rootPrefixCls,"-submenu-open")},ie.saveMenuInstance=function(Ce){ie.menuInstance=Ce},ie.addKeyPath=function(Ce){return Object(Q.a)(Object(Q.a)({},Ce),{},{keyPath:(Ce.keyPath||[]).concat(ie.props.eventKey)})},ie.triggerOpenChange=function(Ce,De){var mt=ie.props.eventKey,Jt=function(){ie.onOpenChange({key:mt,item:Object(B.a)(ie),trigger:De,open:Ce})};De==="mouseenter"?ie.mouseenterTimeout=setTimeout(function(){Jt()},0):Jt()},ie.isChildrenSelected=function(){var Ce={find:!1};return se(ie.props.children,ie.props.selectedKeys,Ce),Ce.find},ie.isOpen=function(){return ie.props.openKeys.indexOf(ie.props.eventKey)!==-1},ie.adjustWidth=function(){if(!ie.subMenuTitle||!ie.menuInstance)return;var Ce=fe.findDOMNode(ie.menuInstance);if(Ce.offsetWidth>=ie.subMenuTitle.offsetWidth)return;Ce.style.minWidth="".concat(ie.subMenuTitle.offsetWidth,"px")},ie.saveSubMenuTitle=function(Ce){ie.subMenuTitle=Ce},ie.getBaseProps=function(){var Ce=Object(B.a)(ie),De=Ce.props;return{mode:De.mode==="horizontal"?"vertical":De.mode,visible:ie.props.isOpen,level:De.level+1,inlineIndent:De.inlineIndent,focusable:!1,onClick:ie.onSubMenuClick,onSelect:ie.onSelect,onDeselect:ie.onDeselect,onDestroy:ie.onDestroy,selectedKeys:De.selectedKeys,eventKey:"".concat(De.eventKey,"-menu-"),openKeys:De.openKeys,motion:De.motion,onOpenChange:ie.onOpenChange,subMenuOpenDelay:De.subMenuOpenDelay,parentMenu:Object(B.a)(ie),subMenuCloseDelay:De.subMenuCloseDelay,forceSubMenuRender:De.forceSubMenuRender,triggerSubMenuAction:De.triggerSubMenuAction,builtinPlacements:De.builtinPlacements,defaultActiveFirst:De.store.getState().defaultActiveFirst[Y(De.eventKey)],multiple:De.multiple,prefixCls:De.rootPrefixCls,id:ie.internalMenuId,manualRef:ie.saveMenuInstance,itemIcon:De.itemIcon,expandIcon:De.expandIcon,direction:De.direction}},ie.getMotion=function(Ce,De){var mt=Object(B.a)(ie),Jt=mt.haveRendered,cn=ie.props,wn=cn.motion,sa=cn.rootPrefixCls,zn=Object(Q.a)(Object(Q.a)({},wn),{},{leavedClassName:"".concat(sa,"-hidden"),removeOnLeave:!1,motionAppear:Jt||!De||Ce!=="inline"});return zn};var be=Qe.store,Ot=Qe.eventKey,qe=be.getState(),Bt=qe.defaultActiveFirst;ie.isRootMenu=!1;var Qt=!1;return Bt&&(Qt=Bt[Ot]),Ft(be,Ot,Qt),ie}return Object(I.a)(pt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ie=this,be=this.props,Ot=be.mode,qe=be.parentMenu,Bt=be.manualRef;if(Bt&&Bt(this),Ot!=="horizontal"||!qe.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ie.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ie=this.props,be=ie.onDestroy,Ot=ie.eventKey;be&&be(Ot),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ie){var be=this,Ot=this.getBaseProps(),qe=this.getMotion(Ot.mode,Ot.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ot.visible||Ot.forceSubMenuRender,!this.haveOpened)return F.createElement("div",null);var Bt=Ot.direction;return F.createElement(Pt.default,Object.assign({visible:Ot.visible},qe),function(Qt){var Ce=Qt.className,De=Qt.style,mt=u()("".concat(Ot.prefixCls,"-sub"),Ce,Object(b.a)({},"".concat(Ot.prefixCls,"-rtl"),Bt==="rtl"));return F.createElement(Ee,Object.assign({},Ot,{id:be.internalMenuId,className:mt,style:De}),ie)})}},{key:"render",value:function(){var ie,be=Object(Q.a)({},this.props),Ot=be.isOpen,qe=this.getPrefixCls(),Bt=be.mode==="inline",Qt=u()(qe,"".concat(qe,"-").concat(be.mode),(ie={},Object(b.a)(ie,be.className,!!be.className),Object(b.a)(ie,this.getOpenClassName(),Ot),Object(b.a)(ie,this.getActiveClassName(),be.active||Ot&&!Bt),Object(b.a)(ie,this.getDisabledClassName(),be.disabled),Object(b.a)(ie,this.getSelectedClassName(),this.isChildrenSelected()),ie));this.internalMenuId||(be.eventKey?this.internalMenuId="".concat(be.eventKey,"$Menu"):(Rt+=1,this.internalMenuId="$__$".concat(Rt,"$Menu")));var Ce={},De={},mt={};be.disabled||(Ce={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},De={onClick:this.onTitleClick},mt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Jt={},cn=be.direction;Bt&&(cn==="rtl"?Jt.paddingRight=be.inlineIndent*be.level:Jt.paddingLeft=be.inlineIndent*be.level);var wn={};this.props.isOpen&&(wn={"aria-owns":this.internalMenuId});var sa=null;be.mode!=="horizontal"&&(sa=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(sa=F.createElement(this.props.expandIcon,Object(Q.a)({},this.props))));var zn=F.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Jt,className:"".concat(qe,"-title"),role:"button"},mt,De,{"aria-expanded":Ot},wn,{"aria-haspopup":"true",title:typeof be.title=="string"?be.title:void 0}),be.title,sa||F.createElement("i",{className:"".concat(qe,"-arrow")})),En=this.renderChildren(be.children),ga=be.parentMenu.isRootMenu?be.parentMenu.props.getPopupContainer:function($a){return $a.parentNode},Ua=Ge[be.mode],ta=be.popupOffset?{offset:be.popupOffset}:{},la=be.mode==="inline"?"":be.popupClassName;la+=cn==="rtl"?" ".concat(qe,"-rtl"):"";var Ra=be.disabled,Xa=be.triggerSubMenuAction,vr=be.subMenuOpenDelay,rn=be.forceSubMenuRender,Xn=be.subMenuCloseDelay,hr=be.builtinPlacements;Be.forEach(function($a){return delete be[$a]}),delete be.onClick;var xr=cn==="rtl"?Object.assign({},_t,hr):Object.assign({},Fe,hr);return delete be.direction,F.createElement("li",Object.assign({},be,Ce,{className:Qt,role:"menuitem"}),Bt&&zn,Bt&&En,!Bt&&F.createElement(Lt.a,{prefixCls:qe,popupClassName:u()("".concat(qe,"-popup"),la),getPopupContainer:ga,builtinPlacements:xr,popupPlacement:Ua,popupVisible:Ot,popupAlign:ta,popup:En,action:Ra?[]:[Xa],mouseEnterDelay:vr,mouseLeaveDelay:Xn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:rn},zn))}}]),pt}(F.Component);wt.defaultProps={onMouseEnter:O,onMouseLeave:O,onTitleMouseEnter:O,onTitleMouseLeave:O,onTitleClick:O,manualRef:O,mode:"vertical",title:""};var yt=Object(D.b)(function(qt,st){var pt=qt.openKeys,Qe=qt.activeKey,ie=qt.selectedKeys,be=st.eventKey,Ot=st.subMenuKey;return{isOpen:pt.indexOf(be)>-1,active:Qe[Ot]===be,selectedKeys:ie}})(wt);yt.isSubMenu=!0;var bn=yt,un="menuitem-overflowed",sn=.5,Ye=function(qt){Object(R.a)(pt,qt);var st=Object(P.a)(pt);function pt(){var Qe;return Object(z.a)(this,pt),Qe=st.apply(this,arguments),Qe.resizeObserver=null,Qe.mutationObserver=null,Qe.originalTotalWidth=0,Qe.overflowedItems=[],Qe.menuItemSizes=[],Qe.cancelFrameId=null,Qe.state={lastVisibleIndex:void 0},Qe.getMenuItemNodes=function(){var ie=Qe.props.prefixCls,be=fe.findDOMNode(Object(B.a)(Qe));return be?[].slice.call(be.children).filter(function(Ot){return Ot.className.split(" ").indexOf("".concat(ie,"-overflowed-submenu"))<0}):[]},Qe.getOverflowedSubMenuItem=function(ie,be,Ot){var qe=Qe.props,Bt=qe.overflowedIndicator,Qt=qe.level,Ce=qe.mode,De=qe.prefixCls,mt=qe.theme;if(Qt!==1||Ce!=="horizontal")return null;var Jt=Qe.props.children[0],cn=Jt.props,wn=cn.children,sa=cn.title,zn=cn.style,En=Object(le.a)(cn,["children","title","style"]),ga=Object(Q.a)({},zn),Ua="".concat(ie,"-overflowed-indicator"),ta="".concat(ie,"-overflowed-indicator");be.length===0&&Ot!==!0?ga=Object(Q.a)(Object(Q.a)({},ga),{},{display:"none"}):Ot&&(ga=Object(Q.a)(Object(Q.a)({},ga),{},{visibility:"hidden",position:"absolute"}),Ua="".concat(Ua,"-placeholder"),ta="".concat(ta,"-placeholder"));var la=mt?"".concat(De,"-").concat(mt):"",Ra={};return Be.forEach(function(Xa){En[Xa]!==void 0&&(Ra[Xa]=En[Xa])}),F.createElement(bn,Object.assign({title:Bt,className:"".concat(De,"-overflowed-submenu"),popupClassName:la},Ra,{key:Ua,eventKey:ta,disabled:!1,style:ga}),be)},Qe.setChildrenWidthAndResize=function(){if(Qe.props.mode!=="horizontal")return;var ie=fe.findDOMNode(Object(B.a)(Qe));if(!ie)return;var be=ie.children;if(!be||be.length===0)return;var Ot=ie.children[be.length-1];xe(Ot,"display","inline-block");var qe=Qe.getMenuItemNodes(),Bt=qe.filter(function(Qt){return Qt.className.split(" ").indexOf(un)>=0});Bt.forEach(function(Qt){xe(Qt,"display","inline-block")}),Qe.menuItemSizes=qe.map(function(Qt){return me(Qt,!0)}),Bt.forEach(function(Qt){xe(Qt,"display","none")}),Qe.overflowedIndicatorWidth=me(ie.children[ie.children.length-1],!0),Qe.originalTotalWidth=Qe.menuItemSizes.reduce(function(Qt,Ce){return Qt+Ce},0),Qe.handleResize(),xe(Ot,"display","none")},Qe.handleResize=function(){if(Qe.props.mode!=="horizontal")return;var ie=fe.findDOMNode(Object(B.a)(Qe));if(!ie)return;var be=me(ie);Qe.overflowedItems=[];var Ot=0,qe;Qe.originalTotalWidth>be+sn&&(qe=-1,Qe.menuItemSizes.forEach(function(Bt){Ot+=Bt,Ot+Qe.overflowedIndicatorWidth<=be&&(qe+=1)})),Qe.setState({lastVisibleIndex:qe})},Qe}return Object(I.a)(pt,[{key:"componentDidMount",value:function(){var ie=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var be=fe.findDOMNode(this);if(!be)return;this.resizeObserver=new Ve.default(function(Ot){Ot.forEach(function(){var qe=ie.cancelFrameId;cancelAnimationFrame(qe),ie.cancelFrameId=requestAnimationFrame(ie.setChildrenWidthAndResize)})}),[].slice.call(be.children).concat(be).forEach(function(Ot){ie.resizeObserver.observe(Ot)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ie.resizeObserver.disconnect(),[].slice.call(be.children).concat(be).forEach(function(Ot){ie.resizeObserver.observe(Ot)}),ie.setChildrenWidthAndResize()}),this.mutationObserver.observe(be,{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(ie){var be=this,Ot=this.state.lastVisibleIndex;return(ie||[]).reduce(function(qe,Bt,Qt){var Ce=Bt;if(be.props.mode==="horizontal"){var De=be.getOverflowedSubMenuItem(Bt.props.eventKey,[]);Ot!==void 0&&be.props.className.indexOf("".concat(be.props.prefixCls,"-root"))!==-1&&(Qt>Ot&&(Ce=F.cloneElement(Bt,{style:{display:"none"},eventKey:"".concat(Bt.props.eventKey,"-hidden"),className:"".concat(un)})),Qt===Ot+1&&(be.overflowedItems=ie.slice(Ot+1).map(function(Jt){return F.cloneElement(Jt,{key:Jt.props.eventKey,mode:"vertical-left"})}),De=be.getOverflowedSubMenuItem(Bt.props.eventKey,be.overflowedItems)));var mt=[].concat(Object(Ae.a)(qe),[De,Ce]);return Qt===ie.length-1&&mt.push(be.getOverflowedSubMenuItem(Bt.props.eventKey,[],!0)),mt}return[].concat(Object(Ae.a)(qe),[Ce])},[])}},{key:"render",value:function(){var ie=this.props,be=ie.visible,Ot=ie.prefixCls,qe=ie.overflowedIndicator,Bt=ie.mode,Qt=ie.level,Ce=ie.tag,De=ie.children,mt=ie.theme,Jt=Object(le.a)(ie,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),cn=Ce;return F.createElement(cn,Object.assign({},Jt),this.renderChildren(De))}}]),pt}(F.Component);Ye.defaultProps={tag:"div",className:""};var nn=Ye;function An(qt){return qt.length?qt.every(function(st){return!!st.props.disabled}):!0}function ke(qt,st,pt){var Qe=qt.getState();qt.setState({activeKey:Object(Q.a)(Object(Q.a)({},Qe.activeKey),{},Object(b.a)({},st,pt))})}function Pe(qt){return qt.eventKey||"0-menu-"}function rt(qt,st){var pt=st,Qe=qt.children,ie=qt.eventKey;if(pt){var be;if(ee(Qe,function(Ot,qe){Ot&&Ot.props&&!Ot.props.disabled&&pt===K(Ot,ie,qe)&&(be=!0)}),be)return pt}return pt=null,qt.defaultActiveFirst&&ee(Qe,function(Ot,qe){!pt&&Ot&&!Ot.props.disabled&&(pt=K(Ot,ie,qe))}),pt}function ht(qt){if(qt){var st=this.instanceArray.indexOf(qt);st!==-1?this.instanceArray[st]=qt:this.instanceArray.push(qt)}}var Ue=function(qt){Object(R.a)(pt,qt);var st=Object(P.a)(pt);function pt(Qe){var ie;return Object(z.a)(this,pt),ie=st.call(this,Qe),ie.onKeyDown=function(be,Ot){var qe=be.keyCode,Bt;if(ie.getFlatInstanceArray().forEach(function(Ce){Ce&&Ce.props.active&&Ce.onKeyDown&&(Bt=Ce.onKeyDown(be))}),Bt)return 1;var Qt=null;return(qe===m.a.UP||qe===m.a.DOWN)&&(Qt=ie.step(qe===m.a.UP?-1:1)),Qt?(be.preventDefault(),ke(ie.props.store,Pe(ie.props),Qt.props.eventKey),typeof Ot=="function"&&Ot(Qt),1):void 0},ie.onItemHover=function(be){var Ot=be.key,qe=be.hover;ke(ie.props.store,Pe(ie.props),qe?Ot:null)},ie.onDeselect=function(be){ie.props.onDeselect(be)},ie.onSelect=function(be){ie.props.onSelect(be)},ie.onClick=function(be){ie.props.onClick(be)},ie.onOpenChange=function(be){ie.props.onOpenChange(be)},ie.onDestroy=function(be){ie.props.onDestroy(be)},ie.getFlatInstanceArray=function(){return ie.instanceArray},ie.step=function(be){var Ot=ie.getFlatInstanceArray(),qe=ie.props.store.getState().activeKey[Pe(ie.props)],Bt=Ot.length;if(!Bt)return null;be<0&&(Ot=Ot.concat().reverse());var Qt=-1;if(Ot.every(function(Jt,cn){return Jt&&Jt.props.eventKey===qe?(Qt=cn,!1):!0}),!ie.props.defaultActiveFirst&&Qt!==-1&&An(Ot.slice(Qt,Bt-1)))return;var Ce=(Qt+1)%Bt,De=Ce;do{var mt=Ot[De];if(!mt||mt.props.disabled)De=(De+1)%Bt;else return mt}while(De!==Ce);return null},ie.renderCommonMenuItem=function(be,Ot,qe){var Bt=ie.props.store.getState(),Qt=Object(B.a)(ie),Ce=Qt.props,De=K(be,Ce.eventKey,Ot),mt=be.props;if(!mt||typeof be.type=="string")return be;var Jt=De===Bt.activeKey,cn=Object(Q.a)(Object(Q.a)({mode:mt.mode||Ce.mode,level:Ce.level,inlineIndent:Ce.inlineIndent,renderMenuItem:ie.renderMenuItem,rootPrefixCls:Ce.prefixCls,index:Ot,parentMenu:Ce.parentMenu,manualRef:mt.disabled?void 0:Object(h.a)(be.ref,ht.bind(Object(B.a)(ie))),eventKey:De,active:!mt.disabled&&Jt,multiple:Ce.multiple,onClick:function(sa){(mt.onClick||O)(sa),ie.onClick(sa)},onItemHover:ie.onItemHover,motion:Ce.motion,subMenuOpenDelay:Ce.subMenuOpenDelay,subMenuCloseDelay:Ce.subMenuCloseDelay,forceSubMenuRender:Ce.forceSubMenuRender,onOpenChange:ie.onOpenChange,onDeselect:ie.onDeselect,onSelect:ie.onSelect,builtinPlacements:Ce.builtinPlacements,itemIcon:mt.itemIcon||ie.props.itemIcon,expandIcon:mt.expandIcon||ie.props.expandIcon},qe),{},{direction:Ce.direction});return(Ce.mode==="inline"||Le())&&(cn.triggerSubMenuAction="click"),F.cloneElement(be,cn)},ie.renderMenuItem=function(be,Ot,qe){if(!be)return null;var Bt=ie.props.store.getState(),Qt={openKeys:Bt.openKeys,selectedKeys:Bt.selectedKeys,triggerSubMenuAction:ie.props.triggerSubMenuAction,subMenuKey:qe};return ie.renderCommonMenuItem(be,Ot,Qt)},Qe.store.setState({activeKey:Object(Q.a)(Object(Q.a)({},Qe.store.getState().activeKey),{},Object(b.a)({},Qe.eventKey,rt(Qe,Qe.activeKey)))}),ie.instanceArray=[],ie}return Object(I.a)(pt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ie){return this.props.visible||ie.visible||this.props.className!==ie.className||!o()(this.props.style,ie.style)}},{key:"componentDidUpdate",value:function(ie){var be=this.props,Ot="activeKey"in be?be.activeKey:be.store.getState().activeKey[Pe(be)],qe=rt(be,Ot);if(qe!==Ot)ke(be.store,Pe(be),qe);else if("activeKey"in ie){var Bt=rt(ie,ie.activeKey);qe!==Bt&&ke(be.store,Pe(be),qe)}}},{key:"render",value:function(){var ie=this,be=Object(A.a)({},this.props);this.instanceArray=[];var Ot=u()(be.prefixCls,be.className,"".concat(be.prefixCls,"-").concat(be.mode)),qe={className:Ot,role:be.role||"menu"};be.id&&(qe.id=be.id),be.focusable&&(qe.tabIndex=0,qe.onKeyDown=this.onKeyDown);var Bt=be.prefixCls,Qt=be.eventKey,Ce=be.visible,De=be.level,mt=be.mode,Jt=be.overflowedIndicator,cn=be.theme;return Be.forEach(function(wn){return delete be[wn]}),delete be.onClick,F.createElement(nn,Object.assign({},be,{prefixCls:Bt,mode:mt,tag:"ul",level:De,theme:cn,visible:Ce,overflowedIndicator:Jt},qe),F.Children.map(be.children,function(wn,sa){return ie.renderMenuItem(wn,sa,Qt||"0-menu-")}))}}]),pt}(F.Component);Ue.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:O};var ut=Object(D.b)()(Ue),Ee=ut,ce=M("Kwbf");function he(qt,st,pt){var Qe=qt.prefixCls,ie=qt.motion,be=qt.defaultMotions,Ot=be===void 0?{}:be,qe=qt.openAnimation,Bt=qt.openTransitionName,Qt=st.switchingModeFromInline;if(ie)return ie;if(Object(s.a)(qe)==="object"&&qe)Object(ce.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof qe=="string")return{motionName:"".concat(Qe,"-open-").concat(qe)};if(Bt)return{motionName:Bt};var Ce=Ot[pt];return Ce||(Qt?null:Ot.other)}var J=function(qt){Object(R.a)(pt,qt);var st=Object(P.a)(pt);function pt(Qe){var ie;Object(z.a)(this,pt),ie=st.call(this,Qe),ie.inlineOpenKeys=[],ie.onSelect=function(qe){var Bt=Object(B.a)(ie),Qt=Bt.props;if(Qt.selectable){var Ce=ie.store.getState(),De=Ce.selectedKeys,mt=qe.key;Qt.multiple?De=De.concat([mt]):De=[mt],"selectedKeys"in Qt||ie.store.setState({selectedKeys:De}),Qt.onSelect(Object(Q.a)(Object(Q.a)({},qe),{},{selectedKeys:De}))}},ie.onClick=function(qe){var Bt=ie.getRealMenuMode(),Qt=Object(B.a)(ie),Ce=Qt.store,De=Qt.props.onOpenChange;Bt!=="inline"&&!("openKeys"in ie.props)&&(Ce.setState({openKeys:[]}),De([])),ie.props.onClick(qe)},ie.onKeyDown=function(qe,Bt){ie.innerMenu.getWrappedInstance().onKeyDown(qe,Bt)},ie.onOpenChange=function(qe){var Bt=Object(B.a)(ie),Qt=Bt.props,Ce=ie.store.getState().openKeys.concat(),De=!1,mt=function(cn){var wn=!1;if(cn.open)wn=Ce.indexOf(cn.key)===-1,wn&&Ce.push(cn.key);else{var sa=Ce.indexOf(cn.key);wn=sa!==-1,wn&&Ce.splice(sa,1)}De=De||wn};Array.isArray(qe)?qe.forEach(mt):mt(qe),De&&("openKeys"in ie.props||ie.store.setState({openKeys:Ce}),Qt.onOpenChange(Ce))},ie.onDeselect=function(qe){var Bt=Object(B.a)(ie),Qt=Bt.props;if(Qt.selectable){var Ce=ie.store.getState().selectedKeys.concat(),De=qe.key,mt=Ce.indexOf(De);mt!==-1&&Ce.splice(mt,1),"selectedKeys"in Qt||ie.store.setState({selectedKeys:Ce}),Qt.onDeselect(Object(Q.a)(Object(Q.a)({},qe),{},{selectedKeys:Ce}))}},ie.onMouseEnter=function(qe){ie.restoreModeVerticalFromInline();var Bt=ie.props.onMouseEnter;Bt&&Bt(qe)},ie.onTransitionEnd=function(qe){var Bt=qe.propertyName==="width"&&qe.target===qe.currentTarget,Qt=qe.target.className,Ce=Object.prototype.toString.call(Qt)==="[object SVGAnimatedString]"?Qt.animVal:Qt,De=qe.propertyName==="font-size"&&Ce.indexOf("anticon")>=0;(Bt||De)&&ie.restoreModeVerticalFromInline()},ie.setInnerMenu=function(qe){ie.innerMenu=qe},ie.isRootMenu=!0;var be=Qe.defaultSelectedKeys,Ot=Qe.defaultOpenKeys;return"selectedKeys"in Qe&&(be=Qe.selectedKeys||[]),"openKeys"in Qe&&(Ot=Qe.openKeys||[]),ie.store=Object(D.c)({selectedKeys:be,openKeys:Ot,activeKey:{"0-menu-":rt(Qe,Qe.activeKey)}}),ie.state={switchingModeFromInline:!1},ie}return Object(I.a)(pt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ie){this.updateOpentKeysWhenSwitchMode(ie),this.updateMiniStore();var be=this.props,Ot=be.siderCollapsed,qe=be.inlineCollapsed,Bt=be.onOpenChange;(!ie.inlineCollapsed&&qe||!ie.siderCollapsed&&Ot)&&Bt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ie){var be=this.props,Ot=this.store,qe=this.inlineOpenKeys,Bt=Ot.getState(),Qt={};ie.mode==="inline"&&be.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in be||((be.inlineCollapsed&&!ie.inlineCollapsed||be.siderCollapsed&&!ie.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Bt.openKeys.concat(),Qt.openKeys=[]),(!be.inlineCollapsed&&ie.inlineCollapsed||!be.siderCollapsed&&ie.siderCollapsed)&&(Qt.openKeys=qe,this.inlineOpenKeys=[])),Object.keys(Qt).length&&Ot.setState(Qt)}},{key:"updateMenuDisplay",value:function(){var ie=this.props.collapsedWidth,be=this.store,Ot=this.prevOpenKeys,qe=this.getInlineCollapsed()&&(ie===0||ie==="0"||ie==="0px");qe?(this.prevOpenKeys=be.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Ot&&(this.store.setState({openKeys:Ot}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ie=this.props.mode,be=this.state.switchingModeFromInline,Ot=this.getInlineCollapsed();return be&&Ot?"inline":Ot?"vertical":ie}},{key:"getInlineCollapsed",value:function(){var ie=this.props,be=ie.inlineCollapsed,Ot=ie.siderCollapsed;return Ot!==void 0?Ot:be}},{key:"restoreModeVerticalFromInline",value:function(){var ie=this.state.switchingModeFromInline;ie&&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 ie=Object(Q.a)({},Object(L.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),be=this.getRealMenuMode();return ie.className+=" ".concat(ie.prefixCls,"-root"),ie.direction==="rtl"&&(ie.className+=" ".concat(ie.prefixCls,"-rtl")),ie=Object(Q.a)(Object(Q.a)({},ie),{},{mode:be,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:he(this.props,this.state,be)}),delete ie.openAnimation,delete ie.openTransitionName,F.createElement(D.a,{store:this.store},F.createElement(Ee,Object.assign({},ie,{ref:this.setInnerMenu}),this.props.children))}}]),pt}(F.Component);J.defaultProps={selectable:!0,onClick:O,onSelect:O,onOpenChange:O,onDeselect:O,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:F.createElement("span",null,"\xB7\xB7\xB7")};var Z=J,re=function(qt){Object(R.a)(pt,qt);var st=Object(P.a)(pt);function pt(){var Qe;return Object(z.a)(this,pt),Qe=st.apply(this,arguments),Qe.onKeyDown=function(ie){var be=ie.keyCode;return be===m.a.ENTER?(Qe.onClick(ie),!0):void 0},Qe.onMouseLeave=function(ie){var be=Qe.props,Ot=be.eventKey,qe=be.onItemHover,Bt=be.onMouseLeave;qe({key:Ot,hover:!1}),Bt({key:Ot,domEvent:ie})},Qe.onMouseEnter=function(ie){var be=Qe.props,Ot=be.eventKey,qe=be.onItemHover,Bt=be.onMouseEnter;qe({key:Ot,hover:!0}),Bt({key:Ot,domEvent:ie})},Qe.onClick=function(ie){var be=Qe.props,Ot=be.eventKey,qe=be.multiple,Bt=be.onClick,Qt=be.onSelect,Ce=be.onDeselect,De=be.isSelected,mt={key:Ot,keyPath:[Ot],item:Object(B.a)(Qe),domEvent:ie};Bt(mt),qe?De?Ce(mt):Qt(mt):De||Qt(mt)},Qe.saveNode=function(ie){Qe.node=ie},Qe}return Object(I.a)(pt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ie=this.props;ie.onDestroy&&ie.onDestroy(ie.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 ie,be=Object(Q.a)({},this.props),Ot=u()(this.getPrefixCls(),be.className,(ie={},Object(b.a)(ie,this.getActiveClassName(),!be.disabled&&be.active),Object(b.a)(ie,this.getSelectedClassName(),be.isSelected),Object(b.a)(ie,this.getDisabledClassName(),be.disabled),ie)),qe=Object(Q.a)(Object(Q.a)({},be.attribute),{},{title:typeof be.title=="string"?be.title:void 0,className:Ot,role:be.role||"menuitem","aria-disabled":be.disabled});be.role==="option"?qe=Object(Q.a)(Object(Q.a)({},qe),{},{role:"option","aria-selected":be.isSelected}):(be.role===null||be.role==="none")&&(qe.role="none");var Bt={onClick:be.disabled?null:this.onClick,onMouseLeave:be.disabled?null:this.onMouseLeave,onMouseEnter:be.disabled?null:this.onMouseEnter},Qt=Object(Q.a)({},be.style);be.mode==="inline"&&(be.direction==="rtl"?Qt.paddingRight=be.inlineIndent*be.level:Qt.paddingLeft=be.inlineIndent*be.level),Be.forEach(function(De){return delete be[De]}),delete be.direction;var Ce=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ce=F.createElement(this.props.itemIcon,this.props)),F.createElement("li",Object.assign({},Object(L.default)(be,["onClick","onMouseEnter","onMouseLeave","onSelect"]),qe,Bt,{style:Qt,ref:this.saveNode}),be.children,Ce)}}]),pt}(F.Component);re.isMenuItem=!0,re.defaultProps={onSelect:O,onMouseEnter:O,onMouseLeave:O,manualRef:O};var ue=Object(D.b)(function(qt,st){var pt=qt.activeKey,Qe=qt.selectedKeys,ie=st.eventKey,be=st.subMenuKey;return{active:pt[be]===ie,isSelected:Qe.indexOf(ie)!==-1}})(re),de=ue,Ne=function(qt){Object(R.a)(pt,qt);var st=Object(P.a)(pt);function pt(){var Qe;return Object(z.a)(this,pt),Qe=st.apply(this,arguments),Qe.renderInnerMenuItem=function(ie){var be=Qe.props,Ot=be.renderMenuItem,qe=be.index;return Ot(ie,qe,Qe.props.subMenuKey)},Qe}return Object(I.a)(pt,[{key:"render",value:function(){var ie=Object(A.a)({},this.props),be=ie.className,Ot=be===void 0?"":be,qe=ie.rootPrefixCls,Bt="".concat(qe,"-item-group-title"),Qt="".concat(qe,"-item-group-list"),Ce=ie.title,De=ie.children;return Be.forEach(function(mt){return delete ie[mt]}),delete ie.onClick,delete ie.direction,F.createElement("li",Object.assign({},ie,{className:"".concat(Ot," ").concat(qe,"-item-group")}),F.createElement("div",{className:Bt,title:typeof Ce=="string"?Ce:void 0},Ce),F.createElement("ul",{className:Qt},F.Children.map(De,this.renderInnerMenuItem)))}}]),pt}(F.Component);Ne.isMenuItemGroup=!0,Ne.defaultProps={disabled:!0};var ct=Ne,Gt=function(st){var pt=st.className,Qe=st.rootPrefixCls,ie=st.style;return F.createElement("li",{className:"".concat(pt," ").concat(Qe,"-item-divider"),style:ie})};Gt.defaultProps={disabled:!0,className:"",style:{}};var an=Gt,it=Ke.e=Z},"4wi7":function(zt,Ke,M){"use strict";var Q=M("14J3"),z=M("BMrR"),I=M("sRBo"),B=M("kaz8"),R=M("5NDa"),P=M("5rEg"),F=M("9og8"),D=M("tJVT"),L=M("WmNS"),A=M.n(L),b=M("cDcd"),m=M.n(b),h=M("oOBs"),d=M.n(h),o=M("xOL1"),a=M.n(o),u=M("BdwD"),s=function(n){var S=n.data,C=n.value,x=C===void 0?[]:C,w=n.handleChangePage,T=n.setSelectedRowKeys,_=n.selectedRowKeys,y=n.onChange,f=y===void 0?function(){}:y,c=Object(b.useState)([]),v=Object(D.a)(c,2),p=v[0],E=v[1],k=Object(b.useState)([]),U=Object(D.a)(k,2),H=U[0],W=U[1],j=Object(b.useState)([]),O=Object(D.a)(j,2),K=O[0],Y=O[1],ee=Object(b.useState)(1),se=Object(D.a)(ee,2),Be=se[0],me=se[1],xe=Object(b.useState)(),Le=Object(D.a)(xe,2),Ae=Le[0],le=Le[1];return Object(b.useEffect)(function(){E(S),W([]),Y([])},[S]),Object(b.useEffect)(function(){T&&(W(_),Y(_))},[_]),m.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},m.a.createElement("div",{className:d.a.leftdiv},m.a.createElement(P.a.Search,{size:"large",onChange:function(){var fe=Object(F.a)(A.a.mark(function Ve(Lt){return A.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:E(S.filter(function(Fe){var _t;return Fe==null||((_t=Fe.name)===null||_t===void 0)?void 0:_t.includes(Lt.target.value)}));case 1:case"end":return vt.stop()}},Ve)}));return function(Ve){return fe.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),p.length===0&&m.a.createElement(u.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),m.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},m.a.createElement(B.a.Group,{value:H.map(function(fe){return"".concat(fe.id)}),onChange:function(Ve){T(p.filter(function(Lt){return Ve.includes("".concat(Lt.id))}))},style:{marginTop:"10px"}},p.map(function(fe,Ve){return m.a.createElement(z.a,{key:fe.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},m.a.createElement(B.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:fe.is_published,value:"".concat(fe.id)},m.a.createElement("div",{className:d.a.listClass},m.a.createElement("span",{className:d.a.spantitle,style:{width:fe.is_published?"108px":"170px"}},fe.name),fe.is_published&&m.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),m.a.createElement("div",{className:d.a.rightdiv},m.a.createElement(P.a.Search,{onChange:function(Ve){Y(H.filter(function(Lt){return Lt.name.includes(Ve.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),K.length===0&&m.a.createElement(u.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),K.length>0&&m.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},m.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},K.map(function(fe,Ve){return m.a.createElement(z.a,{justify:"space-between",style:{marginTop:"10px"},key:fe.id},m.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},fe.name),m.a.createElement("img",{src:a.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){T(H.filter(function(Pt){return"".concat(Pt.id)!="".concat(fe.id)}))}}))})))))};Ke.a=s},"55Ip":function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return i});var Q=M("Ty5D"),z=M("dI71"),I=M("cDcd"),B=M.n(I),R=M("YS25"),P=M("17x9"),F=M.n(P),D=M("wx14"),L=M("zLVn"),A=M("9R94"),b=function(y){Object(z.a)(f,y);function f(){for(var v,p=arguments.length,E=new Array(p),k=0;k<p;k++)E[k]=arguments[k];return v=y.call.apply(y,[this].concat(E))||this,v.history=Object(R.a)(v.props),v}var c=f.prototype;return c.render=function(){return B.a.createElement(Q.c,{history:this.history,children:this.props.children})},f}(B.a.Component),m=function(y){Object(z.a)(f,y);function f(){for(var v,p=arguments.length,E=new Array(p),k=0;k<p;k++)E[k]=arguments[k];return v=y.call.apply(y,[this].concat(E))||this,v.history=Object(R.b)(v.props),v}var c=f.prototype;return c.render=function(){return B.a.createElement(Q.c,{history:this.history,children:this.props.children})},f}(B.a.Component),h=function(f,c){return typeof f=="function"?f(c):f},d=function(f,c){return typeof f=="string"?Object(R.c)(f,null,null,c):f},o=function(f){return f},a=B.a.forwardRef;typeof a=="undefined"&&(a=o);function u(y){return!!(y.metaKey||y.altKey||y.ctrlKey||y.shiftKey)}var s=a(function(y,f){var c=y.innerRef,v=y.navigate,p=y.onClick,E=Object(L.a)(y,["innerRef","navigate","onClick"]),k=E.target,U=Object(D.a)({},E,{onClick:function(W){try{p&&p(W)}catch(j){throw W.preventDefault(),j}!W.defaultPrevented&&W.button===0&&(!k||k==="_self")&&!u(W)&&(W.preventDefault(),v())}});return o!==a?U.ref=f||c:U.ref=c,B.a.createElement("a",U)}),i=a(function(y,f){var c=y.component,v=c===void 0?s:c,p=y.replace,E=y.to,k=y.innerRef,U=Object(L.a)(y,["component","replace","to","innerRef"]);return B.a.createElement(Q.e.Consumer,null,function(H){H||Object(A.a)(!1);var W=H.history,j=d(h(E,H.location),H.location),O=j?W.createHref(j):"",K=Object(D.a)({},U,{href:O,navigate:function(){var ee=h(E,H.location),se=p?W.replace:W.push;se(ee)}});return o!==a?K.ref=f||k:K.innerRef=k,B.a.createElement(v,K)})});if(!1)var n,S;var C=function(f){return f},x=B.a.forwardRef;typeof x=="undefined"&&(x=C);function w(){for(var y=arguments.length,f=new Array(y),c=0;c<y;c++)f[c]=arguments[c];return f.filter(function(v){return v}).join(" ")}var T=x(function(y,f){var c=y["aria-current"],v=c===void 0?"page":c,p=y.activeClassName,E=p===void 0?"active":p,k=y.activeStyle,U=y.className,H=y.exact,W=y.isActive,j=y.location,O=y.sensitive,K=y.strict,Y=y.style,ee=y.to,se=y.innerRef,Be=Object(L.a)(y,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return B.a.createElement(Q.e.Consumer,null,function(me){me||Object(A.a)(!1);var xe=j||me.location,Le=d(h(ee,xe),xe),Ae=Le.pathname,le=Ae&&Ae.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),fe=le?Object(Q.f)(xe.pathname,{path:le,exact:H,sensitive:O,strict:K}):null,Ve=!!(W?W(fe,xe):fe),Lt=Ve?w(U,E):U,Pt=Ve?Object(D.a)({},Y,{},k):Y,vt=Object(D.a)({"aria-current":Ve&&v||null,className:Lt,style:Pt,to:Le},Be);return C!==x?vt.ref=f||se:vt.innerRef=se,B.a.createElement(i,vt)})});if(!1)var _},"5VLF":function(zt,Ke,M){"use strict";var Q,z;function I(B,R,P){var F=function(D,L){return B.js_beautify(D,L)};return F.js=B.js_beautify,F.css=R.css_beautify,F.html=P.html_beautify,F.js_beautify=B.js_beautify,F.css_beautify=R.css_beautify,F.html_beautify=P.html_beautify,F}!(Q=[M("6UM0"),M("TXwP"),M("psGv")],z=function(B,R,P){return I(B,R,P)}.apply(Ke,Q),z!==void 0&&(zt.exports=z))},"6+eU":function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return x});var Q=M("wx14"),z=M("rePB"),I=M("VTBJ"),B=M("1OyB"),R=M("vuIU"),P=M("Ji7U"),F=M("LK+K"),D=M("cDcd"),L=M.n(D),A=M("TSYQ"),b=M.n(A),m=function(T){var _,y="".concat(T.rootPrefixCls,"-item"),f=b()(y,"".concat(y,"-").concat(T.page),(_={},Object(z.a)(_,"".concat(y,"-active"),T.active),Object(z.a)(_,T.className,!!T.className),Object(z.a)(_,"".concat(y,"-disabled"),!T.page),_)),c=function(){T.onClick(T.page)},v=function(E){T.onKeyPress(E,T.onClick,T.page)};return L.a.createElement("li",{title:T.showTitle?T.page:null,className:f,onClick:c,onKeyPress:v,tabIndex:"0"},T.itemRender(T.page,"page",L.a.createElement("a",{rel:"nofollow"},T.page)))},h=m,d={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(w){Object(P.a)(_,w);var T=Object(F.a)(_);function _(){var y;Object(B.a)(this,_);for(var f=arguments.length,c=new Array(f),v=0;v<f;v++)c[v]=arguments[v];return y=T.call.apply(T,[this].concat(c)),y.state={goInputText:""},y.buildOptionText=function(p){return"".concat(p," ").concat(y.props.locale.items_per_page)},y.changeSize=function(p){y.props.changeSize(Number(p))},y.handleChange=function(p){y.setState({goInputText:p.target.value})},y.handleBlur=function(p){var E=y.props,k=E.goButton,U=E.quickGo,H=E.rootPrefixCls,W=y.state.goInputText;if(k||W==="")return;if(p.relatedTarget&&(p.relatedTarget.className.indexOf("".concat(H,"-prev"))>=0||p.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;y.setState({goInputText:""}),U(y.getValidValue())},y.go=function(p){var E=y.state.goInputText;if(E==="")return;(p.keyCode===d.ENTER||p.type==="click")&&(y.setState({goInputText:""}),y.props.quickGo(y.getValidValue()))},y}return Object(R.a)(_,[{key:"getValidValue",value:function(){var f=this.state,c=f.goInputText,v=f.current;return!c||isNaN(c)?v:Number(c)}},{key:"getPageSizeOptions",value:function(){var f=this.props,c=f.pageSize,v=f.pageSizeOptions;return v.some(function(p){return p.toString()===c.toString()})?v:v.concat([c.toString()]).sort(function(p,E){var k=isNaN(Number(p))?0:Number(p),U=isNaN(Number(E))?0:Number(E);return k-U})}},{key:"render",value:function(){var f=this,c=this.props,v=c.pageSize,p=c.locale,E=c.rootPrefixCls,k=c.changeSize,U=c.quickGo,H=c.goButton,W=c.selectComponentClass,j=c.buildOptionText,O=c.selectPrefixCls,K=c.disabled,Y=this.state.goInputText,ee="".concat(E,"-options"),se=W,Be=null,me=null,xe=null;if(!k&&!U)return null;var Le=this.getPageSizeOptions();if(k&&se){var Ae=Le.map(function(le,fe){return L.a.createElement(se.Option,{key:fe,value:le.toString()},(j||f.buildOptionText)(le))});Be=L.a.createElement(se,{disabled:K,prefixCls:O,showSearch:!1,className:"".concat(ee,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||Le[0]).toString(),onChange:this.changeSize,getPopupContainer:function(fe){return fe.parentNode}},Ae)}return U&&(H&&(xe=typeof H=="boolean"?L.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(ee,"-quick-jumper-button")},p.jump_to_confirm):L.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),me=L.a.createElement("div",{className:"".concat(ee,"-quick-jumper")},p.jump_to,L.a.createElement("input",{disabled:K,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,xe)),L.a.createElement("li",{className:"".concat(ee)},Be,me)}}]),_}(L.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var a=o,u=M("N2Kk");function s(){}function i(w){return typeof w=="number"&&isFinite(w)&&Math.floor(w)===w}function n(w,T,_){return _}function S(w,T,_){var y=typeof w=="undefined"?T.pageSize:w;return Math.floor((_.total-1)/y)+1}var C=function(w){Object(P.a)(_,w);var T=Object(F.a)(_);function _(y){var f;Object(B.a)(this,_),f=T.call(this,y),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(S(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(k,U){var H=f.props.prefixCls,W=k||L.a.createElement("button",{type:"button","aria-label":U,className:"".concat(H,"-item-link")});return typeof k=="function"&&(W=L.a.createElement(k,Object(I.a)({},f.props))),W},f.savePaginationNode=function(k){f.paginationNode=k},f.isValid=function(k){return i(k)&&k!==f.state.current},f.shouldDisplayQuickJumper=function(){var k=f.props,U=k.showQuickJumper,H=k.pageSize,W=k.total;return W<=H?!1:U},f.handleKeyDown=function(k){(k.keyCode===d.ARROW_UP||k.keyCode===d.ARROW_DOWN)&&k.preventDefault()},f.handleKeyUp=function(k){var U=f.getValidValue(k),H=f.state.currentInputValue;U!==H&&f.setState({currentInputValue:U}),k.keyCode===d.ENTER?f.handleChange(U):k.keyCode===d.ARROW_UP?f.handleChange(U-1):k.keyCode===d.ARROW_DOWN&&f.handleChange(U+1)},f.changePageSize=function(k){var U=f.state.current,H=S(k,f.state,f.props);U=U>H?H:U,H===0&&(U=f.state.current),typeof k=="number"&&("pageSize"in f.props||f.setState({pageSize:k}),"current"in f.props||f.setState({current:U,currentInputValue:U})),f.props.onShowSizeChange(U,k),"onChange"in f.props&&f.props.onChange&&f.props.onChange(U,k)},f.handleChange=function(k){var U=f.props.disabled,H=k;if(f.isValid(H)&&!U){var W=S(void 0,f.state,f.props);H>W?H=W:H<1&&(H=1),"current"in f.props||f.setState({current:H,currentInputValue:H});var j=f.state.pageSize;return f.props.onChange(H,j),H}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<S(void 0,f.state,f.props)},f.runIfEnter=function(k,U){if(k.key==="Enter"||k.charCode===13){for(var H=arguments.length,W=new Array(H>2?H-2:0),j=2;j<H;j++)W[j-2]=arguments[j];U.apply(void 0,W)}},f.runIfEnterPrev=function(k){f.runIfEnter(k,f.prev)},f.runIfEnterNext=function(k){f.runIfEnter(k,f.next)},f.runIfEnterJumpPrev=function(k){f.runIfEnter(k,f.jumpPrev)},f.runIfEnterJumpNext=function(k){f.runIfEnter(k,f.jumpNext)},f.handleGoTO=function(k){(k.keyCode===d.ENTER||k.type==="click")&&f.handleChange(f.state.currentInputValue)};var c=y.onChange!==s,v="current"in y;v&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var p=y.defaultCurrent;"current"in y&&(p=y.current);var E=y.defaultPageSize;return"pageSize"in y&&(E=y.pageSize),p=Math.min(p,S(E,void 0,y)),f.state={current:p,currentInputValue:p,pageSize:E},f}return Object(R.a)(_,[{key:"componentDidUpdate",value:function(f,c){var v=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var p=this.paginationNode.querySelector(".".concat(v,"-item-").concat(c.current));p&&document.activeElement===p&&p.blur()}}},{key:"getValidValue",value:function(f){var c=f.target.value,v=S(void 0,this.state,this.props),p=this.state.currentInputValue,E;return c===""?E=c:isNaN(Number(c))?E=p:c>=v?E=v:E=Number(c),E}},{key:"getShowSizeChanger",value:function(){var f=this.props,c=f.showSizeChanger,v=f.total,p=f.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:v>p}},{key:"renderPrev",value:function(f){var c=this.props,v=c.prevIcon,p=c.itemRender,E=p(f,"prev",this.getItemIcon(v,"prev page")),k=!this.hasPrev();return Object(D.isValidElement)(E)?Object(D.cloneElement)(E,{disabled:k}):E}},{key:"renderNext",value:function(f){var c=this.props,v=c.nextIcon,p=c.itemRender,E=p(f,"next",this.getItemIcon(v,"next page")),k=!this.hasNext();return Object(D.isValidElement)(E)?Object(D.cloneElement)(E,{disabled:k}):E}},{key:"render",value:function(){var f=this,c=this.props,v=c.prefixCls,p=c.className,E=c.style,k=c.disabled,U=c.hideOnSinglePage,H=c.total,W=c.locale,j=c.showQuickJumper,O=c.showLessItems,K=c.showTitle,Y=c.showTotal,ee=c.simple,se=c.itemRender,Be=c.showPrevNextJumpers,me=c.jumpPrevIcon,xe=c.jumpNextIcon,Le=c.selectComponentClass,Ae=c.selectPrefixCls,le=c.pageSizeOptions,fe=this.state,Ve=fe.current,Lt=fe.pageSize,Pt=fe.currentInputValue;if(U===!0&&H<=Lt)return null;var vt=S(void 0,this.state,this.props),Fe=[],_t=null,tt=null,Rt=null,Ge=null,Ft=null,wt=j&&j.goButton,yt=O?1:2,bn=Ve-1>0?Ve-1:0,un=Ve+1<vt?Ve+1:vt,sn=Object.keys(this.props).reduce(function(J,Z){return(Z.substr(0,5)==="data-"||Z.substr(0,5)==="aria-"||Z==="role")&&(J[Z]=f.props[Z]),J},{});if(ee)return wt&&(typeof wt=="boolean"?Ft=L.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},W.jump_to_confirm):Ft=L.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},wt),Ft=L.a.createElement("li",{title:K?"".concat(W.jump_to).concat(Ve,"/").concat(vt):null,className:"".concat(v,"-simple-pager")},Ft)),L.a.createElement("ul",Object(Q.a)({className:b()(v,"".concat(v,"-simple"),Object(z.a)({},"".concat(v,"-disabled"),k),p),style:E,ref:this.savePaginationNode},sn),L.a.createElement("li",{title:K?W.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(v,"-prev"),Object(z.a)({},"".concat(v,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(bn)),L.a.createElement("li",{title:K?"".concat(Ve,"/").concat(vt):null,className:"".concat(v,"-simple-pager")},L.a.createElement("input",{type:"text",value:Pt,disabled:k,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),L.a.createElement("span",{className:"".concat(v,"-slash")},"/"),vt),L.a.createElement("li",{title:K?W.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(v,"-next"),Object(z.a)({},"".concat(v,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(un)),Ft);if(vt<=3+yt*2){var Ye={locale:W,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:se};vt||Fe.push(L.a.createElement(h,Object(Q.a)({},Ye,{key:"noPager",page:vt,className:"".concat(v,"-disabled")})));for(var nn=1;nn<=vt;nn+=1){var An=Ve===nn;Fe.push(L.a.createElement(h,Object(Q.a)({},Ye,{key:nn,page:nn,active:An})))}}else{var ke=O?W.prev_3:W.prev_5,Pe=O?W.next_3:W.next_5;Be&&(_t=L.a.createElement("li",{title:K?ke:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(v,"-jump-prev"),Object(z.a)({},"".concat(v,"-jump-prev-custom-icon"),!!me))},se(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(me,"prev page"))),tt=L.a.createElement("li",{title:K?Pe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(v,"-jump-next"),Object(z.a)({},"".concat(v,"-jump-next-custom-icon"),!!xe))},se(this.getJumpNextPage(),"jump-next",this.getItemIcon(xe,"next page")))),Ge=L.a.createElement(h,{locale:W,last:!0,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:vt,page:vt,active:!1,showTitle:K,itemRender:se}),Rt=L.a.createElement(h,{locale:W,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:se});var rt=Math.max(1,Ve-yt),ht=Math.min(Ve+yt,vt);Ve-1<=yt&&(ht=1+yt*2),vt-Ve<=yt&&(rt=vt-yt*2);for(var Ue=rt;Ue<=ht;Ue+=1){var ut=Ve===Ue;Fe.push(L.a.createElement(h,{locale:W,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ue,page:Ue,active:ut,showTitle:K,itemRender:se}))}Ve-1>=yt*2&&Ve!==1+2&&(Fe[0]=Object(D.cloneElement)(Fe[0],{className:"".concat(v,"-item-after-jump-prev")}),Fe.unshift(_t)),vt-Ve>=yt*2&&Ve!==vt-2&&(Fe[Fe.length-1]=Object(D.cloneElement)(Fe[Fe.length-1],{className:"".concat(v,"-item-before-jump-next")}),Fe.push(tt)),rt!==1&&Fe.unshift(Rt),ht!==vt&&Fe.push(Ge)}var Ee=null;Y&&(Ee=L.a.createElement("li",{className:"".concat(v,"-total-text")},Y(H,[H===0?0:(Ve-1)*Lt+1,Ve*Lt>H?H:Ve*Lt])));var ce=!this.hasPrev()||!vt,he=!this.hasNext()||!vt;return L.a.createElement("ul",Object(Q.a)({className:b()(v,p,Object(z.a)({},"".concat(v,"-disabled"),k)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},sn),Ee,L.a.createElement("li",{title:K?W.prev_page:null,onClick:this.prev,tabIndex:ce?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(v,"-prev"),Object(z.a)({},"".concat(v,"-disabled"),ce)),"aria-disabled":ce},this.renderPrev(bn)),Fe,L.a.createElement("li",{title:K?W.next_page:null,onClick:this.next,tabIndex:he?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(v,"-next"),Object(z.a)({},"".concat(v,"-disabled"),he)),"aria-disabled":he},this.renderNext(un)),L.a.createElement(a,{disabled:k,locale:W,rootPrefixCls:v,selectComponentClass:Le,selectPrefixCls:Ae,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ve,pageSize:Lt,pageSizeOptions:le,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:wt}))}}],[{key:"getDerivedStateFromProps",value:function(f,c){var v={};if("current"in f&&(v.current=f.current,f.current!==c.current&&(v.currentInputValue=v.current)),"pageSize"in f&&f.pageSize!==c.pageSize){var p=c.current,E=S(f.pageSize,c,f);p=p>E?E:p,"current"in f||(v.current=p,v.currentInputValue=p),v.pageSize=f.pageSize}return v}}]),_}(L.a.Component);C.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:u.a,style:{},itemRender:n,totalBoundaryShowSizeChanger:50};var x=C},"6RRn":function(zt,Ke,M){"use strict";var Q=M("wCXF"),z=M("n6Qo");M.d(Ke,"b",function(){return z.a});var I=M("IBYe"),B=M("6eGT"),R=M("hW8S");M.d(Ke,"a",function(){return R.a}),Ke.c=Q.b},"6UM0":function(zt,Ke,M){var Q,z;(function(){var I;(function(){"use strict";var R=[function(L,A,b){var m=b(1).Beautifier,h=b(5).Options;function d(o,a){var u=new m(o,a);return u.beautify()}L.exports=d,L.exports.defaultOptions=function(){return new h}},function(L,A,b){var m=b(2).Output,h=b(3).Token,d=b(4),o=b(5).Options,a=b(7).Tokenizer,u=b(7).line_starters,s=b(7).positionable_operators,i=b(7).TOKEN;function n(O,K){return K.indexOf(O)!==-1}function S(O){return O.replace(/^\s+/g,"")}function C(O){for(var K={},Y=0;Y<O.length;Y++)K[O[Y].replace(/-/g,"_")]=O[Y];return K}function x(O,K){return O&&O.type===i.RESERVED&&O.text===K}function w(O,K){return O&&O.type===i.RESERVED&&n(O.text,K)}var T=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],y=C(_),f=[y.before_newline,y.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function v(O,K){if(K.multiline_frame||K.mode===c.ForInitializer||K.mode===c.Conditional)return;O.remove_indent(K.start_line_index)}function p(O){O=O.replace(d.allLineBreaks,`
|
|
`);for(var K=[],Y=O.indexOf(`
|
|
`);Y!==-1;)K.push(O.substring(0,Y)),O=O.substring(Y+1),Y=O.indexOf(`
|
|
`);return O.length&&K.push(O),K}function E(O){return O===c.ArrayLiteral}function k(O){return n(O,[c.Expression,c.ForInitializer,c.Conditional])}function U(O,K){for(var Y=0;Y<O.length;Y++){var ee=O[Y].trim();if(ee.charAt(0)!==K)return!1}return!0}function H(O,K){for(var Y=0,ee=O.length,se;Y<ee;Y++)if(se=O[Y],se&&se.indexOf(K)!==0)return!1;return!0}function W(O,K){K=K||{},this._source_text=O||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(K)}W.prototype.create_flags=function(O,K){var Y=0;O&&(Y=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>Y&&(Y=O.line_indent_level));var ee={mode:K,parent:O,last_token:O?O.last_token:new h(i.START_BLOCK,""),last_word:O?O.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:Y,alignment:0,line_indent_level:O?O.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return ee},W.prototype._reset=function(O){var K=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var Y=new a(O,this._options);return this._tokens=Y.tokenize(),O},W.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,K=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
|
|
`,K&&d.lineBreak.test(K||"")&&(Y=K.match(d.lineBreak)[0]));for(var ee=this._tokens.next();ee;)this.handle_token(ee),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ee,ee=this._tokens.next();return O=this._output.get_code(Y),O},W.prototype.handle_token=function(O,K){O.type===i.START_EXPR?this.handle_start_expr(O):O.type===i.END_EXPR?this.handle_end_expr(O):O.type===i.START_BLOCK?this.handle_start_block(O):O.type===i.END_BLOCK?this.handle_end_block(O):O.type===i.WORD?this.handle_word(O):O.type===i.RESERVED?this.handle_word(O):O.type===i.SEMICOLON?this.handle_semicolon(O):O.type===i.STRING?this.handle_string(O):O.type===i.EQUALS?this.handle_equals(O):O.type===i.OPERATOR?this.handle_operator(O):O.type===i.COMMA?this.handle_comma(O):O.type===i.BLOCK_COMMENT?this.handle_block_comment(O,K):O.type===i.COMMENT?this.handle_comment(O,K):O.type===i.DOT?this.handle_dot(O):O.type===i.EOF?this.handle_eof(O):O.type===i.UNKNOWN?this.handle_unknown(O,K):this.handle_unknown(O,K)},W.prototype.handle_whitespace_and_comments=function(O,K){var Y=O.newlines,ee=this._options.keep_array_indentation&&E(this._flags.mode);if(O.comments_before)for(var se=O.comments_before.next();se;)this.handle_whitespace_and_comments(se,K),this.handle_token(se,K),se=O.comments_before.next();if(ee)for(var Be=0;Be<Y;Be+=1)this.print_newline(Be>0,K);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,K);for(var me=1;me<Y;me+=1)this.print_newline(!0,K)}};var j=["async","break","continue","return","throw","yield"];W.prototype.allow_wrap_or_preserved_newline=function(O,K){if(K=K===void 0?!1:K,this._output.just_added_newline())return;var Y=this._options.preserve_newlines&&O.newlines||K,ee=n(this._flags.last_token.text,s)||n(O.text,s);if(ee){var se=n(this._flags.last_token.text,s)&&n(this._options.operator_position,f)||n(O.text,s);Y=Y&&se}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(w(this._flags.last_token,j))return;this._output.set_wrap_point()}},W.prototype.print_newline=function(O,K){if(!K&&(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 Y=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},W.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||E(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.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(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.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(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),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===c.Statement&&v(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===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"]))},W.prototype.start_of_statement=function(O){var K=!1;return K=K||w(this._flags.last_token,["var","let","const"])&&O.type===i.WORD,K=K||x(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&w(this._flags.last_token,j)&&!O.newlines,K=K||x(this._flags.last_token,"else")&&!(x(O,"if")&&!O.comments_before),K=K||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),K=K||this._flags.last_token.type===i.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==i.WORD&&O.type!==i.RESERVED,K=K||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"])),K?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,w(O,["do","for","if","while"])),!0):!1},W.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var K=c.Expression;if(O.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){w(this._flags.last_token,u)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=c.ArrayLiteral,E(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,K=c.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=c.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(n(this._flags.last_token.text,u)||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(O);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var ee=this._tokens.peek(-4);w(Y,["async","function"])||Y.text==="*"&&w(ee,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(ee.text==="{"||ee.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(O);(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===c.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(O,O.newlines),this.print_token(O),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},W.prototype.handle_end_expr=function(O){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&E(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(O),this.restore_mode(),v(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},W.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var K=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):Y&&(n(Y.text,[":",","])&&n(K.type,[i.STRING,i.WORD,i.RESERVED])||n(K.text,["get","set","..."])&&n(Y.type,[i.WORD,i.RESERVED]))?n(this._last_last_text,["class","interface"])&&!n(Y.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):n(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||w(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(w(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ee=!K.comments_before&&K.text==="}",se=ee&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Be=0,me=null;this._flags.inline_frame=!0;do if(Be+=1,me=this._tokens.peek(Be-1),me.newlines){this._flags.inline_frame=!1;break}while(me.type!==i.EOF&&!(me.type===i.END_BLOCK&&me.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(se||this._flags.last_token.type===i.EQUALS||w(this._flags.last_token,T)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(E(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(O),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(O),this.indent(),!ee&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},W.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===c.Statement;)this.restore_mode();var K=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(E(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(O)},W.prototype.handle_word=function(O){if(O.type===i.RESERVED){if(n(O.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)O.type=i.WORD;else if(O.text==="import"&&n(this._tokens.peek().text,["(","."]))O.type=i.WORD;else if(n(O.text,["as","from"])&&!this._flags.import_block)O.type=i.WORD;else if(this._flags.mode===c.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(O.type=i.WORD)}}if(this.start_of_statement(O)?w(this._flags.last_token,["var","let","const"])&&O.type===i.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!k(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||!w(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(x(O,"while")){this._output.space_before_token=!0,this.print_token(O),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&&x(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&w(O,["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(O),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(O)),x(O,"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()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?w(this._flags.last_token,["get","set","new","export"])||w(this._flags.last_token,j)?this._output.space_before_token=!0:x(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&&(k(this._flags.mode)||E(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var Y="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":w(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===c.BlockStatement?Y="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&k(this._flags.mode)?Y="SPACE":this._flags.last_token.type===i.STRING?Y="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===c.ObjectLiteral&&n(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),w(O,u)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),w(O,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ee=this._output.current_line;ee.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?w(this._flags.last_token,T)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&w(O,["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||!w(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(O,"if")&&x(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):w(O,u)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===i.WORD||O.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===i.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(O,"from")&&(this._flags.import_block=!1))},W.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var K=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},W.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),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(O):O.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},W.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},W.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(k(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(O)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},W.prototype.handle_operator=function(O){var K=O.text==="*"&&(w(this._flags.last_token,["function","yield"])||n(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),Y=n(O.text,["-","+"])&&(n(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||n(this._flags.last_token.text,u)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var ee=!K;this.handle_whitespace_and_comments(O,ee)}if(O.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===i.OPERATOR&&n(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),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,Be=!0,me=!1;if(O.text===":"?this._flags.ternary_depth===0?se=!1:(this._flags.ternary_depth-=1,me=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!K&&this._options.preserve_newlines&&n(O.text,s)){var xe=O.text===":",Le=xe&&me,Ae=xe&&!me;switch(this._options.operator_position){case y.before_newline:this._output.space_before_token=!Ae,this.print_token(O),(!xe||Le)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case y.after_newline:this._output.space_before_token=!0,!xe||Le?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case y.preserve_newline:Ae||this.allow_wrap_or_preserved_newline(O),se=!(this._output.just_added_newline()||Ae),this._output.space_before_token=se,this.print_token(O),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(O),se=!1;var le=this._tokens.peek();Be=le&&n(le.type,[i.WORD,i.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),se=this._flags.last_token.type===i.START_BLOCK,Be=!1;else if(n(O.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),se=!1,Be=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var fe=w(this._flags.last_token,T)&&O.newlines;fe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(fe,!0)}this._flags.last_token.text===";"&&k(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==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===i.OPERATOR&&(se=n(O.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(O.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&(Be=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.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(O),this._output.space_before_token=Be},W.prototype.handle_block_comment=function(O,K){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,K),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,K)},W.prototype.print_block_commment=function(O,K){var Y=p(O.text),ee,se=!1,Be=!1,me=O.whitespace_before,xe=me.length;if(this.print_newline(!1,K),this.print_token_line_indentation(O),this._output.add_token(Y[0]),this.print_newline(!1,K),Y.length>1){for(Y=Y.slice(1),se=U(Y,"*"),Be=H(Y,me),se&&(this._flags.alignment=1),ee=0;ee<Y.length;ee++)se?(this.print_token_line_indentation(O),this._output.add_token(S(Y[ee]))):Be&&Y[ee]?(this.print_token_line_indentation(O),this._output.add_token(Y[ee].substring(xe))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[ee])),this.print_newline(!1,K);this._flags.alignment=0}},W.prototype.handle_comment=function(O,K){O.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,K)},W.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),w(this._flags.last_token,T)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,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(O)},W.prototype.handle_unknown=function(O,K){this.print_token(O),O.text[O.text.length-1]===`
|
|
`&&this.print_newline(!1,K)},W.prototype.handle_eof=function(O){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},L.exports.Beautifier=W},function(L){function A(h){this.__parent=h,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=[]}A.prototype.clone_empty=function(){var h=new A(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},A.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},A.prototype.has_match=function(h){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(h))return!0;return!1},A.prototype.set_indent=function(h,d){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(h){this.__items.push(h);var d=h.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=h.length-d:this.__character_count+=h.length},A.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function b(h,d){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),d=d||"",h.indent_level>0&&(d=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}b.prototype.get_indent_size=function(h,d){var o=this.__base_string_length;return d=d||0,h<0&&(o=0),o+=h*this.__indent_size,o+=d,o},b.prototype.get_indent_string=function(h,d){var o=this.__base_string;return d=d||0,h<0&&(h=0,o=""),d+=h*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},b.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var h=this.__cache.length,d=0,o="";this.__indent_size&&h>=this.__indent_size&&(d=Math.floor(h/this.__indent_size),h-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function m(h,d){this.__indent_cache=new b(h,d),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(h,d){return this.__indent_cache.get_indent_string(h,d)},m.prototype.get_indent_size=function(h,d){return this.__indent_cache.get_indent_size(h,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(h){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(h,d){return h=h||0,d=d||0,this.next_line.set_indent(h,d),this.__lines.length>1?(this.current_line.set_indent(h,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(h){for(var d=0;d<h.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(h){for(var d=this.__lines.length;h<d;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(h,d){for(var o=this.__lines.length-2;o>=0;){var a=this.__lines[o];if(a.is_empty())break;if(a.item(0).indexOf(h)!==0&&a.item(-1)!==d){this.__lines.splice(o+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},L.exports.Output=m},function(L){function A(b,m,h,d){this.type=b,this.text=m,this.comments_before=null,this.newlines=h||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=A},function(L,A){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\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",d="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+b+h+"])",a="(?:\\\\u[0-9a-fA-F]{4}|["+m+h+d+"])*";A.identifier=new RegExp(o+a,"g"),A.identifierStart=new RegExp(o),A.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+h+d+"])+");var u=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;A.newline=/[\n\r\u2028\u2029]/,A.lineBreak=new RegExp(`\r
|
|
|`+A.newline.source),A.allLineBreaks=new RegExp(A.lineBreak.source,"g")},function(L,A,b){var m=b(6).Options,h=["before-newline","after-newline","preserve-newline"];function d(o){m.call(this,o,"js");var a=this.raw_options.brace_style||null;a==="expand-strict"?this.raw_options.brace_style="expand":a==="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 u=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<u.length;s++)u[s]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=u[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",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}d.prototype=new m,L.exports.Options=d},function(L){function A(h,d){this.raw_options=b(h,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}A.prototype._get_array=function(h,d){var o=this.raw_options[h],a=d||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(a=o.concat()):typeof o=="string"&&(a=o.split(/[^a-zA-Z0-9_\/\-]+/)),a},A.prototype._get_boolean=function(h,d){var o=this.raw_options[h],a=o===void 0?!!d:!!o;return a},A.prototype._get_characters=function(h,d){var o=this.raw_options[h],a=d||"";return typeof o=="string"&&(a=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),a},A.prototype._get_number=function(h,d){var o=this.raw_options[h];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(o,10);return isNaN(a)&&(a=d),a},A.prototype._get_selection=function(h,d,o){var a=this._get_selection_list(h,d,o);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[h]+"'");return a[0]},A.prototype._get_selection_list=function(h,d,o){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[d[0]],!this._is_valid_selection(o,d))throw new Error("Invalid Default Value!");var a=this._get_array(h,o);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[h]+"'");return a},A.prototype._is_valid_selection=function(h,d){return h.length&&d.length&&!h.some(function(o){return d.indexOf(o)===-1})};function b(h,d){var o={};h=m(h);var a;for(a in h)a!==d&&(o[a]=h[a]);if(d&&h[d])for(a in h[d])o[a]=h[d][a];return o}function m(h){var d={},o;for(o in h){var a=o.replace(/-/g,"_");d[a]=h[o]}return d}L.exports.Options=A,L.exports.normalizeOpts=m,L.exports.mergeOpts=b},function(L,A,b){var m=b(8).InputScanner,h=b(9).Tokenizer,d=b(9).TOKEN,o=b(13).Directives,a=b(4),u=b(12).Pattern,s=b(14).TemplatablePattern;function i(U,H){return H.indexOf(U)!==-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:d.START,RAW:d.RAW,EOF:d.EOF},S=new o(/\/\*/,/\*\//),C=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,w=/[^\d\.]/,T=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var y=new RegExp(_),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+c.join("|")+")$"),p,E=function(U,H){h.call(this,U,H),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var W=new u(this._input),j=new s(this._input).read_options(this._options);this.__patterns={template:j,identifier:j.starting_with(a.identifier).matching(a.identifierMatch),number:W.matching(C),punct:W.matching(y),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(a.lineBreak),shebang:W.starting_with(/#!/).until_after(a.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:j.until(/['\\\n\r\u2028\u2029]/),double_quote:j.until(/["\\\n\r\u2028\u2029]/),template_text:j.until(/[`\\$]/),template_expression:j.until(/[`}\\]/)}};E.prototype=new h,E.prototype._is_comment=function(U){return U.type===n.COMMENT||U.type===n.BLOCK_COMMENT||U.type===n.UNKNOWN},E.prototype._is_opening=function(U){return U.type===n.START_BLOCK||U.type===n.START_EXPR},E.prototype._is_closing=function(U,H){return(U.type===n.END_BLOCK||U.type===n.END_EXPR)&&H&&(U.text==="]"&&H.text==="["||U.text===")"&&H.text==="("||U.text==="}"&&H.text==="{")},E.prototype._reset=function(){p=!1},E.prototype._get_next_token=function(U,H){var W=null;this._readWhitespace();var j=this._input.peek();return j===null?this._create_token(n.EOF,""):(W=W||this._read_non_javascript(j),W=W||this._read_string(j),W=W||this._read_word(U),W=W||this._read_singles(j),W=W||this._read_comment(j),W=W||this._read_regexp(j,U),W=W||this._read_xml(j,U),W=W||this._read_punctuation(),W=W||this._create_token(n.UNKNOWN,this._input.next()),W)},E.prototype._read_word=function(U){var H;if(H=this.__patterns.identifier.read(),H!=="")return H=H.replace(a.allLineBreaks,`
|
|
`),!(U.type===n.DOT||U.type===n.RESERVED&&(U.text==="set"||U.text==="get"))&&v.test(H)?(H==="in"||H==="of")&&(U.type===n.WORD||U.type===n.STRING)?this._create_token(n.OPERATOR,H):this._create_token(n.RESERVED,H):this._create_token(n.WORD,H);if(H=this.__patterns.number.read(),H!=="")return this._create_token(n.WORD,H)},E.prototype._read_singles=function(U){var H=null;return U==="("||U==="["?H=this._create_token(n.START_EXPR,U):U===")"||U==="]"?H=this._create_token(n.END_EXPR,U):U==="{"?H=this._create_token(n.START_BLOCK,U):U==="}"?H=this._create_token(n.END_BLOCK,U):U===";"?H=this._create_token(n.SEMICOLON,U):U==="."&&w.test(this._input.peek(1))?H=this._create_token(n.DOT,U):U===","&&(H=this._create_token(n.COMMA,U)),H&&this._input.next(),H},E.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(n.EQUALS,U):U==="?."?this._create_token(n.DOT,U):this._create_token(n.OPERATOR,U)},E.prototype._read_non_javascript=function(U){var H="";if(U==="#"){if(this._is_first_token()&&(H=this.__patterns.shebang.read(),H))return this._create_token(n.UNKNOWN,H.trim()+`
|
|
`);if(H=this.__patterns.include.read(),H)return this._create_token(n.UNKNOWN,H.trim()+`
|
|
`);U=this._input.next();var W="#";if(this._input.hasNext()&&this._input.testChar(x)){do U=this._input.next(),W+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(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(U==="<"&&this._is_first_token()){if(H=this.__patterns.html_comment_start.read(),H){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)H+=this._input.next();return p=!0,this._create_token(n.COMMENT,H)}}else if(p&&U==="-"&&(H=this.__patterns.html_comment_end.read(),H))return p=!1,this._create_token(n.COMMENT,H);return null},E.prototype._read_comment=function(U){var H=null;if(U==="/"){var W="";if(this._input.peek(1)==="*"){W=this.__patterns.block_comment.read();var j=S.get_directives(W);j&&j.ignore==="start"&&(W+=S.readIgnored(this._input)),W=W.replace(a.allLineBreaks,`
|
|
`),H=this._create_token(n.BLOCK_COMMENT,W),H.directives=j}else this._input.peek(1)==="/"&&(W=this.__patterns.comment.read(),H=this._create_token(n.COMMENT,W))}return H},E.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var H=this._input.next();return this.has_char_escapes=!1,U==="`"?H+=this._read_string_recursive("`",!0,"${"):H+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(H=k(H)),this._input.peek()===U&&(H+=this._input.next()),H=H.replace(a.allLineBreaks,`
|
|
`),this._create_token(n.STRING,H)}return null},E.prototype._allow_regexp_or_xml=function(U){return U.type===n.RESERVED&&i(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===n.END_EXPR&&U.text===")"&&U.opened.previous.type===n.RESERVED&&i(U.opened.previous.text,["if","while","for"])||i(U.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},E.prototype._read_regexp=function(U,H){if(U==="/"&&this._allow_regexp_or_xml(H)){for(var W=this._input.next(),j=!1,O=!1;this._input.hasNext()&&(j||O||this._input.peek()!==U)&&!this._input.testChar(a.newline);)W+=this._input.peek(),j?j=!1:(j=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===U&&(W+=this._input.next(),W+=this._input.read(a.identifier)),this._create_token(n.STRING,W)}return null},E.prototype._read_xml=function(U,H){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(H)){var W="",j=this.__patterns.xml.read_match();if(j){for(var O=j[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=O.indexOf("{")===0,Y=0;j;){var ee=!!j[1],se=j[2],Be=!!j[j.length-1]||se.slice(0,8)==="![CDATA[";if(!Be&&(se===O||K&&se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ee?--Y:++Y),W+=j[0],Y<=0)break;j=this.__patterns.xml.read_match()}return j||(W+=this._input.match(/[\s\S]*/g)[0]),W=W.replace(a.allLineBreaks,`
|
|
`),this._create_token(n.STRING,W)}}return null};function k(U){for(var H="",W=0,j=new m(U),O=null;j.hasNext();)if(O=j.match(/([\s]|[^\\]|\\\\)+/g),O&&(H+=O[0]),j.peek()==="\\"){if(j.next(),j.peek()==="x")O=j.match(/x([0-9A-Fa-f]{2})/g);else if(j.peek()==="u")O=j.match(/u([0-9A-Fa-f]{4})/g);else{H+="\\",j.hasNext()&&(H+=j.next());continue}if(!O)return U;if(W=parseInt(O[1],16),W>126&&W<=255&&O[0].indexOf("x")===0)return U;if(W>=0&&W<32){H+="\\"+O[0];continue}else W===34||W===39||W===92?H+="\\"+String.fromCharCode(W):H+=String.fromCharCode(W)}return H}E.prototype._read_string_recursive=function(U,H,W){var j,O;U==="'"?O=this.__patterns.single_quote:U==='"'?O=this.__patterns.double_quote:U==="`"?O=this.__patterns.template_text:U==="}"&&(O=this.__patterns.template_expression);for(var K=O.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===U||!H&&a.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(j=this._input.peek(),j==="x"||j==="u"?this.has_char_escapes=!0:j==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Y+=this._input.next()):W&&(W==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),W===Y&&(U==="`"?Y+=this._read_string_recursive("}",H,"`"):Y+=this._read_string_recursive("`",H,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=O.read(),K+=Y}return K},L.exports.Tokenizer=E,L.exports.TOKEN=n,L.exports.positionable_operators=T.slice(),L.exports.line_starters=f.slice()},function(L){var A=RegExp.prototype.hasOwnProperty("sticky");function b(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},b.prototype.peek=function(m){var h=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(h=this.__input.charAt(m)),h},b.prototype.__match=function(m,h){m.lastIndex=h;var d=m.exec(this.__input);return d&&!(A&&m.sticky)&&(d.index!==h&&(d=null)),d},b.prototype.test=function(m,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(m,h):!1},b.prototype.testChar=function(m,h){var d=this.peek(h);return m.lastIndex=0,d!==null&&m.test(d)},b.prototype.match=function(m){var h=this.__match(m,this.__position);return h?this.__position+=h[0].length:h=null,h},b.prototype.read=function(m,h,d){var o="",a;return m&&(a=this.match(m),a&&(o+=a[0])),h&&(a||!m)&&(o+=this.readUntil(h,d)),o},b.prototype.readUntil=function(m,h){var d="",o=this.__position;m.lastIndex=this.__position;var a=m.exec(this.__input);return a?(o=a.index,h&&(o+=a[0].length)):o=this.__input_length,d=this.__input.substring(this.__position,o),this.__position=o,d},b.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},b.prototype.get_regexp=function(m,h){var d=null,o="g";return h&&A&&(o="y"),typeof m=="string"&&m!==""?d=new RegExp(m,o):m&&(d=new RegExp(m.source,o)),d},b.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(m){var h=this.__position,d=this.readUntilAfter(m);return this.__position=h,d},b.prototype.lookBack=function(m){var h=this.__position-1;return h>=m.length&&this.__input.substring(h-m.length,h).toLowerCase()===m},L.exports.InputScanner=b},function(L,A,b){var m=b(8).InputScanner,h=b(3).Token,d=b(10).TokenStream,o=b(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(s,i){this._input=new m(s),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var s,i=new h(a.START,""),n=null,S=[],C=new d;i.type!==a.EOF;){for(s=this._get_next_token(i,n);this._is_comment(s);)C.add(s),s=this._get_next_token(i,n);C.isEmpty()||(s.comments_before=C,C=new d),s.parent=n,this._is_opening(s)?(S.push(n),n=s):n&&this._is_closing(s,n)&&(s.opened=n,n.closed=s,n=S.pop(),s.parent=n),s.previous=i,i.next=s,this.__tokens.add(s),i=s}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(s,i){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},u.prototype._is_comment=function(s){return!1},u.prototype._is_opening=function(s){return!1},u.prototype._is_closing=function(s,i){return!1},u.prototype._create_token=function(s,i){var n=new h(s,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=u,L.exports.TOKEN=a},function(L){function A(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}A.prototype.restart=function(){this.__position=0},A.prototype.isEmpty=function(){return this.__tokens_length===0},A.prototype.hasNext=function(){return this.__position<this.__tokens_length},A.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},A.prototype.peek=function(b){var m=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(m=this.__tokens[b]),m},A.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},L.exports.TokenStream=A},function(L,A,b){var m=b(12).Pattern;function h(d,o){m.call(this,d,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new m,h.prototype.__set_whitespace_patterns=function(d,o){d+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var o=this.__split(this._newline_regexp,d);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return d},h.prototype.matching=function(d,o){var a=this._create();return a.__set_whitespace_patterns(d,o),a._update(),a},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(d,o){d.lastIndex=0;for(var a=0,u=[],s=d.exec(o);s;)u.push(o.substring(a,s.index)),a=s.index+s[0].length,s=d.exec(o);return a<o.length?u.push(o.substring(a,o.length)):u.push(""),u},L.exports.WhitespacePattern=h},function(L){function A(b,m){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}A.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},A.prototype.read_match=function(){return this._input.match(this._match_pattern)},A.prototype.until_after=function(b){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(b),m._update(),m},A.prototype.until=function(b){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(b),m._update(),m},A.prototype.starting_with=function(b){var m=this._create();return m._starting_pattern=this._input.get_regexp(b,!0),m._update(),m},A.prototype.matching=function(b){var m=this._create();return m._match_pattern=this._input.get_regexp(b,!0),m._update(),m},A.prototype._create=function(){return new A(this._input,this)},A.prototype._update=function(){},L.exports.Pattern=A},function(L){function A(b,m){b=typeof b=="string"?b:b.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+m,"g")}A.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(b);h;)m[h[1]]=h[2],h=this.__directive_pattern.exec(b);return m},A.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=A},function(L,A,b){var m=b(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(o,a){m.call(this,o,a),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var u=new m(o);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new m,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(o){var a=this._create();return a._disabled[o]=!0,a._update(),a},d.prototype.read_options=function(o){var a=this._create();for(var u in h)a._disabled[u]=o.templating.indexOf(u)===-1;return a._update(),a},d.prototype.exclude=function(o){var a=this._create();return a._excluded[o]=!0,a._update(),a},d.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),o+=a,a=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},d.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},d.prototype._read_template=function(){var o="",a=this._input.peek();if(a==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(o=o||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},L.exports.TemplatablePattern=d}],P={};function F(L){var A=P[L];if(A!==void 0)return A.exports;var b=P[L]={exports:{}};return R[L](b,b.exports,F),b.exports}var D=F(0);I=D})();var B=I;!(Q=[],z=function(){return{js_beautify:B}}.apply(Ke,Q),z!==void 0&&(zt.exports=z))})()},"6eGT":function(zt,Ke,M){"use strict";function Q(z){return null}Ke.a=Q},"7Cbv":function(zt,Ke,M){"use strict";var Q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z=new Uint8Array(16);function I(){if(!Q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Q(z)}var B=/^(?:[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 R(h){return typeof h=="string"&&B.test(h)}for(var P=R,F=[],D=0;D<256;++D)F.push((D+256).toString(16).substr(1));function L(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(F[h[d+0]]+F[h[d+1]]+F[h[d+2]]+F[h[d+3]]+"-"+F[h[d+4]]+F[h[d+5]]+"-"+F[h[d+6]]+F[h[d+7]]+"-"+F[h[d+8]]+F[h[d+9]]+"-"+F[h[d+10]]+F[h[d+11]]+F[h[d+12]]+F[h[d+13]]+F[h[d+14]]+F[h[d+15]]).toLowerCase();if(!P(o))throw TypeError("Stringified UUID is invalid");return o}var A=L;function b(h,d,o){h=h||{};var a=h.random||(h.rng||I)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,d){o=o||0;for(var u=0;u<16;++u)d[o+u]=a[u];return d}return A(a)}var m=Ke.a=b},"7ahc":function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return S});var Q=M("k1fw"),z=M("0Owb"),I=M("+L6B"),B=M("2/Rp"),R=M("y8nQ"),P=M("Vl3Y"),F=M("tJVT"),D=M("OaEy"),L=M("2fM7"),A=M("cDcd"),b=M.n(A),m=M("VrN/"),h=M.n(m),d=M("p77/"),o=M.n(d),a=M("c5Ni"),u=M.n(a),s=L.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"]};Ke.b=function(C){var x=C.callback,w=C.onCancel,T=Object(A.useState)("python"),_=Object(F.a)(T,2),y=_[0],f=_[1];function c(p){f(n[p][1])}function v(p){x(p)}return b.a.createElement(P.a,Object(z.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:v}),b.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(L.a,{onChange:c},Object.keys(n).map(function(p){return b.a.createElement(s,{key:p,value:p},n[p][0])}))),b.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(S,{mode:y})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(B.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function S(C){var x=C.value,w=C.onChange,T=C.mode,_=C.options,y=_===void 0?{}:_,f=Object(A.useRef)(),c=Object(A.useState)(),v=Object(F.a)(c,2),p=v[0],E=v[1];return Object(A.useEffect)(function(){if(p){function k(U){var H=U.getValue();w&&w(H)}return p.on("change",k),function(){p.off("change",k)}}},[p,w]),Object(A.useEffect)(function(){p&&p.setOption("mode",T)},[p,T]),Object(A.useEffect)(function(){p&&((x!==p.getValue()||x==="")&&setTimeout(function(){p.setValue(x||" ")},300))},[p,x]),Object(A.useEffect)(function(){if(f.current&&!p){var k=h.a.fromTextArea(f.current,Object(Q.a)({mode:T,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},y));E(k)}},[f.current,p]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:f}))}},"7ixt":function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return I});var Q={adjustX:1,adjustY:1},z=[0,0],I={left:{points:["cr","cl"],overflow:Q,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:Q,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:Q,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:Q,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:Q,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:Q,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:Q,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:Q,offset:[-4,0],targetOffset:z}},B=I},"815F":function(zt,Ke,M){"use strict";M.d(Ke,"e",function(){return F}),M.d(Ke,"c",function(){return L}),M.d(Ke,"d",function(){return A}),M.d(Ke,"a",function(){return m}),M.d(Ke,"f",function(){return h}),M.d(Ke,"b",function(){return d});var Q=M("KQm4"),z=M("VTBJ"),I=M("Ff2n"),B=M("Zm9Q"),R=M("Kwbf"),P=M("OZM5");function F(o,a){return o!=null?o:a}function D(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=new Map;function u(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(n){var S=n.key,C=n.children;Object(R.a)(S!=null,"Tree node must have a certain key: [".concat(i).concat(S,"]"));var x=String(S);Object(R.a)(!a.has(x)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(x)),a.set(x,!0),u(C,"".concat(i).concat(x," > "))})}u(o)}function L(o){function a(u){var s=Object(B.a)(u);return s.map(function(i){if(!Object(P.i)(i))return Object(R.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var n=i.key,S=i.props,C=S.children,x=Object(I.a)(S,["children"]),w=Object(z.a)({key:n},x),T=a(C);return T.length&&(w.children=T),w}).filter(function(i){return i})}return a(o)}function A(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],u=new Set(a===!0?[]:a),s=[];function i(n){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(C,x){var w=Object(P.h)(S?S.pos:"0",x),T=F(C.key,w),_=Object(z.a)(Object(z.a)({},C),{},{parent:S,pos:w,children:null,data:C,isStart:[].concat(Object(Q.a)(S?S.isStart:[]),[x===0]),isEnd:[].concat(Object(Q.a)(S?S.isEnd:[]),[x===n.length-1])});return s.push(_),a===!0||u.has(T)?_.children=i(C.children||[],_):_.children=[],_})}return i(o),s}function b(o,a,u){var s;u?typeof u=="string"?s=function(S){return S[u]}:typeof u=="function"&&(s=function(S){return u(S)}):s=function(S,C){return F(S.key,C)};function i(n,S,C){var x=n?n.children:o,w=n?Object(P.h)(C.pos,S):"0";if(n){var T=s(n,w),_={node:n,index:S,pos:w,key:T,parentPos:C.node?C.pos:null,level:C.level+1};a(_)}x&&x.forEach(function(y,f){i(y,f,{node:n,pos:w,level:C?C.level+1:-1})})}i(null)}function m(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=a.initWrapper,s=a.processEntity,i=a.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,S={},C={},x={posEntities:S,keyEntities:C};return u&&(x=u(x)||x),b(o,function(w){var T=w.node,_=w.index,y=w.pos,f=w.key,c=w.parentPos,v=w.level,p={node:T,index:_,key:f,pos:y,level:v},E=F(f,y);S[y]=p,C[E]=p,p.parent=S[c],p.parent&&(p.parent.children=p.parent.children||[],p.parent.children.push(p)),s&&s(p,x)},n),i&&i(x),x}function h(o,a){var u=a.expandedKeys,s=a.selectedKeys,i=a.loadedKeys,n=a.loadingKeys,S=a.checkedKeys,C=a.halfCheckedKeys,x=a.dragOverNodeKey,w=a.dropPosition,T=a.keyEntities,_=T[o],y={eventKey:o,expanded:u.indexOf(o)!==-1,selected:s.indexOf(o)!==-1,loaded:i.indexOf(o)!==-1,loading:n.indexOf(o)!==-1,checked:S.indexOf(o)!==-1,halfChecked:C.indexOf(o)!==-1,pos:String(_?_.pos:""),dragOver:x===o&&w===0,dragOverGapTop:x===o&&w===-1,dragOverGapBottom:x===o&&w===1};return y}function d(o){var a=o.data,u=o.expanded,s=o.selected,i=o.checked,n=o.loaded,S=o.loading,C=o.halfChecked,x=o.dragOver,w=o.dragOverGapTop,T=o.dragOverGapBottom,_=o.pos,y=o.active,f=Object(z.a)(Object(z.a)({},a),{},{expanded:u,selected:s,checked:i,loaded:n,loading:S,halfChecked:C,dragOver:x,dragOverGapTop:w,dragOverGapBottom:T,pos:_,active:y});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(R.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),f}},"8EBN":function(zt,Ke,M){(function(Q){Q(M("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 z=0;z<Q.modeInfo.length;z++){var I=Q.modeInfo[z];I.mimes&&(I.mime=I.mimes[0])}Q.findModeByMIME=function(B){B=B.toLowerCase();for(var R=0;R<Q.modeInfo.length;R++){var P=Q.modeInfo[R];if(P.mime==B)return P;if(P.mimes){for(var F=0;F<P.mimes.length;F++)if(P.mimes[F]==B)return P}}if(/\+xml$/.test(B))return Q.findModeByMIME("application/xml");if(/\+json$/.test(B))return Q.findModeByMIME("application/json")},Q.findModeByExtension=function(B){B=B.toLowerCase();for(var R=0;R<Q.modeInfo.length;R++){var P=Q.modeInfo[R];if(P.ext){for(var F=0;F<P.ext.length;F++)if(P.ext[F]==B)return P}}},Q.findModeByFileName=function(B){for(var R=0;R<Q.modeInfo.length;R++){var P=Q.modeInfo[R];if(P.file&&P.file.test(B))return P}var F=B.lastIndexOf("."),D=F>-1&&B.substring(F+1,B.length);if(D)return Q.findModeByExtension(D)},Q.findModeByName=function(B){B=B.toLowerCase();for(var R=0;R<Q.modeInfo.length;R++){var P=Q.modeInfo[R];if(P.name.toLowerCase()==B)return P;if(P.alias){for(var F=0;F<P.alias.length;F++)if(P.alias[F].toLowerCase()==B)return P}}}})},"8hTe":function(zt,Ke,M){zt.exports={button:"button___1wy9m"}},"9Bee":function(zt,Ke,M){"use strict";var Q=M("DYRE"),z=M("zeV3"),I=M("+L6B"),B=M("2/Rp"),R=M("k1fw"),P=M("tJVT"),F=M("cDcd"),D=M.n(F),L=M("vg9a"),A=M("DlQD"),b=M.n(A),m=M("rUJ1");function h(xe,Le){var Ae=xe.match(/^(\s+)(?:```)/);if(Ae===null)return Le;var le=Ae[1];return Le.split(`
|
|
`).map(function(fe){var Ve=fe.match(/^\s+/);if(Ve===null)return fe;var Lt=Object(P.a)(Ve,1),Pt=Lt[0];return Pt.length>=le.length?fe.slice(le.length):fe}).join(`
|
|
`)}var d=[],o=["<ul>"],a=new b.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function s(){d.length=0,o=["<ul>"]}var i={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function n(xe,Le,Ae,le){if(Le>=xe.length||xe[Le].level<=Ae)return Le;var fe=xe[Le];le.push("<li><a href='#"+fe.anchor+"'>"+fe.text+"</a>"),Le++;var Ve=[];return Le=n(xe,Le,fe.level,Ve),Ve.length>0&&(le.push("<ul>"),Ve.forEach(function(Lt){le.push(Lt)}),le.push("</ul>")),le.push("</li>"),Le=n(xe,Le,Ae,le),Le}function S(){return n(d,0,0,o),o.push("</ul>"),o.join("")}var C={heading:function(Le){var Ae=u.exec(Le);if(Ae)return{type:"heading",raw:Ae[0],depth:Ae[1].length,text:Ae[2]}},fences:function(Le){var Ae=this.rules.block.fences.exec(Le);if(Ae){var le=Ae[0],fe=h(le,Ae[3]||""),Ve=Ae[2]?Ae[2].trim():Ae[2];if(["latex","katex","math"].indexOf(Ve)>=0){var Lt=T(),Pt=fe;fe=Lt,_[Lt]={type:"block",expression:Pt}}return{type:"code",raw:le,lang:Ve,text:fe}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,T=function(){return"__special_katext_id_".concat(w++,"__")},_={};function y(){return _}function f(){w=0,_={}}function c(xe){return xe=xe.replace(x,function(Le,Ae){var le=T();return _[le]={type:"inline",expression:Ae},le}),xe}var v=a.listitem;a.listitem=function(xe){return v(c(xe))};var p=a.paragraph;a.paragraph=function(xe){return p(c(xe))};var E=a.tablecell;a.tablecell=function(xe,Le){return E(c(xe),Le)},a.code=function(xe,Le,Ae){var le=(Le||"").match(/\S*/)[0];return le?["latex","katex","math"].indexOf(le)>=0?"<p class='editormd-tex'>".concat(xe,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Le,'">').concat(Ae?xe:Object(m.escape)(xe,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(Ae?xe:Object(m.escape)(xe,!0))+"</code></pre>"},a.heading=function(xe,Le,Ae){var le=this.options.headerPrefix+Ae.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:le,level:Le,text:xe}),"<h"+Le+' id="'+le+'">'+xe+"</h"+Le+">"},b.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),b.a.use({tokenizer:C,renderer:a});var k=b.a,U=M("SJMd"),H=M("ulZh"),W=M.n(H),j=M("m3rI"),O=M("Oy/b"),K=M("p5ED"),Y=M("8hTe"),ee=M.n(Y),se=/<pre[^>]*>/g;function Be(xe){var Le=document.createElement("div");return Le.innerHTML=xe,Le.childNodes.length===0?"":Le.childNodes[0].nodeValue}var me=Ke.a=function(xe){var Le=xe.value,Ae=Le===void 0?"":Le,le=xe.edit,fe=le===void 0?!1:le,Ve=xe.className,Lt=xe.showTextOnly,Pt=xe.showLines,vt=xe.replaces,Fe=xe.zoomImg,_t=xe.hasMask,tt=xe.style,Rt=tt===void 0?{}:tt,Ge=xe.stylesPrev,Ft=Ge===void 0?{}:Ge,wt=String(Ae),yt=Object(F.useRef)(),bn=Object(F.useRef)(),un=Object(F.useState)(""),sn=Object(P.a)(un,2),Ye=sn[0],nn=sn[1],An=Object(F.useState)("office"),ke=Object(P.a)(An,2),Pe=ke[0],rt=ke[1],ht=Object(F.useMemo)(function(){try{var he=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,J=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Z=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;wt=wt.replace(he,"("+j.a.API_SERVER+"/api/attachments/").replace(J,'"'+j.a.API_SERVER+"/api/attachments/").replace(Z,'"'+j.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(Ne){}var re=k(wt),ue=y();if(wt.match(/\[TOC\]/)&&(re=re.replace("<p>[TOC]</p>",S()),s()),re=re.replace(/(__special_katext_id_\d+__)/g,function(Ne,ct){var Gt=ue[ct],an=Gt.type,it=Gt.expression;return Object(O.renderToString)(Be(it)||"",{displayMode:an==="block",throwOnError:!1,output:"html"})}),re=re.replace(/▁/g,"\u2581\u2581\u2581"),f(),Lt){var de=document.createElement("div");return de.innerHTML=re,de.innerText}return setTimeout(function(){return Ee()},500),re},[wt]),Ue=Object(F.useRef)();i.WebkitLineClamp=Pt,Pt&&(Rt=Object(R.a)(Object(R.a)({},Rt),i));function ut(he){var J=he.target;if(J.tagName.toUpperCase()==="IMG"){if(Fe){var Z=J.getAttribute("src");nn(Z),rt("image")}}else if(J.tagName.toUpperCase()==="A"){var re=J.getAttribute("href");if(re.indexOf("office")>-1)he.preventDefault(),nn(re),rt("office");else if(re.indexOf("application/pdf")>-1)he.preventDefault(),nn(re),rt("pdf");else if(re.indexOf("text/html")>-1)he.preventDefault(),nn(re),rt("html");else if(re.startsWith("#")){he.preventDefault();var ue=document.getElementById(re.replace("#",""));ue&&ue.scrollIntoView(!0)}}}var Ee=function(){var J,Z=(J=Ue.current)===null||J===void 0?void 0:J.querySelectorAll("video");Z==null||Z.forEach(function(re){if(re.oncontextmenu=function(){return!1},re.src.indexOf(".m3u8")>-1&&!re.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var ue=new W.a;ue.loadSource(re.src),ue.attachMedia(re)}}})};Object(F.useEffect)(function(){if(Ue.current&&ht&&(ht.match(se)&&window.PR.prettyPrint()),Ue.current)return Ue.current.addEventListener("click",ut),function(){Ue.current.removeEventListener("click",ut),f(),s()}},[ht,Ue.current,ut]);var ce=function(J){if(!fe)return;J.target.nodeName==="IMG"?(yt.current.style.display="flex",yt.current.style.width=J.target.clientWidth+"px",yt.current.style.height=J.target.clientHeight+"px",yt.current.style.top=J.target.offsetTop+"px",yt.current.style.left=J.target.offsetLeft+"px",bn.current.src=J.target.getAttribute("src")):yt.current.style.display="none"};return D.a.createElement("div",{style:{position:"relative"}},D.a.createElement("div",{ref:Ue,style:Object(R.a)({},Rt),className:"".concat(Ve||""," markdown-body ").concat(ee.a.mdBody),onMouseOver:ce,dangerouslySetInnerHTML:{__html:ht}}),D.a.createElement("div",{ref:yt,className:ee.a.button},D.a.createElement(z.a,null,D.a.createElement(B.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),D.a.createElement(B.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),D.a.createElement("img",{ref:bn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),D.a.createElement(K.a,{close:!0,data:Ye,type:Ye!=null&&Ye.length?Pe:"",style:Object(R.a)({},Ft),onClose:function(){return nn("")}}))}},"9VGf":function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return I});var Q=M("cDcd"),z=M.n(Q);function I(B,R){var P=Object(Q.useRef)();Object(Q.useEffect)(function(){P.current=B}),Object(Q.useEffect)(function(){function F(){P.current()}if(R!==null){var D=setInterval(F,R);return function(){return clearInterval(D)}}},[R])}},AHFd:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return D});var Q=M("giR+"),z=M("fyUT"),I=M("OaEy"),B=M("2fM7"),R=M("tJVT"),P=M("cDcd"),F=M.n(P),D;(function(A){A[A.Number=1]="Number",A[A.Percent=2]="Percent"})(D||(D={}));var L=function(b){var m=b.value,h=b.onChange,d=b.disabled,o=b.hidePercentOption,a=o===void 0?!1:o,u=Object(P.useMemo)(function(){return a?D.Number:D.Percent},[a]),s=Object(P.useState)(u),i=Object(R.a)(s,2),n=i[0],S=i[1],C=Object(P.useCallback)(function(w){return n===D.Number?"".concat(w,"\u5206"):"".concat(w,"%")},[n]),x=Object(P.useCallback)(function(w){if(n===D.Number){var T=w.replace("\u5206","");return isNaN(parseInt(T,10))?0:T}else{var _=w.replace("%","");return _}},[n]);return Object(P.useEffect)(function(){S(m.type)},[m]),F.a.createElement("div",{style:{display:"inline-block"}},F.a.createElement(B.a,{onChange:function(T){S(T),h({type:T,inputValue:T===D.Number?5:20})},value:n||u,style:{width:100},options:a?[{label:"\u5206\u503C",value:D.Number}]:[{label:"\u767E\u5206\u6BD4",value:D.Percent},{label:"\u5206\u503C",value:D.Number}],disabled:d}),F.a.createElement(z.a,{disabled:d,value:m.inputValue,formatter:C,parser:x,max:n===D.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(T){h({type:n,inputValue:T})}}))};Ke.b=L},BU3w:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return P});var Q=M("MNnm"),z="rc-util-key";function I(F){if(F.attachTo)return F.attachTo;var D=document.querySelector("head");return D||document.body}function B(F){var D,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Q.a)())return null;var A=document.createElement("style");if((D=L.csp)===null||D===void 0?void 0:D.nonce){var b;A.nonce=(b=L.csp)===null||b===void 0?void 0:b.nonce}A.innerHTML=F;var m=I(L),h=m.firstChild;return L.prepend&&m.prepend?m.prepend(A):L.prepend&&h?m.insertBefore(A,h):m.appendChild(A),A}var R=new Map;function P(F,D){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=I(L);if(!R.has(A)){var b=B("",L),m=b.parentNode;R.set(A,m),m.removeChild(b)}var h=Array.from(R.get(A).children).find(function(s){return s.tagName==="STYLE"&&s[z]===D});if(h){var d,o;if(((d=L.csp)===null||d===void 0?void 0:d.nonce)&&h.nonce!==((o=L.csp)===null||o===void 0?void 0:o.nonce)){var a;h.nonce=(a=L.csp)===null||a===void 0?void 0:a.nonce}return h.innerHTML!==F&&(h.innerHTML=F),h}var u=B(F,L);return u[z]=D,u}},Bd2K:function(zt,Ke,M){(function(Q){Q(M("VrN/"),M("osHv"))})(function(Q){Q.defineOption("autoCloseTags",!1,function(L,A,b){if(b!=Q.Init&&b&&L.removeKeyMap("autoCloseTags"),!A)return;var m={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(m["'/'"]=function(h){return P(h)}),(typeof A!="object"||A.whenOpening!==!1)&&(m["'>'"]=function(h){return B(h)}),L.addKeyMap(m)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["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 B(L){if(L.getOption("disableInput"))return Q.Pass;for(var A=L.listSelections(),b=[],m=L.getOption("autoCloseTags"),h=0;h<A.length;h++){if(!A[h].empty())return Q.Pass;var d=A[h].head,o=L.getTokenAt(d),a=Q.innerMode(L.getMode(),o.state),u=a.state,s=a.mode.xmlCurrentTag&&a.mode.xmlCurrentTag(u),i=s&&s.name;if(!i)return Q.Pass;var n=a.mode.configuration=="html",S=typeof m=="object"&&m.dontCloseTags||n&&z,C=typeof m=="object"&&m.indentTags||n&&I;o.end>d.ch&&(i=i.slice(0,i.length-o.end+d.ch));var x=i.toLowerCase();if(!i||o.type=="string"&&(o.end!=d.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&s.close||o.string.indexOf("/")==d.ch-o.start-1||S&&F(S,x)>-1||D(L,a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(u)||[],i,d,!0))return Q.Pass;var w=typeof m=="object"&&m.emptyTags;if(w&&F(w,i)>-1){b[h]={text:"/>",newPos:Q.Pos(d.line,d.ch+2)};continue}var T=C&&F(C,x)>-1;b[h]={indent:T,text:">"+(T?`
|
|
|
|
`:"")+"</"+i+">",newPos:T?Q.Pos(d.line+1,0):Q.Pos(d.line,d.ch+1)}}for(var _=typeof m=="object"&&m.dontIndentOnAutoClose,h=A.length-1;h>=0;h--){var y=b[h];L.replaceRange(y.text,A[h].head,A[h].anchor,"+insert");var f=L.listSelections().slice(0);f[h]={head:y.newPos,anchor:y.newPos},L.setSelections(f),!_&&y.indent&&(L.indentLine(y.newPos.line,null,!0),L.indentLine(y.newPos.line+1,null,!0))}}function R(L,A){for(var b=L.listSelections(),m=[],h=A?"/":"</",d=L.getOption("autoCloseTags"),o=typeof d=="object"&&d.dontIndentOnSlash,a=0;a<b.length;a++){if(!b[a].empty())return Q.Pass;var u=b[a].head,s=L.getTokenAt(u),i=Q.innerMode(L.getMode(),s.state),n=i.state;if(A&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=u.ch-1))return Q.Pass;var S,C=i.mode.name!="xml"&&L.getMode().name=="htmlmixed";if(C&&i.mode.name=="javascript")S=h+"script";else if(C&&i.mode.name=="css")S=h+"style";else{var x=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(n);if(!x||x.length&&D(L,x,x[x.length-1],u))return Q.Pass;S=h+x[x.length-1]}L.getLine(u.line).charAt(s.end)!=">"&&(S+=">"),m[a]=S}if(L.replaceSelections(m),b=L.listSelections(),!o)for(var a=0;a<b.length;a++)(a==b.length-1||b[a].head.line<b[a+1].head.line)&&L.indentLine(b[a].head.line)}function P(L){return L.getOption("disableInput")?Q.Pass:R(L,!0)}Q.commands.closeTag=function(L){return R(L)};function F(L,A){if(L.indexOf)return L.indexOf(A);for(var b=0,m=L.length;b<m;++b)if(L[b]==A)return b;return-1}function D(L,A,b,m,h){if(!Q.scanForClosingTag)return!1;var d=Math.min(L.lastLine()+1,m.line+500),o=Q.scanForClosingTag(L,m,null,d);if(!o||o.tag!=b)return!1;for(var a=h?1:0,u=A.length-1;u>=0&&A[u]==b;u--)++a;m=o.to;for(var u=1;u<a;u++){var s=Q.scanForClosingTag(L,m,null,d);if(!s||s.tag!=b)return!1;m=s.to}return!0}})},BdwD:function(zt,Ke,M){"use strict";var Q=M("+L6B"),z=M("2/Rp"),I=M("0Owb"),B=M("k1fw"),R=M("cDcd"),P=M.n(R),F=M("FOrL"),D=M.n(F),L=function(b){var m=b.buttonProps,h=m===void 0?{}:m,d=b.styles,o=d===void 0?{}:d,a=b.customText,u=b.ButtonText,s=b.ButtonClick,i=b.Buttonclass,n=b.ButtonTwo;return P.a.createElement("section",{className:"tc animated fadeIn",style:Object(B.a)(Object(B.a)({},{color:"#999",margin:"200px auto"}),o)},P.a.createElement("img",{src:D.a}),P.a.createElement("p",{className:"mt20 font14"},a||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),u&&P.a.createElement(z.a,Object(I.a)({className:i,onClick:s},h),u),n&&n)};Ke.a=L},BjJ7:function(zt,Ke,M){"use strict";M.d(Ke,"d",function(){return z}),M.d(Ke,"c",function(){return I}),M.d(Ke,"e",function(){return B}),M.d(Ke,"b",function(){return R}),M.d(Ke,"a",function(){return F});var Q=M("m3rI");function z(D){var L=!0;if(D.length>0){for(var A=0;A<D.length;A++)if(D[A].compile_success==0||!D[A].compile_success){L=!1;break}}else L=!1;return L}function I(D){for(var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=[],b=0;b<D.length;b++){var m=D[b],h=L?"".concat(L,"/").concat(m.name):"".concat(m.name);A.push({title:m.name,isLeaf:!(m.type==="tree"),key:h})}return A}function B(D,L,A){for(var b=0;b<D.length;b++){var m=D[b];if(m.key===L){m.children=A;break}m.children&&B(m.children,L,A)}return D}function R(D,L,A){var b;return function(){var m=this,h=arguments,d=function(){b=null,A||D.apply(m,h)},o=A&&!b;clearTimeout(b),b=setTimeout(d,L),o&&D.apply(m,h)}}var P=!0,F=Q.a.API_SERVER},"C+DQ":function(zt,Ke,M){},DlQD:function(zt,Ke,M){(function(Q,z){zt.exports=z()})(this,function(){"use strict";function Q(Ee,ce){for(var he=0;he<ce.length;he++){var J=ce[he];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(Ee,J.key,J)}}function z(Ee,ce,he){return ce&&Q(Ee.prototype,ce),he&&Q(Ee,he),Ee}function I(Ee,ce){if(!Ee)return;if(typeof Ee=="string")return B(Ee,ce);var he=Object.prototype.toString.call(Ee).slice(8,-1);if(he==="Object"&&Ee.constructor&&(he=Ee.constructor.name),he==="Map"||he==="Set")return Array.from(Ee);if(he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he))return B(Ee,ce)}function B(Ee,ce){(ce==null||ce>Ee.length)&&(ce=Ee.length);for(var he=0,J=new Array(ce);he<ce;he++)J[he]=Ee[he];return J}function R(Ee,ce){var he;if(typeof Symbol=="undefined"||Ee[Symbol.iterator]==null){if(Array.isArray(Ee)||(he=I(Ee))||ce&&Ee&&typeof Ee.length=="number"){he&&(Ee=he);var J=0;return function(){return J>=Ee.length?{done:!0}:{done:!1,value:Ee[J++]}}}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 he=Ee[Symbol.iterator](),he.next.bind(he)}function P(Ee,ce){return ce={exports:{}},Ee(ce,ce.exports),ce.exports}var F=P(function(Ee){function ce(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function he(J){Ee.exports.defaults=J}Ee.exports={defaults:ce(),getDefaults:ce,changeDefaults:he}}),D=F.defaults,L=F.getDefaults,A=F.changeDefaults,b=/[&<>"']/,m=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=function(ce){return o[ce]};function u(Ee,ce){if(ce){if(b.test(Ee))return Ee.replace(m,a)}else if(h.test(Ee))return Ee.replace(d,a);return Ee}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(Ee){return Ee.replace(s,function(ce,he){return he=he.toLowerCase(),he==="colon"?":":he.charAt(0)==="#"?he.charAt(1)==="x"?String.fromCharCode(parseInt(he.substring(2),16)):String.fromCharCode(+he.substring(1)):""})}var n=/(^|[^\[])\^/g;function S(Ee,ce){Ee=Ee.source||Ee,ce=ce||"";var he={replace:function(Z,re){return re=re.source||re,re=re.replace(n,"$1"),Ee=Ee.replace(Z,re),he},getRegex:function(){return new RegExp(Ee,ce)}};return he}var C=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(Ee,ce,he){if(Ee){var J;try{J=decodeURIComponent(i(he)).replace(C,"").toLowerCase()}catch(Z){return null}if(J.indexOf("javascript:")===0||J.indexOf("vbscript:")===0||J.indexOf("data:")===0)return null}ce&&!x.test(he)&&(he=c(ce,he));try{he=encodeURI(he).replace(/%25/g,"%")}catch(Z){return null}return he}var T={},_=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Ee,ce){T[" "+Ee]||(_.test(Ee)?T[" "+Ee]=Ee+"/":T[" "+Ee]=k(Ee,"/",!0)),Ee=T[" "+Ee];var he=Ee.indexOf(":")===-1;return ce.substring(0,2)==="//"?he?ce:Ee.replace(y,"$1")+ce:ce.charAt(0)==="/"?he?ce:Ee.replace(f,"$1")+ce:Ee+ce}var v={exec:function(){}};function p(Ee){for(var ce=1,he,J;ce<arguments.length;ce++){he=arguments[ce];for(J in he)Object.prototype.hasOwnProperty.call(he,J)&&(Ee[J]=he[J])}return Ee}function E(Ee,ce){var he=Ee.replace(/\|/g,function(re,ue,de){for(var Ne=!1,ct=ue;--ct>=0&&de[ct]==="\\";)Ne=!Ne;return Ne?"|":" |"}),J=he.split(/ \|/),Z=0;if(J.length>ce)J.splice(ce);else for(;J.length<ce;)J.push("");for(;Z<J.length;Z++)J[Z]=J[Z].trim().replace(/\\\|/g,"|");return J}function k(Ee,ce,he){var J=Ee.length;if(J===0)return"";for(var Z=0;Z<J;){var re=Ee.charAt(J-Z-1);if(re===ce&&!he)Z++;else if(re!==ce&&he)Z++;else break}return Ee.substr(0,J-Z)}function U(Ee,ce){if(Ee.indexOf(ce[1])===-1)return-1;for(var he=Ee.length,J=0,Z=0;Z<he;Z++)if(Ee[Z]==="\\")Z++;else if(Ee[Z]===ce[0])J++;else if(Ee[Z]===ce[1]&&(J--,J<0))return Z;return-1}function H(Ee){Ee&&Ee.sanitize&&!Ee.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:u,unescape:i,edit:S,cleanUrl:w,resolveUrl:c,noopTest:v,merge:p,splitCells:E,rtrim:k,findClosingBracket:U,checkSanitizeDeprecation:H},j=F.defaults,O=W.rtrim,K=W.splitCells,Y=W.escape,ee=W.findClosingBracket;function se(Ee,ce,he){var J=ce.href,Z=ce.title?Y(ce.title):null,re=Ee[1].replace(/\\([\[\]])/g,"$1");return Ee[0].charAt(0)!=="!"?{type:"link",raw:he,href:J,title:Z,text:re}:{type:"image",raw:he,href:J,title:Z,text:Y(re)}}function Be(Ee,ce){var he=Ee.match(/^(\s+)(?:```)/);if(he===null)return ce;var J=he[1];return ce.split(`
|
|
`).map(function(Z){var re=Z.match(/^\s+/);if(re===null)return Z;var ue=re[0];return ue.length>=J.length?Z.slice(J.length):Z}).join(`
|
|
`)}var me=function(){function Ee(he){this.options=he||j}var ce=Ee.prototype;return ce.space=function(J){var Z=this.rules.block.newline.exec(J);if(Z)return Z[0].length>1?{type:"space",raw:Z[0]}:{raw:`
|
|
`}},ce.code=function(J,Z){var re=this.rules.block.code.exec(J);if(re){var ue=Z[Z.length-1];if(ue&&ue.type==="paragraph")return{raw:re[0],text:re[0].trimRight()};var de=re[0].replace(/^ {4}/gm,"");return{type:"code",raw:re[0],codeBlockStyle:"indented",text:this.options.pedantic?de:O(de,`
|
|
`)}}},ce.fences=function(J){var Z=this.rules.block.fences.exec(J);if(Z){var re=Z[0],ue=Be(re,Z[3]||"");return{type:"code",raw:re,lang:Z[2]?Z[2].trim():Z[2],text:ue}}},ce.heading=function(J){var Z=this.rules.block.heading.exec(J);if(Z)return{type:"heading",raw:Z[0],depth:Z[1].length,text:Z[2]}},ce.nptable=function(J){var Z=this.rules.block.nptable.exec(J);if(Z){var re={type:"table",header:K(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Z[0]};if(re.header.length===re.align.length){var ue=re.align.length,de;for(de=0;de<ue;de++)/^ *-+: *$/.test(re.align[de])?re.align[de]="right":/^ *:-+: *$/.test(re.align[de])?re.align[de]="center":/^ *:-+ *$/.test(re.align[de])?re.align[de]="left":re.align[de]=null;for(ue=re.cells.length,de=0;de<ue;de++)re.cells[de]=K(re.cells[de],re.header.length);return re}}},ce.hr=function(J){var Z=this.rules.block.hr.exec(J);if(Z)return{type:"hr",raw:Z[0]}},ce.blockquote=function(J){var Z=this.rules.block.blockquote.exec(J);if(Z){var re=Z[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Z[0],text:re}}},ce.list=function(J){var Z=this.rules.block.list.exec(J);if(Z){for(var re=Z[0],ue=Z[2],de=ue.length>1,Ne=ue[ue.length-1]===")",ct={type:"list",raw:re,ordered:de,start:de?+ue.slice(0,-1):"",loose:!1,items:[]},Gt=Z[0].match(this.rules.block.item),an=!1,it,qt,st,pt,Qe,ie,be,Ot=Gt.length,qe=0;qe<Ot;qe++)it=Gt[qe],re=it,qt=it.length,it=it.replace(/^ *([*+-]|\d+[.)]) */,""),~it.indexOf(`
|
|
`)&&(qt-=it.length,it=this.options.pedantic?it.replace(/^ {1,4}/gm,""):it.replace(new RegExp("^ {1,"+qt+"}","gm"),"")),qe!==Ot-1&&(st=this.rules.block.bullet.exec(Gt[qe+1])[0],(de?st.length===1||!Ne&&st[st.length-1]===")":st.length>1||this.options.smartLists&&st!==ue)&&(pt=Gt.slice(qe+1).join(`
|
|
`),ct.raw=ct.raw.substring(0,ct.raw.length-pt.length),qe=Ot-1)),Qe=an||/\n\n(?!\s*$)/.test(it),qe!==Ot-1&&(an=it.charAt(it.length-1)===`
|
|
`,Qe||(Qe=an)),Qe&&(ct.loose=!0),ie=/^\[[ xX]\] /.test(it),be=void 0,ie&&(be=it[1]!==" ",it=it.replace(/^\[[ xX]\] +/,"")),ct.items.push({type:"list_item",raw:re,task:ie,checked:be,loose:Qe,text:it});return ct}},ce.html=function(J){var Z=this.rules.block.html.exec(J);if(Z)return{type:this.options.sanitize?"paragraph":"html",raw:Z[0],pre:!this.options.sanitizer&&(Z[1]==="pre"||Z[1]==="script"||Z[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):Y(Z[0]):Z[0]}},ce.def=function(J){var Z=this.rules.block.def.exec(J);if(Z){Z[3]&&(Z[3]=Z[3].substring(1,Z[3].length-1));var re=Z[1].toLowerCase().replace(/\s+/g," ");return{tag:re,raw:Z[0],href:Z[2],title:Z[3]}}},ce.table=function(J){var Z=this.rules.block.table.exec(J);if(Z){var re={type:"table",header:K(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
`):[]};if(re.header.length===re.align.length){re.raw=Z[0];var ue=re.align.length,de;for(de=0;de<ue;de++)/^ *-+: *$/.test(re.align[de])?re.align[de]="right":/^ *:-+: *$/.test(re.align[de])?re.align[de]="center":/^ *:-+ *$/.test(re.align[de])?re.align[de]="left":re.align[de]=null;for(ue=re.cells.length,de=0;de<ue;de++)re.cells[de]=K(re.cells[de].replace(/^ *\| *| *\| *$/g,""),re.header.length);return re}}},ce.lheading=function(J){var Z=this.rules.block.lheading.exec(J);if(Z)return{type:"heading",raw:Z[0],depth:Z[2].charAt(0)==="="?1:2,text:Z[1]}},ce.paragraph=function(J){var Z=this.rules.block.paragraph.exec(J);if(Z)return{type:"paragraph",raw:Z[0],text:Z[1].charAt(Z[1].length-1)===`
|
|
`?Z[1].slice(0,-1):Z[1]}},ce.text=function(J,Z){var re=this.rules.block.text.exec(J);if(re){var ue=Z[Z.length-1];return ue&&ue.type==="text"?{raw:re[0],text:re[0]}:{type:"text",raw:re[0],text:re[0]}}},ce.escape=function(J){var Z=this.rules.inline.escape.exec(J);if(Z)return{type:"escape",raw:Z[0],text:Y(Z[1])}},ce.tag=function(J,Z,re){var ue=this.rules.inline.tag.exec(J);if(ue)return!Z&&/^<a /i.test(ue[0])?Z=!0:Z&&/^<\/a>/i.test(ue[0])&&(Z=!1),!re&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?re=!0:re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(re=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:Z,inRawBlock:re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]}},ce.link=function(J){var Z=this.rules.inline.link.exec(J);if(Z){var re=ee(Z[2],"()");if(re>-1){var ue=Z[0].indexOf("!")===0?5:4,de=ue+Z[1].length+re;Z[2]=Z[2].substring(0,re),Z[0]=Z[0].substring(0,de).trim(),Z[3]=""}var Ne=Z[2],ct="";if(this.options.pedantic){var Gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ne);Gt?(Ne=Gt[1],ct=Gt[3]):ct=""}else ct=Z[3]?Z[3].slice(1,-1):"";Ne=Ne.trim().replace(/^<([\s\S]*)>$/,"$1");var an=se(Z,{href:Ne&&Ne.replace(this.rules.inline._escapes,"$1"),title:ct&&ct.replace(this.rules.inline._escapes,"$1")},Z[0]);return an}},ce.reflink=function(J,Z){var re;if((re=this.rules.inline.reflink.exec(J))||(re=this.rules.inline.nolink.exec(J))){var ue=(re[2]||re[1]).replace(/\s+/g," ");if(ue=Z[ue.toLowerCase()],!ue||!ue.href){var de=re[0].charAt(0);return{type:"text",raw:de,text:de}}var Ne=se(re,ue,re[0]);return Ne}},ce.strong=function(J,Z,re){re===void 0&&(re="");var ue=this.rules.inline.strong.start.exec(J);if(ue&&(!ue[1]||ue[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){Z=Z.slice(-1*J.length);var de=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;de.lastIndex=0;for(var Ne;(ue=de.exec(Z))!=null;)if(Ne=this.rules.inline.strong.middle.exec(Z.slice(0,ue.index+3)),Ne)return{type:"strong",raw:J.slice(0,Ne[0].length),text:J.slice(2,Ne[0].length-2)}}},ce.em=function(J,Z,re){re===void 0&&(re="");var ue=this.rules.inline.em.start.exec(J);if(ue&&(!ue[1]||ue[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){Z=Z.slice(-1*J.length);var de=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;de.lastIndex=0;for(var Ne;(ue=de.exec(Z))!=null;)if(Ne=this.rules.inline.em.middle.exec(Z.slice(0,ue.index+2)),Ne)return{type:"em",raw:J.slice(0,Ne[0].length),text:J.slice(1,Ne[0].length-1)}}},ce.codespan=function(J){var Z=this.rules.inline.code.exec(J);if(Z){var re=Z[2].replace(/\n/g," "),ue=/[^ ]/.test(re),de=re.startsWith(" ")&&re.endsWith(" ");return ue&&de&&(re=re.substring(1,re.length-1)),re=Y(re,!0),{type:"codespan",raw:Z[0],text:re}}},ce.br=function(J){var Z=this.rules.inline.br.exec(J);if(Z)return{type:"br",raw:Z[0]}},ce.del=function(J){var Z=this.rules.inline.del.exec(J);if(Z)return{type:"del",raw:Z[0],text:Z[1]}},ce.autolink=function(J,Z){var re=this.rules.inline.autolink.exec(J);if(re){var ue,de;return re[2]==="@"?(ue=Y(this.options.mangle?Z(re[1]):re[1]),de="mailto:"+ue):(ue=Y(re[1]),de=ue),{type:"link",raw:re[0],text:ue,href:de,tokens:[{type:"text",raw:ue,text:ue}]}}},ce.url=function(J,Z){var re;if(re=this.rules.inline.url.exec(J)){var ue,de;if(re[2]==="@")ue=Y(this.options.mangle?Z(re[0]):re[0]),de="mailto:"+ue;else{var Ne;do Ne=re[0],re[0]=this.rules.inline._backpedal.exec(re[0])[0];while(Ne!==re[0]);ue=Y(re[0]),re[1]==="www."?de="http://"+ue:de=ue}return{type:"link",raw:re[0],text:ue,href:de,tokens:[{type:"text",raw:ue,text:ue}]}}},ce.inlineText=function(J,Z,re){var ue=this.rules.inline.text.exec(J);if(ue){var de;return Z?de=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]:de=Y(this.options.smartypants?re(ue[0]):ue[0]),{type:"text",raw:ue[0],text:de}}},Ee}(),xe=W.noopTest,Le=W.edit,Ae=W.merge,le={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};le._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,le._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,le.def=Le(le.def).replace("label",le._label).replace("title",le._title).getRegex(),le.bullet=/(?:[*+-]|\d{1,9}[.)])/,le.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,le.item=Le(le.item,"gm").replace(/bull/g,le.bullet).getRegex(),le.list=Le(le.list).replace(/bull/g,le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+le.def.source+")").getRegex(),le._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",le._comment=/<!--(?!-?>)[\s\S]*?-->/,le.html=Le(le.html,"i").replace("comment",le._comment).replace("tag",le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),le.paragraph=Le(le._paragraph).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.blockquote=Le(le.blockquote).replace("paragraph",le.paragraph).getRegex(),le.normal=Ae({},le),le.gfm=Ae({},le.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),le.gfm.nptable=Le(le.gfm.nptable).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.gfm.table=Le(le.gfm.table).replace("hr",le.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",le._tag).getRegex(),le.pedantic=Ae({},le.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",le._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:xe,paragraph:Le(le.normal._paragraph).replace("hr",le.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var fe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,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:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};fe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",fe.punctuation=Le(fe.punctuation).replace(/punctuation/g,fe._punctuation).getRegex(),fe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",fe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",fe.em.start=Le(fe.em.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.middle=Le(fe.em.middle).replace(/punctuation/g,fe._punctuation).replace(/overlapSkip/g,fe._overlapSkip).getRegex(),fe.em.endAst=Le(fe.em.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.endUnd=Le(fe.em.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.start=Le(fe.strong.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.middle=Le(fe.strong.middle).replace(/punctuation/g,fe._punctuation).replace(/blockSkip/g,fe._blockSkip).getRegex(),fe.strong.endAst=Le(fe.strong.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.endUnd=Le(fe.strong.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.blockSkip=Le(fe._blockSkip,"g").getRegex(),fe.overlapSkip=Le(fe._overlapSkip,"g").getRegex(),fe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,fe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,fe._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])?)+(?![-_])/,fe.autolink=Le(fe.autolink).replace("scheme",fe._scheme).replace("email",fe._email).getRegex(),fe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,fe.tag=Le(fe.tag).replace("comment",le._comment).replace("attribute",fe._attribute).getRegex(),fe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,fe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,fe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,fe.link=Le(fe.link).replace("label",fe._label).replace("href",fe._href).replace("title",fe._title).getRegex(),fe.reflink=Le(fe.reflink).replace("label",fe._label).getRegex(),fe.reflinkSearch=Le(fe.reflinkSearch,"g").replace("reflink",fe.reflink).replace("nolink",fe.nolink).getRegex(),fe.normal=Ae({},fe),fe.pedantic=Ae({},fe.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",fe._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fe._label).getRegex()}),fe.gfm=Ae({},fe.normal,{escape:Le(fe.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),fe.gfm.url=Le(fe.gfm.url,"i").replace("email",fe.gfm._extended_email).getRegex(),fe.breaks=Ae({},fe.gfm,{br:Le(fe.br).replace("{2,}","*").getRegex(),text:Le(fe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ve={block:le,inline:fe},Lt=F.defaults,Pt=Ve.block,vt=Ve.inline;function Fe(Ee){return Ee.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 _t(Ee){var ce="",he,J,Z=Ee.length;for(he=0;he<Z;he++)J=Ee.charCodeAt(he),Math.random()>.5&&(J="x"+J.toString(16)),ce+="&#"+J+";";return ce}var tt=function(){function Ee(he){this.tokens=[],this.tokens.links=Object.create(null),this.options=he||Lt,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var J={block:Pt.normal,inline:vt.normal};this.options.pedantic?(J.block=Pt.pedantic,J.inline=vt.pedantic):this.options.gfm&&(J.block=Pt.gfm,this.options.breaks?J.inline=vt.breaks:J.inline=vt.gfm),this.tokenizer.rules=J}Ee.lex=function(J,Z){var re=new Ee(Z);return re.lex(J)};var ce=Ee.prototype;return ce.lex=function(J){return J=J.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(J,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(J,Z,re){Z===void 0&&(Z=[]),re===void 0&&(re=!0),J=J.replace(/^ +$/gm,"");for(var ue,de,Ne,ct;J;){if(ue=this.tokenizer.space(J)){J=J.substring(ue.raw.length),ue.type&&Z.push(ue);continue}if(ue=this.tokenizer.code(J,Z)){J=J.substring(ue.raw.length),ue.type?Z.push(ue):(ct=Z[Z.length-1],ct.raw+=`
|
|
`+ue.raw,ct.text+=`
|
|
`+ue.text);continue}if(ue=this.tokenizer.fences(J)){J=J.substring(ue.raw.length),Z.push(ue);continue}if(ue=this.tokenizer.heading(J)){J=J.substring(ue.raw.length),Z.push(ue);continue}if(ue=this.tokenizer.nptable(J)){J=J.substring(ue.raw.length),Z.push(ue);continue}if(ue=this.tokenizer.hr(J)){J=J.substring(ue.raw.length),Z.push(ue);continue}if(ue=this.tokenizer.blockquote(J)){J=J.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],re),Z.push(ue);continue}if(ue=this.tokenizer.list(J)){for(J=J.substring(ue.raw.length),Ne=ue.items.length,de=0;de<Ne;de++)ue.items[de].tokens=this.blockTokens(ue.items[de].text,[],!1);Z.push(ue);continue}if(ue=this.tokenizer.html(J)){J=J.substring(ue.raw.length),Z.push(ue);continue}if(re&&(ue=this.tokenizer.def(J))){J=J.substring(ue.raw.length),this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(J)){J=J.substring(ue.raw.length),Z.push(ue);continue}if(ue=this.tokenizer.lheading(J)){J=J.substring(ue.raw.length),Z.push(ue);continue}if(re&&(ue=this.tokenizer.paragraph(J))){J=J.substring(ue.raw.length),Z.push(ue);continue}if(ue=this.tokenizer.text(J,Z)){J=J.substring(ue.raw.length),ue.type?Z.push(ue):(ct=Z[Z.length-1],ct.raw+=`
|
|
`+ue.raw,ct.text+=`
|
|
`+ue.text);continue}if(J){var Gt="Infinite loop on byte: "+J.charCodeAt(0);if(this.options.silent){console.error(Gt);break}else throw new Error(Gt)}}return Z},ce.inline=function(J){var Z,re,ue,de,Ne,ct,Gt=J.length;for(Z=0;Z<Gt;Z++){ct=J[Z];switch(ct.type){case"paragraph":case"text":case"heading":{ct.tokens=[],this.inlineTokens(ct.text,ct.tokens);break}case"table":{for(ct.tokens={header:[],cells:[]},de=ct.header.length,re=0;re<de;re++)ct.tokens.header[re]=[],this.inlineTokens(ct.header[re],ct.tokens.header[re]);for(de=ct.cells.length,re=0;re<de;re++)for(Ne=ct.cells[re],ct.tokens.cells[re]=[],ue=0;ue<Ne.length;ue++)ct.tokens.cells[re][ue]=[],this.inlineTokens(Ne[ue],ct.tokens.cells[re][ue]);break}case"blockquote":{this.inline(ct.tokens);break}case"list":{for(de=ct.items.length,re=0;re<de;re++)this.inline(ct.items[re].tokens);break}}}return J},ce.inlineTokens=function(J,Z,re,ue,de){Z===void 0&&(Z=[]),re===void 0&&(re=!1),ue===void 0&&(ue=!1),de===void 0&&(de="");var Ne,ct=J,Gt;if(this.tokens.links){var an=Object.keys(this.tokens.links);if(an.length>0)for(;(Gt=this.tokenizer.rules.inline.reflinkSearch.exec(ct))!=null;)an.includes(Gt[0].slice(Gt[0].lastIndexOf("[")+1,-1))&&(ct=ct.slice(0,Gt.index)+"["+"a".repeat(Gt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Gt=this.tokenizer.rules.inline.blockSkip.exec(ct))!=null;)ct=ct.slice(0,Gt.index)+"["+"a".repeat(Gt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;J;){if(Ne=this.tokenizer.escape(J)){J=J.substring(Ne.raw.length),Z.push(Ne);continue}if(Ne=this.tokenizer.tag(J,re,ue)){J=J.substring(Ne.raw.length),re=Ne.inLink,ue=Ne.inRawBlock,Z.push(Ne);continue}if(Ne=this.tokenizer.link(J)){J=J.substring(Ne.raw.length),Ne.type==="link"&&(Ne.tokens=this.inlineTokens(Ne.text,[],!0,ue)),Z.push(Ne);continue}if(Ne=this.tokenizer.reflink(J,this.tokens.links)){J=J.substring(Ne.raw.length),Ne.type==="link"&&(Ne.tokens=this.inlineTokens(Ne.text,[],!0,ue)),Z.push(Ne);continue}if(Ne=this.tokenizer.strong(J,ct,de)){J=J.substring(Ne.raw.length),Ne.tokens=this.inlineTokens(Ne.text,[],re,ue),Z.push(Ne);continue}if(Ne=this.tokenizer.em(J,ct,de)){J=J.substring(Ne.raw.length),Ne.tokens=this.inlineTokens(Ne.text,[],re,ue),Z.push(Ne);continue}if(Ne=this.tokenizer.codespan(J)){J=J.substring(Ne.raw.length),Z.push(Ne);continue}if(Ne=this.tokenizer.br(J)){J=J.substring(Ne.raw.length),Z.push(Ne);continue}if(Ne=this.tokenizer.del(J)){J=J.substring(Ne.raw.length),Ne.tokens=this.inlineTokens(Ne.text,[],re,ue),Z.push(Ne);continue}if(Ne=this.tokenizer.autolink(J,_t)){J=J.substring(Ne.raw.length),Z.push(Ne);continue}if(!re&&(Ne=this.tokenizer.url(J,_t))){J=J.substring(Ne.raw.length),Z.push(Ne);continue}if(Ne=this.tokenizer.inlineText(J,ue,Fe)){J=J.substring(Ne.raw.length),de=Ne.raw.slice(-1),Z.push(Ne);continue}if(J){var it="Infinite loop on byte: "+J.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return Z},z(Ee,null,[{key:"rules",get:function(){return{block:Pt,inline:vt}}}]),Ee}(),Rt=F.defaults,Ge=W.cleanUrl,Ft=W.escape,wt=function(){function Ee(he){this.options=he||Rt}var ce=Ee.prototype;return ce.code=function(J,Z,re){var ue=(Z||"").match(/\S*/)[0];if(this.options.highlight){var de=this.options.highlight(J,ue);de!=null&&de!==J&&(re=!0,J=de)}return ue?'<pre><code class="'+this.options.langPrefix+Ft(ue,!0)+'">'+(re?J:Ft(J,!0))+`</code></pre>
|
|
`:"<pre><code>"+(re?J:Ft(J,!0))+`</code></pre>
|
|
`},ce.blockquote=function(J){return`<blockquote>
|
|
`+J+`</blockquote>
|
|
`},ce.html=function(J){return J},ce.heading=function(J,Z,re,ue){return this.options.headerIds?"<h"+Z+' id="'+this.options.headerPrefix+ue.slug(re)+'">'+J+"</h"+Z+`>
|
|
`:"<h"+Z+">"+J+"</h"+Z+`>
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ce.list=function(J,Z,re){var ue=Z?"ol":"ul",de=Z&&re!==1?' start="'+re+'"':"";return"<"+ue+de+`>
|
|
`+J+"</"+ue+`>
|
|
`},ce.listitem=function(J){return"<li>"+J+`</li>
|
|
`},ce.checkbox=function(J){return"<input "+(J?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(J){return"<p>"+J+`</p>
|
|
`},ce.table=function(J,Z){return Z&&(Z="<tbody>"+Z+"</tbody>"),`<table>
|
|
<thead>
|
|
`+J+`</thead>
|
|
`+Z+`</table>
|
|
`},ce.tablerow=function(J){return`<tr>
|
|
`+J+`</tr>
|
|
`},ce.tablecell=function(J,Z){var re=Z.header?"th":"td",ue=Z.align?"<"+re+' align="'+Z.align+'">':"<"+re+">";return ue+J+"</"+re+`>
|
|
`},ce.strong=function(J){return"<strong>"+J+"</strong>"},ce.em=function(J){return"<em>"+J+"</em>"},ce.codespan=function(J){return"<code>"+J+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(J){return"<del>"+J+"</del>"},ce.link=function(J,Z,re){if(J=Ge(this.options.sanitize,this.options.baseUrl,J),J===null)return re;var ue='<a href="'+Ft(J)+'"';return Z&&(ue+=' title="'+Z+'"'),ue+=">"+re+"</a>",ue},ce.image=function(J,Z,re){if(J=Ge(this.options.sanitize,this.options.baseUrl,J),J===null)return re;var ue='<img src="'+J+'" alt="'+re+'"';return Z&&(ue+=' title="'+Z+'"'),ue+=this.options.xhtml?"/>":">",ue},ce.text=function(J){return J},Ee}(),yt=function(){function Ee(){}var ce=Ee.prototype;return ce.strong=function(J){return J},ce.em=function(J){return J},ce.codespan=function(J){return J},ce.del=function(J){return J},ce.html=function(J){return J},ce.text=function(J){return J},ce.link=function(J,Z,re){return""+re},ce.image=function(J,Z,re){return""+re},ce.br=function(){return""},Ee}(),bn=function(){function Ee(){this.seen={}}var ce=Ee.prototype;return ce.slug=function(J){var Z=J.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Z)){var re=Z;do this.seen[re]++,Z=re+"-"+this.seen[re];while(this.seen.hasOwnProperty(Z))}return this.seen[Z]=0,Z},Ee}(),un=F.defaults,sn=W.unescape,Ye=function(){function Ee(he){this.options=he||un,this.options.renderer=this.options.renderer||new wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new yt,this.slugger=new bn}Ee.parse=function(J,Z){var re=new Ee(Z);return re.parse(J)};var ce=Ee.prototype;return ce.parse=function(J,Z){Z===void 0&&(Z=!0);var re="",ue,de,Ne,ct,Gt,an,it,qt,st,pt,Qe,ie,be,Ot,qe,Bt,Qt,Ce,De=J.length;for(ue=0;ue<De;ue++){pt=J[ue];switch(pt.type){case"space":continue;case"hr":{re+=this.renderer.hr();continue}case"heading":{re+=this.renderer.heading(this.parseInline(pt.tokens),pt.depth,sn(this.parseInline(pt.tokens,this.textRenderer)),this.slugger);continue}case"code":{re+=this.renderer.code(pt.text,pt.lang,pt.escaped);continue}case"table":{for(qt="",it="",ct=pt.header.length,de=0;de<ct;de++)it+=this.renderer.tablecell(this.parseInline(pt.tokens.header[de]),{header:!0,align:pt.align[de]});for(qt+=this.renderer.tablerow(it),st="",ct=pt.cells.length,de=0;de<ct;de++){for(an=pt.tokens.cells[de],it="",Gt=an.length,Ne=0;Ne<Gt;Ne++)it+=this.renderer.tablecell(this.parseInline(an[Ne]),{header:!1,align:pt.align[Ne]});st+=this.renderer.tablerow(it)}re+=this.renderer.table(qt,st);continue}case"blockquote":{st=this.parse(pt.tokens),re+=this.renderer.blockquote(st);continue}case"list":{for(Qe=pt.ordered,ie=pt.start,be=pt.loose,ct=pt.items.length,st="",de=0;de<ct;de++)qe=pt.items[de],Bt=qe.checked,Qt=qe.task,Ot="",qe.task&&(Ce=this.renderer.checkbox(Bt),be?qe.tokens.length>0&&qe.tokens[0].type==="text"?(qe.tokens[0].text=Ce+" "+qe.tokens[0].text,qe.tokens[0].tokens&&qe.tokens[0].tokens.length>0&&qe.tokens[0].tokens[0].type==="text"&&(qe.tokens[0].tokens[0].text=Ce+" "+qe.tokens[0].tokens[0].text)):qe.tokens.unshift({type:"text",text:Ce}):Ot+=Ce),Ot+=this.parse(qe.tokens,be),st+=this.renderer.listitem(Ot,Qt,Bt);re+=this.renderer.list(st,Qe,ie);continue}case"html":{re+=this.renderer.html(pt.text);continue}case"paragraph":{re+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(st=pt.tokens?this.parseInline(pt.tokens):pt.text;ue+1<De&&J[ue+1].type==="text";)pt=J[++ue],st+=`
|
|
`+(pt.tokens?this.parseInline(pt.tokens):pt.text);re+=Z?this.renderer.paragraph(st):st;continue}default:{var mt='Token with "'+pt.type+'" type was not found.';if(this.options.silent){console.error(mt);return}else throw new Error(mt)}}}return re},ce.parseInline=function(J,Z){Z=Z||this.renderer;var re="",ue,de,Ne=J.length;for(ue=0;ue<Ne;ue++){de=J[ue];switch(de.type){case"escape":{re+=Z.text(de.text);break}case"html":{re+=Z.html(de.text);break}case"link":{re+=Z.link(de.href,de.title,this.parseInline(de.tokens,Z));break}case"image":{re+=Z.image(de.href,de.title,de.text);break}case"strong":{re+=Z.strong(this.parseInline(de.tokens,Z));break}case"em":{re+=Z.em(this.parseInline(de.tokens,Z));break}case"codespan":{re+=Z.codespan(de.text);break}case"br":{re+=Z.br();break}case"del":{re+=Z.del(this.parseInline(de.tokens,Z));break}case"text":{re+=Z.text(de.text);break}default:{var ct='Token with "'+de.type+'" type was not found.';if(this.options.silent){console.error(ct);return}else throw new Error(ct)}}}return re},Ee}(),nn=W.merge,An=W.checkSanitizeDeprecation,ke=W.escape,Pe=F.getDefaults,rt=F.changeDefaults,ht=F.defaults;function Ue(Ee,ce,he){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");if(typeof ce=="function"&&(he=ce,ce=null),ce=nn({},Ue.defaults,ce||{}),An(ce),he){var J=ce.highlight,Z;try{Z=tt.lex(Ee,ce)}catch(Ne){return he(Ne)}var re=function(ct){var Gt;if(!ct)try{Gt=Ye.parse(Z,ce)}catch(an){ct=an}return ce.highlight=J,ct?he(ct):he(null,Gt)};if(!J||J.length<3)return re();if(delete ce.highlight,!Z.length)return re();var ue=0;Ue.walkTokens(Z,function(Ne){Ne.type==="code"&&(ue++,setTimeout(function(){J(Ne.text,Ne.lang,function(ct,Gt){if(ct)return re(ct);Gt!=null&&Gt!==Ne.text&&(Ne.text=Gt,Ne.escaped=!0),ue--,ue===0&&re()})},0))}),ue===0&&re();return}try{var de=tt.lex(Ee,ce);return ce.walkTokens&&Ue.walkTokens(de,ce.walkTokens),Ye.parse(de,ce)}catch(Ne){if(Ne.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+ke(Ne.message+"",!0)+"</pre>";throw Ne}}Ue.options=Ue.setOptions=function(Ee){return nn(Ue.defaults,Ee),rt(Ue.defaults),Ue},Ue.getDefaults=Pe,Ue.defaults=ht,Ue.use=function(Ee){var ce=nn({},Ee);if(Ee.renderer&&function(){var J=Ue.defaults.renderer||new wt,Z=function(de){var Ne=J[de];J[de]=function(){for(var ct=arguments.length,Gt=new Array(ct),an=0;an<ct;an++)Gt[an]=arguments[an];var it=Ee.renderer[de].apply(J,Gt);return it===!1&&(it=Ne.apply(J,Gt)),it}};for(var re in Ee.renderer)Z(re);ce.renderer=J}(),Ee.tokenizer&&function(){var J=Ue.defaults.tokenizer||new me,Z=function(de){var Ne=J[de];J[de]=function(){for(var ct=arguments.length,Gt=new Array(ct),an=0;an<ct;an++)Gt[an]=arguments[an];var it=Ee.tokenizer[de].apply(J,Gt);return it===!1&&(it=Ne.apply(J,Gt)),it}};for(var re in Ee.tokenizer)Z(re);ce.tokenizer=J}(),Ee.walkTokens){var he=Ue.defaults.walkTokens;ce.walkTokens=function(J){Ee.walkTokens(J),he&&he(J)}}Ue.setOptions(ce)},Ue.walkTokens=function(Ee,ce){for(var he=R(Ee),J;!(J=he()).done;){var Z=J.value;ce(Z);switch(Z.type){case"table":{for(var re=R(Z.tokens.header),ue;!(ue=re()).done;){var de=ue.value;Ue.walkTokens(de,ce)}for(var Ne=R(Z.tokens.cells),ct;!(ct=Ne()).done;)for(var Gt=ct.value,an=R(Gt),it;!(it=an()).done;){var qt=it.value;Ue.walkTokens(qt,ce)}break}case"list":{Ue.walkTokens(Z.items,ce);break}default:Z.tokens&&Ue.walkTokens(Z.tokens,ce)}}},Ue.Parser=Ye,Ue.parser=Ye.parse,Ue.Renderer=wt,Ue.TextRenderer=yt,Ue.Lexer=tt,Ue.lexer=tt.lex,Ue.Tokenizer=me,Ue.Slugger=bn,Ue.parse=Ue;var ut=Ue;return ut})},ELLl:function(zt,Ke,M){(function(Q){Q(M("VrN/"))})(function(Q){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=Q.Pos;Q.defineOption("autoCloseBrackets",!1,function(o,a,u){u&&u!=Q.Init&&(o.removeKeyMap(R),o.state.closeBrackets=null),a&&(P(B(a,"pairs")),o.state.closeBrackets=a,o.addKeyMap(R))});function B(o,a){return a=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[a]!=null?o[a]:z[a]}var R={Backspace:L,Enter:A};function P(o){for(var a=0;a<o.length;a++){var u=o.charAt(a),s="'"+u+"'";R[s]||(R[s]=F(u))}}P(z.pairs+"`");function F(o){return function(a){return m(a,o)}}function D(o){var a=o.state.closeBrackets;if(!a||a.override)return a;var u=o.getModeAt(o.getCursor());return u.closeBrackets||a}function L(o){var a=D(o);if(!a||o.getOption("disableInput"))return Q.Pass;for(var u=B(a,"pairs"),s=o.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Q.Pass;var n=h(o,s[i].head);if(!n||u.indexOf(n)%2!=0)return Q.Pass}for(var i=s.length-1;i>=0;i--){var S=s[i].head;o.replaceRange("",I(S.line,S.ch-1),I(S.line,S.ch+1),"+delete")}}function A(o){var a=D(o),u=a&&B(a,"explode");if(!u||o.getOption("disableInput"))return Q.Pass;for(var s=o.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Q.Pass;var n=h(o,s[i].head);if(!n||u.indexOf(n)%2!=0)return Q.Pass}o.operation(function(){var S=o.lineSeparator()||`
|
|
`;o.replaceSelection(S+S,null),o.execCommand("goCharLeft"),s=o.listSelections();for(var C=0;C<s.length;C++){var x=s[C].head.line;o.indentLine(x,null,!0),o.indentLine(x+1,null,!0)}})}function b(o){var a=Q.cmpPos(o.anchor,o.head)>0;return{anchor:new I(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new I(o.head.line,o.head.ch+(a?1:-1))}}function m(o,a){var u=D(o);if(!u||o.getOption("disableInput"))return Q.Pass;var s=B(u,"pairs"),i=s.indexOf(a);if(i==-1)return Q.Pass;for(var n=B(u,"closeBefore"),S=B(u,"triples"),C=s.charAt(i+1)==a,x=o.listSelections(),w=i%2==0,T,_=0;_<x.length;_++){var y=x[_],f=y.head,c,v=o.getRange(f,I(f.line,f.ch+1));if(w&&!y.empty())c="surround";else if((C||!w)&&v==a)C&&d(o,f)?c="both":S.indexOf(a)>=0&&o.getRange(f,I(f.line,f.ch+3))==a+a+a?c="skipThree":c="skip";else if(C&&f.ch>1&&S.indexOf(a)>=0&&o.getRange(I(f.line,f.ch-2),f)==a+a){if(f.ch>2&&/\bstring/.test(o.getTokenTypeAt(I(f.line,f.ch-2))))return Q.Pass;c="addFour"}else if(C){var p=f.ch==0?" ":o.getRange(I(f.line,f.ch-1),f);if(!Q.isWordChar(v)&&p!=a&&!Q.isWordChar(p))c="both";else return Q.Pass}else if(w&&(v.length===0||/\s/.test(v)||n.indexOf(v)>-1))c="both";else return Q.Pass;if(!T)T=c;else if(T!=c)return Q.Pass}var E=i%2?s.charAt(i-1):a,k=i%2?a:s.charAt(i+1);o.operation(function(){if(T=="skip")o.execCommand("goCharRight");else if(T=="skipThree")for(var U=0;U<3;U++)o.execCommand("goCharRight");else if(T=="surround"){for(var H=o.getSelections(),U=0;U<H.length;U++)H[U]=E+H[U]+k;o.replaceSelections(H,"around"),H=o.listSelections().slice();for(var U=0;U<H.length;U++)H[U]=b(H[U]);o.setSelections(H)}else T=="both"?(o.replaceSelection(E+k,null),o.triggerElectric(E+k),o.execCommand("goCharLeft")):T=="addFour"&&(o.replaceSelection(E+E+E+E,"before"),o.execCommand("goCharRight"))})}function h(o,a){var u=o.getRange(I(a.line,a.ch-1),I(a.line,a.ch+1));return u.length==2?u:null}function d(o,a){var u=o.getTokenAt(I(a.line,a.ch+1));return/\bstring/.test(u.type)&&u.start==a.ch&&(a.ch==0||!/\bstring/.test(o.getTokenTypeAt(a)))}})},F0VM:function(zt,Ke,M){zt.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(zt,Ke,M){zt.exports=M.p+"static/nodata.a6b3f948.png"},Gytx:function(zt,Ke){zt.exports=function(Q,z,I,B){var R=I?I.call(B,Q,z):void 0;if(R!==void 0)return!!R;if(Q===z)return!0;if(typeof Q!="object"||!Q||typeof z!="object"||!z)return!1;var P=Object.keys(Q),F=Object.keys(z);if(P.length!==F.length)return!1;for(var D=Object.prototype.hasOwnProperty.bind(z),L=0;L<P.length;L++){var A=P[L];if(!D(A))return!1;var b=Q[A],m=z[A];if(R=I?I.call(B,b,m,A):void 0,R===!1||R===void 0&&b!==m)return!1}return!0}},HmJG:function(zt,Ke,M){},I8Z2:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return B}),M.d(Ke,"b",function(){return h}),M.d(Ke,"c",function(){return o});var Q=M("cDcd"),z=function(){var a=function(u,s){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var S in n)n.hasOwnProperty(S)&&(i[S]=n[S])},a(u,s)};return function(u,s){a(u,s);function i(){this.constructor=u}u.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),I=Q.createContext(null),B=function(a){z(u,a);function u(){return a!==null&&a.apply(this,arguments)||this}return u.prototype.render=function(){return Q.createElement(I.Provider,{value:this.props.store},this.props.children)},u}(Q.Component),R=M("Gytx"),P=M.n(R),F=M("2mql"),D=M.n(F),L=function(){var a=function(u,s){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var S in n)n.hasOwnProperty(S)&&(i[S]=n[S])},a(u,s)};return function(u,s){a(u,s);function i(){this.constructor=u}u.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),A=function(){return A=Object.assign||function(a){for(var u,s=1,i=arguments.length;s<i;s++){u=arguments[s];for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&(a[n]=u[n])}return a},A.apply(this,arguments)};function b(a){return a.displayName||a.name||"Component"}var m=function(){return{}};function h(a,u){u===void 0&&(u={});var s=!!a,i=a||m;return function(S){var C=function(w){L(T,w);function T(_,y){var f=w.call(this,_,y)||this;return f.unsubscribe=null,f.handleChange=function(){if(!f.unsubscribe)return;var c=i(f.store.getState(),f.props);f.setState({subscribed:c})},f.store=f.context,f.state={subscribed:i(f.store.getState(),_),store:f.store,props:_},f}return T.getDerivedStateFromProps=function(_,y){return a&&a.length===2&&_!==y.props?{subscribed:i(y.store.getState(),_),props:_}:{props:_}},T.prototype.componentDidMount=function(){this.trySubscribe()},T.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},T.prototype.shouldComponentUpdate=function(_,y){return!P()(this.props,_)||!P()(this.state.subscribed,y.subscribed)},T.prototype.trySubscribe=function(){s&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},T.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},T.prototype.render=function(){var _=A(A(A({},this.props),this.state.subscribed),{store:this.store});return Q.createElement(S,A({},_,{ref:this.props.miniStoreForwardedRef}))},T.displayName="Connect("+b(S)+")",T.contextType=I,T}(Q.Component);if(u.forwardRef){var x=Q.forwardRef(function(w,T){return Q.createElement(C,A({},w,{miniStoreForwardedRef:T}))});return D()(x,S)}return D()(C,S)}}var d=function(){return d=Object.assign||function(a){for(var u,s=1,i=arguments.length;s<i;s++){u=arguments[s];for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&(a[n]=u[n])}return a},d.apply(this,arguments)};function o(a){var u=a,s=[];function i(C){u=d(d({},u),C);for(var x=0;x<s.length;x++)s[x]()}function n(){return u}function S(C){return s.push(C),function(){var w=s.indexOf(C);s.splice(w,1)}}return{setState:i,getState:n,subscribe:S}}},IBYe:function(zt,Ke,M){"use strict";function Q(z){return null}Ke.a=Q},J66h:function(zt,Ke,M){(function(Q){var z,I;(function(B,R){zt.exports=R(B)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Q!="undefined"?Q:this,function(B){"use strict";B=B||{};var R=B.Base64,P="2.6.4",F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=function(E){for(var k={},U=0,H=E.length;U<H;U++)k[E.charAt(U)]=U;return k}(F),L=String.fromCharCode,A=function(E){if(E.length<2){var k=E.charCodeAt(0);return k<128?E:k<2048?L(192|k>>>6)+L(128|k&63):L(224|k>>>12&15)+L(128|k>>>6&63)+L(128|k&63)}else{var k=65536+(E.charCodeAt(0)-55296)*1024+(E.charCodeAt(1)-56320);return L(240|k>>>18&7)+L(128|k>>>12&63)+L(128|k>>>6&63)+L(128|k&63)}},b=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(E){return E.replace(b,A)},h=function(E){var k=[0,2,1][E.length%3],U=E.charCodeAt(0)<<16|(E.length>1?E.charCodeAt(1):0)<<8|(E.length>2?E.charCodeAt(2):0),H=[F.charAt(U>>>18),F.charAt(U>>>12&63),k>=2?"=":F.charAt(U>>>6&63),k>=1?"=":F.charAt(U&63)];return H.join("")},d=B.btoa&&typeof B.btoa=="function"?function(E){return B.btoa(E)}:function(E){if(E.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return E.replace(/[\s\S]{1,3}/g,h)},o=function(E){return d(m(String(E)))},a=function(E){return E.replace(/[+\/]/g,function(k){return k=="+"?"-":"_"}).replace(/=/g,"")},u=function(E,k){return k?a(o(E)):o(E)},s=function(E){return u(E,!0)},i;B.Uint8Array&&(i=function(E,k){for(var U="",H=0,W=E.length;H<W;H+=3){var j=E[H],O=E[H+1],K=E[H+2],Y=j<<16|O<<8|K;U+=F.charAt(Y>>>18)+F.charAt(Y>>>12&63)+(typeof O!="undefined"?F.charAt(Y>>>6&63):"=")+(typeof K!="undefined"?F.charAt(Y&63):"=")}return k?a(U):U});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(E){switch(E.length){case 4:var k=(7&E.charCodeAt(0))<<18|(63&E.charCodeAt(1))<<12|(63&E.charCodeAt(2))<<6|63&E.charCodeAt(3),U=k-65536;return L((U>>>10)+55296)+L((U&1023)+56320);case 3:return L((15&E.charCodeAt(0))<<12|(63&E.charCodeAt(1))<<6|63&E.charCodeAt(2));default:return L((31&E.charCodeAt(0))<<6|63&E.charCodeAt(1))}},C=function(E){return E.replace(n,S)},x=function(E){var k=E.length,U=k%4,H=(k>0?D[E.charAt(0)]<<18:0)|(k>1?D[E.charAt(1)]<<12:0)|(k>2?D[E.charAt(2)]<<6:0)|(k>3?D[E.charAt(3)]:0),W=[L(H>>>16),L(H>>>8&255),L(H&255)];return W.length-=[0,0,2,1][U],W.join("")},w=B.atob&&typeof B.atob=="function"?function(E){return B.atob(E)}:function(E){return E.replace(/\S{1,4}/g,x)},T=function(E){return w(String(E).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(E){return C(w(E))},y=function(E){return String(E).replace(/[-_]/g,function(k){return k=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(E){return _(y(E))},c;B.Uint8Array&&(c=function(E){return Uint8Array.from(T(y(E)),function(k){return k.charCodeAt(0)})});var v=function(){var E=B.Base64;return B.Base64=R,E};if(B.Base64={VERSION:P,atob:T,btoa:d,fromBase64:f,toBase64:u,utob:m,encode:u,encodeURI:s,btou:C,decode:f,noConflict:v,fromUint8Array:i,toUint8Array:c},typeof Object.defineProperty=="function"){var p=function(E){return{value:E,enumerable:!1,writable:!0,configurable:!0}};B.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",p(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",p(function(E){return u(this,E)})),Object.defineProperty(String.prototype,"toBase64URI",p(function(){return u(this,!0)}))}}return B.Meteor&&(Base64=B.Base64),zt.exports?zt.exports.Base64=B.Base64:!(z=[],I=function(){return B.Base64}.apply(Ke,z),I!==void 0&&(zt.exports=I)),{Base64:B.Base64}})}).call(this,M("IyRk"))},LSTS:function(zt,Ke,M){"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});var Q=function(){function m(h,d){for(var o=0;o<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(h,a.key,a)}}return function(h,d,o){return d&&m(h.prototype,d),o&&m(h,o),h}}(),z=M("cDcd"),I=P(z),B=M("17x9"),R=P(B);function P(m){return m&&m.__esModule?m:{default:m}}function F(m,h){var d={};for(var o in m){if(h.indexOf(o)>=0)continue;if(!Object.prototype.hasOwnProperty.call(m,o))continue;d[o]=m[o]}return d}function D(m,h){if(!(m instanceof h))throw new TypeError("Cannot call a class as a function")}function L(m,h){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:m}function A(m,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);m.prototype=Object.create(h&&h.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(m,h):m.__proto__=h)}var b=function(m){A(h,m);function h(d){D(this,h);var o=L(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,d));return o.scrollListener=o.scrollListener.bind(o),o.eventListenerOptions=o.eventListenerOptions.bind(o),o.mousewheelListener=o.mousewheelListener.bind(o),o}return Q(h,[{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 o=this.getParentElement(this.scrollComponent);o.scrollTop=o.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var o=!1,a={get passive(){o=!0}};try{document.addEventListener("test",null,a),document.removeEventListener("test",null,a)}catch(u){}return o}},{key:"eventListenerOptions",value:function(){var o=this.props.useCapture;return this.isPassiveSupported()&&(o={useCapture:this.props.useCapture,passive:!0}),o}},{key:"setDefaultLoader",value:function(o){this.defaultLoader=o}},{key:"detachMousewheelListener",value:function(){var o=window;this.props.useWindow===!1&&(o=this.scrollComponent.parentNode),o.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var o=window;this.props.useWindow===!1&&(o=this.getParentElement(this.scrollComponent)),o.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(o){var a=this.props.getScrollParent&&this.props.getScrollParent();return a!=null?a:o&&o.parentNode}},{key:"filterProps",value:function(o){return o}},{key:"attachScrollListener",value:function(){var o=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!o)return;var a=window;this.props.useWindow===!1&&(a=o),a.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),a.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(o){o.deltaY===1&&!this.isPassiveSupported()&&o.preventDefault()}},{key:"scrollListener",value:function(){var o=this.scrollComponent,a=window,u=this.getParentElement(o),s=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,n=a.pageYOffset!==void 0?a.pageYOffset:i.scrollTop;this.props.isReverse?s=n:s=this.calculateOffset(o,n)}else this.props.isReverse?s=u.scrollTop:s=o.scrollHeight-u.scrollTop-u.clientHeight;s<Number(this.props.threshold)&&o&&o.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=u.scrollHeight,this.beforeScrollTop=u.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(o,a){return o?this.calculateTopPosition(o)+(o.offsetHeight-a-window.innerHeight):0}},{key:"calculateTopPosition",value:function(o){return o?o.offsetTop+this.calculateTopPosition(o.offsetParent):0}},{key:"render",value:function(){var o=this,a=this.filterProps(this.props),u=a.children,s=a.element,i=a.hasMore,n=a.initialLoad,S=a.isReverse,C=a.loader,x=a.loadMore,w=a.pageStart,T=a.ref,_=a.threshold,y=a.useCapture,f=a.useWindow,c=a.getScrollParent,v=F(a,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);v.ref=function(E){o.scrollComponent=E,T&&T(E)};var p=[u];return i&&(C?S?p.unshift(C):p.push(C):this.defaultLoader&&(S?p.unshift(this.defaultLoader):p.push(this.defaultLoader))),I.default.createElement(s,v,p)}}]),h}(z.Component);b.propTypes={children:R.default.node.isRequired,element:R.default.node,hasMore:R.default.bool,initialLoad:R.default.bool,isReverse:R.default.bool,loader:R.default.node,loadMore:R.default.func.isRequired,pageStart:R.default.number,ref:R.default.func,getScrollParent:R.default.func,threshold:R.default.number,useCapture:R.default.bool,useWindow:R.default.bool},b.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},Ke.default=b,zt.exports=Ke.default},LdHM:function(zt,Ke,M){"use strict";M.d(Ke,"b",function(){return n}),M.d(Ke,"a",function(){return C});var Q=M("1OyB"),z=M("vuIU"),I=M("Ji7U"),B=M("LK+K"),R=M("cDcd"),P=M("rePB"),F=M("Ff2n"),D=M("ODXe"),L=M("4IlW"),A=M("bX4T"),b=M("YrtM"),m=M("TSYQ"),h=M.n(m),d=M("+nKL"),o=M("8OUc"),a=function(K,Y){var ee=K.prefixCls,se=K.id,Be=K.flattenOptions,me=K.childrenAsData,xe=K.values,Le=K.searchValue,Ae=K.multiple,le=K.defaultActiveFirstOption,fe=K.height,Ve=K.itemHeight,Lt=K.notFoundContent,Pt=K.open,vt=K.menuItemSelectedIcon,Fe=K.virtual,_t=K.onSelect,tt=K.onToggleOpen,Rt=K.onActiveValue,Ge=K.onScroll,Ft=K.onMouseEnter,wt="".concat(ee,"-item"),yt=Object(b.a)(function(){return Be},[Pt,Be],function(ut,Ee){return Ee[0]&&ut[1]!==Ee[1]}),bn=R.useRef(null),un=function(Ee){Ee.preventDefault()},sn=function(Ee){bn.current&&bn.current.scrollTo({index:Ee})},Ye=function(Ee){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,he=yt.length,J=0;J<he;J+=1){var Z=(Ee+J*ce+he)%he,re=yt[Z],ue=re.group,de=re.data;if(!ue&&!de.disabled)return Z}return-1},nn=R.useState(function(){return Ye(0)}),An=Object(D.a)(nn,2),ke=An[0],Pe=An[1],rt=function(Ee){Pe(Ee);var ce=yt[Ee];if(!ce){Rt(null,-1);return}Rt(ce.data.value,Ee)};R.useEffect(function(){rt(le!==!1?Ye(0):-1)},[yt.length,Le]),R.useEffect(function(){var ut=setTimeout(function(){if(!Ae&&Pt&&xe.size===1){var Ee=Array.from(xe)[0],ce=yt.findIndex(function(he){var J=he.data;return J.value===Ee});rt(ce),sn(ce)}});return function(){return clearTimeout(ut)}},[Pt]);var ht=function(Ee){Ee!==void 0&&_t(Ee,{selected:!xe.has(Ee)}),Ae||tt(!1)};if(R.useImperativeHandle(Y,function(){return{onKeyDown:function(Ee){var ce=Ee.which;switch(ce){case L.a.UP:case L.a.DOWN:{var he=0;if(ce===L.a.UP?he=-1:ce===L.a.DOWN&&(he=1),he!==0){var J=Ye(ke+he,he);sn(J),rt(J)}break}case L.a.ENTER:{var Z=yt[ke];Z&&!Z.data.disabled?ht(Z.data.value):ht(void 0),Pt&&Ee.preventDefault();break}case L.a.ESC:tt(!1)}},onKeyUp:function(){},scrollTo:function(Ee){sn(Ee)}}}),yt.length===0)return R.createElement("div",{role:"listbox",id:"".concat(se,"_list"),className:"".concat(wt,"-empty"),onMouseDown:un},Lt);function Ue(ut){var Ee=yt[ut];if(!Ee)return null;var ce=Ee.data||{},he=ce.value,J=ce.label,Z=ce.children,re=Object(A.a)(ce,!0),ue=me?Z:J;return Ee?R.createElement("div",Object.assign({"aria-label":typeof ue=="string"?ue:null},re,{key:ut,role:"option",id:"".concat(se,"_list_").concat(ut),"aria-selected":xe.has(he)}),he):null}return R.createElement(R.Fragment,null,R.createElement("div",{role:"listbox",id:"".concat(se,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ue(ke-1),Ue(ke),Ue(ke+1)),R.createElement(d.a,{itemKey:"key",ref:bn,data:yt,height:fe,itemHeight:Ve,fullHeight:!1,onMouseDown:un,onScroll:Ge,virtual:Fe,onMouseEnter:Ft},function(ut,Ee){var ce,he=ut.group,J=ut.groupOption,Z=ut.data,re=Z.label,ue=Z.key;if(he)return R.createElement("div",{className:h()(wt,"".concat(wt,"-group"))},re!==void 0?re:ue);var de=Z.disabled,Ne=Z.value,ct=Z.title,Gt=Z.children,an=Z.style,it=Z.className,qt=Object(F.a)(Z,["disabled","value","title","children","style","className"]),st=xe.has(Ne),pt="".concat(wt,"-option"),Qe=h()(wt,pt,it,(ce={},Object(P.a)(ce,"".concat(pt,"-grouped"),J),Object(P.a)(ce,"".concat(pt,"-active"),ke===Ee&&!de),Object(P.a)(ce,"".concat(pt,"-disabled"),de),Object(P.a)(ce,"".concat(pt,"-selected"),st),ce)),ie=me?Gt:re,be=!vt||typeof vt=="function"||st;return R.createElement("div",Object.assign({},qt,{"aria-selected":st,className:Qe,title:ct,onMouseMove:function(){if(ke===Ee||de)return;rt(Ee)},onClick:function(){de||ht(Ne)},style:an}),R.createElement("div",{className:"".concat(pt,"-content")},ie||Ne),R.isValidElement(vt)||st,be&&R.createElement(o.a,{className:"".concat(wt,"-option-state"),customizeIcon:vt,customizeIconProps:{isSelected:st}},st?"\u2713":null))}))},u=R.forwardRef(a);u.displayName="OptionList";var s=u,i=function(){return null};i.isSelectOption=!0;var n=i,S=function(){return null};S.isSelectOptGroup=!0;var C=S,x=M("VTBJ"),w=M("Zm9Q");function T(O){var K=O.key,Y=O.props,ee=Y.children,se=Y.value,Be=Object(F.a)(Y,["children","value"]);return Object(x.a)({key:K,value:se!==void 0?se:K,children:ee},Be)}function _(O){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(O).map(function(Y,ee){if(!R.isValidElement(Y)||!Y.type)return null;var se=Y.type.isSelectOptGroup,Be=Y.key,me=Y.props,xe=me.children,Le=Object(F.a)(me,["children"]);return K||!se?T(Y):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Be===null?ee:Be,"__"),label:Be},Le),{},{options:_(xe)})}).filter(function(Y){return Y})}var y=M("2Qr1"),f=M("qNPg"),c=M("U8pU"),v=M("Kwbf"),p=M("WKfj");function E(O){var K=O.mode,Y=O.options,ee=O.children,se=O.backfill,Be=O.allowClear,me=O.placeholder,xe=O.getInputElement,Le=O.showSearch,Ae=O.onSearch,le=O.defaultOpen,fe=O.autoFocus,Ve=O.labelInValue,Lt=O.value,Pt=O.inputValue,vt=O.optionLabelProp,Fe=K==="multiple"||K==="tags",_t=Le!==void 0?Le:Fe||K==="combobox",tt=Y||_(ee);if(Object(v.a)(K!=="tags"||tt.every(function(wt){return!wt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),K==="tags"||K==="combobox"){var Rt=tt.some(function(wt){return wt.options?wt.options.some(function(yt){return typeof("value"in yt?yt.value:yt.key)=="number"}):typeof("value"in wt?wt.value:wt.key)=="number"});Object(v.a)(!Rt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(K!=="combobox"||!vt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(K==="combobox"||!se,"`backfill` only works with `combobox` mode."),Object(v.a)(K==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(v.b)(K!=="combobox"||!xe||!Be||!me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ae&&!_t&&K!=="combobox"&&K!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!le||fe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Lt!=null){var Ge=Object(p.d)(Lt);Object(v.a)(!Ve||Ge.every(function(wt){return Object(c.a)(wt)==="object"&&("key"in wt||"value"in wt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!Fe||Array.isArray(Lt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ee){var Ft=null;Object(w.a)(ee).some(function(wt){if(!R.isValidElement(wt)||!wt.type)return!1;var yt=wt.type;if(yt.isSelectOption)return!1;if(yt.isSelectOptGroup){var bn=Object(w.a)(wt.props.children).every(function(un){return!R.isValidElement(un)||!wt.type||un.type.isSelectOption?!0:(Ft=un.type,!1)});return!bn}return Ft=yt,!0}),Ft&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ft.displayName||Ft.name||Ft,"`.")),Object(v.a)(Pt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var k=E,U=Object(f.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:_,flattenOptions:y.d,getLabeledValue:y.e,filterOptions:y.b,isValueDisabled:y.g,findValueOption:y.c,warningProps:k,fillOptionsWithMissingValue:y.a}),H=function(O){Object(I.a)(Y,O);var K=Object(B.a)(Y);function Y(){var ee;return Object(Q.a)(this,Y),ee=K.apply(this,arguments),ee.selectRef=R.createRef(),ee.focus=function(){ee.selectRef.current.focus()},ee.blur=function(){ee.selectRef.current.blur()},ee}return Object(z.a)(Y,[{key:"render",value:function(){return R.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),Y}(R.Component);H.Option=n,H.OptGroup=C;var W=H,j=Ke.c=W},M8RZ:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return L});var Q=M("fWQN"),z=M("mtLc"),I=M("yKVA"),B=M("879j"),R=M("cDcd"),P=M.n(R),F=M("faye"),D=M.n(F),L=function(A){Object(I.a)(m,A);var b=Object(B.a)(m);function m(h){var d;Object(Q.a)(this,m),d=b.call(this,h);var o=window.document;return d.node=o.createElement("div"),o.body.appendChild(d.node),d}return Object(z.a)(m,[{key:"render",value:function(){var d=this.props.children;return Object(F.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(P.a.Component)},NLgs:function(zt,Ke,M){"use strict";M.d(Ke,"e",function(){return n}),M.d(Ke,"f",function(){return S}),M.d(Ke,"d",function(){return x}),M.d(Ke,"c",function(){return w}),M.d(Ke,"a",function(){return T}),M.d(Ke,"b",function(){return _});var Q=M("miYZ"),z=M("tsqr"),I=M("9og8"),B=M("2qtc"),R=M("kLXV"),P=M("WmNS"),F=M.n(P),D=M("cDcd"),L=M.n(D),A=M("9kvl"),b=M("xKgJ"),m=M("1vsH"),h=M("RCxd"),d=M("mOS8"),o=M.n(d),a=M("1ZF9"),u=M.n(a),s=M("NoGO"),i=M.n(s),n=function(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(S(f)&&C(c))},S=function(f){return Object(b.p)()?!0:(f({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},C=function(){var f,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,v=Object(A.c)()._store.getState(),p=v.user;return(f=p.userInfo)!==null&&f!==void 0&&f.profile_completed?!0:(R.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:c?"\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(){A.d.push("/account/profile/edit")}}),!1)},x=function(){var f,c=Object(A.c)()._store.getState(),v=c.user;return(f=v.userInfo)!==null&&f!==void 0&&f.professional_certification?!0:(R.a.confirm({title:"\u63D0\u793A",centered:!0,content:L.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(m.U)("/account/certification")}}),!1)},w=function(){return Object(b.a)()?!0:(R.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),L.a.createElement("img",{src:i.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},T=function(f,c){return f?!0:(R.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",null,L.a.createElement("p",null,c||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),L.a.createElement("div",{style:{marginLeft:"110px"}},L.a.createElement("img",{src:u.a,width:200}),L.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(m.U)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},_=function(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",v=Object(A.c)()._store.getState(),p=v.shixunsDetail.detail;return(p==null?void 0:p.public)===2||(p==null?void 0:p.public)===1||(p==null?void 0:p.shixun_status)===3?(R.a.info({centered:!0,icon:L.a.createElement(h.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(p==null?void 0:p.public)===2?"\u5DF2\u516C\u5F00":(p==null?void 0:p.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",c,"\u3002"),L.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),L.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:o.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(p==null?void 0:p.shixun_status)===2?(R.a.confirm({centered:!0,icon:L.a.createElement(h.a,null),title:"\u63D0\u793A",content:L.a.createElement("div",null,L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",c,"\u3002"),L.a.createElement("br",null),L.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){R.a.confirm({width:440,centered:!0,icon:L.a.createElement(h.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 k=Object(I.a)(F.a.mark(function H(){var W;return F.a.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,f({type:"shixunsDetail/cancelRelease",payload:{id:p==null?void 0:p.identifier}});case 2:W=O.sent,W.status!==401&&(z.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),f({type:"shixunsDetail/getShixunsDetail",payload:{id:p==null?void 0:p.identifier}}),f({type:"practiceSetting/getCommonData",payload:{id:p==null?void 0:p.identifier}}));case 4:case"end":return O.stop()}},H)}));function U(){return k.apply(this,arguments)}return U}()})}}),!0):!1}},Nd3P:function(zt,Ke,M){zt.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"}},NoGO:function(zt,Ke,M){zt.exports=M.p+"static/newqrcode.9bae6615.png"},NvD2:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return P});var Q=M("Kwbf");function z(F,D){var L=new Set;return F.forEach(function(A){D.has(A)||L.add(A)}),L}function I(F){var D=F||{},L=D.disabled,A=D.disableCheckbox,b=D.checkable;return!!(L||A)||b===!1}function B(F,D,L,A){for(var b=new Set(F),m=new Set,h=0;h<=L;h+=1){var d=D.get(h)||new Set;d.forEach(function(s){var i=s.key,n=s.node,S=s.children,C=S===void 0?[]:S;b.has(i)&&!A(n)&&C.filter(function(x){return!A(x.node)}).forEach(function(x){b.add(x.key)})})}for(var o=new Set,a=L;a>=0;a-=1){var u=D.get(a)||new Set;u.forEach(function(s){var i=s.parent,n=s.node;if(A(n)||!s.parent||o.has(s.parent.key))return;if(A(s.parent.node)){o.add(i.key);return}var S=!0,C=!1;(i.children||[]).filter(function(x){return!A(x.node)}).forEach(function(x){var w=x.key,T=b.has(w);S&&!T&&(S=!1),!C&&(T||m.has(w))&&(C=!0)}),S&&b.add(i.key),C&&m.add(i.key),o.add(i.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(z(m,b))}}function R(F,D,L,A,b){for(var m=new Set(F),h=new Set(D),d=0;d<=A;d+=1){var o=L.get(d)||new Set;o.forEach(function(i){var n=i.key,S=i.node,C=i.children,x=C===void 0?[]:C;!m.has(n)&&!h.has(n)&&!b(S)&&x.filter(function(w){return!b(w.node)}).forEach(function(w){m.delete(w.key)})})}h=new Set;for(var a=new Set,u=A;u>=0;u-=1){var s=L.get(u)||new Set;s.forEach(function(i){var n=i.parent,S=i.node;if(b(S)||!i.parent||a.has(i.parent.key))return;if(b(i.parent.node)){a.add(n.key);return}var C=!0,x=!1;(n.children||[]).filter(function(w){return!b(w.node)}).forEach(function(w){var T=w.key,_=m.has(T);C&&!_&&(C=!1),!x&&(_||h.has(T))&&(x=!0)}),C||m.delete(n.key),x&&h.add(n.key),a.add(n.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(z(h,m))}}function P(F,D,L,A){var b=[],m;A?m=A:m=I;var h=new Set(F.filter(function(u){var s=!!L[u];return s||b.push(u),s})),d=new Map,o=0;Object.keys(L).forEach(function(u){var s=L[u],i=s.level,n=d.get(i);n||(n=new Set,d.set(i,n)),n.add(s),o=Math.max(o,i)}),Object(Q.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var a;return D===!0?a=B(h,d,o,m):a=R(h,D.halfCheckedKeys,d,o,m),a}},OH33:function(zt,Ke,M){"use strict";M.r(Ke);var Q=M("g9YV"),z=M("wCAj"),I=M("Znn+"),B=M("ZTPi"),R=M("5Dmo"),P=M("3S7+"),F=M("sPJy"),D=M("bE4q"),L=M("+L6B"),A=M("2/Rp"),b=M("miYZ"),m=M("tsqr"),h=M("9og8"),d=M("2qtc"),o=M("kLXV"),a=M("tJVT"),u=M("WmNS"),s=M.n(u),i=M("cDcd"),n=M.n(i),S=M("ErOA"),C=M("Ty5D"),x=M("55Ip"),w=M("9kvl"),T=M("jhfD"),_=M("1vsH"),y=M("T2oS"),f=M("W9HT"),c=M("DjyN"),v=M("NUBc"),p=M("k1fw"),E=M("9Bee"),k=function(ln){var Tn=ln.shixunHomeworks,fn=ln.dispatch,$n=Object(C.i)();return n.a.createElement(o.a,{centered:!0,title:"\u63D0\u793A",visible:Tn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(h.a)(s.a.mark(function Zn(){var V;return s.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.next=2,fn({type:"shixunHomeworks/deleteReply",payload:{object_id:Tn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:V=ge.sent,V.status===0&&(m.b.success("\u5220\u9664\u6210\u529F"),fn({type:"shixunHomeworks/setActionTabs",payload:{}}),fn({type:"shixunHomeworks/getReplyList",payload:Object(p.a)({},Tn.actionTabs.params)}));case 4:case"end":return ge.stop()}},Zn)})),onCancel:function(){fn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},U=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks;return{shixunHomeworks:ln}})(k),H=M("wd/R"),W=M.n(H),j=M("iF7n"),O=M.n(j),K=M("xKgJ"),Y=M("BdwD");W.a.lang("ZH-cn");var ee=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],se=function(ln){var Tn,fn,$n=ln.shixunHomeworks,Zn=ln.classroomList,V=ln.globalSetting,ae=ln.user,ge=ln.loading,ve=ln.dispatch,Xe=Object(i.useState)(Object(p.a)(Object(p.a)({},Object(C.i)()),{},{per_page:10})),Re=Object(a.a)(Xe,2),ze=Re[0],lt=Re[1],At=Object(i.useState)([]),Dt=Object(a.a)(At,2),Ie=Dt[0],ft=Dt[1],$e=Object(i.useState)(-1),Ze=Object(a.a)($e,2),dt=Ze[0],Tt=Ze[1],at=Object(i.useState)(""),Ut=Object(a.a)(at,2),Yt=Ut[0],yn=Ut[1],In=Object(i.useState)(""),mn=Object(a.a)(In,2),Cn=mn[0],xn=mn[1],Et=Zn.detailLeftMenus,Xt=Object(C.h)(),Mt=Object(i.useState)({}),gt=Object(a.a)(Mt,2),Sn=gt[0],gn=gt[1],Nt=$n.workDetail,et=$n.workList,Rn=Object(i.useState)("1"),$t=Object(a.a)(Rn,2),Bn=$t[0],jt=$t[1],vn=Object(i.useState)(!1),Dn=Object(a.a)(vn,2),tn=Dn[0],oa=Dn[1];Object(i.useEffect)(function(){et.homework_status&&_n()},[et]);function _n(){return hn.apply(this,arguments)}function hn(){return hn=Object(h.a)(s.a.mark(function bt(){var He,Ct,xt;return s.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return oa(!0),kn.next=3,Object(S.a)("/api/courses/".concat(ze.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(p.a)(Object(p.a)({},ze),{},{id:ze.categoryId})});case 3:xt=kn.sent,ft(xt),oa(!1),ze.defaultExpandedRowKeys=["".concat(xt==null||((He=xt.data)===null||He===void 0||((Ct=He[0])===null||Ct===void 0))?void 0:Ct.identifier)],Bn!="2"&&jt(xt!=null&&xt.description?"1":"2"),lt(Object(p.a)({},ze));case 9:case"end":return kn.stop()}},bt)})),hn.apply(this,arguments)}return n.a.createElement("section",{className:O.a.bg},n.a.createElement(f.a,{spinning:tn},n.a.createElement(B.a,{onChange:function(He){jt(He)},activeKey:Bn},n.a.createElement(B.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(Ie!=null&&Ie.description)&&n.a.createElement(Y.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(E.a,{value:(Ie==null?void 0:Ie.description)||""}))),n.a.createElement(B.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"}},ze.defaultExpandedRowKeys&&n.a.createElement(z.a,{dataSource:Ie==null?void 0:Ie.data,rowKey:function(He){return He==null?void 0:He.identifier},pagination:!1,expandable:{expandedRowRender:function(He){var Ct,xt;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",He==null?void 0:He.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",He==null?void 0:He.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(K.c)()&&(Ie==null||((Ct=Ie.homework_status)===null||Ct===void 0)?void 0:Ct.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(A.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(He==null?void 0:He.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[ze.coursesId,ze.categoryId])}},"\u7F16\u8F91"),Object(K.c)()&&(Ie==null||((xt=Ie.homework_status)===null||xt===void 0)?void 0:xt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(A.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){o.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var kn=Object(h.a)(s.a.mark(function Yn(){var Wn;return s.a.wrap(function(na){for(;;)switch(na.prev=na.next){case 0:return na.next=2,Object(S.a)("/api/problems/".concat(He==null?void 0:He.identifier,".json"),{method:"delete"});case 2:Wn=na.sent,(Wn==null?void 0:Wn.status)===0&&(m.b.info("\u5220\u9664\u6210\u529F"),ze.page=1,_n());case 4:case"end":return na.stop()}},Yn)}));function On(){return kn.apply(this,arguments)}return On}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:ze.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(He,Ct,xt){return n.a.createElement("div",null,ee[He])}},{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(He,Ct,xt){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat(ze.coursesId,"/program_homework/").concat(ze.categoryId,"/").concat(He,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(h.a)(s.a.mark(function Vt(){var kn;return s.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return Yn.next=2,Object(S.a)("/api/problems/".concat(Ct==null?void 0:Ct.identifier,"/start.json"),{method:"get"});case 2:kn=Yn.sent,kn&&(window.open("/myproblems/".concat(kn==null?void 0:kn.identifier,"?type=1")),localStorage.setItem("program_homework",[ze.coursesId,ze.categoryId]));case 4:case"end":return Yn.stop()}},Vt)})),style:{margin:"0px 20px"}},Object(K.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(Ie==null||((Tn=Ie.data)===null||Tn===void 0||((fn=Tn[0])===null||fn===void 0))?void 0:fn.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(v.a,{defaultCurrent:1,total:Ie==null?void 0:Ie.count,hideOnSinglePage:!0,showTotal:function(He){return n.a.createElement("span",null,"\u5171",He,"\u6761")},current:ze.page||1,pageSize:ze.per_page||10,onChange:function(He,Ct){ze.page=He,ze.per_page=Ct,lt(Object(p.a)({},ze)),_n()}})))))),n.a.createElement(U,null))},Be=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.classroomList,fn=Mn.loading,$n=Mn.user,Zn=Mn.globalSetting;return{shixunHomeworks:ln,globalSetting:Zn,classroomList:Tn,user:$n,loading:fn.effects}})(se),me=M("oBTY"),xe=M("giR+"),Le=M("fyUT"),Ae=M("7Kak"),le=M("9yH6"),fe=M("qVdP"),Ve=M("jsC+"),Lt=M("5NDa"),Pt=M("5rEg"),vt=M("14J3"),Fe=M("BMrR"),_t=M("sRBo"),tt=M("kaz8"),Rt=M("jCWc"),Ge=M("kPKH"),Ft=M("lUTK"),wt=M("BvKs"),yt=M("jrin"),bn=M("y8nQ"),un=M("Vl3Y"),sn=M("8Skl"),Ye=M("y3Kf"),nn=M("Llu2"),An=M("0NbB"),ke=M("T7RX"),Pe=M("PpiC"),rt=M("IMoZ"),ht=function(ln){var Tn=ln.shixunHomeworks,fn=ln.dispatch,$n=Object(Pe.a)(ln,["shixunHomeworks","dispatch"]),Zn=Object(C.i)(),V=Object(i.useState)(!0),ae=Object(a.a)(V,2),ge=ae[0],ve=ae[1],Xe=Object(i.useState)(!1),Re=Object(a.a)(Xe,2),ze=Re[0],lt=Re[1],At=un.a.useForm(),Dt=Object(a.a)(At,1),Ie=Dt[0],ft=function(){var $e=Object(h.a)(s.a.mark(function Ze(){var dt,Tt;return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return dt=Ie.getFieldValue(),Ut.next=3,Object(S.a)("/api/homework_commons/".concat(Zn.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(me.a)(Tn.actionTabs.selectArrs),cover_all:ge,hidden_comment:dt.hidden_comment,comment:dt.comment}});case 3:Tt=Ut.sent,Tt.status===0&&(m.b.success("\u8BC4\u9605\u6210\u529F"),Ie.resetFields(),fn({type:"shixunHomeworks/setActionTabs",payload:{}}),fn({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},Tn.actionTabs.params)}));case 5:case"end":return Ut.stop()}},Ze)}));return function(){return $e.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(o.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:Tn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(h.a)(s.a.mark(function $e(){var Ze;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:Ze=Ie.getFieldValue(),JSON.stringify(Ze)==="{}"||Ze.hidden_comment===""&&Ze.comment===""?lt(!0):Tn.workList.partial_comment?fn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:Tn.actionTabs.selectArrs,params:Tn.actionTabs.params}}):ft();case 2:case"end":return Tt.stop()}},$e)})),onCancel:function(){fn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(un.a,{form:Ie,onChange:function(){ze&<(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(un.a.Item,{name:"comment"},n.a.createElement(Pt.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(un.a.Item,{name:"hidden_comment"},n.a.createElement(Pt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),ze&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(o.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(rt.a,{className:"c-orange mr20"}),"\u63D0\u793A"),visible:Tn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:function(){ft()},onCancel:function(){fn({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(le.a.Group,{onChange:function(Ze){ve(Ze.target.value)},value:ge},n.a.createElement(le.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(le.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},Ue=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks;return{shixunHomeworks:ln}})(ht),ut=M("XYT7"),Ee=M("Nd3P"),ce=M.n(Ee),he=function(ln){var Tn,fn,$n,Zn,V=ln.shixunHomeworks,ae=ln.dispatch,ge=Object(Pe.a)(ln,["shixunHomeworks","dispatch"]),ve=Object(C.i)(),Xe=Object(i.useState)(!1),Re=Object(a.a)(Xe,2),ze=Re[0],lt=Re[1],At=Object(i.useState)((Tn=V.actionTabs.selectArrs)===null||Tn===void 0||((fn=Tn.data)===null||fn===void 0)?void 0:fn.name),Dt=Object(a.a)(At,2),Ie=Dt[0],ft=Dt[1],$e=un.a.useForm(),Ze=Object(a.a)($e,1),dt=Ze[0];Object(i.useEffect)(function(){var at,Ut,Yt,yn,In,mn;V.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&dt.setFieldsValue({comment:(at=V.actionTabs.selectArrs)===null||at===void 0||((Ut=at.data)===null||Ut===void 0)?void 0:Ut.work_comment,hidden_comment:(Yt=V.actionTabs.selectArrs)===null||Yt===void 0||((yn=Yt.data)===null||yn===void 0)?void 0:yn.work_comment_hidden}),ft((In=V.actionTabs.selectArrs)===null||In===void 0||((mn=In.data)===null||mn===void 0)?void 0:mn.name)},[V.actionTabs.key]);var Tt=function(){var at=Object(h.a)(s.a.mark(function Ut(){var Yt,yn,In,mn;return s.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return In=dt.getFieldValue(),xn.next=3,Object(S.a)("/api/student_works/".concat((Yt=V.actionTabs.selectArrs)===null||Yt===void 0||((yn=Yt.data)===null||yn===void 0)?void 0:yn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:In.hidden_comment,comment:In.comment}});case 3:if(mn=xn.sent,!(mn.status===0)){xn.next=9;break}return m.b.success("\u8BC4\u9605\u6210\u529F"),dt.resetFields(),ae({type:"shixunHomeworks/setActionTabs",payload:{}}),xn.abrupt("return",ae({type:"shixunHomeworks/getWorkList",payload:ve}));case 9:case"end":return xn.stop()}},Ut)}));return function(){return at.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(o.a,{centered:!0,title:($n=V.actionTabs.selectArrs)!==null&&$n!==void 0&&(Zn=$n.data)!==null&&Zn!==void 0&&Zn.work_comment_hidden?"\u66F4\u6539"+Ie+"\u70B9\u8BC4":Ie+"\u70B9\u8BC4",visible:V.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(h.a)(s.a.mark(function at(){var Ut;return s.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:Ut=dt.getFieldValue(),JSON.stringify(Ut)==="{}"||Ut.hidden_comment===""&&Ut.comment===""?lt(!0):Tt();case 2:case"end":return yn.stop()}},at)})),onCancel:function(){ae({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(un.a,{form:dt,onChange:function(){ze&<(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(un.a.Item,{name:"comment"},n.a.createElement(Pt.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(un.a.Item,{name:"hidden_comment"},n.a.createElement(Pt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),ze&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},J=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks;return{shixunHomeworks:ln}})(he),Z=function(ln){var Tn=ln.shixunHomeworks,fn=ln.dispatch,$n=Object(Pe.a)(ln,["shixunHomeworks","dispatch"]),Zn=Object(C.i)(),V=Object(i.useState)([]),ae=Object(a.a)(V,2),ge=ae[0],ve=ae[1],Xe=Object(i.useState)([]),Re=Object(a.a)(Xe,2),ze=Re[0],lt=Re[1];Object(i.useEffect)(function(){Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&At()},[Tn.actionTabs.key]);function At(){return Dt.apply(this,arguments)}function Dt(){return Dt=Object(h.a)(s.a.mark(function ft(){var $e;return s.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(S.a)("/api/homework_commons/".concat(Zn.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:$e=dt.sent,ve($e);case 4:case"end":return dt.stop()}},ft)})),Dt.apply(this,arguments)}var Ie=[{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(o.a,{centered:!0,title:"\u4EE3\u7801\u8D28\u91CF\u8BC4\u5206",visible:Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B",width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(h.a)(s.a.mark(function ft(){var $e;return s.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(S.a)("/api/homework_commons/".concat(Zn.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:ze}});case 2:$e=dt.sent,($e==null?void 0:$e.status)===0&&(w.d.replace("/classrooms/".concat(Zn.coursesId,"/shixun_homework/").concat(Zn.categoryId,"/detail?tabs=4")),window.location.reload(),fn({type:"shixunHomeworks/setActionTabs",payload:{}}),lt([]));case 4:case"end":return dt.stop()}},ft)})),onCancel:function(){lt([]),fn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(z.a,{rowSelection:{type:"checkbox",onChange:function($e,Ze){lt(Object(me.a)($e))},selectedRowKeys:ze,getCheckboxProps:function($e){return{disabled:$e.status==="\u8FDB\u884C\u4E2D"||$e.works_count===0}}},rowKey:function($e){return $e.key||$e.id},scroll:{y:300},pagination:!1,columns:Ie,dataSource:ge==null?void 0:ge.group_list})))},re=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks;return{shixunHomeworks:ln}})(Z),ue=M("Ot1p"),de=M("mgmH"),Ne=function(ln){var Tn,fn,$n,Zn,V,ae,ge,ve,Xe,Re=ln.shixunHomeworks,ze=ln.loading,lt=ln.dispatch,At=ln.setExportParams,Dt=ln.user,Ie=Object(C.i)(),ft=Object(i.useState)(Object(p.a)(Object(p.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),Ie)),$e=Object(a.a)(ft,2),Ze=$e[0],dt=$e[1],Tt=un.a.useForm(),at=Object(a.a)(Tt,1),Ut=at[0],Yt=Object(i.useState)(),yn=Object(a.a)(Yt,2),In=yn[0],mn=yn[1],Cn=Object(i.useState)({}),xn=Object(a.a)(Cn,2),Et=xn[0],Xt=xn[1],Mt=Object(i.useState)([]),gt=Object(a.a)(Mt,2),Sn=gt[0],gn=gt[1],Nt=Object(i.useState)(!1),et=Object(a.a)(Nt,2),Rn=et[0],$t=et[1],Bn=Object(i.useState)([]),jt=Object(a.a)(Bn,2),vn=jt[0],Dn=jt[1],tn=Object(i.useState)(!1),oa=Object(a.a)(tn,2),_n=oa[0],hn=oa[1],bt=Object(i.useState)(),He=Object(a.a)(bt,2),Ct=He[0],xt=He[1],Vt=Object(i.useState)(1),kn=Object(a.a)(Vt,2),On=kn[0],Yn=kn[1],Wn=Object(i.useState)(),pa=Object(a.a)(Wn,2),na=pa[0],ua=pa[1],Ba=Object(i.useState)(),Ia=Object(a.a)(Ba,2),ja=Ia[0],or=Ia[1],sr=Object(i.useState)(),pe=Object(a.a)(sr,2),Se=pe[0],je=pe[1],_e=Object(i.useState)(),q=Object(a.a)(_e,2),oe=q[0],ne=q[1],ye=Object(i.useState)(),Te=Object(a.a)(ye,2),We=Te[0],we=Te[1],Je=Object(i.useState)(!1),St=Object(a.a)(Je,2),Wt=St[0],Zt=St[1],Pn=Object(C.h)();Object(i.useEffect)(function(){return Nn(!0),function(){Xt([]),gn([])}},[Ze.coursesId]),Object(i.useEffect)(function(){var en,Ht=JSON.parse(JSON.stringify(Re.workList));!(Ht!=null&&(en=Ht.student_works)!==null&&en!==void 0&&en.length)&&Ht!==null&&Ht!==void 0&&Ht.id?(Ht.student_works=[Object(p.a)({},Ht)],Xt(Ht)):(Ht!=null&&Ht.id&&gn([Object(p.a)(Object(p.a)({},Ht),{number:"\u6211"})]),Xt(Object(p.a)({},Ht)))},[Re.workList]);var Nn=function(Ht){At(Object(p.a)({},Ze));var dn=lt({type:"shixunHomeworks/getWorkList",payload:Ze});return Ht&&dn.then(function(It){var kt,ea,ba;(It!=null&&(kt=It.homework_status)!==null&&kt!==void 0&&kt.includes("\u8FDB\u884C\u4E2D")||It!=null&&(ea=It.homework_status)!==null&&ea!==void 0&&ea.includes("\u8865\u4EA4\u4E2D")||It!=null&&(ba=It.homework_status)!==null&&ba!==void 0&&ba.includes("\u63D0\u4EA4\u4E2D"))&&!Object(K.s)()&&Qn()}),dn};Object(i.useEffect)(function(){qn()},[]);var qn=function(){var en=Object(h.a)(s.a.mark(function Ht(){var dn;return s.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(ut.I)({categoryId:Ie.categoryId});case 2:dn=kt.sent,mn(dn==null?void 0:dn.update_score);case 4:case"end":return kt.stop()}},Ht)}));return function(){return en.apply(this,arguments)}}(),Qn=function(){var en=Object(h.a)(s.a.mark(function Ht(){var dn;return s.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return lt({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),kt.next=3,Object(ut.Z)({categoryId:Ie.categoryId});case 3:dn=kt.sent,lt({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(dn==null?void 0:dn.status)===0&&(m.b.success(dn==null?void 0:dn.message),Nn());case 6:case"end":return kt.stop()}},Ht)}));return function(){return en.apply(this,arguments)}}(),da=function(){Ze.page=1;var Ht=Object.assign({},Ut.getFieldValue());delete Ze.course_group,delete Ze.teacher_comment,Object.keys(Ht).map(function(dn){switch(dn){case"task_status":Ht[dn].includes("all")||!Ht[dn].length?(delete Ze.work_status,Ut.setFieldsValue(Object(yt.a)({},"task_status","all"))):(Ze.work_status=Ht[dn],Ut.setFieldsValue(Object(yt.a)({},"task_status",Ze.work_status)));break;case"course_group_info":Ht[dn].includes("all")||!Ht[dn].length?(delete Ze.course_group,Ut.setFieldsValue(Object(yt.a)({},"course_group_info","all"))):(Ze.course_group=Ht[dn],Ut.setFieldsValue(Object(yt.a)({},"course_group_info",Ze.course_group)));break;case"teacher_comment":if(Ht[dn].includes("all")||!Ht[dn].length)delete Ze.teacher_comment,Ut.setFieldsValue(Object(yt.a)({},"teacher_comment","all"));else{var It;Ze.teacher_comment=((It=Ht[dn])===null||It===void 0?void 0:It.length)===1?Number(Ht[dn][0]):"",Ut.setFieldsValue(Object(yt.a)({},"teacher_comment",Ht[dn]))}break}}),Nn()};Object(i.useEffect)(function(){if(document.getElementById("divhe")){var en=document.getElementById("divhe").scrollHeight;en>47&&(we(47),Zt(!0))}},[document.getElementById("divhe")]);var ma=function(Ht,dn){Ze.page=Ht,Ze.limit=20,Nn()};function aa(){Yn(1),ua(""),or(""),je(""),ne(""),Dn([])}var ca=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(Ht,dn,It){return Ze.limit*(Ze.page-1)+It+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(Ht){return n.a.createElement(P.a,{placement:"bottomLeft",title:Ht},n.a.createElement("span",{className:"current"},Ht))}},!(Et!=null&&Et.is_excellent)&&!Object(K.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:Ze.order==="student_id"?Ze.b_order==="desc"?"descend":"ascend":null,render:function(Ht){return n.a.createElement(P.a,{placement:"bottomLeft",title:Ht||"--"},n.a.createElement("span",{className:"current"},Ht||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(Ht,dn){return Ht?n.a.createElement(P.a,{placement:"bottom",title:Ht},n.a.createElement("span",{className:"current"},Ht)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:Ze.order==="work_status"?Ze.b_order==="desc"?"descend":"ascend":null,render:function(Ht){return n.a.createElement(_.f,{status:Ht})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(Ht,dn){return n.a.createElement(P.a,{placement:"bottomLeft",title:Ht},n.a.createElement("span",{className:"current"},Ht))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(Ht,dn){return n.a.createElement("span",null,Ht||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(Ht,dn){return n.a.createElement("span",null,Ht||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(Ht,dn){return Ht&&Ht!="--"?n.a.createElement(P.a,{placement:"bottom",title:Ht},n.a.createElement("span",{className:"current"},Ht)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(Ht){return Ht?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(Ht,dn){return Object(K.s)()?n.a.createElement("div",null,Object(_.C)(dn==null?void 0:dn.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(x.a,{target:"_blank",onClick:function(kt){kt.stopPropagation()},to:"/classrooms/".concat(Ze.coursesId,"/program_homework/").concat(Ze.categoryId,"/").concat(dn.id,"/").concat(dn.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(kt){var ea;if(kt.stopPropagation(),(ea=Dt.userInfo)!==null&&ea!==void 0&&ea.professional_certification)window.open("/classrooms/".concat(Ze.coursesId,"/program_homework/").concat(Ze.categoryId,"/").concat(dn.id,"/").concat(dn.user_id,"/comment"),"_blank");else return o.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(_.U)("/account/certification")}}),!1}},"\u67E5\u770B\u4F5C\u4E1A")}}].filter(function(en){return!!en}),ya=function(){return n.a.createElement(wt.a,null,n.a.createElement(wt.a.Item,{onClick:function(){Object(de.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(wt.a.Item,{key:"2"},n.a.createElement(x.a,{to:"/classrooms/".concat(Ze.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(ce.a.wrap," minH500 bg-white pl30 pr30 pt30")},((Tn=Et.homework_status)===null||Tn===void 0?void 0:Tn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(Y.a,null),!((fn=Et.homework_status)!==null&&fn!==void 0&&fn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement("aside",null,!Object(K.c)()&&n.a.createElement("div",{className:"c-light-black font12"},n.a.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4 ",Et==null?void 0:Et.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",Et==null?void 0:Et.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(Et==null?void 0:Et.late_time)||"- -")),Object(K.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(un.a,{form:Ut,onChange:da,initialValues:($n={},Object(yt.a)($n,"task_status","all"),Object(yt.a)($n,"course_group_info","all"),Object(yt.a)($n,"teacher_comment","all"),$n)},((Zn=Et.task_status)===null||Zn===void 0?void 0:Zn.length)>0&&n.a.createElement(un.a.Item,{name:"task_status"},n.a.createElement(tt.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(Ge.a,{flex:"80px"},n.a.createElement(tt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ge.a,{flex:"1"},Et.task_status&&Et.task_status.map(function(en,Ht){return n.a.createElement(tt.a,{name:"task_status",value:en.id},en.name,"(",en.count,")")}))))),((V=Et.course_group_info)===null||V===void 0?void 0:V.length)>0&&n.a.createElement(un.a.Item,{name:"course_group_info"},n.a.createElement(tt.a.Group,{style:{width:"100%"}},n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(Ge.a,{flex:"80px"},n.a.createElement(tt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ge.a,{flex:"1",id:"divhe",style:{height:We+"px",overflow:"hidden"}},(ae=Et.course_group_info)===null||ae===void 0?void 0:ae.map(function(en,Ht){return n.a.createElement(tt.a,{value:en.course_group_id},en.group_group_name,"(",en.count,")")})),Wt&&n.a.createElement("span",{onClick:function(){var Ht=document.getElementById("divhe").scrollHeight;We>47?we(47):we(Ht)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},We===47?"\u5C55\u5F00":"\u6536\u8D77",We===47?n.a.createElement(sn.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(Ye.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((ge=Et.teacher_comment)===null||ge===void 0?void 0:ge.length)>0&&n.a.createElement(un.a.Item,{name:"teacher_comment"},n.a.createElement(tt.a.Group,{style:{width:"100%"}},n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(Ge.a,{flex:"80px"},n.a.createElement(tt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ge.a,{flex:"1"},Et.teacher_comment&&Et.teacher_comment.map(function(en,Ht){return n.a.createElement(tt.a,{value:String(en.id)},en.name,"(",en.count,")")})))))),n.a.createElement(Fe.a,{align:"middle"},n.a.createElement(Ge.a,{flex:"1"},n.a.createElement(Fe.a,{align:"middle"},n.a.createElement(Ge.a,null,n.a.createElement(Pt.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Ht){Ze.search=Ht,Ze.page=1,Nn()},style:{width:240}})),n.a.createElement(Ge.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},Et.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Et.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(Ge.a,null,Object(K.c)()&&n.a.createElement(A.a,{className:"ml10",onClick:function(){lt({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Et.student_works.map(function(Ht){return Ht.id}),params:Ze}})}},n.a.createElement("span",{className:"".concat(ce.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(K.c)()&&n.a.createElement(A.a,{className:"ml10",onClick:Qn},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(K.c)()&&n.a.createElement(Ve.a,{overlay:ya,className:"ml10"},n.a.createElement(A.a,null,n.a.createElement(nn.a,null),"\u5BFC\u51FA",n.a.createElement(An.a,null)))))),n.a.createElement(Fe.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(K.c)()&&In&&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(z.a,{className:"mt30",loading:ze["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(Ht){return{onClick:function(It){window.open("/classrooms/".concat(Ze.coursesId,"/program_homework/").concat(Ze.categoryId,"/").concat(Ht.id,"/").concat(Ht.user_id,"/comment"),"_blank")}}},dataSource:Et.student_works,columns:ca,onChange:function(Ht,dn,It){It.field&&(Ze.order=It.field),It.order||(Ze.b_order="asc"),It.order==="ascend"&&(Ze.b_order="asc"),It.order==="descend"&&(Ze.b_order="desc"),It.order||(Ze.b_order="asc"),Nn()}}),n.a.createElement(Ue,null),n.a.createElement(J,null),n.a.createElement(ke.a,null)),n.a.createElement(o.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:Rn,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(h.a)(s.a.mark(function en(){var Ht,dn;return s.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(!(On===2)){kt.next=13;break}if(!(vn.length<=0)){kt.next=4;break}return m.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),kt.abrupt("return");case 4:if(oe){kt.next=7;break}return m.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),kt.abrupt("return");case 7:return kt.next=9,Object(S.a)("/api/homework_commons/".concat(Ze.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:Ze.categoryId,comment:oe,status:vn}});case 9:Ht=kt.sent,Ht.status===0&&(xt(Ht),$t(!1),hn(!0)),kt.next=32;break;case 13:if(!(Se===0||ja===0)){kt.next=16;break}kt.next=22;break;case 16:if(Se){kt.next=19;break}return m.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),kt.abrupt("return");case 19:if(ja){kt.next=22;break}return m.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),kt.abrupt("return");case 22:if(!(Se>ja)){kt.next=25;break}return m.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),kt.abrupt("return");case 25:if(oe){kt.next=28;break}return m.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),kt.abrupt("return");case 28:return kt.next=30,Object(S.a)("/api/homework_commons/".concat(Ze.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:Ze.categoryId,comment:oe,min_score:Se,max_score:ja}});case 30:dn=kt.sent,dn.status===0&&(xt(dn),$t(!1),hn(!0));case 32:case"end":return kt.stop()}},en)})),onCancel:function(){$t(!1),aa()}},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(le.a.Group,{value:On,onChange:function(Ht){Yn(Ht.target.value)}},n.a.createElement(le.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(le.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),On===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(Le.a,{min:0,max:100,value:Se,onChange:function(Ht){return je(Ht)},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(Le.a,{min:0,max:100,value:ja,onChange:function(Ht){return or(Ht)},style:{width:"100px"}})),On===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(tt.a.Group,{onChange:function(Ht){Dn(Object(me.a)(Ht))},style:{width:"100%"}},(ve=Et.task_status)===null||ve===void 0?void 0:ve.map(function(en,Ht){return n.a.createElement(tt.a,{name:"task_status",value:en.id},en.name,"(",en.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(ue.a,{className:ce.a.MdEditor,onChange:function(Ht){return ne(Ht)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(o.a,{visible:_n,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(h.a)(s.a.mark(function en(){var Ht,dn;return s.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(!(On===2)){kt.next=7;break}return kt.next=3,Object(S.a)("/api/homework_commons/".concat(Ze.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:Ze.categoryId,comment:oe,status:vn}});case 3:Ht=kt.sent,Ht.status===0&&(m.b.info("\u6253\u56DE\u6210\u529F"),aa(),Nn(),hn(!1)),kt.next=11;break;case 7:return kt.next=9,Object(S.a)("/api/homework_commons/".concat(Ze.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:Ze.categoryId,comment:oe,min_score:Se,max_score:ja}});case 9:dn=kt.sent,dn.status===0&&(m.b.info("\u6253\u56DE\u6210\u529F"),aa(),Nn(),hn(!1));case 11:case"end":return kt.stop()}},en)})),onCancel:function(){aa(),hn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},On===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",Se,"-",ja,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),On===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((Xe=Et.task_status)===null||Xe===void 0?void 0:Xe.filter(function(en){return vn==null?void 0:vn.includes(en.id)}).map(function(en){return en.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",Ct==null?void 0:Ct.count,"\u540D\u5B66\u751F")))),n.a.createElement(re,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:ma,current:Ze.page||1,defaultPageSize:20,total:Et.work_count})))},ct=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading,fn=Mn.user;return{shixunHomeworks:ln,loading:Tn.effects,user:fn}})(Ne),Gt=M("fOrg"),an=M("+KLJ"),it=function(ln){var Tn,fn=ln.shixunHomeworks,$n=ln.loading,Zn=ln.dispatch,V=Object(C.i)(),ae=Object(i.useState)(Object(p.a)(Object(p.a)({},{page:1,limit:20,group_ids:[]}),V)),ge=Object(a.a)(ae,2),ve=ge[0],Xe=ge[1],Re=Object(C.h)(),ze=fn.codeReview,lt=Object(i.useState)({}),At=Object(a.a)(lt,2),Dt=At[0],Ie=At[1],ft=un.a.useForm(),$e=Object(a.a)(ft,1),Ze=$e[0];ve.order="code_rate",ve.sort="desc",ve.category=ve.categoryId,Object(i.useEffect)(function(){dt(),console.log("params",ve)},[ve]),Object(i.useEffect)(function(){fn.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&dt()},[fn.actionTabs.key]);var dt=function(){var Yt=Object(h.a)(s.a.mark(function yn(){var In;return s.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.next=2,Zn({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},ve)});case 2:In=Cn.sent,In.status===-2&&setTimeout(function(){return dt()},1500);case 4:case"end":return Cn.stop()}},yn)}));return function(){return Yt.apply(this,arguments)}}(),Tt=function(){},at=function(yn,In){ve.page=yn,ve.limit=20,Zn({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},ve)})},Ut=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(yn,In,mn){return ve.limit*(ve.page-1)+mn+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(yn){return n.a.createElement("span",{className:"c-orange"},yn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(yn,In){return n.a.createElement("div",null,n.a.createElement(x.a,{target:"_blank",to:"/classrooms/".concat(ve.coursesId,"/program_homework/").concat(ve.categoryId,"/review_detail/").concat(In.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(ze==null?void 0:ze.status)===-2&&n.a.createElement(an.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",ze.last_review_time,n.a.createElement(A.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){Zn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:ve}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(Ge.a,null,n.a.createElement(Pt.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(yn){ve.search=yn,Zn({type:"shixunHomeworks/getCodeReview",payload:ve})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((Tn=ze.group_info)===null||Tn===void 0?void 0:Tn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(Ge.a,{flex:"80px"},n.a.createElement(tt.a,{checked:ve.group_ids=="",value:"all",onChange:function(yn){delete ve.group_ids,ve.group_ids=[],ve.page=1,Xe(Object(p.a)({},ve))}},"\u5168\u90E8")),n.a.createElement(Ge.a,{flex:"1"},ze.group_info&&ze.group_info.map(function(Yt,yn){return n.a.createElement(tt.a,{style:{marginLeft:0},value:Yt.id,checked:ve.group_ids.includes(Yt.id),onChange:function(mn){mn.target.checked?ve.group_ids.push(Yt.id):ve.group_ids.splice(ve.group_ids.indexOf(Yt.id),1),ve.page=1,Xe(Object(p.a)({},ve))}},Yt.name,"(",Yt.members_count,")")}))),n.a.createElement(Fe.a,{className:"font14 c-red mt5"},n.a.createElement(Ge.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"},ze.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",ze.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(z.a,{className:"mt30",loading:$n["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:ze.users_reviews,columns:Ut,onChange:function(yn,In,mn){mn.order==="ascend"&&(ve.b_order="asc"),mn.order==="descend"&&(ve.b_order="desc"),mn.order||delete ve.b_order,Zn({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},ve)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showSizeChanger:!1,onChange:at,defaultCurrent:ve.page||1,current:ve.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:ze.copy_reviews_count})))},qt=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading;return{shixunHomeworks:ln,loading:Tn.effects}})(it),st=M("OaEy"),pt=M("2fM7"),Qe=M("iQDF"),ie=M("+eQT"),be=M("/MfK"),Ot=M("w5pM"),qe=M("Lyp1"),Bt=M("LvDl"),Qt=M("xb3X"),Ce=M.n(Qt),De=M("AHFd"),mt=M("eozf"),Jt=ie.a.RangePicker,cn=pt.a.Option,wn=function(ln){var Tn,fn,$n,Zn,V,ae,ge,ve,Xe,Re,ze=ln.shixunHomeworks,lt=ln.loading,At=ln.dispatch,Dt=Object(C.i)(),Ie=ze.workSetting,ft=ze.workList,$e=ze.changeData,Ze=Object(i.useState)(!0),dt=Object(a.a)(Ze,2),Tt=dt[0],at=dt[1],Ut=Object(i.useState)(!1),Yt=Object(a.a)(Ut,2),yn=Yt[0],In=Yt[1],mn=Object(i.useState)([]),Cn=Object(a.a)(mn,2),xn=Cn[0],Et=Cn[1],Xt=Object(i.useState)([]),Mt=Object(a.a)(Xt,2),gt=Mt[0],Sn=Mt[1],gn=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:De.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}),Nt=Object(a.a)(gn,2),et=Nt[0],Rn=Nt[1];Object(i.useEffect)(function(){return $t(),function(){Et([].concat())}},[]);var $t=function(){At({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},Dt)})};Object(i.useEffect)(function(){var bt;if(!(Ie!=null&&Ie.course_id))return;Object.keys(et).map(function(He){et[He]=Ie[He]}),(!et.allow_late||!et.unified_late)&&(et.late_minus_score=20,et.penalty_type=De.a.Percent),et.unified_setting||(et.unified_late=!1,et.unified_anonymous_comment=!1,et.unified_anonymous_appeal=!1),xn=JSON.parse(JSON.stringify(Ie.group_settings.map(function(He){return Object(p.a)(Object(p.a)({},He),{},{group_name:[He.group_name]})}).filter(function(He){return He.publish_time!==null}))),gt=JSON.parse(JSON.stringify(Ie.allow_late_settings.map(function(He){return Object(p.a)(Object(p.a)({},He),{},{group_name:[He.group_name]})}).filter(function(He){return He.late_time!==null}))),et.difficult_settings.length===0&&(et.difficult_settings=[0,0,0]),Rn(Object(p.a)({},et)),Et(Object(me.a)(xn)),((bt=gt)===null||bt===void 0?void 0:bt.length)<=0?Sn([{late_minus_score:20}]):Sn(Object(me.a)(gt))},[Ie]);var Bn=function(){var He,Ct=JSON.parse(JSON.stringify(et));if(Ct.categoryId=Dt.categoryId,et.unified_setting||(xn=(He=xn)===null||He===void 0?void 0:He.map(function(Vt){var kn;if(!Vt.publish_time||!Vt.end_time)throw m.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(!Vt.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Vt.group_name=typeof(Vt==null?void 0:Vt.group_name)=="string"?[Vt==null?void 0:Vt.group_name]:Vt==null?void 0:Vt.group_name,Vt.group_id=(kn=Ie.group_settings)===null||kn===void 0?void 0:kn.filter(function(On){var Yn;return Vt==null||((Yn=Vt.group_name)===null||Yn===void 0)?void 0:Yn.includes(On.group_name)}).map(function(On){return On.group_id||On.id}).toString().split(","),Vt})),Ct.group_settings=xn,et.allow_late)if(et.unified_late){if(et.late_minus_score===null||et.late_minus_score===void 0||et.late_minus_score<0||et.late_minus_score>100)throw m.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(!et.late_time)throw m.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 xt;gt=(xt=gt)===null||xt===void 0?void 0:xt.map(function(Vt){var kn,On;if(Vt.late_minus_score===null||Vt.late_minus_score===void 0||Vt.late_minus_score<0||Vt.late_minus_score>100)throw m.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(!Vt.late_time)throw m.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(!Vt.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Vt.group_name=typeof(Vt==null?void 0:Vt.group_name)=="string"?[Vt==null?void 0:Vt.group_name]:Vt==null?void 0:Vt.group_name,Vt.group_id=Vt==null||((kn=Vt.group_name)===null||kn===void 0||((On=kn.map(function(Yn){var Wn,pa,na=(Wn=Ie.group_settings)===null||Wn===void 0||((pa=Wn.filter(function(ua){return(ua==null?void 0:ua.group_name)===Yn}))===null||pa===void 0)?void 0:pa[0];return na==null?void 0:na.group_id}))===null||On===void 0))?void 0:On.toString().split(","),Vt}),Ct.allow_late_settings=gt}Ct.send_type===1&&(Ct.difficult_settings=Ct.difficult_settings.map(function(Vt){return Vt||0})),jt(Ct)},jt=function(He){var Ct;if(He.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(He!=null&&He.work_efficiency&&He.eff_score===null){m.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var xt={shixun_evaluation:He.shixun_evaluation,challenge_settings:He.challenge_settings},Vt=function(){var kn=Object(h.a)(s.a.mark(function On(){var Yn;return s.a.wrap(function(pa){for(;;)switch(pa.prev=pa.next){case 0:return In(!0),pa.next=3,Object(S.a)("/api/homework_commons/".concat(Dt.categoryId,"/publish_setting.json"),{method:"post",body:Object(p.a)({},He)});case 3:Yn=pa.sent,Yn.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),at(!0),$t(),At({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},Dt)})),In(!1);case 6:case"end":return pa.stop()}},On)}));return function(){return kn.apply(this,arguments)}}();!Object(Bt.isEqual)($e,xt)&&!(ft!=null&&(Ct=ft.homework_status)!==null&&Ct!==void 0&&Ct.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:Vt}):Vt()},vn=function(He,Ct){var xt,Vt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Ct?Ct.find(function(kn){return kn[Vt]===He}):Ie==null||((xt=Ie.group_settings)===null||xt===void 0)?void 0:xt.find(function(kn){return kn.group_id[0]===He})},Dn=(Ie==null?void 0:Ie.allow_late)||(Ie==null?void 0:Ie.anonymous_comment),tn=function(He){var Ct=vn(He,Ie==null?void 0:Ie.allow_late_settings,"id"),xt=vn(He,Ie==null?void 0:Ie.anonymous_comment_settings);return(Ie==null?void 0:Ie.allow_late)&&Ct&&(Ct==null?void 0:Ct.late_time)!==null||(Ie==null?void 0:Ie.anonymous_comment)&&xt&&(xt==null?void 0:xt.evaluation_start)!==null},oa=Object(i.useMemo)(function(){var bt;if(Ie!=null&&Ie.unified_setting){var He;return!(ft!=null&&(He=ft.homework_status)!==null&&He!==void 0&&He.includes("\u5DF2\u622A\u6B62"))||(Ie==null?void 0:Ie.allow_late)||(Ie==null?void 0:Ie.anonymous_comment)}var Ct=Ie==null||((bt=Ie.group_settings)===null||bt===void 0)?void 0:bt.some(function(xt){return W()(xt.end_time)<=W()()});return!Ct||(Ie==null?void 0:Ie.allow_late)||(Ie==null?void 0:Ie.all_group_late)},[Ie,ft]),_n=Ie==null?void 0:Ie.anonymous_comment,hn=function(He){if(!He)return!1;var Ct=vn(He,Ie==null?void 0:Ie.anonymous_comment_settings);return(Ie==null?void 0:Ie.anonymous_comment)&&Ct&&(Ct==null?void 0:Ct.evaluation_start)!==null};return n.a.createElement("section",{className:Ce.a.form},n.a.createElement(Fe.a,{align:"middle"},n.a.createElement(Ge.a,{flex:"1"},n.a.createElement("div",{className:Ce.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(Ge.a,null,Object(K.c)()&&n.a.createElement(A.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return at(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(le.a.Group,{disabled:Tt||!(ft!=null&&(Tn=ft.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),value:et.send_type,onChange:function(He){et.send_type=He.target.value,Rn(Object.assign({},et))}},n.a.createElement(le.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(le.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),et.send_type===1&&n.a.createElement(Fe.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(Ge.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement(Le.a,{precision:0,disabled:Tt||!(ft!=null&&(fn=ft.homework_status)!==null&&fn!==void 0&&fn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(et.difficult_count[0]||0),min:0,max:et.difficult_count[0]||0,value:et.difficult_settings[0],onChange:function(He){et.difficult_settings[0]=He,Rn(Object.assign({},et))},className:"ml10 mr20"})),n.a.createElement(Ge.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement(Le.a,{precision:0,disabled:Tt||!(ft!=null&&($n=ft.homework_status)!==null&&$n!==void 0&&$n.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(et.difficult_count[1]||0),min:0,max:et.difficult_count[1]||0,value:et.difficult_settings[1],onChange:function(He){et.difficult_settings[1]=He,Rn(Object.assign({},et))},className:"ml10 mr20"})),n.a.createElement(Ge.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement(Le.a,{precision:0,disabled:Tt||!(ft!=null&&(Zn=ft.homework_status)!==null&&Zn!==void 0&&Zn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(et.difficult_count[2]||0),min:0,max:et.difficult_count[2]||0,value:et.difficult_settings[2],onChange:function(He){et.difficult_settings[2]=He,Rn(Object.assign({},et))},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(le.a.Group,{disabled:Tt||!(ft!=null&&(V=ft.homework_status)!==null&&V!==void 0&&V.includes("\u672A\u53D1\u5E03")),value:et.unified_setting,onChange:function(He){var Ct;if(!(ft!=null&&(Ct=ft.homework_status)!==null&&Ct!==void 0&&Ct.includes("\u672A\u53D1\u5E03"))){m.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(et.unified_setting=!et.unified_setting,et.unified_setting||(et.unified_late=!1),Rn(Object.assign({},et)),et.unified_setting===!1&&xn==""){Et(xn.concat({}));return}et.unified_setting&&(Et([]),Sn([{late_minus_score:5}]))}},n.a.createElement(le.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(le.a,{className:"ml20",disabled:(Ie==null||((ae=Ie.group_settings)===null||ae===void 0)?void 0:ae.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Ie==null||((ge=Ie.group_settings)===null||ge===void 0)?void 0:ge.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")),et.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(Fe.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ge.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(Ge.a,{className:"ml10"},n.a.createElement(ie.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(He){return Object(mt.b)(He,Ie==null?void 0:Ie.course_end_date)},disabledTime:function(He){return Object(mt.c)(He)},disabled:Tt||!(ft!=null&&(ve=ft.homework_status)!==null&&ve!==void 0&&ve.includes("\u672A\u53D1\u5E03")),value:et.publish_time?W()(et.publish_time):"",onChange:function(He,Ct){et.publish_time=Ct,(et.end_time==""||!et.end_time)&&et.unified_setting&&(et.end_time=W()(He).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Rn(Object.assign({},et))}})),n.a.createElement(Ge.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(Fe.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ge.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(Ge.a,{className:"ml10"},n.a.createElement(ie.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:W()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Tt||Dn,disabledDate:function(He){return Object(mt.b)(He,Ie==null?void 0:Ie.course_end_date,et.publish_time)},disabledTime:function(He){return Object(mt.c)(He,et.publish_time)},value:et.end_time?W()(et.end_time):"",onChange:function(He,Ct){et.end_time=Ct,Rn(Object.assign({},et))}})),n.a.createElement(Ge.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)")))),!et.unified_setting&&((Xe=xn)===null||Xe===void 0?void 0:Xe.length)>0&&n.a.createElement(Fe.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(Ge.a,{span:24},n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{span:10}),n.a.createElement(Ge.a,{span:10},n.a.createElement(Fe.a,{className:"c-grey-c ml30"},n.a.createElement(Ge.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(Ge.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(Ge.a,{span:4}))),xn&&xn.map(function(bt,He){var Ct,xt,Vt,kn,On;return n.a.createElement(Ge.a,{span:24,key:He},n.a.createElement(Fe.a,{gutter:[8,16]},n.a.createElement(Ge.a,{span:10},n.a.createElement(Fe.a,{gutter:[8,16]},n.a.createElement(Ge.a,null,"\u53D1\u5E03\u89C4\u5219 ",He+1),n.a.createElement(Ge.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(pt.a,{disabled:Tt||!(ft!=null&&(Ct=ft.homework_status)!==null&&Ct!==void 0&&Ct.includes("\u672A\u53D1\u5E03"))&&bt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:bt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Wn){xn[He].group_name=Wn,xn[He].group_id=bt.group_id;var pa=Object(Bt.flattenDeep)(xn.map(function(ua){return ua.group_name})),na=gt.map(function(ua){var Ba=(ua==null?void 0:ua.group_name)||[];return Object(p.a)(Object(p.a)({},ua),{},{group_name:Object(Bt.remove)(Ba,function(Ia){return pa.includes(Ia)})})});Sn(na),Et(xn.slice())}},Ie.group_settings&&Ie.group_settings.map(function(Yn){if(!xn.map(function(Wn){return Wn.group_name}).toString().split(",").includes(String(Yn.group_name)))return n.a.createElement(cn,{value:Yn.group_name,key:Yn.id},Yn.group_name)}))))),n.a.createElement(Ge.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Jt,{allowClear:!1,ranges:{\u6B64\u523B:[bt.publish_time?W()(bt.publish_time):W()(),W()()]},disabled:Tt||(W()()<=W()((xt=vn((Vt=bt.group_id)===null||Vt===void 0?void 0:Vt[0]))===null||xt===void 0?void 0:xt.publish_time)?!1:[!0,tn((kn=bt.group_id)===null||kn===void 0?void 0:kn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(Wn){return Object(mt.b)(Wn,Ie==null?void 0:Ie.course_end_date)},disabledTime:function(Wn){return Object(mt.c)(Wn)},showTime:{format:"HH:mm",defaultValue:[W()(Object(_.d)(),"HH:mm"),W()(Object(_.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:bt.publish_time&&[W()(bt.publish_time),bt.end_time?W()(bt.end_time):void 0],onChange:function(Wn,pa){xn[He].publish_time=pa[0],xn[He].end_time=pa[1],Et(Object(me.a)(xn))}}))),!Tt&&n.a.createElement(Ge.a,{span:4},He>0&&!bt.id&&n.a.createElement(be.a,{onClick:function(){xn=xn.filter(function(Wn,pa){return He!==pa}),Et(xn.slice()),setTimeout(function(){return Et(xn.slice())},10)}}),xn.length<(Ie==null||((On=Ie.group_settings)===null||On===void 0)?void 0:On.length)&&n.a.createElement(Ot.a,{className:"c-green ml20",onClick:function(){Et(xn.concat({}))}}))))})),n.a.createElement(Fe.a,{className:"mt30"},n.a.createElement(Ge.a,null,n.a.createElement(Fe.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(P.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(qe.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(Ge.a,{span:24,className:"mt10"},n.a.createElement(tt.a,{checked:et.allow_late,disabled:Tt||oa,onChange:function(){et.allow_late=!et.allow_late,gt==""&&Sn([{late_minus_score:5}]),Rn(Object.assign({},et))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(P.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(qe.a,null)))),(et==null?void 0:et.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(le.a.Group,{disabled:Tt||(Ie==null?void 0:Ie.anonymous_comment)||(Ie==null?void 0:Ie.allow_late),value:et.unified_late,onChange:function(He){et.unified_late=He.target.value,gt==""&&!He.target.value&&Sn([{late_minus_score:5}]),Rn(Object(p.a)({},et))}},(et==null?void 0:et.unified_setting)&&n.a.createElement(le.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Ie==null||((Re=Ie.group_settings)===null||Re===void 0)?void 0:Re.length)&&n.a.createElement(le.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),et!=null&&et.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(Fe.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ge.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(Ge.a,{className:"ml5"},n.a.createElement(De.b,{disabled:Tt||_n,value:{type:et.penalty_type,inputValue:et.late_minus_score},onChange:function(He){Rn(Object(p.a)(Object(p.a)({},et),{},{late_minus_score:He.inputValue,penalty_type:He.type}))}})),n.a.createElement(Ge.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},et.penalty_type===De.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(Fe.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ge.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(Ge.a,{className:"ml5"},n.a.createElement(ie.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:W()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Tt||_n,value:et.late_time?W()(et.late_time):"",disabledDate:function(He){return Object(mt.b)(He,Ie==null?void 0:Ie.course_end_date)},disabledTime:function(He){return Object(mt.c)(He)},onChange:function(He,Ct){et.late_time=Ct,Rn(Object.assign({},et))}})),n.a.createElement(Ge.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)")))):gt.map(function(bt,He){var Ct;return n.a.createElement(Ge.a,{span:24,key:He},n.a.createElement(Fe.a,{className:"mt25"},n.a.createElement(Ge.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",He+1,"\uFF1A"),n.a.createElement(pt.a,{disabled:Tt||!(ft!=null&&(Ct=ft.homework_status)!==null&&Ct!==void 0&&Ct.includes("\u672A\u53D1\u5E03"))&&bt.id||(Ie==null?void 0:Ie.anonymous_comment),mode:"multiple",style:{width:306},value:typeof bt.group_name=="string"?[bt.group_name]:bt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Vt){gt[He].group_name=Vt,gt[He].group_id=bt.group_id,Sn(gt.slice())}},Ie.group_settings&&Ie.group_settings.map(function(xt){if(et!=null&&et.unified_setting&&!gt.map(function(Vt){return Vt.group_name}).toString().split(",").includes(String(xt.group_name)))return n.a.createElement(cn,{value:xt.group_name,key:xt.id},xt.group_name);if(xn.map(function(Vt){return Vt.group_name}).toString().split(",").includes(String(xt.group_name))&&(!gt.map(function(Vt){return Vt.group_name}).toString().split(",").includes(String(xt.group_name))&&W()(xt.end_time)<=W()()))return n.a.createElement(cn,{value:xt.group_name,key:xt.id},xt.group_name)}))),n.a.createElement(Ge.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(De.b,{disabled:Tt||hn(bt.id),value:{type:bt.penalty_type,inputValue:bt.late_minus_score},onChange:function(Vt){gt[He].late_minus_score=Vt.inputValue,gt[He].penalty_type=Vt.type,Sn(Object(me.a)(gt))}})),n.a.createElement(Ge.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(ie.a,{disabled:Tt||hn(bt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:W()(Object(_.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(Vt){return Object(mt.b)(Vt,Ie==null?void 0:Ie.course_end_date)},disabledTime:function(Vt){return Object(mt.c)(Vt)},format:"YYYY-MM-DD HH:mm",value:bt!=null&&bt.late_time?W()(bt.late_time):void 0,onChange:function(Vt,kn){gt[He].late_time=kn,Sn(Object(me.a)(gt))}})),!Tt&&n.a.createElement(Ge.a,{className:"ml20"},He>0&&!bt.id&&n.a.createElement(be.a,{onClick:function(){gt=gt.filter(function(Vt,kn){return He!==kn}),Sn(gt.slice()),setTimeout(function(){return Sn(gt.slice())},10)}}),n.a.createElement(Ot.a,{className:"c-green ml20",onClick:function(){Sn(gt.concat({penalty_type:De.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!Tt&&n.a.createElement("div",{className:Ce.a.btns},n.a.createElement(A.a,{type:"primary",loading:yn,onClick:function(){return Bn()}},"\u63D0\u4EA4"),n.a.createElement(A.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){at(!0),$t()}},"\u53D6\u6D88")))},sa=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading;return{shixunHomeworks:ln,loading:Tn.effects}})(wn);function zn(Mn,ln){for(var Tn=[],fn=Mn;fn<ln;fn++)Tn.push(fn);return Tn}var En=function(ln){var Tn=new Date,fn=W()(ln).format("HH");if(W()(ln).isSame(W()(Tn),"day")){var $n=W()(Tn).format("HH"),Zn=W()(Tn).format("mm");return{disabledHours:function(){return zn(0,24).splice(1,$n*1-1)},disabledMinutes:function(){return console.log("\u7981\u6B62\u65F6\u95F4\uFF1A",fn,$n),W()(ln).isSame(W()(Tn),"hour")&&fn<=$n?zn(0,60).splice(0,Zn):zn(60,60)}}}else if(W()(ln).isSame(W()(),"day")){var V=W()().format("HH"),ae=W()().format("mm");return{disabledHours:function(){return zn(0,24).splice(0,V)},disabledMinutes:function(){return fn<=V?zn(0,ae):zn(60,60)}}}else return},ga=ie.a.RangePicker,Ua=pt.a.Option,ta=function(ln){var Tn,fn=ln.shixunHomeworks,$n=ln.loading,Zn=ln.dispatch,V=Object(C.i)(),ae=Object(C.h)(),ge=fn.workSetting,ve=fn.workList,Xe=fn.changeData,Re=Object(i.useState)(!0),ze=Object(a.a)(Re,2),lt=ze[0],At=ze[1],Dt=Object(i.useState)({}),Ie=Object(a.a)(Dt,2),ft=Ie[0],$e=Ie[1],Ze=Object(i.useState)(!1),dt=Object(a.a)(Ze,2),Tt=dt[0],at=dt[1],Ut=un.a.useForm(),Yt=Object(a.a)(Ut,1),yn=Yt[0],In=Object(i.useState)([]),mn=Object(a.a)(In,2),Cn=mn[0],xn=mn[1],Et=Object(i.useState)([]),Xt=Object(a.a)(Et,2),Mt=Xt[0],gt=Xt[1],Sn=Object(i.useState)(!1),gn=Object(a.a)(Sn,2),Nt=gn[0],et=gn[1],Rn=Object(i.useState)([]),$t=Object(a.a)(Rn,2),Bn=$t[0],jt=$t[1],vn=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:""}),Dn=Object(a.a)(vn,2),tn=Dn[0],oa=Dn[1];Object(i.useEffect)(function(){return _n(),function(){xn([].concat())}},[]);var _n=function(){Zn({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},V)})},hn=function(xt){return xt&&xt<W()().startOf("day")};Object(i.useEffect)(function(){var Ct;if(!(ge!=null&&ge.course_id))return;Object.keys(tn).map(function(xt){tn[xt]=ge[xt]}),(!tn.allow_late||!tn.unified_late)&&(tn.late_penalty=5),Cn=JSON.parse(JSON.stringify(ge.group_settings.map(function(xt){return Object(p.a)(Object(p.a)({},xt),{},{group_name:[xt.group_name]})}).filter(function(xt){return xt.publish_time!==null}))),Mt=JSON.parse(JSON.stringify(ge.allow_late_settings.map(function(xt){return Object(p.a)(Object(p.a)({},xt),{},{group_name:[xt.group_name]})}).filter(function(xt){return xt.rank_forbidden_start!==null}))),oa(Object(p.a)({},tn)),xn(Object(me.a)(Cn)),((Ct=Mt)===null||Ct===void 0?void 0:Ct.length)<=0?gt([{}]):gt(Object(me.a)(Mt))},[ge]),console.log(tn,"data");var bt=function(){var xt,Vt=JSON.parse(JSON.stringify(tn));if(Vt.categoryId=V.categoryId,tn.unified_setting||(Cn=(xt=Cn)===null||xt===void 0?void 0:xt.map(function(On){var Yn;if(!On.publish_time||!On.end_time)throw m.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(!On.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return On.group_name=typeof(On==null?void 0:On.group_name)=="string"?[On==null?void 0:On.group_name]:On==null?void 0:On.group_name,On.group_id=(Yn=ge.group_settings)===null||Yn===void 0?void 0:Yn.filter(function(Wn){var pa;return On==null||((pa=On.group_name)===null||pa===void 0)?void 0:pa.includes(Wn.group_name)}).map(function(Wn){return Wn.group_id||Wn.id}).toString().split(","),On})),Vt.group_settings=Cn,tn.rank_forbidden)if(tn.unified_setting){if(!tn.rank_forbidden_start)throw m.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(!tn.rank_forbidden_end)throw m.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()(tn.rank_forbidden_end)<W()(tn.rank_forbidden_start))throw m.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 kn;Mt=(kn=Mt)===null||kn===void 0?void 0:kn.map(function(On){var Yn,Wn;if(!On.rank_forbidden_start)throw m.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(!On.rank_forbidden_end)throw m.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(!On.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return On.group_name=typeof(On==null?void 0:On.group_name)=="string"?[On==null?void 0:On.group_name]:On==null?void 0:On.group_name,On.group_id=On==null||((Yn=On.group_name)===null||Yn===void 0||((Wn=Yn.map(function(pa){var na,ua,Ba=(na=ge.group_settings)===null||na===void 0||((ua=na.filter(function(Ia){return(Ia==null?void 0:Ia.group_name)===pa}))===null||ua===void 0)?void 0:ua[0];return Ba==null?void 0:Ba.group_id}))===null||Wn===void 0))?void 0:Wn.toString().split(","),On}),Vt.group_settingss=Mt}He(Vt)},He=function(xt){if(console.log(xt.total_score,xt.eff_score),xt.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(xt!=null&&xt.work_efficiency&&xt.eff_score===null){m.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Vt={shixun_evaluation:xt.shixun_evaluation},kn=function(){var On=Object(h.a)(s.a.mark(function Yn(){var Wn;return s.a.wrap(function(na){for(;;)switch(na.prev=na.next){case 0:return at(!0),na.next=3,Object(S.a)("/api/homework_commons/".concat(V.categoryId,"/public_setting.json"),{method:"post",body:Object(p.a)({},xt)});case 3:Wn=na.sent,Wn.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),At(!0),_n(),Zn({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},V)})),at(!1);case 6:case"end":return na.stop()}},Yn)}));return function(){return On.apply(this,arguments)}}();kn()};return n.a.createElement("section",{className:Ce.a.form},n.a.createElement(Fe.a,{align:"middle"},n.a.createElement(Ge.a,{flex:"1"},n.a.createElement("div",{className:Ce.a.title},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(Ge.a,null,(ge==null?void 0:ge.can_edit)&&n.a.createElement(A.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return At(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{span:24,className:"mt15 mt20"},n.a.createElement(tt.a,{checked:tn.score_open,disabled:lt,onChange:function(xt){tn.score_open=xt.target.checked,oa(Object.assign({},tn))}},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(Ge.a,{span:24,className:"mt15"},n.a.createElement(tt.a,{checked:tn.open_code,disabled:lt,onChange:function(xt){tn.open_code=xt.target.checked,oa(Object.assign({},tn))}},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)")),!!tn.open_code&&n.a.createElement(Ge.a,{span:24,className:"mt10 ml25"},n.a.createElement(le.a.Group,{disabled:lt,value:tn.open_code_type,onChange:function(xt){tn.open_code_type=xt.target.value,oa(Object.assign({},tn))}},n.a.createElement(le.a,{value:0},"\u4EFB\u610F\u65F6\u95F4\u67E5\u770B"),n.a.createElement(le.a,{style:{marginLeft:60},value:1},"\u7EC3\u4E60\u65F6\u95F4\u7ED3\u675F\u540E"))),n.a.createElement(Ge.a,{span:24,className:"mt15 mt20"},n.a.createElement(tt.a,{checked:tn.rank_forbidden,disabled:lt,onChange:function(xt){tn.rank_forbidden=xt.target.checked,oa(Object.assign({},tn))}},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)")),!!tn.rank_forbidden&&tn.unified_setting&&n.a.createElement(Ge.a,{span:24,className:"mt10 "},n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(Fe.a,{align:"middle",className:"mt25 "},n.a.createElement(Ge.a,null,"\u5F00\u59CB\u65F6\u95F4"),n.a.createElement(Ge.a,{className:"ml10"},n.a.createElement(ie.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:hn,disabledTime:En,disabled:lt||W()()>W()(ge.rank_forbidden_start),value:tn.rank_forbidden_start?W()(tn.rank_forbidden_start):"",onChange:function(xt,Vt){tn.rank_forbidden_start=Vt,(tn.end_time==""||!tn.end_time)&&tn.unified_setting&&(tn.end_time=W()(xt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),oa(Object.assign({},tn))}})),n.a.createElement(Ge.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(Fe.a,{align:"middle",className:"mt25"},n.a.createElement(Ge.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(Ge.a,{className:"ml10"},n.a.createElement(ie.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:W()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:lt,disabledDate:hn,value:tn.rank_forbidden_end?W()(tn.rank_forbidden_end):"",onChange:function(xt,Vt){tn.rank_forbidden_end=Vt,oa(Object.assign({},tn))}})),n.a.createElement(Ge.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("----",Cn),!tn.unified_setting&&((Tn=Cn)===null||Tn===void 0?void 0:Tn.length)>0&&!!tn.rank_forbidden&&n.a.createElement(Fe.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(Ge.a,{span:24},n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{span:10}),n.a.createElement(Ge.a,{span:10},n.a.createElement(Fe.a,{className:"c-grey-c ml30"},n.a.createElement(Ge.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(Ge.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(Ge.a,{span:4}))),Mt.map(function(Ct,xt){var Vt,kn,On,Yn,Wn,pa,na;return n.a.createElement(Ge.a,{span:24,key:xt},n.a.createElement(Fe.a,{className:"mt25"},n.a.createElement(Ge.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",xt+1,"\uFF1A"),n.a.createElement(pt.a,{disabled:lt||!(ve!=null&&(Vt=ve.homework_status)!==null&&Vt!==void 0&&Vt.includes("\u672A\u53D1\u5E03"))&&Ct.id,mode:"multiple",style:{width:306},value:typeof Ct.group_name=="string"?[Ct.group_name]:Ct.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Ba){Mt[xt].group_name=Ba,Mt[xt].group_id=Ct.group_id,gt(Mt.slice())}},ge.group_settings&&ge.group_settings.map(function(ua){if(tn!=null&&tn.unified_setting&&!Mt.map(function(Ba){return Ba.group_name}).toString().split(",").includes(String(ua.group_name)))return n.a.createElement(Ua,{value:ua.group_name,key:ua.id},ua.group_name);if(Cn.map(function(Ba){return Ba.group_name}).toString().split(",").includes(String(ua.group_name))&&!Mt.map(function(Ba){return Ba.group_name}).toString().split(",").includes(String(ua.group_name)))return n.a.createElement(Ua,{value:ua.group_name,key:ua.id},ua.group_name)}))),n.a.createElement(Ge.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(ga,{allowClear:!1,disabled:lt||(ge!=null&&(kn=ge.group_settings)!==null&&kn!==void 0&&(On=kn.filter(function(ua){return ua.id===Ct.id}))!==null&&On!==void 0&&(Yn=On[0])!==null&&Yn!==void 0&&Yn.rank_forbidden_start?W()()<W()(ge==null||((Wn=ge.group_settings)===null||Wn===void 0||((pa=Wn.filter(function(ua){return ua.id===Ct.id}))===null||pa===void 0||((na=pa[0])===null||na===void 0)))?void 0:na.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:hn,disabledTime:En,showTime:{format:"HH:mm",defaultValue:[W()(Object(_.d)(),"HH:mm"),W()(Object(_.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Ct.rank_forbidden_start&&[W()(Ct.rank_forbidden_start),Ct.rank_forbidden_end?W()(Ct.rank_forbidden_end):void 0],onChange:function(Ba,Ia){Mt[xt].rank_forbidden_start=Ia[0],Mt[xt].rank_forbidden_end=Ia[1],gt(Object(me.a)(Mt))}}))),!lt&&n.a.createElement(Ge.a,{className:"ml20"},xt>0&&!Ct.id&&n.a.createElement(be.a,{onClick:function(){Mt=Mt.filter(function(Ba,Ia){return xt!==Ia}),gt(Mt.slice()),setTimeout(function(){return gt(Mt.slice())},10)}}),n.a.createElement(Ot.a,{className:"c-green ml20",onClick:function(){gt(Mt.concat({}))}}))))})),!lt&&n.a.createElement("div",{className:Ce.a.btns},n.a.createElement(A.a,{type:"primary",loading:Tt,onClick:function(){return bt()}},"\u63D0\u4EA4"),n.a.createElement(A.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){At(!0),_n()}},"\u53D6\u6D88"))),n.a.createElement(o.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Nt,onCancel:function(){return et(!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(Pt.a.Search,{onChange:function(xt){}})),n.a.createElement(z.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(xt,Vt){jt(xt)}},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"}]}))))},la=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading;return{shixunHomeworks:ln,loading:Tn.effects}})(ta),Ra=function(ln){var Tn,fn=ln.shixunHomeworks,$n=ln.loading,Zn=ln.dispatch,V=Object(C.i)(),ae=fn.workSetting,ge=fn.workList,ve=fn.changeData,Xe=Object(i.useState)(!0),Re=Object(a.a)(Xe,2),ze=Re[0],lt=Re[1],At=Object(i.useState)(!1),Dt=Object(a.a)(At,2),Ie=Dt[0],ft=Dt[1],$e=Object(i.useState)(!1),Ze=Object(a.a)($e,2),dt=Ze[0],Tt=Ze[1],at=un.a.useForm(),Ut=Object(a.a)(at,1),Yt=Ut[0],yn=Object(i.useState)([]),In=Object(a.a)(yn,2),mn=In[0],Cn=In[1],xn=Object(i.useState)([]),Et=Object(a.a)(xn,2),Xt=Et[0],Mt=Et[1],gt=!(ge!=null&&(Tn=ge.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),Sn=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}),gn=Object(a.a)(Sn,2),Nt=gn[0],et=gn[1];Object(i.useEffect)(function(){return Rn(),function(){Cn([].concat())}},[]);var Rn=function(){Zn({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},V)})};Object(i.useEffect)(function(){if(!(ae!=null&&ae.course_id))return;Object.keys(Nt).map(function(vn){Nt[vn]=ae[vn]}),(!Nt.allow_late||!Nt.unified_late)&&(Nt.late_penalty=5),mn=JSON.parse(JSON.stringify(ae.group_settings.map(function(vn){return Object(p.a)(Object(p.a)({},vn),{},{group_name:[vn.group_name]})}).filter(function(vn){return vn.publish_time!==null}))),Xt=JSON.parse(JSON.stringify(ae.allow_late_settings.map(function(vn){return Object(p.a)(Object(p.a)({},vn),{},{group_name:[vn.group_name]})}).filter(function(vn){return vn.late_time!==null}))),jt(),et(Object(p.a)({},Nt)),Cn(Object(me.a)(mn)),Mt(Object(me.a)(Xt))},[ae]);var $t=function(){var Dn=JSON.parse(JSON.stringify(Nt));Bn(Dn)},Bn=function(Dn){if(console.log(Dn.total_score,Dn.eff_score),Dn.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var tn=function(){var oa=Object(h.a)(s.a.mark(function _n(){var hn;return s.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return ft(!0),He.next=3,Object(S.a)("/api/homework_commons/".concat(V.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(p.a)({},Dn)});case 3:hn=He.sent,hn.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),lt(!0),Rn(),Zn({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},V)})),ft(!1);case 6:case"end":return He.stop()}},_n)}));return function(){return oa.apply(this,arguments)}}();(Nt==null?void 0:Nt.hack_score_settings)!==(ae==null?void 0:ae.hack_score_settings)&>?o.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:tn}):tn()},jt=function(){var Dn,tn=Nt.total_score,oa=(Dn=Nt.hack_settings)===null||Dn===void 0?void 0:Dn.length,_n=0,hn;switch(Nt.hack_score_settings){case 0:var bt=(tn/oa).toFixed(2);Nt.hack_settings.map(function(Wn,pa){_n=pa,Wn.hack_score=bt>0?bt:0}),hn=(tn-bt*(oa-1)).toFixed(2),Nt.hack_settings[_n].hack_score=hn>0?hn:0;break;case 1:var He=[0,1,3,6],Ct=0,xt=Nt.hack_settings.filter(function(Wn){return Wn.difficult===1}).length*He[1],Vt=Nt.hack_settings.filter(function(Wn){return Wn.difficult===2}).length*He[2],kn=Nt.hack_settings.filter(function(Wn){return Wn.difficult===3}).length*He[3],On=tn/(xt+Vt+kn);console.log(On,2222),Nt.hack_settings.map(function(Wn,pa){_n=pa,Wn.hack_score=(He[Wn.difficult]*On).toFixed(2),Ct=Ct+Number(Wn.hack_score)});var Yn=Nt.hack_settings[_n].hack_score;hn=(tn-Ct+Number(Yn)).toFixed(2),Nt.hack_settings[_n].hack_score=hn>0?hn:0;break}};return n.a.createElement("section",{className:Ce.a.form},n.a.createElement(Fe.a,{align:"middle"},n.a.createElement(Ge.a,{flex:"1"}),n.a.createElement(Ge.a,null,(ae==null?void 0:ae.can_edit)&&n.a.createElement(A.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return lt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(Fe.a,{align:"middle"},n.a.createElement(Ge.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement(Le.a,{min:0,className:"ml10 mr10",style:{width:160},value:Nt.total_score,disabled:ze||gt,onChange:function(Dn){Nt.total_score=Dn,et(Object.assign({},Nt)),jt()}}),"\xA0\u5206"),n.a.createElement(Ge.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement(Le.a,{className:"ml10 mr10",style:{width:160},min:0,value:Nt.punish_time,precision:0,disabled:ze,onChange:function(Dn){Nt.punish_time=Dn,et(Object.assign({},Nt)),jt()}}),"\xA0\u5206\u949F")),n.a.createElement(Fe.a,{align:"middle",style:{marginTop:20}},n.a.createElement(Ge.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(Ge.a,{flex:"1"},n.a.createElement(un.a.Item,{className:"ml20"},n.a.createElement(le.a.Group,{disabled:ze||gt,value:Nt.hack_score_settings,onChange:function(Dn){Nt.hack_score_settings=Dn.target.value,et(Object.assign({},Nt)),jt()}},n.a.createElement(le.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(le.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(le.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:Ce.a.hackList},Nt.hack_settings&&Nt.hack_settings.map(function(vn,Dn){return n.a.createElement(Fe.a,{key:Dn,align:"middle",style:{marginTop:20}},n.a.createElement(Ge.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,vn.hack_name)),n.a.createElement(Ge.a,{flex:"150px"},n.a.createElement(Le.a,{min:0,step:.1,value:vn.hack_score,disabled:ze||Nt.hack_score_settings!==2||gt,onChange:function(oa){Nt.hack_settings[Dn].hack_score=oa;var _n=Nt.hack_settings.reduce(function(hn,bt){return hn+Number(bt.hack_score)},0);Nt.total_score=_n.toFixed(2),et(Object(p.a)({},Nt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(Ge.a,{style:{lineHeight:"20px"}},vn.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),vn.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),vn.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}}),!ze&&n.a.createElement("div",{className:Ce.a.btns},n.a.createElement(A.a,{type:"primary",loading:Ie,onClick:function(){return $t()}},"\u63D0\u4EA4"),n.a.createElement(A.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){lt(!0),Rn()}},"\u53D6\u6D88")))},Xa=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading;return{shixunHomeworks:ln,loading:Tn.effects}})(Ra),vr=function(ln){var Tn,fn,$n=ln.shixunHomeworks,Zn=ln.loading,V=ln.dispatch,ae=Object(i.useState)(!0),ge=Object(a.a)(ae,2),ve=ge[0],Xe=ge[1],Re=Object(i.useState)(!1),ze=Object(a.a)(Re,2),lt=ze[0],At=ze[1],Dt=Object(i.useState)([]),Ie=Object(a.a)(Dt,2),ft=Ie[0],$e=Ie[1],Ze=Object(i.useState)([]),dt=Object(a.a)(Ze,2),Tt=dt[0],at=dt[1],Ut=Object(i.useState)([]),Yt=Object(a.a)(Ut,2),yn=Yt[0],In=Yt[1],mn=Object(i.useState)([]),Cn=Object(a.a)(mn,2),xn=Cn[0],Et=Cn[1],Xt=Object(C.i)();function Mt(){return gt.apply(this,arguments)}function gt(){return gt=Object(h.a)(s.a.mark(function et(){var Rn;return s.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(S.a)("/api/homework_commons/".concat(Xt.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:Rn=Bn.sent,at(Rn);case 4:case"end":return Bn.stop()}},et)})),gt.apply(this,arguments)}function Sn(){return gn.apply(this,arguments)}function gn(){return gn=Object(h.a)(s.a.mark(function et(){var Rn;return s.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(S.a)("/api/courses/".concat(Xt==null?void 0:Xt.coursesId,"/teachers"),{method:"get",params:{homework_id:Xt.categoryId}});case 2:Rn=Bn.sent,Rn==null||Rn.teacher_list.map(function(jt){jt.key=jt.user_id}),In(Rn==null?void 0:Rn.teacher_list),Et(Rn==null?void 0:Rn.teacher_list);case 6:case"end":return Bn.stop()}},et)})),gn.apply(this,arguments)}Object(i.useEffect)(function(){Mt(),Sn()},[Xt]);var Nt=function(){};return n.a.createElement("section",{className:Ce.a.form},n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(Tt==null?void 0:Tt.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(Fe.a,{style:{marginTop:"20px",marginBottom:"20px"}},(Tt==null||((Tn=Tt.data)===null||Tn===void 0)?void 0:Tn.length)<=0&&n.a.createElement(Y.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),Tt==null||((fn=Tt.data)===null||fn===void 0)?void 0:fn.map(function(et){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"}},et==null?void 0:et.real_name),(Tt==null?void 0:Tt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(h.a)(s.a.mark(function Rn(){var $t;return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(S.a)("/api/homework_commons/".concat(Xt.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:et.id}});case 2:$t=jt.sent,$t.status===0&&(m.b.info("\u5220\u9664\u6210\u529F"),Mt(),Sn());case 4:case"end":return jt.stop()}},Rn)}))},"X"))})),n.a.createElement(Fe.a,null,!ve&&n.a.createElement(Ge.a,{className:"mb50"},n.a.createElement(A.a,{type:"primary",size:"large",onClick:function(){return Nt()}},"\u63D0\u4EA4"),n.a.createElement(A.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Xe(!0)}},"\u53D6\u6D88"))),n.a.createElement(o.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:lt,onCancel:function(){return At(!1)},onOk:Object(h.a)(s.a.mark(function et(){var Rn;return s.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:if(!(ft.length===0)){Bn.next=3;break}return m.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),Bn.abrupt("return");case 3:return Bn.next=5,Object(S.a)("/api/homework_commons/".concat(Xt.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:ft}});case 5:Rn=Bn.sent,Rn.status===0&&(m.b.info("\u6DFB\u52A0\u6210\u529F"),$e([]),Mt(),Sn(),At(!1));case 7:case"end":return Bn.stop()}},et)}))},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(Pt.a.Search,{onChange:function(Rn){In(xn.filter(function($t){return $t.name.indexOf(Rn.target.value)>-1}))}})),n.a.createElement(z.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Rn,$t){$e(Rn)},selectedRowKeys:ft,getCheckboxProps:function(Rn){return{disabled:Rn.is_collaborator}}},pagination:!1,dataSource:yn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},rn=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading;return{shixunHomeworks:ln,loading:Tn.effects}})(vr),Xn=ie.a.RangePicker,hr=pt.a.Option,xr=function(ln){var Tn=ln.shixunHomeworks,fn=ln.loading,$n=ln.dispatch;return n.a.createElement("section",{className:"bg-white pl30 pr30 pt10 mb10"},n.a.createElement(B.a,null,n.a.createElement(B.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},n.a.createElement(sa,null)),n.a.createElement(B.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(Xa,null)),n.a.createElement(B.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(la,null)),n.a.createElement(B.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(rn,null))))},$a=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading;return{shixunHomeworks:ln,loading:Tn.effects}})(xr),Ga=M("RotF"),Aa=M.n(Ga),Kn=function(ln){var Tn,fn=ln.shixunHomeworks,$n=ln.loading,Zn=ln.dispatch,V=Object(C.i)(),ae=Object(C.h)(),ge=Object(i.useState)([]),ve=Object(a.a)(ge,2),Xe=ve[0],Re=ve[1],ze=Object(i.useState)([]),lt=Object(a.a)(ze,2),At=lt[0],Dt=lt[1],Ie=Object(i.useState)(!0),ft=Object(a.a)(Ie,2),$e=ft[0],Ze=ft[1],dt=Object(i.useState)(!1),Tt=Object(a.a)(dt,2),at=Tt[0],Ut=Tt[1],Yt=Object(i.useState)(1),yn=Object(a.a)(Yt,2),In=yn[0],mn=yn[1],Cn=Object(i.useState)([]),xn=Object(a.a)(Cn,2),Et=xn[0],Xt=xn[1],Mt=Object(i.useState)(!1),gt=Object(a.a)(Mt,2),Sn=gt[0],gn=gt[1],Nt=Object(i.useState)(!1),et=Object(a.a)(Nt,2),Rn=et[0],$t=et[1];Object(i.useEffect)(function(){fn.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(vn.resetFields(),Re([]),gn(!0),tn()):gn(!1)},[fn.actionTabs.key]);var Bn=un.a.useForm(),jt=Object(a.a)(Bn,1),vn=jt[0],Dn=[],tn=function(){var hn=Object(h.a)(s.a.mark(function bt(){var He,Ct,xt;return s.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(!($e&&!at)){kn.next=11;break}return Ut(!0),mn(In+1),kn.next=5,Object(ut.x)(Object(p.a)(Object(p.a)({},V),{},{page:In}));case 5:Ct=kn.sent,xt=Object(me.a)(Ct.group_list),Ct!=null&&Ct.ungroup_list&&xt.push({id:Ct==null?void 0:Ct.ungroup_list.id,name:Ct==null?void 0:Ct.ungroup_list.name,works_count:Ct==null?void 0:Ct.ungroup_list.work_count,last_review_time:Ct==null?void 0:Ct.ungroup_list.last_review_time}),Re([].concat(Object(me.a)(Xe),Object(me.a)(xt))),Ut(!1),((He=Ct.group_list)===null||He===void 0?void 0:He.length)<10&&Ze(!1);case 11:case"end":return kn.stop()}},bt)}));return function(){return hn.apply(this,arguments)}}(),oa=function(){Zn({type:"shixunHomeworks/setActionTabs",payload:{}}),$t(!1),Ze(!0),Ut(!1),mn(1),Re([]),vn.resetFields()},_n=[{title:"",dataIndex:"id",width:280,render:function(bt,He){return n.a.createElement(tt.a,{disabled:!(He.works_count>1),value:String(He.id)},He.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(o.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Sn,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(h.a)(s.a.mark(function hn(){var bt,He;return s.a.wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:return bt=vn.getFieldValue(),xt.next=3,Object(S.a)("/api/homework_commons/".concat(V.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(me.a)(bt.group_ids)}});case 3:if(He=xt.sent,!(He.status===0)){xt.next=11;break}return oa(),m.b.success("\u64CD\u4F5C\u6210\u529F"),xt.next=9,Zn({type:"shixunHomeworks/getWorkList",payload:fn.actionTabs.params});case 9:w.d.push("/classrooms/".concat(V.coursesId,"/program_homework/").concat(V.categoryId,"/detail?tabs=2")),Zn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return xt.stop()}},hn)})),onCancel:oa},fn.codeReviewCourse&&n.a.createElement(un.a,{form:vn,onChange:function(bt){Xt(Object(p.a)({},vn.getFieldValue()))},initialValues:(Tn={},Object(yt.a)(Tn,"group_ids",Dn),Object(yt.a)(Tn,"end_time",W()(W()().add(7,"days").format("YYYY-MM-DD HH:mm"))),Tn)},n.a.createElement("div",{className:"flexd-table-header mt20"},n.a.createElement(z.a,{pagination:!1,dataSource:[],columns:_n})),n.a.createElement(un.a.Item,{name:"group_ids"},n.a.createElement(tt.a.Group,{className:"w100"},n.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},n.a.createElement(Aa.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(bt){tn()},hasMore:$e,useWindow:!1},n.a.createElement(z.a,{loading:$n.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:_n,dataSource:Xe,pagination:!1})))))),n.a.createElement(Fe.a,null,n.a.createElement(Ge.a,{className:"ml10"},n.a.createElement(tt.a,{checked:Rn,onChange:function(bt){$t(bt.target.checked);var He=[];bt.target.checked&&(He=Xe.filter(function(Ct){return Ct.works_count>1}).map(function(Ct){return Ct.id+""})),vn.setFieldsValue(Object(yt.a)({},"group_ids",He))}},"\u5168\u9009"))))},pr=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading;return{shixunHomeworks:ln,loading:Tn}})(Kn),on=M("nPLb"),qa=M("XpUO"),Ka=M("bTeP"),Tr=M.n(Ka),mr=M("HBuW"),nr=M("NLgs"),Br=M("m3rI"),Hr=M("+92d"),ar=M.n(Hr),Ea=M("wwSX"),Sr=M.n(Ea),Rr=M("zlzj"),ur=M.n(Rr),_r=M("deN7"),oi=[ar.a,Sr.a,ur.a],$r=function(ln){var Tn,fn,$n=ln.user,Zn=Object(i.useState)(Object(p.a)(Object(p.a)({},Object(C.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(K.s)()?[$n.userInfo.course.course_group_id]:[]},Object(C.i)())),V=Object(a.a)(Zn,2),ae=V[0],ge=V[1],ve=Object(i.useState)([]),Xe=Object(a.a)(ve,2),Re=Xe[0],ze=Xe[1],lt=Object(i.useState)([]),At=Object(a.a)(lt,2),Dt=At[0],Ie=At[1],ft=Object(i.useState)([]),$e=Object(a.a)(ft,2),Ze=$e[0],dt=$e[1],Tt=Object(i.useState)(!1),at=Object(a.a)(Tt,2),Ut=at[0],Yt=at[1],yn=Object(i.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(Mt,gt,Sn){return Mt<4?n.a.createElement("img",{src:oi[Mt-1]}):Mt}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(Mt,gt,Sn){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Br.a.IMG_SERVER+"/images/"+(gt==null?void 0:gt.image_url)}),Mt)}},{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(Mt){return Mt||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),In=Object(a.a)(yn,2),mn=In[0],Cn=In[1];Object(i.useEffect)(function(){mn.splice(7);for(var Xt=function(gn){var Nt,et,Rn,$t,Bn={};Bn.title=Re!=null&&Re.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(gn+1)+"\uFF08".concat(Re==null||((Nt=Re.question_data)===null||Nt===void 0||((et=Nt[gn])===null||et===void 0))?void 0:et.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(h.a)(s.a.mark(function jt(){var vn,Dn,tn;return s.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,Object(S.a)("/api/problems/".concat(Re==null||((vn=Re.question_data)===null||vn===void 0||((Dn=vn[gn])===null||Dn===void 0))?void 0:Dn.identifier,"/start.json"),{method:"get"});case 2:tn=_n.sent,tn&&(window.open("/myproblems/".concat(tn==null?void 0:tn.identifier,"?type=1")),localStorage.setItem("program_homework",[ae.coursesId,ae.categoryId]));case 4:case"end":return _n.stop()}},jt)}))},"\u9898\u76EE"+(gn+1)+"\uFF08".concat(Re==null||((Rn=Re.question_data)===null||Rn===void 0||(($t=Rn[gn])===null||$t===void 0))?void 0:$t.question_score,"\uFF09")),Bn.dataIndex="question_data",Bn.width=250,Bn.render=function(jt,vn){var Dn,tn,oa,_n,hn;return n.a.createElement("div",null,(jt==null||((Dn=jt[gn])===null||Dn===void 0)?void 0:Dn.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(h.a)(s.a.mark(function bt(){var He,Ct,xt,Vt,kn,On,Yn,Wn;return s.a.wrap(function(na){for(;;)switch(na.prev=na.next){case 0:if(jt!=null&&(He=jt[gn])!==null&&He!==void 0&&He.open_code){na.next=3;break}return m.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),na.abrupt("return");case 3:return na.next=5,Object(S.a)("/api/courses/view_code.json",{method:"get",params:Object(p.a)(Object(p.a)({},ae),{},{id:ae.coursesId,homework_common_id:ae.categoryId,hack_user_code_id:jt==null||((Ct=jt[gn])===null||Ct===void 0)?void 0:Ct.hack_user_code_id})});case 5:Wn=na.sent,o.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",jt==null||((xt=jt[gn])===null||xt===void 0)?void 0:xt.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",jt==null||((Vt=jt[gn])===null||Vt===void 0)?void 0:Vt.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",jt==null||((kn=jt[gn])===null||kn===void 0)?void 0:kn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",jt==null||((On=jt[gn])===null||On===void 0)?void 0:On.score)),content:n.a.createElement(_r.a,{languages:[{language:jt==null||((Yn=jt[gn])===null||Yn===void 0)?void 0:Yn.language,code:Wn==null?void 0:Wn.code}],v:jt,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:jt.language,game_id:jt.id,diff_code_count:jt.diff_code_count})});case 7:case"end":return na.stop()}},bt)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(jt==null||((tn=jt[gn])===null||tn===void 0)?void 0:tn.answer_question_time)||"- -"),jt!=null&&(oa=jt[gn])!==null&&oa!==void 0&&oa.submit_count?n.a.createElement(P.a,{title:"".concat((jt==null||((_n=jt[gn])===null||_n===void 0)?void 0:_n.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(jt==null||((hn=jt[gn])===null||hn===void 0)?void 0:hn.submit_count)||0):null))},mn.push(Bn)},Mt=0;Mt<(Re==null||((gt=Re.question_data)===null||gt===void 0)?void 0:gt.length);Mt++){var gt;Xt(Mt)}Cn(Object(me.a)(mn))},[Re==null?void 0:Re.question_data]),Object(i.useEffect)(function(){var Xt;$n!=null&&(Xt=$n.userInfo)!==null&&Xt!==void 0&&Xt.course&&(Object(K.s)()&&(ae.course_group=Object(K.s)()?[$n.userInfo.course.course_group_id]:[],ge(Object(p.a)({},ae))),xn(1))},[$n==null?void 0:$n.userInfo]);function xn(Xt){return Et.apply(this,arguments)}function Et(){return Et=Object(h.a)(s.a.mark(function Xt(Mt){var gt,Sn,gn,Nt,et,Rn,$t;return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return Yt(!0),jt.next=3,Object(S.a)("/api/courses/rank_list.json",{method:"get",params:Object(p.a)(Object(p.a)({},ae),{},{id:ae.coursesId,rank_type:2,homework_common_id:ae.categoryId})});case 3:if(gt=jt.sent,ze(gt),Yt(!1),Object(K.s)()?(Mt===1&&Ie([gt==null||((Sn=gt.course_group)===null||Sn===void 0||((gn=Sn[0])===null||gn===void 0))?void 0:gn.id]),gt!=null&>.my_rank?dt([gt==null?void 0:gt.my_rank].concat(Object(me.a)(gt==null?void 0:gt.rank_list))):dt(Object(me.a)(gt==null?void 0:gt.rank_list))):dt(Object(me.a)(gt==null?void 0:gt.rank_list)),Mt===1){for(Nt={title:n.a.createElement(P.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(gt==null?void 0:gt.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"},mn.push(Nt),et=function(Dn){var tn,oa,_n,hn,bt={};bt.title=gt!=null&>.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Dn+1)+"\uFF08".concat(gt==null||((tn=gt.question_data)===null||tn===void 0||((oa=tn[Dn])===null||oa===void 0))?void 0:oa.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(h.a)(s.a.mark(function He(){var Ct,xt,Vt;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,Object(S.a)("/api/problems/".concat(gt==null||((Ct=gt.question_data)===null||Ct===void 0||((xt=Ct[Dn])===null||xt===void 0))?void 0:xt.identifier,"/start.json"),{method:"get"});case 2:Vt=On.sent,Vt&&(window.open("/myproblems/".concat(Vt==null?void 0:Vt.identifier,"?type=1")),localStorage.setItem("program_homework",[ae.coursesId,ae.categoryId]));case 4:case"end":return On.stop()}},He)}))},"\u9898\u76EE"+(Dn+1)+"\uFF08".concat(gt==null||((_n=gt.question_data)===null||_n===void 0||((hn=_n[Dn])===null||hn===void 0))?void 0:hn.question_score,"\uFF09")),bt.dataIndex="question_data",bt.width=250,bt.render=function(He,Ct){var xt,Vt,kn,On,Yn;return n.a.createElement("div",null,(He==null||((xt=He[Dn])===null||xt===void 0)?void 0:xt.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(h.a)(s.a.mark(function Wn(){var pa,na,ua,Ba,Ia,ja,or,sr;return s.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(He!=null&&(pa=He[Dn])!==null&&pa!==void 0&&pa.open_code){Se.next=3;break}return m.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),Se.abrupt("return");case 3:return Se.next=5,Object(S.a)("/api/courses/view_code.json",{method:"get",params:Object(p.a)(Object(p.a)({},ae),{},{id:ae.coursesId,homework_common_id:ae.categoryId,hack_user_code_id:He==null||((na=He[Dn])===null||na===void 0)?void 0:na.hack_user_code_id})});case 5:sr=Se.sent,o.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",He==null||((ua=He[Dn])===null||ua===void 0)?void 0:ua.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",He==null||((Ba=He[Dn])===null||Ba===void 0)?void 0:Ba.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",He==null||((Ia=He[Dn])===null||Ia===void 0)?void 0:Ia.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",He==null||((ja=He[Dn])===null||ja===void 0)?void 0:ja.score)),content:n.a.createElement(_r.a,{languages:[{language:He==null||((or=He[Dn])===null||or===void 0)?void 0:or.language,code:sr==null?void 0:sr.code}],v:He,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:He.language,game_id:He.id,diff_code_count:He.diff_code_count})});case 7:case"end":return Se.stop()}},Wn)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(He==null||((Vt=He[Dn])===null||Vt===void 0)?void 0:Vt.answer_question_time)||"- -"),He!=null&&(kn=He[Dn])!==null&&kn!==void 0&&kn.submit_count?n.a.createElement(P.a,{title:"".concat((He==null||((On=He[Dn])===null||On===void 0)?void 0:On.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(He==null||((Yn=He[Dn])===null||Yn===void 0)?void 0:Yn.submit_count)||0):null))},mn.push(bt)},Rn=0;Rn<(gt==null||(($t=gt.question_data)===null||$t===void 0)?void 0:$t.length);Rn++)et(Rn);Cn(Object(me.a)(mn))}case 8:case"end":return jt.stop()}},Xt)})),Et.apply(this,arguments)}return console.log("----",mn),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(Re==null?void 0:Re.message)==="\u5C01\u699C\u4E2D"?n.a.createElement(Y.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(K.c)()&&n.a.createElement("div",{style:{flex:1}},n.a.createElement(tt.a.Group,{className:Tr.a.checkboxgroup,value:Dt,onChange:function(Mt){if(ae.type===1)Ie([]),ae.course_group=[],ae.page=1,ge(Object(p.a)({},ae)),xn();else if(ae.type===2){var gt;Ie(["\u5168\u90E8"].concat()),ae.course_group=Re==null||((gt=Re.course_group)===null||gt===void 0)?void 0:gt.map(function(Sn){return Sn.id}),ae.page=1,ge(Object(p.a)({},ae)),xn()}else Ie(Object(me.a)(Mt.filter(function(Sn){return Sn!="\u5168\u90E8"}))),ae.course_group=Mt.filter(function(Sn){return Sn!="\u5168\u90E8"}),ae.page=1,ge(Object(p.a)({},ae)),xn()}},n.a.createElement(tt.a,{value:"\u5168\u90E8",onChange:function(Mt){Mt.target.checked?ae.type=2:ae.type=1}},"\u5168\u90E8\u5206\u73ED"),Re==null||((Tn=Re.course_group)===null||Tn===void 0)?void 0:Tn.map(function(Xt,Mt){return n.a.createElement(tt.a,{onChange:function(Sn){ae.type=3},value:Xt.id},Xt==null?void 0:Xt.name)}))),Object(K.s)()&&n.a.createElement(le.a.Group,{onChange:function(Mt){Mt.target.value==="\u5168\u90E8"?(ae.course_group=[],ae.page=1,ge(Object(p.a)({},ae)),xn()):(ae.course_group=[Mt.target.value],ae.page=1,ge(Object(p.a)({},ae)),xn())},defaultValue:$n.userInfo.course.course_group_id},n.a.createElement(le.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Re==null||((fn=Re.course_group)===null||fn===void 0)?void 0:fn.map(function(Xt,Mt){return n.a.createElement(le.a,{value:Xt.id},Xt.name)}))),Object(K.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(){o.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(A.a,{onClick:function(){Object(de.v)(Object(p.a)(Object(p.a)({},ae),{},{id:ae.coursesId,rank_type:2,homework_common_id:ae.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(f.a,{spinning:Ut},n.a.createElement(z.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(Mt,gt){return gt===0&&Object(K.s)()&&Tr.a.tables},dataSource:Ze,columns:mn})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(v.a,{current:ae.page,pageSize:ae.per_page,total:Re==null?void 0:Re.count,hideOnSinglePage:!0,onChange:function(Mt,gt){ae.page=Mt,ae.per_page=gt,ge(Object(p.a)({},ae)),xn()}}))))},va=Object(w.a)(function(Mn){var ln=Mn.user;return{user:ln}})($r),_a=[{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%"}],ir=function(ln){var Tn,fn=ln.shixunHomeworks,$n=ln.globalSetting,Zn=ln.loading,V=ln.dispatch,ae=Object(C.i)(),ge=Object(C.h)(),ve=Object(C.g)(),Xe=Object(i.useState)([]),Re=Object(a.a)(Xe,2),ze=Re[0],lt=Re[1],At=Object(i.useState)(ge.query.tabs||"0"),Dt=Object(a.a)(At,2),Ie=Dt[0],ft=Dt[1],$e=Object(i.useState)({}),Ze=Object(a.a)($e,2),dt=Ze[0],Tt=Ze[1],at=fn.workList,Ut=Object(i.useState)(!1),Yt=Object(a.a)(Ut,2),yn=Yt[0],In=Yt[1],mn;ae.category=ge.query.category_id,ae.order="work_score",ae.b_order="desc";var Cn=function(Nt){ft(Nt),Nt==="0"&&V({type:"shixunHomeworks/getWorkList",payload:ae})},xn=function(){o.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 Nt=Object(h.a)(s.a.mark(function Rn(){var $t,Bn,jt;return s.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return Bn=($t=fn.workList)===null||$t===void 0?void 0:$t.myshixun_identifier,Dn.next=3,Object(ut.X)({id:Bn});case 3:jt=Dn.sent,jt&&(m.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`),V({type:"shixunHomeworks/getWorkList",payload:dt}));case 5:case"end":return Dn.stop()}},Rn)}));function et(){return Nt.apply(this,arguments)}return et}()})},Et=function gn(Nt){var et;Nt=(et=Nt)!==null&&et!==void 0&&et.includes(".json")?Nt:"".concat(Nt,".json"),o.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 Rn=Object(h.a)(s.a.mark(function Bn(){var jt,vn;return s.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(mr.Bb)({url:Nt});case 2:if(jt=tn.sent,jt){tn.next=5;break}return tn.abrupt("return");case 5:return m.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),tn.next=8,Object(mr.E)({id:jt.shixun_identifier});case 8:if(vn=tn.sent,!(vn!=null&&vn.game_identifier)){tn.next=12;break}return Object(_.U)("/tasks/".concat(vn.game_identifier,"?coursesId=").concat(ae.coursesId)),tn.abrupt("return");case 12:(vn==null?void 0:vn.status)===2?gn(vn==null?void 0:vn.message):(vn==null?void 0:vn.status)===3&&Xt(vn==null?void 0:vn.message);case 13:case"end":return tn.stop()}},Bn)}));function $t(){return Rn.apply(this,arguments)}return $t}()})},Xt=function(Nt){o.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",Nt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Mt=function(){var gn=Object(h.a)(s.a.mark(function Nt(et){var Rn,$t;return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return et=(Rn=et)!==null&&Rn!==void 0&&Rn.includes(".json")?et:"".concat(et,".json"),jt.next=3,Object(mr.Bb)({url:et});case 3:if($t=jt.sent,console.log($t,"execRes"),!($t!=null&&$t.game_identifier)){jt.next=8;break}return Object(_.U)("/tasks/".concat($t.game_identifier,"?coursesId=").concat(ae.coursesId)),jt.abrupt("return");case 8:($t==null?void 0:$t.status)===-3?Object(_.q)():($t==null?void 0:$t.status)===2?Et($t==null?void 0:$t.message):($t==null?void 0:$t.status)===3&&Xt($t==null?void 0:$t.message);case 9:case"end":return jt.stop()}},Nt)}));return function(et){return gn.apply(this,arguments)}}(),gt=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(ct,{setExportParams:Tt}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement(Be,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(va,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(qt,null)},{name:Object(K.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement($a,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(ae.coursesId,"/program_homework/").concat(ae.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(gn){var Nt;if(Object(K.s)())return gn.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(K.s)()||(at==null||((Nt=at.homework_status)===null||Nt===void 0)?void 0:Nt[0])!=="\u5DF2\u622A\u6B62")return gn.name!=="\u8D28\u91CF\u68C0\u6D4B";var et;return!at.code_review&&(at==null||((et=at.homework_status)===null||et===void 0)?void 0:et[0])!=="\u672A\u53D1\u5E03"?!0:gn.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(gn){return at.open_code_quality_analysis?!0:gn.name!=="\u8D28\u91CF\u68C0\u6D4B"}),Sn=function(){var Nt,et,Rn,$t,Bn,jt,vn,Dn;return n.a.createElement("aside",{className:Tr.a.workListTabButton},Object(K.s)()&&((Nt=fn.workList)===null||Nt===void 0?void 0:Nt.redo_work)&&n.a.createElement(A.a,{onClick:xn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((et=fn.workList)===null||et===void 0?void 0:et.shixun_status)>1&&((Rn=fn.workList)===null||Rn===void 0?void 0:Rn.time_status)<5&&Object(K.s)()&&n.a.createElement(A.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var oa,_n,hn,bt,He,Ct,xt;if(!Object(nr.e)(V,!0))return;(oa=fn.workList)!==null&&oa!==void 0&&(_n=oa.task_operation)!==null&&_n!==void 0&&(hn=_n[1])!==null&&hn!==void 0&&hn.includes("/")?Mt((bt=fn.workList)===null||bt===void 0||((He=bt.task_operation)===null||He===void 0)?void 0:He[1]):Object(_.U)("/tasks/".concat((Ct=fn.workList)===null||Ct===void 0||((xt=Ct.task_operation)===null||xt===void 0)?void 0:xt[1]))}},($t=fn.workList)===null||$t===void 0||((Bn=$t.task_operation)===null||Bn===void 0)?void 0:Bn[0]),((jt=fn.workList)===null||jt===void 0?void 0:jt.commit_des)&&n.a.createElement(A.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var oa;Object(_.U)("/classrooms/".concat(ae.coursesId,"/shixun_homework/").concat(ae.categoryId,"/").concat((oa=fn.workList)===null||oa===void 0?void 0:oa.id,"/commitsummary"))}},(vn=fn.workList)===null||vn===void 0?void 0:vn.commit_des),Object(K.c)()&&(at==null||((Dn=at.homework_status)===null||Dn===void 0)?void 0:Dn[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(A.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){ve.push("/classrooms/".concat(ae.coursesId,"/program_homework/").concat(ae.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(K.c)()&&at.publish_immediately&&n.a.createElement(A.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){V({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[ae.categoryId],selectArrsAll:[at],params:ae,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(K.c)()&&at.end_immediately&&n.a.createElement(A.a,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){V({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:ae,type:2,detail:!0,selectArrs:[ae.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},at.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},at.category&&n.a.createElement(D.a,{separator:">"},n.a.createElement(D.a.Item,null,n.a.createElement(x.a,{to:"/classrooms/".concat(at.course_id,"/program_homework")},at.course_name)),n.a.createElement(D.a.Item,null,n.a.createElement(x.a,{to:"/classrooms/".concat(at.course_id,"/program_homework/").concat(at.category.main?"":at.category.category_id)},at.category.category_name)),n.a.createElement(D.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[Tr.a.title,"mt20"].join(" ")},n.a.createElement(x.a,{to:"/classrooms/".concat(at.course_id,"/program_homework/").concat(at.category.main?"":at.category.category_id)},n.a.createElement(T.a,{className:"font16 c-black"})),n.a.createElement(P.a,{title:at.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},at.homework_name)),n.a.createElement(_.m,{temporary:!0,status:at.homework_status}),Object(K.s)()&&n.a.createElement("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},n.a.createElement(A.a,{onClick:Object(h.a)(s.a.mark(function gn(){var Nt,et;return s.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(S.a)("/api/problems/".concat((Nt=fn.workList)===null||Nt===void 0?void 0:Nt.start_identifier,"/start.json"),{method:"get"});case 2:et=$t.sent,et&&(window.open("/myproblems/".concat(et==null?void 0:et.identifier,"?type=1")),localStorage.setItem("program_homework",[ae.coursesId,ae.categoryId]));case 4:case"end":return $t.stop()}},gn)})),type:"primary"},(Tn=at.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u5DF2\u622A\u6B62")?"\u67E5\u770B\u4F5C\u4E1A":"\u8FDB\u5165\u7EC3\u4E60"," ")))),n.a.createElement("aside",{className:"mt30 relative ".concat(Tr.a.workListTabWrap)},n.a.createElement(B.a,{type:"card",defaultActiveKey:Ie,activeKey:Ie,tabBarExtraContent:Sn(),onChange:Cn},gt.map(function(gn,Nt){return n.a.createElement(B.a.TabPane,{tab:gn.name,key:gn.id,forceRender:gn.forceRender},gn.compontent)})))),n.a.createElement(pr,null),n.a.createElement(on.a,{courseEndTime:at==null?void 0:at.course_end_date}),n.a.createElement(qa.a,{courseEndTime:at==null?void 0:at.course_end_date}),n.a.createElement(o.a,{visible:yn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){In(!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(z.a,{dataSource:_a,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")))},Pa=Ke.default=Object(w.a)(function(Mn){var ln=Mn.shixunHomeworks,Tn=Mn.loading,fn=Mn.globalSetting;return{shixunHomeworks:ln,globalSetting:fn,loading:Tn.effects}})(ir)},OLES:function(zt,Ke,M){"use strict";var Q=M("U8pU"),z=M("VTBJ"),I=M("Ff2n"),B=M("cDcd"),R=M("uciX"),P=M("7ixt"),F=function(h){var d=h.overlay,o=h.prefixCls,a=h.id,u=h.overlayInnerStyle;return B.createElement("div",{className:"".concat(o,"-inner"),id:a,role:"tooltip",style:u},typeof d=="function"?d():d)},D=F,L=function(h,d){var o=h.overlayClassName,a=h.trigger,u=a===void 0?["hover"]:a,s=h.mouseEnterDelay,i=s===void 0?0:s,n=h.mouseLeaveDelay,S=n===void 0?.1:n,C=h.overlayStyle,x=h.prefixCls,w=x===void 0?"rc-tooltip":x,T=h.children,_=h.onVisibleChange,y=h.afterVisibleChange,f=h.transitionName,c=h.animation,v=h.placement,p=v===void 0?"right":v,E=h.align,k=E===void 0?{}:E,U=h.destroyTooltipOnHide,H=U===void 0?!1:U,W=h.defaultVisible,j=h.getTooltipContainer,O=h.overlayInnerStyle,K=Object(I.a)(h,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Y=Object(B.useRef)(null);Object(B.useImperativeHandle)(d,function(){return Y.current});var ee=Object(z.a)({},K);"visible"in h&&(ee.popupVisible=h.visible);var se=function(){var Ae=h.arrowContent,le=Ae===void 0?null:Ae,fe=h.overlay,Ve=h.id;return[B.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},le),B.createElement(D,{key:"content",prefixCls:w,id:Ve,overlay:fe,overlayInnerStyle:O})]},Be=!1,me=!1;if(typeof H=="boolean")Be=H;else if(H&&Object(Q.a)(H)==="object"){var xe=H.keepParent;Be=xe===!0,me=xe===!1}return B.createElement(R.a,Object.assign({popupClassName:o,prefixCls:w,popup:se,action:u,builtinPlacements:P.a,popupPlacement:p,ref:Y,popupAlign:k,getPopupContainer:j,onPopupVisibleChange:_,afterPopupVisibleChange:y,popupTransitionName:f,popupAnimation:c,defaultPopupVisible:W,destroyPopupOnHide:Be,autoDestroy:me,mouseLeaveDelay:S,popupStyle:C,mouseEnterDelay:i},ee),T)},A=Object(B.forwardRef)(L),b=Ke.a=A},OZM5:function(zt,Ke,M){"use strict";M.d(Ke,"b",function(){return A}),M.d(Ke,"a",function(){return b}),M.d(Ke,"k",function(){return m}),M.d(Ke,"h",function(){return h}),M.d(Ke,"i",function(){return d}),M.d(Ke,"g",function(){return o}),M.d(Ke,"c",function(){return a}),M.d(Ke,"d",function(){return u}),M.d(Ke,"j",function(){return n}),M.d(Ke,"e",function(){return S}),M.d(Ke,"f",function(){return C});var Q=M("KQm4"),z=M("U8pU"),I=M("Ff2n"),B=M("cDcd"),R=M.n(B),P=M("Kwbf"),F=M("WaYH"),D=.25,L=2;function A(x,w){var T=x.slice(),_=T.indexOf(w);return _>=0&&T.splice(_,1),T}function b(x,w){var T=x.slice();return T.indexOf(w)===-1&&T.push(w),T}function m(x){return x.split("-")}function h(x,w){return"".concat(x,"-").concat(w)}function d(x){return x&&x.type&&x.type.isTreeNode}function o(x,w){var T=[x],_=w[x];function y(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(c){var v=c.key,p=c.children;T.push(v),y(p)})}return y(_.children),T}function a(x,w){var T=x.clientY,_=w.selectHandle.getBoundingClientRect(),y=_.top,f=_.bottom,c=_.height,v=Math.max(c*D,L);return T<=y+v?-1:T>=f-v?1:0}function u(x,w){if(!x)return;var T=w.multiple;return T?x.slice():x.length?[x[0]]:x}var s=function(w){return w};function i(x,w){if(!x)return[];var T=w||{},_=T.processProps,y=_===void 0?s:_,f=Array.isArray(x)?x:[x];return f.map(function(c){var v=c.children,p=Object(I.a)(c,["children"]),E=i(v,w);return R.a.createElement(F.a,Object.assign({},y(p)),E)})}function n(x){if(!x)return null;var w;if(Array.isArray(x))w={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(z.a)(x)==="object")w={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(P.a)(!1,"`checkedKeys` is not an array or an object"),null;return w}function S(x,w){var T=new Set;function _(y){if(T.has(y))return;var f=w[y];if(!f)return;T.add(y);var c=f.parent,v=f.node;if(v.disabled)return;c&&_(c.key)}return(x||[]).forEach(function(y){_(y)}),Object(Q.a)(T)}function C(x){var w={};return Object.keys(x).forEach(function(T){(T.startsWith("data-")||T.startsWith("aria-"))&&(w[T]=x[T])}),w}},Ot1p:function(zt,Ke,M){"use strict";var Q=M("2qtc"),z=M("kLXV"),I=M("rAM+"),B=M("miYZ"),R=M("tsqr"),P=M("9og8"),F=M("tJVT"),D=M("jrin"),L=M("WmNS"),A=M.n(L),b=M("cDcd"),m=M.n(b),h=M("VrN/"),d=M.n(h),o=M("bdgK"),a=M("p77/"),u=M("Bd2K"),s=M("ELLl"),i=M("19Vz"),n=M("lZu9"),S=M("+NIl"),C=M("kSUc"),x=M("9Bee"),w=function(de){var Ne=de.value,ct=Ne===void 0?"":Ne,Gt=de.className,an=de.showTextOnly,it=de.showLines,qt=de.style,st=qt===void 0?{}:qt,pt=Object(b.useMemo)(function(){return""},[ct]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:pt}}))},T=M("0Owb"),_=M("dejd"),y=M("C+DQ"),f=M("1vsH"),c=M("m3rI"),v=[{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 p(de){var Ne=de.onActionCallback,ct=de.title,Gt=de.icon,an=de.actionName,it=de.className,qt=it===void 0?"":it,st=de.children;function pt(){Ne(an)}return m.a.createElement("a",{title:ct,className:qt,onClick:pt},m.a.createElement("i",{className:"md-iconfont ".concat(Gt)}),st)}var E=function(de){var Ne=de.watch,ct=de.showNullButton,Gt=de.onActionCallback,an=de.fullScreen,it=de.insertTemp,qt=de.hidetoolBar,st=de.uuid,pt=de.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.G)("_educoder_session"),"&key=").concat(st,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Qe=[].concat(v,[{title:"".concat(Ne?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ne?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!qt&&Qe.map(function(ie,be){return m.a.createElement("li",{key:be},ie.actionName?m.a.createElement(p,Object(T.a)({},ie,{onActionCallback:Gt})):m.a.createElement("span",{className:"v-line"}))}),ct?m.a.createElement("li",null,m.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Gt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,it&&m.a.createElement("li",null,m.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(it),onActionCallback:Gt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(p,{icon:"".concat(an?"icon-shrink":"icon-enlarge"),title:an?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Gt})))},k=M("M8RZ"),U=M("+L6B"),H=M("2/Rp"),W=M("y8nQ"),j=M("Vl3Y"),O=M("5NDa"),K=M("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},ee=function(de){var Ne=de.callback,ct=de.onCancel;function Gt(an){Ne(an)}return m.a.createElement(j.a,Object(T.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Gt}),m.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(K.a,null)),m.a.createElement(j.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(K.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(H.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},se=M("7ahc"),Be=M("HmJG"),me=M("BjJ7"),xe=j.a.useForm,Le={width:280,marginRight:10},Ae={labelCol:{span:5},wrapperCol:{span:19}},le=function(de){var Ne=de.callback,ct=de.onCancel,Gt=xe(),an=Object(F.a)(Gt,1),it=an[0];function qt(Qe){Ne(Qe)}function st(Qe,ie){if(Qe.status===-1){R.b.error(Qe.message);return}it.setFieldsValue({src:"/api/attachments/".concat(Qe.id),type:ie.type})}function pt(Qe){var ie=Qe.target.files[0];Ve(ie,st)}return m.a.createElement(j.a,Object(T.a)({form:it},Ae,{className:"upload-image-panel",onFinish:qt}),m.a.createElement(j.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(j.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(K.a,{style:Le})),m.a.createElement(fe,{onFileChange:pt}))),m.a.createElement(j.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(K.a,{style:{width:264}})),m.a.createElement(j.a.Item,{style:{textAlign:"right"}},m.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(H.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))};function fe(de){var Ne=de.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ne}))}function Ve(de,Ne){if(!de)throw new String("\u6CA1\u6709\u6587\u4EF6");var ct=new FormData;ct.append("editormd-image-file",de),ct.append("file_param_name","editormd-image-file"),ct.append("byxhr","true");var Gt=new window.XMLHttpRequest;Gt.withCredentials=!0,Gt.addEventListener("load",function(an){Ne(JSON.parse(an.target.responseText),de)},!1),Gt.addEventListener("error",function(an){console.error(an)},!1),Gt.open("POST","".concat(me.a,"/api/attachments.json")),Gt.send(ct)}var Lt=M("giR+"),Pt=M("fyUT"),vt=M("7Kak"),Fe=M("9yH6"),_t=Fe.a.Group,tt={margin:"0 8px"},Rt=function(de){var Ne=de.callback,ct=de.onCancel;function Gt(an){Ne(an)}return m.a.createElement(j.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Gt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:tt},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:tt},"\u884C\u6570"),m.a.createElement(j.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(Pt.a,null)),m.a.createElement("span",{style:tt},"\u5217\u6570"),m.a.createElement(j.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(Pt.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:tt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(j.a.Item,{name:"align"},m.a.createElement(_t,null,m.a.createElement(Fe.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Fe.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Fe.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Fe.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(H.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},Ge=M("ErOA"),Ft=M("7Cbv"),wt="link",yt="upload-image",bn="code-block",un="add-table",sn="------------",Ye={default:sn,left:":".concat(sn),center:":".concat(sn,":"),right:"".concat(sn,":")},nn=M("9VGf"),An,ke;function Pe(){}var rt=0,ht=1e4,Ue="\u2581",ut=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ee(de){return/^\d+$/.test(de)?"".concat(de,"px"):de}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,he=ce?"Cmd":"Ctrl",J=["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"],Z=(An={},Object(D.a)(An,he+"-B","bold"),Object(D.a)(An,he+"-I","italic"),An),re=(ke={},Object(D.a)(ke,wt,"\u6DFB\u52A0\u94FE\u63A5"),Object(D.a)(ke,bn,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(D.a)(ke,yt,"\u6DFB\u52A0\u6587\u4EF6"),Object(D.a)(ke,un,"\u6DFB\u52A0\u8868\u683C"),ke),ue=Ke.a=function(de){var Ne=de.defaultValue,ct=Ne===void 0?"":Ne,Gt=de.onChange,an=de.width,it=an===void 0?"100%":an,qt=de.height,st=qt===void 0?400:qt,pt=de.miniToolbar,Qe=pt===void 0?!1:pt,ie=de.isFocus,be=ie===void 0?!1:ie,Ot=de.watch,qe=de.insertTemp,Bt=de.mode,Qt=Bt===void 0?"markdown":Bt,Ce=de.id,De=Ce===void 0?"markdown-editor-id":Ce,mt=de.showResizeBar,Jt=mt===void 0?!1:mt,cn=de.noStorage,wn=cn===void 0?!1:cn,sa=de.showNullButton,zn=sa===void 0?!1:sa,En=de.hidetoolBar,ga=En===void 0?!1:En,Ua=de.fullScreen,ta=Ua===void 0?!1:Ua,la=de.onBlur,Ra=de.onCMBeforeChange,Xa=de.onFullScreen,vr=de.className,rn=vr===void 0?"":vr,Xn=de.disablePaste,hr=Xn===void 0?!1:Xn,xr=de.placeholder,$a=xr===void 0?"":xr,Ga=de.values,Aa=Ga===void 0?"":Ga,Kn=Object(b.useState)(null),pr=Object(F.a)(Kn,2),on=pr[0],qa=pr[1],Ka=Object(b.useState)(ct),Tr=Object(F.a)(Ka,2),mr=Tr[0],nr=Tr[1],Br=Object(b.useState)(Ot),Hr=Object(F.a)(Br,2),ar=Hr[0],Ea=Hr[1],Sr=Object(b.useState)(ta),Rr=Object(F.a)(Sr,2),ur=Rr[0],_r=Rr[1],oi=Object(b.useState)(""),$r=Object(F.a)(oi,2),va=$r[0],_a=$r[1],ir=Object(b.useState)(0),Pa=Object(F.a)(ir,2),Mn=Pa[0],ln=Pa[1],Tn=Object(b.useState)(st),fn=Object(F.a)(Tn,2),$n=fn[0],Zn=fn[1],V=Object(b.useState)(!1),ae=Object(F.a)(V,2),ge=ae[0],ve=ae[1],Xe=Object(b.useRef)(Object(Ft.a)()),Re=Object(b.useRef)(!1),ze=Object(b.useRef)(),lt=Object(b.useRef)(),At=Object(b.useRef)(),Dt=Object(b.useRef)(),Ie=Object(b.useRef)(),ft=function(){var Et=Object(P.a)(A.a.mark(function Xt(){var Mt,gt;return A.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.next=2,Object(Ge.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xe.current}});case 2:gt=gn.sent,gt!=null&&(Mt=gt.attachments)!==null&&Mt!==void 0&&Mt.length&&(console.log("cm:",on,lt),gt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?on.replaceSelection(".concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?on.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?on.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):on.replaceSelection("[".concat(Nt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return gn.stop()}},Xt)}));return function(){return Et.apply(this,arguments)}}();Object(b.useEffect)(function(){nr(Aa),on==null||on.setValue(Aa)},[Aa]),Object(b.useEffect)(function(){Xa==null||Xa(ur)},[ur]),Object(b.useEffect)(function(){if(lt.current){var Et=d.a.fromTextArea(lt.current,{mode:Qt,lineNumbers:!Qe,lineWrapping:!0,value:ct,autoCloseTags:!0,autoCloseBrackets:!0});be&&Et.focus();function Xt(Mt,gt){if(hr){gt.preventDefault();return}var Sn=gt.clipboardData;if(Sn){var gn=Sn.types.toString(),Nt=Sn.items;if(gn==="Files"||Sn.types.indexOf("Files")>-1){if(gt.preventDefault(),Qt=="stex")return;try{var et,Rn=Nt[1];((et=Nt[0])===null||et===void 0?void 0:et.kind)==="file"&&(Rn=Nt[0]);var $t=Rn.getAsFile(),Bn=$t.name.split(".").pop();Ve($t,function(jt){if(jt.id){var vn,Dn,tn;($t==null||((vn=$t.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?Et.replaceSelection(".concat(jt.content_type,")")):($t==null||((Dn=$t.type)===null||Dn===void 0)?void 0:Dn.indexOf("video"))>-1?Et.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,'"></video>')):($t==null||((tn=$t.type)===null||tn===void 0)?void 0:tn.indexOf("pdf"))>-1?Et.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):J.includes(Bn)?Et.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):Et.replaceSelection("[".concat($t.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}else(jt==null?void 0:jt.status)===401&&(document.location.href="/user/login")})}catch(jt){R.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Et.on("paste",Xt),Et.on("dragleave",function(Mt,gt){At.current.classList.remove("mouse-hover-md")}),Et.on("dragover",function(Mt,gt){At.current.classList.add("mouse-hover-md")}),Et.on("drop",function(Mt,gt){At.current.classList.add("mouse-hover-md");var Sn;if(Sn=gt.dataTransfer.files,Sn.length>0){gt.preventDefault(),gt.stopPropagation();for(var gn=function(Rn){var $t=Sn[Rn],Bn=$t.name.split(".").pop();Ve($t,function(jt){if(jt.id){var vn,Dn,tn;($t==null||((vn=$t.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?Et.replaceSelection(".concat(jt.content_type,")")):($t==null||((Dn=$t.type)===null||Dn===void 0)?void 0:Dn.indexOf("video"))>-1?Et.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,'"></video>')):($t==null||((tn=$t.type)===null||tn===void 0)?void 0:tn.indexOf("pdf"))>-1?Et.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):J.includes(Bn)?Et.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):Et.replaceSelection("[".concat($t.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}else(jt==null?void 0:jt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt<Sn.length;Nt++)gn(Nt)}}),qa(Et),function(){Et.off("paste",Xt)}}},[]);var $e=Object(b.useCallback)(function(){if(At.current)try{}catch(Et){console.log(Et,"---- to set md editor body height")}},[$n,At,ur]);Object(b.useEffect)(function(){function Et(){var Mt=new o.default(function(gt){var Sn=Object(I.a)(gt),gn;try{for(Sn.s();!(gn=Sn.n()).done;){var Nt=gn.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&($e(),on.setSize("100%","100%"),on.refresh())}}catch(et){Sn.e(et)}finally{Sn.f()}});return Mt.observe(lt.current.parentElement),Mt}if(on){var Xt=Et();return function(){Xt.unobserve(lt.current.parentElement)}}},[on,$e]),Object(b.useEffect)(function(){if(on){for(var Et=[],Xt=function(){var Nt=gt[Mt];Sn=Object(F.a)(Nt,2);var et=Sn[0],Rn=Sn[1],$t=Object(D.a)({},et,function(){Ze(Rn)});Et.push($t),on.addKeyMap($t)},Mt=0,gt=Object.entries(Z);Mt<gt.length;Mt++){var Sn;Xt()}return ze.current=setInterval(function(){Re.current&&ft()},4e3),function(){clearInterval(ze.current);var gn=Object(I.a)(Et),Nt;try{for(gn.s();!(Nt=gn.n()).done;){var et=Nt.value;on.removeKeyMap(et)}}catch(Rn){gn.e(Rn)}finally{gn.f()}}}},[on]),Object(b.useEffect)(function(){ta!==ur&&_r(ta)},[ta]),Object(nn.a)(function(){if(!wn&&Mn>0){var Et=new Date().getTime(),Xt=window.sessionStorage.getItem(De);Et>=Mn+ht&&(!Xt||Xt!==mr)&&(window.sessionStorage.setItem(De,mr),ve(!0))}},ht),Object(b.useEffect)(function(){Ea(Ot)},[on,Ot]),Object(b.useEffect)(function(){on&&(be&&on.focus())},[on,be]),Object(b.useEffect)(function(){if(ar&&on){var Et=on.getScrollerElement();function Xt(Mt){var gt=Mt.target;if(Ie.current){var Sn=gt.scrollTop/gt.scrollHeight;Ie.current.scrollTop=Ie.current.scrollHeight*Sn}}return Et.addEventListener("scroll",Xt),function(){Et.removeEventListener("scroll",Xt)}}},[on,ar]),Object(b.useEffect)(function(){if(on&&Ra){function Et(Xt,Mt){Ra(Xt,Mt)}return on.on("beforeChange",Et),function(){on.off("beforeChange",Et)}}},[on,Ra]),Object(b.useEffect)(function(){if(on&&la){function Et(){la(on.getValue())}return on.on("blur",Et),function(){on.off("blur",Et)}}},[on,la]),Object(b.useEffect)(function(){if(on){function Et(Xt){var Mt=Xt.getValue();nr(Mt),ln(new Date().getTime()),Xt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Gt&&Gt(Mt)}return on.on("change",Et),function(){on.off("change",Et)}}},[on,Gt]),Object(b.useEffect)(function(){on&&(ct==null?(on.setValue(""),nr("")):ct!==on.getValue()&&(on.setValue(ct),nr(ct),on.setCursor(on.lineCount(),0)))},[on,ct]);var Ze=Object(b.useCallback)(function(Et){var Xt=on.getCursor(),Mt=on.getSelection(),gt=Mt.split(`
|
|
`);switch(Et){case"bold":return on.replaceSelection("**"+Mt+"**"),Mt===""&&on.setCursor(Xt.line,Xt.ch+2),on.focus();case"italic":return on.replaceSelection("*"+Mt+"*"),Mt===""&&on.setCursor(Xt.line,Xt.ch+1),on.focus();case"code":return on.replaceSelection("`"+Mt+"`"),Mt===""&&on.setCursor(Xt.line,Xt.ch+1),on.focus();case"inline-latex":return on.replaceSelection("`$$"+Mt+"$$`"),Mt===""&&on.setCursor(Xt.line,Xt.ch+3),on.focus();case"latex":return on.replaceSelection("```latex\n"+Mt+"\n```"),on.setCursor(Xt.line+1,Mt.length+1),on.focus();case"line-break":return on.replaceSelection(`<br/>
|
|
`),on.focus();case"list-ul":return Mt===""?on.replaceSelection("- "+Mt):on.replaceSelection(gt.map(function(Sn){return Sn===""?"":"- ".concat(Sn)}).join(`
|
|
`)),on.focus();case"list-ol":return Mt===""?on.replaceSelection("1. "+Mt):on.replaceSelection(gt.map(function(Sn,gn){return Sn===""?"":"".concat(gn+1,". ").concat(Sn)}).join(`
|
|
`)),on.focus();case"add-null-ch":return Mt===""&&on.setCursor(Xt.line,Xt.ch+1),on.replaceSelection(Ue),on.focus();case"inster-template-1":return Mt===""&&on.setCursor(Xt.line,Xt.ch),on.replaceSelection(ut),on.focus();case"eraser":return on.setValue(""),on.focus();case"trigger-watch":return Ea(!ar),on.focus();case"trigger-full-screen":return _r(!ur),on.focus();case wt:_a(wt);return;case bn:_a(bn);return;case yt:_a(yt);return;case un:_a(un);return;default:throw new Error}},[on,ar,ur]),dt=Object(b.useCallback)(function(Et){_a("");switch(va){case wt:var Xt=Et.title,Mt=Et.link;return on.replaceSelection("[".concat(Xt,"](").concat(Mt,")")),on.focus();case bn:var gt=Et.language,Sn=Et.content;return on.replaceSelection(["```"+gt,Sn,"```"].join(`
|
|
`)),on.focus();case yt:var gn=Et.src,Nt=Et.alt;return Nt?on.replaceSelection(".concat(gn,' "').concat(Nt,'" )')):on.replaceSelection("")),on.focus();case un:for(var et=Et.row,Rn=Et.col,$t=Et.align,Bn=`
|
|
`,jt=0;jt<et;jt++){for(var vn=[],Dn=[],tn=0;tn<Rn;tn++)jt===1&&Dn.push(Ye[$t]),vn.push(" ");jt===1&&(Bn+="| ".concat(Dn.join(" | "),` |
|
|
`)),Bn+="| ".concat(vn.join(Rn===1?"":" | "),` |
|
|
`)}return on.replaceSelection(Bn+`
|
|
`),on.focus();default:throw new Error}},[on,va]),Tt=Object(b.useMemo)(function(){switch(va){case wt:return m.a.createElement(ee,{callback:dt,onCancel:at});case bn:return m.a.createElement(se.b,{callback:dt,onCancel:at});case yt:return m.a.createElement(le,{callback:dt,onCancel:at});case un:return m.a.createElement(Rt,{callback:dt,onCancel:at});default:return null}},[va]);function at(){_a("")}Object(b.useEffect)(function(){if(Dt.current){var Et=Dt.current,Xt=!1,Mt=0;function gt(Nt){Xt=!0,Mt=Nt.pageY}function Sn(){Xt=!1}function gn(Nt){if(Xt){var et=Nt.pageY-Mt;et<0&&(et=0),et>300&&(et=300);var Rn=st+et+"px";Zn(Rn)}}return Et.addEventListener("mousedown",gt),document.addEventListener("mousemove",gn),document.addEventListener("mouseup",Sn),function(){Et.removeEventListener("mousedown",gt),document.removeEventListener("mousemove",gn),document.removeEventListener("mouseup",Sn)}}},[on,Dt]),Object(b.useEffect)(function(){Zn(st)},[st]);var Ut=Ee(it),Yt=Ee($n),yn={width:Ut,height:Yt},In=Object(b.useMemo)(function(){if(Mn){var Et=new Date(Mn),Xt=Et.getHours(),Mt=Et.getMinutes(),gt=Et.getSeconds();return Xt=Xt<10?"0"+Xt:Xt,Mt=Mt<10?"0"+Mt:Mt,gt=gt<10?"0"+gt:gt,"".concat(Xt,":").concat(Mt,":").concat(gt)}return 0},[Mn]);function mn(){window.sessionStorage.removeItem(De),ve(!1),ln(0)}function Cn(){ve(!1),ln(0),on.setValue(window.sessionStorage.getItem(De))}function xn(Et,Xt){var Mt=on.getValue();Mt=Mt.replace(Et,Xt),nr(Mt),on==null||on.setValue(Mt)}return m.a.createElement(b.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:At},m.a.createElement("div",{className:"markdown-editor-container ".concat(rn," ").concat(ar?"on-preview":""," ").concat(Qe?"mini":""," ").concat(ur?"full-screen":""),style:yn},m.a.createElement(E,{insertTemp:qe,watch:ar,fullScreen:ur,showNullButton:zn,onActionCallback:Ze,hidetoolBar:ga,uuid:Xe.current,setOpenPhones:function(){Re.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:lt,placeholder:$a})),ar?m.a.createElement("div",{ref:Ie,className:"preview-container"},Qt==="stex"&&m.a.createElement(w,{value:mr}),Qt!=="stex"&&m.a.createElement(x.a,{edit:!0,value:mr,replaces:xn})):null))),Jt?m.a.createElement("a",{ref:Dt,className:"editor-resize"}):null,m.a.createElement(k.a,null,re[va]?m.a.createElement(z.a,{centered:!0,title:re[va],visible:!0,onCancel:at,footer:null,className:"markdown-popup-form"},Tt):null))}},RotF:function(zt,Ke,M){zt.exports=M("LSTS")},"SA+Z":function(zt,Ke,M){var Q=M("wTVA"),z=M("EbDI"),I=M("ZhPi"),B=M("wkBT");function R(P){return Q(P)||z(P)||I(P)||B()}zt.exports=R,zt.exports.__esModule=!0,zt.exports.default=zt.exports},SJMd:function(zt,Ke){/**
|
|
* @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 M,Q,z,I=!1,B,R;window.PR_SHOULD_USE_CONTINUATION=!0;var P,F;(function(){var D=window,L=["break,continue,do,else,for,if,return,while"],A=[L,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],b=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[b,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],h=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[b,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",a=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="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=[L,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],i=[L,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],n=[L,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[m,d,h,a,u,s,i,n],C=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",w="kwd",T="com",_="typ",y="lit",f="pun",c="pln",v="tag",p="dec",E="src",k="atn",U="atv",H="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(_t){for(var tt=0,Rt=!1,Ge=!1,Ft=0,wt=_t.length;Ft<wt;++Ft){var yt=_t[Ft];if(yt.ignoreCase)Ge=!0;else if(/[a-z]/i.test(yt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Rt=!0,Ge=!1;break}}var bn={b:8,t:9,n:10,v:11,f:12,r:13};function un(ke){var Pe=ke.charCodeAt(0);if(Pe!==92)return Pe;var rt=ke.charAt(1);return Pe=bn[rt],Pe||("0"<=rt&&rt<="7"?parseInt(ke.substring(1),8):rt==="u"||rt==="x"?parseInt(ke.substring(2),16):ke.charCodeAt(1))}function sn(ke){if(ke<32)return(ke<16?"\\x0":"\\x")+ke.toString(16);var Pe=String.fromCharCode(ke);return Pe==="\\"||Pe==="-"||Pe==="]"||Pe==="^"?"\\"+Pe:Pe}function Ye(ke){var Pe=ke.substring(1,ke.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")),rt=[],ht=Pe[0]==="^",Ue=["["];ht&&Ue.push("^");for(var ut=ht?1:0,Ee=Pe.length;ut<Ee;++ut){var ce=Pe[ut];if(/\\[bdsw]/i.test(ce))Ue.push(ce);else{var he=un(ce),J;ut+2<Ee&&Pe[ut+1]==="-"?(J=un(Pe[ut+2]),ut+=2):J=he,rt.push([he,J]),J<65||he>122||(J<65||he>90||rt.push([Math.max(65,he)|32,Math.min(J,90)|32]),J<97||he>122||rt.push([Math.max(97,he)&~32,Math.min(J,122)&~32]))}}rt.sort(function(de,Ne){return de[0]-Ne[0]||Ne[1]-de[1]});for(var Z=[],re=[],ut=0;ut<rt.length;++ut){var ue=rt[ut];ue[0]<=re[1]+1?re[1]=Math.max(re[1],ue[1]):Z.push(re=ue)}for(var ut=0;ut<Z.length;++ut){var ue=Z[ut];Ue.push(sn(ue[0])),ue[1]>ue[0]&&(ue[1]+1>ue[0]&&Ue.push("-"),Ue.push(sn(ue[1])))}return Ue.push("]"),Ue.join("")}function nn(ke){for(var Pe=ke.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")),rt=Pe.length,ht=[],Ue=0,ut=0;Ue<rt;++Ue){var Ee=Pe[Ue];if(Ee==="(")++ut;else if(Ee.charAt(0)==="\\"){var ce=+Ee.substring(1);ce&&(ce<=ut?ht[ce]=-1:Pe[Ue]=sn(ce))}}for(var Ue=1;Ue<ht.length;++Ue)ht[Ue]===-1&&(ht[Ue]=++tt);for(var Ue=0,ut=0;Ue<rt;++Ue){var Ee=Pe[Ue];if(Ee==="(")++ut,ht[ut]||(Pe[Ue]="(?:");else if(Ee.charAt(0)==="\\"){var ce=+Ee.substring(1);ce&&ce<=ut&&(Pe[Ue]="\\"+ht[ce])}}for(var Ue=0;Ue<rt;++Ue)Pe[Ue]==="^"&&Pe[Ue+1]!=="^"&&(Pe[Ue]="");if(ke.ignoreCase&&Rt)for(var Ue=0;Ue<rt;++Ue){var Ee=Pe[Ue],he=Ee.charAt(0);Ee.length>=2&&he==="["?Pe[Ue]=Ye(Ee):he!=="\\"&&(Pe[Ue]=Ee.replace(/[a-zA-Z]/g,function(re){var ue=re.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Pe.join("")}for(var An=[],Ft=0,wt=_t.length;Ft<wt;++Ft){var yt=_t[Ft];if(yt.global||yt.multiline)throw new Error(""+yt);An.push("(?:"+nn(yt)+")")}return new RegExp(An.join("|"),Ge?"gi":"g")}function O(_t,tt){var Rt=/(?:^|\s)nocode(?:\s|$)/,Ge=[],Ft=0,wt=[],yt=0;function bn(un){var sn=un.nodeType;if(sn==1){if(Rt.test(un.className))return;for(var Ye=un.firstChild;Ye;Ye=Ye.nextSibling)bn(Ye);var nn=un.nodeName.toLowerCase();(nn==="br"||nn==="li")&&(Ge[yt]=`
|
|
`,wt[yt<<1]=Ft++,wt[yt++<<1|1]=un)}else if(sn==3||sn==4){var An=un.nodeValue;An.length&&(tt?An=An.replace(/\r\n?/g,`
|
|
`):An=An.replace(/[ \t\r\n]+/g," "),Ge[yt]=An,wt[yt<<1]=Ft,Ft+=An.length,wt[yt++<<1|1]=un)}}return bn(_t),{sourceCode:Ge.join("").replace(/\n$/,""),spans:wt}}function K(_t,tt,Rt,Ge,Ft){if(!Rt)return;var wt={sourceNode:_t,pre:1,langExtension:null,numberLines:null,sourceCode:Rt,spans:null,basePos:tt,decorations:null};Ge(wt),Ft.push.apply(Ft,wt.decorations)}var Y=/\S/;function ee(_t){for(var tt=void 0,Rt=_t.firstChild;Rt;Rt=Rt.nextSibling){var Ge=Rt.nodeType;tt=Ge===1?tt?_t:Rt:Ge===3&&Y.test(Rt.nodeValue)?_t:tt}return tt===_t?void 0:tt}function se(_t,tt){var Rt={},Ge;(function(){for(var yt=_t.concat(tt),bn=[],un={},sn=0,Ye=yt.length;sn<Ye;++sn){var nn=yt[sn],An=nn[3];if(An)for(var ke=An.length;--ke>=0;)Rt[An.charAt(ke)]=nn;var Pe=nn[1],rt=""+Pe;un.hasOwnProperty(rt)||(bn.push(Pe),un[rt]=null)}bn.push(/[\0-\uffff]/),Ge=j(bn)})();var Ft=tt.length,wt=function(yt){for(var bn=yt.sourceCode,un=yt.basePos,sn=yt.sourceNode,Ye=[un,c],nn=0,An=bn.match(Ge)||[],ke={},Pe=0,rt=An.length;Pe<rt;++Pe){var ht=An[Pe],Ue=ke[ht],ut=void 0,Ee;if(typeof Ue=="string")Ee=!1;else{var ce=Rt[ht.charAt(0)];if(ce)ut=ht.match(ce[1]),Ue=ce[0];else{for(var he=0;he<Ft;++he)if(ce=tt[he],ut=ht.match(ce[1]),ut){Ue=ce[0];break}ut||(Ue=c)}Ee=Ue.length>=5&&Ue.substring(0,5)==="lang-",Ee&&!(ut&&typeof ut[1]=="string")&&(Ee=!1,Ue=E),Ee||(ke[ht]=Ue)}var J=nn;if(nn+=ht.length,!Ee)Ye.push(un+J,Ue);else{var Z=ut[1],re=ht.indexOf(Z),ue=re+Z.length;ut[2]&&(ue=ht.length-ut[2].length,re=ue-Z.length);var de=Ue.substring(5);K(sn,un+J,ht.substring(0,re),wt,Ye),K(sn,un+J+re,Z,fe(de,Z),Ye),K(sn,un+J+ue,ht.substring(ue),wt,Ye)}}yt.decorations=Ye};return wt}function Be(_t){var tt=[],Rt=[];_t.tripleQuotedStrings?tt.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):_t.multiLineStrings?tt.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):tt.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),_t.verbatimStrings&&Rt.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ge=_t.hashComments;Ge&&(_t.cStyleComments?(Ge>1?tt.push([T,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):tt.push([T,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Rt.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):tt.push([T,/^#[^\r\n]*/,null,"#"])),_t.cStyleComments&&(Rt.push([T,/^\/\/[^\r\n]*/,null]),Rt.push([T,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ft=_t.regexLiterals;if(Ft){var wt=Ft>1?"":`
|
|
\r`,yt=wt?".":"[\\S\\s]",bn="/(?=[^/*"+wt+"])(?:[^/\\x5B\\x5C"+wt+"]|\\x5C"+yt+"|\\x5B(?:[^\\x5C\\x5D"+wt+"]|\\x5C"+yt+")*(?:\\x5D|$))+/";Rt.push(["lang-regex",RegExp("^"+W+"("+bn+")")])}var un=_t.types;un&&Rt.push([_,un]);var sn=(""+_t.keywords).replace(/^ | $/g,"");sn.length&&Rt.push([w,new RegExp("^(?:"+sn.replace(/[\s,]+/g,"|")+")\\b"),null]),tt.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return _t.regexLiterals&&(Ye+="(?!s*/)"),Rt.push([y,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[y,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[f,new RegExp(Ye),null]),se(tt,Rt)}var me=Be({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(_t,tt,Rt){for(var Ge=/(?:^|\s)nocode(?:\s|$)/,Ft=/\r\n?|\n/,wt=_t.ownerDocument,yt=wt.createElement("li");_t.firstChild;)yt.appendChild(_t.firstChild);var bn=[yt];function un(Pe){var rt=Pe.nodeType;if(rt==1&&!Ge.test(Pe.className))if(Pe.nodeName==="br")sn(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var ht=Pe.firstChild;ht;ht=ht.nextSibling)un(ht);else if((rt==3||rt==4)&&Rt){var Ue=Pe.nodeValue,ut=Ue.match(Ft);if(ut){var Ee=Ue.substring(0,ut.index);Pe.nodeValue=Ee;var ce=Ue.substring(ut.index+ut[0].length);if(ce){var he=Pe.parentNode;he.insertBefore(wt.createTextNode(ce),Pe.nextSibling)}sn(Pe),Ee||Pe.parentNode.removeChild(Pe)}}}function sn(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function rt(ut,Ee){var ce=Ee?ut.cloneNode(!1):ut,he=ut.parentNode;if(he){var J=rt(he,1),Z=ut.nextSibling;J.appendChild(ce);for(var re=Z;re;re=Z)Z=re.nextSibling,J.appendChild(re)}return ce}for(var ht=rt(Pe.nextSibling,0),Ue;(Ue=ht.parentNode)&&Ue.nodeType===1;)ht=Ue;bn.push(ht)}for(var Ye=0;Ye<bn.length;++Ye)un(bn[Ye]);tt===(tt|0)&&bn[0].setAttribute("value",tt);var nn=wt.createElement("ol");nn.className="linenums";for(var An=Math.max(0,tt-1|0)||0,Ye=0,ke=bn.length;Ye<ke;++Ye)yt=bn[Ye],yt.className="L"+(Ye+An)%10,yt.firstChild||yt.appendChild(wt.createTextNode("\xA0")),nn.appendChild(yt);_t.appendChild(nn)}function Le(_t){var tt=/\bMSIE\s(\d+)/.exec(navigator.userAgent);tt=tt&&+tt[1]<=8;var Rt=/\n/g,Ge=_t.sourceCode,Ft=Ge.length,wt=0,yt=_t.spans,bn=yt.length,un=0,sn=_t.decorations,Ye=sn.length,nn=0;sn[Ye]=Ft;var An,ke;for(ke=An=0;ke<Ye;)sn[ke]!==sn[ke+2]?(sn[An++]=sn[ke++],sn[An++]=sn[ke++]):ke+=2;for(Ye=An,ke=An=0;ke<Ye;){for(var Pe=sn[ke],rt=sn[ke+1],ht=ke+2;ht+2<=Ye&&sn[ht+1]===rt;)ht+=2;sn[An++]=Pe,sn[An++]=rt,ke=ht}Ye=sn.length=An;var Ue=_t.sourceNode,ut="";Ue&&(ut=Ue.style.display,Ue.style.display="none");try{for(var Ee=null;un<bn;){var ce=yt[un],he=yt[un+2]||Ft,J=sn[nn+2]||Ft,ht=Math.min(he,J),Z=yt[un+1],re;if(Z.nodeType!==1&&(re=Ge.substring(wt,ht))){tt&&(re=re.replace(Rt,"\r")),Z.nodeValue=re;var ue=Z.ownerDocument,de=ue.createElement("span");de.className=sn[nn+1];var Ne=Z.parentNode;Ne.replaceChild(de,Z),de.appendChild(Z),wt<he&&(yt[un+1]=Z=ue.createTextNode(Ge.substring(ht,he)),Ne.insertBefore(Z,de.nextSibling))}wt=ht,wt>=he&&(un+=2),wt>=J&&(nn+=2)}}finally{Ue&&(Ue.style.display=ut)}}var Ae={};function le(_t,tt){for(var Rt=tt.length;--Rt>=0;){var Ge=tt[Rt];Ae.hasOwnProperty(Ge)?D.console&&console.warn("cannot override language handler %s",Ge):Ae[Ge]=_t}}function fe(_t,tt){return _t&&Ae.hasOwnProperty(_t)||(_t=/^\s*</.test(tt)?"default-markup":"default-code"),Ae[_t]}le(me,["default-code"]),le(se([],[[c,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[T,/^<\!--[\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"]),le(se([[c,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[k,/^(?!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"]),le(se([],[[U,/^[\s\S]+/]]),["uq.val"]),le(Be({keywords:m,hashComments:!0,cStyleComments:!0,types:C}),["c","cc","cpp","cxx","cyc","m"]),le(Be({keywords:"null,true,false"}),["json"]),le(Be({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:C}),["cs"]),le(Be({keywords:h,cStyleComments:!0}),["java"]),le(Be({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),le(Be({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),le(Be({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),le(Be({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),le(Be({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),le(Be({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),le(se([],[[x,/^[\s\S]+/]]),["regex"]);function Ve(_t){var tt=_t.langExtension;try{var Rt=O(_t.sourceNode,_t.pre),Ge=Rt.sourceCode;_t.sourceCode=Ge,_t.spans=Rt.spans,_t.basePos=0,fe(tt,Ge)(_t),Le(_t)}catch(Ft){D.console&&console.log(Ft&&Ft.stack||Ft)}}function Lt(_t,tt,Rt){var Ge=Rt||!1,Ft=tt||null,wt=document.createElement("div");wt.innerHTML="<pre>"+_t+"</pre>",wt=wt.firstChild,Ge&&xe(wt,Ge,!0);var yt={langExtension:Ft,numberLines:Ge,sourceNode:wt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ve(yt),wt.innerHTML}function Pt(_t,tt){var Rt=tt||document.body,Ge=Rt.ownerDocument||document;function Ft(ce){return Rt.getElementsByTagName(ce)}for(var wt=[Ft("pre"),Ft("code"),Ft("xmp")],yt=[],bn=0;bn<wt.length;++bn)for(var un=0,sn=wt[bn].length;un<sn;++un)yt.push(wt[bn][un]);wt=null;var Ye=Date;Ye.now||(Ye={now:function(){return+new Date}});var nn=0,An=/\blang(?:uage)?-([\w.]+)(?!\S)/,ke=/\bprettyprint\b/,Pe=/\bprettyprinted\b/,rt=/pre|xmp/i,ht=/^code$/i,Ue=/^(?:pre|code|xmp)$/i,ut={};function Ee(){for(var ce=D.PR_SHOULD_USE_CONTINUATION?Ye.now()+250:Infinity;nn<yt.length&&Ye.now()<ce;nn++){for(var he=yt[nn],J=ut,Z=he;Z=Z.previousSibling;){var re=Z.nodeType,ue=(re===7||re===8)&&Z.nodeValue;if(ue?!/^\??prettify\b/.test(ue):re!==3||/\S/.test(Z.nodeValue))break;if(ue){J={},ue.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ot,qe,Bt){J[qe]=Bt});break}}var de=he.className;if((J!==ut||ke.test(de))&&!Pe.test(de)){for(var Ne=!1,ct=he.parentNode;ct;ct=ct.parentNode){var Gt=ct.tagName;if(Ue.test(Gt)&&ct.className&&ke.test(ct.className)){Ne=!0;break}}if(!Ne){he.className+=" prettyprinted";var an=J.lang;if(!an){an=de.match(An);var it;!an&&(it=ee(he))&&ht.test(it.tagName)&&(an=it.className.match(An)),an&&(an=an[1])}var qt;if(rt.test(he.tagName))qt=1;else{var st=he.currentStyle,pt=Ge.defaultView,Qe=st?st.whiteSpace:pt&&pt.getComputedStyle?pt.getComputedStyle(he,null).getPropertyValue("white-space"):0;qt=Qe&&Qe.substring(0,3)==="pre"}var ie=J.linenums;(ie=ie==="true"||+ie)||(ie=de.match(/\blinenums\b(?::(\d+))?/),ie=ie?ie[1]&&ie[1].length?+ie[1]:!0:!1),ie&&xe(he,ie,qt);var be={langExtension:an,sourceNode:he,numberLines:ie,pre:qt,sourceCode:null,basePos:null,spans:null,decorations:null};Ve(be)}}}nn<yt.length?D.setTimeout(Ee,250):typeof _t=="function"&&_t()}Ee()}var vt=D.PR={createSimpleLexer:se,registerLangHandler:le,sourceDecorator:Be,PR_ATTRIB_NAME:k,PR_ATTRIB_VALUE:U,PR_COMMENT:T,PR_DECLARATION:p,PR_KEYWORD:w,PR_LITERAL:y,PR_NOCODE:H,PR_PLAIN:c,PR_PUNCTUATION:f,PR_SOURCE:E,PR_STRING:x,PR_TAG:v,PR_TYPE:_,prettyPrintOne:I?D.prettyPrintOne=Lt:P=Lt,prettyPrint:F=I?D.prettyPrint=Pt:F=Pt},Fe=D.define;typeof Fe=="function"&&Fe.amd&&Fe("google-code-prettify",[],function(){return vt})})()},T7RX:function(zt,Ke,M){"use strict";var Q=M("2qtc"),z=M("kLXV"),I=M("k1fw"),B=M("miYZ"),R=M("tsqr"),P=M("9og8"),F=M("PpiC"),D=M("WmNS"),L=M.n(D),A=M("cDcd"),b=M.n(A),m=M("ErOA"),h=M("Ty5D"),d=M("9kvl"),o=function(u){var s=u.shixunHomeworks,i=u.dispatch,n=Object(F.a)(u,["shixunHomeworks","dispatch"]),S=Object(h.i)();return b.a.createElement(z.a,{centered:!0,title:"\u63D0\u793A",visible:s.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(P.a)(L.a.mark(function C(){var x;return L.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,Object(m.a)("/api/myshixuns/".concat(s.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:S.coursesId}});case 2:x=T.sent,x.shixun_identifier&&(R.b.success("\u64CD\u4F5C\u6210\u529F"),i({type:"shixunHomeworks/setActionTabs",payload:{}}),i({type:"shixunHomeworks/getWorkList",payload:Object(I.a)({},s.actionTabs.params)}));case 4:case"end":return T.stop()}},C)})),onCancel:function(){i({type:"shixunHomeworks/setActionTabs",payload:{}})}},b.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),b.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};Ke.a=Object(d.a)(function(a){var u=a.shixunHomeworks;return{shixunHomeworks:u}})(o)},TXwP:function(zt,Ke,M){var Q,z;(function(){var I;(function(){"use strict";var R=[,,function(L){function A(h){this.__parent=h,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=[]}A.prototype.clone_empty=function(){var h=new A(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},A.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},A.prototype.has_match=function(h){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(h))return!0;return!1},A.prototype.set_indent=function(h,d){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(h){this.__items.push(h);var d=h.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=h.length-d:this.__character_count+=h.length},A.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function b(h,d){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),d=d||"",h.indent_level>0&&(d=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}b.prototype.get_indent_size=function(h,d){var o=this.__base_string_length;return d=d||0,h<0&&(o=0),o+=h*this.__indent_size,o+=d,o},b.prototype.get_indent_string=function(h,d){var o=this.__base_string;return d=d||0,h<0&&(h=0,o=""),d+=h*this.__indent_size,this.__ensure_cache(d),o+=this.__cache[d],o},b.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var h=this.__cache.length,d=0,o="";this.__indent_size&&h>=this.__indent_size&&(d=Math.floor(h/this.__indent_size),h-=d*this.__indent_size,o=new Array(d+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function m(h,d){this.__indent_cache=new b(h,d),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(h,d){return this.__indent_cache.get_indent_string(h,d)},m.prototype.get_indent_size=function(h,d){return this.__indent_cache.get_indent_size(h,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(h){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(o=o.replace(/[\n]/g,h)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(h,d){return h=h||0,d=d||0,this.next_line.set_indent(h,d),this.__lines.length>1?(this.current_line.set_indent(h,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(h){for(var d=0;d<h.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(h){for(var d=this.__lines.length;h<d;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(h,d){for(var o=this.__lines.length-2;o>=0;){var a=this.__lines[o];if(a.is_empty())break;if(a.item(0).indexOf(h)!==0&&a.item(-1)!==d){this.__lines.splice(o+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},L.exports.Output=m},,,,function(L){function A(h,d){this.raw_options=b(h,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}A.prototype._get_array=function(h,d){var o=this.raw_options[h],a=d||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(a=o.concat()):typeof o=="string"&&(a=o.split(/[^a-zA-Z0-9_\/\-]+/)),a},A.prototype._get_boolean=function(h,d){var o=this.raw_options[h],a=o===void 0?!!d:!!o;return a},A.prototype._get_characters=function(h,d){var o=this.raw_options[h],a=d||"";return typeof o=="string"&&(a=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),a},A.prototype._get_number=function(h,d){var o=this.raw_options[h];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(o,10);return isNaN(a)&&(a=d),a},A.prototype._get_selection=function(h,d,o){var a=this._get_selection_list(h,d,o);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[h]+"'");return a[0]},A.prototype._get_selection_list=function(h,d,o){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[d[0]],!this._is_valid_selection(o,d))throw new Error("Invalid Default Value!");var a=this._get_array(h,o);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[h]+"'");return a},A.prototype._is_valid_selection=function(h,d){return h.length&&d.length&&!h.some(function(o){return d.indexOf(o)===-1})};function b(h,d){var o={};h=m(h);var a;for(a in h)a!==d&&(o[a]=h[a]);if(d&&h[d])for(a in h[d])o[a]=h[d][a];return o}function m(h){var d={},o;for(o in h){var a=o.replace(/-/g,"_");d[a]=h[o]}return d}L.exports.Options=A,L.exports.normalizeOpts=m,L.exports.mergeOpts=b},,function(L){var A=RegExp.prototype.hasOwnProperty("sticky");function b(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},b.prototype.peek=function(m){var h=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(h=this.__input.charAt(m)),h},b.prototype.__match=function(m,h){m.lastIndex=h;var d=m.exec(this.__input);return d&&!(A&&m.sticky)&&(d.index!==h&&(d=null)),d},b.prototype.test=function(m,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(m,h):!1},b.prototype.testChar=function(m,h){var d=this.peek(h);return m.lastIndex=0,d!==null&&m.test(d)},b.prototype.match=function(m){var h=this.__match(m,this.__position);return h?this.__position+=h[0].length:h=null,h},b.prototype.read=function(m,h,d){var o="",a;return m&&(a=this.match(m),a&&(o+=a[0])),h&&(a||!m)&&(o+=this.readUntil(h,d)),o},b.prototype.readUntil=function(m,h){var d="",o=this.__position;m.lastIndex=this.__position;var a=m.exec(this.__input);return a?(o=a.index,h&&(o+=a[0].length)):o=this.__input_length,d=this.__input.substring(this.__position,o),this.__position=o,d},b.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},b.prototype.get_regexp=function(m,h){var d=null,o="g";return h&&A&&(o="y"),typeof m=="string"&&m!==""?d=new RegExp(m,o):m&&(d=new RegExp(m.source,o)),d},b.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(m){var h=this.__position,d=this.readUntilAfter(m);return this.__position=h,d},b.prototype.lookBack=function(m){var h=this.__position-1;return h>=m.length&&this.__input.substring(h-m.length,h).toLowerCase()===m},L.exports.InputScanner=b},,,,,function(L){function A(b,m){b=typeof b=="string"?b:b.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+m,"g")}A.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(b);h;)m[h[1]]=h[2],h=this.__directive_pattern.exec(b);return m},A.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=A},,function(L,A,b){var m=b(16).Beautifier,h=b(17).Options;function d(o,a){var u=new m(o,a);return u.beautify()}L.exports=d,L.exports.defaultOptions=function(){return new h}},function(L,A,b){var m=b(17).Options,h=b(2).Output,d=b(8).InputScanner,o=b(13).Directives,a=new o(/\/\*/,/\*\//),u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=/\s/,n=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,C=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(w,T){this._source_text=w||"",this._options=new m(T),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"]}x.prototype.eatString=function(w){var T="";for(this._ch=this._input.next();this._ch;){if(T+=this._ch,this._ch==="\\")T+=this._input.next();else if(w.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return T},x.prototype.eatWhitespace=function(w){for(var T=i.test(this._input.peek()),_=0;i.test(this._input.peek());)this._ch=this._input.next(),w&&this._ch===`
|
|
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return T},x.prototype.foundNestedPseudoClass=function(){for(var w=0,T=1,_=this._input.peek(T);_;){if(_==="{")return!0;if(_==="(")w+=1;else if(_===")"){if(w===0)return!1;w-=1}else if(_===";"||_==="}")return!1;T++,_=this._input.peek(T)}return!1},x.prototype.print_string=function(w){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(w)},x.prototype.preserveSingleSpace=function(w){w&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,T=this._options.eol;T==="auto"&&(T=`
|
|
`,w&&u.test(w||"")&&(T=w.match(u)[0])),w=w.replace(s,`
|
|
`);var _=w.match(/^[\t ]*/)[0];this._output=new h(this._options,_),this._input=new d(w),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var y=0,f=!1,c=!1,v=!1,p=!1,E=!1,k=!1,U=this._ch,H=!1,W,j,O;W=this._input.read(n),j=W!=="",O=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var K=this._input.read(S),Y=a.get_directives(K);Y&&Y.ignore==="start"&&(K+=a.readIgnored(this._input)),this.print_string(K),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(C)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(j),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ee=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ee.match(/[ :]$/)&&(ee=this.eatString(": ").replace(/\s$/,""),this.print_string(ee),this._output.space_before_token=!0),ee=ee.replace(/\s$/,""),ee==="extend"?p=!0:ee==="import"&&(E=!0),ee in this.NESTED_AT_RULE?(this._nestedLevel+=1,ee in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!f&&y===0&&ee.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(j),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),v?(v=!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)):(O==="("?this._output.space_before_token=!1:O!==","&&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(),O==="{"&&this._output.trim(!0),E=!1,p=!1,c&&(this.outdent(),c=!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])){H=!0;break}(f||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!p&&y===0?(this.print_string(":"),c||(c=!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 Be=O==='"'||O==="'";this.preserveSingleSpace(Be||j),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")H=!1,y===0?(c&&(this.outdent(),c=!1),p=!1,E=!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(),y++,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(")")),y&&(y--,this.outdent()));else{var me=!1;this._input.lookBack("with")&&(me=!0),this.preserveSingleSpace(j||me),this.print_string(this._ch),c&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),k=!0):(this.eatWhitespace(),y++,this.indent())}else if(this._ch===")")y&&(y--,this.outdent()),k&&this._input.peek()===";"&&this._options.selector_separator_newline&&(k=!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&&(!c||k)&&y===0&&!E&&!p?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&y===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(j),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 xe=O==='"'||O==="'";this.preserveSingleSpace(xe||j),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&H&&this._output.add_new_line()}var Le=this._output.get_code(T);return Le},L.exports.Beautifier=x},function(L,A,b){var m=b(6).Options;function h(d){m.call(this,d,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var u=0;u<a.length;u++)a[u]!=="expand"?this.brace_style="collapse":this.brace_style=a[u]}h.prototype=new m,L.exports.Options=h}],P={};function F(L){var A=P[L];if(A!==void 0)return A.exports;var b=P[L]={exports:{}};return R[L](b,b.exports,F),b.exports}var D=F(15);I=D})();var B=I;!(Q=[],z=function(){return{css_beautify:B}}.apply(Ke,Q),z!==void 0&&(zt.exports=z))})()},"VrN/":function(zt,Ke,M){(function(Q,z){zt.exports=z()})(this,function(){"use strict";var Q=navigator.userAgent,z=navigator.platform,I=/gecko\/\d/i.test(Q),B=/MSIE \d/.test(Q),R=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Q),P=/Edge\/(\d+)/.exec(Q),F=B||R||P,D=F&&(B?document.documentMode||6:+(P||R)[1]),L=!P&&/WebKit\//.test(Q),A=L&&/Qt\/\d+\.\d+/.test(Q),b=!P&&/Chrome\//.test(Q),m=/Opera\//.test(Q),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Q),o=/PhantomJS/.test(Q),a=!P&&/AppleWebKit/.test(Q)&&/Mobile\/\w+/.test(Q),u=/Android/.test(Q),s=a||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Q),i=a||/Mac/.test(z),n=/\bCrOS\b/.test(Q),S=/win/i.test(z),C=m&&Q.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(m=!1,L=!0);var x=i&&(A||m&&(C==null||C<12.11)),w=I||F&&D>=9;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var l=e.className,r=T(t).exec(l);if(r){var g=l.slice(r.index+r[0].length);e.className=l.slice(0,r.index)+(g?r[1]+g:"")}};function y(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return y(e).appendChild(t)}function c(e,t,l,r){var g=document.createElement(e);if(l&&(g.className=l),r&&(g.style.cssText=r),typeof t=="string")g.appendChild(document.createTextNode(t));else if(t)for(var N=0;N<t.length;++N)g.appendChild(t[N]);return g}function v(e,t,l,r){var g=c(e,t,l,r);return g.setAttribute("role","presentation"),g}var p;document.createRange?p=function(e,t,l,r){var g=document.createRange();return g.setEnd(r||e,l),g.setStart(e,t),g}:p=function(e,t,l){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(g){return r}return r.collapse(!0),r.moveEnd("character",l),r.moveStart("character",t),r};function E(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function k(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function U(e,t){var l=e.className;T(t).test(l)||(e.className+=(l?" ":"")+t)}function H(e,t){for(var l=e.split(" "),r=0;r<l.length;r++)l[r]&&!T(l[r]).test(t)&&(t+=" "+l[r]);return t}var W=function(e){e.select()};a?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:F&&(W=function(e){try{e.select()}catch(t){}});function j(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function O(e,t,l){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(l!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function K(e,t,l,r,g){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var N=r||0,G=g||0;;){var X=e.indexOf(" ",N);if(X<0||X>=t)return G+(t-N);G+=X-N,G+=l-G%l,N=X+1}}var Y=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};Y.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Y.prototype.set=function(e,t){this.f=t;var l=+new Date+e;(!this.id||l<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=l)};function ee(e,t){for(var l=0;l<e.length;++l)if(e[l]==t)return l;return-1}var se=50,Be={toString:function(){return"CodeMirror.Pass"}},me={scroll:!1},xe={origin:"*mouse"},Le={origin:"+move"};function Ae(e,t,l){for(var r=0,g=0;;){var N=e.indexOf(" ",r);N==-1&&(N=e.length);var G=N-r;if(N==e.length||g+G>=t)return r+Math.min(G,t-g);if(g+=N-r,g+=l-g%l,r=N+1,g>=t)return r}}var le=[""];function fe(e){for(;le.length<=e;)le.push(Ve(le)+" ");return le[e]}function Ve(e){return e[e.length-1]}function Lt(e,t){for(var l=[],r=0;r<e.length;r++)l[r]=t(e[r],r);return l}function Pt(e,t,l){for(var r=0,g=l(t);r<e.length&&l(e[r])<=g;)r++;e.splice(r,0,t)}function vt(){}function Fe(e,t){var l;return Object.create?l=Object.create(e):(vt.prototype=e,l=new vt),t&&O(t,l),l}var _t=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function tt(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||_t.test(e))}function Rt(e,t){return t?t.source.indexOf("\\w")>-1&&tt(e)?!0:t.test(e):tt(e)}function Ge(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ft=/[\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 wt(e){return e.charCodeAt(0)>=768&&Ft.test(e)}function yt(e,t,l){for(;(l<0?t>0:t<e.length)&&wt(e.charAt(t));)t+=l;return t}function bn(e,t,l){for(var r=t>l?-1:1;;){if(t==l)return t;var g=(t+l)/2,N=r<0?Math.ceil(g):Math.floor(g);if(N==t)return e(N)?t:l;e(N)?l=N:t=N+r}}function un(e,t,l,r){if(!e)return r(t,l,"ltr",0);for(var g=!1,N=0;N<e.length;++N){var G=e[N];(G.from<l&&G.to>t||t==l&&G.to==t)&&(r(Math.max(G.from,t),Math.min(G.to,l),G.level==1?"rtl":"ltr",N),g=!0)}g||r(t,l,"ltr")}var sn=null;function Ye(e,t,l){var r;sn=null;for(var g=0;g<e.length;++g){var N=e[g];if(N.from<t&&N.to>t)return g;N.to==t&&(N.from!=N.to&&l=="before"?r=g:sn=g),N.from==t&&(N.from!=N.to&&l!="before"?r=g:sn=g)}return r!=null?r:sn}var nn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function l(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,N=/[LRr]/,G=/[Lb1n]/,X=/[1n]/;function $(te,Oe,Me){this.level=te,this.from=Oe,this.to=Me}return function(te,Oe){var Me=Oe=="ltr"?"L":"R";if(te.length==0||Oe=="ltr"&&!r.test(te))return!1;for(var ot=te.length,nt=[],Kt=0;Kt<ot;++Kt)nt.push(l(te.charCodeAt(Kt)));for(var pn=0,Ln=Me;pn<ot;++pn){var Un=nt[pn];Un=="m"?nt[pn]=Ln:Ln=Un}for(var Hn=0,jn=Me;Hn<ot;++Hn){var Vn=nt[Hn];Vn=="1"&&jn=="r"?nt[Hn]="n":N.test(Vn)&&(jn=Vn,Vn=="r"&&(nt[Hn]="R"))}for(var fa=1,ia=nt[0];fa<ot-1;++fa){var wa=nt[fa];wa=="+"&&ia=="1"&&nt[fa+1]=="1"?nt[fa]="1":wa==","&&ia==nt[fa+1]&&(ia=="1"||ia=="n")&&(nt[fa]=ia),ia=wa}for(var tr=0;tr<ot;++tr){var jr=nt[tr];if(jr==",")nt[tr]="N";else if(jr=="%"){var gr=void 0;for(gr=tr+1;gr<ot&&nt[gr]=="%";++gr);for(var ii=tr&&nt[tr-1]=="!"||gr<ot&&nt[gr]=="1"?"1":"N",ti=tr;ti<gr;++ti)nt[ti]=ii;tr=gr-1}}for(var Pr=0,ni=Me;Pr<ot;++Pr){var zr=nt[Pr];ni=="L"&&zr=="1"?nt[Pr]="L":N.test(zr)&&(ni=zr)}for(var Ir=0;Ir<ot;++Ir)if(g.test(nt[Ir])){var Lr=void 0;for(Lr=Ir+1;Lr<ot&&g.test(nt[Lr]);++Lr);for(var Er=(Ir?nt[Ir-1]:Me)=="L",ai=(Lr<ot?nt[Lr]:Me)=="L",wo=Er==ai?Er?"L":"R":Me,to=Ir;to<Lr;++to)nt[to]=wo;Ir=Lr-1}for(var Vr=[],Li,Fr=0;Fr<ot;)if(G.test(nt[Fr])){var ms=Fr;for(++Fr;Fr<ot&&G.test(nt[Fr]);++Fr);Vr.push(new $(0,ms,Fr))}else{var zi=Fr,lo=Vr.length,uo=Oe=="rtl"?1:0;for(++Fr;Fr<ot&&nt[Fr]!="L";++Fr);for(var Xr=zi;Xr<Fr;)if(X.test(nt[Xr])){zi<Xr&&(Vr.splice(lo,0,new $(1,zi,Xr)),lo+=uo);var So=Xr;for(++Xr;Xr<Fr&&X.test(nt[Xr]);++Xr);Vr.splice(lo,0,new $(2,So,Xr)),lo+=uo,zi=Xr}else++Xr;zi<Fr&&Vr.splice(lo,0,new $(1,zi,Fr))}return Oe=="ltr"&&(Vr[0].level==1&&(Li=te.match(/^\s+/))&&(Vr[0].from=Li[0].length,Vr.unshift(new $(0,0,Li[0].length))),Ve(Vr).level==1&&(Li=te.match(/\s+$/))&&(Ve(Vr).to-=Li[0].length,Vr.push(new $(0,ot-Li[0].length,ot)))),Oe=="rtl"?Vr.reverse():Vr}}();function An(e,t){var l=e.order;return l==null&&(l=e.order=nn(e.text,t)),l}var ke=[],Pe=function(e,t,l){if(e.addEventListener)e.addEventListener(t,l,!1);else if(e.attachEvent)e.attachEvent("on"+t,l);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ke).concat(l)}};function rt(e,t){return e._handlers&&e._handlers[t]||ke}function ht(e,t,l){if(e.removeEventListener)e.removeEventListener(t,l,!1);else if(e.detachEvent)e.detachEvent("on"+t,l);else{var r=e._handlers,g=r&&r[t];if(g){var N=ee(g,l);N>-1&&(r[t]=g.slice(0,N).concat(g.slice(N+1)))}}}function Ue(e,t){var l=rt(e,t);if(!l.length)return;for(var r=Array.prototype.slice.call(arguments,2),g=0;g<l.length;++g)l[g].apply(null,r)}function ut(e,t,l){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ue(e,l||t.type,e,t),re(t)||t.codemirrorIgnore}function Ee(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var l=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ee(l,t[r])==-1&&l.push(t[r])}function ce(e,t){return rt(e,t).length>0}function he(e){e.prototype.on=function(t,l){Pe(this,t,l)},e.prototype.off=function(t,l){ht(this,t,l)}}function J(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Z(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function re(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ue(e){J(e),Z(e)}function de(e){return e.target||e.srcElement}function Ne(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 ct=function(){if(F&&D<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Gt;function an(e){if(Gt==null){var t=c("span","\u200B");f(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Gt=t.offsetWidth<=1&&t.offsetHeight>2&&!(F&&D<8))}var l=Gt?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return l.setAttribute("cm-text",""),l}var it;function qt(e){if(it!=null)return it;var t=f(e,document.createTextNode("A\u062EA")),l=p(t,0,1).getBoundingClientRect(),r=p(t,1,2).getBoundingClientRect();return y(e),!l||l.left==l.right?!1:it=r.right-l.right<3}var st=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,l=[],r=e.length;t<=r;){var g=e.indexOf(`
|
|
`,t);g==-1&&(g=e.length);var N=e.slice(t,e.charAt(g-1)=="\r"?g-1:g),G=N.indexOf("\r");G!=-1?(l.push(N.slice(0,G)),t+=G+1):(l.push(N),t=g+1)}return l}:function(e){return e.split(/\r\n?|\n/)},pt=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(l){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Qe=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ie=null;function be(e){if(ie!=null)return ie;var t=f(e,c("span","x")),l=t.getBoundingClientRect(),r=p(t,0,1).getBoundingClientRect();return ie=Math.abs(l.left-r.left)>1}var Ot={},qe={};function Bt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ot[e]=t}function Qt(e,t){qe[e]=t}function Ce(e){if(typeof e=="string"&&qe.hasOwnProperty(e))e=qe[e];else if(e&&typeof e.name=="string"&&qe.hasOwnProperty(e.name)){var t=qe[e.name];typeof t=="string"&&(t={name:t}),e=Fe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ce("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ce("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function De(e,t){t=Ce(t);var l=Ot[t.name];if(!l)return De(e,"text/plain");var r=l(e,t);if(mt.hasOwnProperty(t.name)){var g=mt[t.name];for(var N in g){if(!g.hasOwnProperty(N))continue;r.hasOwnProperty(N)&&(r["_"+N]=r[N]),r[N]=g[N]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var G in t.modeProps)r[G]=t.modeProps[G];return r}var mt={};function Jt(e,t){var l=mt.hasOwnProperty(e)?mt[e]:mt[e]={};O(t,l)}function cn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var l={};for(var r in t){var g=t[r];g instanceof Array&&(g=g.concat([])),l[r]=g}return l}function wn(e,t){for(var l;e.innerMode&&!(l=e.innerMode(t),!l||l.mode==e);)t=l.state,e=l.mode;return l||{mode:e,state:t}}function sa(e,t,l){return e.startState?e.startState(t,l):!0}var zn=function(e,t,l){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=l};zn.prototype.eol=function(){return this.pos>=this.string.length},zn.prototype.sol=function(){return this.pos==this.lineStart},zn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},zn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},zn.prototype.eat=function(e){var t=this.string.charAt(this.pos),l;if(typeof e=="string"?l=t==e:l=t&&(e.test?e.test(t):e(t)),l)return++this.pos,t},zn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},zn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},zn.prototype.skipToEnd=function(){this.pos=this.string.length},zn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},zn.prototype.backUp=function(e){this.pos-=e},zn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=K(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},zn.prototype.indentation=function(){return K(this.string,null,this.tabSize)-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},zn.prototype.match=function(e,t,l){if(typeof e=="string"){var r=function(G){return l?G.toLowerCase():G},g=this.string.substr(this.pos,e.length);if(r(g)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var N=this.string.slice(this.pos).match(e);return N&&N.index>0?null:(N&&t!==!1&&(this.pos+=N[0].length),N)}},zn.prototype.current=function(){return this.string.slice(this.start,this.pos)},zn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},zn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},zn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function En(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 l=e;!l.lines;)for(var r=0;;++r){var g=l.children[r],N=g.chunkSize();if(t<N){l=g;break}t-=N}return l.lines[t]}function ga(e,t,l){var r=[],g=t.line;return e.iter(t.line,l.line+1,function(N){var G=N.text;g==l.line&&(G=G.slice(0,l.ch)),g==t.line&&(G=G.slice(t.ch)),r.push(G),++g}),r}function Ua(e,t,l){var r=[];return e.iter(t,l,function(g){r.push(g.text)}),r}function ta(e,t){var l=t-e.height;if(l)for(var r=e;r;r=r.parent)r.height+=l}function la(e){if(e.parent==null)return null;for(var t=e.parent,l=ee(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var g=0;!(r.children[g]==t);++g)l+=r.children[g].chunkSize();return l+t.first}function Ra(e,t){var l=e.first;e:do{for(var r=0;r<e.children.length;++r){var g=e.children[r],N=g.height;if(t<N){e=g;continue e}t-=N,l+=g.chunkSize()}return l}while(!e.lines);for(var G=0;G<e.lines.length;++G){var X=e.lines[G],$=X.height;if(t<$)break;t-=$}return l+G}function Xa(e,t){return t>=e.first&&t<e.first+e.size}function vr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function rn(e,t,l){if(l===void 0&&(l=null),!(this instanceof rn))return new rn(e,t,l);this.line=e,this.ch=t,this.sticky=l}function Xn(e,t){return e.line-t.line||e.ch-t.ch}function hr(e,t){return e.sticky==t.sticky&&Xn(e,t)==0}function xr(e){return rn(e.line,e.ch)}function $a(e,t){return Xn(e,t)<0?t:e}function Ga(e,t){return Xn(e,t)<0?e:t}function Aa(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Kn(e,t){if(t.line<e.first)return rn(e.first,0);var l=e.first+e.size-1;return t.line>l?rn(l,En(e,l).text.length):pr(t,En(e,t.line).text.length)}function pr(e,t){var l=e.ch;return l==null||l>t?rn(e.line,t):l<0?rn(e.line,0):e}function on(e,t){for(var l=[],r=0;r<t.length;r++)l[r]=Kn(e,t[r]);return l}var qa=function(e,t){this.state=e,this.lookAhead=t},Ka=function(e,t,l,r){this.state=t,this.doc=e,this.line=l,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ka.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ka.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}},Ka.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ka.fromSaved=function(e,t,l){return t instanceof qa?new Ka(e,cn(e.mode,t.state),l,t.lookAhead):new Ka(e,cn(e.mode,t),l)},Ka.prototype.save=function(e){var t=e!==!1?cn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new qa(t,this.maxLookAhead):t};function Tr(e,t,l,r){var g=[e.state.modeGen],N={};ur(e,t.text,e.doc.mode,l,function(te,Oe){return g.push(te,Oe)},N,r);for(var G=l.state,X=function(te){l.baseTokens=g;var Oe=e.state.overlays[te],Me=1,ot=0;l.state=!0,ur(e,t.text,Oe.mode,l,function(nt,Kt){for(var pn=Me;ot<nt;){var Ln=g[Me];Ln>nt&&g.splice(Me,1,nt,g[Me+1],Ln),Me+=2,ot=Math.min(nt,Ln)}if(!Kt)return;if(Oe.opaque)g.splice(pn,Me-pn,nt,"overlay "+Kt),Me=pn+2;else for(;pn<Me;pn+=2){var Un=g[pn+1];g[pn+1]=(Un?Un+" ":"")+"overlay "+Kt}},N),l.state=G,l.baseTokens=null,l.baseTokenPos=1},$=0;$<e.state.overlays.length;++$)X($);return{styles:g,classes:N.bgClass||N.textClass?N:null}}function mr(e,t,l){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=nr(e,la(t)),g=t.text.length>e.options.maxHighlightLength&&cn(e.doc.mode,r.state),N=Tr(e,t,r);g&&(r.state=g),t.stateAfter=r.save(!g),t.styles=N.styles,N.classes?t.styleClasses=N.classes:t.styleClasses&&(t.styleClasses=null),l===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function nr(e,t,l){var r=e.doc,g=e.display;if(!r.mode.startState)return new Ka(r,!0,t);var N=_r(e,t,l),G=N>r.first&&En(r,N-1).stateAfter,X=G?Ka.fromSaved(r,G,N):new Ka(r,sa(r.mode),N);return r.iter(N,t,function($){Br(e,$.text,X);var te=X.line;$.stateAfter=te==t-1||te%5==0||te>=g.viewFrom&&te<g.viewTo?X.save():null,X.nextLine()}),l&&(r.modeFrontier=X.line),X}function Br(e,t,l,r){var g=e.doc.mode,N=new zn(t,e.options.tabSize,l);for(N.start=N.pos=r||0,t==""&&Hr(g,l.state);!N.eol();)ar(g,N,l.state),N.start=N.pos}function Hr(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var l=wn(e,t);if(l.mode.blankLine)return l.mode.blankLine(l.state)}function ar(e,t,l,r){for(var g=0;g<10;g++){r&&(r[0]=wn(e,l).mode);var N=e.token(t,l);if(t.pos>t.start)return N}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ea=function(e,t,l){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=l};function Sr(e,t,l,r){var g=e.doc,N=g.mode,G;t=Kn(g,t);var X=En(g,t.line),$=nr(e,t.line,l),te=new zn(X.text,e.options.tabSize,$),Oe;for(r&&(Oe=[]);(r||te.pos<t.ch)&&!te.eol();)te.start=te.pos,G=ar(N,te,$.state),r&&Oe.push(new Ea(te,G,cn(g.mode,$.state)));return r?Oe:new Ea(te,G,$.state)}function Rr(e,t){if(e)for(;;){var l=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!l)break;e=e.slice(0,l.index)+e.slice(l.index+l[0].length);var r=l[1]?"bgClass":"textClass";t[r]==null?t[r]=l[2]:new RegExp("(?:^|\\s)"+l[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+l[2])}return e}function ur(e,t,l,r,g,N,G){var X=l.flattenSpans;X==null&&(X=e.options.flattenSpans);var $=0,te=null,Oe=new zn(t,e.options.tabSize,r),Me,ot=e.options.addModeClass&&[null];for(t==""&&Rr(Hr(l,r.state),N);!Oe.eol();){if(Oe.pos>e.options.maxHighlightLength?(X=!1,G&&Br(e,t,r,Oe.pos),Oe.pos=t.length,Me=null):Me=Rr(ar(l,Oe,r.state,ot),N),ot){var nt=ot[0].name;nt&&(Me="m-"+(Me?nt+" "+Me:nt))}if(!X||te!=Me){for(;$<Oe.start;)$=Math.min(Oe.start,$+5e3),g($,te);te=Me}Oe.start=Oe.pos}for(;$<Oe.pos;){var Kt=Math.min(Oe.pos,$+5e3);g(Kt,te),$=Kt}}function _r(e,t,l){for(var r,g,N=e.doc,G=l?-1:t-(e.doc.mode.innerMode?1e3:100),X=t;X>G;--X){if(X<=N.first)return N.first;var $=En(N,X-1),te=$.stateAfter;if(te&&(!l||X+(te instanceof qa?te.lookAhead:0)<=N.modeFrontier))return X;var Oe=K($.text,null,e.options.tabSize);(g==null||r>Oe)&&(g=X-1,r=Oe)}return g}function oi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var l=e.first,r=t-1;r>l;r--){var g=En(e,r).stateAfter;if(g&&(!(g instanceof qa)||r+g.lookAhead<t)){l=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,l)}var $r=!1,va=!1;function _a(){$r=!0}function ir(){va=!0}function Pa(e,t,l){this.marker=e,this.from=t,this.to=l}function Mn(e,t){if(e)for(var l=0;l<e.length;++l){var r=e[l];if(r.marker==t)return r}}function ln(e,t){for(var l,r=0;r<e.length;++r)e[r]!=t&&(l||(l=[])).push(e[r]);return l}function Tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function fn(e,t,l){var r;if(e)for(var g=0;g<e.length;++g){var N=e[g],G=N.marker,X=N.from==null||(G.inclusiveLeft?N.from<=t:N.from<t);if(X||N.from==t&&G.type=="bookmark"&&(!l||!N.marker.insertLeft)){var $=N.to==null||(G.inclusiveRight?N.to>=t:N.to>t);(r||(r=[])).push(new Pa(G,N.from,$?null:N.to))}}return r}function $n(e,t,l){var r;if(e)for(var g=0;g<e.length;++g){var N=e[g],G=N.marker,X=N.to==null||(G.inclusiveRight?N.to>=t:N.to>t);if(X||N.from==t&&G.type=="bookmark"&&(!l||N.marker.insertLeft)){var $=N.from==null||(G.inclusiveLeft?N.from<=t:N.from<t);(r||(r=[])).push(new Pa(G,$?null:N.from-t,N.to==null?null:N.to-t))}}return r}function Zn(e,t){if(t.full)return null;var l=Xa(e,t.from.line)&&En(e,t.from.line).markedSpans,r=Xa(e,t.to.line)&&En(e,t.to.line).markedSpans;if(!l&&!r)return null;var g=t.from.ch,N=t.to.ch,G=Xn(t.from,t.to)==0,X=fn(l,g,G),$=$n(r,N,G),te=t.text.length==1,Oe=Ve(t.text).length+(te?g:0);if(X)for(var Me=0;Me<X.length;++Me){var ot=X[Me];if(ot.to==null){var nt=Mn($,ot.marker);nt?te&&(ot.to=nt.to==null?null:nt.to+Oe):ot.to=g}}if($)for(var Kt=0;Kt<$.length;++Kt){var pn=$[Kt];if(pn.to!=null&&(pn.to+=Oe),pn.from==null){var Ln=Mn(X,pn.marker);Ln||(pn.from=Oe,te&&(X||(X=[])).push(pn))}else pn.from+=Oe,te&&(X||(X=[])).push(pn)}X&&(X=V(X)),$&&$!=X&&($=V($));var Un=[X];if(!te){var Hn=t.text.length-2,jn;if(Hn>0&&X)for(var Vn=0;Vn<X.length;++Vn)X[Vn].to==null&&(jn||(jn=[])).push(new Pa(X[Vn].marker,null,null));for(var fa=0;fa<Hn;++fa)Un.push(jn);Un.push($)}return Un}function V(e){for(var t=0;t<e.length;++t){var l=e[t];l.from!=null&&l.from==l.to&&l.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ae(e,t,l){var r=null;if(e.iter(t.line,l.line+1,function(nt){if(nt.markedSpans)for(var Kt=0;Kt<nt.markedSpans.length;++Kt){var pn=nt.markedSpans[Kt].marker;pn.readOnly&&(!r||ee(r,pn)==-1)&&(r||(r=[])).push(pn)}}),!r)return null;for(var g=[{from:t,to:l}],N=0;N<r.length;++N)for(var G=r[N],X=G.find(0),$=0;$<g.length;++$){var te=g[$];if(Xn(te.to,X.from)<0||Xn(te.from,X.to)>0)continue;var Oe=[$,1],Me=Xn(te.from,X.from),ot=Xn(te.to,X.to);(Me<0||!G.inclusiveLeft&&!Me)&&Oe.push({from:te.from,to:X.from}),(ot>0||!G.inclusiveRight&&!ot)&&Oe.push({from:X.to,to:te.to}),g.splice.apply(g,Oe),$+=Oe.length-3}return g}function ge(e){var t=e.markedSpans;if(!t)return;for(var l=0;l<t.length;++l)t[l].marker.detachLine(e);e.markedSpans=null}function ve(e,t){if(!t)return;for(var l=0;l<t.length;++l)t[l].marker.attachLine(e);e.markedSpans=t}function Xe(e){return e.inclusiveLeft?-1:0}function Re(e){return e.inclusiveRight?1:0}function ze(e,t){var l=e.lines.length-t.lines.length;if(l!=0)return l;var r=e.find(),g=t.find(),N=Xn(r.from,g.from)||Xe(e)-Xe(t);if(N)return-N;var G=Xn(r.to,g.to)||Re(e)-Re(t);return G||t.id-e.id}function lt(e,t){var l=va&&e.markedSpans,r;if(l)for(var g=void 0,N=0;N<l.length;++N)g=l[N],g.marker.collapsed&&(t?g.from:g.to)==null&&(!r||ze(r,g.marker)<0)&&(r=g.marker);return r}function At(e){return lt(e,!0)}function Dt(e){return lt(e,!1)}function Ie(e,t){var l=va&&e.markedSpans,r;if(l)for(var g=0;g<l.length;++g){var N=l[g];N.marker.collapsed&&(N.from==null||N.from<t)&&(N.to==null||N.to>t)&&(!r||ze(r,N.marker)<0)&&(r=N.marker)}return r}function ft(e,t,l,r,g){var N=En(e,t),G=va&&N.markedSpans;if(G)for(var X=0;X<G.length;++X){var $=G[X];if(!$.marker.collapsed)continue;var te=$.marker.find(0),Oe=Xn(te.from,l)||Xe($.marker)-Xe(g),Me=Xn(te.to,r)||Re($.marker)-Re(g);if(Oe>=0&&Me<=0||Oe<=0&&Me>=0)continue;if(Oe<=0&&($.marker.inclusiveRight&&g.inclusiveLeft?Xn(te.to,l)>=0:Xn(te.to,l)>0)||Oe>=0&&($.marker.inclusiveRight&&g.inclusiveLeft?Xn(te.from,r)<=0:Xn(te.from,r)<0))return!0}}function $e(e){for(var t;t=At(e);)e=t.find(-1,!0).line;return e}function Ze(e){for(var t;t=Dt(e);)e=t.find(1,!0).line;return e}function dt(e){for(var t,l;t=Dt(e);)e=t.find(1,!0).line,(l||(l=[])).push(e);return l}function Tt(e,t){var l=En(e,t),r=$e(l);return l==r?t:la(r)}function at(e,t){if(t>e.lastLine())return t;var l=En(e,t),r;if(!Ut(e,l))return t;for(;r=Dt(l);)l=r.find(1,!0).line;return la(l)+1}function Ut(e,t){var l=va&&t.markedSpans;if(l)for(var r=void 0,g=0;g<l.length;++g){if(r=l[g],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&Yt(e,t,r))return!0}}function Yt(e,t,l){if(l.to==null){var r=l.marker.find(1,!0);return Yt(e,r.line,Mn(r.line.markedSpans,l.marker))}if(l.marker.inclusiveRight&&l.to==t.text.length)return!0;for(var g=void 0,N=0;N<t.markedSpans.length;++N)if(g=t.markedSpans[N],g.marker.collapsed&&!g.marker.widgetNode&&g.from==l.to&&(g.to==null||g.to!=l.from)&&(g.marker.inclusiveLeft||l.marker.inclusiveRight)&&Yt(e,t,g))return!0}function yn(e){e=$e(e);for(var t=0,l=e.parent,r=0;r<l.lines.length;++r){var g=l.lines[r];if(g==e)break;t+=g.height}for(var N=l.parent;N;l=N,N=l.parent)for(var G=0;G<N.children.length;++G){var X=N.children[G];if(X==l)break;t+=X.height}return t}function In(e){if(e.height==0)return 0;for(var t=e.text.length,l,r=e;l=At(r);){var g=l.find(0,!0);r=g.from.line,t+=g.from.ch-g.to.ch}for(r=e;l=Dt(r);){var N=l.find(0,!0);t-=r.text.length-N.from.ch,r=N.to.line,t+=r.text.length-N.to.ch}return t}function mn(e){var t=e.display,l=e.doc;t.maxLine=En(l,l.first),t.maxLineLength=In(t.maxLine),t.maxLineChanged=!0,l.iter(function(r){var g=In(r);g>t.maxLineLength&&(t.maxLineLength=g,t.maxLine=r)})}var Cn=function(e,t,l){this.text=e,ve(this,t),this.height=l?l(this):1};Cn.prototype.lineNo=function(){return la(this)},he(Cn);function xn(e,t,l,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ge(e),ve(e,l);var g=r?r(e):1;g!=e.height&&ta(e,g)}function Et(e){e.parent=null,ge(e)}var Xt={},Mt={};function gt(e,t){if(!e||/^\s*$/.test(e))return null;var l=t.addModeClass?Mt:Xt;return l[e]||(l[e]=e.replace(/\S+/g,"cm-$&"))}function Sn(e,t){var l=v("span",null,null,L?"padding-right: .1px":null),r={pre:v("pre",[l],"CodeMirror-line"),content:l,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var g=0;g<=(t.rest?t.rest.length:0);g++){var N=g?t.rest[g-1]:t.line,G=void 0;r.pos=0,r.addToken=Nt,qt(e.display.measure)&&(G=An(N,e.doc.direction))&&(r.addToken=Rn(r.addToken,G)),r.map=[];var X=t!=e.display.externalMeasured&&la(N);Bn(N,r,mr(e,N,X)),N.styleClasses&&(N.styleClasses.bgClass&&(r.bgClass=H(N.styleClasses.bgClass,r.bgClass||"")),N.styleClasses.textClass&&(r.textClass=H(N.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(an(e.display.measure))),g==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(L){var $=r.content.lastChild;(/\bcm-tab\b/.test($.className)||$.querySelector&&$.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ue(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=H(r.pre.className,r.textClass||"")),r}function gn(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nt(e,t,l,r,g,N,G){if(!t)return;var X=e.splitSpaces?et(t,e.trailingSpace):t,$=e.cm.state.specialChars,te=!1,Oe;if(!$.test(t))e.col+=t.length,Oe=document.createTextNode(X),e.map.push(e.pos,e.pos+t.length,Oe),F&&D<9&&(te=!0),e.pos+=t.length;else{Oe=document.createDocumentFragment();for(var Me=0;;){$.lastIndex=Me;var ot=$.exec(t),nt=ot?ot.index-Me:t.length-Me;if(nt){var Kt=document.createTextNode(X.slice(Me,Me+nt));F&&D<9?Oe.appendChild(c("span",[Kt])):Oe.appendChild(Kt),e.map.push(e.pos,e.pos+nt,Kt),e.col+=nt,e.pos+=nt}if(!ot)break;Me+=nt+1;var pn=void 0;if(ot[0]==" "){var Ln=e.cm.options.tabSize,Un=Ln-e.col%Ln;pn=Oe.appendChild(c("span",fe(Un),"cm-tab")),pn.setAttribute("role","presentation"),pn.setAttribute("cm-text"," "),e.col+=Un}else ot[0]=="\r"||ot[0]==`
|
|
`?(pn=Oe.appendChild(c("span",ot[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),pn.setAttribute("cm-text",ot[0]),e.col+=1):(pn=e.cm.options.specialCharPlaceholder(ot[0]),pn.setAttribute("cm-text",ot[0]),F&&D<9?Oe.appendChild(c("span",[pn])):Oe.appendChild(pn),e.col+=1);e.map.push(e.pos,e.pos+1,pn),e.pos++}}if(e.trailingSpace=X.charCodeAt(t.length-1)==32,l||r||g||te||N||G){var Hn=l||"";r&&(Hn+=r),g&&(Hn+=g);var jn=c("span",[Oe],Hn,N);if(G)for(var Vn in G)G.hasOwnProperty(Vn)&&Vn!="style"&&Vn!="class"&&jn.setAttribute(Vn,G[Vn]);return e.content.appendChild(jn)}e.content.appendChild(Oe)}function et(e,t){if(e.length>1&&!/ /.test(e))return e;for(var l=t,r="",g=0;g<e.length;g++){var N=e.charAt(g);N==" "&&l&&(g==e.length-1||e.charCodeAt(g+1)==32)&&(N="\xA0"),r+=N,l=N==" "}return r}function Rn(e,t){return function(l,r,g,N,G,X,$){g=g?g+" cm-force-border":"cm-force-border";for(var te=l.pos,Oe=te+r.length;;){for(var Me=void 0,ot=0;ot<t.length&&!(Me=t[ot],Me.to>te&&Me.from<=te);ot++);if(Me.to>=Oe)return e(l,r,g,N,G,X,$);e(l,r.slice(0,Me.to-te),g,N,null,X,$),N=null,r=r.slice(Me.to-te),te=Me.to}}}function $t(e,t,l,r){var g=!r&&l.widgetNode;g&&e.map.push(e.pos,e.pos+t,g),!r&&e.cm.display.input.needsContentAttribute&&(g||(g=e.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",l.id)),g&&(e.cm.display.input.setUneditable(g),e.content.appendChild(g)),e.pos+=t,e.trailingSpace=!1}function Bn(e,t,l){var r=e.markedSpans,g=e.text,N=0;if(!r){for(var G=1;G<l.length;G+=2)t.addToken(t,g.slice(N,N=l[G]),gt(l[G+1],t.cm.options));return}for(var X=g.length,$=0,te=1,Oe="",Me,ot,nt=0,Kt,pn,Ln,Un,Hn;;){if(nt==$){Kt=pn=Ln=ot="",Hn=null,Un=null,nt=Infinity;for(var jn=[],Vn=void 0,fa=0;fa<r.length;++fa){var ia=r[fa],wa=ia.marker;if(wa.type=="bookmark"&&ia.from==$&&wa.widgetNode)jn.push(wa);else if(ia.from<=$&&(ia.to==null||ia.to>$||wa.collapsed&&ia.to==$&&ia.from==$)){if(ia.to!=null&&ia.to!=$&&nt>ia.to&&(nt=ia.to,pn=""),wa.className&&(Kt+=" "+wa.className),wa.css&&(ot=(ot?ot+";":"")+wa.css),wa.startStyle&&ia.from==$&&(Ln+=" "+wa.startStyle),wa.endStyle&&ia.to==nt&&(Vn||(Vn=[])).push(wa.endStyle,ia.to),wa.title&&((Hn||(Hn={})).title=wa.title),wa.attributes)for(var tr in wa.attributes)(Hn||(Hn={}))[tr]=wa.attributes[tr];wa.collapsed&&(!Un||ze(Un.marker,wa)<0)&&(Un=ia)}else ia.from>$&&nt>ia.from&&(nt=ia.from)}if(Vn)for(var jr=0;jr<Vn.length;jr+=2)Vn[jr+1]==nt&&(pn+=" "+Vn[jr]);if(!Un||Un.from==$)for(var gr=0;gr<jn.length;++gr)$t(t,0,jn[gr]);if(Un&&(Un.from||0)==$){if($t(t,(Un.to==null?X+1:Un.to)-$,Un.marker,Un.from==null),Un.to==null)return;Un.to==$&&(Un=!1)}}if($>=X)break;for(var ii=Math.min(X,nt);;){if(Oe){var ti=$+Oe.length;if(!Un){var Pr=ti>ii?Oe.slice(0,ii-$):Oe;t.addToken(t,Pr,Me?Me+Kt:Kt,Ln,$+Pr.length==nt?pn:"",ot,Hn)}if(ti>=ii){Oe=Oe.slice(ii-$),$=ii;break}$=ti,Ln=""}Oe=g.slice(N,N=l[te++]),Me=gt(l[te++],t.cm.options)}}}function jt(e,t,l){this.line=t,this.rest=dt(t),this.size=this.rest?la(Ve(this.rest))-l+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function vn(e,t,l){for(var r=[],g,N=t;N<l;N=g){var G=new jt(e.doc,En(e.doc,N),N);g=N+G.size,r.push(G)}return r}var Dn=null;function tn(e){Dn?Dn.ops.push(e):e.ownsGroup=Dn={ops:[e],delayedCallbacks:[]}}function oa(e){var t=e.delayedCallbacks,l=0;do{for(;l<t.length;l++)t[l].call(null);for(var r=0;r<e.ops.length;r++){var g=e.ops[r];if(g.cursorActivityHandlers)for(;g.cursorActivityCalled<g.cursorActivityHandlers.length;)g.cursorActivityHandlers[g.cursorActivityCalled++].call(null,g.cm)}}while(l<t.length)}function _n(e,t){var l=e.ownsGroup;if(!l)return;try{oa(l)}finally{Dn=null,t(l)}}var hn=null;function bt(e,t){var l=rt(e,t);if(!l.length)return;var r=Array.prototype.slice.call(arguments,2),g;Dn?g=Dn.delayedCallbacks:hn?g=hn:(g=hn=[],setTimeout(He,0));for(var N=function(X){g.push(function(){return l[X].apply(null,r)})},G=0;G<l.length;++G)N(G)}function He(){var e=hn;hn=null;for(var t=0;t<e.length;++t)e[t]()}function Ct(e,t,l,r){for(var g=0;g<t.changes.length;g++){var N=t.changes[g];N=="text"?On(e,t):N=="gutter"?Wn(e,t,l,r):N=="class"?Yn(e,t):N=="widget"&&pa(e,t,r)}t.changes=null}function xt(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),F&&D<8&&(e.node.style.zIndex=2)),e.node}function Vt(e,t){var l=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(l&&(l+=" CodeMirror-linebackground"),t.background)l?t.background.className=l:(t.background.parentNode.removeChild(t.background),t.background=null);else if(l){var r=xt(t);t.background=r.insertBefore(c("div",null,l),r.firstChild),e.display.input.setUneditable(t.background)}}function kn(e,t){var l=e.display.externalMeasured;return l&&l.line==t.line?(e.display.externalMeasured=null,t.measure=l.measure,l.built):Sn(e,t)}function On(e,t){var l=t.text.className,r=kn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Yn(e,t)):l&&(t.text.className=l)}function Yn(e,t){Vt(e,t),t.line.wrapClass?xt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var l=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=l||""}function Wn(e,t,l,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var g=xt(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),g.insertBefore(t.gutterBackground,t.text)}var N=t.line.gutterMarkers;if(e.options.lineNumbers||N){var G=xt(t),X=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(X),G.insertBefore(X,t.text),t.line.gutterClass&&(X.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!N||!N["CodeMirror-linenumbers"])&&(t.lineNumber=X.appendChild(c("div",vr(e.options,l),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),N)for(var $=0;$<e.display.gutterSpecs.length;++$){var te=e.display.gutterSpecs[$].className,Oe=N.hasOwnProperty(te)&&N[te];Oe&&X.appendChild(c("div",[Oe],"CodeMirror-gutter-elt","left: "+r.gutterLeft[te]+"px; width: "+r.gutterWidth[te]+"px"))}}}function pa(e,t,l){t.alignable&&(t.alignable=null);for(var r=T("CodeMirror-linewidget"),g=t.node.firstChild,N=void 0;g;g=N)N=g.nextSibling,r.test(g.className)&&t.node.removeChild(g);ua(e,t,l)}function na(e,t,l,r){var g=kn(e,t);return t.text=t.node=g.pre,g.bgClass&&(t.bgClass=g.bgClass),g.textClass&&(t.textClass=g.textClass),Yn(e,t),Wn(e,t,l,r),ua(e,t,r),t.node}function ua(e,t,l){if(Ba(e,t.line,t,l,!0),t.rest)for(var r=0;r<t.rest.length;r++)Ba(e,t.rest[r],t,l,!1)}function Ba(e,t,l,r,g){if(!t.widgets)return;for(var N=xt(l),G=0,X=t.widgets;G<X.length;++G){var $=X[G],te=c("div",[$.node],"CodeMirror-linewidget"+($.className?" "+$.className:""));$.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Ia($,te,l,r),e.display.input.setUneditable(te),g&&$.above?N.insertBefore(te,l.gutter||l.text):N.appendChild(te),bt($,"redraw")}}function Ia(e,t,l,r){if(e.noHScroll){(l.alignable||(l.alignable=[])).push(t);var g=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(g-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=g+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ja(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var l="position: relative;";e.coverGutter&&(l+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(l+="width: "+t.display.wrapper.clientWidth+"px;"),f(t.display.measure,c("div",[e.node],null,l))}return e.height=e.node.parentNode.offsetHeight}function or(e,t){for(var l=de(t);l!=e.wrapper;l=l.parentNode)if(!l||l.nodeType==1&&l.getAttribute("cm-ignore-events")=="true"||l.parentNode==e.sizer&&l!=e.mover)return!0}function sr(e){return e.lineSpace.offsetTop}function pe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Se(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,c("pre","x","CodeMirror-line-like")),l=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(l.paddingLeft),right:parseInt(l.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function je(e){return se-e.display.nativeBarWidth}function _e(e){return e.display.scroller.clientWidth-je(e)-e.display.barWidth}function q(e){return e.display.scroller.clientHeight-je(e)-e.display.barHeight}function oe(e,t,l){var r=e.options.lineWrapping,g=r&&_e(e);if(!t.measure.heights||r&&t.measure.width!=g){var N=t.measure.heights=[];if(r){t.measure.width=g;for(var G=t.text.firstChild.getClientRects(),X=0;X<G.length-1;X++){var $=G[X],te=G[X+1];Math.abs($.bottom-te.bottom)>2&&N.push(($.bottom+te.top)/2-l.top)}}N.push(l.bottom-l.top)}}function ne(e,t,l){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var g=0;g<e.rest.length;g++)if(la(e.rest[g])>l)return{map:e.measure.maps[g],cache:e.measure.caches[g],before:!0}}function ye(e,t){t=$e(t);var l=la(t),r=e.display.externalMeasured=new jt(e.doc,t,l);r.lineN=l;var g=r.built=Sn(e,r);return r.text=g.pre,f(e.display.lineMeasure,g.pre),r}function Te(e,t,l,r){return Je(e,we(e,t),l,r)}function We(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Qa(e,t)];var l=e.display.externalMeasured;if(l&&t>=l.lineN&&t<l.lineN+l.size)return l}function we(e,t){var l=la(t),r=We(e,l);r&&!r.text?r=null:r&&r.changes&&(Ct(e,r,l,ra(e)),e.curOp.forceUpdate=!0),r||(r=ye(e,t));var g=ne(r,t,l);return{line:t,view:r,rect:null,map:g.map,cache:g.cache,before:g.before,hasHeights:!1}}function Je(e,t,l,r,g){t.before&&(l=-1);var N=l+(r||""),G;return t.cache.hasOwnProperty(N)?G=t.cache[N]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(oe(e,t.view,t.rect),t.hasHeights=!0),G=Pn(e,t,l,r),G.bogus||(t.cache[N]=G)),{left:G.left,right:G.right,top:g?G.rtop:G.top,bottom:g?G.rbottom:G.bottom}}var St={left:0,right:0,top:0,bottom:0};function Wt(e,t,l){for(var r,g,N,G,X,$,te=0;te<e.length;te+=3)if(X=e[te],$=e[te+1],t<X?(g=0,N=1,G="left"):t<$?(g=t-X,N=g+1):(te==e.length-3||t==$&&e[te+3]>t)&&(N=$-X,g=N-1,t>=$&&(G="right")),g!=null){if(r=e[te+2],X==$&&l==(r.insertLeft?"left":"right")&&(G=l),l=="left"&&g==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)r=e[(te-=3)+2],G="left";if(l=="right"&&g==$-X)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)r=e[(te+=3)+2],G="right";break}return{node:r,start:g,end:N,collapse:G,coverStart:X,coverEnd:$}}function Zt(e,t){var l=St;if(t=="left")for(var r=0;r<e.length&&!((l=e[r]).left!=l.right);r++);else for(var g=e.length-1;g>=0&&!((l=e[g]).left!=l.right);g--);return l}function Pn(e,t,l,r){var g=Wt(t.map,l,r),N=g.node,G=g.start,X=g.end,$=g.collapse,te;if(N.nodeType==3){for(var Oe=0;Oe<4;Oe++){for(;G&&wt(t.line.text.charAt(g.coverStart+G));)--G;for(;g.coverStart+X<g.coverEnd&&wt(t.line.text.charAt(g.coverStart+X));)++X;if(F&&D<9&&G==0&&X==g.coverEnd-g.coverStart?te=N.parentNode.getBoundingClientRect():te=Zt(p(N,G,X).getClientRects(),r),te.left||te.right||G==0)break;X=G,G=G-1,$="right"}F&&D<11&&(te=Nn(e.display.measure,te))}else{G>0&&($=r="right");var Me;e.options.lineWrapping&&(Me=N.getClientRects()).length>1?te=Me[r=="right"?Me.length-1:0]:te=N.getBoundingClientRect()}if(F&&D<9&&!G&&(!te||!te.left&&!te.right)){var ot=N.parentNode.getClientRects()[0];ot?te={left:ot.left,right:ot.left+Sa(e.display),top:ot.top,bottom:ot.bottom}:te=St}for(var nt=te.top-t.rect.top,Kt=te.bottom-t.rect.top,pn=(nt+Kt)/2,Ln=t.view.measure.heights,Un=0;Un<Ln.length-1&&!(pn<Ln[Un]);Un++);var Hn=Un?Ln[Un-1]:0,jn=Ln[Un],Vn={left:($=="right"?te.right:te.left)-t.rect.left,right:($=="left"?te.left:te.right)-t.rect.left,top:Hn,bottom:jn};return!te.left&&!te.right&&(Vn.bogus=!0),e.options.singleCursorHeightPerLine||(Vn.rtop=nt,Vn.rbottom=Kt),Vn}function Nn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!be(e))return t;var l=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*l,right:t.right*l,top:t.top*r,bottom:t.bottom*r}}function qn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Qn(e){e.display.externalMeasure=null,y(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)qn(e.display.view[t])}function da(e){Qn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ma(){return b&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function aa(){return b&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ca(e){var t=0;if(e.widgets)for(var l=0;l<e.widgets.length;++l)e.widgets[l].above&&(t+=ja(e.widgets[l]));return t}function ya(e,t,l,r,g){if(!g){var N=ca(t);l.top+=N,l.bottom+=N}if(r=="line")return l;r||(r="local");var G=yn(t);if(r=="local"?G+=sr(e.display):G-=e.display.viewOffset,r=="page"||r=="window"){var X=e.display.lineSpace.getBoundingClientRect();G+=X.top+(r=="window"?0:aa());var $=X.left+(r=="window"?0:ma());l.left+=$,l.right+=$}return l.top+=G,l.bottom+=G,l}function en(e,t,l){if(l=="div")return t;var r=t.left,g=t.top;if(l=="page")r-=ma(),g-=aa();else if(l=="local"||!l){var N=e.display.sizer.getBoundingClientRect();r+=N.left,g+=N.top}var G=e.display.lineSpace.getBoundingClientRect();return{left:r-G.left,top:g-G.top}}function Ht(e,t,l,r,g){return r||(r=En(e.doc,t.line)),ya(e,r,Te(e,r,t.ch,g),l)}function dn(e,t,l,r,g,N){r=r||En(e.doc,t.line),g||(g=we(e,r));function G(Kt,pn){var Ln=Je(e,g,Kt,pn?"right":"left",N);return pn?Ln.left=Ln.right:Ln.right=Ln.left,ya(e,r,Ln,l)}var X=An(r,e.doc.direction),$=t.ch,te=t.sticky;if($>=r.text.length?($=r.text.length,te="before"):$<=0&&($=0,te="after"),!X)return G(te=="before"?$-1:$,te=="before");function Oe(Kt,pn,Ln){var Un=X[pn],Hn=Un.level==1;return G(Ln?Kt-1:Kt,Hn!=Ln)}var Me=Ye(X,$,te),ot=sn,nt=Oe($,Me,te=="before");return ot!=null&&(nt.other=Oe($,ot,te!="before")),nt}function It(e,t){var l=0;t=Kn(e.doc,t),e.options.lineWrapping||(l=Sa(e.display)*t.ch);var r=En(e.doc,t.line),g=yn(r)+sr(e.display);return{left:l,right:l,top:g,bottom:g+r.height}}function kt(e,t,l,r,g){var N=rn(e,t,l);return N.xRel=g,r&&(N.outside=r),N}function ea(e,t,l){var r=e.doc;if(l+=e.display.viewOffset,l<0)return kt(r.first,0,null,-1,-1);var g=Ra(r,l),N=r.first+r.size-1;if(g>N)return kt(r.first+r.size-1,En(r,N).text.length,null,1,1);t<0&&(t=0);for(var G=En(r,g);;){var X=Va(e,G,g,t,l),$=Ie(G,X.ch+(X.xRel>0||X.outside>0?1:0));if(!$)return X;var te=$.find(1);if(te.line==g)return te;G=En(r,g=te.line)}}function ba(e,t,l,r){r-=ca(t);var g=t.text.length,N=bn(function(G){return Je(e,l,G-1).bottom<=r},g,0);return g=bn(function(G){return Je(e,l,G).top>r},N,g),{begin:N,end:g}}function Gn(e,t,l,r){l||(l=we(e,t));var g=ya(e,t,Je(e,l,r),"line").top;return ba(e,t,l,g)}function Oa(e,t,l,r){return e.bottom<=l?!1:e.top>l?!0:(r?e.left:e.right)>t}function Va(e,t,l,r,g){g-=yn(t);var N=we(e,t),G=ca(t),X=0,$=t.text.length,te=!0,Oe=An(t,e.doc.direction);if(Oe){var Me=(e.options.lineWrapping?ka:Ca)(e,t,l,N,Oe,r,g);te=Me.level!=1,X=te?Me.from:Me.to-1,$=te?Me.to:Me.from-1}var ot=null,nt=null,Kt=bn(function(fa){var ia=Je(e,N,fa);return ia.top+=G,ia.bottom+=G,Oa(ia,r,g,!1)?(ia.top<=g&&ia.left<=r&&(ot=fa,nt=ia),!0):!1},X,$),pn,Ln,Un=!1;if(nt){var Hn=r-nt.left<nt.right-r,jn=Hn==te;Kt=ot+(jn?0:1),Ln=jn?"after":"before",pn=Hn?nt.left:nt.right}else{!te&&(Kt==$||Kt==X)&&Kt++,Ln=Kt==0?"after":Kt==t.text.length?"before":Je(e,N,Kt-(te?1:0)).bottom+G<=g==te?"after":"before";var Vn=dn(e,rn(l,Kt,Ln),"line",t,N);pn=Vn.left,Un=g<Vn.top?-1:g>=Vn.bottom?1:0}return Kt=yt(t.text,Kt,1),kt(l,Kt,Ln,Un,r-pn)}function Ca(e,t,l,r,g,N,G){var X=bn(function(Me){var ot=g[Me],nt=ot.level!=1;return Oa(dn(e,rn(l,nt?ot.to:ot.from,nt?"before":"after"),"line",t,r),N,G,!0)},0,g.length-1),$=g[X];if(X>0){var te=$.level!=1,Oe=dn(e,rn(l,te?$.from:$.to,te?"after":"before"),"line",t,r);Oa(Oe,N,G,!0)&&Oe.top>G&&($=g[X-1])}return $}function ka(e,t,l,r,g,N,G){var X=ba(e,t,r,G),$=X.begin,te=X.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var Oe=null,Me=null,ot=0;ot<g.length;ot++){var nt=g[ot];if(nt.from>=te||nt.to<=$)continue;var Kt=nt.level!=1,pn=Je(e,r,Kt?Math.min(te,nt.to)-1:Math.max($,nt.from)).right,Ln=pn<N?N-pn+1e9:pn-N;(!Oe||Me>Ln)&&(Oe=nt,Me=Ln)}return Oe||(Oe=g[g.length-1]),Oe.from<$&&(Oe={from:$,to:Oe.to,level:Oe.level}),Oe.to>te&&(Oe={from:Oe.from,to:te,level:Oe.level}),Oe}var La;function Da(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(La==null){La=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)La.appendChild(document.createTextNode("x")),La.appendChild(c("br"));La.appendChild(document.createTextNode("x"))}f(e.measure,La);var l=La.offsetHeight/50;return l>3&&(e.cachedTextHeight=l),y(e.measure),l||1}function Sa(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),l=c("pre",[t],"CodeMirror-line-like");f(e.measure,l);var r=t.getBoundingClientRect(),g=(r.right-r.left)/10;return g>2&&(e.cachedCharWidth=g),g||10}function ra(e){for(var t=e.display,l={},r={},g=t.gutters.clientLeft,N=t.gutters.firstChild,G=0;N;N=N.nextSibling,++G){var X=e.display.gutterSpecs[G].className;l[X]=N.offsetLeft+N.clientLeft+g,r[X]=N.clientWidth}return{fixedPos:lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:l,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qr(e){var t=Da(e.display),l=e.options.lineWrapping,r=l&&Math.max(5,e.display.scroller.clientWidth/Sa(e.display)-3);return function(g){if(Ut(e.doc,g))return 0;var N=0;if(g.widgets)for(var G=0;G<g.widgets.length;G++)g.widgets[G].height&&(N+=g.widgets[G].height);return l?N+(Math.ceil(g.text.length/r)||1)*t:N+t}}function kr(e){var t=e.doc,l=Qr(e);t.iter(function(r){var g=l(r);g!=r.height&&ta(r,g)})}function Or(e,t,l,r){var g=e.display;if(!l&&de(t).getAttribute("cm-not-content")=="true")return null;var N,G,X=g.lineSpace.getBoundingClientRect();try{N=t.clientX-X.left,G=t.clientY-X.top}catch(Me){return null}var $=ea(e,N,G),te;if(r&&$.xRel>0&&(te=En(e.doc,$.line).text).length==$.ch){var Oe=K(te,te.length,e.options.tabSize)-te.length;$=rn($.line,Math.max(0,Math.round((N-Se(e.display).left)/Sa(e.display))-Oe))}return $}function Qa(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var l=e.display.view,r=0;r<l.length;r++)if(t-=l[r].size,t<0)return r}function Ha(e,t,l,r){t==null&&(t=e.doc.first),l==null&&(l=e.doc.first+e.doc.size),r||(r=0);var g=e.display;if(r&&l<g.viewTo&&(g.updateLineNumbers==null||g.updateLineNumbers>t)&&(g.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=g.viewTo)va&&Tt(e.doc,t)<g.viewTo&&Ja(e);else if(l<=g.viewFrom)va&&at(e.doc,l+r)>g.viewFrom?Ja(e):(g.viewFrom+=r,g.viewTo+=r);else if(t<=g.viewFrom&&l>=g.viewTo)Ja(e);else if(t<=g.viewFrom){var N=Nr(e,l,l+r,1);N?(g.view=g.view.slice(N.index),g.viewFrom=N.lineN,g.viewTo+=r):Ja(e)}else if(l>=g.viewTo){var G=Nr(e,t,t,-1);G?(g.view=g.view.slice(0,G.index),g.viewTo=G.lineN):Ja(e)}else{var X=Nr(e,t,t,-1),$=Nr(e,l,l+r,1);X&&$?(g.view=g.view.slice(0,X.index).concat(vn(e,X.lineN,$.lineN)).concat(g.view.slice($.index)),g.viewTo+=r):Ja(e)}var te=g.externalMeasured;te&&(l<te.lineN?te.lineN+=r:t<te.lineN+te.size&&(g.externalMeasured=null))}function za(e,t,l){e.curOp.viewChanged=!0;var r=e.display,g=e.display.externalMeasured;if(g&&t>=g.lineN&&t<g.lineN+g.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var N=r.view[Qa(e,t)];if(N.node==null)return;var G=N.changes||(N.changes=[]);ee(G,l)==-1&&G.push(l)}function Ja(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Nr(e,t,l,r){var g=Qa(e,t),N,G=e.display.view;if(!va||l==e.doc.first+e.doc.size)return{index:g,lineN:l};for(var X=e.display.viewFrom,$=0;$<g;$++)X+=G[$].size;if(X!=t){if(r>0){if(g==G.length-1)return null;N=X+G[g].size-t,g++}else N=X-t;t+=N,l+=N}for(;Tt(e.doc,l)!=l;){if(g==(r<0?0:G.length-1))return null;l+=r*G[g-(r<0?1:0)].size,g+=r}return{index:g,lineN:l}}function fi(e,t,l){var r=e.display,g=r.view;g.length==0||t>=r.viewTo||l<=r.viewFrom?(r.view=vn(e,t,l),r.viewFrom=t):(r.viewFrom>t?r.view=vn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Qa(e,t))),r.viewFrom=t,r.viewTo<l?r.view=r.view.concat(vn(e,r.viewTo,l)):r.viewTo>l&&(r.view=r.view.slice(0,Qa(e,l)))),r.viewTo=l}function si(e){for(var t=e.display.view,l=0,r=0;r<t.length;r++){var g=t[r];!g.hidden&&(!g.node||g.changes)&&++l}return l}function Wa(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Jr(e,t){t===void 0&&(t=!0);for(var l=e.doc,r={},g=r.cursors=document.createDocumentFragment(),N=r.selection=document.createDocumentFragment(),G=0;G<l.sel.ranges.length;G++){if(!t&&G==l.sel.primIndex)continue;var X=l.sel.ranges[G];if(X.from().line>=e.display.viewTo||X.to().line<e.display.viewFrom)continue;var $=X.empty();($||e.options.showCursorWhenSelecting)&&Zr(e,X.head,g),$||Fa(e,X,N)}return r}function Zr(e,t,l){var r=dn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),g=l.appendChild(c("div","\xA0","CodeMirror-cursor"));if(g.style.left=r.left+"px",g.style.top=r.top+"px",g.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var N=l.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));N.style.display="",N.style.left=r.other.left+"px",N.style.top=r.other.top+"px",N.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Ya(e,t){return e.top-t.top||e.left-t.left}function Fa(e,t,l){var r=e.display,g=e.doc,N=document.createDocumentFragment(),G=Se(e.display),X=G.left,$=Math.max(r.sizerWidth,_e(e)-r.sizer.offsetLeft)-G.right,te=g.direction=="ltr";function Oe(jn,Vn,fa,ia){Vn<0&&(Vn=0),Vn=Math.round(Vn),ia=Math.round(ia),N.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+jn+`px;
|
|
top: `+Vn+"px; width: "+(fa==null?$-jn:fa)+`px;
|
|
height: `+(ia-Vn)+"px"))}function Me(jn,Vn,fa){var ia=En(g,jn),wa=ia.text.length,tr,jr;function gr(Pr,ni){return Ht(e,rn(jn,Pr),"div",ia,ni)}function ii(Pr,ni,zr){var Ir=Gn(e,ia,null,Pr),Lr=ni=="ltr"==(zr=="after")?"left":"right",Er=zr=="after"?Ir.begin:Ir.end-(/\s/.test(ia.text.charAt(Ir.end-1))?2:1);return gr(Er,Lr)[Lr]}var ti=An(ia,g.direction);return un(ti,Vn||0,fa==null?wa:fa,function(Pr,ni,zr,Ir){var Lr=zr=="ltr",Er=gr(Pr,Lr?"left":"right"),ai=gr(ni-1,Lr?"right":"left"),wo=Vn==null&&Pr==0,to=fa==null&&ni==wa,Vr=Ir==0,Li=!ti||Ir==ti.length-1;if(ai.top-Er.top<=3){var Fr=(te?wo:to)&&Vr,ms=(te?to:wo)&&Li,zi=Fr?X:(Lr?Er:ai).left,lo=ms?$:(Lr?ai:Er).right;Oe(zi,Er.top,lo-zi,Er.bottom)}else{var uo,Xr,So,gs;Lr?(uo=te&&wo&&Vr?X:Er.left,Xr=te?$:ii(Pr,zr,"before"),So=te?X:ii(ni,zr,"after"),gs=te&&to&&Li?$:ai.right):(uo=te?ii(Pr,zr,"before"):X,Xr=!te&&wo&&Vr?$:Er.right,So=!te&&to&&Li?X:ai.left,gs=te?ii(ni,zr,"after"):$),Oe(uo,Er.top,Xr-uo,Er.bottom),Er.bottom<ai.top&&Oe(X,Er.bottom,null,ai.top),Oe(So,ai.top,gs-So,ai.bottom)}(!tr||Ya(Er,tr)<0)&&(tr=Er),Ya(ai,tr)<0&&(tr=ai),(!jr||Ya(Er,jr)<0)&&(jr=Er),Ya(ai,jr)<0&&(jr=ai)}),{start:tr,end:jr}}var ot=t.from(),nt=t.to();if(ot.line==nt.line)Me(ot.line,ot.ch,nt.ch);else{var Kt=En(g,ot.line),pn=En(g,nt.line),Ln=$e(Kt)==$e(pn),Un=Me(ot.line,ot.ch,Ln?Kt.text.length+1:null).end,Hn=Me(nt.line,Ln?0:null,nt.ch).start;Ln&&(Un.top<Hn.top-2?(Oe(Un.right,Un.top,null,Un.bottom),Oe(X,Hn.top,Hn.left,Hn.bottom)):Oe(Un.right,Un.top,Hn.left-Un.right,Un.bottom)),Un.bottom<Hn.top&&Oe(X,Un.bottom,null,Hn.top)}l.appendChild(N)}function yr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var l=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Oi(e),t.cursorDiv.style.visibility=(l=!l)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Mi(e){e.state.focused||(e.display.input.focus(),li(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Oi(e))},100)}function li(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ue(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),L&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),yr(e)}function Oi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ue(e,"blur",e,t),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ci(e){for(var t=e.display,l=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var g=t.view[r],N=e.options.lineWrapping,G=void 0,X=0;if(g.hidden)continue;if(F&&D<8){var $=g.node.offsetTop+g.node.offsetHeight;G=$-l,l=$}else{var te=g.node.getBoundingClientRect();G=te.bottom-te.top,!N&&g.text.firstChild&&(X=g.text.firstChild.getBoundingClientRect().right-te.left-1)}var Oe=g.line.height-G;if((Oe>.005||Oe<-.005)&&(ta(g.line,G),wi(g.line),g.rest))for(var Me=0;Me<g.rest.length;Me++)wi(g.rest[Me]);if(X>e.display.sizerWidth){var ot=Math.ceil(X/Sa(e.display));ot>e.display.maxLineLength&&(e.display.maxLineLength=ot,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}function wi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var l=e.widgets[t],r=l.node.parentNode;r&&(l.height=r.offsetHeight)}}function Ii(e,t,l){var r=l&&l.top!=null?Math.max(0,l.top):e.scroller.scrollTop;r=Math.floor(r-sr(e));var g=l&&l.bottom!=null?l.bottom:r+e.wrapper.clientHeight,N=Ra(t,r),G=Ra(t,g);if(l&&l.ensure){var X=l.ensure.from.line,$=l.ensure.to.line;X<N?(N=X,G=Ra(t,yn(En(t,X))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=G&&(N=Ra(t,yn(En(t,$))-e.wrapper.clientHeight),G=$)}return{from:N,to:Math.max(G,N+1)}}function co(e,t){if(ut(e,"scrollCursorIntoView"))return;var l=e.display,r=l.sizer.getBoundingClientRect(),g=null;if(t.top+r.top<0?g=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),g!=null&&!o){var N=c("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-l.viewOffset-sr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+je(e)+l.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(N),N.scrollIntoView(g),e.display.lineSpace.removeChild(N)}}function Ro(e,t,l,r){r==null&&(r=0);var g;!e.options.lineWrapping&&t==l&&(t=t.ch?rn(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,l=t.sticky=="before"?rn(t.line,t.ch+1,"before"):t);for(var N=0;N<5;N++){var G=!1,X=dn(e,t),$=!l||l==t?X:dn(e,l);g={left:Math.min(X.left,$.left),top:Math.min(X.top,$.top)-r,right:Math.max(X.left,$.left),bottom:Math.max(X.bottom,$.bottom)+r};var te=Si(e,g),Oe=e.doc.scrollTop,Me=e.doc.scrollLeft;if(te.scrollTop!=null&&(Di(e,te.scrollTop),Math.abs(e.doc.scrollTop-Oe)>1&&(G=!0)),te.scrollLeft!=null&&(Mr(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-Me)>1&&(G=!0)),!G)break}return g}function Gi(e,t){var l=Si(e,t);l.scrollTop!=null&&Di(e,l.scrollTop),l.scrollLeft!=null&&Mr(e,l.scrollLeft)}function Si(e,t){var l=e.display,r=Da(e.display);t.top<0&&(t.top=0);var g=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:l.scroller.scrollTop,N=q(e),G={};t.bottom-t.top>N&&(t.bottom=t.top+N);var X=e.doc.height+pe(l),$=t.top<r,te=t.bottom>X-r;if(t.top<g)G.scrollTop=$?0:t.top;else if(t.bottom>g+N){var Oe=Math.min(t.top,(te?X:t.bottom)-N);Oe!=g&&(G.scrollTop=Oe)}var Me=e.options.fixedGutter?0:l.gutters.offsetWidth,ot=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:l.scroller.scrollLeft-Me,nt=_e(e)-l.gutters.offsetWidth,Kt=t.right-t.left>nt;return Kt&&(t.right=t.left+nt),t.left<10?G.scrollLeft=0:t.left<ot?G.scrollLeft=Math.max(0,t.left+Me-(Kt?0:10)):t.right>nt+ot-3&&(G.scrollLeft=t.right+(Kt?0:10)-nt),G}function Vi(e,t){if(t==null)return;Yi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _i(e){Yi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ri(e,t,l){(t!=null||l!=null)&&Yi(e),t!=null&&(e.curOp.scrollLeft=t),l!=null&&(e.curOp.scrollTop=l)}function fo(e,t){Yi(e),e.curOp.scrollToPos=t}function Yi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var l=It(e,t.from),r=It(e,t.to);Ai(e,l,r,t.margin)}}function Ai(e,t,l,r){var g=Si(e,{left:Math.min(t.left,l.left),top:Math.min(t.top,l.top)-r,right:Math.max(t.right,l.right),bottom:Math.max(t.bottom,l.bottom)+r});Ri(e,g.scrollLeft,g.scrollTop)}function Di(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;I||Ui(e,{top:t}),yi(e,t,!0),I&&Ui(e),Ni(e,100)}function yi(e,t,l){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!l)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Mr(e,t,l,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(l?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Ta(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function hi(e){var t=e.display,l=t.gutters.offsetWidth,r=Math.round(e.doc.height+pe(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?l:0,docHeight:r,scrollHeight:r+je(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:l}}var pi=function(e,t,l){this.cm=l;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=g.tabIndex=-1,e(r),e(g),Pe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Pe(g,"scroll",function(){g.clientWidth&&t(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,F&&D<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,l=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(l){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var g=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+g)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=l?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var N=e.viewWidth-e.barLeft-(l?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+N)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:l?r:0,bottom:t?r:0}},pi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pi.prototype.zeroWidthHack=function(){var e=i&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Y,this.disableVert=new Y},pi.prototype.enableZeroWidthBar=function(e,t,l){e.style.pointerEvents="auto";function r(){var g=e.getBoundingClientRect(),N=l=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);N!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},pi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bi=function(){};bi.prototype.update=function(){return{bottom:0,right:0}},bi.prototype.setScrollLeft=function(){},bi.prototype.setScrollTop=function(){},bi.prototype.clear=function(){};function mi(e,t){t||(t=hi(e));var l=e.display.barWidth,r=e.display.barHeight;Xi(e,t);for(var g=0;g<4&&l!=e.display.barWidth||r!=e.display.barHeight;g++)l!=e.display.barWidth&&e.options.lineWrapping&&Ci(e),Xi(e,hi(e)),l=e.display.barWidth,r=e.display.barHeight}function Xi(e,t){var l=e.display,r=l.scrollbars.update(t);l.sizer.style.paddingRight=(l.barWidth=r.right)+"px",l.sizer.style.paddingBottom=(l.barHeight=r.bottom)+"px",l.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(l.scrollbarFiller.style.display="block",l.scrollbarFiller.style.height=r.bottom+"px",l.scrollbarFiller.style.width=r.right+"px"):l.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(l.gutterFiller.style.display="block",l.gutterFiller.style.height=r.bottom+"px",l.gutterFiller.style.width=t.gutterWidth+"px"):l.gutterFiller.style.display=""}var $i={native:pi,null:bi};function Qi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $i[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Pe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,l){l=="horizontal"?Mr(e,t):Di(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var ki=0;function ui(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:++ki},tn(e.curOp)}function Ei(e){var t=e.curOp;t&&_n(t,function(l){for(var r=0;r<l.ops.length;r++)l.ops[r].cm.curOp=null;ao(l)})}function ao(e){for(var t=e.ops,l=0;l<t.length;l++)Ao(t[l]);for(var r=0;r<t.length;r++)Do(t[r]);for(var g=0;g<t.length;g++)ho(t[g]);for(var N=0;N<t.length;N++)ro(t[N]);for(var G=0;G<t.length;G++)po(t[G])}function Ao(e){var t=e.cm,l=t.display;io(t),e.updateMaxLine&&mn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<l.viewFrom||e.scrollToPos.to.line>=l.viewTo)||l.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new qr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&xi(e.cm,e.update)}function ho(e){var t=e.cm,l=t.display;e.updatedDisplay&&Ci(t),e.barMeasure=hi(t),l.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Te(t,l.maxLine,l.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(l.scroller.clientWidth,l.sizer.offsetLeft+e.adjustWidthTo+je(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,l.sizer.offsetLeft+e.adjustWidthTo-_e(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=l.input.prepareSelection())}function ro(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Mr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var l=e.focus&&e.focus==k();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,l),(e.updatedDisplay||e.startHeight!=t.doc.height)&&mi(t,e.barMeasure),e.updatedDisplay&&Na(t,e.barMeasure),e.selectionChanged&&yr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),l&&Mi(e.cm)}function po(e){var t=e.cm,l=t.display,r=t.doc;if(e.updatedDisplay&&Ji(t,e.update),l.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(l.wheelStartX=l.wheelStartY=null),e.scrollTop!=null&&yi(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Mr(t,e.scrollLeft,!0,!0),e.scrollToPos){var g=Ro(t,Kn(r,e.scrollToPos.from),Kn(r,e.scrollToPos.to),e.scrollToPos.margin);co(t,g)}var N=e.maybeHiddenMarkers,G=e.maybeUnhiddenMarkers;if(N)for(var X=0;X<N.length;++X)N[X].lines.length||Ue(N[X],"hide");if(G)for(var $=0;$<G.length;++$)G[$].lines.length&&Ue(G[$],"unhide");l.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ue(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wr(e,t){if(e.curOp)return t();ui(e);try{return t()}finally{Ei(e)}}function dr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ui(e);try{return t.apply(e,arguments)}finally{Ei(e)}}}function Ar(e){return function(){if(this.curOp)return e.apply(this,arguments);ui(this);try{return e.apply(this,arguments)}finally{Ei(this)}}}function cr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ui(t);try{return e.apply(this,arguments)}finally{Ei(t)}}}function Ni(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,j(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var l=+new Date+e.options.workTime,r=nr(e,t.highlightFrontier),g=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(N){if(r.line>=e.display.viewFrom){var G=N.styles,X=N.text.length>e.options.maxHighlightLength?cn(t.mode,r.state):null,$=Tr(e,N,r,!0);X&&(r.state=X),N.styles=$.styles;var te=N.styleClasses,Oe=$.classes;Oe?N.styleClasses=Oe:te&&(N.styleClasses=null);for(var Me=!G||G.length!=N.styles.length||te!=Oe&&(!te||!Oe||te.bgClass!=Oe.bgClass||te.textClass!=Oe.textClass),ot=0;!Me&&ot<G.length;++ot)Me=G[ot]!=N.styles[ot];Me&&g.push(r.line),N.stateAfter=r.save(),r.nextLine()}else N.text.length<=e.options.maxHighlightLength&&Br(e,N.text,r),N.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>l)return Ni(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),g.length&&Wr(e,function(){for(var N=0;N<g.length;N++)za(e,g[N],"text")})}var qr=function(e,t,l){var r=e.display;this.viewport=t,this.visible=Ii(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=_e(e),this.force=l,this.dims=ra(e),this.events=[]};qr.prototype.signal=function(e,t){ce(e,t)&&this.events.push(arguments)},qr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ue.apply(null,this.events[e])};function io(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=je(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=je(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=k();if(!t||!E(e.display.lineDiv,t))return null;var l={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&E(e.display.lineDiv,r.anchorNode)&&(l.anchorNode=r.anchorNode,l.anchorOffset=r.anchorOffset,l.focusNode=r.focusNode,l.focusOffset=r.focusOffset)}return l}function so(e){if(!e||!e.activeElt||e.activeElt==k())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode)){var t=window.getSelection(),l=document.createRange();l.setEnd(e.anchorNode,e.anchorOffset),l.collapse(!1),t.removeAllRanges(),t.addRange(l),t.extend(e.focusNode,e.focusOffset)}}function xi(e,t){var l=e.display,r=e.doc;if(t.editorIsHidden)return Ja(e),!1;if(!t.force&&t.visible.from>=l.viewFrom&&t.visible.to<=l.viewTo&&(l.updateLineNumbers==null||l.updateLineNumbers>=l.viewTo)&&l.renderedView==l.view&&si(e)==0)return!1;rr(e)&&(Ja(e),t.dims=ra(e));var g=r.first+r.size,N=Math.max(t.visible.from-e.options.viewportMargin,r.first),G=Math.min(g,t.visible.to+e.options.viewportMargin);l.viewFrom<N&&N-l.viewFrom<20&&(N=Math.max(r.first,l.viewFrom)),l.viewTo>G&&l.viewTo-G<20&&(G=Math.min(g,l.viewTo)),va&&(N=Tt(e.doc,N),G=at(e.doc,G));var X=N!=l.viewFrom||G!=l.viewTo||l.lastWrapHeight!=t.wrapperHeight||l.lastWrapWidth!=t.wrapperWidth;fi(e,N,G),l.viewOffset=yn(En(e.doc,l.viewFrom)),e.display.mover.style.top=l.viewOffset+"px";var $=si(e);if(!X&&$==0&&!t.force&&l.renderedView==l.view&&(l.updateLineNumbers==null||l.updateLineNumbers>=l.viewTo))return!1;var te=oo(e);return $>4&&(l.lineDiv.style.display="none"),go(e,l.updateLineNumbers,t.dims),$>4&&(l.lineDiv.style.display=""),l.renderedView=l.view,so(te),y(l.cursorDiv),y(l.selectionDiv),l.gutters.style.height=l.sizer.style.minHeight=0,X&&(l.lastWrapHeight=t.wrapperHeight,l.lastWrapWidth=t.wrapperWidth,Ni(e,400)),l.updateLineNumbers=null,!0}function Ji(e,t){for(var l=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==_e(e)){if(l&&l.top!=null&&(l={top:Math.min(e.doc.height+pe(e.display)-q(e),l.top)}),t.visible=Ii(e.display,e.doc,l),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ii(e.display,e.doc,l));if(!xi(e,t))break;Ci(e);var g=hi(e);Wa(e),mi(e,g),Na(e,g),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 Ui(e,t){var l=new qr(e,t);if(xi(e,l)){Ci(e),Ji(e,l);var r=hi(e);Wa(e),mi(e,r),Na(e,r),l.finish()}}function go(e,t,l){var r=e.display,g=e.options.lineNumbers,N=r.lineDiv,G=N.firstChild;function X(Kt){var pn=Kt.nextSibling;return L&&i&&e.display.currentWheelTarget==Kt?Kt.style.display="none":Kt.parentNode.removeChild(Kt),pn}for(var $=r.view,te=r.viewFrom,Oe=0;Oe<$.length;Oe++){var Me=$[Oe];if(!Me.hidden)if(!Me.node||Me.node.parentNode!=N){var ot=na(e,Me,te,l);N.insertBefore(ot,G)}else{for(;G!=Me.node;)G=X(G);var nt=g&&t!=null&&t<=te&&Me.lineNumber;Me.changes&&(ee(Me.changes,"gutter")>-1&&(nt=!1),Ct(e,Me,te,l)),nt&&(y(Me.lineNumber),Me.lineNumber.appendChild(document.createTextNode(vr(e.options,te)))),G=Me.node.nextSibling}te+=Me.size}for(;G;)G=X(G)}function Zi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Na(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+je(e)+"px"}function Ta(e){var t=e.display,l=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,g=t.gutters.offsetWidth,N=r+"px",G=0;G<l.length;G++)if(!l[G].hidden){e.options.fixedGutter&&(l[G].gutter&&(l[G].gutter.style.left=N),l[G].gutterBackground&&(l[G].gutterBackground.style.left=N));var X=l[G].alignable;if(X)for(var $=0;$<X.length;$++)X[$].style.left=N}e.options.fixedGutter&&(t.gutters.style.left=r+g+"px")}function rr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,l=vr(e.options,t.first+t.size-1),r=e.display;if(l.length!=r.lineNumChars){var g=r.measure.appendChild(c("div",[c("div",l)],"CodeMirror-linenumber CodeMirror-gutter-elt")),N=g.firstChild.offsetWidth,G=g.offsetWidth-N;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(N,r.lineGutter.offsetWidth-G)+1,r.lineNumWidth=r.lineNumInnerWidth+G,r.lineNumChars=r.lineNumInnerWidth?l.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Zi(e.display),!0}return!1}function Ur(e,t){for(var l=[],r=!1,g=0;g<e.length;g++){var N=e[g],G=null;if(typeof N!="string"&&(G=N.style,N=N.className),N=="CodeMirror-linenumbers")if(t)r=!0;else continue;l.push({className:N,style:G})}return t&&!r&&l.push({className:"CodeMirror-linenumbers",style:null}),l}function Pi(e){var t=e.gutters,l=e.gutterSpecs;y(t),e.lineGutter=null;for(var r=0;r<l.length;++r){var g=l[r],N=g.className,G=g.style,X=t.appendChild(c("div",null,"CodeMirror-gutter "+N));G&&(X.style.cssText=G),N=="CodeMirror-linenumbers"&&(e.lineGutter=X,X.style.width=(e.lineNumWidth||1)+"px")}t.style.display=l.length?"":"none",Zi(e)}function di(e){Pi(e.display),Ha(e),Ta(e)}function ji(e,t,l,r){var g=this;this.input=l,g.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),g.scrollbarFiller.setAttribute("cm-not-content","true"),g.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),g.gutterFiller.setAttribute("cm-not-content","true"),g.lineDiv=v("div",null,"CodeMirror-code"),g.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),g.cursorDiv=c("div",null,"CodeMirror-cursors"),g.measure=c("div",null,"CodeMirror-measure"),g.lineMeasure=c("div",null,"CodeMirror-measure"),g.lineSpace=v("div",[g.measure,g.lineMeasure,g.selectionDiv,g.cursorDiv,g.lineDiv],null,"position: relative; outline: none");var N=v("div",[g.lineSpace],"CodeMirror-lines");g.mover=c("div",[N],null,"position: relative"),g.sizer=c("div",[g.mover],"CodeMirror-sizer"),g.sizerWidth=null,g.heightForcer=c("div",null,null,"position: absolute; height: "+se+"px; width: 1px;"),g.gutters=c("div",null,"CodeMirror-gutters"),g.lineGutter=null,g.scroller=c("div",[g.sizer,g.heightForcer,g.gutters],"CodeMirror-scroll"),g.scroller.setAttribute("tabIndex","-1"),g.wrapper=c("div",[g.scrollbarFiller,g.gutterFiller,g.scroller],"CodeMirror"),F&&D<8&&(g.gutters.style.zIndex=-1,g.scroller.style.paddingRight=0),!L&&!(I&&s)&&(g.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(g.wrapper):e(g.wrapper)),g.viewFrom=g.viewTo=t.first,g.reportedViewFrom=g.reportedViewTo=t.first,g.view=[],g.renderedView=null,g.externalMeasured=null,g.viewOffset=0,g.lastWrapHeight=g.lastWrapWidth=0,g.updateLineNumbers=null,g.nativeBarWidth=g.barHeight=g.barWidth=0,g.scrollbarsClipped=!1,g.lineNumWidth=g.lineNumInnerWidth=g.lineNumChars=null,g.alignWidgets=!1,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=null,g.maxLine=null,g.maxLineLength=0,g.maxLineChanged=!1,g.wheelDX=g.wheelDY=g.wheelStartX=g.wheelStartY=null,g.shift=!1,g.selForContextMenu=null,g.activeTouch=null,g.gutterSpecs=Ur(r.gutters,r.lineNumbers),Pi(g),l.init(g)}var ci=0,br=null;F?br=-.53:I?br=15:b?br=-.7:h&&(br=-1/3);function Fi(e){var t=e.wheelDeltaX,l=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),l==null&&e.detail&&e.axis==e.VERTICAL_AXIS?l=e.detail:l==null&&(l=e.wheelDelta),{x:t,y:l}}function Bi(e){var t=Fi(e);return t.x*=br,t.y*=br,t}function Hi(e,t){var l=Fi(t),r=l.x,g=l.y,N=e.display,G=N.scroller,X=G.scrollWidth>G.clientWidth,$=G.scrollHeight>G.clientHeight;if(!(r&&X||g&&$))return;if(g&&i&&L){e:for(var te=t.target,Oe=N.view;te!=G;te=te.parentNode)for(var Me=0;Me<Oe.length;Me++)if(Oe[Me].node==te){e.display.currentWheelTarget=te;break e}}if(r&&!I&&!m&&br!=null){g&&$&&Di(e,Math.max(0,G.scrollTop+g*br)),Mr(e,Math.max(0,G.scrollLeft+r*br)),(!g||g&&$)&&J(t),N.wheelStartX=null;return}if(g&&br!=null){var ot=g*br,nt=e.doc.scrollTop,Kt=nt+N.wrapper.clientHeight;ot<0?nt=Math.max(0,nt+ot-50):Kt=Math.min(e.doc.height,Kt+ot+50),Ui(e,{top:nt,bottom:Kt})}ci<20&&(N.wheelStartX==null?(N.wheelStartX=G.scrollLeft,N.wheelStartY=G.scrollTop,N.wheelDX=r,N.wheelDY=g,setTimeout(function(){if(N.wheelStartX==null)return;var pn=G.scrollLeft-N.wheelStartX,Ln=G.scrollTop-N.wheelStartY,Un=Ln&&N.wheelDY&&Ln/N.wheelDY||pn&&N.wheelDX&&pn/N.wheelDX;if(N.wheelStartX=N.wheelStartY=null,!Un)return;br=(br*ci+Un)/(ci+1),++ci},200)):(N.wheelDX+=r,N.wheelDY+=g))}var Kr=function(e,t){this.ranges=e,this.primIndex=t};Kr.prototype.primary=function(){return this.ranges[this.primIndex]},Kr.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 l=this.ranges[t],r=e.ranges[t];if(!hr(l.anchor,r.anchor)||!hr(l.head,r.head))return!1}return!0},Kr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ma(xr(this.ranges[t].anchor),xr(this.ranges[t].head));return new Kr(e,this.primIndex)},Kr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Kr.prototype.contains=function(e,t){t||(t=e);for(var l=0;l<this.ranges.length;l++){var r=this.ranges[l];if(Xn(t,r.from())>=0&&Xn(e,r.to())<=0)return l}return-1};var Ma=function(e,t){this.anchor=e,this.head=t};Ma.prototype.from=function(){return Ga(this.anchor,this.head)},Ma.prototype.to=function(){return $a(this.anchor,this.head)},Ma.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ha(e,t,l){var r=e&&e.options.selectionsMayTouch,g=t[l];t.sort(function(ot,nt){return Xn(ot.from(),nt.from())}),l=ee(t,g);for(var N=1;N<t.length;N++){var G=t[N],X=t[N-1],$=Xn(X.to(),G.from());if(r&&!G.empty()?$>0:$>=0){var te=Ga(X.from(),G.from()),Oe=$a(X.to(),G.to()),Me=X.empty()?G.from()==G.head:X.from()==X.head;N<=l&&--l,t.splice(--N,2,new Ma(Me?Oe:te,Me?te:Oe))}}return new Kr(t,l)}function Fn(e,t){return new Kr([new Ma(e,t||e)],0)}function Jn(e){return e.text?rn(e.from.line+e.text.length-1,Ve(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function xa(e,t){if(Xn(e,t.from)<0)return e;if(Xn(e,t.to)<=0)return Jn(t);var l=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Jn(t).ch-t.to.ch),rn(l,r)}function er(e,t){for(var l=[],r=0;r<e.sel.ranges.length;r++){var g=e.sel.ranges[r];l.push(new Ma(xa(g.anchor,t),xa(g.head,t)))}return ha(e.cm,l,e.sel.primIndex)}function gi(e,t,l){return e.line==t.line?rn(l.line,e.ch-t.ch+l.ch):rn(l.line+(e.line-t.line),e.ch)}function ri(e,t,l){for(var r=[],g=rn(e.first,0),N=g,G=0;G<t.length;G++){var X=t[G],$=gi(X.from,g,N),te=gi(Jn(X),g,N);if(g=X.to,N=te,l=="around"){var Oe=e.sel.ranges[G],Me=Xn(Oe.head,Oe.anchor)<0;r[G]=new Ma(Me?te:$,Me?$:te)}else r[G]=new Ma($,$)}return new Kr(r,e.sel.primIndex)}function Dr(e){e.doc.mode=De(e.options,e.doc.modeOption),Yr(e)}function Yr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ni(e,100),e.state.modeGen++,e.curOp&&Ha(e)}function vi(e,t){return t.from.ch==0&&t.to.ch==0&&Ve(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wi(e,t,l,r){function g(Hn){return l?l[Hn]:null}function N(Hn,jn,Vn){xn(Hn,jn,Vn,r),bt(Hn,"change",Hn,t)}function G(Hn,jn){for(var Vn=[],fa=Hn;fa<jn;++fa)Vn.push(new Cn(te[fa],g(fa),r));return Vn}var X=t.from,$=t.to,te=t.text,Oe=En(e,X.line),Me=En(e,$.line),ot=Ve(te),nt=g(te.length-1),Kt=$.line-X.line;if(t.full)e.insert(0,G(0,te.length)),e.remove(te.length,e.size-te.length);else if(vi(e,t)){var pn=G(0,te.length-1);N(Me,Me.text,nt),Kt&&e.remove(X.line,Kt),pn.length&&e.insert(X.line,pn)}else if(Oe==Me)if(te.length==1)N(Oe,Oe.text.slice(0,X.ch)+ot+Oe.text.slice($.ch),nt);else{var Ln=G(1,te.length-1);Ln.push(new Cn(ot+Oe.text.slice($.ch),nt,r)),N(Oe,Oe.text.slice(0,X.ch)+te[0],g(0)),e.insert(X.line+1,Ln)}else if(te.length==1)N(Oe,Oe.text.slice(0,X.ch)+te[0]+Me.text.slice($.ch),g(0)),e.remove(X.line+1,Kt);else{N(Oe,Oe.text.slice(0,X.ch)+te[0],g(0)),N(Me,ot+Me.text.slice($.ch),nt);var Un=G(1,te.length-1);Kt>1&&e.remove(X.line+1,Kt-1),e.insert(X.line+1,Un)}bt(e,"change",e,t)}function Cr(e,t,l){function r(g,N,G){if(g.linked)for(var X=0;X<g.linked.length;++X){var $=g.linked[X];if($.doc==N)continue;var te=G&&$.sharedHist;if(l&&!te)continue;t($.doc,te),r($.doc,g,te)}}r(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,kr(e),Dr(e),_s(e),e.options.lineWrapping||mn(e),e.options.mode=t.modeOption,Ha(e)}function _s(e){(e.doc.direction=="rtl"?U:_)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){Wr(e,function(){_s(e),Ha(e)})}function zo(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 as(e,t){var l={from:xr(t.from),to:Jn(t),text:ga(e,t.from,t.to)};return Es(e,l,t.from.line,t.to.line+1),Cr(e,function(r){return Es(r,l,t.from.line,t.to.line+1)},!0),l}function ys(e){for(;e.length;){var t=Ve(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),Ve(e.done);if(e.done.length&&!Ve(e.done).ranges)return Ve(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ve(e.done)}function bs(e,t,l,r){var g=e.history;g.undone.length=0;var N=+new Date,G,X;if((g.lastOp==r||g.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&g.lastModTime>N-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(G=pl(g,g.lastOp==r)))X=Ve(G.changes),Xn(t.from,t.to)==0&&Xn(t.from,X.to)==0?X.to=Jn(t):G.changes.push(as(e,t));else{var $=Ve(g.done);for((!$||!$.ranges)&&Go(e.sel,g.done),G={changes:[as(e,t)],generation:g.generation},g.done.push(G);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(l),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=N,g.lastOp=g.lastSelOp=r,g.lastOrigin=g.lastSelOrigin=t.origin,X||Ue(e,"historyAdded")}function ml(e,t,l,r){var g=t.charAt(0);return g=="*"||g=="+"&&l.ranges.length==r.ranges.length&&l.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,l,r){var g=e.history,N=r&&r.origin;l==g.lastSelOp||N&&g.lastSelOrigin==N&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==N||ml(e,N,Ve(g.done),t))?g.done[g.done.length-1]=t:Go(t,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=N,g.lastSelOp=l,r&&r.clearRedo!==!1&&ys(g.undone)}function Go(e,t){var l=Ve(t);l&&l.ranges&&l.equals(e)||t.push(e)}function Es(e,t,l,r){var g=t["spans_"+e.id],N=0;e.iter(Math.max(e.first,l),Math.min(e.first+e.size,r),function(G){G.markedSpans&&((g||(g=t["spans_"+e.id]={}))[N]=G.markedSpans),++N})}function vl(e){if(!e)return null;for(var t,l=0;l<e.length;++l)e[l].marker.explicitlyCleared?t||(t=e.slice(0,l)):t&&t.push(e[l]);return t?t.length?t:null:e}function _l(e,t){var l=t["spans_"+e.id];if(!l)return null;for(var r=[],g=0;g<t.text.length;++g)r.push(vl(l[g]));return r}function xs(e,t){var l=_l(e,t),r=Zn(e,t);if(!l)return r;if(!r)return l;for(var g=0;g<l.length;++g){var N=l[g],G=r[g];if(N&&G){e:for(var X=0;X<G.length;++X){for(var $=G[X],te=0;te<N.length;++te)if(N[te].marker==$.marker)continue e;N.push($)}}else G&&(l[g]=G)}return l}function vo(e,t,l){for(var r=[],g=0;g<e.length;++g){var N=e[g];if(N.ranges){r.push(l?Kr.prototype.deepCopy.call(N):N);continue}var G=N.changes,X=[];r.push({changes:X});for(var $=0;$<G.length;++$){var te=G[$],Oe=void 0;if(X.push({from:te.from,to:te.to,text:te.text}),t)for(var Me in te)(Oe=Me.match(/^spans_(\d+)$/))&&(ee(t,Number(Oe[1]))>-1&&(Ve(X)[Me]=te[Me],delete te[Me]))}}return r}function rs(e,t,l,r){if(r){var g=e.anchor;if(l){var N=Xn(t,g)<0;N!=Xn(l,g)<0?(g=t,t=l):N!=Xn(t,l)<0&&(t=l)}return new Ma(g,t)}else return new Ma(l||t,t)}function Vo(e,t,l,r,g){g==null&&(g=e.cm&&(e.cm.display.shift||e.extend)),Gr(e,new Kr([rs(e.sel.primary(),t,l,g)],0),r)}function Ts(e,t,l){for(var r=[],g=e.cm&&(e.cm.display.shift||e.extend),N=0;N<e.sel.ranges.length;N++)r[N]=rs(e.sel.ranges[N],t[N],null,g);var G=ha(e.cm,r,e.sel.primIndex);Gr(e,G,l)}function is(e,t,l,r){var g=e.sel.ranges.slice(0);g[t]=l,Gr(e,ha(e.cm,g,e.sel.primIndex),r)}function Os(e,t,l,r){Gr(e,Fn(t,l),r)}function yl(e,t,l){var r={ranges:t.ranges,update:function(g){this.ranges=[];for(var N=0;N<g.length;N++)this.ranges[N]=new Ma(Kn(e,g[N].anchor),Kn(e,g[N].head))},origin:l&&l.origin};return Ue(e,"beforeSelectionChange",e,r),e.cm&&Ue(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ha(e.cm,r.ranges,r.ranges.length-1):t}function Cs(e,t,l){var r=e.history.done,g=Ve(r);g&&g.ranges?(r[r.length-1]=t,Yo(e,t,l)):Gr(e,t,l)}function Gr(e,t,l){Yo(e,t,l),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,l)}function Yo(e,t,l){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,l));var r=l&&l.bias||(Xn(t.primary().head,e.sel.primary().head)<0?-1:1);ws(e,Rs(e,t,r,!0)),!(l&&l.scroll===!1)&&e.cm&&_i(e.cm)}function ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ee(e.cm)),bt(e,"cursorActivity",e)}function Ss(e){ws(e,Rs(e,e.sel,null,!1))}function Rs(e,t,l,r){for(var g,N=0;N<t.ranges.length;N++){var G=t.ranges[N],X=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[N],$=Xo(e,G.anchor,X&&X.anchor,l,r),te=Xo(e,G.head,X&&X.head,l,r);(g||$!=G.anchor||te!=G.head)&&(g||(g=t.ranges.slice(0,N)),g[N]=new Ma($,te))}return g?ha(e.cm,g,t.primIndex):t}function _o(e,t,l,r,g){var N=En(e,t.line);if(N.markedSpans)for(var G=0;G<N.markedSpans.length;++G){var X=N.markedSpans[G],$=X.marker,te="selectLeft"in $?!$.selectLeft:$.inclusiveLeft,Oe="selectRight"in $?!$.selectRight:$.inclusiveRight;if((X.from==null||(te?X.from<=t.ch:X.from<t.ch))&&(X.to==null||(Oe?X.to>=t.ch:X.to>t.ch))){if(g&&(Ue($,"beforeCursorEnter"),$.explicitlyCleared))if(N.markedSpans){--G;continue}else break;if(!$.atomic)continue;if(l){var Me=$.find(r<0?1:-1),ot=void 0;if((r<0?Oe:te)&&(Me=As(e,Me,-r,Me&&Me.line==t.line?N:null)),Me&&Me.line==t.line&&(ot=Xn(Me,l))&&(r<0?ot<0:ot>0))return _o(e,Me,t,r,g)}var nt=$.find(r<0?-1:1);return(r<0?te:Oe)&&(nt=As(e,nt,r,nt.line==t.line?N:null)),nt?_o(e,nt,t,r,g):null}}return t}function Xo(e,t,l,r,g){var N=r||1,G=_o(e,t,l,N,g)||!g&&_o(e,t,l,N,!0)||_o(e,t,l,-N,g)||!g&&_o(e,t,l,-N,!0);return G||(e.cantEdit=!0,rn(e.first,0))}function As(e,t,l,r){return l<0&&t.ch==0?t.line>e.first?Kn(e,rn(t.line-1)):null:l>0&&t.ch==(r||En(e,t.line)).text.length?t.line<e.first+e.size-1?rn(t.line+1,0):null:new rn(t.line,t.ch+l)}function Ds(e){e.setSelection(rn(e.firstLine(),0),rn(e.lastLine()),me)}function Ps(e,t,l){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return l&&(r.update=function(g,N,G,X){g&&(r.from=Kn(e,g)),N&&(r.to=Kn(e,N)),G&&(r.text=G),X!==void 0&&(r.origin=X)}),Ue(e,"beforeChange",e,r),e.cm&&Ue(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function yo(e,t,l){if(e.cm){if(!e.cm.curOp)return dr(e.cm,yo)(e,t,l);if(e.cm.state.suppressEdits)return}if((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(t=Ps(e,t,!0),!t))return;var r=$r&&!l&&ae(e,t.from,t.to);if(r)for(var g=r.length-1;g>=0;--g)Ls(e,{from:r[g].from,to:r[g].to,text:g?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Xn(t.from,t.to)==0)return;var l=er(e,t);bs(e,t,l,e.cm?e.cm.curOp.id:NaN),Po(e,t,l,Zn(e,t));var r=[];Cr(e,function(g,N){!N&&ee(r,g.history)==-1&&(Ns(g.history,t),r.push(g.history)),Po(g,t,null,Zn(g,t))})}function $o(e,t,l){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!l)return;for(var g=e.history,N,G=e.sel,X=t=="undo"?g.done:g.undone,$=t=="undo"?g.undone:g.done,te=0;te<X.length&&!(N=X[te],l?N.ranges&&!N.equals(e.sel):!N.ranges);te++);if(te==X.length)return;for(g.lastOrigin=g.lastSelOrigin=null;;)if(N=X.pop(),N.ranges){if(Go(N,$),l&&!N.equals(e.sel)){Gr(e,N,{clearRedo:!1});return}G=N}else if(r){X.push(N);return}else break;var Oe=[];Go(G,$),$.push({changes:Oe,generation:g.generation}),g.generation=N.generation||++g.maxGeneration;for(var Me=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),ot=function(pn){var Ln=N.changes[pn];if(Ln.origin=t,Me&&!Ps(e,Ln,!1))return X.length=0,{};Oe.push(as(e,Ln));var Un=pn?er(e,Ln):Ve(X);Po(e,Ln,Un,xs(e,Ln)),!pn&&e.cm&&e.cm.scrollIntoView({from:Ln.from,to:Jn(Ln)});var Hn=[];Cr(e,function(jn,Vn){!Vn&&ee(Hn,jn.history)==-1&&(Ns(jn.history,Ln),Hn.push(jn.history)),Po(jn,Ln,null,xs(jn,Ln))})},nt=N.changes.length-1;nt>=0;--nt){var Kt=ot(nt);if(Kt)return Kt.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new Kr(Lt(e.sel.ranges,function(g){return new Ma(rn(g.anchor.line+t,g.anchor.ch),rn(g.head.line+t,g.head.ch))}),e.sel.primIndex),e.cm){Ha(e.cm,e.first,e.first-t,t);for(var l=e.cm.display,r=l.viewFrom;r<l.viewTo;r++)za(e.cm,r,"gutter")}}function Po(e,t,l,r){if(e.cm&&!e.cm.curOp)return dr(e.cm,Po)(e,t,l,r);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 g=t.text.length-1-(e.first-t.from.line);Ms(e,g),t={from:rn(e.first,0),to:rn(t.to.line+g,t.to.ch),text:[Ve(t.text)],origin:t.origin}}var N=e.lastLine();t.to.line>N&&(t={from:t.from,to:rn(N,En(e,N).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ga(e,t.from,t.to),l||(l=er(e,t)),e.cm?bl(e.cm,t,r):Wi(e,t,r),Yo(e,l,me),e.cantEdit&&Xo(e,rn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,l){var r=e.doc,g=e.display,N=t.from,G=t.to,X=!1,$=N.line;e.options.lineWrapping||($=la($e(En(r,N.line))),r.iter($,G.line+1,function(nt){if(nt==g.maxLine)return X=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ee(e),Wi(r,t,l,Qr(e)),e.options.lineWrapping||(r.iter($,N.line+t.text.length,function(nt){var Kt=In(nt);Kt>g.maxLineLength&&(g.maxLine=nt,g.maxLineLength=Kt,g.maxLineChanged=!0,X=!1)}),X&&(e.curOp.updateMaxLine=!0)),oi(r,N.line),Ni(e,400);var te=t.text.length-(G.line-N.line)-1;t.full?Ha(e):N.line==G.line&&t.text.length==1&&!vi(e.doc,t)?za(e,N.line,"text"):Ha(e,N.line,G.line+1,te);var Oe=ce(e,"changes"),Me=ce(e,"change");if(Me||Oe){var ot={from:N,to:G,text:t.text,removed:t.removed,origin:t.origin};Me&&bt(e,"change",e,ot),Oe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ot)}e.display.selForContextMenu=null}function bo(e,t,l,r,g){var N;r||(r=l),Xn(r,l)<0&&(N=[r,l],l=N[0],r=N[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:l,to:r,text:t,origin:g})}function Is(e,t,l,r){l<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ks(e,t,l,r){for(var g=0;g<e.length;++g){var N=e[g],G=!0;if(N.ranges){N.copied||(N=e[g]=N.deepCopy(),N.copied=!0);for(var X=0;X<N.ranges.length;X++)Is(N.ranges[X].anchor,t,l,r),Is(N.ranges[X].head,t,l,r);continue}for(var $=0;$<N.changes.length;++$){var te=N.changes[$];if(l<te.from.line)te.from=rn(te.from.line+r,te.from.ch),te.to=rn(te.to.line+r,te.to.ch);else if(t<=te.to.line){G=!1;break}}G||(e.splice(0,g+1),g=0)}}function Ns(e,t){var l=t.from.line,r=t.to.line,g=t.text.length-(r-l)-1;ks(e.done,l,r,g),ks(e.undone,l,r,g)}function Lo(e,t,l,r){var g=t,N=t;return typeof t=="number"?N=En(e,Aa(e,t)):g=la(t),g==null?null:(r(N,g)&&e.cm&&za(e.cm,g,l),N)}function Mo(e){this.lines=e,this.parent=null;for(var t=0,l=0;l<e.length;++l)e[l].parent=this,t+=e[l].height;this.height=t}Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var l=e,r=e+t;l<r;++l){var g=this.lines[l];this.height-=g.height,Et(g),bt(g,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,l){this.height+=l,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,l){for(var r=e+t;e<r;++e)if(l(this.lines[e]))return!0}};function Io(e){this.children=e;for(var t=0,l=0,r=0;r<e.length;++r){var g=e[r];t+=g.chunkSize(),l+=g.height,g.parent=this}this.size=t,this.height=l,this.parent=null}Io.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var l=0;l<this.children.length;++l){var r=this.children[l],g=r.chunkSize();if(e<g){var N=Math.min(t,g-e),G=r.height;if(r.removeInner(e,N),this.height-=G-r.height,g==N&&(this.children.splice(l--,1),r.parent=null),(t-=N)==0)break;e=0}else e-=g}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var X=[];this.collapse(X),this.children=[new Mo(X)],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,l){this.size+=t.length,this.height+=l;for(var r=0;r<this.children.length;++r){var g=this.children[r],N=g.chunkSize();if(e<=N){if(g.insertInner(e,t,l),g.lines&&g.lines.length>50){for(var G=g.lines.length%25+25,X=G;X<g.lines.length;){var $=new Mo(g.lines.slice(X,X+=25));g.height-=$.height,this.children.splice(++r,0,$),$.parent=this}g.lines=g.lines.slice(0,G),this.maybeSpill()}break}e-=N}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),l=new Io(t);if(e.parent){e.size-=l.size,e.height-=l.height;var g=ee(e.parent.children,e);e.parent.children.splice(g+1,0,l)}else{var r=new Io(e.children);r.parent=e,e.children=[r,l],e=r}l.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,l){for(var r=0;r<this.children.length;++r){var g=this.children[r],N=g.chunkSize();if(e<N){var G=Math.min(t,N-e);if(g.iterN(e,G,l))return!0;if((t-=G)==0)break;e=0}else e-=N}}};var ko=function(e,t,l){if(l)for(var r in l)l.hasOwnProperty(r)&&(this[r]=l[r]);this.doc=e,this.node=t};ko.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,l=this.line,r=la(l);if(r==null||!t)return;for(var g=0;g<t.length;++g)t[g]==this&&t.splice(g--,1);t.length||(l.widgets=null);var N=ja(this);ta(l,Math.max(0,l.height-N)),e&&(Wr(e,function(){Us(e,l,-N),za(e,r,"widget")}),bt(e,"lineWidgetCleared",e,this,r))},ko.prototype.changed=function(){var e=this,t=this.height,l=this.doc.cm,r=this.line;this.height=null;var g=ja(this)-t;if(!g)return;Ut(this.doc,r)||ta(r,r.height+g),l&&Wr(l,function(){l.curOp.forceUpdate=!0,Us(l,r,g),bt(l,"lineWidgetChanged",l,e,la(r))})},he(ko);function Us(e,t,l){yn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Vi(e,l)}function El(e,t,l,r){var g=new ko(e,l,r),N=e.cm;return N&&g.noHScroll&&(N.display.alignWidgets=!0),Lo(e,t,"widget",function(G){var X=G.widgets||(G.widgets=[]);if(g.insertAt==null?X.push(g):X.splice(Math.min(X.length-1,Math.max(0,g.insertAt)),0,g),g.line=G,N&&!Ut(e,G)){var $=yn(G)<e.scrollTop;ta(G,G.height+ja(g)),$&&Vi(N,g.height),N.curOp.forceUpdate=!0}return!0}),N&&bt(N,"lineWidgetAdded",N,g,typeof t=="number"?t:la(t)),g}var js=0,qi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};qi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ui(e),ce(this,"clear")){var l=this.find();l&&bt(this,"clear",l.from,l.to)}for(var r=null,g=null,N=0;N<this.lines.length;++N){var G=this.lines[N],X=Mn(G.markedSpans,this);e&&!this.collapsed?za(e,la(G),"text"):e&&(X.to!=null&&(g=la(G)),X.from!=null&&(r=la(G))),G.markedSpans=ln(G.markedSpans,X),X.from==null&&this.collapsed&&!Ut(this.doc,G)&&e&&ta(G,Da(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var $=0;$<this.lines.length;++$){var te=$e(this.lines[$]),Oe=In(te);Oe>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=Oe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Ha(e,r,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ss(e.doc)),e&&bt(e,"markerCleared",e,this,r,g),t&&Ei(e),this.parent&&this.parent.clear()},qi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var l,r,g=0;g<this.lines.length;++g){var N=this.lines[g],G=Mn(N.markedSpans,this);if(G.from!=null&&(l=rn(t?N:la(N),G.from),e==-1))return l;if(G.to!=null&&(r=rn(t?N:la(N),G.to),e==1))return r}return l&&{from:l,to:r}},qi.prototype.changed=function(){var e=this,t=this.find(-1,!0),l=this,r=this.doc.cm;if(!t||!r)return;Wr(r,function(){var g=t.line,N=la(t.line),G=We(r,N);if(G&&(qn(G),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ut(l.doc,g)&&l.height!=null){var X=l.height;l.height=null;var $=ja(l)-X;$&&ta(g,g.height+$)}bt(r,"markerChanged",r,e)})},qi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ee(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qi.prototype.detachLine=function(e){if(this.lines.splice(ee(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},he(qi);function Eo(e,t,l,r,g){if(r&&r.shared)return xl(e,t,l,r,g);if(e.cm&&!e.cm.curOp)return dr(e.cm,Eo)(e,t,l,r,g);var N=new qi(e,g),G=Xn(t,l);if(r&&O(r,N,!1),G>0||G==0&&N.clearWhenEmpty!==!1)return N;if(N.replacedWith&&(N.collapsed=!0,N.widgetNode=v("span",[N.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||N.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(N.widgetNode.insertLeft=!0)),N.collapsed){if(ft(e,t.line,t,l,N)||t.line!=l.line&&ft(e,l.line,t,l,N))throw new Error("Inserting collapsed marker partially overlapping an existing one");ir()}N.addToHistory&&bs(e,{from:t,to:l,origin:"markText"},e.sel,NaN);var X=t.line,$=e.cm,te;if(e.iter(X,l.line+1,function(Me){$&&N.collapsed&&!$.options.lineWrapping&&$e(Me)==$.display.maxLine&&(te=!0),N.collapsed&&X!=t.line&&ta(Me,0),Tn(Me,new Pa(N,X==t.line?t.ch:null,X==l.line?l.ch:null)),++X}),N.collapsed&&e.iter(t.line,l.line+1,function(Me){Ut(e,Me)&&ta(Me,0)}),N.clearOnEnter&&Pe(N,"beforeCursorEnter",function(){return N.clear()}),N.readOnly&&(_a(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),N.collapsed&&(N.id=++js,N.atomic=!0),$){if(te&&($.curOp.updateMaxLine=!0),N.collapsed)Ha($,t.line,l.line+1);else if(N.className||N.startStyle||N.endStyle||N.css||N.attributes||N.title)for(var Oe=t.line;Oe<=l.line;Oe++)za($,Oe,"text");N.atomic&&Ss($.doc),bt($,"markerAdded",$,N)}return N}var No=function(e,t){this.markers=e,this.primary=t;for(var l=0;l<e.length;++l)e[l].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();bt(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},he(No);function xl(e,t,l,r,g){r=O(r),r.shared=!1;var N=[Eo(e,t,l,r,g)],G=N[0],X=r.widgetNode;return Cr(e,function($){X&&(r.widgetNode=X.cloneNode(!0)),N.push(Eo($,Kn($,t),Kn($,l),r,g));for(var te=0;te<$.linked.length;++te)if($.linked[te].isParent)return;G=Ve(N)}),new No(N,G)}function Fs(e){return e.findMarks(rn(e.first,0),e.clipPos(rn(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var l=0;l<t.length;l++){var r=t[l],g=r.find(),N=e.clipPos(g.from),G=e.clipPos(g.to);if(Xn(N,G)){var X=Eo(e,N,G,r.primary,r.primary.type);r.markers.push(X),X.parent=r}}}function Ol(e){for(var t=function(r){var g=e[r],N=[g.primary.doc];Cr(g.primary.doc,function($){return N.push($)});for(var G=0;G<g.markers.length;G++){var X=g.markers[G];ee(N,X.doc)==-1&&(X.parent=null,g.markers.splice(G--,1))}},l=0;l<e.length;l++)t(l)}var Cl=0,ei=function(e,t,l,r,g){if(!(this instanceof ei))return new ei(e,t,l,r,g);l==null&&(l=0),Io.call(this,[new Mo([new Cn("",null)])]),this.first=l,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=l;var N=rn(l,0);this.sel=Fn(N),this.history=new zo(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction=g=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wi(this,{from:N,to:N,text:e}),Gr(this,Fn(N),me)};ei.prototype=Fe(Io.prototype,{constructor:ei,iter:function(e,t,l){l?this.iterN(e-this.first,t-e,l):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var l=0,r=0;r<t.length;++r)l+=t[r].height;this.insertInner(e-this.first,t,l)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ua(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:cr(function(e){var t=rn(this.first,0),l=this.first+this.size-1;yo(this,{from:t,to:rn(l,En(this,l).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ri(this.cm,0,0),Gr(this,Fn(t),me)}),replaceRange:function(e,t,l,r){t=Kn(this,t),l=l?Kn(this,l):t,bo(this,e,t,l,r)},getRange:function(e,t,l){var r=ga(this,Kn(this,e),Kn(this,t));return l===!1?r:r.join(l||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Xa(this,e))return En(this,e)},getLineNumber:function(e){return la(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=En(this,e)),$e(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Kn(this,e)},getCursor:function(e){var t=this.sel.primary(),l;return e==null||e=="head"?l=t.head:e=="anchor"?l=t.anchor:e=="end"||e=="to"||e===!1?l=t.to():l=t.from(),l},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cr(function(e,t,l){Os(this,Kn(this,typeof e=="number"?rn(e,t||0):e),null,l)}),setSelection:cr(function(e,t,l){Os(this,Kn(this,e),Kn(this,t||e),l)}),extendSelection:cr(function(e,t,l){Vo(this,Kn(this,e),t&&Kn(this,t),l)}),extendSelections:cr(function(e,t){Ts(this,on(this,e),t)}),extendSelectionsBy:cr(function(e,t){var l=Lt(this.sel.ranges,e);Ts(this,on(this,l),t)}),setSelections:cr(function(e,t,l){if(!e.length)return;for(var r=[],g=0;g<e.length;g++)r[g]=new Ma(Kn(this,e[g].anchor),Kn(this,e[g].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Gr(this,ha(this.cm,r,t),l)}),addSelection:cr(function(e,t,l){var r=this.sel.ranges.slice(0);r.push(new Ma(Kn(this,e),Kn(this,t||e))),Gr(this,ha(this.cm,r,r.length-1),l)}),getSelection:function(e){for(var t=this.sel.ranges,l,r=0;r<t.length;r++){var g=ga(this,t[r].from(),t[r].to());l=l?l.concat(g):g}return e===!1?l:l.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],l=this.sel.ranges,r=0;r<l.length;r++){var g=ga(this,l[r].from(),l[r].to());e!==!1&&(g=g.join(e||this.lineSeparator())),t[r]=g}return t},replaceSelection:function(e,t,l){for(var r=[],g=0;g<this.sel.ranges.length;g++)r[g]=e;this.replaceSelections(r,t,l||"+input")},replaceSelections:cr(function(e,t,l){for(var r=[],g=this.sel,N=0;N<g.ranges.length;N++){var G=g.ranges[N];r[N]={from:G.from(),to:G.to(),text:this.splitLines(e[N]),origin:l}}for(var X=t&&t!="end"&&ri(this,r,t),$=r.length-1;$>=0;$--)yo(this,r[$]);X?Cs(this,X):this.cm&&_i(this.cm)}),undo:cr(function(){$o(this,"undo")}),redo:cr(function(){$o(this,"redo")}),undoSelection:cr(function(){$o(this,"undo",!0)}),redoSelection:cr(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,l=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var g=0;g<e.undone.length;g++)e.undone[g].ranges||++l;return{undo:t,redo:l}},clearHistory:function(){var e=this;this.history=new zo(this.history.maxGeneration),Cr(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 zo(this.history.maxGeneration);t.done=vo(e.done.slice(0),null,!0),t.undone=vo(e.undone.slice(0),null,!0)},setGutterMarker:cr(function(e,t,l){return Lo(this,e,"gutter",function(r){var g=r.gutterMarkers||(r.gutterMarkers={});return g[t]=l,!l&&Ge(g)&&(r.gutterMarkers=null),!0})}),clearGutter:cr(function(e){var t=this;this.iter(function(l){l.gutterMarkers&&l.gutterMarkers[e]&&Lo(t,l,"gutter",function(){return l.gutterMarkers[e]=null,Ge(l.gutterMarkers)&&(l.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Xa(this,e))return null;if(t=e,e=En(this,e),!e)return null}else if(t=la(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:cr(function(e,t,l){return Lo(this,e,t=="gutter"?"gutter":"class",function(r){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[g])r[g]=l;else{if(T(l).test(r[g]))return!1;r[g]+=" "+l}return!0})}),removeLineClass:cr(function(e,t,l){return Lo(this,e,t=="gutter"?"gutter":"class",function(r){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",N=r[g];if(N)if(l==null)r[g]=null;else{var G=N.match(T(l));if(!G)return!1;var X=G.index+G[0].length;r[g]=N.slice(0,G.index)+(!G.index||X==N.length?"":" ")+N.slice(X)||null}else return!1;return!0})}),addLineWidget:cr(function(e,t,l){return El(this,e,t,l)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,l){return Eo(this,Kn(this,e),Kn(this,t),l,l&&l.type||"range")},setBookmark:function(e,t){var l={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Kn(this,e),Eo(this,e,e,l,"bookmark")},findMarksAt:function(e){e=Kn(this,e);var t=[],l=En(this,e.line).markedSpans;if(l)for(var r=0;r<l.length;++r){var g=l[r];(g.from==null||g.from<=e.ch)&&(g.to==null||g.to>=e.ch)&&t.push(g.marker.parent||g.marker)}return t},findMarks:function(e,t,l){e=Kn(this,e),t=Kn(this,t);var r=[],g=e.line;return this.iter(e.line,t.line+1,function(N){var G=N.markedSpans;if(G)for(var X=0;X<G.length;X++){var $=G[X];!($.to!=null&&g==e.line&&e.ch>=$.to||$.from==null&&g!=e.line||$.from!=null&&g==t.line&&$.from>=t.ch)&&(!l||l($.marker))&&r.push($.marker.parent||$.marker)}++g}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var l=t.markedSpans;if(l)for(var r=0;r<l.length;++r)l[r].from!=null&&e.push(l[r].marker)}),e},posFromIndex:function(e){var t,l=this.first,r=this.lineSeparator().length;return this.iter(function(g){var N=g.text.length+r;if(N>e)return t=e,!0;e-=N,++l}),Kn(this,rn(l,t))},indexFromPos:function(e){e=Kn(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var l=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+l}),t},copy:function(e){var t=new ei(Ua(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,l=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<l&&(l=e.to);var r=new ei(Ua(this,t,l),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,Fs(this)),r},unlinkDoc:function(e){if(e instanceof fr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var l=this.linked[t];if(l.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Ol(Fs(this));break}if(e.history==this.history){var r=[e.id];Cr(e,function(g){return r.push(g.id)},!0),e.history=new zo(null),e.history.done=vo(this.history.done,r),e.history.undone=vo(this.history.undone,r)}},iterLinkedDocs:function(e){Cr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):st(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:cr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),ei.prototype.eachLine=ei.prototype.iter;var Bs=0;function wl(e){var t=this;if(Hs(t),ut(t,e)||or(t.display,e))return;J(e),F&&(Bs=+new Date);var l=Or(t,e,!0),r=e.dataTransfer.files;if(!l||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var g=r.length,N=Array(g),G=0,X=function(){++G==g&&dr(t,function(){l=Kn(t.doc,l);var nt={from:l,to:l,text:t.doc.splitLines(N.filter(function(Kt){return Kt!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,nt),Cs(t.doc,Fn(Kn(t.doc,l),Kn(t.doc,Jn(nt))))})()},$=function(nt,Kt){if(t.options.allowDropFileTypes&&ee(t.options.allowDropFileTypes,nt.type)==-1){X();return}var pn=new FileReader;pn.onerror=function(){return X()},pn.onload=function(){var Ln=pn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ln)){X();return}N[Kt]=Ln,X()},pn.readAsText(nt)},te=0;te<r.length;te++)$(r[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(l)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Oe=e.dataTransfer.getData("Text");if(Oe){var Me;if(t.state.draggingText&&!t.state.draggingText.copy&&(Me=t.listSelections()),Yo(t.doc,Fn(l,l)),Me)for(var ot=0;ot<Me.length;++ot)bo(t.doc,"",Me[ot].anchor,Me[ot].head,"drag");t.replaceSelection(Oe,"around","paste"),t.display.input.focus()}}catch(nt){}}}function Sl(e,t){if(F&&(!e.state.draggingText||+new Date-Bs<100)){ue(t);return}if(ut(e,t)||or(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h){var l=c("img",null,null,"position: fixed; left: 0; top: 0;");l.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(l.width=l.height=1,e.display.wrapper.appendChild(l),l._top=l.offsetTop),t.dataTransfer.setDragImage(l,0,0),m&&l.parentNode.removeChild(l)}}function Rl(e,t){var l=Or(e,t);if(!l)return;var r=document.createDocumentFragment();Zr(e,l,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,r)}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"),l=[],r=0;r<t.length;r++){var g=t[r].CodeMirror;g&&l.push(g)}l.length&&l[0].operation(function(){for(var N=0;N<l.length;N++)e(l[N])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;Pe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Pl)},100))}),Pe(window,"blur",function(){return Ws(Oi)})}function Pl(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 Qo=65;Qo<=90;Qo++)eo[Qo]=String.fromCharCode(Qo);for(var jo=1;jo<=12;jo++)eo[jo+111]=eo[jo+63235]="F"+jo;var Ki={};Ki.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"},Ki.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"},Ki.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"},Ki.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"]},Ki.default=i?Ki.macDefault:Ki.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var l,r,g,N,G=0;G<t.length-1;G++){var X=t[G];if(/^(cmd|meta|m)$/i.test(X))N=!0;else if(/^a(lt)?$/i.test(X))l=!0;else if(/^(c|ctrl|control)$/i.test(X))r=!0;else if(/^s(hift)?$/i.test(X))g=!0;else throw new Error("Unrecognized modifier name: "+X)}return l&&(e="Alt-"+e),r&&(e="Ctrl-"+e),N&&(e="Cmd-"+e),g&&(e="Shift-"+e),e}function Ml(e){var t={};for(var l in e)if(e.hasOwnProperty(l)){var r=e[l];if(/^(name|fallthrough|(de|at)tach)$/.test(l))continue;if(r=="..."){delete e[l];continue}for(var g=Lt(l.split(" "),Ll),N=0;N<g.length;N++){var G=void 0,X=void 0;N==g.length-1?(X=g.join(" "),G=r):(X=g.slice(0,N+1).join(" "),G="...");var $=t[X];if(!$)t[X]=G;else if($!=G)throw new Error("Inconsistent bindings for "+X)}delete e[l]}for(var te in t)e[te]=t[te];return e}function xo(e,t,l,r){t=Jo(t);var g=t.call?t.call(e,r):t[e];if(g===!1)return"nothing";if(g==="...")return"multi";if(g!=null&&l(g))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return xo(e,t.fallthrough,l,r);for(var N=0;N<t.fallthrough.length;N++){var G=xo(e,t.fallthrough[N],l,r);if(G)return G}}}function zs(e){var t=typeof e=="string"?e:eo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,l){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!l&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(m&&e.keyCode==34&&e.char)return!1;var l=eo[e.keyCode];return l==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(l=e.code),Gs(l,e,t))}function Jo(e){return typeof e=="string"?Ki[e]:e}function To(e,t){for(var l=e.doc.sel.ranges,r=[],g=0;g<l.length;g++){for(var N=t(l[g]);r.length&&Xn(N.from,Ve(r).to)<=0;){var G=r.pop();if(Xn(G.from,N.from)<0){N.from=G.from;break}}r.push(N)}Wr(e,function(){for(var X=r.length-1;X>=0;X--)bo(e.doc,"",r[X].from,r[X].to,"+delete");_i(e)})}function os(e,t,l){var r=yt(e.text,t+l,l);return r<0||r>e.text.length?null:r}function ss(e,t,l){var r=os(e,t.ch,l);return r==null?null:new rn(t.line,r,l<0?"after":"before")}function ls(e,t,l,r,g){if(e){t.doc.direction=="rtl"&&(g=-g);var N=An(l,t.doc.direction);if(N){var G=g<0?Ve(N):N[0],X=g<0==(G.level==1),$=X?"after":"before",te;if(G.level>0||t.doc.direction=="rtl"){var Oe=we(t,l);te=g<0?l.text.length-1:0;var Me=Je(t,Oe,te).top;te=bn(function(ot){return Je(t,Oe,ot).top==Me},g<0==(G.level==1)?G.from:G.to-1,te),$=="before"&&(te=os(l,te,1))}else te=g<0?G.to:G.from;return new rn(r,te,$)}}return new rn(r,g<0?l.text.length:0,g<0?"before":"after")}function Il(e,t,l,r){var g=An(t,e.doc.direction);if(!g)return ss(t,l,r);l.ch>=t.text.length?(l.ch=t.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var N=Ye(g,l.ch,l.sticky),G=g[N];if(e.doc.direction=="ltr"&&G.level%2==0&&(r>0?G.to>l.ch:G.from<l.ch))return ss(t,l,r);var X=function(Un,Hn){return os(t,Un instanceof rn?Un.ch:Un,Hn)},$,te=function(Un){return e.options.lineWrapping?($=$||we(e,t),Gn(e,t,$,Un)):{begin:0,end:t.text.length}},Oe=te(l.sticky=="before"?X(l,-1):l.ch);if(e.doc.direction=="rtl"||G.level==1){var Me=G.level==1==r<0,ot=X(l,Me?1:-1);if(ot!=null&&(Me?ot<=G.to&&ot<=Oe.end:ot>=G.from&&ot>=Oe.begin)){var nt=Me?"before":"after";return new rn(l.line,ot,nt)}}var Kt=function(Un,Hn,jn){for(var Vn=function(tr,jr){return jr?new rn(l.line,X(tr,1),"before"):new rn(l.line,tr,"after")};Un>=0&&Un<g.length;Un+=Hn){var fa=g[Un],ia=Hn>0==(fa.level!=1),wa=ia?jn.begin:X(jn.end,-1);if(fa.from<=wa&&wa<fa.to)return Vn(wa,ia);if(wa=ia?fa.from:X(fa.to,-1),jn.begin<=wa&&wa<jn.end)return Vn(wa,ia)}},pn=Kt(N+r,r,Oe);if(pn)return pn;var Ln=r>0?Oe.end:X(Oe.begin,-1);return Ln!=null&&!(r>0&&Ln==t.text.length)&&(pn=Kt(r>0?0:g.length-1,r,te(Ln)),pn)?pn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),me)},killLine:function(e){return To(e,function(t){if(t.empty()){var l=En(e.doc,t.head.line).text.length;return t.head.ch==l&&t.head.line<e.lastLine()?{from:t.head,to:rn(t.head.line+1,0)}:{from:t.head,to:rn(t.head.line,l)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return To(e,function(t){return{from:rn(t.from().line,0),to:Kn(e.doc,rn(t.to().line+1,0))}})},delLineLeft:function(e){return To(e,function(t){return{from:rn(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return To(e,function(t){var l=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:l},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return To(e,function(t){var l=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:l},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(rn(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(rn(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 kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var l=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:l},"div")},Le)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var l=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:l},"div")},Le)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var l=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:l},"div");return r.ch<e.getLine(r.line).search(/\S/)?Xs(e,t.head):r},Le)},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=[],l=e.listSelections(),r=e.options.tabSize,g=0;g<l.length;g++){var N=l[g].from(),G=K(e.getLine(N.line),N.ch,r);t.push(fe(r-G%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wr(e,function(){for(var t=e.listSelections(),l=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var g=t[r].head,N=En(e.doc,g.line).text;if(N){if(g.ch==N.length&&(g=new rn(g.line,g.ch-1)),g.ch>0)g=new rn(g.line,g.ch+1),e.replaceRange(N.charAt(g.ch-1)+N.charAt(g.ch-2),rn(g.line,g.ch-2),g,"+transpose");else if(g.line>e.doc.first){var G=En(e.doc,g.line-1).text;G&&(g=new rn(g.line,1),e.replaceRange(N.charAt(0)+e.doc.lineSeparator()+G.charAt(G.length-1),rn(g.line-1,G.length-1),g,"+transpose"))}}l.push(new Ma(g,g))}e.setSelections(l)})},newlineAndIndent:function(e){return Wr(e,function(){for(var t=e.listSelections(),l=t.length-1;l>=0;l--)e.replaceRange(e.doc.lineSeparator(),t[l].anchor,t[l].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);_i(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var l=En(e.doc,t),r=$e(l);return r!=l&&(t=la(r)),ls(!0,e,r,t,1)}function kl(e,t){var l=En(e.doc,t),r=Ze(l);return r!=l&&(t=la(r)),ls(!0,e,l,t,-1)}function Xs(e,t){var l=Ys(e,t.line),r=En(e.doc,l.line),g=An(r,e.doc.direction);if(!g||g[0].level==0){var N=Math.max(l.ch,r.text.search(/\S/)),G=t.line==l.line&&t.ch<=N&&t.ch;return rn(l.line,G?0:N,l.sticky)}return l}function Zo(e,t,l){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l&&(e.display.shift=!1),g=t(e)!=Be}finally{e.display.shift=r,e.state.suppressEdits=!1}return g}function Nl(e,t,l){for(var r=0;r<e.state.keyMaps.length;r++){var g=xo(t,e.state.keyMaps[r],l,e);if(g)return g}return e.options.extraKeys&&xo(t,e.options.extraKeys,l,e)||xo(t,e.options.keyMap,l,e)}var Ul=new Y;function Bo(e,t,l,r){var g=e.state.keySeq;if(g){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==g&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,g+" "+t,l,r))return!0}return $s(e,t,l,r)}function $s(e,t,l,r){var g=Nl(e,t,r);return g=="multi"&&(e.state.keySeq=t),g=="handled"&&bt(e,"keyHandled",e,t,l),(g=="handled"||g=="multi")&&(J(l),yr(e)),!!g}function Qs(e,t){var l=Vs(t,!0);return l?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+l,t,function(r){return Zo(e,r,!0)})||Bo(e,l,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Zo(e,r)}):Bo(e,l,t,function(r){return Zo(e,r)}):!1}function jl(e,t,l){return Bo(e,"'"+l+"'",t,function(r){return Zo(e,r,!0)})}var us=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=k(),ut(t,e))return;F&&D<11&&e.keyCode==27&&(e.returnValue=!1);var l=e.keyCode;t.display.shift=l==16||e.shiftKey;var r=Qs(t,e);m&&(us=r?l:null,!r&&l==88&&!Qe&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),I&&!i&&!r&&l==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),l==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function l(r){(r.keyCode==18||!r.altKey)&&(_(t,"CodeMirror-crosshair"),ht(document,"keyup",l),ht(document,"mouseover",l))}Pe(document,"keyup",l),Pe(document,"mouseover",l)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ut(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(or(t.display,e)||ut(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var l=e.keyCode,r=e.charCode;if(m&&l==us){us=null,J(e);return}if(m&&(!e.which||e.which<10)&&Qs(t,e))return;var g=String.fromCharCode(r==null?l:r);if(g=="\b")return;if(jl(t,e,g))return;t.display.input.onKeyPress(e)}var Bl=400,ds=function(e,t,l){this.time=e,this.pos=t,this.button=l};ds.prototype.compare=function(e,t,l){return this.time+Bl>e&&Xn(t,this.pos)==0&&l==this.button};var Ho,Wo;function Hl(e,t){var l=+new Date;return Wo&&Wo.compare(l,e,t)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(l,e,t)?(Wo=new ds(l,e,t),Ho=null,"double"):(Ho=new ds(l,e,t),Wo=null,"single")}function el(e){var t=this,l=t.display;if(ut(t,e)||l.activeTouch&&l.input.supportsTouch())return;if(l.input.ensurePolled(),l.shift=e.shiftKey,or(l,e)){L||(l.scroller.draggable=!1,setTimeout(function(){return l.scroller.draggable=!0},100));return}if(cs(t,e))return;var r=Or(t,e),g=Ne(e),N=r?Hl(r,g):"single";if(window.focus(),g==1&&t.state.selectingText&&t.state.selectingText(e),r&&Wl(t,g,r,N,e))return;g==1?r?zl(t,r,N,e):de(e)==l.scroller&&J(e):g==2?(r&&Vo(t.doc,r),setTimeout(function(){return l.input.focus()},20)):g==3&&(w?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,l,r,g){var N="Click";return r=="double"?N="Double"+N:r=="triple"&&(N="Triple"+N),N=(t==1?"Left":t==2?"Middle":"Right")+N,Bo(e,Gs(N,g),g,function(G){if(typeof G=="string"&&(G=Fo[G]),!G)return!1;var X=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),X=G(e,l)!=Be}finally{e.state.suppressEdits=!1}return X})}function Kl(e,t,l){var r=e.getOption("configureMouse"),g=r?r(e,t,l):{};if(g.unit==null){var N=n?l.shiftKey&&l.metaKey:l.altKey;g.unit=N?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(g.extend==null||e.doc.extend)&&(g.extend=e.doc.extend||l.shiftKey),g.addNew==null&&(g.addNew=i?l.metaKey:l.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(i?l.altKey:l.ctrlKey)),g}function zl(e,t,l,r){F?setTimeout(j(Mi,e),0):e.curOp.focus=k();var g=Kl(e,l,r),N=e.doc.sel,G;e.options.dragDrop&&ct&&!e.isReadOnly()&&l=="single"&&(G=N.contains(t))>-1&&(Xn((G=N.ranges[G]).from(),t)<0||t.xRel>0)&&(Xn(G.to(),t)>0||t.xRel<0)?Gl(e,r,t,g):Vl(e,r,t,g)}function Gl(e,t,l,r){var g=e.display,N=!1,G=dr(e,function(te){L&&(g.scroller.draggable=!1),e.state.draggingText=!1,ht(g.wrapper.ownerDocument,"mouseup",G),ht(g.wrapper.ownerDocument,"mousemove",X),ht(g.scroller,"dragstart",$),ht(g.scroller,"drop",G),N||(J(te),r.addNew||Vo(e.doc,l,null,null,r.extend),L&&!h||F&&D==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),X=function(te){N=N||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},$=function(){return N=!0};L&&(g.scroller.draggable=!0),e.state.draggingText=G,G.copy=!r.moveOnDrag,g.scroller.dragDrop&&g.scroller.dragDrop(),Pe(g.wrapper.ownerDocument,"mouseup",G),Pe(g.wrapper.ownerDocument,"mousemove",X),Pe(g.scroller,"dragstart",$),Pe(g.scroller,"drop",G),no(e),setTimeout(function(){return g.input.focus()},20)}function tl(e,t,l){if(l=="char")return new Ma(t,t);if(l=="word")return e.findWordAt(t);if(l=="line")return new Ma(rn(t.line,0),Kn(e.doc,rn(t.line+1,0)));var r=l(e,t);return new Ma(r.from,r.to)}function Vl(e,t,l,r){var g=e.display,N=e.doc;J(t);var G,X,$=N.sel,te=$.ranges;if(r.addNew&&!r.extend?(X=N.sel.contains(l),X>-1?G=te[X]:G=new Ma(l,l)):(G=N.sel.primary(),X=N.sel.primIndex),r.unit=="rectangle")r.addNew||(G=new Ma(l,l)),l=Or(e,t,!0,!0),X=-1;else{var Oe=tl(e,l,r.unit);r.extend?G=rs(G,Oe.anchor,Oe.head,r.extend):G=Oe}r.addNew?X==-1?(X=te.length,Gr(N,ha(e,te.concat([G]),X),{scroll:!1,origin:"*mouse"})):te.length>1&&te[X].empty()&&r.unit=="char"&&!r.extend?(Gr(N,ha(e,te.slice(0,X).concat(te.slice(X+1)),0),{scroll:!1,origin:"*mouse"}),$=N.sel):is(N,X,G,xe):(X=0,Gr(N,new Kr([G],0),xe),$=N.sel);var Me=l;function ot(jn){if(Xn(Me,jn)==0)return;if(Me=jn,r.unit=="rectangle"){for(var Vn=[],fa=e.options.tabSize,ia=K(En(N,l.line).text,l.ch,fa),wa=K(En(N,jn.line).text,jn.ch,fa),tr=Math.min(ia,wa),jr=Math.max(ia,wa),gr=Math.min(l.line,jn.line),ii=Math.min(e.lastLine(),Math.max(l.line,jn.line));gr<=ii;gr++){var ti=En(N,gr).text,Pr=Ae(ti,tr,fa);tr==jr?Vn.push(new Ma(rn(gr,Pr),rn(gr,Pr))):ti.length>Pr&&Vn.push(new Ma(rn(gr,Pr),rn(gr,Ae(ti,jr,fa))))}Vn.length||Vn.push(new Ma(l,l)),Gr(N,ha(e,$.ranges.slice(0,X).concat(Vn),X),{origin:"*mouse",scroll:!1}),e.scrollIntoView(jn)}else{var ni=G,zr=tl(e,jn,r.unit),Ir=ni.anchor,Lr;Xn(zr.anchor,Ir)>0?(Lr=zr.head,Ir=Ga(ni.from(),zr.anchor)):(Lr=zr.anchor,Ir=$a(ni.to(),zr.head));var Er=$.ranges.slice(0);Er[X]=Yl(e,new Ma(Kn(N,Ir),Lr)),Gr(N,ha(e,Er,X),xe)}}var nt=g.wrapper.getBoundingClientRect(),Kt=0;function pn(jn){var Vn=++Kt,fa=Or(e,jn,!0,r.unit=="rectangle");if(!fa)return;if(Xn(fa,Me)!=0){e.curOp.focus=k(),ot(fa);var ia=Ii(g,N);(fa.line>=ia.to||fa.line<ia.from)&&setTimeout(dr(e,function(){Kt==Vn&&pn(jn)}),150)}else{var wa=jn.clientY<nt.top?-20:jn.clientY>nt.bottom?20:0;wa&&setTimeout(dr(e,function(){if(Kt!=Vn)return;g.scroller.scrollTop+=wa,pn(jn)}),50)}}function Ln(jn){e.state.selectingText=!1,Kt=Infinity,jn&&(J(jn),g.input.focus()),ht(g.wrapper.ownerDocument,"mousemove",Un),ht(g.wrapper.ownerDocument,"mouseup",Hn),N.history.lastSelOrigin=null}var Un=dr(e,function(jn){jn.buttons===0||!Ne(jn)?Ln(jn):pn(jn)}),Hn=dr(e,Ln);e.state.selectingText=Hn,Pe(g.wrapper.ownerDocument,"mousemove",Un),Pe(g.wrapper.ownerDocument,"mouseup",Hn)}function Yl(e,t){var l=t.anchor,r=t.head,g=En(e.doc,l.line);if(Xn(l,r)==0&&l.sticky==r.sticky)return t;var N=An(g);if(!N)return t;var G=Ye(N,l.ch,l.sticky),X=N[G];if(X.from!=l.ch&&X.to!=l.ch)return t;var $=G+(X.from==l.ch==(X.level!=1)?0:1);if($==0||$==N.length)return t;var te;if(r.line!=l.line)te=(r.line-l.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Oe=Ye(N,r.ch,r.sticky),Me=Oe-G||(r.ch-l.ch)*(X.level==1?-1:1);Oe==$-1||Oe==$?te=Me<0:te=Me>0}var ot=N[$+(te?-1:0)],nt=te==(ot.level==1),Kt=nt?ot.from:ot.to,pn=nt?"after":"before";return l.ch==Kt&&l.sticky==pn?t:new Ma(new rn(l.line,Kt,pn),r)}function nl(e,t,l,r){var g,N;if(t.touches)g=t.touches[0].clientX,N=t.touches[0].clientY;else try{g=t.clientX,N=t.clientY}catch(ot){return!1}if(g>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&J(t);var G=e.display,X=G.lineDiv.getBoundingClientRect();if(N>X.bottom||!ce(e,l))return re(t);N-=X.top-G.viewOffset;for(var $=0;$<e.display.gutterSpecs.length;++$){var te=G.gutters.childNodes[$];if(te&&te.getBoundingClientRect().right>=g){var Oe=Ra(e.doc,N),Me=e.display.gutterSpecs[$];return Ue(e,l,e,Oe,Me.className,t),re(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function al(e,t){if(or(e.display,t)||Xl(e,t))return;if(ut(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Xl(e,t){return ce(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),da(e)}var Oo={toString:function(){return"CodeMirror.Init"}},il={},qo={};function $l(e){var t=e.optionHandlers;function l(r,g,N,G){e.defaults[r]=g,N&&(t[r]=G?function(X,$,te){te!=Oo&&N(X,$,te)}:N)}e.defineOption=l,e.Init=Oo,l("value","",function(r,g){return r.setValue(g)},!0),l("mode",null,function(r,g){r.doc.modeOption=g,Dr(r)},!0),l("indentUnit",2,Dr,!0),l("indentWithTabs",!1),l("smartIndent",!0),l("tabSize",4,function(r){Yr(r),da(r),Ha(r)},!0),l("lineSeparator",null,function(r,g){if(r.doc.lineSep=g,!g)return;var N=[],G=r.doc.first;r.doc.iter(function($){for(var te=0;;){var Oe=$.text.indexOf(g,te);if(Oe==-1)break;te=Oe+g.length,N.push(rn(G,Oe))}G++});for(var X=N.length-1;X>=0;X--)bo(r.doc,g,N[X],rn(N[X].line,N[X].ch+g.length))}),l("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,g,N){r.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),N!=Oo&&r.refresh()}),l("specialCharPlaceholder",gn,function(r){return r.refresh()},!0),l("electricChars",!0),l("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),l("spellcheck",!1,function(r,g){return r.getInputField().spellcheck=g},!0),l("autocorrect",!1,function(r,g){return r.getInputField().autocorrect=g},!0),l("autocapitalize",!1,function(r,g){return r.getInputField().autocapitalize=g},!0),l("rtlMoveVisually",!S),l("wholeLineUpdateBefore",!0),l("theme","default",function(r){rl(r),di(r)},!0),l("keyMap","default",function(r,g,N){var G=Jo(g),X=N!=Oo&&Jo(N);X&&X.detach&&X.detach(r,G),G.attach&&G.attach(r,X||null)}),l("extraKeys",null),l("configureMouse",null),l("lineWrapping",!1,Jl,!0),l("gutters",[],function(r,g){r.display.gutterSpecs=Ur(g,r.options.lineNumbers),di(r)},!0),l("fixedGutter",!0,function(r,g){r.display.gutters.style.left=g?lr(r.display)+"px":"0",r.refresh()},!0),l("coverGutterNextToScrollbar",!1,function(r){return mi(r)},!0),l("scrollbarStyle","native",function(r){Qi(r),mi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),l("lineNumbers",!1,function(r,g){r.display.gutterSpecs=Ur(r.options.gutters,g),di(r)},!0),l("firstLineNumber",1,di,!0),l("lineNumberFormatter",function(r){return r},di,!0),l("showCursorWhenSelecting",!1,Wa,!0),l("resetSelectionOnContextMenu",!0),l("lineWiseCopyCut",!0),l("pasteLinesPerSelection",!0),l("selectionsMayTouch",!1),l("readOnly",!1,function(r,g){g=="nocursor"&&(Oi(r),r.display.input.blur()),r.display.input.readOnlyChanged(g)}),l("screenReaderLabel",null,function(r,g){g=g===""?null:g,r.display.input.screenReaderLabelChanged(g)}),l("disableInput",!1,function(r,g){g||r.display.input.reset()},!0),l("dragDrop",!0,Ql),l("allowDropFileTypes",null),l("cursorBlinkRate",530),l("cursorScrollMargin",0),l("cursorHeight",1,Wa,!0),l("singleCursorHeightPerLine",!0,Wa,!0),l("workTime",100),l("workDelay",100),l("flattenSpans",!0,Yr,!0),l("addModeClass",!1,Yr,!0),l("pollInterval",100),l("undoDepth",200,function(r,g){return r.doc.history.undoDepth=g}),l("historyEventDelay",1250),l("viewportMargin",10,function(r){return r.refresh()},!0),l("maxHighlightLength",1e4,Yr,!0),l("moveInputWithCursor",!0,function(r,g){g||r.display.input.resetPosition()}),l("tabindex",null,function(r,g){return r.display.input.getField().tabIndex=g||""}),l("autofocus",null),l("direction","ltr",function(r,g){return r.doc.setDirection(g)},!0),l("phrases",null)}function Ql(e,t,l){var r=l&&l!=Oo;if(!t!=!r){var g=e.display.dragFunctions,N=t?Pe:ht;N(e.display.scroller,"dragstart",g.start),N(e.display.scroller,"dragenter",g.enter),N(e.display.scroller,"dragover",g.over),N(e.display.scroller,"dragleave",g.leave),N(e.display.scroller,"drop",g.drop)}}function Jl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),mn(e)),kr(e),Ha(e),da(e),setTimeout(function(){return mi(e)},100)}function fr(e,t){var l=this;if(!(this instanceof fr))return new fr(e,t);this.options=t=t?O(t):{},O(il,t,!1);var r=t.value;typeof r=="string"?r=new ei(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var g=new fr.inputStyles[t.inputStyle](this),N=this.display=new ji(e,r,g,t);N.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Qi(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 Y,keySeq:null,specialChars:null},t.autofocus&&!s&&N.input.focus(),F&&D<11&&setTimeout(function(){return l.display.input.reset(!0)},20),Zl(this),Al(),ui(this),this.curOp.forceUpdate=!0,vs(this,r),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){l.hasFocus()&&!l.state.focused&&li(l)},20):Oi(this);for(var G in qo)qo.hasOwnProperty(G)&&qo[G](this,t[G],Oo);rr(this),t.finishInit&&t.finishInit(this);for(var X=0;X<fs.length;++X)fs[X](this);Ei(this),L&&t.lineWrapping&&getComputedStyle(N.lineDiv).textRendering=="optimizelegibility"&&(N.lineDiv.style.textRendering="auto")}fr.defaults=il,fr.optionHandlers=qo;function Zl(e){var t=e.display;Pe(t.scroller,"mousedown",dr(e,el)),F&&D<11?Pe(t.scroller,"dblclick",dr(e,function($){if(ut(e,$))return;var te=Or(e,$);if(!te||cs(e,$)||or(e.display,$))return;J($);var Oe=e.findWordAt(te);Vo(e.doc,Oe.anchor,Oe.head)})):Pe(t.scroller,"dblclick",function($){return ut(e,$)||J($)}),Pe(t.scroller,"contextmenu",function($){return al(e,$)}),Pe(t.input.getField(),"contextmenu",function($){t.scroller.contains($.target)||al(e,$)});var l,r={end:0};function g(){t.activeTouch&&(l=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function N($){if($.touches.length!=1)return!1;var te=$.touches[0];return te.radiusX<=1&&te.radiusY<=1}function G($,te){if(te.left==null)return!0;var Oe=te.left-$.left,Me=te.top-$.top;return Oe*Oe+Me*Me>20*20}Pe(t.scroller,"touchstart",function($){if(!ut(e,$)&&!N($)&&!cs(e,$)){t.input.ensurePolled(),clearTimeout(l);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-r.end<=300?r:null},$.touches.length==1&&(t.activeTouch.left=$.touches[0].pageX,t.activeTouch.top=$.touches[0].pageY)}}),Pe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Pe(t.scroller,"touchend",function($){var te=t.activeTouch;if(te&&!or(t,$)&&te.left!=null&&!te.moved&&new Date-te.start<300){var Oe=e.coordsChar(t.activeTouch,"page"),Me;!te.prev||G(te,te.prev)?Me=new Ma(Oe,Oe):!te.prev.prev||G(te,te.prev.prev)?Me=e.findWordAt(Oe):Me=new Ma(rn(Oe.line,0),Kn(e.doc,rn(Oe.line+1,0))),e.setSelection(Me.anchor,Me.head),e.focus(),J($)}g()}),Pe(t.scroller,"touchcancel",g),Pe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Di(e,t.scroller.scrollTop),Mr(e,t.scroller.scrollLeft,!0),Ue(e,"scroll",e))}),Pe(t.scroller,"mousewheel",function($){return Hi(e,$)}),Pe(t.scroller,"DOMMouseScroll",function($){return Hi(e,$)}),Pe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function($){ut(e,$)||ue($)},over:function($){ut(e,$)||(Rl(e,$),ue($))},start:function($){return Sl(e,$)},drop:dr(e,wl),leave:function($){ut(e,$)||Hs(e)}};var X=t.input.getField();Pe(X,"keyup",function($){return Zs.call(e,$)}),Pe(X,"keydown",dr(e,Js)),Pe(X,"keypress",dr(e,qs)),Pe(X,"focus",function($){return li(e,$)}),Pe(X,"blur",function($){return Oi(e,$)})}var fs=[];fr.defineInitHook=function(e){return fs.push(e)};function Ko(e,t,l,r){var g=e.doc,N;l==null&&(l="add"),l=="smart"&&(g.mode.indent?N=nr(e,t).state:l="prev");var G=e.options.tabSize,X=En(g,t),$=K(X.text,null,G);X.stateAfter&&(X.stateAfter=null);var te=X.text.match(/^\s*/)[0],Oe;if(!r&&!/\S/.test(X.text))Oe=0,l="not";else if(l=="smart"&&(Oe=g.mode.indent(N,X.text.slice(te.length),X.text),Oe==Be||Oe>150)){if(!r)return;l="prev"}l=="prev"?t>g.first?Oe=K(En(g,t-1).text,null,G):Oe=0:l=="add"?Oe=$+e.options.indentUnit:l=="subtract"?Oe=$-e.options.indentUnit:typeof l=="number"&&(Oe=$+l),Oe=Math.max(0,Oe);var Me="",ot=0;if(e.options.indentWithTabs)for(var nt=Math.floor(Oe/G);nt;--nt)ot+=G,Me+=" ";if(ot<Oe&&(Me+=fe(Oe-ot)),Me!=te)return bo(g,Me,rn(t,0),rn(t,te.length),"+input"),X.stateAfter=null,!0;for(var Kt=0;Kt<g.sel.ranges.length;Kt++){var pn=g.sel.ranges[Kt];if(pn.head.line==t&&pn.head.ch<te.length){var Ln=rn(t,te.length);is(g,Kt,new Ma(Ln,Ln));break}}}var Ti=null;function es(e){Ti=e}function hs(e,t,l,r,g){var N=e.doc;e.display.shift=!1,r||(r=N.sel);var G=+new Date-200,X=g=="paste"||e.state.pasteIncoming>G,$=st(t),te=null;if(X&&r.ranges.length>1)if(Ti&&Ti.text.join(`
|
|
`)==t){if(r.ranges.length%Ti.text.length==0){te=[];for(var Oe=0;Oe<Ti.text.length;Oe++)te.push(N.splitLines(Ti.text[Oe]))}}else $.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(te=Lt($,function(Un){return[Un]}));for(var Me=e.curOp.updateInput,ot=r.ranges.length-1;ot>=0;ot--){var nt=r.ranges[ot],Kt=nt.from(),pn=nt.to();nt.empty()&&(l&&l>0?Kt=rn(Kt.line,Kt.ch-l):e.state.overwrite&&!X?pn=rn(pn.line,Math.min(En(N,pn.line).text.length,pn.ch+Ve($).length)):X&&Ti&&Ti.lineWise&&Ti.text.join(`
|
|
`)==$.join(`
|
|
`)&&(Kt=pn=rn(Kt.line,0)));var Ln={from:Kt,to:pn,text:te?te[ot%te.length]:$,origin:g||(X?"paste":e.state.cutIncoming>G?"cut":"+input")};yo(e.doc,Ln),bt(e,"inputRead",e,Ln)}t&&!X&&sl(e,t),_i(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Me),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var l=e.clipboardData&&e.clipboardData.getData("Text");if(l)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wr(t,function(){return hs(t,l,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var l=e.doc.sel,r=l.ranges.length-1;r>=0;r--){var g=l.ranges[r];if(g.head.ch>100||r&&l.ranges[r-1].head.line==g.head.line)continue;var N=e.getModeAt(g.head),G=!1;if(N.electricChars){for(var X=0;X<N.electricChars.length;X++)if(t.indexOf(N.electricChars.charAt(X))>-1){G=Ko(e,g.head.line,"smart");break}}else N.electricInput&&(N.electricInput.test(En(e.doc,g.head.line).text.slice(0,g.head.ch))&&(G=Ko(e,g.head.line,"smart")));G&&bt(e,"electricInput",e,g.head.line)}}function ll(e){for(var t=[],l=[],r=0;r<e.doc.sel.ranges.length;r++){var g=e.doc.sel.ranges[r].head.line,N={anchor:rn(g,0),head:rn(g+1,0)};l.push(N),t.push(e.getRange(N.anchor,N.head))}return{text:t,ranges:l}}function ul(e,t,l,r){e.setAttribute("autocorrect",l?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return L?e.style.width="1000px":e.setAttribute("wrap","off"),a&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,l=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,g){var N=this.options,G=N[r];if(N[r]==g&&r!="mode")return;N[r]=g,t.hasOwnProperty(r)&&dr(this,t[r])(this,g,G),Ue(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,g){this.state.keyMaps[g?"push":"unshift"](Jo(r))},removeKeyMap:function(r){for(var g=this.state.keyMaps,N=0;N<g.length;++N)if(g[N]==r||g[N].name==r)return g.splice(N,1),!0},addOverlay:Ar(function(r,g){var N=r.token?r:e.getMode(this.options,r);if(N.startState)throw new Error("Overlays may not be stateful.");Pt(this.state.overlays,{mode:N,modeSpec:r,opaque:g&&g.opaque,priority:g&&g.priority||0},function(G){return G.priority}),this.state.modeGen++,Ha(this)}),removeOverlay:Ar(function(r){for(var g=this.state.overlays,N=0;N<g.length;++N){var G=g[N].modeSpec;if(G==r||typeof r=="string"&&G.name==r){g.splice(N,1),this.state.modeGen++,Ha(this);return}}}),indentLine:Ar(function(r,g,N){typeof g!="string"&&typeof g!="number"&&(g==null?g=this.options.smartIndent?"smart":"prev":g=g?"add":"subtract"),Xa(this.doc,r)&&Ko(this,r,g,N)}),indentSelection:Ar(function(r){for(var g=this.doc.sel.ranges,N=-1,G=0;G<g.length;G++){var X=g[G];if(X.empty())X.head.line>N&&(Ko(this,X.head.line,r,!0),N=X.head.line,G==this.doc.sel.primIndex&&_i(this));else{var $=X.from(),te=X.to(),Oe=Math.max(N,$.line);N=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var Me=Oe;Me<N;++Me)Ko(this,Me,r);var ot=this.doc.sel.ranges;$.ch==0&&g.length==ot.length&&ot[G].from().ch>0&&is(this.doc,G,new Ma($,ot[G].to()),me)}}}),getTokenAt:function(r,g){return Sr(this,r,g)},getLineTokens:function(r,g){return Sr(this,rn(r),g,!0)},getTokenTypeAt:function(r){r=Kn(this.doc,r);var g=mr(this,En(this.doc,r.line)),N=0,G=(g.length-1)/2,X=r.ch,$;if(X==0)$=g[2];else for(;;){var te=N+G>>1;if((te?g[te*2-1]:0)>=X)G=te;else if(g[te*2+1]<X)N=te+1;else{$=g[te*2+2];break}}var Oe=$?$.indexOf("overlay "):-1;return Oe<0?$:Oe==0?null:$.slice(0,Oe-1)},getModeAt:function(r){var g=this.doc.mode;return g.innerMode?e.innerMode(g,this.getTokenAt(r).state).mode:g},getHelper:function(r,g){return this.getHelpers(r,g)[0]},getHelpers:function(r,g){var N=[];if(!l.hasOwnProperty(g))return N;var G=l[g],X=this.getModeAt(r);if(typeof X[g]=="string")G[X[g]]&&N.push(G[X[g]]);else if(X[g])for(var $=0;$<X[g].length;$++){var te=G[X[g][$]];te&&N.push(te)}else X.helperType&&G[X.helperType]?N.push(G[X.helperType]):G[X.name]&&N.push(G[X.name]);for(var Oe=0;Oe<G._global.length;Oe++){var Me=G._global[Oe];Me.pred(X,this)&&ee(N,Me.val)==-1&&N.push(Me.val)}return N},getStateAfter:function(r,g){var N=this.doc;return r=Aa(N,r==null?N.first+N.size-1:r),nr(this,r+1,g).state},cursorCoords:function(r,g){var N,G=this.doc.sel.primary();return r==null?N=G.head:typeof r=="object"?N=Kn(this.doc,r):N=r?G.from():G.to(),dn(this,N,g||"page")},charCoords:function(r,g){return Ht(this,Kn(this.doc,r),g||"page")},coordsChar:function(r,g){return r=en(this,r,g||"page"),ea(this,r.left,r.top)},lineAtHeight:function(r,g){return r=en(this,{top:r,left:0},g||"page").top,Ra(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,g,N){var G=!1,X;if(typeof r=="number"){var $=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>$&&(r=$,G=!0),X=En(this.doc,r)}else X=r;return ya(this,X,{top:0,left:0},g||"page",N||G).top+(G?this.doc.height-yn(X):0)},defaultTextHeight:function(){return Da(this.display)},defaultCharWidth:function(){return Sa(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,g,N,G,X){var $=this.display;r=dn(this,Kn(this.doc,r));var te=r.bottom,Oe=r.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),$.sizer.appendChild(g),G=="over")te=r.top;else if(G=="above"||G=="near"){var Me=Math.max($.wrapper.clientHeight,this.doc.height),ot=Math.max($.sizer.clientWidth,$.lineSpace.clientWidth);(G=="above"||r.bottom+g.offsetHeight>Me)&&r.top>g.offsetHeight?te=r.top-g.offsetHeight:r.bottom+g.offsetHeight<=Me&&(te=r.bottom),Oe+g.offsetWidth>ot&&(Oe=ot-g.offsetWidth)}g.style.top=te+"px",g.style.left=g.style.right="",X=="right"?(Oe=$.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(X=="left"?Oe=0:X=="middle"&&(Oe=($.sizer.clientWidth-g.offsetWidth)/2),g.style.left=Oe+"px"),N&&Gi(this,{left:Oe,top:te,right:Oe+g.offsetWidth,bottom:te+g.offsetHeight})},triggerOnKeyDown:Ar(Js),triggerOnKeyPress:Ar(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Ar(el),execCommand:function(r){if(Fo.hasOwnProperty(r))return Fo[r].call(null,this)},triggerElectric:Ar(function(r){sl(this,r)}),findPosH:function(r,g,N,G){var X=1;g<0&&(X=-1,g=-g);for(var $=Kn(this.doc,r),te=0;te<g&&!($=ps(this.doc,$,X,N,G),$.hitSide);++te);return $},moveH:Ar(function(r,g){var N=this;this.extendSelectionsBy(function(G){return N.display.shift||N.doc.extend||G.empty()?ps(N.doc,G.head,r,g,N.options.rtlMoveVisually):r<0?G.from():G.to()},Le)}),deleteH:Ar(function(r,g){var N=this.doc.sel,G=this.doc;N.somethingSelected()?G.replaceSelection("",null,"+delete"):To(this,function(X){var $=ps(G,X.head,r,g,!1);return r<0?{from:$,to:X.head}:{from:X.head,to:$}})}),findPosV:function(r,g,N,G){var X=1,$=G;g<0&&(X=-1,g=-g);for(var te=Kn(this.doc,r),Oe=0;Oe<g;++Oe){var Me=dn(this,te,"div");if($==null?$=Me.left:Me.left=$,te=cl(this,Me,X,N),te.hitSide)break}return te},moveV:Ar(function(r,g){var N=this,G=this.doc,X=[],$=!this.display.shift&&!G.extend&&G.sel.somethingSelected();if(G.extendSelectionsBy(function(Oe){if($)return r<0?Oe.from():Oe.to();var Me=dn(N,Oe.head,"div");Oe.goalColumn!=null&&(Me.left=Oe.goalColumn),X.push(Me.left);var ot=cl(N,Me,r,g);return g=="page"&&Oe==G.sel.primary()&&Vi(N,Ht(N,ot,"div").top-Me.top),ot},Le),X.length)for(var te=0;te<G.sel.ranges.length;te++)G.sel.ranges[te].goalColumn=X[te]}),findWordAt:function(r){var g=this.doc,N=En(g,r.line).text,G=r.ch,X=r.ch;if(N){var $=this.getHelper(r,"wordChars");(r.sticky=="before"||X==N.length)&&G?--G:++X;for(var te=N.charAt(G),Oe=Rt(te,$)?function(Me){return Rt(Me,$)}:/\s/.test(te)?function(Me){return/\s/.test(Me)}:function(Me){return!/\s/.test(Me)&&!Rt(Me)};G>0&&Oe(N.charAt(G-1));)--G;for(;X<N.length&&Oe(N.charAt(X));)++X}return new Ma(rn(r.line,G),rn(r.line,X))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),Ue(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==k()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ar(function(r,g){Ri(this,r,g)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-je(this)-this.display.barHeight,width:r.scrollWidth-je(this)-this.display.barWidth,clientHeight:q(this),clientWidth:_e(this)}},scrollIntoView:Ar(function(r,g){r==null?(r={from:this.doc.sel.primary().head,to:null},g==null&&(g=this.options.cursorScrollMargin)):typeof r=="number"?r={from:rn(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=g||0,r.from.line!=null?fo(this,r):Ai(this,r.from,r.to,r.margin)}),setSize:Ar(function(r,g){var N=this,G=function($){return typeof $=="number"||/^\d+$/.test(String($))?$+"px":$};r!=null&&(this.display.wrapper.style.width=G(r)),g!=null&&(this.display.wrapper.style.height=G(g)),this.options.lineWrapping&&Qn(this);var X=this.display.viewFrom;this.doc.iter(X,this.display.viewTo,function($){if($.widgets){for(var te=0;te<$.widgets.length;te++)if($.widgets[te].noHScroll){za(N,X,"widget");break}}++X}),this.curOp.forceUpdate=!0,Ue(this,"refresh",this)}),operation:function(r){return Wr(this,r)},startOperation:function(){return ui(this)},endOperation:function(){return Ei(this)},refresh:Ar(function(){var r=this.display.cachedTextHeight;Ha(this),this.curOp.forceUpdate=!0,da(this),Ri(this,this.doc.scrollLeft,this.doc.scrollTop),Zi(this.display),(r==null||Math.abs(r-Da(this.display))>.5||this.options.lineWrapping)&&kr(this),Ue(this,"refresh",this)}),swapDoc:Ar(function(r){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,r),da(this),this.display.input.reset(),Ri(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,bt(this,"swapDoc",this,g),g}),phrase:function(r){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,r)?g[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},he(e),e.registerHelper=function(r,g,N){l.hasOwnProperty(r)||(l[r]=e[r]={_global:[]}),l[r][g]=N},e.registerGlobalHelper=function(r,g,N,G){e.registerHelper(r,g,G),l[r]._global.push({pred:N,val:G})}}function ps(e,t,l,r,g){var N=t,G=l,X=En(e,t.line),$=g&&e.direction=="rtl"?-l:l;function te(){var Hn=t.line+$;return Hn<e.first||Hn>=e.first+e.size?!1:(t=new rn(Hn,t.ch,t.sticky),X=En(e,Hn))}function Oe(Hn){var jn;if(r=="codepoint"){var Vn=X.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Vn)?jn=null:jn=new rn(t.line,Math.max(0,Math.min(X.text.length,t.ch+l*(Vn>=55296&&Vn<56320?2:1))),-l)}else g?jn=Il(e.cm,X,t,l):jn=ss(X,t,l);if(jn==null)if(!Hn&&te())t=ls(g,e.cm,X,t.line,$);else return!1;else t=jn;return!0}if(r=="char"||r=="codepoint")Oe();else if(r=="column")Oe(!0);else if(r=="word"||r=="group")for(var Me=null,ot=r=="group",nt=e.cm&&e.cm.getHelper(t,"wordChars"),Kt=!0;!(l<0&&!Oe(!Kt));Kt=!1){var pn=X.text.charAt(t.ch)||`
|
|
`,Ln=Rt(pn,nt)?"w":ot&&pn==`
|
|
`?"n":!ot||/\s/.test(pn)?null:"p";if(ot&&!Kt&&!Ln&&(Ln="s"),Me&&Me!=Ln){l<0&&(l=1,Oe(),t.sticky="after");break}if(Ln&&(Me=Ln),l>0&&!Oe(!Kt))break}var Un=Xo(e,t,N,G,!0);return hr(N,Un)&&(Un.hitSide=!0),Un}function cl(e,t,l,r){var g=e.doc,N=t.left,G;if(r=="page"){var X=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),$=Math.max(X-.5*Da(e.display),3);G=(l>0?t.bottom:t.top)+l*$}else r=="line"&&(G=l>0?t.bottom+3:t.top-3);for(var te;!(te=ea(e,N,G),!te.outside);){if(l<0?G<=0:G>=g.height){te.hitSide=!0;break}G+=l*5}return te}var Za=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Y,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Za.prototype.init=function(e){var t=this,l=this,r=l.cm,g=l.div=e.lineDiv;ul(g,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function N(X){for(var $=X.target;$;$=$.parentNode){if($==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test($.className))break}return!1}Pe(g,"paste",function(X){if(!N(X)||ut(r,X)||ol(X,r))return;D<=11&&setTimeout(dr(r,function(){return t.updateFromDOM()}),20)}),Pe(g,"compositionstart",function(X){t.composing={data:X.data,done:!1}}),Pe(g,"compositionupdate",function(X){t.composing||(t.composing={data:X.data,done:!1})}),Pe(g,"compositionend",function(X){t.composing&&(X.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Pe(g,"touchstart",function(){return l.forceCompositionEnd()}),Pe(g,"input",function(){t.composing||t.readFromDOMSoon()});function G(X){if(!N(X)||ut(r,X))return;if(r.somethingSelected())es({lineWise:!1,text:r.getSelections()}),X.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var $=ll(r);es({lineWise:!0,text:$.text}),X.type=="cut"&&r.operation(function(){r.setSelections($.ranges,0,me),r.replaceSelection("",null,"cut")})}else return;if(X.clipboardData){X.clipboardData.clearData();var te=Ti.text.join(`
|
|
`);if(X.clipboardData.setData("Text",te),X.clipboardData.getData("Text")==te){X.preventDefault();return}}var Oe=dl(),Me=Oe.firstChild;r.display.lineSpace.insertBefore(Oe,r.display.lineSpace.firstChild),Me.value=Ti.text.join(`
|
|
`);var ot=document.activeElement;W(Me),setTimeout(function(){r.display.lineSpace.removeChild(Oe),ot.focus(),ot==g&&l.showPrimarySelection()},50)}Pe(g,"copy",G),Pe(g,"cut",G)},Za.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Za.prototype.prepareSelection=function(){var e=Jr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Za.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Za.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Za.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,l=t.doc.sel.primary(),r=l.from(),g=l.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||g.line<t.display.viewFrom){e.removeAllRanges();return}var N=ts(t,e.anchorNode,e.anchorOffset),G=ts(t,e.focusNode,e.focusOffset);if(N&&!N.bad&&G&&!G.bad&&Xn(Ga(N,G),r)==0&&Xn($a(N,G),g)==0)return;var X=t.display.view,$=r.line>=t.display.viewFrom&&fl(t,r)||{node:X[0].measure.map[2],offset:0},te=g.line<t.display.viewTo&&fl(t,g);if(!te){var Oe=X[X.length-1].measure,Me=Oe.maps?Oe.maps[Oe.maps.length-1]:Oe.map;te={node:Me[Me.length-1],offset:Me[Me.length-2]-Me[Me.length-3]}}if(!$||!te){e.removeAllRanges();return}var ot=e.rangeCount&&e.getRangeAt(0),nt;try{nt=p($.node,$.offset,te.offset,te.node)}catch(Kt){}nt&&(!I&&t.state.focused?(e.collapse($.node,$.offset),nt.collapsed||(e.removeAllRanges(),e.addRange(nt))):(e.removeAllRanges(),e.addRange(nt)),ot&&e.anchorNode==null?e.addRange(ot):I&&this.startGracePeriod()),this.rememberSelection()},Za.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)},Za.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},Za.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Za.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Za.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Za.prototype.blur=function(){this.div.blur()},Za.prototype.getField=function(){return this.div},Za.prototype.supportsTouch=function(){return!0},Za.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Za.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Za.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&b&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var l=ts(t,e.anchorNode,e.anchorOffset),r=ts(t,e.focusNode,e.focusOffset);l&&r&&Wr(t,function(){Gr(t.doc,Fn(l,r),me),(l.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Za.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,l=e.doc.sel.primary(),r=l.from(),g=l.to();if(r.ch==0&&r.line>e.firstLine()&&(r=rn(r.line-1,En(e.doc,r.line-1).length)),g.ch==En(e.doc,g.line).text.length&&g.line<e.lastLine()&&(g=rn(g.line+1,0)),r.line<t.viewFrom||g.line>t.viewTo-1)return!1;var N,G,X;r.line==t.viewFrom||(N=Qa(e,r.line))==0?(G=la(t.view[0].line),X=t.view[0].node):(G=la(t.view[N].line),X=t.view[N-1].node.nextSibling);var $=Qa(e,g.line),te,Oe;if($==t.view.length-1?(te=t.viewTo-1,Oe=t.lineDiv.lastChild):(te=la(t.view[$+1].line)-1,Oe=t.view[$+1].node.previousSibling),!X)return!1;for(var Me=e.doc.splitLines(tu(e,X,Oe,G,te)),ot=ga(e.doc,rn(G,0),rn(te,En(e.doc,te).text.length));Me.length>1&&ot.length>1;)if(Ve(Me)==Ve(ot))Me.pop(),ot.pop(),te--;else if(Me[0]==ot[0])Me.shift(),ot.shift(),G++;else break;for(var nt=0,Kt=0,pn=Me[0],Ln=ot[0],Un=Math.min(pn.length,Ln.length);nt<Un&&pn.charCodeAt(nt)==Ln.charCodeAt(nt);)++nt;for(var Hn=Ve(Me),jn=Ve(ot),Vn=Math.min(Hn.length-(Me.length==1?nt:0),jn.length-(ot.length==1?nt:0));Kt<Vn&&Hn.charCodeAt(Hn.length-Kt-1)==jn.charCodeAt(jn.length-Kt-1);)++Kt;if(Me.length==1&&ot.length==1&&G==r.line)for(;nt&&nt>r.ch&&Hn.charCodeAt(Hn.length-Kt-1)==jn.charCodeAt(jn.length-Kt-1);)nt--,Kt++;Me[Me.length-1]=Hn.slice(0,Hn.length-Kt).replace(/^\u200b+/,""),Me[0]=Me[0].slice(nt).replace(/\u200b+$/,"");var fa=rn(G,nt),ia=rn(te,ot.length?Ve(ot).length-Kt:0);if(Me.length>1||Me[0]||Xn(fa,ia))return bo(e.doc,Me,fa,ia,"+input"),!0},Za.prototype.ensurePolled=function(){this.forceCompositionEnd()},Za.prototype.reset=function(){this.forceCompositionEnd()},Za.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Za.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)},Za.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wr(this.cm,function(){return Ha(e.cm)})},Za.prototype.setUneditable=function(e){e.contentEditable="false"},Za.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||dr(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Za.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Za.prototype.onContextMenu=function(){},Za.prototype.resetPosition=function(){},Za.prototype.needsContentAttribute=!0;function fl(e,t){var l=We(e,t.line);if(!l||l.hidden)return null;var r=En(e.doc,t.line),g=ne(l,r,t.line),N=An(r,e.doc.direction),G="left";if(N){var X=Ye(N,t.ch);G=X%2?"right":"left"}var $=Wt(g.map,t.ch,G);return $.offset=$.collapse=="right"?$.end:$.start,$}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Co(e,t){return t&&(e.bad=!0),e}function tu(e,t,l,r,g){var N="",G=!1,X=e.doc.lineSeparator(),$=!1;function te(nt){return function(Kt){return Kt.id==nt}}function Oe(){G&&(N+=X,$&&(N+=X),G=$=!1)}function Me(nt){nt&&(Oe(),N+=nt)}function ot(nt){if(nt.nodeType==1){var Kt=nt.getAttribute("cm-text");if(Kt){Me(Kt);return}var pn=nt.getAttribute("cm-marker"),Ln;if(pn){var Un=e.findMarks(rn(r,0),rn(g+1,0),te(+pn));Un.length&&(Ln=Un[0].find(0))&&Me(ga(e.doc,Ln.from,Ln.to).join(X));return}if(nt.getAttribute("contenteditable")=="false")return;var Hn=/^(pre|div|p|li|table|br)$/i.test(nt.nodeName);if(!/^br$/i.test(nt.nodeName)&&nt.textContent.length==0)return;Hn&&Oe();for(var jn=0;jn<nt.childNodes.length;jn++)ot(nt.childNodes[jn]);/^(pre|p)$/i.test(nt.nodeName)&&($=!0),Hn&&(G=!0)}else nt.nodeType==3&&Me(nt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ot(t),t==l);)t=t.nextSibling,$=!1;return N}function ts(e,t,l){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[l],!r)return Co(e.clipPos(rn(e.display.viewTo-1)),!0);t=null,l=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var g=0;g<e.display.view.length;g++){var N=e.display.view[g];if(N.node==r)return nu(N,t,l)}}function nu(e,t,l){var r=e.text.firstChild,g=!1;if(!t||!E(r,t))return Co(rn(la(e.line),0),!0);if(t==r&&(g=!0,t=r.childNodes[l],l=0,!t)){var N=e.rest?Ve(e.rest):e.line;return Co(rn(la(N),N.text.length),g)}var G=t.nodeType==3?t:null,X=t;for(!G&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(G=t.firstChild,l&&(l=G.nodeValue.length));X.parentNode!=r;)X=X.parentNode;var $=e.measure,te=$.maps;function Oe(Ln,Un,Hn){for(var jn=-1;jn<(te?te.length:0);jn++)for(var Vn=jn<0?$.map:te[jn],fa=0;fa<Vn.length;fa+=3){var ia=Vn[fa+2];if(ia==Ln||ia==Un){var wa=la(jn<0?e.line:e.rest[jn]),tr=Vn[fa]+Hn;return(Hn<0||ia!=Ln)&&(tr=Vn[fa+(Hn?1:0)]),rn(wa,tr)}}}var Me=Oe(G,X,l);if(Me)return Co(Me,g);for(var ot=X.nextSibling,nt=G?G.nodeValue.length-l:0;ot;ot=ot.nextSibling){if(Me=Oe(ot,ot.firstChild,0),Me)return Co(rn(Me.line,Me.ch-nt),g);nt+=ot.textContent.length}for(var Kt=X.previousSibling,pn=l;Kt;Kt=Kt.previousSibling){if(Me=Oe(Kt,Kt.firstChild,-1),Me)return Co(rn(Me.line,Me.ch+pn),g);pn+=Kt.textContent.length}}var wr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Y,this.hasSelection=!1,this.composing=null};wr.prototype.init=function(e){var t=this,l=this,r=this.cm;this.createField(e);var g=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),a&&(g.style.width="0px"),Pe(g,"input",function(){F&&D>=9&&t.hasSelection&&(t.hasSelection=null),l.poll()}),Pe(g,"paste",function(G){if(ut(r,G)||ol(G,r))return;r.state.pasteIncoming=+new Date,l.fastPoll()});function N(G){if(ut(r,G))return;if(r.somethingSelected())es({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var X=ll(r);es({lineWise:!0,text:X.text}),G.type=="cut"?r.setSelections(X.ranges,null,me):(l.prevInput="",g.value=X.text.join(`
|
|
`),W(g))}else return;G.type=="cut"&&(r.state.cutIncoming=+new Date)}Pe(g,"cut",N),Pe(g,"copy",N),Pe(e.scroller,"paste",function(G){if(or(e,G)||ut(r,G))return;if(!g.dispatchEvent){r.state.pasteIncoming=+new Date,l.focus();return}var X=new Event("paste");X.clipboardData=G.clipboardData,g.dispatchEvent(X)}),Pe(e.lineSpace,"selectstart",function(G){or(e,G)||J(G)}),Pe(g,"compositionstart",function(){var G=r.getCursor("from");l.composing&&l.composing.range.clear(),l.composing={start:G,range:r.markText(G,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Pe(g,"compositionend",function(){l.composing&&(l.poll(),l.composing.range.clear(),l.composing=null)})},wr.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},wr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},wr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,l=e.doc,r=Jr(e);if(e.options.moveInputWithCursor){var g=dn(e,l.sel.primary().head,"div"),N=t.wrapper.getBoundingClientRect(),G=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,g.top+G.top-N.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,g.left+G.left-N.left))}return r},wr.prototype.showSelection=function(e){var t=this.cm,l=t.display;f(l.cursorDiv,e.cursors),f(l.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},wr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var l=t.getSelection();this.textarea.value=l,t.state.focused&&W(this.textarea),F&&D>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",F&&D>=9&&(this.hasSelection=null))},wr.prototype.getField=function(){return this.textarea},wr.prototype.supportsTouch=function(){return!1},wr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||k()!=this.textarea))try{this.textarea.focus()}catch(e){}},wr.prototype.blur=function(){this.textarea.blur()},wr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},wr.prototype.receivedFocus=function(){this.slowPoll()},wr.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()})},wr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function l(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,l)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,l)},wr.prototype.poll=function(){var e=this,t=this.cm,l=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||pt(l)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var g=l.value;if(g==r&&!t.somethingSelected())return!1;if(F&&D>=9&&this.hasSelection===g||i&&/[\uf700-\uf7ff]/.test(g))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var N=g.charCodeAt(0);if(N==8203&&!r&&(r="\u200B"),N==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,X=Math.min(r.length,g.length);G<X&&r.charCodeAt(G)==g.charCodeAt(G);)++G;return Wr(t,function(){hs(t,g.slice(G),r.length-G,null,e.composing?"*compose":null),g.length>1e3||g.indexOf(`
|
|
`)>-1?l.value=e.prevInput="":e.prevInput=g,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},wr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},wr.prototype.onKeyPress=function(){F&&D>=9&&(this.hasSelection=null),this.fastPoll()},wr.prototype.onContextMenu=function(e){var t=this,l=t.cm,r=l.display,g=t.textarea;t.contextMenuPending&&t.contextMenuPending();var N=Or(l,e),G=r.scroller.scrollTop;if(!N||m)return;var X=l.options.resetSelectionOnContextMenu;X&&l.doc.sel.contains(N)==-1&&dr(l,Gr)(l.doc,Fn(N),me);var $=g.style.cssText,te=t.wrapper.style.cssText,Oe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-Oe.top-5)+"px; left: "+(e.clientX-Oe.left-5)+`px;
|
|
z-index: 1000; background: `+(F?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Me;L&&(Me=window.scrollY),r.input.focus(),L&&window.scrollTo(null,Me),r.input.reset(),l.somethingSelected()||(g.value=t.prevInput=" "),t.contextMenuPending=nt,r.selForContextMenu=l.doc.sel,clearTimeout(r.detectingSelectAll);function ot(){if(g.selectionStart!=null){var pn=l.somethingSelected(),Ln="\u200B"+(pn?g.value:"");g.value="\u21DA",g.value=Ln,t.prevInput=pn?"":"\u200B",g.selectionStart=1,g.selectionEnd=Ln.length,r.selForContextMenu=l.doc.sel}}function nt(){if(t.contextMenuPending!=nt)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,g.style.cssText=$,F&&D<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=G),g.selectionStart!=null){(!F||F&&D<9)&&ot();var pn=0,Ln=function(){r.selForContextMenu==l.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&t.prevInput=="\u200B"?dr(l,Ds)(l):pn++<10?r.detectingSelectAll=setTimeout(Ln,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ln,200)}}if(F&&D>=9&&ot(),w){ue(e);var Kt=function(){ht(window,"mouseup",Kt),setTimeout(nt,20)};Pe(window,"mouseup",Kt)}else setTimeout(nt,50)},wr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},wr.prototype.setUneditable=function(){},wr.prototype.needsContentAttribute=!1;function au(e,t){if(t=t?O(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 l=k();t.autofocus=l==e||e.getAttribute("autofocus")!=null&&l==document.body}function r(){e.value=X.getValue()}var g;if(e.form&&(Pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var N=e.form;g=N.submit;try{var G=N.submit=function(){r(),N.submit=g,N.submit(),N.submit=G}}catch($){}}t.finishInit=function($){$.save=r,$.getTextArea=function(){return e},$.toTextArea=function(){$.toTextArea=isNaN,r(),e.parentNode.removeChild($.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=g))}},e.style.display="none";var X=fr(function($){return e.parentNode.insertBefore($,e.nextSibling)},t);return X}function ru(e){e.off=ht,e.on=Pe,e.wheelEventPixels=Bi,e.Doc=ei,e.splitLines=st,e.countColumn=K,e.findColumn=Ae,e.isWordChar=tt,e.Pass=Be,e.signal=Ue,e.Line=Cn,e.changeEnd=Jn,e.scrollbarModel=$i,e.Pos=rn,e.cmpPos=Xn,e.modes=Ot,e.mimeModes=qe,e.resolveMode=Ce,e.getMode=De,e.modeExtensions=mt,e.extendMode=Jt,e.copyState=cn,e.startState=sa,e.innerMode=wn,e.commands=Fo,e.keyMap=Ki,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=zn,e.SharedTextMarker=No,e.TextMarker=qi,e.LineWidget=ko,e.e_preventDefault=J,e.e_stopPropagation=Z,e.e_stop=ue,e.addClass=U,e.contains=E,e.rmClass=_,e.keyNames=eo}$l(fr),ql(fr);var iu="iter insert remove copy getEditor constructor".split(" ");for(var ns in ei.prototype)ei.prototype.hasOwnProperty(ns)&&ee(iu,ns)<0&&(fr.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ei.prototype[ns]));return he(ei),fr.inputStyles={textarea:wr,contenteditable:Za},fr.defineMode=function(e){!fr.defaults.mode&&e!="null"&&(fr.defaults.mode=e),Bt.apply(this,arguments)},fr.defineMIME=Qt,fr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),fr.defineMIME("text/plain","null"),fr.defineExtension=function(e,t){fr.prototype[e]=t},fr.defineDocExtension=function(e,t){ei.prototype[e]=t},fr.fromTextArea=au,ru(fr),fr.version="5.58.2",fr})},WaYH:function(zt,Ke,M){"use strict";var Q=M("rePB"),z=M("Ff2n"),I=M("VTBJ"),B=M("1OyB"),R=M("vuIU"),P=M("JX7q"),F=M("Ji7U"),D=M("LK+K"),L=M("cDcd"),A=M("TSYQ"),b=M.n(A),m=M("sboe"),h=M("OZM5"),d=function(w){var T=w.prefixCls,_=w.level,y=w.isStart,f=w.isEnd;if(!_)return null;for(var c="".concat(T,"-indent-unit"),v=[],p=0;p<_;p+=1){var E;v.push(L.createElement("span",{key:p,className:b()(c,(E={},Object(Q.a)(E,"".concat(c,"-start"),y[p+1]),Object(Q.a)(E,"".concat(c,"-end"),f[p+1]),Object(Q.a)(E,"".concat(c,"-end-first-level"),!p&&f[0]),E))}))}return L.createElement("span",{"aria-hidden":"true",className:"".concat(T,"-indent")},v)},o=d,a=M("815F"),u="open",s="close",i="---",n=function(x){Object(F.a)(T,x);var w=Object(D.a)(T);function T(){var _;return Object(B.a)(this,T),_=w.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(y){var f=_.props.context.onNodeClick;f(y,Object(a.b)(_.props)),_.isSelectable()?_.onSelect(y):_.onCheck(y)},_.onSelectorDoubleClick=function(y){var f=_.props.context.onNodeDoubleClick;f(y,Object(a.b)(_.props))},_.onSelect=function(y){if(_.isDisabled())return;var f=_.props.context.onNodeSelect;y.preventDefault(),f(y,Object(a.b)(_.props))},_.onCheck=function(y){if(_.isDisabled())return;var f=_.props,c=f.disableCheckbox,v=f.checked,p=_.props.context.onNodeCheck;if(!_.isCheckable()||c)return;y.preventDefault();var E=!v;p(y,Object(a.b)(_.props),E)},_.onMouseEnter=function(y){var f=_.props.context.onNodeMouseEnter;f(y,Object(a.b)(_.props))},_.onMouseLeave=function(y){var f=_.props.context.onNodeMouseLeave;f(y,Object(a.b)(_.props))},_.onContextMenu=function(y){var f=_.props.context.onNodeContextMenu;f(y,Object(a.b)(_.props))},_.onDragStart=function(y){var f=_.props.context.onNodeDragStart;y.stopPropagation(),_.setState({dragNodeHighlight:!0}),f(y,Object(P.a)(_));try{y.dataTransfer.setData("text/plain","")}catch(c){}},_.onDragEnter=function(y){var f=_.props.context.onNodeDragEnter;y.preventDefault(),y.stopPropagation(),f(y,Object(P.a)(_))},_.onDragOver=function(y){var f=_.props.context.onNodeDragOver;y.preventDefault(),y.stopPropagation(),f(y,Object(P.a)(_))},_.onDragLeave=function(y){var f=_.props.context.onNodeDragLeave;y.stopPropagation(),f(y,Object(P.a)(_))},_.onDragEnd=function(y){var f=_.props.context.onNodeDragEnd;y.stopPropagation(),_.setState({dragNodeHighlight:!1}),f(y,Object(P.a)(_))},_.onDrop=function(y){var f=_.props.context.onNodeDrop;y.preventDefault(),y.stopPropagation(),_.setState({dragNodeHighlight:!1}),f(y,Object(P.a)(_))},_.onExpand=function(y){var f=_.props.context.onNodeExpand;f(y,Object(a.b)(_.props))},_.setSelectHandle=function(y){_.selectHandle=y},_.getNodeState=function(){var y=_.props.expanded;return _.isLeaf()?null:y?u:s},_.hasChildren=function(){var y=_.props.eventKey,f=_.props.context.keyEntities,c=f[y]||{},v=c.children;return!!(v||[]).length},_.isLeaf=function(){var y=_.props,f=y.isLeaf,c=y.loaded,v=_.props.context.loadData,p=_.hasChildren();return f===!1?!1:f||!v&&!p||v&&c&&!p},_.isDisabled=function(){var y=_.props.disabled,f=_.props.context.disabled;return!!(f||y)},_.isCheckable=function(){var y=_.props.checkable,f=_.props.context.checkable;return!f||y===!1?!1:f},_.syncLoadData=function(y){var f=y.expanded,c=y.loading,v=y.loaded,p=_.props.context,E=p.loadData,k=p.onNodeLoad;if(c)return;E&&f&&!_.isLeaf()&&(!_.hasChildren()&&!v&&k(Object(a.b)(_.props)))},_.renderSwitcher=function(){var y=_.props,f=y.expanded,c=y.switcherIcon,v=_.props.context,p=v.prefixCls,E=v.switcherIcon,k=c||E;if(_.isLeaf())return L.createElement("span",{className:b()("".concat(p,"-switcher"),"".concat(p,"-switcher-noop"))},typeof k=="function"?k(Object(I.a)(Object(I.a)({},_.props),{},{isLeaf:!0})):k);var U=b()("".concat(p,"-switcher"),"".concat(p,"-switcher_").concat(f?u:s));return L.createElement("span",{onClick:_.onExpand,className:U},typeof k=="function"?k(Object(I.a)(Object(I.a)({},_.props),{},{isLeaf:!1})):k)},_.renderCheckbox=function(){var y=_.props,f=y.checked,c=y.halfChecked,v=y.disableCheckbox,p=_.props.context.prefixCls,E=_.isDisabled(),k=_.isCheckable();if(!k)return null;var U=typeof k!="boolean"?k:null;return L.createElement("span",{className:b()("".concat(p,"-checkbox"),f&&"".concat(p,"-checkbox-checked"),!f&&c&&"".concat(p,"-checkbox-indeterminate"),(E||v)&&"".concat(p,"-checkbox-disabled")),onClick:_.onCheck},U)},_.renderIcon=function(){var y=_.props.loading,f=_.props.context.prefixCls;return L.createElement("span",{className:b()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(_.getNodeState()||"docu"),y&&"".concat(f,"-icon_loading"))})},_.renderSelector=function(){var y=_.state.dragNodeHighlight,f=_.props,c=f.title,v=f.selected,p=f.icon,E=f.loading,k=f.data,U=_.props.context,H=U.prefixCls,W=U.showIcon,j=U.icon,O=U.draggable,K=U.loadData,Y=U.titleRender,ee=_.isDisabled(),se="".concat(H,"-node-content-wrapper"),Be;if(W){var me=p||j;Be=me?L.createElement("span",{className:b()("".concat(H,"-iconEle"),"".concat(H,"-icon__customize"))},typeof me=="function"?me(_.props):me):_.renderIcon()}else K&&E&&(Be=_.renderIcon());var xe;typeof c=="function"?xe=c(k):Y?xe=Y(k):xe=c;var Le=L.createElement("span",{className:"".concat(H,"-title")},xe);return L.createElement("span",{ref:_.setSelectHandle,title:typeof c=="string"?c:"",className:b()("".concat(se),"".concat(se,"-").concat(_.getNodeState()||"normal"),!ee&&(v||y)&&"".concat(H,"-node-selected"),!ee&&O&&"draggable"),draggable:!ee&&O||void 0,"aria-grabbed":!ee&&O||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:O?_.onDragStart:void 0},Be,Le)},_}return Object(R.a)(T,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var y=this.props.selectable,f=this.props.context.selectable;return typeof y=="boolean"?y:f}},{key:"render",value:function(){var y,f=this.props,c=f.eventKey,v=f.className,p=f.style,E=f.dragOver,k=f.dragOverGapTop,U=f.dragOverGapBottom,H=f.isLeaf,W=f.isStart,j=f.isEnd,O=f.expanded,K=f.selected,Y=f.checked,ee=f.halfChecked,se=f.loading,Be=f.domRef,me=f.active,xe=f.onMouseMove,Le=Object(z.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ae=this.props.context,le=Ae.prefixCls,fe=Ae.filterTreeNode,Ve=Ae.draggable,Lt=Ae.keyEntities,Pt=this.isDisabled(),vt=Object(h.f)(Le),Fe=Lt[c]||{},_t=Fe.level,tt=j[j.length-1];return L.createElement("div",Object.assign({ref:Be,className:b()(v,"".concat(le,"-treenode"),(y={},Object(Q.a)(y,"".concat(le,"-treenode-disabled"),Pt),Object(Q.a)(y,"".concat(le,"-treenode-switcher-").concat(O?"open":"close"),!H),Object(Q.a)(y,"".concat(le,"-treenode-checkbox-checked"),Y),Object(Q.a)(y,"".concat(le,"-treenode-checkbox-indeterminate"),ee),Object(Q.a)(y,"".concat(le,"-treenode-selected"),K),Object(Q.a)(y,"".concat(le,"-treenode-loading"),se),Object(Q.a)(y,"".concat(le,"-treenode-active"),me),Object(Q.a)(y,"".concat(le,"-treenode-leaf-last"),tt),Object(Q.a)(y,"drag-over",!Pt&&E),Object(Q.a)(y,"drag-over-gap-top",!Pt&&k),Object(Q.a)(y,"drag-over-gap-bottom",!Pt&&U),Object(Q.a)(y,"filter-node",fe&&fe(Object(a.b)(this.props))),y)),style:p,onDragEnter:Ve?this.onDragEnter:void 0,onDragOver:Ve?this.onDragOver:void 0,onDragLeave:Ve?this.onDragLeave:void 0,onDrop:Ve?this.onDrop:void 0,onDragEnd:Ve?this.onDragEnd:void 0,onMouseMove:xe},vt),L.createElement(o,{prefixCls:le,level:_t,isStart:W,isEnd:j}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),T}(L.Component),S=function(w){return L.createElement(m.a.Consumer,null,function(T){return L.createElement(n,Object.assign({},w,{context:T}))})};S.displayName="TreeNode",S.defaultProps={title:i},S.isTreeNode=1;var C=Ke.a=S},XpUO:function(zt,Ke,M){"use strict";var Q=M("2qtc"),z=M("kLXV"),I=M("sRBo"),B=M("kaz8"),R=M("jCWc"),P=M("kPKH"),F=M("iQDF"),D=M("+eQT"),L=M("giR+"),A=M("fyUT"),b=M("14J3"),m=M("BMrR"),h=M("7Kak"),d=M("9yH6"),o=M("miYZ"),a=M("tsqr"),u=M("jrin"),s=M("9og8"),i=M("k1fw"),n=M("oBTY"),S=M("y8nQ"),C=M("Vl3Y"),x=M("tJVT"),w=M("PpiC"),T=M("WmNS"),_=M.n(T),y=M("cDcd"),f=M.n(y),c=M("wd/R"),v=M.n(c),p=M("ErOA"),E=M("xKgJ"),k=M("1vsH"),U=M("Ty5D"),H=M("9kvl"),W=M("4wi7"),j=M("oUNq"),O=M("eozf"),K=function(ee){var se,Be,me,xe,Le,Ae,le,fe,Ve,Lt,Pt,vt,Fe,_t,tt,Rt,Ge,Ft,wt,yt,bn,un,sn,Ye,nn,An,ke,Pe,rt,ht,Ue,ut,Ee,ce,he,J,Z,re,ue,de=ee.classroomList,Ne=ee.dispatch,ct=ee.courseEndTime,Gt=Object(w.a)(ee,["classroomList","dispatch","courseEndTime"]),an=Object(U.i)(),it=C.a.useForm(),qt=Object(x.a)(it,1),st=qt[0],pt=Object(y.useState)(1),Qe=Object(x.a)(pt,2),ie=Qe[0],be=Qe[1],Ot=Object(y.useState)([]),qe=Object(x.a)(Ot,2),Bt=qe[0],Qt=qe[1],Ce=Object(y.useState)(0),De=Object(x.a)(Ce,2),mt=De[0],Jt=De[1],cn=Object(y.useState)(2e3),wn=Object(x.a)(cn,2),sa=wn[0],zn=wn[1],En=Object(y.useState)(!0),ga=Object(x.a)(En,2),Ua=ga[0],ta=ga[1],la=Object(y.useState)(!1),Ra=Object(x.a)(la,2),Xa=Ra[0],vr=Ra[1],rn=Object(y.useState)(!1),Xn=Object(x.a)(rn,2),hr=Xn[0],xr=Xn[1],$a=Object(y.useState)([]),Ga=Object(x.a)($a,2),Aa=Ga[0],Kn=Ga[1],pr=Object(y.useState)(!0),on=Object(x.a)(pr,2),qa=on[0],Ka=on[1],Tr=Object(y.useState)(!((se=de.actionTabs)!==null&&se!==void 0&&(Be=se.selectArrsAll)!==null&&Be!==void 0&&(me=Be[0])!==null&&me!==void 0&&me.send_type)),mr=Object(x.a)(Tr,2),nr=mr[0],Br=mr[1],Hr=Object(y.useState)([0,0,0]),ar=Object(x.a)(Hr,2),Ea=ar[0],Sr=ar[1];Object(y.useEffect)(function(){if(de.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var va,_a,ir,Pa,Mn,ln;if((va=de.actionTabs)!==null&&va!==void 0&&(_a=va.selectArrsAll)!==null&&_a!==void 0&&(ir=_a[0])!==null&&ir!==void 0&&ir.can_publish){var Zn,V,ae;Sr(Object(n.a)((Zn=de.actionTabs)===null||Zn===void 0||((V=Zn.selectArrsAll)===null||V===void 0||((ae=V[0])===null||ae===void 0))?void 0:ae.difficult_count))}else{var Tn,fn,$n;Sr(Object(n.a)((Tn=de.actionTabs)===null||Tn===void 0||((fn=Tn.selectArrsAll)===null||fn===void 0||(($n=fn[0])===null||$n===void 0))?void 0:$n.difficult_settings))}if(Br(!((Pa=de.actionTabs)!==null&&Pa!==void 0&&(Mn=Pa.selectArrsAll)!==null&&Mn!==void 0&&(ln=Mn[0])!==null&&ln!==void 0&&ln.send_type)),Rr(),de.actionTabs.type===2){var ge,ve=(ge=de.actionTabs.selectArrsAll)===null||ge===void 0?void 0:ge[0];Ka(ve.unified_setting)}}},[de.actionTabs]),Object(y.useEffect)(function(){if(Xa){if(hr)return;Ne({type:"classroomList/setActionTabs",payload:{}}),Object(E.c)()?(Ne({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},de.actionTabs.params),{},{type:1})}),Ne({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},an)})):Ne({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},de.actionTabs.params)})}},[Xa]);var Rr=function(){var va=Object(s.a)(_.a.mark(function _a(ir){var Pa,Mn;return _.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return ta(!0),Tn.next=3,Object(j.B)(Object(i.a)(Object(i.a)({},an),{},{page:ir||ie,limit:2e4,homework_id:de.actionTabs.type===1?"":de.actionTabs.selectArrs[0]}));case 3:Pa=Tn.sent,Pa==null||Pa.course_groups.map(function(fn,$n){fn.key=fn.id,fn.title=fn.name,fn.disabled=fn.is_published}),Pa&&(Qt(Object(n.a)(Pa==null?void 0:Pa.course_groups)),Jt(Pa==null?void 0:Pa.course_groups_count),ta(!1),ir||st.setFieldsValue((Mn={},Object(u.a)(Mn,"publish_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(u.a)(Mn,"end_time",v()(v()(new Date(Object(k.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),Mn)));case 6:case"end":return Tn.stop()}},_a)}));return function(ir){return va.apply(this,arguments)}}(),ur=function(){Object(E.c)()?de.actionTabs.detail?(Ne({type:"shixunHomeworks/setActionTabs",payload:{}}),Ne({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},an)}),Ne({type:"shixunHomeworks/getWorkSetting",payload:Object(i.a)({},an)})):Ne({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},de.actionTabs.params),{},{type:5})}):Ne({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},de.actionTabs.params)})},_r=function(){var va=Object(s.a)(_.a.mark(function _a(){var ir,Pa,Mn,ln;return _.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:if(Pa=Object(i.a)({},st.getFieldsValue()),!(Pa.end_time<=Pa.publish_time)){fn.next=4;break}return a.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),fn.abrupt("return");case 4:if(!((Aa==null?void 0:Aa.length)<=0&&!qa&&Bt.length>0)){fn.next=7;break}return a.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),fn.abrupt("return");case 7:if(!(Ea.reduce(function($n,Zn){return $n+Zn})===0&&!nr)){fn.next=10;break}return a.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),fn.abrupt("return");case 10:return Mn={homework_ids:Object(n.a)(de.actionTabs.selectArrs),group_ids:Aa.length>0?Aa.map(function($n){return $n.id}):(ir=de.detailCommonHomeworksList)===null||ir===void 0?void 0:ir.course_groups,end_time:v()(Pa.end_time).format("YYYY-MM-DD HH:mm"),publish_time:v()(Pa.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:Ea==null?void 0:Ea.map(function($n){return $n}),send_type:nr?"0":"1",unified_setting:!Aa.length},fn.next=13,Object(p.a)("/api/courses/".concat(an.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(i.a)({},Mn)});case 13:ln=fn.sent,ln.status===0&&(Object(k.eb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),a.b.success("\u53D1\u5E03\u6210\u529F"),Ne({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Gt.onCallback&&Gt.onCallback(),ur(),localStorage.getItem("Noviceguide")==="0"||Ne({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 fn.stop()}},_a)}));return function(){return va.apply(this,arguments)}}(),oi=function(){be(1),Qt([]),Kn([])},$r=mt>ie*sa;return f.a.createElement(z.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:de.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:_r,onCancel:function(){oi(),ur(),Ne({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'),Bt&&f.a.createElement(C.a,{form:st},f.a.createElement("div",{style:{paddingLeft:0}},de.actionTabs.type===2&&f.a.createElement(m.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),f.a.createElement(d.a.Group,{value:nr,disabled:!((xe=de.actionTabs)!==null&&xe!==void 0&&(Le=xe.selectArrsAll)!==null&&Le!==void 0&&(Ae=Le[0])!==null&&Ae!==void 0&&Ae.can_publish),onChange:function(_a){Br(_a.target.value)}},f.a.createElement(d.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),f.a.createElement(d.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!nr&&f.a.createElement(m.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{style:{marginRight:65}}),f.a.createElement("span",null,"\u7B80\u5355\u9898\u6570 ",f.a.createElement(A.a,{value:Ea[0],onChange:function(_a){Ea[0]=_a,Sr(Object(n.a)(Ea))},min:0,disabled:!((le=de.actionTabs)!==null&&le!==void 0&&(fe=le.selectArrsAll)!==null&&fe!==void 0&&(Ve=fe[0])!==null&&Ve!==void 0&&Ve.can_publish),placeholder:"\u6700\u5927".concat((Lt=de.actionTabs)===null||Lt===void 0||((Pt=Lt.selectArrsAll)===null||Pt===void 0||((vt=Pt[0])===null||vt===void 0||((Fe=vt.difficult_count)===null||Fe===void 0)))?void 0:Fe[0]),max:(_t=de.actionTabs)===null||_t===void 0||((tt=_t.selectArrsAll)===null||tt===void 0||((Rt=tt[0])===null||Rt===void 0||((Ge=Rt.difficult_count)===null||Ge===void 0)))?void 0:Ge[0],style:{width:60}})),f.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570 ",f.a.createElement(A.a,{value:Ea[1],onChange:function(_a){Ea[1]=_a,Sr(Object(n.a)(Ea))},min:0,disabled:!((Ft=de.actionTabs)!==null&&Ft!==void 0&&(wt=Ft.selectArrsAll)!==null&&wt!==void 0&&(yt=wt[0])!==null&&yt!==void 0&&yt.can_publish),max:(bn=de.actionTabs)===null||bn===void 0||((un=bn.selectArrsAll)===null||un===void 0||((sn=un[0])===null||sn===void 0||((Ye=sn.difficult_count)===null||Ye===void 0)))?void 0:Ye[1],placeholder:"\u6700\u5927".concat((nn=de.actionTabs)===null||nn===void 0||((An=nn.selectArrsAll)===null||An===void 0||((ke=An[0])===null||ke===void 0||((Pe=ke.difficult_count)===null||Pe===void 0)))?void 0:Pe[1]),style:{width:60}})),f.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570 ",f.a.createElement(A.a,{value:Ea[2],onChange:function(_a){Ea[2]=_a,Sr(Object(n.a)(Ea))},min:0,disabled:!((rt=de.actionTabs)!==null&&rt!==void 0&&(ht=rt.selectArrsAll)!==null&&ht!==void 0&&(Ue=ht[0])!==null&&Ue!==void 0&&Ue.can_publish),placeholder:"\u6700\u5927".concat((ut=de.actionTabs)===null||ut===void 0||((Ee=ut.selectArrsAll)===null||Ee===void 0||((ce=Ee[0])===null||ce===void 0||((he=ce.difficult_count)===null||he===void 0)))?void 0:he[2]),max:(J=de.actionTabs)===null||J===void 0||((Z=J.selectArrsAll)===null||Z===void 0||((re=Z[0])===null||re===void 0||((ue=re.difficult_count)===null||ue===void 0)))?void 0:ue[2],style:{width:60}}))),f.a.createElement(m.a,{className:"mt30",align:"middle"},f.a.createElement(P.a,null,f.a.createElement(C.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},f.a.createElement(D.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(_a){return _a.parentNode},disabledDate:function(_a){return Object(O.b)(_a,ct)},disabledTime:function(_a){return Object(O.c)(_a)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(k.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),f.a.createElement(P.a,{className:"ml20"},f.a.createElement(C.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},f.a.createElement(D.a,{style:{width:170},getPopupContainer:function(_a){return _a.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(k.d)(),"HH:mm")},disabledDate:function(_a){return Object(O.b)(_a,ct,st.getFieldValue("publish_time"))},disabledTime:function(_a){return Object(O.c)(_a,st.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),de.actionTabs.type===2&&f.a.createElement(m.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),f.a.createElement(d.a.Group,{value:qa,onChange:function(_a){Ka(_a.target.value),Kn([])}},f.a.createElement(d.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),f.a.createElement(d.a,{className:"ml20",disabled:Bt.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Bt.length<=0&&de.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"')),(de.actionTabs.type===1||!qa)&&Bt.length>0&&f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},f.a.createElement("span",{style:{flex:1}},f.a.createElement(B.a,{checked:Aa.length===Bt.length,onChange:function(_a){Aa.length===Bt.length?Kn([]):Kn(Bt.filter(function(ir){return!ir.is_published}))}},"\u5168\u9009")," "),f.a.createElement("span",{style:{width:16}}),f.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",Aa.length||0,"\u4E2A\u5206\u73ED")),(de.actionTabs.type===1||!qa)&&Bt.length>0&&f.a.createElement(W.a,{data:Bt,selectedRowKeys:Aa,setSelectedRowKeys:Kn})))};Ke.a=Object(H.a)(function(Y){var ee=Y.classroomList;return{classroomList:ee}})(K)},Y1PL:function(zt,Ke,M){"use strict";M.r(Ke),M.d(Ke,"ResizableTextArea",function(){return ee});var Q=M("wx14"),z=M("1OyB"),I=M("vuIU"),B=M("Ji7U"),R=M("LK+K"),P=M("cDcd"),F=M("VTBJ"),D=M("rePB"),L=M("Zm9Q"),A=M("Kwbf"),b=M("c+Xe"),m=M("m+aA"),h=M("bdgK"),d=new Map;function o(me){me.forEach(function(xe){var Le,Ae=xe.target;(Le=d.get(Ae))===null||Le===void 0||Le.forEach(function(le){return le(Ae)})})}var a=new h.default(o),u=null,s=null;function i(me,xe){d.has(me)||(d.set(me,new Set),a.observe(me)),d.get(me).add(xe)}function n(me,xe){d.has(me)&&(d.get(me).delete(xe),d.get(me).size||(a.unobserve(me),d.delete(me)))}var S=function(me){Object(B.a)(Le,me);var xe=Object(R.a)(Le);function Le(){return Object(z.a)(this,Le),xe.apply(this,arguments)}return Object(I.a)(Le,[{key:"render",value:function(){return this.props.children}}]),Le}(P.Component),C=P.createContext(null);function x(me){var xe=me.children,Le=me.onBatchResize,Ae=P.useRef(0),le=P.useRef([]),fe=P.useContext(C),Ve=P.useCallback(function(Lt,Pt,vt){Ae.current+=1;var Fe=Ae.current;le.current.push({size:Lt,element:Pt,data:vt}),Promise.resolve().then(function(){Fe===Ae.current&&(Le==null||Le(le.current),le.current=[])}),fe==null||fe(Lt,Pt,vt)},[Le,fe]);return P.createElement(C.Provider,{value:Ve},xe)}function w(me){var xe=me.children,Le=me.disabled,Ae=P.useRef(null),le=P.useRef(null),fe=P.useContext(C),Ve=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Lt=P.isValidElement(xe)&&Object(b.c)(xe),Pt=Lt?xe.ref:null,vt=P.useMemo(function(){return Object(b.a)(Pt,Ae)},[Pt,Ae]),Fe=P.useRef(me);Fe.current=me;var _t=P.useCallback(function(tt){var Rt=Fe.current,Ge=Rt.onResize,Ft=Rt.data,wt=tt.getBoundingClientRect(),yt=wt.width,bn=wt.height,un=tt.offsetWidth,sn=tt.offsetHeight,Ye=Math.floor(yt),nn=Math.floor(bn);if(Ve.current.width!==Ye||Ve.current.height!==nn||Ve.current.offsetWidth!==un||Ve.current.offsetHeight!==sn){var An={width:Ye,height:nn,offsetWidth:un,offsetHeight:sn};Ve.current=An;var ke=un===Math.round(yt)?yt:un,Pe=sn===Math.round(bn)?bn:sn,rt=Object(F.a)(Object(F.a)({},An),{},{offsetWidth:ke,offsetHeight:Pe});fe==null||fe(rt,tt,Ft),Ge&&Promise.resolve().then(function(){Ge(rt,tt)})}},[]);return P.useEffect(function(){var tt=Object(m.a)(Ae.current)||Object(m.a)(le.current);return tt&&!Le&&i(tt,_t),function(){return n(tt,_t)}},[Ae.current,Le]),P.createElement(S,{ref:le},Lt?P.cloneElement(xe,{ref:vt}):xe)}var T="rc-observer-key";function _(me){var xe=me.children,Le=Object(L.a)(xe);return Le.map(function(Ae,le){var fe=(Ae==null?void 0:Ae.key)||"".concat(T,"-").concat(le);return P.createElement(w,Object(Q.a)({},me,{key:fe}),Ae)})}_.Collection=x;var y=_,f=M("bT9E"),c=M("TSYQ"),v=M.n(c),p=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,E=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],k={},U;function H(me){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=me.getAttribute("id")||me.getAttribute("data-reactid")||me.getAttribute("name");if(xe&&k[Le])return k[Le];var Ae=window.getComputedStyle(me),le=Ae.getPropertyValue("box-sizing")||Ae.getPropertyValue("-moz-box-sizing")||Ae.getPropertyValue("-webkit-box-sizing"),fe=parseFloat(Ae.getPropertyValue("padding-bottom"))+parseFloat(Ae.getPropertyValue("padding-top")),Ve=parseFloat(Ae.getPropertyValue("border-bottom-width"))+parseFloat(Ae.getPropertyValue("border-top-width")),Lt=E.map(function(vt){return"".concat(vt,":").concat(Ae.getPropertyValue(vt))}).join(";"),Pt={sizingStyle:Lt,paddingSize:fe,borderSize:Ve,boxSizing:le};return xe&&Le&&(k[Le]=Pt),Pt}function W(me){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),me.getAttribute("wrap")?U.setAttribute("wrap",me.getAttribute("wrap")):U.removeAttribute("wrap");var le=H(me,xe),fe=le.paddingSize,Ve=le.borderSize,Lt=le.boxSizing,Pt=le.sizingStyle;U.setAttribute("style","".concat(Pt,";").concat(p)),U.value=me.value||me.placeholder||"";var vt=Number.MIN_SAFE_INTEGER,Fe=Number.MAX_SAFE_INTEGER,_t=U.scrollHeight,tt;if(Lt==="border-box"?_t+=Ve:Lt==="content-box"&&(_t-=fe),Le!==null||Ae!==null){U.value=" ";var Rt=U.scrollHeight-fe;Le!==null&&(vt=Rt*Le,Lt==="border-box"&&(vt=vt+fe+Ve),_t=Math.max(vt,_t)),Ae!==null&&(Fe=Rt*Ae,Lt==="border-box"&&(Fe=Fe+fe+Ve),tt=_t>Fe?"":"hidden",_t=Math.min(Fe,_t))}return{height:_t,minHeight:vt,maxHeight:Fe,overflowY:tt,resize:"none"}}var j=M("Gytx"),O=M.n(j),K;(function(me){me[me.NONE=0]="NONE",me[me.RESIZING=1]="RESIZING",me[me.RESIZED=2]="RESIZED"})(K||(K={}));var Y=function(me){Object(B.a)(Le,me);var xe=Object(R.a)(Le);function Le(Ae){var le;return Object(z.a)(this,Le),le=xe.call(this,Ae),le.nextFrameActionId=void 0,le.resizeFrameId=void 0,le.textArea=void 0,le.saveTextArea=function(fe){le.textArea=fe},le.handleResize=function(fe){var Ve=le.state.resizeStatus,Lt=le.props,Pt=Lt.autoSize,vt=Lt.onResize;if(Ve!==K.NONE)return;typeof vt=="function"&&vt(fe),Pt&&le.resizeOnNextFrame()},le.resizeOnNextFrame=function(){cancelAnimationFrame(le.nextFrameActionId),le.nextFrameActionId=requestAnimationFrame(le.resizeTextarea)},le.resizeTextarea=function(){var fe=le.props.autoSize;if(!fe||!le.textArea)return;var Ve=fe.minRows,Lt=fe.maxRows,Pt=W(le.textArea,!1,Ve,Lt);le.setState({textareaStyles:Pt,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(le.resizeFrameId),le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:K.RESIZED},function(){le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:K.NONE}),le.fixFirefoxAutoScroll()})})})})},le.renderTextArea=function(){var fe=le.props,Ve=fe.prefixCls,Lt=Ve===void 0?"rc-textarea":Ve,Pt=fe.autoSize,vt=fe.onResize,Fe=fe.className,_t=fe.disabled,tt=le.state,Rt=tt.textareaStyles,Ge=tt.resizeStatus,Ft=Object(f.a)(le.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),wt=v()(Lt,Fe,Object(D.a)({},"".concat(Lt,"-disabled"),_t));"value"in Ft&&(Ft.value=Ft.value||"");var yt=Object(F.a)(Object(F.a)(Object(F.a)({},le.props.style),Rt),Ge===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(y,{onResize:le.handleResize,disabled:!(Pt||vt)},P.createElement("textarea",Object(Q.a)({},Ft,{className:wt,style:yt,ref:le.saveTextArea})))},le.state={textareaStyles:{},resizeStatus:K.NONE},le}return Object(I.a)(Le,[{key:"componentDidUpdate",value:function(le){(le.value!==this.props.value||!O()(le.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var le=this.textArea.selectionStart,fe=this.textArea.selectionEnd;this.textArea.setSelectionRange(le,fe)}}catch(Ve){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(P.Component),ee=Y,se=function(me){Object(B.a)(Le,me);var xe=Object(R.a)(Le);function Le(Ae){var le;Object(z.a)(this,Le),le=xe.call(this,Ae),le.resizableTextArea=void 0,le.focus=function(){le.resizableTextArea.textArea.focus()},le.saveTextArea=function(Ve){le.resizableTextArea=Ve},le.handleChange=function(Ve){var Lt=le.props.onChange;le.setValue(Ve.target.value,function(){le.resizableTextArea.resizeTextarea()}),Lt&&Lt(Ve)},le.handleKeyDown=function(Ve){var Lt=le.props,Pt=Lt.onPressEnter,vt=Lt.onKeyDown;Ve.keyCode===13&&Pt&&Pt(Ve),vt&&vt(Ve)};var fe=typeof Ae.value=="undefined"||Ae.value===null?Ae.defaultValue:Ae.value;return le.state={value:fe},le}return Object(I.a)(Le,[{key:"setValue",value:function(le,fe){"value"in this.props||this.setState({value:le},fe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(ee,Object(Q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(le){return"value"in le?{value:le.value}:null}}]),Le}(P.Component),Be=Ke.default=se},ZW9T:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return W});var Q=M("k1fw"),z=M("miYZ"),I=M("tsqr"),B=M("rAM+"),R=M("tJVT"),P=M("PpiC"),F=M("cDcd"),D=M.n(F),L=M("bdgK"),A=M("oBTY"),b=M("9og8"),m=M("WmNS"),h=M.n(m),d={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},a={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},u={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=M("5VLF"),i=M.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"]}},S=function(O,K){return K.map(function(Y){return{label:Y,kind:O.languages.CompletionItemKind.Keyword,insertText:Y}})},C=function(O){return Object.keys(n.tables).map(function(K){return{label:K,kind:O.languages.CompletionItemKind.Variable,insertText:K}})},x=function(O,K){var Y=n.tables[O];return Y?Y.map(function(ee){return{label:ee,kind:K.languages.CompletionItemKind.Field,insertText:ee}}):[]};function w(j,O,K,Y,ee){var se=O.getWordUntilPosition(K),Be={startLineNumber:K.lineNumber,endLineNumber:K.lineNumber,startColumn:se.startColumn,endColumn:se.endColumn},me=Y.map(function(xe){return{label:xe,kind:j.languages.CompletionItemKind.Keyword,insertText:xe,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Be}});return ee.map(function(xe){me.push(Object(Q.a)(Object(Q.a)({},xe),{},{range:Be}))}),me}var T=function(j){n.languages.map(function(ee){return j.languages.registerDocumentFormattingEditProvider(ee,{provideDocumentFormattingEdits:function(Be,me,xe){return Object(b.a)(h.a.mark(function Le(){var Ae;return h.a.wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return Ae=i()(Be.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}),fe.abrupt("return",[{range:Be.getFullModelRange(),text:Ae}]);case 2:case"end":return fe.stop()}},Le)}))()}}),ee});var O=a.quickKey.map(function(ee){return{label:ee.label,kind:j.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),K=u.quickKey.map(function(ee){return{label:ee.label,kind:j.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Y=o.quickKey.map(function(ee){return{label:ee.label,kind:j.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:j.languages.CompletionItemInsertTextRule.InsertAsSnippet}});j.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(A.a)(a.keywords),Object(A.a)(a.quickKey.map(function(ee){return ee.label}))),provideCompletionItems:function(se,Be){var me=se.getValueInRange({startLineNumber:Be.lineNumber,startColumn:1,endLineNumber:Be.lineNumber,endColumn:Be.column}),xe=me.match(/cu/gim);console.log("match:",xe,Be,me,se);var Le=[],Ae=Be.lineNumber,le=Be.column,fe=se.getValueInRange({startLineNumber:Ae,startColumn:0,endLineNumber:Ae,endColumn:le}),Ve=fe.trim().split(/\s+/),Lt=Ve[Ve.length-1];if(Lt.endsWith(".")){var Pt=Lt.slice(0,Lt.length-1);Object.keys(n.tables).includes(Pt)&&(Le=Object(A.a)(x(Pt,j)))}else Lt==="."?Le=[]:Le=[].concat(Object(A.a)(C(j)),Object(A.a)(S(j,a.keywords)),Object(A.a)(O));return{suggestions:Le}}}),j.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(A.a)(d.keywords)),provideCompletionItems:function(se,Be){var me=se.getValueInRange({startLineNumber:Be.lineNumber,startColumn:1,endLineNumber:Be.lineNumber,endColumn:Be.column}),xe=me.match(/cu/gim);console.log("match:",xe,Be,me,se);var Le=[],Ae=Be.lineNumber,le=Be.column,fe=se.getValueInRange({startLineNumber:Ae,startColumn:0,endLineNumber:Ae,endColumn:le}),Ve=fe.trim().split(/\s+/),Lt=Ve[Ve.length-1];if(Lt.endsWith(".")){var Pt=Lt.slice(0,Lt.length-1);Object.keys(n.tables).includes(Pt)&&(Le=Object(A.a)(x(Pt,j)))}else Lt==="."?Le=[]:Le=[].concat(Object(A.a)(C(j)),Object(A.a)(S(j,d.keywords)));return{suggestions:Le}}}),j.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(A.a)(o.keywords)),provideCompletionItems:function(se,Be){var me=[],xe=Be.lineNumber,Le=Be.column,Ae=se.getValueInRange({startLineNumber:xe,startColumn:0,endLineNumber:xe,endColumn:Le}),le=Ae.trim().split(/\s+/),fe=le[le.length-1];if(fe.endsWith(".")){var Ve=fe.slice(0,fe.length-1);Object.keys(n.tables).includes(Ve)&&(me=Object(A.a)(x(Ve,j)))}else fe==="."?me=[]:me=[].concat(Object(A.a)(C(j)),Object(A.a)(S(j,o.keywords)),Object(A.a)(Y));return{suggestions:me}}}),j.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(A.a)(u.keywords)),provideCompletionItems:function(se,Be){var me=[],xe=Be.lineNumber,Le=Be.column,Ae=se.getValueInRange({startLineNumber:xe,startColumn:0,endLineNumber:xe,endColumn:Le}),le=Ae.trim().split(/\s+/),fe=le[le.length-1];if(fe.endsWith(".")){var Ve=fe.slice(0,fe.length-1);Object.keys(n.tables).includes(Ve)&&(me=Object(A.a)(x(Ve,j)))}else fe==="."?me=[]:me=[].concat(Object(A.a)(C(j)),Object(A.a)(S(j,u.keywords)),Object(A.a)(K));return{suggestions:me}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",y=M("LvDl"),f=M("+ua5");function c(j){return/^\d+$/.test(j)?"".concat(j,"px"):j}function v(){}var p=!1,E={"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 k(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],O=j;if(Array.isArray(j)){for(var K=0;K<j.length;K++){var Y=E[j[K]];if(Y)return Y}return O[0]}return E[O]||O}var U=null,H=Ke.b=function(j){var O=j.width,K=O===void 0?"100%":O,Y=j.height,ee=Y===void 0?"100%":Y,se=j.value,Be=j.language,me=Be===void 0?"javascript":Be,xe=j.style,Le=xe===void 0?{}:xe,Ae=j.options,le=Ae===void 0?{}:Ae,fe=j.overrideServices,Ve=fe===void 0?{}:fe,Lt=j.theme,Pt=Lt===void 0?"vs-dark":Lt,vt=j.onEditBlur,Fe=j.onSave,_t=j.autoHeight,tt=_t===void 0?!1:_t,Rt=j.forbidCopy,Ge=Rt===void 0?!1:Rt,Ft=j.onChange,wt=Ft===void 0?v:Ft,yt=j.editorDidMount,bn=yt===void 0?v:yt,un=j.onFocus,sn=un===void 0?v:un,Ye=j.filename,nn=Ye===void 0?"educoder.txt":Ye,An=j.errorLine,ke=j.errorContent,Pe=ke===void 0?"":ke,rt=Object(P.a)(j,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ht=Object(F.useRef)(),Ue=Object(F.useRef)({}),ut=Object(F.useRef)(),Ee=Object(F.useRef)(!1),ce=Object(F.useRef)(),he=Object(F.useState)(!1),J=Object(R.a)(he,2),Z=J[0],re=J[1];function ue(){var Ce;return ht.current&&(Ce=new L.default(function(De){var mt=Object(B.a)(De),Jt;try{for(mt.s();!(Jt=mt.n()).done;){var cn=Jt.value;(cn.target.offsetHeight>0||cn.target.offsetWidth>0)&&Ue.current.instance.layout()}}catch(wn){mt.e(wn)}finally{mt.f()}}),Ce.observe(ht.current)),Ce}function de(){I.b.warn(decodeURIComponent(_))}var Ne=function(){var De=Ue.current.instance;if(se!=null&&De&&Z){var mt=De.getModel();mt&&se!==mt.getValue()&&(p=!0,mt.setValue(se),De.layout(),p=!1)}};Object(F.useEffect)(function(){ut.current&&clearTimeout(ut.current),ut.current=setTimeout(function(){Ne()},500)},[se,Z,Ue.current]),Object(F.useEffect)(function(){if(An&&Ue.current&&Ue.current.instance){var Ce=Ue.current.instance;Ce.changeViewZones(function(mt){var Jt=document.createElement("div");Jt.style.padding="10px 20px",Jt.style.width="calc(100% - 20px)",Jt.className="my-error-line-wrp",Jt.innerHTML=Pe,mt.addZone({afterLineNumber:An||11,heightInLines:3,domNode:Jt})});var De={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}};Ce.addOverlayWidget(De),Ce.revealPositionInCenter({lineNumber:20,column:1})}},[An,Ue.current,Z]);function ct(){var Ce=Ue.current.instance;if(Ce){var De=Ce.getSelection(),mt=Ue.current.pastePos||{},Jt=new U.Range(mt.startLineNumber||De.endLineNumber,mt.startColumn||De.endColumn,mt.endLineNumber||De.endLineNumber,mt.endColumn||De.endColumn);setTimeout(function(){Ce.executeEdits("",[{range:Jt,text:""}])},300)}}function Gt(Ce){(window.navigator.platform.match("Mac")?Ce.metaKey:Ce.ctrlKey)&&Ce.keyCode==83&&(Ce.preventDefault(),Fe())}var an=function(){if(tt&&Ue.current.instance){var De=Ue.current.instance.getContentHeight();Bt(De<ee?ee:De)}else Bt(ee)};function it(Ce){var De=document.createEvent("MouseEvents");De.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ce.dispatchEvent(De)}function qt(Ce,De){var mt=window.URL||window.webkitURL||window,Jt=new Blob([De]),cn=document.createElementNS("http://www.w3.org/1999/xhtml","a");cn.href=mt.createObjectURL(Jt),cn.download=Ce,it(cn)}Object(F.useEffect)(function(){an()},[an]),Object(F.useEffect)(function(){ht.current&&!Z&&M.e(27).then(M.t.bind(null,"M/lh",7)).then(function(Ce){try{U=Ce,Ue.current.instance=U.editor.create(ht.current,{value:se,language:k(me),theme:Pt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Ve);var De=Ue.current.instance;if(bn(De,U),setTimeout(function(){an(),Ue.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){qt(nn||"educoder.txt",De.getValue())}})},500),Ue.current.subscription=De.onDidChangeModelContent(function(Jt){Ee.current?clearTimeout(ce.current):(an(),wt(De.getValue(),Jt)),ce.current=setTimeout(function(){Ee.current=!1},500)}),window.Monaco||T(U),Ge&&(De.addCommand(U.KeyMod.CtrlCmd|U.KeyMod.Shift|U.KeyCode.KEY_V,function(){return de(),null}),De.addCommand(U.KeyMod.CtrlCmd|U.KeyCode.KEY_C,function(){return de(),null})),window.Monaco=U,vt&&De.onDidBlurEditorWidget(function(){vt(De.getValue())}),sn&&De.onDidFocusEditorText(function(){sn(De.getValue())}),Ge){De.addCommand(U.KeyMod.CtrlCmd|U.KeyCode.KEY_V,function(){return de(),null}),De.onDidPaste(function(Jt){Ue.current.pastePos=Jt});try{window.addEventListener("paste",ct)}catch(Jt){}}var mt=ue();return re(!0),function(){var Jt=Ue.current.instance;Jt.dispose();var cn=Jt.getModel();cn&&cn.dispose(),Ue.current.subscription&&Ue.current.subscription.dispose(),Ge&&window.removeEventListener("paste",ct),mt.unobserve(ht.current)}}catch(Jt){}})},[]),Object(F.useEffect)(function(){var Ce=Ue.current.instance;if(Ce&&Z)return document.addEventListener("keydown",Gt,!1),function(){document.removeEventListener("keydown",Gt)}},[Fe,Z]),Object(F.useEffect)(function(){var Ce=Ue.current.instance;if(Ce&&Z){var De=k(me);U.editor.setModelLanguage(Ce.getModel(),De),console.log("language:",me,Ce.getModel(),De)}},[me,Z]),Object(F.useEffect)(function(){var Ce=Ue.current.instance;Ce&&Z&&U.editor.setTheme(Pt)},[Pt,Z]),Object(F.useEffect)(function(){var Ce=Ue.current.instance;Ce&&Z&&(Ce.updateOptions(Object(Q.a)({},le)),setTimeout(function(){Ce.getModel().updateOptions(Object(Q.a)({},le))},200))},[JSON.stringify(le),Z]),Object(F.useEffect)(function(){var Ce=Ue.current.instance;Ce&&Z&&Ce.layout()},[K,ee,Z]);var st=Object(F.useState)(c(K)),pt=Object(R.a)(st,2),Qe=pt[0],ie=pt[1],be=Object(F.useState)(c(ee)),Ot=Object(R.a)(be,2),qe=Ot[0],Bt=Ot[1],Qt=Object(Q.a)(Object(Q.a)({},Le),{},{width:Qe,height:qe});return D.a.createElement("div",{className:"my-monaco-editor",ref:ht,style:Qt})};function W(j){var O=j.width,K=O===void 0?"100%":O,Y=j.height,ee=Y===void 0?"100%":Y,se=j.original,Be=j.modified,me=j.language,xe=j.options,Le=xe===void 0?{}:xe,Ae=Object(F.useRef)(),le=Object(F.useState)(null),fe=Object(R.a)(le,2),Ve=fe[0],Lt=fe[1];function Pt(tt){var Rt;return Ae.current&&(Rt=new L.default(function(Ge){var Ft=Object(B.a)(Ge),wt;try{for(Ft.s();!(wt=Ft.n()).done;){var yt=wt.value;(yt.target.offsetHeight>0||yt.target.offsetWidth>0)&&tt.layout()}}catch(bn){Ft.e(bn)}finally{Ft.f()}}),Rt.observe(Ae.current)),Rt}Object(F.useEffect)(function(){Ae.current&&M.e(27).then(M.t.bind(null,"M/lh",7)).then(function(tt){U=tt;var Rt=U.editor.createDiffEditor(Ae.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},Le),{},{wordWrap:!0}));Lt(Rt);var Ge=Pt(Rt);return function(){Rt.dispose();var Ft=Rt.getModel();Ft&&Ft.dispose(),Ge.unobserve(Ae.current)}})},[]),Object(F.useEffect)(function(){Ve&&Ve.setModel({original:U.editor.createModel(se,me),modified:U.editor.createModel(Be,me)})},[se,Be,me,Ve]);var vt=c(K),Fe=c(ee),_t={width:vt,height:Fe};return D.a.createElement("div",{className:"my-diff-editor",ref:Ae,style:_t})}},ZpRC:function(zt,Ke,M){"use strict";function Q(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function z(b,m){return(!m||b!=="hidden")&&b!=="visible"&&b!=="clip"}function I(b,m){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var h=getComputedStyle(b,null);return z(h.overflowY,m)||z(h.overflowX,m)||function(d){var o=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch(u){return null}}(d);return!!o&&(o.clientHeight<d.scrollHeight||o.clientWidth<d.scrollWidth)}(b)}return!1}function B(b,m,h,d,o,a,u,s){return a<b&&u>m||a>b&&u<m?0:a<=b&&s<=h||u>=m&&s>=h?a-b-d:u>m&&s<h||a<b&&s>h?u-m+o:0}var R=function(b,m){var h=window,d=m.scrollMode,o=m.block,a=m.inline,u=m.boundary,s=m.skipOverflowHiddenElements,i=typeof u=="function"?u:function(Rt){return Rt!==u};if(!Q(b))throw new TypeError("Invalid target");for(var n=document.scrollingElement||document.documentElement,S=[],C=b;Q(C)&&i(C);){if((C=C.parentElement)===n){S.push(C);break}C!=null&&C===document.body&&I(C)&&!I(document.documentElement)||C!=null&&I(C,s)&&S.push(C)}for(var x=h.visualViewport?h.visualViewport.width:innerWidth,w=h.visualViewport?h.visualViewport.height:innerHeight,T=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,y=b.getBoundingClientRect(),f=y.height,c=y.width,v=y.top,p=y.right,E=y.bottom,k=y.left,U=o==="start"||o==="nearest"?v:o==="end"?E:v+f/2,H=a==="center"?k+c/2:a==="end"?p:k,W=[],j=0;j<S.length;j++){var O=S[j],K=O.getBoundingClientRect(),Y=K.height,ee=K.width,se=K.top,Be=K.right,me=K.bottom,xe=K.left;if(d==="if-needed"&&v>=0&&k>=0&&E<=w&&p<=x&&v>=se&&E<=me&&k>=xe&&p<=Be)return W;var Le=getComputedStyle(O),Ae=parseInt(Le.borderLeftWidth,10),le=parseInt(Le.borderTopWidth,10),fe=parseInt(Le.borderRightWidth,10),Ve=parseInt(Le.borderBottomWidth,10),Lt=0,Pt=0,vt="offsetWidth"in O?O.offsetWidth-O.clientWidth-Ae-fe:0,Fe="offsetHeight"in O?O.offsetHeight-O.clientHeight-le-Ve:0;if(n===O)Lt=o==="start"?U:o==="end"?U-w:o==="nearest"?B(_,_+w,w,le,Ve,_+U,_+U+f,f):U-w/2,Pt=a==="start"?H:a==="center"?H-x/2:a==="end"?H-x:B(T,T+x,x,Ae,fe,T+H,T+H+c,c),Lt=Math.max(0,Lt+_),Pt=Math.max(0,Pt+T);else{Lt=o==="start"?U-se-le:o==="end"?U-me+Ve+Fe:o==="nearest"?B(se,me,Y,le,Ve+Fe,U,U+f,f):U-(se+Y/2)+Fe/2,Pt=a==="start"?H-xe-Ae:a==="center"?H-(xe+ee/2)+vt/2:a==="end"?H-Be+fe+vt:B(xe,Be,ee,Ae,fe+vt,H,H+c,c);var _t=O.scrollLeft,tt=O.scrollTop;U+=tt-(Lt=Math.max(0,Math.min(tt+Lt,O.scrollHeight-Y+Fe))),H+=_t-(Pt=Math.max(0,Math.min(_t+Pt,O.scrollWidth-ee+vt)))}W.push({el:O,top:Lt,left:Pt})}return W};function P(b){return b===Object(b)&&Object.keys(b).length!==0}function F(b,m){m===void 0&&(m="auto");var h="scrollBehavior"in document.body.style;b.forEach(function(d){var o=d.el,a=d.top,u=d.left;o.scroll&&h?o.scroll({top:a,left:u,behavior:m}):(o.scrollTop=a,o.scrollLeft=u)})}function D(b){return b===!1?{block:"end",inline:"nearest"}:P(b)?b:{block:"start",inline:"nearest"}}function L(b,m){var h=!b.ownerDocument.documentElement.contains(b);if(P(m)&&typeof m.behavior=="function")return m.behavior(h?[]:R(b,m));if(h)return;var d=D(m);return F(R(b,d),d.behavior)}var A=Ke.a=L},bT9E:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return z});var Q=M("VTBJ");function z(I,B){var R=Object(Q.a)({},I);return Array.isArray(B)&&B.forEach(function(P){delete R[P]}),R}},bTeP:function(zt,Ke,M){zt.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(zt,Ke,M){"use strict";var Q=M("cDcd"),z=M.n(Q),I=Q.createContext(null);Ke.a=I},c5Ni:function(zt,Ke,M){},deN7:function(zt,Ke,M){"use strict";var Q=M("/zsF"),z=M("PArb"),I=M("14J3"),B=M("BMrR"),R=M("jCWc"),P=M("kPKH"),F=M("+L6B"),D=M("2/Rp"),L=M("miYZ"),A=M("tsqr"),b=M("9og8"),m=M("giR+"),h=M("fyUT"),d=M("2qtc"),o=M("kLXV"),a=M("7Kak"),u=M("9yH6"),s=M("tJVT"),i=M("k1fw"),n=M("OaEy"),S=M("2fM7"),C=M("WmNS"),x=M.n(C),w=M("cDcd"),T=M.n(w),_=M("ZW9T"),y=M("F0VM"),f=M.n(y),c=M("xKgJ"),v=M("J66h"),p=M.n(v),E=M("ErOA"),k=M("Ty5D"),U=M("9Bee"),H=M("XYT7"),W=M("RCxd"),j=M("/MfK"),O=S.a.Option,K={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},Y;(function(se){se[se.SET_PATH=0]="SET_PATH",se[se.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(Y||(Y={}));function ee(se,Be){switch(Be.type){case Y.SET_PATH:return Object(i.a)(Object(i.a)({},se),{},{selectedPath:Be.payload});case Y.GET_PASSED_CONTENT:return Object(i.a)(Object(i.a)({},se),{},{passedContent:Be.payload});default:throw new Error}}Ke.a=function(se){var Be=se.language,me=se.dispatch,xe=se.shixunWorkReport,Le=se.v,Ae=se.languages,le=se.onPathChange,fe=se.autoHeight,Ve=se.diff_code_count,Lt=se.data,Pt=Object(w.useState)(Ae==null?void 0:Ae[0]),vt=Object(s.a)(Pt,2),Fe=vt[0],_t=vt[1],tt=xe!="shixunWorkReport"&&Object(k.i)();return Object(w.useEffect)(function(){_t(Ae==null?void 0:Ae[0])},[]),Object(w.useEffect)(function(){var Rt;_t(Ae==null||((Rt=Ae.filter(function(Ge){return Ge.language===(Fe==null?void 0:Fe.language)}))===null||Rt===void 0)?void 0:Rt[0])},[Ae]),T.a.createElement(T.a.Fragment,null,T.a.createElement("h2",null," ",T.a.createElement("span",null,T.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Ae==null?void 0:Ae.length)>1&&T.a.createElement(u.a.Group,{defaultValue:Be,style:{marginLeft:10},onChange:function(Ge){var Ft;_t(Ae==null||((Ft=Ae.filter(function(wt){return wt.language===Ge.target.value}))===null||Ft===void 0)?void 0:Ft[0])}},Ae==null?void 0:Ae.map(function(Rt){return T.a.createElement(u.a,{value:Rt==null?void 0:Rt.language},Rt==null?void 0:Rt.language)}))),Object(c.c)()&&xe!="shixunWorkReport"&&T.a.createElement("span",null,T.a.createElement("span",null,"\u5F97\u5206 ",Fe==null?void 0:Fe.score,"/",Fe==null?void 0:Fe.total_score),T.a.createElement(D.a,{style:{margin:"0px 10px"},onClick:function(){var Ge=Fe==null?void 0:Fe.score;o.a.confirm({title:"\u8C03\u5206",content:T.a.createElement("div",null,T.a.createElement("p",null,"\u5F97\u5206\uFF1A",Fe==null?void 0:Fe.score,"/",Fe==null?void 0:Fe.total_score),T.a.createElement("p",null,"\u8C03\u5206\uFF1A",T.a.createElement(h.a,{min:0,max:Fe==null?void 0:Fe.total_score,defaultValue:Fe==null?void 0:Fe.score,onChange:function(wt){Ge=wt}}))),okText:"\u786E\u8BA4",onOk:function(){var Ft=Object(b.a)(x.a.mark(function yt(){var bn;return x.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Object(E.a)("/api/courses/".concat(tt==null?void 0:tt.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:tt==null?void 0:tt.coursesId,hack_user_code_id:Fe==null?void 0:Fe.hack_user_id,score:Ge}});case 2:bn=sn.sent,bn.status===0&&(A.b.success("\u8C03\u5206\u6210\u529F"),me({type:"shixunHomeworks/setActionTabs",payload:{}}),me({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},tt)}));case 4:case"end":return sn.stop()}},yt)}));function wt(){return Ft.apply(this,arguments)}return wt}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(c.c)()&&xe!="shixunWorkReport"&&T.a.createElement(D.a,{onClick:function(){me({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:xe.user_id,type:"1",language:Fe==null?void 0:Fe.language,v:Le,data:Object(i.a)({},xe)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),T.a.createElement(_.b,{height:300,language:Fe==null?void 0:Fe.language,value:v.Base64.decode(Fe==null?void 0:Fe.code),autoHeight:fe,theme:"default",options:K}),((Fe==null?void 0:Fe.comment)||(Fe==null?void 0:Fe.hidden_comment))&&T.a.createElement("div",null,T.a.createElement(B.a,{align:"middle",style:{borderTop:"1px solid #eee"}},T.a.createElement(P.a,{flex:1},T.a.createElement("h1",{className:f.a.title},"\u70B9\u8BC4\u5185\u5BB9")),T.a.createElement(P.a,{className:"pr30"},Object(c.c)()&&T.a.createElement(D.a,{onClick:Object(b.a)(x.a.mark(function Rt(){return x.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:o.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:T.a.createElement(W.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(b.a)(x.a.mark(function yt(){var bn;return x.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Object(H.m)({comment_id:Fe==null?void 0:Fe.comment_id,homeworkId:tt.homeworkId,type:"hack"});case 2:bn=sn.sent,bn.status===0&&(A.b.success("\u5220\u9664\u6210\u529F"),me({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},tt)}));case 4:case"end":return sn.stop()}},yt)}))()}});case 1:case"end":return Ft.stop()}},Rt)}))},T.a.createElement(j.a,null),"\u5220\u9664"))),T.a.createElement(z.a,{style:{margin:0}}),(Fe==null?void 0:Fe.comment)&&T.a.createElement("aside",{className:"pl30 pr30 mt20"},T.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),T.a.createElement("br",null),T.a.createElement(U.a,{value:Fe==null?void 0:Fe.comment})),(Fe==null?void 0:Fe.hidden_comment)&&T.a.createElement("aside",{className:"pl30 pr30 mt20"},T.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),T.a.createElement("br",null),T.a.createElement(U.a,{value:Fe==null?void 0:Fe.hidden_comment}))))}},dejd:function(zt,Ke,M){},dmUQ:function(zt,Ke,M){"use strict";var Q=M("Ff2n"),z=M("rePB"),I=M("1OyB"),B=M("vuIU"),R=M("Ji7U"),P=M("md7G"),F=M("foSv"),D=M("cDcd"),L=M.n(D),A=M("TSYQ"),b=M.n(A),m=M("4IlW");function h(f,c){var v=Object.keys(f);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(f);c&&(p=p.filter(function(E){return Object.getOwnPropertyDescriptor(f,E).enumerable})),v.push.apply(v,p)}return v}function d(f){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?h(Object(v),!0).forEach(function(p){Object(z.a)(f,p,v[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(v)):h(Object(v)).forEach(function(p){Object.defineProperty(f,p,Object.getOwnPropertyDescriptor(v,p))})}return f}function o(f){var c=a();return function(){var p=Object(F.a)(f),E;if(c){var k=Object(F.a)(this).constructor;E=Reflect.construct(p,arguments,k)}else E=p.apply(this,arguments);return Object(P.a)(this,E)}}function a(){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 u(){}function s(f){f.preventDefault()}var i=function(c){return c.replace(/[^\w.-]+/g,"")},n=200,S=600,C=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(c){return c!=null},w=function(c,v){return v===c||typeof v=="number"&&typeof c=="number"&&isNaN(v)&&isNaN(c)},T=function(f){Object(R.a)(v,f);var c=o(v);function v(p){var E;Object(I.a)(this,v),E=c.call(this,p),E.onKeyDown=function(H){var W=E.props,j=W.onKeyDown,O=W.onPressEnter;if(H.keyCode===m.a.UP){var K=E.getRatio(H);E.up(H,K,null),E.stop()}else if(H.keyCode===m.a.DOWN){var Y=E.getRatio(H);E.down(H,Y,null),E.stop()}else H.keyCode===m.a.ENTER&&O&&O(H);if(E.recordCursorPosition(),E.lastKeyCode=H.keyCode,j){for(var ee=arguments.length,se=new Array(ee>1?ee-1:0),Be=1;Be<ee;Be++)se[Be-1]=arguments[Be];j.apply(void 0,[H].concat(se))}},E.onKeyUp=function(H){var W=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),W){for(var j=arguments.length,O=new Array(j>1?j-1:0),K=1;K<j;K++)O[K-1]=arguments[K];W.apply(void 0,[H].concat(O))}},E.onChange=function(H){var W=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(H)),E.setState({inputValue:E.rawInput}),W(E.toNumber(E.rawInput))},E.onMouseUp=function(){var H=E.props.onMouseUp;E.recordCursorPosition(),H&&H.apply(void 0,arguments)},E.onFocus=function(){var H;E.setState({focused:!0}),(H=E.props).onFocus.apply(H,arguments)},E.onBlur=function(){var H=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var W=E.getCurrentValidValue(E.state.inputValue),j=E.setValue(W,u);if(H){var O=E.input.value,K=E.getInputDisplayValue({focus:!1,value:j});E.input.value=K&&Number(K),H.apply(void 0,arguments),E.input.value=O}},E.getRatio=function(H){var W=1;return H.metaKey||H.ctrlKey?W=.1:H.shiftKey&&(W=10),W},E.getFullNum=function(H){return isNaN(H)?H:/e/i.test(String(H))?Number(H).toFixed(18).replace(/\.?0+$/,""):H},E.getPrecision=function(H){if(x(E.props.precision))return E.props.precision;var W=String(H);if(W.indexOf("e-")>=0)return parseInt(W.slice(W.indexOf("e-")+2),10);var j=0;return W.indexOf(".")>=0&&(j=W.length-W.indexOf(".")-1),j},E.getInputDisplayValue=function(H){var W=H||E.state,j=W.focused,O=W.inputValue,K=W.value,Y;j?Y=O:Y=E.toPrecisionAsStep(K),Y==null&&(Y="");var ee=E.formatWrapper(Y);return x(E.props.decimalSeparator)&&(ee=ee.toString().replace(".",E.props.decimalSeparator)),ee},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(H){}},E.restoreByAfter=function(H){if(H===void 0)return!1;var W=E.input.value,j=W.lastIndexOf(H);if(j===-1)return!1;var O=E.cursorBefore.length;return E.lastKeyCode===m.a.DELETE&&E.cursorBefore.charAt(O-1)===H[0]?(E.fixCaret(O,O),!0):j+H.length===W.length?(E.fixCaret(j,j),!0):!1},E.partRestoreByAfter=function(H){return H===void 0?!1:Array.prototype.some.call(H,function(W,j){var O=H.substring(j);return E.restoreByAfter(O)})},E.isNotCompleteNumber=function(H){return isNaN(H)||H===""||H===null||H&&H.toString().indexOf(".")===H.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(H,W,j){E.pressingUpOrDown=!0,E.step("down",H,W,j)},E.up=function(H,W,j){E.pressingUpOrDown=!0,E.step("up",H,W,j)},E.saveInput=function(H){E.input=H};var k=p.value;k===void 0&&(k=p.defaultValue),E.state={focused:p.autoFocus};var U=E.getValidValue(E.toNumber(k));return E.state=d(d({},E.state),{},{inputValue:E.toPrecisionAsStep(U),value:U}),E}return Object(B.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var k=this.props,U=k.value,H=k.onChange,W=k.max,j=k.min,O=this.state.focused;if(E){if(!w(E.value,U)||!w(E.max,W)||!w(E.min,j)){var K=O?U:this.getValidValue(U),Y;this.pressingUpOrDown?Y=K:this.inputting?Y=this.rawInput:Y=this.toPrecisionAsStep(K),this.setState({value:K,inputValue:Y})}var ee="value"in this.props?U:this.state.value;"max"in this.props&&E.max!==W&&typeof ee=="number"&&ee>W&&H&&H(W),"min"in this.props&&E.min!==j&&typeof ee=="number"&&ee<j&&H&&H(j)}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===m.a.BACKSPACE?se=this.cursorStart-1:this.lastKeyCode===m.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 m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Be){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(E){var k=E;return k===""?k="":this.isNotCompleteNumber(parseFloat(k))?k=this.state.value:k=this.getValidValue(k),this.toNumber(k)}},{key:"getValueFromEvent",value:function(E){var k=E.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(k=k.replace(this.props.decimalSeparator,".")),k}},{key:"getValidValue",value:function(E){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,H=parseFloat(E);return isNaN(H)?E:(H<k&&(H=k),H>U&&(H=U),H)}},{key:"setValue",value:function(E,k){var U=this.props.precision,H=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),W=this.state.value,j=W===void 0?null:W,O=this.state.inputValue,K=O===void 0?null:O,Y=typeof H=="number"?H.toFixed(U):"".concat(H),ee=H!==j||Y!=="".concat(K);return"value"in this.props?(K=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:K},k)):this.setState({value:H,inputValue:this.toPrecisionAsStep(E)},k),ee&&this.props.onChange(H),H}},{key:"getMaxPrecision",value:function(E){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,H=U.precision,W=U.step;if(x(H))return H;var j=this.getPrecision(k),O=this.getPrecision(W),K=this.getPrecision(E);return E?Math.max(K,j+O):j+O}},{key:"getPrecisionFactor",value:function(E){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(E,k);return Math.pow(10,U)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var k=Math.abs(this.getMaxPrecision(E));return isNaN(k)?E.toString():Number(E).toFixed(k)}},{key:"toNumber",value:function(E){var k=this.props.precision,U=this.state.focused,H=E&&E.length>16&&U;return this.isNotCompleteNumber(E)||H?E:x(k)?Math.round(E*Math.pow(10,k))/Math.pow(10,k):Number(E)}},{key:"upStep",value:function(E,k){var U=this.props.step,H=this.getPrecisionFactor(E,k),W=Math.abs(this.getMaxPrecision(E,k)),j=((H*E+H*U*k)/H).toFixed(W);return this.toNumber(j)}},{key:"downStep",value:function(E,k){var U=this.props.step,H=this.getPrecisionFactor(E,k),W=Math.abs(this.getMaxPrecision(E,k)),j=((H*E-H*U*k)/H).toFixed(W);return this.toNumber(j)}},{key:"step",value:function(E,k){var U=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,W=arguments.length>3?arguments[3]:void 0;this.stop(),k&&(k.persist(),k.preventDefault());var j=this.props;if(j.disabled)return;var O=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(O))return;var K=this["".concat(E,"Step")](O,H),Y=K>j.max||K<j.min;if(K>j.max?K=j.max:K<j.min&&(K=j.min),this.setValue(K,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),Y)return;this.autoStepTimer=setTimeout(function(){U[E](k,H,!0)},W?n:S)}},{key:"fixCaret",value:function(E,k){if(E===void 0||k===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,H=this.input.selectionEnd;(E!==U||k!==H)&&this.input.setSelectionRange(E,k)}catch(W){}}},{key:"render",value:function(){var E,k=this.props,U=k.prefixCls,H=k.disabled,W=k.readOnly,j=k.useTouch,O=k.autoComplete,K=k.upHandler,Y=k.downHandler,ee=k.className,se=k.max,Be=k.min,me=k.style,xe=k.title,Le=k.onMouseEnter,Ae=k.onMouseLeave,le=k.onMouseOver,fe=k.onMouseOut,Ve=k.required,Lt=k.onClick,Pt=k.tabIndex,vt=k.type,Fe=k.placeholder,_t=k.id,tt=k.inputMode,Rt=k.pattern,Ge=k.step,Ft=k.maxLength,wt=k.autoFocus,yt=k.name,bn=k.onPaste,un=k.onInput,sn=Object(Q.a)(k,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Ye=this.state,nn=Ye.value,An=Ye.focused,ke=b()(U,(E={},Object(z.a)(E,ee,!!ee),Object(z.a)(E,"".concat(U,"-disabled"),H),Object(z.a)(E,"".concat(U,"-focused"),An),E)),Pe={};Object.keys(sn).forEach(function(ue){(ue.substr(0,5)==="data-"||ue.substr(0,5)==="aria-"||ue==="role")&&(Pe[ue]=sn[ue])});var rt=!W&&!H,ht=this.getInputDisplayValue(null),Ue=(nn||nn===0)&&(isNaN(nn)||Number(nn)>=se),ut=(nn||nn===0)&&(isNaN(nn)||Number(nn)<=Be),Ee=Ue||H||W,ce=ut||H||W,he=b()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(z.a)({},"".concat(U,"-handler-up-disabled"),Ee)),J=b()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(z.a)({},"".concat(U,"-handler-down-disabled"),ce)),Z=j?{onTouchStart:Ee?u:this.up,onTouchEnd:this.stop}:{onMouseDown:Ee?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},re=j?{onTouchStart:ce?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return L.a.createElement("div",{className:ke,style:me,title:xe,onMouseEnter:Le,onMouseLeave:Ae,onMouseOver:le,onMouseOut:fe,onFocus:function(){return null},onBlur:function(){return null}},L.a.createElement("div",{className:"".concat(U,"-handler-wrap")},L.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Increase Value","aria-disabled":Ee,className:he}),K||L.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:s})),L.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:J}),Y||L.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:s}))),L.a.createElement("div",{className:"".concat(U,"-input-wrap")},L.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Be,"aria-valuemax":se,"aria-valuenow":nn,required:Ve,type:vt,placeholder:Fe,onPaste:bn,onClick:Lt,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:Pt,autoComplete:O,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:rt?this.onKeyDown:u,onKeyUp:rt?this.onKeyUp:u,autoFocus:wt,maxLength:Ft,readOnly:W,disabled:H,max:se,min:Be,step:Ge,name:yt,title:xe,id:_t,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ht),pattern:Rt,inputMode:tt,onInput:un},Pe))))}}]),v}(L.a.Component);T.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:C,min:-C,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:i,required:!1,autoComplete:"off"};var _=T,y=Ke.a=_},eozf:function(zt,Ke,M){"use strict";M.d(Ke,"b",function(){return Ae}),M.d(Ke,"c",function(){return le});var Q=M("sRBo"),z=M("kaz8"),I=M("5Dmo"),B=M("3S7+"),R=M("/zsF"),P=M("PArb"),F=M("7Kak"),D=M("9yH6"),L=M("14J3"),A=M("BMrR"),b=M("+L6B"),m=M("2/Rp"),h=M("jCWc"),d=M("kPKH"),o=M("2qtc"),a=M("kLXV"),u=M("9og8"),s=M("miYZ"),i=M("tsqr"),n=M("oBTY"),S=M("k1fw"),C=M("tJVT"),x=M("OaEy"),w=M("2fM7"),T=M("iQDF"),_=M("+eQT"),y=M("WmNS"),f=M.n(y),c=M("cDcd"),v=M.n(c),p=M("/MfK"),E=M("w5pM"),k=M("Lyp1"),U=M("wd/R"),H=M.n(U),W=M("xKgJ"),j=M("ErOA"),O=M("LvDl"),K=M.n(O),Y=M("1vsH"),ee=M("zetH"),se=M.n(ee),Be=M("Ty5D"),me=M("9kvl"),xe=M("AHFd");function Le(Pt,vt){for(var Fe=[],_t=Pt;_t<vt;_t++)Fe.push(_t);return Fe}var Ae=function(vt,Fe,_t){var tt=vt<H()().startOf("day"),Rt=vt>H()(Fe).endOf("day"),Ge=vt<H()(_t).startOf("day");return Fe?_t?H()()<=H()(_t)?Ge||Rt:tt||Rt:vt&&tt||Rt:_t&&H()()<=H()(_t)?Ge:tt},le=function(vt,Fe){var _t=parseInt(H()(vt).format("HH")),tt=parseInt(H()().format("HH")),Rt=parseInt(H()().format("mm"));if(!vt)return{disabledHours:function(){return Le(0,tt)},disabledMinutes:function(){return Le(0,Rt)}};if(Fe){var Ge=parseInt(H()(Fe).format("HH")),Ft=parseInt(H()(Fe).format("mm"));return H()(vt).isSame(H()(Fe),"day")?{disabledHours:function(){return Le(0,Ge)},disabledMinutes:function(){return _t<=Ge?Le(0,Ft):[]}}:void 0}return H()(vt).isSame(H()(),"day")?{disabledHours:function(){return Le(0,tt)},disabledMinutes:function(){return H()(vt).isSame(H()(),"hour")&&_t<=tt?Le(0,Rt):[]}}:void 0},fe=_.a.RangePicker,Ve=w.a.Option,Lt=function(vt){var Fe,_t,tt,Rt,Ge,Ft,wt,yt=vt.shixunHomeworks,bn=vt.loading,un=vt.dispatch,sn=Object(Be.i)(),Ye=yt.workSetting,nn=yt.workList,An=yt.changeData,ke=Object(c.useState)(!0),Pe=Object(C.a)(ke,2),rt=Pe[0],ht=Pe[1],Ue=Object(c.useState)(!1),ut=Object(C.a)(Ue,2),Ee=ut[0],ce=ut[1],he=Object(c.useState)([]),J=Object(C.a)(he,2),Z=J[0],re=J[1],ue=Object(c.useState)([]),de=Object(C.a)(ue,2),Ne=de[0],ct=de[1],Gt=Object(c.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:xe.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}),an=Object(C.a)(Gt,2),it=an[0],qt=an[1];Object(c.useEffect)(function(){return st(),function(){re([].concat())}},[]);var st=function(){un({type:"shixunHomeworks/getWorkSetting",payload:Object(S.a)({},sn)})};Object(c.useEffect)(function(){var Ce;if(!(Ye!=null&&Ye.course_id))return;Object.keys(it).map(function(De){it[De]=Ye[De]}),(!it.allow_late||!it.unified_late)&&(it.late_penalty=20,it.penalty_type=xe.a.Percent),it.unified_setting||(it.unified_late=!1,it.unified_anonymous_comment=!1,it.unified_anonymous_appeal=!1),Z=JSON.parse(JSON.stringify(Ye.group_settings.map(function(De){return Object(S.a)(Object(S.a)({},De),{},{group_name:[De.group_name]})}).filter(function(De){return De.publish_time!==null}))),Ne=JSON.parse(JSON.stringify(Ye.allow_late_settings.map(function(De){return Object(S.a)(Object(S.a)({},De),{},{group_name:[De.group_name]})}).filter(function(De){return De.late_time!==null}))),qt(Object(S.a)({},it)),re(Object(n.a)(Z)),((Ce=Ne)===null||Ce===void 0?void 0:Ce.length)<=0?ct([{penalty_type:xe.a.Percent,late_penalty:20}]):ct(Object(n.a)(Ne))},[Ye]);var pt=function(){var De,mt,Jt=JSON.parse(JSON.stringify(it));if(Jt.challenge_settings.filter(function(wn){return!wn.hide}),Jt.categoryId=sn.categoryId,(De=Jt.challenge_settings)!==null&&De!==void 0&&De.every(function(wn){return!wn.checked})){i.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(it.unified_setting||(Z=(mt=Z)===null||mt===void 0?void 0:mt.map(function(wn){var sa;if(!wn.publish_time||!wn.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(!wn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return wn.group_name=typeof(wn==null?void 0:wn.group_name)=="string"?[wn==null?void 0:wn.group_name]:wn==null?void 0:wn.group_name,wn.group_id=(sa=Ye.group_settings)===null||sa===void 0?void 0:sa.filter(function(zn){var En;return wn==null||((En=wn.group_name)===null||En===void 0)?void 0:En.includes(zn.group_name)}).map(function(zn){return zn.group_id||zn.id}).toString().split(","),wn})),Jt.group_settings=Z,it.allow_late)if(it.unified_late){if(it.late_penalty===null||it.late_penalty===void 0||it.late_penalty<0||it.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(!it.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 cn;Ne=(cn=Ne)===null||cn===void 0?void 0:cn.map(function(wn){var sa,zn;if(wn.late_penalty===null||wn.late_penalty===void 0||wn.late_penalty<0||wn.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(!wn.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(!wn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return wn.group_name=typeof(wn==null?void 0:wn.group_name)=="string"?[wn==null?void 0:wn.group_name]:wn==null?void 0:wn.group_name,wn.group_id=wn==null||((sa=wn.group_name)===null||sa===void 0||((zn=sa.map(function(En){var ga,Ua,ta=(ga=Ye.group_settings)===null||ga===void 0||((Ua=ga.filter(function(la){return(la==null?void 0:la.group_name)===En}))===null||Ua===void 0)?void 0:Ua[0];return ta==null?void 0:ta.group_id}))===null||zn===void 0))?void 0:zn.toString().split(","),wn}),Jt.allow_late_settings=Ne}Qe(Jt)},Qe=function(De){var mt,Jt;if(De.total_score===null){i.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(De!=null&&De.work_efficiency&&De.eff_score===null){i.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var cn=De.challenge_settings.reduce(function(zn,En){return zn+Number(En.challenge_score)},0);if((cn==null?void 0:cn.toFixed(10))!==((mt=De.total_score-De.eff_score)===null||mt===void 0?void 0:mt.toFixed(10))){i.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(De.total_score,"\u5206"));return}var wn={shixun_evaluation:De.shixun_evaluation,challenge_settings:De.challenge_settings},sa=function(){var zn=Object(u.a)(f.a.mark(function En(){var ga;return f.a.wrap(function(ta){for(;;)switch(ta.prev=ta.next){case 0:return ce(!0),ta.next=3,Object(j.a)("/api/homework_commons/".concat(sn.categoryId,"/publish_setting.json"),{method:"post",body:Object(S.a)({},De)});case 3:ga=ta.sent,ga.status===0&&(i.b.success("\u66F4\u65B0\u6210\u529F"),ht(!0),st(),un({type:"shixunHomeworks/getWorkList",payload:Object(S.a)({},sn)})),ce(!1);case 6:case"end":return ta.stop()}},En)}));return function(){return zn.apply(this,arguments)}}();!Object(O.isEqual)(An,wn)&&!(nn!=null&&(Jt=nn.homework_status)!==null&&Jt!==void 0&&Jt.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:sa}):sa()},ie=function(De,mt){var Jt,cn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return mt?mt.find(function(wn){return wn[cn]===De}):Ye==null||((Jt=Ye.group_settings)===null||Jt===void 0)?void 0:Jt.find(function(wn){return wn.group_id[0]===De})},be=(Ye==null?void 0:Ye.allow_late)||(Ye==null?void 0:Ye.anonymous_comment),Ot=function(De){var mt=ie(De,Ye==null?void 0:Ye.allow_late_settings,"id"),Jt=ie(De,Ye==null?void 0:Ye.anonymous_comment_settings);return(Ye==null?void 0:Ye.allow_late)&&mt&&(mt==null?void 0:mt.late_time)!==null||(Ye==null?void 0:Ye.anonymous_comment)&&Jt&&(Jt==null?void 0:Jt.evaluation_start)!==null},qe=Object(c.useMemo)(function(){var Ce;if(Ye!=null&&Ye.unified_setting){var De;return!(nn!=null&&(De=nn.homework_status)!==null&&De!==void 0&&De.includes("\u5DF2\u622A\u6B62"))||(Ye==null?void 0:Ye.allow_late)||(Ye==null?void 0:Ye.anonymous_comment)}var mt=Ye==null||((Ce=Ye.group_settings)===null||Ce===void 0)?void 0:Ce.some(function(Jt){return H()(Jt.end_time)<=H()()});return!mt||(Ye==null?void 0:Ye.allow_late)||(Ye==null?void 0:Ye.all_group_late)},[Ye,nn]),Bt=Ye==null?void 0:Ye.anonymous_comment,Qt=function(De){if(!De)return!1;var mt=ie(De,Ye==null?void 0:Ye.anonymous_comment_settings);return(Ye==null?void 0:Ye.anonymous_comment)&&mt&&(mt==null?void 0:mt.evaluation_start)!==null};return v.a.createElement("section",{className:[se.a.form," bg-white pl30 pr30 pt10"].join(" ")},v.a.createElement(A.a,null,v.a.createElement(d.a,{span:24},v.a.createElement(A.a,{align:"middle"},v.a.createElement(d.a,{flex:"1"}),v.a.createElement(d.a,null,Object(W.c)()&&rt&&v.a.createElement(m.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return ht(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),v.a.createElement("div",null,v.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",v.a.createElement(D.a.Group,{disabled:rt||!(nn!=null&&(Fe=nn.homework_status)!==null&&Fe!==void 0&&Fe.includes("\u672A\u53D1\u5E03")),value:it.unified_setting,onChange:function(De){var mt;if(!(nn!=null&&(mt=nn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))){i.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(it.unified_setting=!it.unified_setting,it.unified_setting||(it.unified_late=!1),qt(Object.assign({},it)),it.unified_setting===!1&&Z==""){re(Z.concat({}));return}it.unified_setting&&(re([]),ct([{late_penalty:5}]))}},v.a.createElement(D.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),v.a.createElement(D.a,{disabled:(Ye==null||((_t=Ye.group_settings)===null||_t===void 0)?void 0:_t.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Ye==null||((tt=Ye.group_settings)===null||tt===void 0)?void 0:tt.length)===0&&v.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"))),it.unified_setting&&v.a.createElement("div",null,v.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u53D1\u5E03\u65F6\u95F4:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(_.a,{disabled:rt||!(nn!=null&&(Rt=nn.homework_status)!==null&&Rt!==void 0&&Rt.includes("\u672A\u53D1\u5E03")||nn!=null&&(Ge=nn.homework_status)!==null&&Ge!==void 0&&Ge.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(De){return Ae(De,Ye==null?void 0:Ye.course_end_date)},disabledTime:function(De){return le(De)},value:it.publish_time?H()(it.publish_time):"",onChange:function(De,mt){it.publish_time=mt,(it.end_time==""||!it.end_time)&&it.unified_setting&&(it.end_time=H()(De).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),qt(Object.assign({},it))}})),v.a.createElement(d.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),v.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u622A\u6B62\u65F6\u95F4:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(_.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(Y.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:rt||be,disabledDate:function(De){return Ae(De,Ye==null?void 0:Ye.course_end_date,it.publish_time)},disabledTime:function(De){return le(De,it.publish_time)},value:it.end_time?H()(it.end_time):"",onChange:function(De,mt){it.end_time=mt,qt(Object.assign({},it))}})),v.a.createElement(d.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!it.unified_setting&&((Ft=Z)===null||Ft===void 0?void 0:Ft.length)>0&&v.a.createElement(A.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},v.a.createElement(d.a,{span:24},v.a.createElement(A.a,null,v.a.createElement(d.a,{span:10}),v.a.createElement(d.a,{span:10},v.a.createElement(A.a,{className:"c-grey-c ml30"},v.a.createElement(d.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),v.a.createElement(d.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),v.a.createElement(d.a,{span:4}))),Z&&Z.map(function(Ce,De){var mt,Jt,cn,wn,sa;return v.a.createElement(d.a,{span:24,key:De},v.a.createElement(A.a,{gutter:[8,16]},v.a.createElement(d.a,{span:10},v.a.createElement(A.a,{gutter:[8,16]},v.a.createElement(d.a,null,"\u53D1\u5E03\u89C4\u5219 ",De+1),v.a.createElement(d.a,{flex:"1",style:{maxWidth:300}},v.a.createElement(w.a,{disabled:rt||!(nn!=null&&(mt=nn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))&&Ce.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Ce.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(En){Z[De].group_name=En,Z[De].group_id=Ce.group_id;var ga=Object(O.flattenDeep)(Z.map(function(ta){return ta.group_name})),Ua=Ne.map(function(ta){var la=(ta==null?void 0:ta.group_name)||[];return Object(S.a)(Object(S.a)({},ta),{},{group_name:Object(O.remove)(la,function(Ra){return ga.includes(Ra)})})});ct(Ua),re(Z.slice())}},Ye.group_settings&&Ye.group_settings.map(function(zn){var En=Z.map(function(ga){return ga.group_name}).flat();if(!En.includes(zn.group_name))return v.a.createElement(Ve,{value:zn.group_name,key:zn.id},zn.group_name)}))))),v.a.createElement(d.a,{span:10},v.a.createElement("div",{className:"ml30"},v.a.createElement(fe,{ranges:{\u6B64\u523B:[Ce.publish_time?H()(Ce.publish_time):H()(),H()()]},allowClear:!1,disabled:rt||(H()()<=H()((Jt=ie((cn=Ce.group_id)===null||cn===void 0?void 0:cn[0]))===null||Jt===void 0?void 0:Jt.publish_time)?!1:[!0,Ot((wn=Ce.group_id)===null||wn===void 0?void 0:wn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(En){return Ae(En,Ye==null?void 0:Ye.course_end_date)},disabledTime:function(En){return le(En)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[H()(Object(Y.d)(),"HH:mm"),H()(Object(Y.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Ce.publish_time&&[H()(Ce.publish_time),Ce.end_time?H()(Ce.end_time):void 0],onChange:function(En,ga){Z[De].publish_time=ga[0],Z[De].end_time=ga[1],re(Object(n.a)(Z))}}))),!rt&&v.a.createElement(d.a,{span:4},De>0&&!Ce.id&&v.a.createElement(p.a,{onClick:function(){Z=Z.filter(function(En,ga){return De!==ga}),re(Z.slice()),setTimeout(function(){return re(Z.slice())},10)}}),Z.length<(Ye==null||((sa=Ye.group_settings)===null||sa===void 0)?void 0:sa.length)&&v.a.createElement(E.a,{className:"c-green ml20",onClick:function(){re(Z.concat({}))}}))))})),v.a.createElement(P.a,null),v.a.createElement(A.a,null,v.a.createElement(d.a,null,v.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),v.a.createElement(B.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"},v.a.createElement(k.a,{style:{marginLeft:4,cursor:"pointer"}}))),v.a.createElement(d.a,{span:24,className:"mt15 pl30"},v.a.createElement(z.a,{checked:it.allow_late,disabled:rt||qe,onChange:function(){it.allow_late=!it.allow_late,Ne==""&&ct([{late_penalty:5}]),qt(Object.assign({},it))}},v.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),v.a.createElement(B.a,{overlayStyle:{width:380,maxWidth:380},title:v.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},v.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),v.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"),v.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"))},v.a.createElement(k.a,null)))),(it==null?void 0:it.allow_late)&&v.a.createElement("div",{style:{marginLeft:22}},v.a.createElement("div",{className:"ml30 mt20"},v.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),v.a.createElement(D.a.Group,{disabled:rt||(Ye==null?void 0:Ye.anonymous_comment)||(Ye==null?void 0:Ye.allow_late),value:it.unified_late,onChange:function(De){it.unified_late=De.target.value,Ne==""&&!De.target.value&&ct([{penalty_type:xe.a.Percent,late_penalty:20}]),qt(Object(S.a)({},it))}},(it==null?void 0:it.unified_setting)&&v.a.createElement(D.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Ye==null||((wt=Ye.group_settings)===null||wt===void 0)?void 0:wt.length)>0&&v.a.createElement(D.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),it!=null&&it.unified_late?v.a.createElement(v.a.Fragment,null,v.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u8865\u4EA4\u6263\u5206:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(xe.b,{disabled:rt||Bt,value:{type:it.penalty_type,inputValue:it.late_penalty},onChange:function(De){qt(Object(S.a)(Object(S.a)({},it),{},{late_penalty:De.inputValue,penalty_type:De.type}))}})),v.a.createElement(d.a,{flex:"1",className:"ml5"},v.a.createElement("span",{className:"c-grey-c ml10"},it.penalty_type===xe.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)"))),v.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(_.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(Y.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:rt||Bt,value:it.late_time?H()(it.late_time):"",disabledDate:function(De){return Ae(De,Ye==null?void 0:Ye.course_end_date)},onChange:function(De,mt){it.late_time=mt,qt(Object.assign({},it))}})),v.a.createElement(d.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Ne.map(function(Ce,De){var mt;return v.a.createElement(d.a,{span:24,key:De},v.a.createElement(A.a,{className:"mt25"},v.a.createElement(d.a,{style:{marginLeft:30}},v.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",De+1,"\uFF1A"),v.a.createElement(w.a,{disabled:rt||!(nn!=null&&(mt=nn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))&&Ce.id||(Ye==null?void 0:Ye.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Ce.group_name=="string"?[Ce.group_name]:Ce.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(cn){Ne[De].group_name=cn,Ne[De].group_id=Ce.group_id,ct(Ne.slice())}},Ye.group_settings&&Ye.group_settings.map(function(Jt){var cn=Ne.map(function(sa){return sa.group_name}).flat(),wn=Z.map(function(sa){return sa.group_name}).flat();if(it!=null&&it.unified_setting){if(!cn.includes(Jt.group_name))return v.a.createElement(Ve,{value:Jt.group_name,key:Jt.id},Jt.group_name)}else if(wn.includes(Jt.group_name)&&(!cn.includes(Jt.group_name)&&H()(Jt.end_time)<=H()()))return v.a.createElement(Ve,{value:Jt.group_name,key:Jt.id},Jt.group_name)}))),v.a.createElement(d.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),v.a.createElement(xe.b,{disabled:rt||Qt(Ce.id),value:{type:Ce.penalty_type,inputValue:Ce.late_penalty},onChange:function(cn){Ne[De].late_penalty=cn.inputValue,Ne[De].penalty_type=cn.type,ct(Object(n.a)(Ne))}})),v.a.createElement(d.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),v.a.createElement(_.a,{disabled:rt||Qt(Ce.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:H()(Object(Y.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(cn){return Ae(cn,Ye==null?void 0:Ye.course_end_date)},format:"YYYY-MM-DD HH:mm",value:Ce!=null&&Ce.late_time?H()(Ce.late_time):void 0,onChange:function(cn,wn){Ne[De].late_time=wn,ct(Object(n.a)(Ne))}})),!rt&&v.a.createElement(d.a,{className:"ml20"},De>0&&!Ce.id&&v.a.createElement(p.a,{onClick:function(){Ne=Ne.filter(function(cn,wn){return De!==wn}),ct(Ne.slice()),setTimeout(function(){return ct(Ne.slice())},10)}}),v.a.createElement(E.a,{className:"c-green ml20",onClick:function(){ct(Ne.concat({penalty_type:xe.a.Percent,late_minus_score:20}))}}))))})),v.a.createElement(P.a,null),!rt&&v.a.createElement(d.a,{className:"mb50"},v.a.createElement(m.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:Ee,onClick:function(){return pt()}},"\u63D0\u4EA4"),v.a.createElement(m.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){ht(!0),st()}},"\u53D6\u6D88")))};Ke.a=Object(me.a)(function(Pt){var vt=Pt.shixunHomeworks,Fe=Pt.loading;return{shixunHomeworks:vt,loading:Fe.effects}})(Lt)},fyJ8:function(zt,Ke,M){"use strict";var Q=M("rePB"),z=M("VTBJ"),I=M("Ff2n"),B=M("U8pU"),R=M("cDcd"),P=M.n(R),F=M("TSYQ"),D=M.n(F),L=M("c+Xe"),A=M("sR1s");function b(a){return a&&Object(B.a)(a)==="object"&&!Array.isArray(a)&&!R.isValidElement(a)}function m(a){return typeof a=="string"?!0:Object(L.c)(a)}function h(a,u){var s,i=a.prefixCls,n=a.className,S=a.record,C=a.index,x=a.dataIndex,w=a.render,T=a.children,_=a.component,y=_===void 0?"td":_,f=a.colSpan,c=a.rowSpan,v=a.fixLeft,p=a.fixRight,E=a.firstFixLeft,k=a.lastFixLeft,U=a.firstFixRight,H=a.lastFixRight,W=a.appendNode,j=a.additionalProps,O=j===void 0?{}:j,K=a.ellipsis,Y=a.align,ee=a.rowType,se=a.isSticky,Be="".concat(i,"-cell"),me,xe;if(T)xe=T;else{var Le=Object(A.b)(S,x);if(xe=Le,w){var Ae=w(Le,S,C);b(Ae)?(xe=Ae.children,me=Ae.props):xe=Ae}}Object(B.a)(xe)==="object"&&!Array.isArray(xe)&&!R.isValidElement(xe)&&(xe=null),K&&(k||U)&&(xe=R.createElement("span",{className:"".concat(Be,"-content")},xe));var le=me||{},fe=le.colSpan,Ve=le.rowSpan,Lt=le.style,Pt=le.className,vt=Object(I.a)(le,["colSpan","rowSpan","style","className"]),Fe=fe!==void 0?fe:f,_t=Ve!==void 0?Ve:c;if(Fe===0||_t===0)return null;var tt={},Rt=typeof v=="number",Ge=typeof p=="number";Rt&&(tt.position="sticky",tt.left=v),Ge&&(tt.position="sticky",tt.right=p);var Ft={};Y&&(Ft.textAlign=Y);var wt,yt=K===!0?{showTitle:!0}:K;yt&&(yt.showTitle||ee==="header")&&(typeof xe=="string"||typeof xe=="number"?wt=xe.toString():R.isValidElement(xe)&&typeof xe.props.children=="string"&&(wt=xe.props.children));var bn=Object(z.a)(Object(z.a)(Object(z.a)({title:wt},vt),O),{},{colSpan:Fe&&Fe!==1?Fe:null,rowSpan:_t&&_t!==1?_t:null,className:D()(Be,n,(s={},Object(Q.a)(s,"".concat(Be,"-fix-left"),Rt),Object(Q.a)(s,"".concat(Be,"-fix-left-first"),E),Object(Q.a)(s,"".concat(Be,"-fix-left-last"),k),Object(Q.a)(s,"".concat(Be,"-fix-right"),Ge),Object(Q.a)(s,"".concat(Be,"-fix-right-first"),U),Object(Q.a)(s,"".concat(Be,"-fix-right-last"),H),Object(Q.a)(s,"".concat(Be,"-ellipsis"),K),Object(Q.a)(s,"".concat(Be,"-with-append"),W),Object(Q.a)(s,"".concat(Be,"-fix-sticky"),(Rt||Ge)&&se),s),O.className,Pt),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},O.style),Ft),tt),Lt),ref:m(y)?u:null});return R.createElement(y,Object.assign({},bn),W,xe)}var d=R.forwardRef(h);d.displayName="Cell";var o=R.memo(d,function(a,u){return u.shouldCellUpdate?!u.shouldCellUpdate(u.record,a.record):!1});Ke.a=o},hW8S:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return B}),M.d(Ke,"c",function(){return R}),M.d(Ke,"b",function(){return P});var Q=M("VTBJ"),z=M("Ff2n"),I=M("Kwbf"),B="RC_TABLE_INTERNAL_COL_DEFINE";function R(F){var D=F.expandable,L=Object(z.a)(F,["expandable"]);return"expandable"in F?Object(Q.a)(Object(Q.a)({},L),D):L}function P(F){return Object.keys(F).reduce(function(D,L){return(L.substr(0,5)==="data-"||L.substr(0,5)==="aria-")&&(D[L]=F[L]),D},{})}},iF7n:function(zt,Ke,M){zt.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"}},k3GJ:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return na});var Q=M("rePB"),z=M("ODXe"),I=M("Ff2n"),B=M("VTBJ"),R=M("cDcd"),P=M("TSYQ"),F=M.n(P),D=M("Zm9Q"),L=M("6cGi"),A=M("KQm4"),b=M("xEkU"),m=M.n(b),h=M("t23M");function d(pe){var Se=Object(R.useRef)(),je=Object(R.useRef)(!1);function _e(){for(var q=arguments.length,oe=new Array(q),ne=0;ne<q;ne++)oe[ne]=arguments[ne];je.current||(m.a.cancel(Se.current),Se.current=m()(function(){pe.apply(void 0,oe)}))}return Object(R.useEffect)(function(){return function(){je.current=!0,m.a.cancel(Se.current)}},[]),_e}function o(pe){var Se=Object(R.useRef)([]),je=Object(R.useState)({}),_e=Object(z.a)(je,2),q=_e[1],oe=Object(R.useRef)(typeof pe=="function"?pe():pe),ne=d(function(){var Te=oe.current;Se.current.forEach(function(We){Te=We(Te)}),Se.current=[],oe.current=Te,q({})});function ye(Te){Se.current.push(Te),ne()}return[oe.current,ye]}var a=M("4IlW");function u(pe,Se){var je,_e=pe.prefixCls,q=pe.id,oe=pe.active,ne=pe.rtl,ye=pe.tab,Te=ye.key,We=ye.tab,we=ye.disabled,Je=ye.closeIcon,St=pe.tabBarGutter,Wt=pe.tabPosition,Zt=pe.closable,Pn=pe.renderWrapper,Nn=pe.removeAriaLabel,qn=pe.editable,Qn=pe.onClick,da=pe.onRemove,ma=pe.onFocus,aa="".concat(_e,"-tab");R.useEffect(function(){return da},[]);var ca={};Wt==="top"||Wt==="bottom"?ca[ne?"marginLeft":"marginRight"]=St:ca.marginBottom=St;var ya=qn&&Zt!==!1&&!we;function en(It){if(we)return;Qn(It)}function Ht(It){It.preventDefault(),It.stopPropagation(),qn.onEdit("remove",{key:Te,event:It})}var dn=R.createElement("div",{key:Te,ref:Se,className:F()(aa,(je={},Object(Q.a)(je,"".concat(aa,"-with-remove"),ya),Object(Q.a)(je,"".concat(aa,"-active"),oe),Object(Q.a)(je,"".concat(aa,"-disabled"),we),je)),style:ca,onClick:en},R.createElement("div",{role:"tab","aria-selected":oe,id:q&&"".concat(q,"-tab-").concat(Te),className:"".concat(aa,"-btn"),"aria-controls":q&&"".concat(q,"-panel-").concat(Te),"aria-disabled":we,tabIndex:we?null:0,onClick:function(kt){kt.stopPropagation(),en(kt)},onKeyDown:function(kt){[a.a.SPACE,a.a.ENTER].includes(kt.which)&&(kt.preventDefault(),en(kt))},onFocus:ma},We),ya&&R.createElement("button",{type:"button","aria-label":Nn||"remove",tabIndex:0,className:"".concat(aa,"-remove"),onClick:function(kt){kt.stopPropagation(),Ht(kt)}},Je||qn.removeIcon||"\xD7"));return Pn&&(dn=Pn(dn)),dn}var s=R.forwardRef(u),i={width:0,height:0,left:0,top:0};function n(pe,Se,je){return Object(R.useMemo)(function(){for(var _e,q=new Map,oe=Se.get((_e=pe[0])===null||_e===void 0?void 0:_e.key)||i,ne=oe.left+oe.width,ye=0;ye<pe.length;ye+=1){var Te=pe[ye].key,We=Se.get(Te);if(!We){var we;We=Se.get((we=pe[ye-1])===null||we===void 0?void 0:we.key)||i}var Je=q.get(Te)||Object(B.a)({},We);Je.right=ne-Je.left-Je.width,q.set(Te,Je)}return q},[pe.map(function(_e){return _e.key}).join("_"),Se,je])}var S={width:0,height:0,left:0,top:0,right:0};function C(pe,Se,je,_e,q){var oe=q.tabs,ne=q.tabPosition,ye=q.rtl,Te,We,we;["top","bottom"].includes(ne)?(Te="width",We=ye?"right":"left",we=Math.abs(Se.left)):(Te="height",We="top",we=-Se.top);var Je=Se[Te],St=je[Te],Wt=_e[Te],Zt=Je;return St+Wt>Je&&(Zt=Je-Wt),Object(R.useMemo)(function(){if(!oe.length)return[0,0];for(var Pn=oe.length,Nn=Pn,qn=0;qn<Pn;qn+=1){var Qn=pe.get(oe[qn].key)||S;if(Qn[We]+Qn[Te]>we+Zt){Nn=qn-1;break}}for(var da=0,ma=Pn-1;ma>=0;ma-=1){var aa=pe.get(oe[ma].key)||S;if(aa[We]<we){da=ma+1;break}}return[da,Nn]},[pe,we,Zt,ne,oe.map(function(Pn){return Pn.key}).join("_"),ye])}var x=M("wx14"),w=M("1OyB"),T=M("vuIU"),_=M("JX7q"),y=M("Ji7U"),f=M("LK+K"),c=M("I8Z2"),v=M("bT9E"),p=M("2GS6"),E=M("Gytx"),k=M.n(E),U=M("U8pU"),H=/iPhone/i,W=/iPod/i,j=/iPad/i,O=/\bAndroid(?:.+)Mobile\b/i,K=/Android/i,Y=/\bAndroid(?:.+)SD4930UR\b/i,ee=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,se=/Windows Phone/i,Be=/\bWindows(?:.+)ARM\b/i,me=/BlackBerry/i,xe=/BB10/i,Le=/Opera Mini/i,Ae=/\b(CriOS|Chrome)(?:.+)Mobile/i,le=/Mobile(?:.+)Firefox\b/i;function fe(pe,Se){return pe.test(Se)}function Ve(pe){var Se=pe||(typeof navigator!="undefined"?navigator.userAgent:""),je=(Se||"").split("[FBAN");if(typeof je[1]!="undefined"){var _e=je,q=Object(z.a)(_e,1);Se=q[0]}if(je=Se.split("Twitter"),typeof je[1]!="undefined"){var oe=je,ne=Object(z.a)(oe,1);Se=ne[0]}var ye={apple:{phone:fe(H,Se)&&!fe(se,Se),ipod:fe(W,Se),tablet:!fe(H,Se)&&fe(j,Se)&&!fe(se,Se),device:(fe(H,Se)||fe(W,Se)||fe(j,Se))&&!fe(se,Se)},amazon:{phone:fe(Y,Se),tablet:!fe(Y,Se)&&fe(ee,Se),device:fe(Y,Se)||fe(ee,Se)},android:{phone:!fe(se,Se)&&fe(Y,Se)||!fe(se,Se)&&fe(O,Se),tablet:!fe(se,Se)&&!fe(Y,Se)&&!fe(O,Se)&&(fe(ee,Se)||fe(K,Se)),device:!fe(se,Se)&&(fe(Y,Se)||fe(ee,Se)||fe(O,Se)||fe(K,Se))||fe(/\bokhttp\b/i,Se)},windows:{phone:fe(se,Se),tablet:fe(Be,Se),device:fe(se,Se)||fe(Be,Se)},other:{blackberry:fe(me,Se),blackberry10:fe(xe,Se),opera:fe(Le,Se),firefox:fe(le,Se),chrome:fe(Ae,Se),device:fe(me,Se)||fe(xe,Se)||fe(Le,Se)||fe(le,Se)||fe(Ae,Se)},any:null,phone:null,tablet:null};return ye.any=ye.apple.device||ye.android.device||ye.windows.device||ye.other.device,ye.phone=ye.apple.phone||ye.android.phone||ye.windows.phone,ye.tablet=ye.apple.tablet||ye.android.tablet||ye.windows.tablet,ye}var Lt=Object(B.a)(Object(B.a)({},Ve()),{},{isMobile:Ve}),Pt=Lt;function vt(){}function Fe(pe,Se,je){var _e=Se||"";return pe.key||"".concat(_e,"item_").concat(je)}function _t(pe){return"".concat(pe,"-menu-")}function tt(pe,Se){var je=-1;R.Children.forEach(pe,function(_e){je+=1,_e&&_e.type&&_e.type.isMenuItemGroup?R.Children.forEach(_e.props.children,function(q){je+=1,Se(q,je)}):Se(_e,je)})}function Rt(pe,Se,je){if(!pe||je.find)return;R.Children.forEach(pe,function(_e){if(_e){var q=_e.type;if(!q||!(q.isSubMenu||q.isMenuItem||q.isMenuItemGroup))return;Se.indexOf(_e.key)!==-1?je.find=!0:_e.props.children&&Rt(_e.props.children,Se,je)}})}var Ge=["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"],Ft=function(Se){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e=Se&&typeof Se.getBoundingClientRect=="function"&&Se.getBoundingClientRect().width;if(_e){if(je){var q=getComputedStyle(Se),oe=q.marginLeft,ne=q.marginRight;_e+=+oe.replace("px","")+ +ne.replace("px","")}_e=+_e.toFixed(6)}return _e||0},wt=function(Se,je,_e){Se&&Object(U.a)(Se.style)==="object"&&(Se.style[je]=_e)},yt=function(){return Pt.any},bn=M("bdgK"),un=M("faye"),sn=M.n(un),Ye=M("wgJM"),nn=M("l4aY"),An=M("m+aA"),ke=M("c+Xe"),Pe=M("zT1h"),rt=M("QC+M");function ht(pe,Se,je){return je?pe[0]===Se[0]:pe[0]===Se[0]&&pe[1]===Se[1]}function Ue(pe,Se,je){var _e=pe[Se]||{};return Object(B.a)(Object(B.a)({},_e),je)}function ut(pe,Se,je,_e){for(var q=je.points,oe=Object.keys(pe),ne=0;ne<oe.length;ne+=1){var ye=oe[ne];if(ht(pe[ye].points,q,_e))return"".concat(Se,"-placement-").concat(ye)}return""}var Ee=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var pe=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(pe)||/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(pe==null?void 0:pe.substr(0,4)))},ce=M("MNnm");function he(pe,Se){var je={};return je[pe.toLowerCase()]=Se.toLowerCase(),je["Webkit".concat(pe)]="webkit".concat(Se),je["Moz".concat(pe)]="moz".concat(Se),je["ms".concat(pe)]="MS".concat(Se),je["O".concat(pe)]="o".concat(Se.toLowerCase()),je}function J(pe,Se){var je={animationend:he("Animation","AnimationEnd"),transitionend:he("Transition","TransitionEnd")};return pe&&("AnimationEvent"in Se||delete je.animationend.animation,"TransitionEvent"in Se||delete je.transitionend.transition),je}var Z=J(Object(ce.a)(),typeof window!="undefined"?window:{}),re={};if(Object(ce.a)()){var ue=document.createElement("div");re=ue.style}var de={};function Ne(pe){if(de[pe])return de[pe];var Se=Z[pe];if(Se)for(var je=Object.keys(Se),_e=je.length,q=0;q<_e;q+=1){var oe=je[q];if(Object.prototype.hasOwnProperty.call(Se,oe)&&oe in re)return de[pe]=Se[oe],de[pe]}return""}var ct=Ne("animationend"),Gt=Ne("transitionend"),an=!!(ct&&Gt),it=ct||"animationend",qt=Gt||"transitionend";function st(pe,Se){if(!pe)return null;if(Object(U.a)(pe)==="object"){var je=Se.replace(/-\w/g,function(_e){return _e[1].toUpperCase()});return pe[je]}return"".concat(pe,"-").concat(Se)}var pt="none",Qe="appear",ie="enter",be="leave",Ot="none",qe="prepare",Bt="start",Qt="active",Ce="end";function De(pe){var Se=Object(R.useRef)(!1),je=Object(R.useState)(pe),_e=Object(z.a)(je,2),q=_e[0],oe=_e[1];function ne(ye){Se.current||oe(ye)}return Object(R.useEffect)(function(){return function(){Se.current=!0}},[]),[q,ne]}var mt=Object(ce.a)()?R.useLayoutEffect:R.useEffect,Jt=mt,cn=function(){var pe=R.useRef(null);function Se(){Ye.a.cancel(pe.current)}function je(_e){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Se();var oe=Object(Ye.a)(function(){q<=1?_e({isCanceled:function(){return oe!==pe.current}}):je(_e,q-1)});pe.current=oe}return R.useEffect(function(){return function(){Se()}},[]),[je,Se]},wn=[qe,Bt,Qt,Ce],sa=!1,zn=!0;function En(pe){return pe===Qt||pe===Ce}var ga=function(pe,Se){var je=R.useState(Ot),_e=Object(z.a)(je,2),q=_e[0],oe=_e[1],ne=cn(),ye=Object(z.a)(ne,2),Te=ye[0],We=ye[1];function we(){oe(qe)}return Jt(function(){if(q!==Ot&&q!==Ce){var Je=wn.indexOf(q),St=wn[Je+1],Wt=Se(q);Wt===sa?oe(St):Te(function(Zt){function Pn(){if(Zt.isCanceled())return;oe(St)}Wt===!0?Pn():Promise.resolve(Wt).then(Pn)})}},[pe,q]),R.useEffect(function(){return function(){We()}},[]),[we,q]},Ua=function(pe){var Se=Object(R.useRef)(),je=Object(R.useRef)(pe);je.current=pe;var _e=R.useCallback(function(ne){je.current(ne)},[]);function q(ne){ne&&(ne.removeEventListener(qt,_e),ne.removeEventListener(it,_e))}function oe(ne){Se.current&&Se.current!==ne&&q(Se.current),ne&&ne!==Se.current&&(ne.addEventListener(qt,_e),ne.addEventListener(it,_e),Se.current=ne)}return R.useEffect(function(){return function(){q(Se.current)}},[]),[oe,q]};function ta(pe,Se,je,_e){var q=_e.motionEnter,oe=q===void 0?!0:q,ne=_e.motionAppear,ye=ne===void 0?!0:ne,Te=_e.motionLeave,We=Te===void 0?!0:Te,we=_e.motionDeadline,Je=_e.motionLeaveImmediately,St=_e.onAppearPrepare,Wt=_e.onEnterPrepare,Zt=_e.onLeavePrepare,Pn=_e.onAppearStart,Nn=_e.onEnterStart,qn=_e.onLeaveStart,Qn=_e.onAppearActive,da=_e.onEnterActive,ma=_e.onLeaveActive,aa=_e.onAppearEnd,ca=_e.onEnterEnd,ya=_e.onLeaveEnd,en=_e.onVisibleChanged,Ht=De(),dn=Object(z.a)(Ht,2),It=dn[0],kt=dn[1],ea=De(pt),ba=Object(z.a)(ea,2),Gn=ba[0],Oa=ba[1],Va=De(null),Ca=Object(z.a)(Va,2),ka=Ca[0],La=Ca[1],Da=Object(R.useRef)(!1),Sa=Object(R.useRef)(null),ra=Object(R.useRef)(!1),lr=Object(R.useRef)(null);function Qr(){var Ya=je();return Ya||lr.current}var kr=Object(R.useRef)(!1);function Or(Ya){var Fa=Qr();if(Ya&&!Ya.deadline&&Ya.target!==Fa)return;var yr;Gn===Qe&&kr.current?yr=aa==null?void 0:aa(Fa,Ya):Gn===ie&&kr.current?yr=ca==null?void 0:ca(Fa,Ya):Gn===be&&kr.current&&(yr=ya==null?void 0:ya(Fa,Ya)),yr!==!1&&!ra.current&&(Oa(pt),La(null))}var Qa=Ua(Or),Ha=Object(z.a)(Qa,1),za=Ha[0],Ja=R.useMemo(function(){var Ya,Fa,yr;switch(Gn){case"appear":return Ya={},Object(Q.a)(Ya,qe,St),Object(Q.a)(Ya,Bt,Pn),Object(Q.a)(Ya,Qt,Qn),Ya;case"enter":return Fa={},Object(Q.a)(Fa,qe,Wt),Object(Q.a)(Fa,Bt,Nn),Object(Q.a)(Fa,Qt,da),Fa;case"leave":return yr={},Object(Q.a)(yr,qe,Zt),Object(Q.a)(yr,Bt,qn),Object(Q.a)(yr,Qt,ma),yr;default:return{}}},[Gn]),Nr=ga(Gn,function(Ya){if(Ya===qe){var Fa=Ja[qe];return Fa?Fa(Qr()):sa}if(Wa in Ja){var yr;La(((yr=Ja[Wa])===null||yr===void 0?void 0:yr.call(Ja,Qr(),null))||null)}return Wa===Qt&&(za(Qr()),we>0&&(clearTimeout(Sa.current),Sa.current=setTimeout(function(){Or({deadline:!0})},we))),zn}),fi=Object(z.a)(Nr,2),si=fi[0],Wa=fi[1],Jr=En(Wa);kr.current=Jr,Jt(function(){kt(Se);var Ya=Da.current;if(Da.current=!0,!pe)return;var Fa;!Ya&&Se&&ye&&(Fa=Qe),Ya&&Se&&oe&&(Fa=ie),(Ya&&!Se&&We||!Ya&&Je&&!Se&&We)&&(Fa=be),Fa&&(Oa(Fa),si())},[Se]),Object(R.useEffect)(function(){(Gn===Qe&&!ye||Gn===ie&&!oe||Gn===be&&!We)&&Oa(pt)},[ye,oe,We]),Object(R.useEffect)(function(){return function(){clearTimeout(Sa.current),ra.current=!0}},[]),Object(R.useEffect)(function(){It!==void 0&&Gn===pt&&(en==null||en(It))},[It,Gn]);var Zr=ka;return Ja[qe]&&Wa===Bt&&(Zr=Object(B.a)({transition:"none"},Zr)),[Gn,Wa,Zr,It!=null?It:Se]}var la=function(pe){Object(y.a)(je,pe);var Se=Object(f.a)(je);function je(){return Object(w.a)(this,je),Se.apply(this,arguments)}return Object(T.a)(je,[{key:"render",value:function(){return this.props.children}}]),je}(R.Component),Ra=la;function Xa(pe){var Se=pe;Object(U.a)(pe)==="object"&&(Se=pe.transitionSupport);function je(q){return!!(q.motionName&&Se)}var _e=R.forwardRef(function(q,oe){var ne=q.visible,ye=ne===void 0?!0:ne,Te=q.removeOnLeave,We=Te===void 0?!0:Te,we=q.forceRender,Je=q.children,St=q.motionName,Wt=q.leavedClassName,Zt=q.eventProps,Pn=je(q),Nn=Object(R.useRef)(),qn=Object(R.useRef)();function Qn(){try{return Object(An.a)(Nn.current||qn.current)}catch(Oa){return null}}var da=ta(Pn,ye,Qn,q),ma=Object(z.a)(da,4),aa=ma[0],ca=ma[1],ya=ma[2],en=ma[3],Ht=R.useRef(en);en&&(Ht.current=!0);var dn=Object(R.useRef)(oe);dn.current=oe;var It=R.useCallback(function(Oa){Nn.current=Oa,Object(ke.b)(dn.current,Oa)},[]),kt,ea=Object(B.a)(Object(B.a)({},Zt),{},{visible:ye});if(!Je)kt=null;else if(aa===pt||!je(q))en?kt=Je(Object(B.a)({},ea),It):!We&&Ht.current?kt=Je(Object(B.a)(Object(B.a)({},ea),{},{className:Wt}),It):we?kt=Je(Object(B.a)(Object(B.a)({},ea),{},{style:{display:"none"}}),It):kt=null;else{var ba,Gn;ca===qe?Gn="prepare":En(ca)?Gn="active":ca===Bt&&(Gn="start"),kt=Je(Object(B.a)(Object(B.a)({},ea),{},{className:F()(st(St,aa),(ba={},Object(Q.a)(ba,st(St,"".concat(aa,"-").concat(Gn)),Gn),Object(Q.a)(ba,St,typeof St=="string"),ba)),style:ya}),It)}return R.createElement(Ra,{ref:qn},kt)});return _e.displayName="CSSMotion",_e}var vr=Xa(an),rn="add",Xn="keep",hr="remove",xr="removed";function $a(pe){var Se;return pe&&Object(U.a)(pe)==="object"&&"key"in pe?Se=pe:Se={key:pe},Object(B.a)(Object(B.a)({},Se),{},{key:String(Se.key)})}function Ga(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return pe.map($a)}function Aa(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],je=[],_e=0,q=Se.length,oe=Ga(pe),ne=Ga(Se);oe.forEach(function(We){for(var we=!1,Je=_e;Je<q;Je+=1){var St=ne[Je];if(St.key===We.key){_e<Je&&(je=je.concat(ne.slice(_e,Je).map(function(Wt){return Object(B.a)(Object(B.a)({},Wt),{},{status:rn})})),_e=Je),je.push(Object(B.a)(Object(B.a)({},St),{},{status:Xn})),_e+=1,we=!0;break}}we||je.push(Object(B.a)(Object(B.a)({},We),{},{status:hr}))}),_e<q&&(je=je.concat(ne.slice(_e).map(function(We){return Object(B.a)(Object(B.a)({},We),{},{status:rn})})));var ye={};je.forEach(function(We){var we=We.key;ye[we]=(ye[we]||0)+1});var Te=Object.keys(ye).filter(function(We){return ye[We]>1});return Te.forEach(function(We){je=je.filter(function(we){var Je=we.key,St=we.status;return Je!==We||St!==hr}),je.forEach(function(we){we.key===We&&(we.status=Xn)})}),je}var Kn=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function pr(pe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vr,je=function(_e){Object(y.a)(oe,_e);var q=Object(f.a)(oe);function oe(){var ne;return Object(w.a)(this,oe),ne=q.apply(this,arguments),ne.state={keyEntities:[]},ne.removeKey=function(ye){ne.setState(function(Te){var We=Te.keyEntities;return{keyEntities:We.map(function(we){return we.key!==ye?we:Object(B.a)(Object(B.a)({},we),{},{status:xr})})}})},ne}return Object(T.a)(oe,[{key:"render",value:function(){var ye=this,Te=this.state.keyEntities,We=this.props,we=We.component,Je=We.children,St=We.onVisibleChanged,Wt=Object(I.a)(We,["component","children","onVisibleChanged"]),Zt=we||R.Fragment,Pn={};return Kn.forEach(function(Nn){Pn[Nn]=Wt[Nn],delete Wt[Nn]}),delete Wt.keys,R.createElement(Zt,Wt,Te.map(function(Nn){var qn=Nn.status,Qn=Object(I.a)(Nn,["status"]),da=qn===rn||qn===Xn;return R.createElement(Se,Object(x.a)({},Pn,{key:Qn.key,visible:da,eventProps:Qn,onVisibleChanged:function(aa){St==null||St(aa,{key:Qn.key}),aa||ye.removeKey(Qn.key)}}),Je)}))}}],[{key:"getDerivedStateFromProps",value:function(ye,Te){var We=ye.keys,we=Te.keyEntities,Je=Ga(We),St=Aa(we,Je);return{keyEntities:St.filter(function(Wt){var Zt=we.find(function(Pn){var Nn=Pn.key;return Wt.key===Nn});return!(Zt&&Zt.status===xr&&Wt.status===hr)})}}}]),oe}(R.Component);return je.defaultProps={component:"div"},je}var on=pr(an),qa=vr;function Ka(pe){var Se=pe.prefixCls,je=pe.motion,_e=pe.animation,q=pe.transitionName;return je||(_e?{motionName:"".concat(Se,"-").concat(_e)}:q?{motionName:q}:null)}function Tr(pe){var Se=pe.prefixCls,je=pe.visible,_e=pe.zIndex,q=pe.mask,oe=pe.maskMotion,ne=pe.maskAnimation,ye=pe.maskTransitionName;if(!q)return null;var Te={};return(oe||ye||ne)&&(Te=Object(B.a)({motionAppear:!0},Ka({motion:oe,prefixCls:Se,transitionName:ye,animation:ne}))),R.createElement(qa,Object(x.a)({},Te,{visible:je,removeOnLeave:!0}),function(We){var we=We.className;return R.createElement("div",{style:{zIndex:_e},className:F()("".concat(Se,"-mask"),we)})})}var mr=M("9mu1"),nr=M("o0o1"),Br=M.n(nr),Hr=M("HaE+"),ar=["measure","align",null,"motion"],Ea=function(pe,Se){var je=Object(R.useState)(null),_e=Object(z.a)(je,2),q=_e[0],oe=_e[1],ne=Object(R.useRef)(),ye=Object(R.useRef)(!1);function Te(Je){ye.current||oe(Je)}function We(){Ye.a.cancel(ne.current)}function we(Je){We(),ne.current=Object(Ye.a)(function(){Te(function(St){switch(q){case"align":return"motion";case"motion":return"stable";default:}return St}),Je==null||Je()})}return Object(R.useEffect)(function(){Te("measure")},[pe]),Object(R.useEffect)(function(){switch(q){case"measure":Se();break;default:}q&&(ne.current=Object(Ye.a)(Object(Hr.a)(Br.a.mark(function Je(){var St,Wt;return Br.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:St=ar.indexOf(q),Wt=ar[St+1],Wt&&St!==-1&&Te(Wt);case 3:case"end":return Pn.stop()}},Je)}))))},[q]),Object(R.useEffect)(function(){return function(){ye.current=!0,We()}},[]),[q,we]},Sr=function(pe){var Se=R.useState({width:0,height:0}),je=Object(z.a)(Se,2),_e=je[0],q=je[1];function oe(ye){q({width:ye.offsetWidth,height:ye.offsetHeight})}var ne=R.useMemo(function(){var ye={};if(pe){var Te=_e.width,We=_e.height;pe.indexOf("height")!==-1&&We?ye.height=We:pe.indexOf("minHeight")!==-1&&We&&(ye.minHeight=We),pe.indexOf("width")!==-1&&Te?ye.width=Te:pe.indexOf("minWidth")!==-1&&Te&&(ye.minWidth=Te)}return ye},[pe,_e]);return[ne,oe]},Rr=R.forwardRef(function(pe,Se){var je=pe.visible,_e=pe.prefixCls,q=pe.className,oe=pe.style,ne=pe.children,ye=pe.zIndex,Te=pe.stretch,We=pe.destroyPopupOnHide,we=pe.forceRender,Je=pe.align,St=pe.point,Wt=pe.getRootDomNode,Zt=pe.getClassNameFromAlign,Pn=pe.onAlign,Nn=pe.onMouseEnter,qn=pe.onMouseLeave,Qn=pe.onMouseDown,da=pe.onTouchStart,ma=Object(R.useRef)(),aa=Object(R.useRef)(),ca=Object(R.useState)(),ya=Object(z.a)(ca,2),en=ya[0],Ht=ya[1],dn=Sr(Te),It=Object(z.a)(dn,2),kt=It[0],ea=It[1];function ba(){Te&&ea(Wt())}var Gn=Ea(je,ba),Oa=Object(z.a)(Gn,2),Va=Oa[0],Ca=Oa[1],ka=Object(R.useRef)();function La(){return St||Wt}function Da(){var Qa;(Qa=ma.current)===null||Qa===void 0||Qa.forceAlign()}function Sa(Qa,Ha){var za=Zt(Ha);en!==za&&Ht(za),Va==="align"&&(en!==za?Promise.resolve().then(function(){Da()}):Ca(function(){var Ja;(Ja=ka.current)===null||Ja===void 0||Ja.call(ka)}),Pn==null||Pn(Qa,Ha))}var ra=Object(B.a)({},Ka(pe));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Qa){var Ha=ra[Qa];ra[Qa]=function(za,Ja){return Ca(),Ha==null?void 0:Ha(za,Ja)}});function lr(){return new Promise(function(Qa){ka.current=Qa})}R.useEffect(function(){!ra.motionName&&Va==="motion"&&Ca()},[ra.motionName,Va]),R.useImperativeHandle(Se,function(){return{forceAlign:Da,getElement:function(){return aa.current}}});var Qr=Object(B.a)(Object(B.a)({},kt),{},{zIndex:ye,opacity:Va==="motion"||Va==="stable"||!je?void 0:0,pointerEvents:Va==="stable"?void 0:"none"},oe),kr=!0;(Je==null?void 0:Je.points)&&(Va==="align"||Va==="stable")&&(kr=!1);var Or=ne;return R.Children.count(ne)>1&&(Or=R.createElement("div",{className:"".concat(_e,"-content")},ne)),R.createElement(qa,Object(x.a)({visible:je,ref:aa,leavedClassName:"".concat(_e,"-hidden")},ra,{onAppearPrepare:lr,onEnterPrepare:lr,removeOnLeave:We,forceRender:we}),function(Qa,Ha){var za=Qa.className,Ja=Qa.style,Nr=F()(_e,q,en,za);return R.createElement(mr.a,{target:La(),key:"popup",ref:ma,monitorWindowResize:!0,disabled:kr,align:Je,onAlign:Sa},R.createElement("div",{ref:Ha,className:Nr,onMouseEnter:Nn,onMouseLeave:qn,onMouseDownCapture:Qn,onTouchStartCapture:da,style:Object(B.a)(Object(B.a)({},Ja),Qr)},Or))})});Rr.displayName="PopupInner";var ur=Rr,_r=R.forwardRef(function(pe,Se){var je=pe.prefixCls,_e=pe.visible,q=pe.zIndex,oe=pe.children,ne=pe.mobile;ne=ne===void 0?{}:ne;var ye=ne.popupClassName,Te=ne.popupStyle,We=ne.popupMotion,we=We===void 0?{}:We,Je=ne.popupRender,St=R.useRef();R.useImperativeHandle(Se,function(){return{forceAlign:function(){},getElement:function(){return St.current}}});var Wt=Object(B.a)({zIndex:q},Te),Zt=oe;return R.Children.count(oe)>1&&(Zt=R.createElement("div",{className:"".concat(je,"-content")},oe)),Je&&(Zt=Je(Zt)),R.createElement(qa,Object(x.a)({visible:_e,ref:St,removeOnLeave:!0},we),function(Pn,Nn){var qn=Pn.className,Qn=Pn.style,da=F()(je,ye,qn);return R.createElement("div",{ref:Nn,className:da,style:Object(B.a)(Object(B.a)({},Qn),Wt)},Zt)})});_r.displayName="MobilePopupInner";var oi=_r,$r=["visible","mobile"],va=R.forwardRef(function(pe,Se){var je=pe.visible,_e=pe.mobile,q=Object(I.a)(pe,$r),oe=Object(R.useState)(je),ne=Object(z.a)(oe,2),ye=ne[0],Te=ne[1],We=Object(R.useState)(!1),we=Object(z.a)(We,2),Je=we[0],St=we[1],Wt=Object(B.a)(Object(B.a)({},q),{},{visible:ye});Object(R.useEffect)(function(){Te(je),je&&_e&&St(Ee())},[je,_e]);var Zt=Je?R.createElement(oi,Object(x.a)({},Wt,{mobile:_e,ref:Se})):R.createElement(ur,Object(x.a)({},Wt,{ref:Se}));return R.createElement("div",null,R.createElement(Tr,Wt),Zt)});va.displayName="Popup";var _a=va,ir=R.createContext(null),Pa=ir;function Mn(){}function ln(){return""}function Tn(pe){return pe?pe.ownerDocument:window.document}var fn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function $n(pe){var Se=function(je){Object(y.a)(q,je);var _e=Object(f.a)(q);function q(oe){var ne;Object(w.a)(this,q),ne=_e.call(this,oe),ne.popupRef=R.createRef(),ne.triggerRef=R.createRef(),ne.attachId=void 0,ne.clickOutsideHandler=void 0,ne.touchOutsideHandler=void 0,ne.contextMenuOutsideHandler1=void 0,ne.contextMenuOutsideHandler2=void 0,ne.mouseDownTimeout=void 0,ne.focusTime=void 0,ne.preClickTime=void 0,ne.preTouchTime=void 0,ne.delayTimer=void 0,ne.hasPopupMouseDown=void 0,ne.onMouseEnter=function(Te){var We=ne.props.mouseEnterDelay;ne.fireEvents("onMouseEnter",Te),ne.delaySetPopupVisible(!0,We,We?null:Te)},ne.onMouseMove=function(Te){ne.fireEvents("onMouseMove",Te),ne.setPoint(Te)},ne.onMouseLeave=function(Te){ne.fireEvents("onMouseLeave",Te),ne.delaySetPopupVisible(!1,ne.props.mouseLeaveDelay)},ne.onPopupMouseEnter=function(){ne.clearDelayTimer()},ne.onPopupMouseLeave=function(Te){var We;if(Te.relatedTarget&&!Te.relatedTarget.setTimeout&&Object(nn.a)((We=ne.popupRef.current)===null||We===void 0?void 0:We.getElement(),Te.relatedTarget))return;ne.delaySetPopupVisible(!1,ne.props.mouseLeaveDelay)},ne.onFocus=function(Te){ne.fireEvents("onFocus",Te),ne.clearDelayTimer(),ne.isFocusToShow()&&(ne.focusTime=Date.now(),ne.delaySetPopupVisible(!0,ne.props.focusDelay))},ne.onMouseDown=function(Te){ne.fireEvents("onMouseDown",Te),ne.preClickTime=Date.now()},ne.onTouchStart=function(Te){ne.fireEvents("onTouchStart",Te),ne.preTouchTime=Date.now()},ne.onBlur=function(Te){ne.fireEvents("onBlur",Te),ne.clearDelayTimer(),ne.isBlurToHide()&&ne.delaySetPopupVisible(!1,ne.props.blurDelay)},ne.onContextMenu=function(Te){Te.preventDefault(),ne.fireEvents("onContextMenu",Te),ne.setPopupVisible(!0,Te)},ne.onContextMenuClose=function(){ne.isContextMenuToShow()&&ne.close()},ne.onClick=function(Te){if(ne.fireEvents("onClick",Te),ne.focusTime){var We;if(ne.preClickTime&&ne.preTouchTime?We=Math.min(ne.preClickTime,ne.preTouchTime):ne.preClickTime?We=ne.preClickTime:ne.preTouchTime&&(We=ne.preTouchTime),Math.abs(We-ne.focusTime)<20)return;ne.focusTime=0}ne.preClickTime=0,ne.preTouchTime=0,ne.isClickToShow()&&(ne.isClickToHide()||ne.isBlurToHide())&&Te&&Te.preventDefault&&Te.preventDefault();var we=!ne.state.popupVisible;(ne.isClickToHide()&&!we||we&&ne.isClickToShow())&&ne.setPopupVisible(!ne.state.popupVisible,Te)},ne.onPopupMouseDown=function(){if(ne.hasPopupMouseDown=!0,clearTimeout(ne.mouseDownTimeout),ne.mouseDownTimeout=window.setTimeout(function(){ne.hasPopupMouseDown=!1},0),ne.context){var Te;(Te=ne.context).onPopupMouseDown.apply(Te,arguments)}},ne.onDocumentClick=function(Te){if(ne.props.mask&&!ne.props.maskClosable)return;var We=Te.target,we=ne.getRootDomNode(),Je=ne.getPopupDomNode();(!Object(nn.a)(we,We)||ne.isContextMenuOnly())&&!Object(nn.a)(Je,We)&&!ne.hasPopupMouseDown&&ne.close()},ne.getRootDomNode=function(){var Te=ne.props.getTriggerDOMNode;if(Te)return Te(ne.triggerRef.current);try{var We=Object(An.a)(ne.triggerRef.current);if(We)return We}catch(we){}return sn.a.findDOMNode(Object(_.a)(ne))},ne.getPopupClassNameFromAlign=function(Te){var We=[],we=ne.props,Je=we.popupPlacement,St=we.builtinPlacements,Wt=we.prefixCls,Zt=we.alignPoint,Pn=we.getPopupClassNameFromAlign;return Je&&St&&We.push(ut(St,Wt,Te,Zt)),Pn&&We.push(Pn(Te)),We.join(" ")},ne.getComponent=function(){var Te=ne.props,We=Te.prefixCls,we=Te.destroyPopupOnHide,Je=Te.popupClassName,St=Te.onPopupAlign,Wt=Te.popupMotion,Zt=Te.popupAnimation,Pn=Te.popupTransitionName,Nn=Te.popupStyle,qn=Te.mask,Qn=Te.maskAnimation,da=Te.maskTransitionName,ma=Te.maskMotion,aa=Te.zIndex,ca=Te.popup,ya=Te.stretch,en=Te.alignPoint,Ht=Te.mobile,dn=Te.forceRender,It=ne.state,kt=It.popupVisible,ea=It.point,ba=ne.getPopupAlign(),Gn={};return ne.isMouseEnterToShow()&&(Gn.onMouseEnter=ne.onPopupMouseEnter),ne.isMouseLeaveToHide()&&(Gn.onMouseLeave=ne.onPopupMouseLeave),Gn.onMouseDown=ne.onPopupMouseDown,Gn.onTouchStart=ne.onPopupMouseDown,R.createElement(_a,Object(x.a)({prefixCls:We,destroyPopupOnHide:we,visible:kt,point:en&&ea,className:Je,align:ba,onAlign:St,animation:Zt,getClassNameFromAlign:ne.getPopupClassNameFromAlign},Gn,{stretch:ya,getRootDomNode:ne.getRootDomNode,style:Nn,mask:qn,zIndex:aa,transitionName:Pn,maskAnimation:Qn,maskTransitionName:da,maskMotion:ma,ref:ne.popupRef,motion:Wt,mobile:Ht,forceRender:dn}),typeof ca=="function"?ca():ca)},ne.attachParent=function(Te){Ye.a.cancel(ne.attachId);var We=ne.props,we=We.getPopupContainer,Je=We.getDocument,St=ne.getRootDomNode(),Wt;we?(St||we.length===0)&&(Wt=we(St)):Wt=Je(ne.getRootDomNode()).body,Wt?Wt.appendChild(Te):ne.attachId=Object(Ye.a)(function(){ne.attachParent(Te)})},ne.getContainer=function(){var Te=ne.props.getDocument,We=Te(ne.getRootDomNode()).createElement("div");return We.style.position="absolute",We.style.top="0",We.style.left="0",We.style.width="100%",ne.attachParent(We),We},ne.setPoint=function(Te){var We=ne.props.alignPoint;if(!We||!Te)return;ne.setState({point:{pageX:Te.pageX,pageY:Te.pageY}})},ne.handlePortalUpdate=function(){ne.state.prevPopupVisible!==ne.state.popupVisible&&ne.props.afterPopupVisibleChange(ne.state.popupVisible)},ne.triggerContextValue={onPopupMouseDown:ne.onPopupMouseDown};var ye;return"popupVisible"in oe?ye=!!oe.popupVisible:ye=!!oe.defaultPopupVisible,ne.state={prevPopupVisible:ye,popupVisible:ye},fn.forEach(function(Te){ne["fire".concat(Te)]=function(We){ne.fireEvents(Te,We)}}),ne}return Object(T.a)(q,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ne=this.props,ye=this.state;if(ye.popupVisible){var Te;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Te=ne.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Pe.a)(Te,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Te=Te||ne.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Pe.a)(Te,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Te=Te||ne.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Pe.a)(Te,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Pe.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Ye.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ne;return((ne=this.popupRef.current)===null||ne===void 0?void 0:ne.getElement())||null}},{key:"getPopupAlign",value:function(){var ne=this.props,ye=ne.popupPlacement,Te=ne.popupAlign,We=ne.builtinPlacements;return ye&&We?Ue(We,ye,Te):Te}},{key:"setPopupVisible",value:function(ne,ye){var Te=this.props.alignPoint,We=this.state.popupVisible;this.clearDelayTimer(),We!==ne&&("popupVisible"in this.props||this.setState({popupVisible:ne,prevPopupVisible:We}),this.props.onPopupVisibleChange(ne)),Te&&ye&&ne&&this.setPoint(ye)}},{key:"delaySetPopupVisible",value:function(ne,ye,Te){var We=this,we=ye*1e3;if(this.clearDelayTimer(),we){var Je=Te?{pageX:Te.pageX,pageY:Te.pageY}:null;this.delayTimer=window.setTimeout(function(){We.setPopupVisible(ne,Je),We.clearDelayTimer()},we)}else this.setPopupVisible(ne,Te)}},{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(ne){var ye=this.props.children.props,Te=this.props;return ye[ne]&&Te[ne]?this["fire".concat(ne)]:ye[ne]||Te[ne]}},{key:"isClickToShow",value:function(){var ne=this.props,ye=ne.action,Te=ne.showAction;return ye.indexOf("click")!==-1||Te.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ne=this.props.action;return ne==="contextMenu"||ne.length===1&&ne[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ne=this.props,ye=ne.action,Te=ne.showAction;return ye.indexOf("contextMenu")!==-1||Te.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ne=this.props,ye=ne.action,Te=ne.hideAction;return ye.indexOf("click")!==-1||Te.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ne=this.props,ye=ne.action,Te=ne.showAction;return ye.indexOf("hover")!==-1||Te.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ne=this.props,ye=ne.action,Te=ne.hideAction;return ye.indexOf("hover")!==-1||Te.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ne=this.props,ye=ne.action,Te=ne.showAction;return ye.indexOf("focus")!==-1||Te.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ne=this.props,ye=ne.action,Te=ne.hideAction;return ye.indexOf("focus")!==-1||Te.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ne;(ne=this.popupRef.current)===null||ne===void 0||ne.forceAlign()}}},{key:"fireEvents",value:function(ne,ye){var Te=this.props.children.props[ne];Te&&Te(ye);var We=this.props[ne];We&&We(ye)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ne=this.state.popupVisible,ye=this.props,Te=ye.children,We=ye.forceRender,we=ye.alignPoint,Je=ye.className,St=ye.autoDestroy,Wt=R.Children.only(Te),Zt={key:"trigger"};this.isContextMenuToShow()?Zt.onContextMenu=this.onContextMenu:Zt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Zt.onClick=this.onClick,Zt.onMouseDown=this.onMouseDown,Zt.onTouchStart=this.onTouchStart):(Zt.onClick=this.createTwoChains("onClick"),Zt.onMouseDown=this.createTwoChains("onMouseDown"),Zt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Zt.onMouseEnter=this.onMouseEnter,we&&(Zt.onMouseMove=this.onMouseMove)):Zt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Zt.onMouseLeave=this.onMouseLeave:Zt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Zt.onFocus=this.onFocus,Zt.onBlur=this.onBlur):(Zt.onFocus=this.createTwoChains("onFocus"),Zt.onBlur=this.createTwoChains("onBlur"));var Pn=F()(Wt&&Wt.props&&Wt.props.className,Je);Pn&&(Zt.className=Pn);var Nn=Object(B.a)({},Zt);Object(ke.c)(Wt)&&(Nn.ref=Object(ke.a)(this.triggerRef,Wt.ref));var qn=R.cloneElement(Wt,Nn),Qn;return(ne||this.popupRef.current||We)&&(Qn=R.createElement(pe,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ne&&St&&(Qn=null),R.createElement(Pa.Provider,{value:this.triggerContextValue},qn,Qn)}}],[{key:"getDerivedStateFromProps",value:function(ne,ye){var Te=ne.popupVisible,We={};return Te!==void 0&&ye.popupVisible!==Te&&(We.popupVisible=Te,We.prevPopupVisible=ye.popupVisible),We}}]),q}(R.Component);return Se.contextType=Pa,Se.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ln,getDocument:Tn,onPopupVisibleChange:Mn,afterPopupVisibleChange:Mn,onPopupAlign:Mn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Se}var Zn=$n(rt.a),V={adjustX:1,adjustY:1},ae={topLeft:{points:["bl","tl"],overflow:V,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:V,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:V,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:V,offset:[4,0]}},ge={topLeft:{points:["bl","tl"],overflow:V,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:V,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:V,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:V,offset:[4,0]}},ve=ae,Xe=0,Re={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ze=function(Se,je,_e){var q=_t(je),oe=Se.getState();Se.setState({defaultActiveFirst:Object(B.a)(Object(B.a)({},oe.defaultActiveFirst),{},Object(Q.a)({},q,_e))})},lt=function(pe){Object(y.a)(je,pe);var Se=Object(f.a)(je);function je(_e){var q;Object(w.a)(this,je),q=Se.call(this,_e),q.onDestroy=function(we){q.props.onDestroy(we)},q.onKeyDown=function(we){var Je=we.keyCode,St=q.menuInstance,Wt=q.props.store,Zt=q.getVisible();if(Je===a.a.ENTER)return q.onTitleClick(we),ze(Wt,q.props.eventKey,!0),!0;if(Je===a.a.RIGHT)return Zt?St.onKeyDown(we):(q.triggerOpenChange(!0),ze(Wt,q.props.eventKey,!0)),!0;if(Je===a.a.LEFT){var Pn;if(Zt)Pn=St.onKeyDown(we);else return;return Pn||(q.triggerOpenChange(!1),Pn=!0),Pn}return Zt&&(Je===a.a.UP||Je===a.a.DOWN)?St.onKeyDown(we):void 0},q.onOpenChange=function(we){q.props.onOpenChange(we)},q.onPopupVisibleChange=function(we){q.triggerOpenChange(we,we?"mouseenter":"mouseleave")},q.onMouseEnter=function(we){var Je=q.props,St=Je.eventKey,Wt=Je.onMouseEnter,Zt=Je.store;ze(Zt,q.props.eventKey,!1),Wt({key:St,domEvent:we})},q.onMouseLeave=function(we){var Je=q.props,St=Je.parentMenu,Wt=Je.eventKey,Zt=Je.onMouseLeave;St.subMenuInstance=Object(_.a)(q),Zt({key:Wt,domEvent:we})},q.onTitleMouseEnter=function(we){var Je=q.props,St=Je.eventKey,Wt=Je.onItemHover,Zt=Je.onTitleMouseEnter;Wt({key:St,hover:!0}),Zt({key:St,domEvent:we})},q.onTitleMouseLeave=function(we){var Je=q.props,St=Je.parentMenu,Wt=Je.eventKey,Zt=Je.onItemHover,Pn=Je.onTitleMouseLeave;St.subMenuInstance=Object(_.a)(q),Zt({key:Wt,hover:!1}),Pn({key:Wt,domEvent:we})},q.onTitleClick=function(we){var Je=Object(_.a)(q),St=Je.props;if(St.onTitleClick({key:St.eventKey,domEvent:we}),St.triggerSubMenuAction==="hover")return;q.triggerOpenChange(!q.getVisible(),"click"),ze(St.store,q.props.eventKey,!1)},q.onSubMenuClick=function(we){typeof q.props.onClick=="function"&&q.props.onClick(q.addKeyPath(we))},q.onSelect=function(we){q.props.onSelect(we)},q.onDeselect=function(we){q.props.onDeselect(we)},q.getPrefixCls=function(){return"".concat(q.props.rootPrefixCls,"-submenu")},q.getActiveClassName=function(){return"".concat(q.getPrefixCls(),"-active")},q.getDisabledClassName=function(){return"".concat(q.getPrefixCls(),"-disabled")},q.getSelectedClassName=function(){return"".concat(q.getPrefixCls(),"-selected")},q.getOpenClassName=function(){return"".concat(q.props.rootPrefixCls,"-submenu-open")},q.getVisible=function(){return q.state.isOpen},q.getMode=function(){return q.state.mode},q.saveMenuInstance=function(we){q.menuInstance=we},q.addKeyPath=function(we){return Object(B.a)(Object(B.a)({},we),{},{keyPath:(we.keyPath||[]).concat(q.props.eventKey)})},q.triggerOpenChange=function(we,Je){var St=q.props.eventKey,Wt=function(){q.onOpenChange({key:St,item:Object(_.a)(q),trigger:Je,open:we})};Je==="mouseenter"?q.mouseenterTimeout=setTimeout(function(){Wt()},0):Wt()},q.isChildrenSelected=function(){var we={find:!1};return Rt(q.props.children,q.props.selectedKeys,we),we.find},q.isInlineMode=function(){return q.getMode()==="inline"},q.adjustWidth=function(){if(!q.subMenuTitle||!q.menuInstance)return;var we=un.findDOMNode(q.menuInstance);if(we.offsetWidth>=q.subMenuTitle.offsetWidth)return;we.style.minWidth="".concat(q.subMenuTitle.offsetWidth,"px")},q.saveSubMenuTitle=function(we){q.subMenuTitle=we},q.getBaseProps=function(){var we=Object(_.a)(q),Je=we.props,St=q.getMode();return{mode:St==="horizontal"?"vertical":St,visible:q.getVisible(),level:Je.level+1,inlineIndent:Je.inlineIndent,focusable:!1,onClick:q.onSubMenuClick,onSelect:q.onSelect,onDeselect:q.onDeselect,onDestroy:q.onDestroy,selectedKeys:Je.selectedKeys,eventKey:"".concat(Je.eventKey,"-menu-"),openKeys:Je.openKeys,motion:Je.motion,onOpenChange:q.onOpenChange,subMenuOpenDelay:Je.subMenuOpenDelay,parentMenu:Object(_.a)(q),subMenuCloseDelay:Je.subMenuCloseDelay,forceSubMenuRender:Je.forceSubMenuRender,triggerSubMenuAction:Je.triggerSubMenuAction,builtinPlacements:Je.builtinPlacements,defaultActiveFirst:Je.store.getState().defaultActiveFirst[_t(Je.eventKey)],multiple:Je.multiple,prefixCls:Je.rootPrefixCls,id:q.internalMenuId,manualRef:q.saveMenuInstance,itemIcon:Je.itemIcon,expandIcon:Je.expandIcon,direction:Je.direction}},q.getMotion=function(we,Je){var St=Object(_.a)(q),Wt=St.haveRendered,Zt=q.props,Pn=Zt.motion,Nn=Zt.rootPrefixCls,qn=Object(B.a)(Object(B.a)({},Pn),{},{leavedClassName:"".concat(Nn,"-hidden"),removeOnLeave:!1,motionAppear:Wt||!Je||we!=="inline"});return qn};var oe=_e.store,ne=_e.eventKey,ye=oe.getState(),Te=ye.defaultActiveFirst;q.isRootMenu=!1;var We=!1;return Te&&(We=Te[ne]),ze(oe,ne,We),q.state={mode:_e.mode,isOpen:_e.isOpen},q}return Object(T.a)(je,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var q=this,oe=this.props,ne=oe.mode,ye=oe.parentMenu,Te=oe.manualRef,We=oe.isOpen,we=function(){q.setState({mode:ne,isOpen:We})},Je=We!==this.state.isOpen,St=ne!==this.state.mode;if((St||Je)&&(Ye.a.cancel(this.updateStateRaf),St?this.updateStateRaf=Object(Ye.a)(we):we()),Te&&Te(this),ne!=="horizontal"||!(ye==null?void 0:ye.isRootMenu)||!We)return;this.minWidthTimeout=setTimeout(function(){return q.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var q=this.props,oe=q.onDestroy,ne=q.eventKey;oe&&oe(ne),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Ye.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(q,oe){var ne=this.getBaseProps();return R.createElement(mn,Object(x.a)({},ne,{id:this.internalMenuId,className:q,style:oe}),this.props.children)}},{key:"renderChildren",value:function(){var q=this,oe=this.getBaseProps(),ne=oe.mode,ye=oe.visible,Te=oe.forceSubMenuRender,We=oe.direction,we=this.getMotion(ne,ye);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ye||Te,!this.haveOpened)return R.createElement("div",null);var Je=F()("".concat(oe.prefixCls,"-sub"),Object(Q.a)({},"".concat(oe.prefixCls,"-rtl"),We==="rtl"));return this.isInlineMode()?R.createElement(qa,Object(x.a)({visible:oe.visible,forceRender:Te},we),function(St){var Wt=St.className,Zt=St.style,Pn=F()(Je,Wt);return q.renderPopupMenu(Pn,Zt)}):this.renderPopupMenu(Je)}},{key:"render",value:function(){var q,oe,ne,ye=Object(B.a)({},this.props),Te=this.getVisible(),We=this.getPrefixCls(),we=this.isInlineMode(),Je=this.getMode(),St=F()(We,"".concat(We,"-").concat(Je),(q={},Object(Q.a)(q,ye.className,!!ye.className),Object(Q.a)(q,this.getOpenClassName(),Te),Object(Q.a)(q,this.getActiveClassName(),ye.active||Te&&!we),Object(Q.a)(q,this.getDisabledClassName(),ye.disabled),Object(Q.a)(q,this.getSelectedClassName(),this.isChildrenSelected()),q));this.internalMenuId||(ye.eventKey?this.internalMenuId="".concat(ye.eventKey,"$Menu"):(Xe+=1,this.internalMenuId="$__$".concat(Xe,"$Menu")));var Wt={},Zt={},Pn={};ye.disabled||(Wt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Zt={onClick:this.onTitleClick},Pn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Nn={},qn=ye.direction,Qn=qn==="rtl";we&&(Qn?Nn.paddingRight=ye.inlineIndent*ye.level:Nn.paddingLeft=ye.inlineIndent*ye.level);var da={};this.getVisible()&&(da={"aria-owns":this.internalMenuId});var ma=null;Je!=="horizontal"&&(ma=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ma=R.createElement(this.props.expandIcon,Object(B.a)({},this.props))));var aa=R.createElement("div",Object(x.a)({ref:this.saveSubMenuTitle,style:Nn,className:"".concat(We,"-title"),role:"button"},Pn,Zt,{"aria-expanded":Te},da,{"aria-haspopup":"true",title:typeof ye.title=="string"?ye.title:void 0}),ye.title,ma||R.createElement("i",{className:"".concat(We,"-arrow")})),ca=this.renderChildren(),ya=((oe=ye.parentMenu)===null||oe===void 0?void 0:oe.isRootMenu)?ye.parentMenu.props.getPopupContainer:function(La){return La.parentNode},en=Re[Je],Ht=ye.popupOffset?{offset:ye.popupOffset}:{},dn=F()((ne={},Object(Q.a)(ne,ye.popupClassName,ye.popupClassName&&!we),Object(Q.a)(ne,"".concat(We,"-rtl"),Qn),ne)),It=ye.disabled,kt=ye.triggerSubMenuAction,ea=ye.subMenuOpenDelay,ba=ye.forceSubMenuRender,Gn=ye.subMenuCloseDelay,Oa=ye.builtinPlacements;Ge.forEach(function(La){return delete ye[La]}),delete ye.onClick;var Va=Qn?Object(B.a)(Object(B.a)({},ge),Oa):Object(B.a)(Object(B.a)({},ae),Oa);delete ye.direction;var Ca=this.getBaseProps(),ka=we?null:this.getMotion(Ca.mode,Ca.visible);return R.createElement("li",Object(x.a)({},ye,Wt,{className:St,role:"menuitem"}),R.createElement(Zn,{prefixCls:We,popupClassName:F()("".concat(We,"-popup"),dn),getPopupContainer:ya,builtinPlacements:Va,popupPlacement:en,popupVisible:we?!1:Te,popupAlign:Ht,popup:we?null:ca,action:It||we?[]:[kt],mouseEnterDelay:ea,mouseLeaveDelay:Gn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ba,popupMotion:ka},aa),we?ca:null)}}]),je}(R.Component);lt.defaultProps={onMouseEnter:vt,onMouseLeave:vt,onTitleMouseEnter:vt,onTitleMouseLeave:vt,onTitleClick:vt,manualRef:vt,mode:"vertical",title:""};var At=Object(c.b)(function(pe,Se){var je=pe.openKeys,_e=pe.activeKey,q=pe.selectedKeys,oe=Se.eventKey,ne=Se.subMenuKey;return{isOpen:je.indexOf(oe)>-1,active:_e[ne]===oe,selectedKeys:q}})(lt);At.isSubMenu=!0;var Dt=At,Ie="menuitem-overflowed",ft=.5,$e=function(pe){Object(y.a)(je,pe);var Se=Object(f.a)(je);function je(){var _e;return Object(w.a)(this,je),_e=Se.apply(this,arguments),_e.resizeObserver=null,_e.mutationObserver=null,_e.originalTotalWidth=0,_e.overflowedItems=[],_e.menuItemSizes=[],_e.cancelFrameId=null,_e.state={lastVisibleIndex:void 0},_e.childRef=R.createRef(),_e.getMenuItemNodes=function(){var q=_e.props.prefixCls,oe=_e.childRef.current;return oe?[].slice.call(oe.children).filter(function(ne){return ne.className.split(" ").indexOf("".concat(q,"-overflowed-submenu"))<0}):[]},_e.getOverflowedSubMenuItem=function(q,oe,ne){var ye=_e.props,Te=ye.overflowedIndicator,We=ye.level,we=ye.mode,Je=ye.prefixCls,St=ye.theme;if(We!==1||we!=="horizontal")return null;var Wt=_e.props.children[0],Zt=Wt.props,Pn=Zt.children,Nn=Zt.title,qn=Zt.style,Qn=Object(I.a)(Zt,["children","title","style"]),da=Object(B.a)({},qn),ma="".concat(q,"-overflowed-indicator"),aa="".concat(q,"-overflowed-indicator");oe.length===0&&ne!==!0?da=Object(B.a)(Object(B.a)({},da),{},{display:"none"}):ne&&(da=Object(B.a)(Object(B.a)({},da),{},{visibility:"hidden",position:"absolute"}),ma="".concat(ma,"-placeholder"),aa="".concat(aa,"-placeholder"));var ca=St?"".concat(Je,"-").concat(St):"",ya={};return Ge.forEach(function(en){Qn[en]!==void 0&&(ya[en]=Qn[en])}),R.createElement(Dt,Object(x.a)({title:Te,className:"".concat(Je,"-overflowed-submenu"),popupClassName:ca},ya,{key:ma,eventKey:aa,disabled:!1,style:da}),oe)},_e.setChildrenWidthAndResize=function(){if(_e.props.mode!=="horizontal")return;var q=_e.childRef.current;if(!q)return;var oe=q.children;if(!oe||oe.length===0)return;var ne=q.children[oe.length-1];wt(ne,"display","inline-block");var ye=_e.getMenuItemNodes(),Te=ye.filter(function(We){return We.className.split(" ").indexOf(Ie)>=0});Te.forEach(function(We){wt(We,"display","inline-block")}),_e.menuItemSizes=ye.map(function(We){return Ft(We,!0)}),Te.forEach(function(We){wt(We,"display","none")}),_e.overflowedIndicatorWidth=Ft(q.children[q.children.length-1],!0),_e.originalTotalWidth=_e.menuItemSizes.reduce(function(We,we){return We+we},0),_e.handleResize(),wt(ne,"display","none")},_e.handleResize=function(){if(_e.props.mode!=="horizontal")return;var q=_e.childRef.current;if(!q)return;var oe=Ft(q);_e.overflowedItems=[];var ne=0,ye;_e.originalTotalWidth>oe+ft&&(ye=-1,_e.menuItemSizes.forEach(function(Te){ne+=Te,ne+_e.overflowedIndicatorWidth<=oe&&(ye+=1)})),_e.setState({lastVisibleIndex:ye})},_e}return Object(T.a)(je,[{key:"componentDidMount",value:function(){var q=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var oe=this.childRef.current;if(!oe)return;this.resizeObserver=new bn.default(function(ne){ne.forEach(function(){var ye=q.cancelFrameId;cancelAnimationFrame(ye),q.cancelFrameId=requestAnimationFrame(q.setChildrenWidthAndResize)})}),[].slice.call(oe.children).concat(oe).forEach(function(ne){q.resizeObserver.observe(ne)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){q.resizeObserver.disconnect(),[].slice.call(oe.children).concat(oe).forEach(function(ne){q.resizeObserver.observe(ne)}),q.setChildrenWidthAndResize()}),this.mutationObserver.observe(oe,{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(q){var oe=this,ne=this.state.lastVisibleIndex;return(q||[]).reduce(function(ye,Te,We){var we=Te;if(oe.props.mode==="horizontal"){var Je=oe.getOverflowedSubMenuItem(Te.props.eventKey,[]);ne!==void 0&&oe.props.className.indexOf("".concat(oe.props.prefixCls,"-root"))!==-1&&(We>ne&&(we=R.cloneElement(Te,{style:{display:"none"},eventKey:"".concat(Te.props.eventKey,"-hidden"),className:"".concat(Ie)})),We===ne+1&&(oe.overflowedItems=q.slice(ne+1).map(function(Wt){return R.cloneElement(Wt,{key:Wt.props.eventKey,mode:"vertical-left"})}),Je=oe.getOverflowedSubMenuItem(Te.props.eventKey,oe.overflowedItems)));var St=[].concat(Object(A.a)(ye),[Je,we]);return We===q.length-1&&St.push(oe.getOverflowedSubMenuItem(Te.props.eventKey,[],!0)),St}return[].concat(Object(A.a)(ye),[we])},[])}},{key:"render",value:function(){var q=this.props,oe=q.visible,ne=q.prefixCls,ye=q.overflowedIndicator,Te=q.mode,We=q.level,we=q.tag,Je=q.children,St=q.theme,Wt=Object(I.a)(q,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Zt=we;return R.createElement(Zt,Object(x.a)({ref:this.childRef},Wt),this.renderChildren(Je))}}]),je}(R.Component);$e.defaultProps={tag:"div",className:""};var Ze=$e;function dt(pe){return pe.length?pe.every(function(Se){return!!Se.props.disabled}):!0}function Tt(pe,Se,je){var _e=pe.getState();pe.setState({activeKey:Object(B.a)(Object(B.a)({},_e.activeKey),{},Object(Q.a)({},Se,je))})}function at(pe){return pe.eventKey||"0-menu-"}function Ut(pe,Se){var je=Se,_e=pe.children,q=pe.eventKey;if(je){var oe;if(tt(_e,function(ne,ye){ne&&ne.props&&!ne.props.disabled&&je===Fe(ne,q,ye)&&(oe=!0)}),oe)return je}return je=null,pe.defaultActiveFirst&&tt(_e,function(ne,ye){!je&&ne&&!ne.props.disabled&&(je=Fe(ne,q,ye))}),je}function Yt(pe){if(!pe)return;var Se=this.instanceArray.indexOf(pe);Se!==-1?this.instanceArray[Se]=pe:this.instanceArray.push(pe)}var yn=function(pe){Object(y.a)(je,pe);var Se=Object(f.a)(je);function je(_e){var q;return Object(w.a)(this,je),q=Se.call(this,_e),q.onKeyDown=function(oe,ne){var ye=oe.keyCode,Te;if(q.getFlatInstanceArray().forEach(function(we){we&&we.props.active&&we.onKeyDown&&(Te=we.onKeyDown(oe))}),Te)return 1;var We=null;return(ye===a.a.UP||ye===a.a.DOWN)&&(We=q.step(ye===a.a.UP?-1:1)),We?(oe.preventDefault(),Tt(q.props.store,at(q.props),We.props.eventKey),typeof ne=="function"&&ne(We),1):void 0},q.onItemHover=function(oe){var ne=oe.key,ye=oe.hover;Tt(q.props.store,at(q.props),ye?ne:null)},q.onDeselect=function(oe){q.props.onDeselect(oe)},q.onSelect=function(oe){q.props.onSelect(oe)},q.onClick=function(oe){q.props.onClick(oe)},q.onOpenChange=function(oe){q.props.onOpenChange(oe)},q.onDestroy=function(oe){q.props.onDestroy(oe)},q.getFlatInstanceArray=function(){return q.instanceArray},q.step=function(oe){var ne=q.getFlatInstanceArray(),ye=q.props.store.getState().activeKey[at(q.props)],Te=ne.length;if(!Te)return null;oe<0&&(ne=ne.concat().reverse());var We=-1;if(ne.every(function(Wt,Zt){return Wt&&Wt.props.eventKey===ye?(We=Zt,!1):!0}),!q.props.defaultActiveFirst&&We!==-1&&dt(ne.slice(We,Te-1)))return;var we=(We+1)%Te,Je=we;do{var St=ne[Je];if(!St||St.props.disabled)Je=(Je+1)%Te;else return St}while(Je!==we);return null},q.renderCommonMenuItem=function(oe,ne,ye){var Te=q.props.store.getState(),We=Object(_.a)(q),we=We.props,Je=Fe(oe,we.eventKey,ne),St=oe.props;if(!St||typeof oe.type=="string")return oe;var Wt=Je===Te.activeKey,Zt=Object(B.a)(Object(B.a)({mode:St.mode||we.mode,level:we.level,inlineIndent:we.inlineIndent,renderMenuItem:q.renderMenuItem,rootPrefixCls:we.prefixCls,index:ne,parentMenu:we.parentMenu,manualRef:St.disabled?void 0:Object(p.a)(oe.ref,Yt.bind(Object(_.a)(q))),eventKey:Je,active:!St.disabled&&Wt,multiple:we.multiple,onClick:function(Nn){(St.onClick||vt)(Nn),q.onClick(Nn)},onItemHover:q.onItemHover,motion:we.motion,subMenuOpenDelay:we.subMenuOpenDelay,subMenuCloseDelay:we.subMenuCloseDelay,forceSubMenuRender:we.forceSubMenuRender,onOpenChange:q.onOpenChange,onDeselect:q.onDeselect,onSelect:q.onSelect,builtinPlacements:we.builtinPlacements,itemIcon:St.itemIcon||q.props.itemIcon,expandIcon:St.expandIcon||q.props.expandIcon},ye),{},{direction:we.direction});return(we.mode==="inline"||yt())&&(Zt.triggerSubMenuAction="click"),R.cloneElement(oe,Object(B.a)(Object(B.a)({},Zt),{},{key:Je||ne}))},q.renderMenuItem=function(oe,ne,ye){if(!oe)return null;var Te=q.props.store.getState(),We={openKeys:Te.openKeys,selectedKeys:Te.selectedKeys,triggerSubMenuAction:q.props.triggerSubMenuAction,subMenuKey:ye};return q.renderCommonMenuItem(oe,ne,We)},_e.store.setState({activeKey:Object(B.a)(Object(B.a)({},_e.store.getState().activeKey),{},Object(Q.a)({},_e.eventKey,Ut(_e,_e.activeKey)))}),q.instanceArray=[],q}return Object(T.a)(je,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(q){return this.props.visible||q.visible||this.props.className!==q.className||!k()(this.props.style,q.style)}},{key:"componentDidUpdate",value:function(q){var oe=this.props,ne="activeKey"in oe?oe.activeKey:oe.store.getState().activeKey[at(oe)],ye=Ut(oe,ne);if(ye!==ne)Tt(oe.store,at(oe),ye);else if("activeKey"in q){var Te=Ut(q,q.activeKey);ye!==Te&&Tt(oe.store,at(oe),ye)}}},{key:"render",value:function(){var q=this,oe=Object(x.a)({},this.props);this.instanceArray=[];var ne=F()(oe.prefixCls,oe.className,"".concat(oe.prefixCls,"-").concat(oe.mode)),ye={className:ne,role:oe.role||"menu"};oe.id&&(ye.id=oe.id),oe.focusable&&(ye.tabIndex=0,ye.onKeyDown=this.onKeyDown);var Te=oe.prefixCls,We=oe.eventKey,we=oe.visible,Je=oe.level,St=oe.mode,Wt=oe.overflowedIndicator,Zt=oe.theme;return Ge.forEach(function(Pn){return delete oe[Pn]}),delete oe.onClick,R.createElement(Ze,Object(x.a)({},oe,{prefixCls:Te,mode:St,tag:"ul",level:Je,theme:Zt,visible:we,overflowedIndicator:Wt},ye),Object(D.a)(oe.children).map(function(Pn,Nn){return q.renderMenuItem(Pn,Nn,We||"0-menu-")}))}}]),je}(R.Component);yn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:vt};var In=Object(c.b)()(yn),mn=In,Cn=M("Kwbf");function xn(pe,Se,je){var _e=pe.prefixCls,q=pe.motion,oe=pe.defaultMotions,ne=oe===void 0?{}:oe,ye=pe.openAnimation,Te=pe.openTransitionName,We=Se.switchingModeFromInline;if(q)return q;if(Object(U.a)(ye)==="object"&&ye)Object(Cn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ye=="string")return{motionName:"".concat(_e,"-open-").concat(ye)};if(Te)return{motionName:Te};var we=ne[je];return we||(We?null:ne.other)}var Et=function(pe){Object(y.a)(je,pe);var Se=Object(f.a)(je);function je(_e){var q;Object(w.a)(this,je),q=Se.call(this,_e),q.onSelect=function(ye){var Te=Object(_.a)(q),We=Te.props;if(We.selectable){var we=q.store.getState(),Je=we.selectedKeys,St=ye.key;We.multiple?Je=Je.concat([St]):Je=[St],"selectedKeys"in We||q.store.setState({selectedKeys:Je}),We.onSelect(Object(B.a)(Object(B.a)({},ye),{},{selectedKeys:Je}))}},q.onClick=function(ye){var Te=q.getRealMenuMode(),We=Object(_.a)(q),we=We.store,Je=We.props.onOpenChange;Te!=="inline"&&!("openKeys"in q.props)&&(we.setState({openKeys:[]}),Je([])),q.props.onClick(ye)},q.onKeyDown=function(ye,Te){q.innerMenu.getWrappedInstance().onKeyDown(ye,Te)},q.onOpenChange=function(ye){var Te=Object(_.a)(q),We=Te.props,we=q.store.getState().openKeys.concat(),Je=!1,St=function(Zt){var Pn=!1;if(Zt.open)Pn=we.indexOf(Zt.key)===-1,Pn&&we.push(Zt.key);else{var Nn=we.indexOf(Zt.key);Pn=Nn!==-1,Pn&&we.splice(Nn,1)}Je=Je||Pn};Array.isArray(ye)?ye.forEach(St):St(ye),Je&&("openKeys"in q.props||q.store.setState({openKeys:we}),We.onOpenChange(we))},q.onDeselect=function(ye){var Te=Object(_.a)(q),We=Te.props;if(We.selectable){var we=q.store.getState().selectedKeys.concat(),Je=ye.key,St=we.indexOf(Je);St!==-1&&we.splice(St,1),"selectedKeys"in We||q.store.setState({selectedKeys:we}),We.onDeselect(Object(B.a)(Object(B.a)({},ye),{},{selectedKeys:we}))}},q.onMouseEnter=function(ye){q.restoreModeVerticalFromInline();var Te=q.props.onMouseEnter;Te&&Te(ye)},q.onTransitionEnd=function(ye){var Te=ye.propertyName==="width"&&ye.target===ye.currentTarget,We=ye.target.className,we=Object.prototype.toString.call(We)==="[object SVGAnimatedString]"?We.animVal:We,Je=ye.propertyName==="font-size"&&we.indexOf("anticon")>=0;(Te||Je)&&q.restoreModeVerticalFromInline()},q.setInnerMenu=function(ye){q.innerMenu=ye},q.isRootMenu=!0;var oe=_e.defaultSelectedKeys,ne=_e.defaultOpenKeys;return"selectedKeys"in _e&&(oe=_e.selectedKeys||[]),"openKeys"in _e&&(ne=_e.openKeys||[]),q.store=Object(c.c)({selectedKeys:oe,openKeys:ne,activeKey:{"0-menu-":Ut(_e,_e.activeKey)}}),q.state={switchingModeFromInline:!1,prevProps:_e,inlineOpenKeys:[],store:q.store},q}return Object(T.a)(je,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(q){var oe=this.props,ne=oe.siderCollapsed,ye=oe.inlineCollapsed,Te=oe.onOpenChange;(!q.inlineCollapsed&&ye||!q.siderCollapsed&&ne)&&Te([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var q=this.props.collapsedWidth,oe=this.store,ne=this.prevOpenKeys,ye=this.getInlineCollapsed()&&(q===0||q==="0"||q==="0px");ye?(this.prevOpenKeys=oe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ne&&(this.store.setState({openKeys:ne}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var q=this.props.mode,oe=this.state.switchingModeFromInline,ne=this.getInlineCollapsed();return oe&&ne?"inline":ne?"vertical":q}},{key:"getInlineCollapsed",value:function(){var q=this.props,oe=q.inlineCollapsed,ne=q.siderCollapsed;return ne!==void 0?ne:oe}},{key:"restoreModeVerticalFromInline",value:function(){var q=this.state.switchingModeFromInline;q&&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 q=Object(B.a)({},Object(v.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),oe=this.getRealMenuMode();return q.className+=" ".concat(q.prefixCls,"-root"),q.direction==="rtl"&&(q.className+=" ".concat(q.prefixCls,"-rtl")),q=Object(B.a)(Object(B.a)({},q),{},{mode:oe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:xn(this.props,this.state,oe)}),delete q.openAnimation,delete q.openTransitionName,R.createElement(c.a,{store:this.store},R.createElement(mn,Object(x.a)({},q,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(q,oe){var ne=oe.prevProps,ye=oe.store,Te=ye.getState(),We={},we={prevProps:q};return ne.mode==="inline"&&q.mode!=="inline"&&(we.switchingModeFromInline=!0),"openKeys"in q?We.openKeys=q.openKeys||[]:((q.inlineCollapsed&&!ne.inlineCollapsed||q.siderCollapsed&&!ne.siderCollapsed)&&(we.switchingModeFromInline=!0,we.inlineOpenKeys=Te.openKeys,We.openKeys=[]),(!q.inlineCollapsed&&ne.inlineCollapsed||!q.siderCollapsed&&ne.siderCollapsed)&&(We.openKeys=oe.inlineOpenKeys,we.inlineOpenKeys=[])),Object.keys(We).length&&ye.setState(We),we}}]),je}(R.Component);Et.defaultProps={selectable:!0,onClick:vt,onSelect:vt,onOpenChange:vt,onDeselect:vt,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:R.createElement("span",null,"\xB7\xB7\xB7")};var Xt=Et,Mt=function(pe){Object(y.a)(je,pe);var Se=Object(f.a)(je);function je(){var _e;return Object(w.a)(this,je),_e=Se.apply(this,arguments),_e.onKeyDown=function(q){var oe=q.keyCode;return oe===a.a.ENTER?(_e.onClick(q),!0):void 0},_e.onMouseLeave=function(q){var oe=_e.props,ne=oe.eventKey,ye=oe.onItemHover,Te=oe.onMouseLeave;ye({key:ne,hover:!1}),Te({key:ne,domEvent:q})},_e.onMouseEnter=function(q){var oe=_e.props,ne=oe.eventKey,ye=oe.onItemHover,Te=oe.onMouseEnter;ye({key:ne,hover:!0}),Te({key:ne,domEvent:q})},_e.onClick=function(q){var oe=_e.props,ne=oe.eventKey,ye=oe.multiple,Te=oe.onClick,We=oe.onSelect,we=oe.onDeselect,Je=oe.isSelected,St={key:ne,keyPath:[ne],item:Object(_.a)(_e),domEvent:q};Te(St),ye?Je?we(St):We(St):Je||We(St)},_e.saveNode=function(q){_e.node=q},_e}return Object(T.a)(je,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var q=this.props;q.onDestroy&&q.onDestroy(q.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 q,oe=Object(B.a)({},this.props),ne=F()(this.getPrefixCls(),oe.className,(q={},Object(Q.a)(q,this.getActiveClassName(),!oe.disabled&&oe.active),Object(Q.a)(q,this.getSelectedClassName(),oe.isSelected),Object(Q.a)(q,this.getDisabledClassName(),oe.disabled),q)),ye=Object(B.a)(Object(B.a)({},oe.attribute),{},{title:typeof oe.title=="string"?oe.title:void 0,className:ne,role:oe.role||"menuitem","aria-disabled":oe.disabled});oe.role==="option"?ye=Object(B.a)(Object(B.a)({},ye),{},{role:"option","aria-selected":oe.isSelected}):(oe.role===null||oe.role==="none")&&(ye.role="none");var Te={onClick:oe.disabled?null:this.onClick,onMouseLeave:oe.disabled?null:this.onMouseLeave,onMouseEnter:oe.disabled?null:this.onMouseEnter},We=Object(B.a)({},oe.style);oe.mode==="inline"&&(oe.direction==="rtl"?We.paddingRight=oe.inlineIndent*oe.level:We.paddingLeft=oe.inlineIndent*oe.level),Ge.forEach(function(Je){return delete oe[Je]}),delete oe.direction;var we=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(we=R.createElement(this.props.itemIcon,this.props)),R.createElement("li",Object(x.a)({},Object(v.a)(oe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ye,Te,{style:We,ref:this.saveNode}),oe.children,we)}}]),je}(R.Component);Mt.isMenuItem=!0,Mt.defaultProps={onSelect:vt,onMouseEnter:vt,onMouseLeave:vt,manualRef:vt};var gt=Object(c.b)(function(pe,Se){var je=pe.activeKey,_e=pe.selectedKeys,q=Se.eventKey,oe=Se.subMenuKey;return{active:je[oe]===q,isSelected:Array.isArray(_e)?_e.indexOf(q)!==-1:_e===q}})(Mt),Sn=gt,gn=function(pe){Object(y.a)(je,pe);var Se=Object(f.a)(je);function je(){var _e;return Object(w.a)(this,je),_e=Se.apply(this,arguments),_e.renderInnerMenuItem=function(q){var oe=_e.props,ne=oe.renderMenuItem,ye=oe.index;return ne(q,ye,_e.props.subMenuKey)},_e}return Object(T.a)(je,[{key:"render",value:function(){var q=Object(x.a)({},this.props),oe=q.className,ne=oe===void 0?"":oe,ye=q.rootPrefixCls,Te="".concat(ye,"-item-group-title"),We="".concat(ye,"-item-group-list"),we=q.title,Je=q.children;return Ge.forEach(function(St){return delete q[St]}),delete q.direction,R.createElement("li",Object(x.a)({},q,{onClick:function(Wt){return Wt.stopPropagation()},className:"".concat(ne," ").concat(ye,"-item-group")}),R.createElement("div",{className:Te,title:typeof we=="string"?we:void 0},we),R.createElement("ul",{className:We},R.Children.map(Je,this.renderInnerMenuItem)))}}]),je}(R.Component);gn.isMenuItemGroup=!0,gn.defaultProps={disabled:!0};var Nt=gn,et=function(Se){var je=Se.className,_e=Se.rootPrefixCls,q=Se.style;return R.createElement("li",{className:"".concat(je," ").concat(_e,"-item-divider"),style:q})};et.defaultProps={disabled:!0,className:"",style:{}};var Rn=et,$t=Xt,Bn=M("eDIo");function jt(pe,Se){var je=pe.prefixCls,_e=pe.editable,q=pe.locale,oe=pe.style;return!_e||_e.showAdd===!1?null:R.createElement("button",{ref:Se,type:"button",className:"".concat(je,"-nav-add"),style:oe,"aria-label":(q==null?void 0:q.addAriaLabel)||"Add tab",onClick:function(ye){_e.onEdit("add",{event:ye})}},_e.addIcon||"+")}var vn=R.forwardRef(jt);function Dn(pe,Se){var je=pe.prefixCls,_e=pe.id,q=pe.tabs,oe=pe.locale,ne=pe.mobile,ye=pe.moreIcon,Te=ye===void 0?"More":ye,We=pe.moreTransitionName,we=pe.style,Je=pe.className,St=pe.editable,Wt=pe.tabBarGutter,Zt=pe.rtl,Pn=pe.onTabClick,Nn=Object(R.useState)(!1),qn=Object(z.a)(Nn,2),Qn=qn[0],da=qn[1],ma=Object(R.useState)(null),aa=Object(z.a)(ma,2),ca=aa[0],ya=aa[1],en="".concat(_e,"-more-popup"),Ht="".concat(je,"-dropdown"),dn=ca!==null?"".concat(en,"-").concat(ca):null,It=oe==null?void 0:oe.dropdownAriaLabel,kt=R.createElement($t,{onClick:function(ka){var La=ka.key,Da=ka.domEvent;Pn(La,Da),da(!1)},id:en,tabIndex:-1,role:"listbox","aria-activedescendant":dn,selectedKeys:[ca],"aria-label":It!==void 0?It:"expanded dropdown"},q.map(function(Ca){return R.createElement(Sn,{key:Ca.key,id:"".concat(en,"-").concat(Ca.key),role:"option","aria-controls":_e&&"".concat(_e,"-panel-").concat(Ca.key),disabled:Ca.disabled},Ca.tab)}));function ea(Ca){for(var ka=q.filter(function(lr){return!lr.disabled}),La=ka.findIndex(function(lr){return lr.key===ca})||0,Da=ka.length,Sa=0;Sa<Da;Sa+=1){La=(La+Ca+Da)%Da;var ra=ka[La];if(!ra.disabled){ya(ra.key);return}}}function ba(Ca){var ka=Ca.which;if(!Qn){[a.a.DOWN,a.a.SPACE,a.a.ENTER].includes(ka)&&(da(!0),Ca.preventDefault());return}switch(ka){case a.a.UP:ea(-1),Ca.preventDefault();break;case a.a.DOWN:ea(1),Ca.preventDefault();break;case a.a.ESC:da(!1);break;case a.a.SPACE:case a.a.ENTER:ca!==null&&Pn(ca,Ca);break}}Object(R.useEffect)(function(){var Ca=document.getElementById(dn);Ca&&Ca.scrollIntoView&&Ca.scrollIntoView(!1)},[ca]),Object(R.useEffect)(function(){Qn||ya(null)},[Qn]);var Gn=Object(Q.a)({},Zt?"marginLeft":"marginRight",Wt);q.length||(Gn.visibility="hidden",Gn.order=1);var Oa=F()(Object(Q.a)({},"".concat(Ht,"-rtl"),Zt)),Va=ne?null:R.createElement(Bn.a,{prefixCls:Ht,overlay:kt,trigger:["hover"],visible:Qn,transitionName:We,onVisibleChange:da,overlayClassName:Oa,mouseEnterDelay:.1,mouseLeaveDelay:.1},R.createElement("button",{type:"button",className:"".concat(je,"-nav-more"),style:Gn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":en,id:"".concat(_e,"-more"),"aria-expanded":Qn,onKeyDown:ba},Te));return R.createElement("div",{className:F()("".concat(je,"-nav-operations"),Je),style:we,ref:Se},Va,R.createElement(vn,{prefixCls:je,locale:oe,editable:St}))}var tn=R.forwardRef(Dn),oa=Object(R.createContext)(null),_n=.1,hn=.01,bt=20,He=Math.pow(.995,bt);function Ct(){var pe=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(pe)||/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(pe.substr(0,4)))}function xt(pe,Se){var je=Object(R.useState)(),_e=Object(z.a)(je,2),q=_e[0],oe=_e[1],ne=Object(R.useState)(0),ye=Object(z.a)(ne,2),Te=ye[0],We=ye[1],we=Object(R.useState)(0),Je=Object(z.a)(we,2),St=Je[0],Wt=Je[1],Zt=Object(R.useState)(),Pn=Object(z.a)(Zt,2),Nn=Pn[0],qn=Pn[1],Qn=Object(R.useRef)();function da(It){var kt=It.touches[0],ea=kt.screenX,ba=kt.screenY;oe({x:ea,y:ba}),window.clearInterval(Qn.current)}function ma(It){if(!q)return;It.preventDefault();var kt=It.touches[0],ea=kt.screenX,ba=kt.screenY;oe({x:ea,y:ba});var Gn=ea-q.x,Oa=ba-q.y;Se(Gn,Oa);var Va=Date.now();We(Va),Wt(Va-Te),qn({x:Gn,y:Oa})}function aa(){if(!q)return;if(oe(null),qn(null),Nn){var It=Nn.x/St,kt=Nn.y/St,ea=Math.abs(It),ba=Math.abs(kt);if(Math.max(ea,ba)<_n)return;var Gn=It,Oa=kt;Qn.current=window.setInterval(function(){if(Math.abs(Gn)<hn&&Math.abs(Oa)<hn){window.clearInterval(Qn.current);return}Gn*=He,Oa*=He,Se(Gn*bt,Oa*bt)},bt)}}var ca=Object(R.useRef)(0),ya=Object(R.useRef)(!1),en=Object(R.useRef)();function Ht(It){var kt=It.deltaX,ea=It.deltaY,ba=0,Gn=Math.abs(kt),Oa=Math.abs(ea);Gn===Oa?ba=en.current==="x"?kt:ea:Gn>Oa?(ba=kt,en.current="x"):(ba=ea,en.current="y");var Va=Date.now();Va-ca.current>100&&(ya.current=!1),(Se(-ba,-ba)||ya.current)&&(It.preventDefault(),ya.current=!0),ca.current=Va}var dn=Object(R.useRef)(null);dn.current={onTouchStart:da,onTouchMove:ma,onTouchEnd:aa,onWheel:Ht},R.useEffect(function(){function It(Gn){dn.current.onTouchStart(Gn)}function kt(Gn){dn.current.onTouchMove(Gn)}function ea(Gn){dn.current.onTouchEnd(Gn)}function ba(Gn){dn.current.onWheel(Gn)}return document.addEventListener("touchmove",kt,{passive:!1}),document.addEventListener("touchend",ea,{passive:!1}),pe.current.addEventListener("touchstart",It,{passive:!1}),pe.current.addEventListener("wheel",ba),function(){document.removeEventListener("touchmove",kt),document.removeEventListener("touchend",ea)}},[])}function Vt(){var pe=Object(R.useRef)(new Map);function Se(_e){return pe.current.has(_e)||pe.current.set(_e,R.createRef()),pe.current.get(_e)}function je(_e){pe.current.delete(_e)}return[Se,je]}function kn(pe,Se){var je=R.useRef(pe),_e=R.useState({}),q=Object(z.a)(_e,2),oe=q[1];function ne(ye){var Te=typeof ye=="function"?ye(je.current):ye;Te!==je.current&&Se(Te,je.current),je.current=Te,oe({})}return[je.current,ne]}var On=function(Se){var je=Se.position,_e=Se.prefixCls,q=Se.extra;if(!q)return null;var oe,ne=q;return je==="right"&&(oe=ne.right||!ne.left&&ne||null),je==="left"&&(oe=ne.left||null),oe?R.createElement("div",{className:"".concat(_e,"-extra-content")},oe):null};function Yn(pe,Se){var je,_e=R.useContext(oa),q=_e.prefixCls,oe=_e.tabs,ne=pe.className,ye=pe.style,Te=pe.id,We=pe.animated,we=pe.activeKey,Je=pe.rtl,St=pe.extra,Wt=pe.editable,Zt=pe.locale,Pn=pe.tabPosition,Nn=pe.tabBarGutter,qn=pe.children,Qn=pe.onTabClick,da=pe.onTabScroll,ma=Object(R.useRef)(),aa=Object(R.useRef)(),ca=Object(R.useRef)(),ya=Object(R.useRef)(),en=Vt(),Ht=Object(z.a)(en,2),dn=Ht[0],It=Ht[1],kt=Pn==="top"||Pn==="bottom",ea=kn(0,function(Na,Ta){kt&&da&&da({direction:Na>Ta?"left":"right"})}),ba=Object(z.a)(ea,2),Gn=ba[0],Oa=ba[1],Va=kn(0,function(Na,Ta){!kt&&da&&da({direction:Na>Ta?"top":"bottom"})}),Ca=Object(z.a)(Va,2),ka=Ca[0],La=Ca[1],Da=Object(R.useState)(0),Sa=Object(z.a)(Da,2),ra=Sa[0],lr=Sa[1],Qr=Object(R.useState)(0),kr=Object(z.a)(Qr,2),Or=kr[0],Qa=kr[1],Ha=Object(R.useState)(0),za=Object(z.a)(Ha,2),Ja=za[0],Nr=za[1],fi=Object(R.useState)(0),si=Object(z.a)(fi,2),Wa=si[0],Jr=si[1],Zr=Object(R.useState)(null),Ya=Object(z.a)(Zr,2),Fa=Ya[0],yr=Ya[1],Mi=Object(R.useState)(null),no=Object(z.a)(Mi,2),li=no[0],Oi=no[1],Ci=Object(R.useState)(0),wi=Object(z.a)(Ci,2),Ii=wi[0],co=wi[1],Ro=Object(R.useState)(0),Gi=Object(z.a)(Ro,2),Si=Gi[0],Vi=Gi[1],_i=o(new Map),Ri=Object(z.a)(_i,2),fo=Ri[0],Yi=Ri[1],Ai=n(oe,fo,ra),Di="".concat(q,"-nav-operations-hidden"),yi=0,Mr=0;kt?Je?(yi=0,Mr=Math.max(0,ra-Fa)):(yi=Math.min(0,Fa-ra),Mr=0):(yi=Math.min(0,li-Or),Mr=0);function hi(Na){return Na<yi?[yi,!1]:Na>Mr?[Mr,!1]:[Na,!0]}var pi=Object(R.useRef)(),bi=Object(R.useState)(),mi=Object(z.a)(bi,2),Xi=mi[0],$i=mi[1];function Qi(){$i(Date.now())}function ki(){window.clearTimeout(pi.current)}xt(ma,function(Na,Ta){var rr=!1;function Ur(Pi,di){Pi(function(ji){var ci=hi(ji+di),br=Object(z.a)(ci,2),Fi=br[0],Bi=br[1];return rr=Bi,Fi})}if(kt){if(Fa>=ra)return rr;Ur(Oa,Na)}else{if(li>=Or)return rr;Ur(La,Ta)}return ki(),Qi(),rr}),Object(R.useEffect)(function(){return ki(),Xi&&(pi.current=window.setTimeout(function(){$i(0)},100)),ki},[Xi]);function ui(){var Na=arguments.length>0&&arguments[0]!==void 0?arguments[0]:we,Ta=Ai.get(Na);if(!Ta)return;if(kt){var rr=Gn;Je?Ta.right<Gn?rr=Ta.right:Ta.right+Ta.width>Gn+Fa&&(rr=Ta.right+Ta.width-Fa):Ta.left<-Gn?rr=-Ta.left:Ta.left+Ta.width>-Gn+Fa&&(rr=-(Ta.left+Ta.width-Fa)),La(0),Oa(hi(rr)[0])}else{var Ur=ka;Ta.top<-ka?Ur=-Ta.top:Ta.top+Ta.height>-ka+li&&(Ur=-(Ta.top+Ta.height-li)),Oa(0),La(hi(Ur)[0])}}var Ei=C(Ai,{width:Fa,height:li,left:Gn,top:ka},{width:Ja,height:Wa},{width:Ii,height:Si},Object(B.a)(Object(B.a)({},pe),{},{tabs:oe})),ao=Object(z.a)(Ei,2),Ao=ao[0],Do=ao[1],ho=oe.map(function(Na){var Ta=Na.key;return R.createElement(s,{id:Te,prefixCls:q,key:Ta,rtl:Je,tab:Na,closable:Na.closable,editable:Wt,active:Ta===we,tabPosition:Pn,tabBarGutter:Nn,renderWrapper:qn,removeAriaLabel:Zt==null?void 0:Zt.removeAriaLabel,ref:dn(Ta),onClick:function(Ur){Qn(Ta,Ur)},onRemove:function(){It(Ta)},onFocus:function(){ui(Ta),Qi(),Je||(ma.current.scrollLeft=0),ma.current.scrollTop=0}})}),ro=d(function(){var Na,Ta,rr,Ur,Pi,di,ji,ci,br,Fi=((Na=ma.current)===null||Na===void 0?void 0:Na.offsetWidth)||0,Bi=((Ta=ma.current)===null||Ta===void 0?void 0:Ta.offsetHeight)||0,Hi=((rr=ya.current)===null||rr===void 0?void 0:rr.offsetWidth)||0,Kr=((Ur=ya.current)===null||Ur===void 0?void 0:Ur.offsetHeight)||0,Ma=((Pi=ca.current)===null||Pi===void 0?void 0:Pi.offsetWidth)||0,ha=((di=ca.current)===null||di===void 0?void 0:di.offsetHeight)||0;yr(Fi),Oi(Bi),co(Hi),Vi(Kr);var Fn=(((ji=aa.current)===null||ji===void 0?void 0:ji.offsetWidth)||0)-Hi,Jn=(((ci=aa.current)===null||ci===void 0?void 0:ci.offsetHeight)||0)-Kr;lr(Fn),Qa(Jn);var xa=(br=ca.current)===null||br===void 0?void 0:br.className.includes(Di);Nr(Fn-(xa?0:Ma)),Jr(Jn-(xa?0:ha)),Yi(function(){var er=new Map;return oe.forEach(function(gi){var ri=gi.key,Dr=dn(ri).current;Dr&&er.set(ri,{width:Dr.offsetWidth,height:Dr.offsetHeight,left:Dr.offsetLeft,top:Dr.offsetTop})}),er})}),po=oe.slice(0,Ao),Wr=oe.slice(Do+1),dr=[].concat(Object(A.a)(po),Object(A.a)(Wr)),Ar=Object(R.useState)(),cr=Object(z.a)(Ar,2),Ni=cr[0],mo=cr[1],qr=Ai.get(we),io=Object(R.useRef)();function oo(){m.a.cancel(io.current)}Object(R.useEffect)(function(){var Na={};return qr&&(kt?(Je?Na.right=qr.right:Na.left=qr.left,Na.width=qr.width):(Na.top=qr.top,Na.height=qr.height)),oo(),io.current=m()(function(){mo(Na)}),oo},[qr,kt,Je]),Object(R.useEffect)(function(){ui()},[we,qr,Ai,kt]),Object(R.useEffect)(function(){ro()},[Je,Nn,we,oe.map(function(Na){return Na.key}).join("_")]);var so=!!dr.length,xi="".concat(q,"-nav-wrap"),Ji,Ui,go,Zi;return kt?Je?(Ui=Gn>0,Ji=Gn+Fa<ra):(Ji=Gn<0,Ui=-Gn+Fa<ra):(go=ka<0,Zi=-ka+li<Or),R.createElement("div",{ref:Se,role:"tablist",className:F()("".concat(q,"-nav"),ne),style:ye,onKeyDown:function(){Qi()}},R.createElement(On,{position:"left",extra:St,prefixCls:q}),R.createElement(h.a,{onResize:ro},R.createElement("div",{className:F()(xi,(je={},Object(Q.a)(je,"".concat(xi,"-ping-left"),Ji),Object(Q.a)(je,"".concat(xi,"-ping-right"),Ui),Object(Q.a)(je,"".concat(xi,"-ping-top"),go),Object(Q.a)(je,"".concat(xi,"-ping-bottom"),Zi),je)),ref:ma},R.createElement(h.a,{onResize:ro},R.createElement("div",{ref:aa,className:"".concat(q,"-nav-list"),style:{transform:"translate(".concat(Gn,"px, ").concat(ka,"px)"),transition:Xi?"none":void 0}},ho,R.createElement(vn,{ref:ya,prefixCls:q,locale:Zt,editable:Wt,style:{visibility:so?"hidden":null}}),R.createElement("div",{className:F()("".concat(q,"-ink-bar"),Object(Q.a)({},"".concat(q,"-ink-bar-animated"),We.inkBar)),style:Ni}))))),R.createElement(tn,Object.assign({},pe,{ref:ca,prefixCls:q,tabs:dr,className:!so&&Di})),R.createElement(On,{position:"right",extra:St,prefixCls:q}))}var Wn=R.forwardRef(Yn);function pa(pe){var Se=pe.id,je=pe.activeKey,_e=pe.animated,q=pe.tabPosition,oe=pe.rtl,ne=pe.destroyInactiveTabPane,ye=R.useContext(oa),Te=ye.prefixCls,We=ye.tabs,we=_e.tabPane,Je=We.findIndex(function(St){return St.key===je});return R.createElement("div",{className:F()("".concat(Te,"-content-holder"))},R.createElement("div",{className:F()("".concat(Te,"-content"),"".concat(Te,"-content-").concat(q),Object(Q.a)({},"".concat(Te,"-content-animated"),we)),style:Je&&we?Object(Q.a)({},oe?"marginRight":"marginLeft","-".concat(Je,"00%")):null},We.map(function(St){return R.cloneElement(St.node,{key:St.key,prefixCls:Te,tabKey:St.key,id:Se,animated:we,active:St.key===je,destroyInactiveTabPane:ne})})))}function na(pe){var Se=pe.prefixCls,je=pe.forceRender,_e=pe.className,q=pe.style,oe=pe.id,ne=pe.active,ye=pe.animated,Te=pe.destroyInactiveTabPane,We=pe.tabKey,we=pe.children,Je=R.useState(je),St=Object(z.a)(Je,2),Wt=St[0],Zt=St[1];R.useEffect(function(){ne?Zt(!0):Te&&Zt(!1)},[ne,Te]);var Pn={};return ne||(ye?(Pn.visibility="hidden",Pn.height=0,Pn.overflowY="hidden"):Pn.display="none"),R.createElement("div",{id:oe&&"".concat(oe,"-panel-").concat(We),role:"tabpanel",tabIndex:ne?0:-1,"aria-labelledby":oe&&"".concat(oe,"-tab-").concat(We),"aria-hidden":!ne,style:Object(B.a)(Object(B.a)({},Pn),q),className:F()("".concat(Se,"-tabpane"),ne&&"".concat(Se,"-tabpane-active"),_e)},(ne||Wt||je)&&we)}var ua=0;function Ba(pe){return Object(D.a)(pe).map(function(Se){if(R.isValidElement(Se)){var je=Se.key!==void 0?String(Se.key):void 0;return Object(B.a)(Object(B.a)({key:je},Se.props),{},{node:Se})}return null}).filter(function(Se){return Se})}function Ia(pe,Se){var je,_e=pe.id,q=pe.prefixCls,oe=q===void 0?"rc-tabs":q,ne=pe.className,ye=pe.children,Te=pe.direction,We=pe.activeKey,we=pe.defaultActiveKey,Je=pe.editable,St=pe.animated,Wt=pe.tabPosition,Zt=Wt===void 0?"top":Wt,Pn=pe.tabBarGutter,Nn=pe.tabBarStyle,qn=pe.tabBarExtraContent,Qn=pe.locale,da=pe.moreIcon,ma=pe.moreTransitionName,aa=pe.destroyInactiveTabPane,ca=pe.renderTabBar,ya=pe.onChange,en=pe.onTabClick,Ht=pe.onTabScroll,dn=Object(I.a)(pe,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),It=Ba(ye),kt=Te==="rtl",ea;St===!1?ea={inkBar:!1,tabPane:!1}:ea=Object(B.a)({inkBar:!0,tabPane:!1},St!==!0?St:null);var ba=Object(R.useState)(!1),Gn=Object(z.a)(ba,2),Oa=Gn[0],Va=Gn[1];Object(R.useEffect)(function(){Va(Ct())},[]);var Ca=Object(L.a)(function(){var Wa;return(Wa=It[0])===null||Wa===void 0?void 0:Wa.key},{value:We,defaultValue:we}),ka=Object(z.a)(Ca,2),La=ka[0],Da=ka[1],Sa=Object(R.useState)(function(){return It.findIndex(function(Wa){return Wa.key===La})}),ra=Object(z.a)(Sa,2),lr=ra[0],Qr=ra[1];Object(R.useEffect)(function(){var Wa=It.findIndex(function(Zr){return Zr.key===La});if(Wa===-1){var Jr;Wa=Math.max(0,Math.min(lr,It.length-1)),Da((Jr=It[Wa])===null||Jr===void 0?void 0:Jr.key)}Qr(Wa)},[It.map(function(Wa){return Wa.key}).join("_"),La,lr]);var kr=Object(L.a)(null,{value:_e}),Or=Object(z.a)(kr,2),Qa=Or[0],Ha=Or[1],za=Zt;Oa&&!["left","right"].includes(Zt)&&(za="top"),Object(R.useEffect)(function(){_e||(Ha("rc-tabs-".concat(ua)),ua+=1)},[]);function Ja(Wa,Jr){en==null||en(Wa,Jr),Da(Wa),ya==null||ya(Wa)}var Nr={id:Qa,activeKey:La,animated:ea,tabPosition:za,rtl:kt,mobile:Oa},fi,si=Object(B.a)(Object(B.a)({},Nr),{},{editable:Je,locale:Qn,moreIcon:da,moreTransitionName:ma,tabBarGutter:Pn,onTabClick:Ja,onTabScroll:Ht,extra:qn,style:Nn,panes:ye});return ca?fi=ca(si,Wn):fi=R.createElement(Wn,Object.assign({},si)),R.createElement(oa.Provider,{value:{tabs:It,prefixCls:oe}},R.createElement("div",Object.assign({ref:Se,id:_e,className:F()(oe,"".concat(oe,"-").concat(za),(je={},Object(Q.a)(je,"".concat(oe,"-mobile"),Oa),Object(Q.a)(je,"".concat(oe,"-editable"),Je),Object(Q.a)(je,"".concat(oe,"-rtl"),kt),je),ne)},dn),fi,R.createElement(pa,Object.assign({destroyInactiveTabPane:aa},Nr,{animated:ea}))))}var ja=R.forwardRef(Ia);ja.TabPane=na;var or=ja,sr=Ke.b=or},kSUc:function(zt,Ke,M){},lZu9:function(zt,Ke,M){(function(Q){Q(M("VrN/"),M("1eCo"),M("8EBN"))})(function(Q){"use strict";Q.defineMode("markdown",function(z,I){var B=Q.getMode(z,"text/html"),R=B.name=="null";function P(j){if(Q.findModeByName){var O=Q.findModeByName(j);O&&(j=O.mime||O.mimes[0])}var K=Q.getMode(z,j);return K.name=="null"?null:K}I.highlightFormatting===void 0&&(I.highlightFormatting=!1),I.maxBlockquoteDepth===void 0&&(I.maxBlockquoteDepth=0),I.taskLists===void 0&&(I.taskLists=!1),I.strikethrough===void 0&&(I.strikethrough=!1),I.emoji===void 0&&(I.emoji=!1),I.fencedCodeBlockHighlighting===void 0&&(I.fencedCodeBlockHighlighting=!0),I.fencedCodeBlockDefaultMode===void 0&&(I.fencedCodeBlockDefaultMode="text/plain"),I.xml===void 0&&(I.xml=!0),I.tokenTypeOverrides===void 0&&(I.tokenTypeOverrides={});var F={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 D in F)F.hasOwnProperty(D)&&I.tokenTypeOverrides[D]&&(F[D]=I.tokenTypeOverrides[D]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,m=I.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,a=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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(j,O,K){return O.f=O.inline=K,K(j,O)}function n(j,O,K){return O.f=O.block=K,K(j,O)}function S(j){return!j||!/\S/.test(j.string)}function C(j){if(j.linkTitle=!1,j.linkHref=!1,j.linkText=!1,j.em=!1,j.strong=!1,j.strikethrough=!1,j.quote=0,j.indentedCode=!1,j.f==w){var O=R;if(!O){var K=Q.innerMode(B,j.htmlState);O=K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText}O&&(j.f=f,j.block=x,j.htmlState=null)}return j.trailingSpace=0,j.trailingSpaceNewLine=!1,j.prevLine=j.thisLine,j.thisLine={stream:null},null}function x(j,O){var K=j.column()===O.indentation,Y=S(O.prevLine.stream),ee=O.indentedCode,se=O.prevLine.hr,Be=O.list!==!1,me=(O.listStack[O.listStack.length-1]||0)+3;O.indentedCode=!1;var xe=O.indentation;if(O.indentationDiff===null&&(O.indentationDiff=O.indentation,Be)){for(O.list=null;xe<O.listStack[O.listStack.length-1];)O.listStack.pop(),O.listStack.length?O.indentation=O.listStack[O.listStack.length-1]:O.list=!1;O.list!==!1&&(O.indentationDiff=xe-O.listStack[O.listStack.length-1])}var Le=!Y&&!se&&!O.prevLine.header&&(!Be||!ee)&&!O.prevLine.fencedCodeEnd,Ae=(O.list===!1||se||Y)&&O.indentation<=me&&j.match(L),le=null;if(O.indentationDiff>=4&&(ee||O.prevLine.fencedCodeEnd||O.prevLine.header||Y))return j.skipToEnd(),O.indentedCode=!0,F.code;if(j.eatSpace())return null;if(K&&O.indentation<=me&&(le=j.match(m))&&le[1].length<=6)return O.quote=0,O.header=le[1].length,O.thisLine.header=!0,I.highlightFormatting&&(O.formatting="header"),O.f=O.inline,_(O);if(O.indentation<=me&&j.eat(">"))return O.quote=K?1:O.quote+1,I.highlightFormatting&&(O.formatting="quote"),j.eatSpace(),_(O);if(!Ae&&!O.setext&&K&&O.indentation<=me&&(le=j.match(A))){var fe=le[1]?"ol":"ul";return O.indentation=xe+j.current().length,O.list=!0,O.quote=0,O.listStack.push(O.indentation),O.em=!1,O.strong=!1,O.code=!1,O.strikethrough=!1,I.taskLists&&j.match(b,!1)&&(O.taskList=!0),O.f=O.inline,I.highlightFormatting&&(O.formatting=["list","list-"+fe]),_(O)}else{if(K&&O.indentation<=me&&(le=j.match(o,!0)))return O.quote=0,O.fencedEndRE=new RegExp(le[1]+"+ *$"),O.localMode=I.fencedCodeBlockHighlighting&&P(le[2]||I.fencedCodeBlockDefaultMode),O.localMode&&(O.localState=Q.startState(O.localMode)),O.f=O.block=T,I.highlightFormatting&&(O.formatting="code-block"),O.code=-1,_(O);if(O.setext||(!Le||!Be)&&!O.quote&&O.list===!1&&!O.code&&!Ae&&!a.test(j.string)&&(le=j.lookAhead(1))&&(le=le.match(h)))return O.setext?(O.header=O.setext,O.setext=0,j.skipToEnd(),I.highlightFormatting&&(O.formatting="header")):(O.header=le[0].charAt(0)=="="?1:2,O.setext=O.header),O.thisLine.header=!0,O.f=O.inline,_(O);if(Ae)return j.skipToEnd(),O.hr=!0,O.thisLine.hr=!0,F.hr;if(j.peek()==="[")return i(j,O,k)}return i(j,O,O.inline)}function w(j,O){var K=B.token(j,O.htmlState);if(!R){var Y=Q.innerMode(B,O.htmlState);(Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText||O.md_inside&&j.current().indexOf(">")>-1)&&(O.f=f,O.block=x,O.htmlState=null)}return K}function T(j,O){var K=O.listStack[O.listStack.length-1]||0,Y=O.indentation<K,ee=K+3;if(O.fencedEndRE&&O.indentation<=ee&&(Y||j.match(O.fencedEndRE))){I.highlightFormatting&&(O.formatting="code-block");var se;return Y||(se=_(O)),O.localMode=O.localState=null,O.block=x,O.f=f,O.fencedEndRE=null,O.code=0,O.thisLine.fencedCodeEnd=!0,Y?n(j,O,O.block):se}else return O.localMode?O.localMode.token(j,O.localState):(j.skipToEnd(),F.code)}function _(j){var O=[];if(j.formatting){O.push(F.formatting),typeof j.formatting=="string"&&(j.formatting=[j.formatting]);for(var K=0;K<j.formatting.length;K++)O.push(F.formatting+"-"+j.formatting[K]),j.formatting[K]==="header"&&O.push(F.formatting+"-"+j.formatting[K]+"-"+j.header),j.formatting[K]==="quote"&&(!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=j.quote?O.push(F.formatting+"-"+j.formatting[K]+"-"+j.quote):O.push("error"))}if(j.taskOpen)return O.push("meta"),O.length?O.join(" "):null;if(j.taskClosed)return O.push("property"),O.length?O.join(" "):null;if(j.linkHref?O.push(F.linkHref,"url"):(j.strong&&O.push(F.strong),j.em&&O.push(F.em),j.strikethrough&&O.push(F.strikethrough),j.emoji&&O.push(F.emoji),j.linkText&&O.push(F.linkText),j.code&&O.push(F.code),j.image&&O.push(F.image),j.imageAltText&&O.push(F.imageAltText,"link"),j.imageMarker&&O.push(F.imageMarker)),j.header&&O.push(F.header,F.header+"-"+j.header),j.quote&&(O.push(F.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=j.quote?O.push(F.quote+"-"+j.quote):O.push(F.quote+"-"+I.maxBlockquoteDepth)),j.list!==!1){var Y=(j.listStack.length-1)%3;Y?Y===1?O.push(F.list2):O.push(F.list3):O.push(F.list1)}return j.trailingSpaceNewLine?O.push("trailing-space-new-line"):j.trailingSpace&&O.push("trailing-space-"+(j.trailingSpace%2?"a":"b")),O.length?O.join(" "):null}function y(j,O){return j.match(d,!0)?_(O):void 0}function f(j,O){var K=O.text(j,O);if(typeof K!="undefined")return K;if(O.list)return O.list=null,_(O);if(O.taskList){var Y=j.match(b,!0)[1]===" ";return Y?O.taskOpen=!0:O.taskClosed=!0,I.highlightFormatting&&(O.formatting="task"),O.taskList=!1,_(O)}if(O.taskOpen=!1,O.taskClosed=!1,O.header&&j.match(/^#+$/,!0))return I.highlightFormatting&&(O.formatting="header"),_(O);var ee=j.next();if(O.linkTitle){O.linkTitle=!1;var se=ee;ee==="("&&(se=")"),se=(se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Be="^\\s*(?:[^"+se+"\\\\]+|\\\\\\\\|\\\\.)"+se;if(j.match(new RegExp(Be),!0))return F.linkHref}if(ee==="`"){var me=O.formatting;I.highlightFormatting&&(O.formatting="code"),j.eatWhile("`");var xe=j.current().length;if(O.code==0&&(!O.quote||xe==1))return O.code=xe,_(O);if(xe==O.code){var Le=_(O);return O.code=0,Le}else return O.formatting=me,_(O)}else if(O.code)return _(O);if(ee==="\\"&&(j.next(),I.highlightFormatting)){var Ae=_(O),le=F.formatting+"-escape";return Ae?Ae+" "+le:le}if(ee==="!"&&j.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return O.imageMarker=!0,O.image=!0,I.highlightFormatting&&(O.formatting="image"),_(O);if(ee==="["&&O.imageMarker&&j.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return O.imageMarker=!1,O.imageAltText=!0,I.highlightFormatting&&(O.formatting="image"),_(O);if(ee==="]"&&O.imageAltText){I.highlightFormatting&&(O.formatting="image");var Ae=_(O);return O.imageAltText=!1,O.image=!1,O.inline=O.f=v,Ae}if(ee==="["&&!O.image)return O.linkText&&j.match(/^.*?\]/)||(O.linkText=!0,I.highlightFormatting&&(O.formatting="link")),_(O);if(ee==="]"&&O.linkText){I.highlightFormatting&&(O.formatting="link");var Ae=_(O);return O.linkText=!1,O.inline=O.f=j.match(/\(.*?\)| ?\[.*?\]/,!1)?v:f,Ae}if(ee==="<"&&j.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=c,I.highlightFormatting&&(O.formatting="link");var Ae=_(O);return Ae?Ae+=" ":Ae="",Ae+F.linkInline}if(ee==="<"&&j.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=c,I.highlightFormatting&&(O.formatting="link");var Ae=_(O);return Ae?Ae+=" ":Ae="",Ae+F.linkEmail}if(I.xml&&ee==="<"&&j.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var fe=j.string.indexOf(">",j.pos);if(fe!=-1){var Ve=j.string.substring(j.start,fe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ve)&&(O.md_inside=!0)}return j.backUp(1),O.htmlState=Q.startState(B),n(j,O,w)}if(I.xml&&ee==="<"&&j.match(/^\/\w*?>/))return O.md_inside=!1,"tag";if(ee==="*"||ee==="_"){for(var Lt=1,Pt=j.pos==1?" ":j.string.charAt(j.pos-2);Lt<3&&j.eat(ee);)Lt++;var vt=j.peek()||" ",Fe=!/\s/.test(vt)&&(!u.test(vt)||/\s/.test(Pt)||u.test(Pt)),_t=!/\s/.test(Pt)&&(!u.test(Pt)||/\s/.test(vt)||u.test(vt)),tt=null,Rt=null;if(Lt%2&&(!O.em&&Fe&&(ee==="*"||!_t||u.test(Pt))?tt=!0:O.em==ee&&_t&&(ee==="*"||!Fe||u.test(vt))&&(tt=!1)),Lt>1&&(!O.strong&&Fe&&(ee==="*"||!_t||u.test(Pt))?Rt=!0:O.strong==ee&&_t&&(ee==="*"||!Fe||u.test(vt))&&(Rt=!1)),Rt!=null||tt!=null){I.highlightFormatting&&(O.formatting=tt==null?"strong":Rt==null?"em":"strong em"),tt===!0&&(O.em=ee),Rt===!0&&(O.strong=ee);var Le=_(O);return tt===!1&&(O.em=!1),Rt===!1&&(O.strong=!1),Le}}else if(ee===" "&&(j.eat("*")||j.eat("_"))){if(j.peek()===" ")return _(O);j.backUp(1)}if(I.strikethrough){if(ee==="~"&&j.eatWhile(ee)){if(O.strikethrough){I.highlightFormatting&&(O.formatting="strikethrough");var Le=_(O);return O.strikethrough=!1,Le}else if(j.match(/^[^\s]/,!1))return O.strikethrough=!0,I.highlightFormatting&&(O.formatting="strikethrough"),_(O)}else if(ee===" "&&j.match(/^~~/,!0)){if(j.peek()===" ")return _(O);j.backUp(2)}}if(I.emoji&&ee===":"&&j.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){O.emoji=!0,I.highlightFormatting&&(O.formatting="emoji");var Ge=_(O);return O.emoji=!1,Ge}return ee===" "&&(j.match(/^ +$/,!1)?O.trailingSpace++:O.trailingSpace&&(O.trailingSpaceNewLine=!0)),_(O)}function c(j,O){var K=j.next();if(K===">"){O.f=O.inline=f,I.highlightFormatting&&(O.formatting="link");var Y=_(O);return Y?Y+=" ":Y="",Y+F.linkInline}return j.match(/^[^>]+/,!0),F.linkInline}function v(j,O){if(j.eatSpace())return null;var K=j.next();return K==="("||K==="["?(O.f=O.inline=E(K==="("?")":"]"),I.highlightFormatting&&(O.formatting="link-string"),O.linkHref=!0,_(O)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(j){return function(O,K){var Y=O.next();if(Y===j){K.f=K.inline=f,I.highlightFormatting&&(K.formatting="link-string");var ee=_(K);return K.linkHref=!1,ee}return O.match(p[j]),K.linkHref=!0,_(K)}}function k(j,O){return j.match(/^([^\]\\]|\\.)*\]:/,!1)?(O.f=U,j.next(),I.highlightFormatting&&(O.formatting="link"),O.linkText=!0,_(O)):i(j,O,f)}function U(j,O){if(j.match(/^\]:/,!0)){O.f=O.inline=H,I.highlightFormatting&&(O.formatting="link");var K=_(O);return O.linkText=!1,K}return j.match(/^([^\]\\]|\\.)+/,!0),F.linkText}function H(j,O){return j.eatSpace()?null:(j.match(/^[^\s]+/,!0),j.peek()===void 0?O.linkTitle=!0:j.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),O.f=O.inline=f,F.linkHref+" url")}var W={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:f,text:y,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(j){return{f:j.f,prevLine:j.prevLine,thisLine:j.thisLine,block:j.block,htmlState:j.htmlState&&Q.copyState(B,j.htmlState),indentation:j.indentation,localMode:j.localMode,localState:j.localMode?Q.copyState(j.localMode,j.localState):null,inline:j.inline,text:j.text,formatting:!1,linkText:j.linkText,linkTitle:j.linkTitle,linkHref:j.linkHref,code:j.code,em:j.em,strong:j.strong,strikethrough:j.strikethrough,emoji:j.emoji,header:j.header,setext:j.setext,hr:j.hr,taskList:j.taskList,list:j.list,listStack:j.listStack.slice(0),quote:j.quote,indentedCode:j.indentedCode,trailingSpace:j.trailingSpace,trailingSpaceNewLine:j.trailingSpaceNewLine,md_inside:j.md_inside,fencedEndRE:j.fencedEndRE}},token:function(j,O){if(O.formatting=!1,j!=O.thisLine.stream){if(O.header=0,O.hr=!1,j.match(/^\s*$/,!0))return C(O),null;if(O.prevLine=O.thisLine,O.thisLine={stream:j},O.taskList=!1,O.trailingSpace=0,O.trailingSpaceNewLine=!1,!O.localState&&(O.f=O.block,O.f!=w)){var K=j.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(O.indentation=K,O.indentationDiff=null,K>0)return null}}return O.f(j,O)},innerMode:function(j){return j.block==w?{state:j.htmlState,mode:B}:j.localState?{state:j.localState,mode:j.localMode}:{state:j,mode:W}},indent:function(j,O,K){return j.block==w&&B.indent?B.indent(j.htmlState,O,K):j.localState&&j.localMode.indent?j.localMode.indent(j.localState,O,K):Q.Pass},blankLine:C,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return W},"xml"),Q.defineMIME("text/markdown","markdown"),Q.defineMIME("text/x-markdown","markdown")})},mOS8:function(zt,Ke,M){zt.exports=M.p+"static/403Qrcode.6c17b6f4.png"},mgmH:function(zt,Ke,M){"use strict";M.d(Ke,"d",function(){return h}),M.d(Ke,"b",function(){return d}),M.d(Ke,"e",function(){return o}),M.d(Ke,"c",function(){return a}),M.d(Ke,"n",function(){return u}),M.d(Ke,"g",function(){return s}),M.d(Ke,"h",function(){return i}),M.d(Ke,"j",function(){return S}),M.d(Ke,"a",function(){return C}),M.d(Ke,"l",function(){return x}),M.d(Ke,"f",function(){return w}),M.d(Ke,"k",function(){return T}),M.d(Ke,"m",function(){return _}),M.d(Ke,"i",function(){return y}),M.d(Ke,"o",function(){return f}),M.d(Ke,"t",function(){return c}),M.d(Ke,"s",function(){return v}),M.d(Ke,"p",function(){return p}),M.d(Ke,"q",function(){return E}),M.d(Ke,"r",function(){return k}),M.d(Ke,"v",function(){return U}),M.d(Ke,"u",function(){return H});var Q=M("miYZ"),z=M("tsqr"),I=M("k1fw"),B=M("9og8"),R=M("WmNS"),P=M.n(R),F=M("oUNq"),D=M("9kvl"),L=M("1vsH"),A=M("m3rI"),b=function(){Object(D.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},m=function(){Object(D.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},h=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return b(),ee.next=3,Object(F.t)(Object(I.a)({},O));case 3:if(K=ee.sent,!(K.status===0)){ee.next=7;break}return ee.next=7,Object(L.w)("",Object(L.ab)({url:A.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/export_couser_info.json"),query:O}));case 7:m();case 8:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),d=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(F.r)(Object(I.a)({},O));case 2:if(K=ee.sent,!(K.status===0)){ee.next=8;break}z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_member_act_score")),ee.next=13;break;case 8:if(!(K.status===-2)){ee.next=12;break}return ee.abrupt("return",K);case 12:K.status===-3&&(Object(D.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),o=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(F.u)(Object(I.a)({},O));case 2:if(K=ee.sent,!(K.status===0)){ee.next=8;break}z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_score")),ee.next=13;break;case 8:if(!(K.status===-2)){ee.next=12;break}return ee.abrupt("return",K);case 12:K.status===-3&&(Object(D.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_score")));case 13:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),a=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(F.s)(Object(I.a)({},O));case 2:if(K=ee.sent,!(K.status===0)){ee.next=8;break}z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")),ee.next=13;break;case 8:if(!(K.status===-2)){ee.next=12;break}return ee.abrupt("return",K);case 12:K.status===-3&&(Object(D.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),u=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(F.z)(Object(I.a)({},O));case 2:if(K=ee.sent,!(K.status===0)){ee.next=8;break}z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")),ee.next=13;break;case 8:if(!(K.status===-2)){ee.next=12;break}return ee.abrupt("return",K);case 12:K.status===-3&&(Object(D.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),s=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(F.v)(Object(I.a)({},O));case 2:if(K=ee.sent,!(K.status===0)){ee.next=8;break}z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_homework")),ee.next=13;break;case 8:if(!(K.status===-2)){ee.next=12;break}return ee.abrupt("return",K);case 12:K.status===-3&&(Object(D.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),i=function(){var W=Object(B.a)(P.a.mark(function j(O,K){var Y;return P.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:return se.next=2,Object(F.x)(Object(I.a)({},O));case 2:Y=se.sent,Y.status===0?(z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/").concat(K))):Y.status===-3&&(Object(D.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/").concat(K)));case 4:case"end":return se.stop()}},j)}));return function(O,K){return W.apply(this,arguments)}}(),n=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return b(),ee.next=3,Object(F.w)(Object(I.a)({},O));case 3:if(K=ee.sent,!(K.status===0)){ee.next=7;break}return ee.next=7,Object(L.w)("",Object(L.ab)({url:A.a.API_SERVER+"/api/homework_commons/".concat(O.categoryId,"/works_list.zip"),query:O}));case 7:m();case 8:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),S=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return b(),ee.next=3,Object(F.A)(Object(I.a)({},O));case 3:if(K=ee.sent,!(K.status===0)){ee.next=7;break}return ee.next=7,Object(L.w)("",Object(L.ab)({url:A.a.API_SERVER+"/api/polls/".concat(O.categoryId,"/commit_result.xlsx"),query:O}));case 7:m();case 8:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),C=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/attendances/export_xlsx_data.xlsx"),query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),x=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/video_study_statics.xlsx"),query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),w=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/export_course_students_info.xlsx"),query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),T=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/item_banks/export.xlsx",query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),_=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),y=function(){var W=Object(B.a)(P.a.mark(function j(O){var K;return P.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(F.y)(Object(I.a)({},O));case 2:K=ee.sent,K.status===0?(z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/exercise_score"))):K.status===-3&&(Object(D.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),D.d.push("/classrooms/".concat(O.coursesId,"/exportlist/exercise_score")));case 4:case"end":return ee.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),f=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Y.next=3,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/export_records/".concat(O.id,".xlsx"),query:O}));case 3:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),c=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),v=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_training_objectives.xlsx"),query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),p=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)(O==null?void 0:O.name,Object(L.ab)({url:A.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),E=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_courses.xlsx"),query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),k=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_graduation_requirements.xlsx"),query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),U=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/courses/rank_list.xlsx",query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}(),H=function(){var W=Object(B.a)(P.a.mark(function j(O){return P.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(L.v)("",Object(L.ab)({url:A.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:O}));case 2:case"end":return Y.stop()}},j)}));return function(O){return W.apply(this,arguments)}}()},n6Qo:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return D});var Q=M("cDcd"),z=M("biw7"),I=M("fyJ8");function B(L){var A=L.className,b=L.index,m=L.children,h=L.colSpan,d=L.rowSpan,o=Q.useContext(z.a),a=o.prefixCls,u=o.fixedInfoList,s=u[b];return Q.createElement(I.a,Object.assign({className:A,index:b,component:"td",prefixCls:a,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:h,rowSpan:d}}}},s))}function R(L){return Q.createElement("tr",Object.assign({},L))}function P(L){var A=L.children,b=Q.useContext(z.a),m=b.prefixCls;return Q.createElement("tfoot",{className:"".concat(m,"-summary")},A)}var F=Ke.b=P,D={Cell:B,Row:R}},nPLb:function(zt,Ke,M){"use strict";var Q=M("2qtc"),z=M("kLXV"),I=M("g9YV"),B=M("wCAj"),R=M("5NDa"),P=M("5rEg"),F=M("14J3"),D=M("BMrR"),L=M("iQDF"),A=M("+eQT"),b=M("miYZ"),m=M("tsqr"),h=M("jrin"),d=M("oBTY"),o=M("k1fw"),a=M("9og8"),u=M("y8nQ"),s=M("Vl3Y"),i=M("tJVT"),n=M("PpiC"),S=M("WmNS"),C=M.n(S),x=M("cDcd"),w=M.n(x),T=M("wd/R"),_=M.n(T),y=M("ErOA"),f=M("1vsH"),c=M("Ty5D"),v=M("9kvl"),p=M("oUNq"),E=M("xKgJ"),k=M("eozf"),U=function(W){var j=W.classroomList,O=W.dispatch,K=W.courseEndTime,Y=Object(n.a)(W,["classroomList","dispatch","courseEndTime"]),ee=Object(c.i)(),se=s.a.useForm(),Be=Object(i.a)(se,1),me=Be[0],xe=Object(x.useState)(1),Le=Object(i.a)(xe,2),Ae=Le[0],le=Le[1],fe=Object(x.useState)([]),Ve=Object(i.a)(fe,2),Lt=Ve[0],Pt=Ve[1],vt=Object(x.useState)(0),Fe=Object(i.a)(vt,2),_t=Fe[0],tt=Fe[1],Rt=Object(x.useState)(2e4),Ge=Object(i.a)(Rt,2),Ft=Ge[0],wt=Ge[1],yt=Object(x.useState)(!0),bn=Object(i.a)(yt,2),un=bn[0],sn=bn[1],Ye=Object(x.useState)(),nn=Object(i.a)(Ye,2),An=nn[0],ke=nn[1],Pe=Object(x.useState)([]),rt=Object(i.a)(Pe,2),ht=rt[0],Ue=rt[1];ee.id=ee.coursesId,Object(x.useEffect)(function(){j.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?ut():(Ue([]),Pt([]))},[j.actionTabs.key]);var ut=function(){var J=Object(a.a)(C.a.mark(function Z(re){var ue,de,Ne;return C.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return sn(!0),Gt.next=3,Object(p.B)(Object(o.a)(Object(o.a)({},ee),{},{page:re||Ae,limit:Ft,homework_id:j.actionTabs.type===1?"":j.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:ue=Gt.sent,ue==null||ue.course_groups.map(function(an){an.key=an.id}),ue&&(Pt([].concat(Object(d.a)(Lt),Object(d.a)(ue==null?void 0:ue.course_groups))),tt(ue==null?void 0:ue.group_count),ke(ue==null?void 0:ue.course_groups),sn(!1),re||me.setFieldsValue((Ne={},Object(h.a)(Ne,"group_ids",ue==null||((de=ue.course_groups)===null||de===void 0)?void 0:de.map(function(an){return String(an.id)})),Object(h.a)(Ne,"end_time",_()(_()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Ne)));case 6:case"end":return Gt.stop()}},Z)}));return function(re){return J.apply(this,arguments)}}(),Ee=function(){var J=Object(a.a)(C.a.mark(function Z(){var re,ue,de,Ne,ct;return C.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(ue=Object(o.a)({},me.getFieldsValue()),console.log("----",ue.group_ids),ue!=null&&(re=ue.group_ids)!==null&&re!==void 0&&re.length){an.next=5;break}return m.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),an.abrupt("return");case 5:return an.next=7,Object(y.a)("/api/courses/".concat(ee.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(d.a)(j.actionTabs.selectArrs),group_ids:(ht==null?void 0:ht.length)>0?ht:[],unified_setting:!(Lt!=null&&Lt.length),end_time:_()(ue.end_time).format("YYYY-MM-DD HH:mm")}});case 7:de=an.sent,de.status===0&&(ce(),Object(f.eb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),m.b.success("\u64CD\u4F5C\u6210\u529F"),O({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Y.onCallback&&Y.onCallback(),Object(E.c)()?(O({type:"classroomList/setActionTabs",payload:{}}),(j==null||((Ne=j.actionTabs)===null||Ne===void 0||((ct=Ne.selectArrsAll)===null||ct===void 0))?void 0:ct.length)>0?O({type:"classroomList/getClassroomTeacherCommonList",payload:Object(o.a)(Object(o.a)({},j.actionTabs.params),{},{type:5})}):O({type:"shixunHomeworks/getWorkList",payload:Object(o.a)({},ee)})):O({type:"classroomList/getClassroomCommonList",payload:Object(o.a)({},j.actionTabs.params)}));case 9:case"end":return an.stop()}},Z)}));return function(){return J.apply(this,arguments)}}(),ce=function(){le(1),Pt([])},he=j.detailCommonHomeworksList;return w.a.createElement(z.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:j.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:Ee,onCancel:function(){ce(),O({type:"classroomList/setActionTabs",payload:{}})}},w.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",w.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),Lt&&w.a.createElement(s.a,{form:me},w.a.createElement(D.a,null,w.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),w.a.createElement(s.a.Item,{name:"end_time"},w.a.createElement(A.a,{style:{width:170},getPopupContainer:function(Z){return Z.parentNode},disabledDate:function(Z){return Object(k.b)(Z,K)},disabledTime:function(Z){return Object(k.c)(Z)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(f.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(An==null?void 0:An.length)>0&&w.a.createElement(D.a,null,w.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),w.a.createElement(P.a.Search,{style:{width:"300px"},onChange:function(Z){Pt(An.filter(function(re){return re.name.indexOf(Z.target.value)>-1}))}})),(Lt==null?void 0:Lt.length)>0&&j.actionTabs.type===1&&w.a.createElement(B.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Z,re){Ue(Z)}},rowKey:"id",pagination:!1,dataSource:Lt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(Lt==null?void 0:Lt.length)>0&&j.actionTabs.type===2&&w.a.createElement(B.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Z,re){Ue(Z)}},rowKey:"id",pagination:!1,dataSource:Lt,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"}]})))};Ke.a=Object(v.a)(function(H){var W=H.classroomList;return{classroomList:W}})(U)},oOBs:function(zt,Ke,M){zt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return $n});var Q=M("1OyB"),z=M("vuIU"),I=M("Ji7U"),B=M("LK+K"),R=M("rePB"),P=M("VTBJ"),F=M("ODXe"),D=M("cDcd"),L=M("TSYQ"),A=M.n(L),b=M("Kwbf"),m=M("6cGi"),h=M("U8pU"),d=M("4IlW"),o=D.createContext({}),a=o,u={visibility:"hidden"};function s(V){var ae=V.prefixCls,ge=V.prevIcon,ve=ge===void 0?"\u2039":ge,Xe=V.nextIcon,Re=Xe===void 0?"\u203A":Xe,ze=V.superPrevIcon,lt=ze===void 0?"\xAB":ze,At=V.superNextIcon,Dt=At===void 0?"\xBB":At,Ie=V.onSuperPrev,ft=V.onSuperNext,$e=V.onPrev,Ze=V.onNext,dt=V.children,Tt=D.useContext(a),at=Tt.hideNextBtn,Ut=Tt.hidePrevBtn;return D.createElement("div",{className:ae},Ie&&D.createElement("button",{type:"button",onClick:Ie,tabIndex:-1,className:"".concat(ae,"-super-prev-btn"),style:Ut?u:{}},lt),$e&&D.createElement("button",{type:"button",onClick:$e,tabIndex:-1,className:"".concat(ae,"-prev-btn"),style:Ut?u:{}},ve),D.createElement("div",{className:"".concat(ae,"-view")},dt),Ze&&D.createElement("button",{type:"button",onClick:Ze,tabIndex:-1,className:"".concat(ae,"-next-btn"),style:at?u:{}},Re),ft&&D.createElement("button",{type:"button",onClick:ft,tabIndex:-1,className:"".concat(ae,"-super-next-btn"),style:at?u:{}},Dt))}var i=s;function n(V){var ae=D.useContext(a),ge=ae.hideHeader;if(ge)return null;var ve=V.prefixCls,Xe=V.generateConfig,Re=V.locale,ze=V.value,lt=V.format,At="".concat(ve,"-header");return D.createElement(i,{prefixCls:At},ze?Xe.locale.format(Re.locale,ze,lt):"\xA0")}var S=n,C=M("YrtM"),x=M("KQm4"),w=new Map;function T(V,ae,ge){if(w.get(V)&&cancelAnimationFrame(w.get(V)),ge<=0){w.set(V,requestAnimationFrame(function(){V.scrollTop=ae}));return}var ve=ae-V.scrollTop,Xe=ve/ge*10;w.set(V,requestAnimationFrame(function(){V.scrollTop+=Xe,V.scrollTop!==ae&&T(V,ae,ge-10)}))}function _(V,ae){var ge=ae.onLeftRight,ve=ae.onCtrlLeftRight,Xe=ae.onUpDown,Re=ae.onPageUpDown,ze=ae.onEnter,lt=V.which,At=V.ctrlKey,Dt=V.metaKey;switch(lt){case d.a.LEFT:if(At||Dt){if(ve)return ve(-1),!0}else if(ge)return ge(-1),!0;break;case d.a.RIGHT:if(At||Dt){if(ve)return ve(1),!0}else if(ge)return ge(1),!0;break;case d.a.UP:if(Xe)return Xe(-1),!0;break;case d.a.DOWN:if(Xe)return Xe(1),!0;break;case d.a.PAGE_UP:if(Re)return Re(-1),!0;break;case d.a.PAGE_DOWN:if(Re)return Re(1),!0;break;case d.a.ENTER:if(ze)return ze(),!0;break}return!1}function y(V,ae,ge,ve){var Xe=V;if(!Xe)switch(ae){case"time":Xe=ve?"hh:mm:ss a":"HH:mm:ss";break;case"week":Xe="gggg-wo";break;case"month":Xe="YYYY-MM";break;case"quarter":Xe="YYYY-[Q]Q";break;case"year":Xe="YYYY";break;default:Xe=ge?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return Xe}function f(V,ae){var ge=V==="time"?8:10;return Math.max(ge,ae.length)+2}var c=null,v=new Set;function p(V){return!c&&typeof window!="undefined"&&window.addEventListener&&(c=function(ge){Object(x.a)(v).forEach(function(ve){ve(ge)})},window.addEventListener("mousedown",c)),v.add(V),function(){v.delete(V),v.size===0&&(window.removeEventListener("mousedown",c),c=null)}}var E=function(ae){return ae==="month"||ae==="date"?"year":ae},k=function(ae){return ae==="date"?"month":ae},U=function(ae){return ae==="month"||ae==="date"?"quarter":ae},H=function(ae){return ae==="date"?"week":ae},W={year:E,month:k,quarter:U,week:H,time:null,date:null};function j(V,ae){return V.some(function(ge){return ge&&ge.contains(ae)})}function O(V){var ae=V.prefixCls,ge=V.units,ve=V.onSelect,Xe=V.value,Re=V.active,ze=V.hideDisabledOptions,lt="".concat(ae,"-cell"),At=D.useContext(a),Dt=At.open,Ie=D.useRef(null),ft=D.useRef(new Map);return D.useLayoutEffect(function(){var $e=ft.current.get(Xe);$e&&Dt!==!1&&T(Ie.current,$e.offsetTop,120)},[Xe]),D.useLayoutEffect(function(){if(Dt){var $e=ft.current.get(Xe);$e&&T(Ie.current,$e.offsetTop,0)}},[Dt]),D.createElement("ul",{className:A()("".concat(ae,"-column"),Object(R.a)({},"".concat(ae,"-column-active"),Re)),ref:Ie,style:{position:"relative"}},ge.map(function($e){var Ze;return ze&&$e.disabled?null:D.createElement("li",{key:$e.value,ref:function(Tt){ft.current.set($e.value,Tt)},className:A()(lt,(Ze={},Object(R.a)(Ze,"".concat(lt,"-disabled"),$e.disabled),Object(R.a)(Ze,"".concat(lt,"-selected"),Xe===$e.value),Ze)),onClick:function(){if($e.disabled)return;ve($e.value)}},D.createElement("div",{className:"".concat(lt,"-inner")},$e.label))}))}var K=O;function Y(V,ae){for(var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",ve=String(V);ve.length<ae;)ve="".concat(ge).concat(V);return ve}var ee=function(){for(var ae=arguments.length,ge=new Array(ae),ve=0;ve<ae;ve++)ge[ve]=arguments[ve];return ge};function se(V){return V==null?[]:Array.isArray(V)?V:[V]}function Be(V){var ae={};return Object.keys(V).forEach(function(ge){(ge.substr(0,5)==="data-"||ge.substr(0,5)==="aria-"||ge==="role"||ge==="name")&&ge.substr(0,7)!=="data-__"&&(ae[ge]=V[ge])}),ae}function me(V,ae){return V?V[ae]:null}function xe(V,ae,ge){var ve=[me(V,0),me(V,1)];return ve[ge]=typeof ae=="function"?ae(ve[ge]):ae,!ve[0]&&!ve[1]?null:ve}function Le(V,ae,ge,ve,Xe){var Re=V.setHour(ae,ge);return Re=V.setMinute(Re,ve),Re=V.setSecond(Re,Xe),Re}function Ae(V,ae,ge,ve,Xe,Re){var ze=Math.floor(V/ve)*ve;if(ze<V)return[ze,60-Xe,60-Re];var lt=Math.floor(ae/Xe)*Xe;if(lt<ae)return[ze,lt,60-Re];var At=Math.floor(ge/Re)*Re;return[ze,lt,At]}function le(V,ae){if(V.length!==ae.length)return!0;for(var ge=0;ge<V.length;ge+=1)if(V[ge].disabled!==ae[ge].disabled)return!0;return!1}function fe(V,ae,ge,ve){for(var Xe=[],Re=V;Re<=ae;Re+=ge)Xe.push({label:Y(Re,2),value:Re,disabled:(ve||[]).includes(Re)});return Xe}function Ve(V){var ae=V.generateConfig,ge=V.prefixCls,ve=V.operationRef,Xe=V.activeColumnIndex,Re=V.value,ze=V.showHour,lt=V.showMinute,At=V.showSecond,Dt=V.use12Hours,Ie=V.hourStep,ft=Ie===void 0?1:Ie,$e=V.minuteStep,Ze=$e===void 0?1:$e,dt=V.secondStep,Tt=dt===void 0?1:dt,at=V.disabledHours,Ut=V.disabledMinutes,Yt=V.disabledSeconds,yn=V.hideDisabledOptions,In=V.onSelect,mn=[],Cn="".concat(ge,"-content"),xn="".concat(ge,"-time-panel"),Et,Xt=Re?ae.getHour(Re):-1,Mt=Re?ae.getMinute(Re):-1,gt=Re?ae.getSecond(Re):-1,Sn=function(hn,bt,He,Ct){var xt=Re||ae.getNow(),Vt=Math.max(0,bt),kn=Math.max(0,He),On=Math.max(0,Ct);return xt=Le(ae,xt,!Dt||!hn?Vt:Vt+12,kn,On),xt},gn=fe(0,23,ft,at&&at()),Nt=Object(C.a)(function(){return gn},gn,le);Dt&&(Et=Xt>=12,Xt%=12);var et=D.useMemo(function(){if(!Dt)return[!1,!1];var _n=[!0,!0];return Nt.forEach(function(hn){var bt=hn.disabled,He=hn.value;if(bt)return;He>=12?_n[1]=!1:_n[0]=!1}),_n},[Dt,Nt]),Rn=Object(F.a)(et,2),$t=Rn[0],Bn=Rn[1],jt=D.useMemo(function(){return Dt?Nt.filter(Et?function(_n){return _n.value>=12}:function(_n){return _n.value<12}).map(function(_n){var hn=_n.value%12,bt=hn===0?"12":Y(hn,2);return Object(P.a)(Object(P.a)({},_n),{},{label:bt,value:hn})}):Nt},[Dt,Nt]),vn=fe(0,59,Ze,Ut&&Ut(Xt)),Dn=fe(0,59,Tt,Yt&&Yt(Xt,Mt));ve.current={onUpDown:function(hn){var bt=mn[Xe];if(bt)for(var He=bt.units.findIndex(function(kn){return kn.value===bt.value}),Ct=bt.units.length,xt=1;xt<Ct;xt+=1){var Vt=bt.units[(He+hn*xt+Ct)%Ct];if(Vt.disabled!==!0){bt.onSelect(Vt.value);break}}}};function tn(_n,hn,bt,He,Ct){_n!==!1&&mn.push({node:D.cloneElement(hn,{prefixCls:xn,value:bt,active:Xe===mn.length,onSelect:Ct,units:He,hideDisabledOptions:yn}),onSelect:Ct,value:bt,units:He})}tn(ze,D.createElement(K,{key:"hour"}),Xt,jt,function(_n){In(Sn(Et,_n,Mt,gt),"mouse")}),tn(lt,D.createElement(K,{key:"minute"}),Mt,vn,function(_n){In(Sn(Et,Xt,_n,gt),"mouse")}),tn(At,D.createElement(K,{key:"second"}),gt,Dn,function(_n){In(Sn(Et,Xt,Mt,_n),"mouse")});var oa=-1;return typeof Et=="boolean"&&(oa=Et?1:0),tn(Dt===!0,D.createElement(K,{key:"12hours"}),oa,[{label:"AM",value:0,disabled:$t},{label:"PM",value:1,disabled:Bn}],function(_n){In(Sn(!!_n,Xt,Mt,gt),"mouse")}),D.createElement("div",{className:Cn},mn.map(function(_n){var hn=_n.node;return hn}))}var Lt=Ve,Pt=function(ae){return ae.filter(function(ge){return ge!==!1}).length};function vt(V){var ae=V.generateConfig,ge=V.format,ve=ge===void 0?"HH:mm:ss":ge,Xe=V.prefixCls,Re=V.active,ze=V.operationRef,lt=V.showHour,At=V.showMinute,Dt=V.showSecond,Ie=V.use12Hours,ft=Ie===void 0?!1:Ie,$e=V.onSelect,Ze=V.value,dt="".concat(Xe,"-time-panel"),Tt=D.useRef(),at=D.useState(-1),Ut=Object(F.a)(at,2),Yt=Ut[0],yn=Ut[1],In=Pt([lt,At,Dt,ft]);return ze.current={onKeyDown:function(Cn){return _(Cn,{onLeftRight:function(Et){yn((Yt+Et+In)%In)},onUpDown:function(Et){Yt===-1?yn(0):Tt.current&&Tt.current.onUpDown(Et)},onEnter:function(){$e(Ze||ae.getNow(),"key"),yn(-1)}})},onBlur:function(){yn(-1)}},D.createElement("div",{className:A()(dt,Object(R.a)({},"".concat(dt,"-active"),Re))},D.createElement(S,Object.assign({},V,{format:ve,prefixCls:Xe})),D.createElement(Lt,Object.assign({},V,{prefixCls:Xe,activeColumnIndex:Yt,operationRef:Tt})))}var Fe=vt,_t=7;function tt(V,ae){return!V&&!ae?!0:!V||!ae?!1:void 0}function Rt(V,ae,ge){var ve=tt(ae,ge);if(typeof ve=="boolean")return ve;var Xe=Math.floor(V.getYear(ae)/10),Re=Math.floor(V.getYear(ge)/10);return Xe===Re}function Ge(V,ae,ge){var ve=tt(ae,ge);return typeof ve=="boolean"?ve:V.getYear(ae)===V.getYear(ge)}function Ft(V,ae){var ge=Math.floor(V.getMonth(ae)/3);return ge+1}function wt(V,ae,ge){var ve=tt(ae,ge);return typeof ve=="boolean"?ve:Ge(V,ae,ge)&&Ft(V,ae)===Ft(V,ge)}function yt(V,ae,ge){var ve=tt(ae,ge);return typeof ve=="boolean"?ve:Ge(V,ae,ge)&&V.getMonth(ae)===V.getMonth(ge)}function bn(V,ae,ge){var ve=tt(ae,ge);return typeof ve=="boolean"?ve:V.getYear(ae)===V.getYear(ge)&&V.getMonth(ae)===V.getMonth(ge)&&V.getDate(ae)===V.getDate(ge)}function un(V,ae,ge){var ve=tt(ae,ge);return typeof ve=="boolean"?ve:V.getHour(ae)===V.getHour(ge)&&V.getMinute(ae)===V.getMinute(ge)&&V.getSecond(ae)===V.getSecond(ge)}function sn(V,ae,ge,ve){var Xe=tt(ge,ve);return typeof Xe=="boolean"?Xe:V.locale.getWeek(ae,ge)===V.locale.getWeek(ae,ve)}function Ye(V,ae,ge){return bn(V,ae,ge)&&un(V,ae,ge)}function nn(V,ae,ge,ve){return!ae||!ge||!ve?!1:!bn(V,ae,ve)&&!bn(V,ge,ve)&&V.isAfter(ve,ae)&&V.isAfter(ge,ve)}function An(V,ae,ge){var ve=ae.locale.getWeekFirstDay(V),Xe=ae.setDate(ge,1),Re=ae.getWeekDay(Xe),ze=ae.addDate(Xe,ve-Re);return ae.getMonth(ze)===ae.getMonth(ge)&&ae.getDate(ze)>1&&(ze=ae.addDate(ze,-7)),ze}function ke(V,ae,ge){var ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ae){case"year":return ge.addYear(V,ve*10);case"quarter":case"month":return ge.addYear(V,ve);default:return ge.addMonth(V,ve)}}var Pe=D.createContext({}),rt=Pe;function ht(V){var ae=V.cellPrefixCls,ge=V.generateConfig,ve=V.rangedValue,Xe=V.hoverRangedValue,Re=V.isInView,ze=V.isSameCell,lt=V.offsetCell,At=V.today,Dt=V.value;function Ie(ft){var $e,Ze=lt(ft,-1),dt=lt(ft,1),Tt=me(ve,0),at=me(ve,1),Ut=me(Xe,0),Yt=me(Xe,1),yn=nn(ge,Ut,Yt,ft);function In(Mt){return ze(Tt,Mt)}function mn(Mt){return ze(at,Mt)}var Cn=ze(Ut,ft),xn=ze(Yt,ft),Et=(yn||xn)&&(!Re(Ze)||mn(Ze)),Xt=(yn||Cn)&&(!Re(dt)||In(dt));return $e={},Object(R.a)($e,"".concat(ae,"-in-view"),Re(ft)),Object(R.a)($e,"".concat(ae,"-in-range"),nn(ge,Tt,at,ft)),Object(R.a)($e,"".concat(ae,"-range-start"),In(ft)),Object(R.a)($e,"".concat(ae,"-range-end"),mn(ft)),Object(R.a)($e,"".concat(ae,"-range-start-single"),In(ft)&&!at),Object(R.a)($e,"".concat(ae,"-range-end-single"),mn(ft)&&!Tt),Object(R.a)($e,"".concat(ae,"-range-start-near-hover"),In(ft)&&(ze(Ze,Ut)||nn(ge,Ut,Yt,Ze))),Object(R.a)($e,"".concat(ae,"-range-end-near-hover"),mn(ft)&&(ze(dt,Yt)||nn(ge,Ut,Yt,dt))),Object(R.a)($e,"".concat(ae,"-range-hover"),yn),Object(R.a)($e,"".concat(ae,"-range-hover-start"),Cn),Object(R.a)($e,"".concat(ae,"-range-hover-end"),xn),Object(R.a)($e,"".concat(ae,"-range-hover-edge-start"),Et),Object(R.a)($e,"".concat(ae,"-range-hover-edge-end"),Xt),Object(R.a)($e,"".concat(ae,"-range-hover-edge-start-near-range"),Et&&ze(Ze,at)),Object(R.a)($e,"".concat(ae,"-range-hover-edge-end-near-range"),Xt&&ze(dt,Tt)),Object(R.a)($e,"".concat(ae,"-today"),ze(At,ft)),Object(R.a)($e,"".concat(ae,"-selected"),ze(Dt,ft)),$e}return Ie}function Ue(V){for(var ae=V.prefixCls,ge=V.disabledDate,ve=V.onSelect,Xe=V.rowNum,Re=V.colNum,ze=V.prefixColumn,lt=V.rowClassName,At=V.baseDate,Dt=V.getCellClassName,Ie=V.getCellText,ft=V.getCellNode,$e=V.getCellDate,Ze=V.titleCell,dt=V.headerCells,Tt=D.useContext(a),at=Tt.onDateMouseEnter,Ut=Tt.onDateMouseLeave,Yt="".concat(ae,"-cell"),yn=[],In=0;In<Xe;In+=1){for(var mn=[],Cn=void 0,xn=function(Mt){var gt=In*Re+Mt,Sn=$e(At,gt),gn=ge&&ge(Sn);Mt===0&&(Cn=Sn,ze&&mn.push(ze(Cn))),mn.push(D.createElement("td",{key:Mt,title:Ze&&Ze(Sn),className:A()(Yt,Object(P.a)(Object(R.a)({},"".concat(Yt,"-disabled"),gn),Dt(Sn))),onClick:function(){gn||ve(Sn)},onMouseEnter:function(){!gn&&at&&at(Sn)},onMouseLeave:function(){!gn&&Ut&&Ut(Sn)}},ft?ft(Sn):D.createElement("div",{className:"".concat(Yt,"-inner")},Ie(Sn))))},Et=0;Et<Re;Et+=1)xn(Et);yn.push(D.createElement("tr",{key:In,className:lt&<(Cn)},mn))}return D.createElement("div",{className:"".concat(ae,"-body")},D.createElement("table",{className:"".concat(ae,"-content")},dt&&D.createElement("thead",null,D.createElement("tr",null,dt)),D.createElement("tbody",null,yn)))}function ut(V){var ae=V.prefixCls,ge=V.generateConfig,ve=V.prefixColumn,Xe=V.locale,Re=V.rowCount,ze=V.viewDate,lt=V.value,At=V.dateRender,Dt=D.useContext(rt),Ie=Dt.rangedValue,ft=Dt.hoverRangedValue,$e=An(Xe.locale,ge,ze),Ze="".concat(ae,"-cell"),dt=ge.locale.getWeekFirstDay(Xe.locale),Tt=ge.getNow(),at=[],Ut=Xe.shortWeekDays||(ge.locale.getShortWeekDays?ge.locale.getShortWeekDays(Xe.locale):[]);ve&&at.push(D.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var Yt=0;Yt<_t;Yt+=1)at.push(D.createElement("th",{key:Yt},Ut[(Yt+dt)%_t]));var yn=ht({cellPrefixCls:Ze,today:Tt,value:lt,generateConfig:ge,rangedValue:ve?null:Ie,hoverRangedValue:ve?null:ft,isSameCell:function(Cn,xn){return bn(ge,Cn,xn)},isInView:function(Cn){return yt(ge,Cn,ze)},offsetCell:function(Cn,xn){return ge.addDate(Cn,xn)}}),In=At?function(mn){return At(mn,Tt)}:void 0;return D.createElement(Ue,Object.assign({},V,{rowNum:Re,colNum:_t,baseDate:$e,getCellNode:In,getCellText:ge.getDate,getCellClassName:yn,getCellDate:ge.addDate,titleCell:function(Cn){return ge.locale.format(Xe.locale,Cn,"YYYY-MM-DD")},headerCells:at}))}var Ee=ut;function ce(V){var ae=V.prefixCls,ge=V.generateConfig,ve=V.locale,Xe=V.viewDate,Re=V.onNextMonth,ze=V.onPrevMonth,lt=V.onNextYear,At=V.onPrevYear,Dt=V.onYearClick,Ie=V.onMonthClick,ft=D.useContext(a),$e=ft.hideHeader;if($e)return null;var Ze="".concat(ae,"-header"),dt=ve.shortMonths||(ge.locale.getShortMonths?ge.locale.getShortMonths(ve.locale):[]),Tt=ge.getMonth(Xe),at=D.createElement("button",{type:"button",key:"year",onClick:Dt,tabIndex:-1,className:"".concat(ae,"-year-btn")},ge.locale.format(ve.locale,Xe,ve.yearFormat)),Ut=D.createElement("button",{type:"button",key:"month",onClick:Ie,tabIndex:-1,className:"".concat(ae,"-month-btn")},ve.monthFormat?ge.locale.format(ve.locale,Xe,ve.monthFormat):dt[Tt]),Yt=ve.monthBeforeYear?[Ut,at]:[at,Ut];return D.createElement(i,Object.assign({},V,{prefixCls:Ze,onSuperPrev:At,onPrev:ze,onNext:Re,onSuperNext:lt}),Yt)}var he=ce,J=6;function Z(V){var ae=V.prefixCls,ge=V.panelName,ve=ge===void 0?"date":ge,Xe=V.keyboardConfig,Re=V.active,ze=V.operationRef,lt=V.generateConfig,At=V.value,Dt=V.viewDate,Ie=V.onViewDateChange,ft=V.onPanelChange,$e=V.onSelect,Ze="".concat(ae,"-").concat(ve,"-panel");ze.current={onKeyDown:function(Ut){return _(Ut,Object(P.a)({onLeftRight:function(yn){$e(lt.addDate(At||Dt,yn),"key")},onCtrlLeftRight:function(yn){$e(lt.addYear(At||Dt,yn),"key")},onUpDown:function(yn){$e(lt.addDate(At||Dt,yn*_t),"key")},onPageUpDown:function(yn){$e(lt.addMonth(At||Dt,yn),"key")}},Xe))}};var dt=function(Ut){var Yt=lt.addYear(Dt,Ut);Ie(Yt),ft(null,Yt)},Tt=function(Ut){var Yt=lt.addMonth(Dt,Ut);Ie(Yt),ft(null,Yt)};return D.createElement("div",{className:A()(Ze,Object(R.a)({},"".concat(Ze,"-active"),Re))},D.createElement(he,Object.assign({},V,{prefixCls:ae,value:At,viewDate:Dt,onPrevYear:function(){dt(-1)},onNextYear:function(){dt(1)},onPrevMonth:function(){Tt(-1)},onNextMonth:function(){Tt(1)},onMonthClick:function(){ft("month",Dt)},onYearClick:function(){ft("year",Dt)}})),D.createElement(Ee,Object.assign({},V,{onSelect:function(Ut){return $e(Ut,"mouse")},prefixCls:ae,value:At,viewDate:Dt,rowCount:J})))}var re=Z;function ue(V,ae,ge){if(!ge)return ae;var ve=ae;return ve=V.setHour(ve,V.getHour(ge)),ve=V.setMinute(ve,V.getMinute(ge)),ve=V.setSecond(ve,V.getSecond(ge)),ve}var de=ee("date","time");function Ne(V){var ae=V.prefixCls,ge=V.operationRef,ve=V.generateConfig,Xe=V.value,Re=V.defaultValue,ze=V.disabledTime,lt=V.showTime,At=V.onSelect,Dt="".concat(ae,"-datetime-panel"),Ie=D.useState(null),ft=Object(F.a)(Ie,2),$e=ft[0],Ze=ft[1],dt=D.useRef({}),Tt=D.useRef({}),at=Object(h.a)(lt)==="object"?Object(P.a)({},lt):{};function Ut(mn){var Cn=de.indexOf($e)+mn,xn=de[Cn]||null;return xn}var Yt=function(Cn){Tt.current.onBlur&&Tt.current.onBlur(Cn),Ze(null)};ge.current={onKeyDown:function(Cn){if(Cn.which===d.a.TAB){var xn=Ut(Cn.shiftKey?-1:1);return Ze(xn),xn&&Cn.preventDefault(),!0}if($e){var Et=$e==="date"?dt:Tt;return Et.current&&Et.current.onKeyDown&&Et.current.onKeyDown(Cn),!0}return[d.a.LEFT,d.a.RIGHT,d.a.UP,d.a.DOWN].includes(Cn.which)?(Ze("date"),!0):!1},onBlur:Yt,onClose:Yt};var yn=function(Cn,xn){var Et=Cn;xn==="date"&&!Xe&&at.defaultValue?(Et=ve.setHour(Et,ve.getHour(at.defaultValue)),Et=ve.setMinute(Et,ve.getMinute(at.defaultValue)),Et=ve.setSecond(Et,ve.getSecond(at.defaultValue))):xn==="time"&&!Xe&&Re&&(Et=ve.setYear(Et,ve.getYear(Re)),Et=ve.setMonth(Et,ve.getMonth(Re)),Et=ve.setDate(Et,ve.getDate(Re))),At&&At(Et,"mouse")},In=ze?ze(Xe||null):{};return D.createElement("div",{className:A()(Dt,Object(R.a)({},"".concat(Dt,"-active"),$e))},D.createElement(re,Object.assign({},V,{operationRef:dt,active:$e==="date",onSelect:function(Cn){yn(ue(ve,Cn,lt&&Object(h.a)(lt)==="object"?lt.defaultValue:null),"date")}})),D.createElement(Fe,Object.assign({},V,{format:void 0},at,In,{defaultValue:void 0,operationRef:Tt,active:$e==="time",onSelect:function(Cn){yn(Cn,"time")}})))}var ct=Ne;function Gt(V){var ae=V.prefixCls,ge=V.generateConfig,ve=V.locale,Xe=V.value,Re="".concat(ae,"-cell"),ze=function(Ie){return D.createElement("td",{key:"week",className:A()(Re,"".concat(Re,"-week"))},ge.locale.getWeek(ve.locale,Ie))},lt="".concat(ae,"-week-panel-row"),At=function(Ie){return A()(lt,Object(R.a)({},"".concat(lt,"-selected"),sn(ge,ve.locale,Xe,Ie)))};return D.createElement(re,Object.assign({},V,{panelName:"week",prefixColumn:ze,rowClassName:At,keyboardConfig:{onLeftRight:null}}))}var an=Gt;function it(V){var ae=V.prefixCls,ge=V.generateConfig,ve=V.locale,Xe=V.viewDate,Re=V.onNextYear,ze=V.onPrevYear,lt=V.onYearClick,At=D.useContext(a),Dt=At.hideHeader;if(Dt)return null;var Ie="".concat(ae,"-header");return D.createElement(i,Object.assign({},V,{prefixCls:Ie,onSuperPrev:ze,onSuperNext:Re}),D.createElement("button",{type:"button",onClick:lt,className:"".concat(ae,"-year-btn")},ge.locale.format(ve.locale,Xe,ve.yearFormat)))}var qt=it,st=3,pt=4;function Qe(V){var ae=V.prefixCls,ge=V.locale,ve=V.value,Xe=V.viewDate,Re=V.generateConfig,ze=V.monthCellRender,lt=D.useContext(rt),At=lt.rangedValue,Dt=lt.hoverRangedValue,Ie="".concat(ae,"-cell"),ft=ht({cellPrefixCls:Ie,value:ve,generateConfig:Re,rangedValue:At,hoverRangedValue:Dt,isSameCell:function(at,Ut){return yt(Re,at,Ut)},isInView:function(){return!0},offsetCell:function(at,Ut){return Re.addMonth(at,Ut)}}),$e=ge.shortMonths||(Re.locale.getShortMonths?Re.locale.getShortMonths(ge.locale):[]),Ze=Re.setMonth(Xe,0),dt=ze?function(Tt){return ze(Tt,ge)}:void 0;return D.createElement(Ue,Object.assign({},V,{rowNum:pt,colNum:st,baseDate:Ze,getCellNode:dt,getCellText:function(at){return ge.monthFormat?Re.locale.format(ge.locale,at,ge.monthFormat):$e[Re.getMonth(at)]},getCellClassName:ft,getCellDate:Re.addMonth,titleCell:function(at){return Re.locale.format(ge.locale,at,"YYYY-MM")}}))}var ie=Qe;function be(V){var ae=V.prefixCls,ge=V.operationRef,ve=V.onViewDateChange,Xe=V.generateConfig,Re=V.value,ze=V.viewDate,lt=V.onPanelChange,At=V.onSelect,Dt="".concat(ae,"-month-panel");ge.current={onKeyDown:function($e){return _($e,{onLeftRight:function(dt){At(Xe.addMonth(Re||ze,dt),"key")},onCtrlLeftRight:function(dt){At(Xe.addYear(Re||ze,dt),"key")},onUpDown:function(dt){At(Xe.addMonth(Re||ze,dt*st),"key")},onEnter:function(){lt("date",Re||ze)}})}};var Ie=function($e){var Ze=Xe.addYear(ze,$e);ve(Ze),lt(null,Ze)};return D.createElement("div",{className:Dt},D.createElement(qt,Object.assign({},V,{prefixCls:ae,onPrevYear:function(){Ie(-1)},onNextYear:function(){Ie(1)},onYearClick:function(){lt("year",ze)}})),D.createElement(ie,Object.assign({},V,{prefixCls:ae,onSelect:function($e){At($e,"mouse"),lt("date",$e)}})))}var Ot=be;function qe(V){var ae=V.prefixCls,ge=V.generateConfig,ve=V.locale,Xe=V.viewDate,Re=V.onNextYear,ze=V.onPrevYear,lt=V.onYearClick,At=D.useContext(a),Dt=At.hideHeader;if(Dt)return null;var Ie="".concat(ae,"-header");return D.createElement(i,Object.assign({},V,{prefixCls:Ie,onSuperPrev:ze,onSuperNext:Re}),D.createElement("button",{type:"button",onClick:lt,className:"".concat(ae,"-year-btn")},ge.locale.format(ve.locale,Xe,ve.yearFormat)))}var Bt=qe,Qt=4,Ce=1;function De(V){var ae=V.prefixCls,ge=V.locale,ve=V.value,Xe=V.viewDate,Re=V.generateConfig,ze=D.useContext(rt),lt=ze.rangedValue,At=ze.hoverRangedValue,Dt="".concat(ae,"-cell"),Ie=ht({cellPrefixCls:Dt,value:ve,generateConfig:Re,rangedValue:lt,hoverRangedValue:At,isSameCell:function(Ze,dt){return wt(Re,Ze,dt)},isInView:function(){return!0},offsetCell:function(Ze,dt){return Re.addMonth(Ze,dt*3)}}),ft=Re.setDate(Re.setMonth(Xe,0),1);return D.createElement(Ue,Object.assign({},V,{rowNum:Ce,colNum:Qt,baseDate:ft,getCellText:function(Ze){return Re.locale.format(ge.locale,Ze,ge.quarterFormat||"[Q]Q")},getCellClassName:Ie,getCellDate:function(Ze,dt){return Re.addMonth(Ze,dt*3)},titleCell:function(Ze){return Re.locale.format(ge.locale,Ze,"YYYY-[Q]Q")}}))}var mt=De;function Jt(V){var ae=V.prefixCls,ge=V.operationRef,ve=V.onViewDateChange,Xe=V.generateConfig,Re=V.value,ze=V.viewDate,lt=V.onPanelChange,At=V.onSelect,Dt="".concat(ae,"-quarter-panel");ge.current={onKeyDown:function($e){return _($e,{onLeftRight:function(dt){At(Xe.addMonth(Re||ze,dt*3),"key")},onCtrlLeftRight:function(dt){At(Xe.addYear(Re||ze,dt),"key")},onUpDown:function(dt){At(Xe.addYear(Re||ze,dt),"key")}})}};var Ie=function($e){var Ze=Xe.addYear(ze,$e);ve(Ze),lt(null,Ze)};return D.createElement("div",{className:Dt},D.createElement(Bt,Object.assign({},V,{prefixCls:ae,onPrevYear:function(){Ie(-1)},onNextYear:function(){Ie(1)},onYearClick:function(){lt("year",ze)}})),D.createElement(mt,Object.assign({},V,{prefixCls:ae,onSelect:function($e){At($e,"mouse")}})))}var cn=Jt;function wn(V){var ae=V.prefixCls,ge=V.generateConfig,ve=V.viewDate,Xe=V.onPrevDecade,Re=V.onNextDecade,ze=V.onDecadeClick,lt=D.useContext(a),At=lt.hideHeader;if(At)return null;var Dt="".concat(ae,"-header"),Ie=ge.getYear(ve),ft=Math.floor(Ie/ta)*ta,$e=ft+ta-1;return D.createElement(i,Object.assign({},V,{prefixCls:Dt,onSuperPrev:Xe,onSuperNext:Re}),D.createElement("button",{type:"button",onClick:ze,className:"".concat(ae,"-decade-btn")},ft,"-",$e))}var sa=wn,zn=3,En=4;function ga(V){var ae=V.prefixCls,ge=V.value,ve=V.viewDate,Xe=V.locale,Re=V.generateConfig,ze=D.useContext(rt),lt=ze.rangedValue,At=ze.hoverRangedValue,Dt="".concat(ae,"-cell"),Ie=Re.getYear(ve),ft=Math.floor(Ie/ta)*ta,$e=ft+ta-1,Ze=Re.setYear(ve,ft-Math.ceil((zn*En-ta)/2)),dt=function(Ut){var Yt=Re.getYear(Ut);return ft<=Yt&&Yt<=$e},Tt=ht({cellPrefixCls:Dt,value:ge,generateConfig:Re,rangedValue:lt,hoverRangedValue:At,isSameCell:function(Ut,Yt){return Ge(Re,Ut,Yt)},isInView:dt,offsetCell:function(Ut,Yt){return Re.addYear(Ut,Yt)}});return D.createElement(Ue,Object.assign({},V,{rowNum:En,colNum:zn,baseDate:Ze,getCellText:Re.getYear,getCellClassName:Tt,getCellDate:Re.addYear,titleCell:function(Ut){return Re.locale.format(Xe.locale,Ut,"YYYY")}}))}var Ua=ga,ta=10;function la(V){var ae=V.prefixCls,ge=V.operationRef,ve=V.onViewDateChange,Xe=V.generateConfig,Re=V.value,ze=V.viewDate,lt=V.sourceMode,At=V.onSelect,Dt=V.onPanelChange,Ie="".concat(ae,"-year-panel");ge.current={onKeyDown:function(Ze){return _(Ze,{onLeftRight:function(Tt){At(Xe.addYear(Re||ze,Tt),"key")},onCtrlLeftRight:function(Tt){At(Xe.addYear(Re||ze,Tt*ta),"key")},onUpDown:function(Tt){At(Xe.addYear(Re||ze,Tt*zn),"key")},onEnter:function(){Dt(lt==="date"?"date":"month",Re||ze)}})}};var ft=function(Ze){var dt=Xe.addYear(ze,Ze*10);ve(dt),Dt(null,dt)};return D.createElement("div",{className:Ie},D.createElement(sa,Object.assign({},V,{prefixCls:ae,onPrevDecade:function(){ft(-1)},onNextDecade:function(){ft(1)},onDecadeClick:function(){Dt("decade",ze)}})),D.createElement(Ua,Object.assign({},V,{prefixCls:ae,onSelect:function(Ze){Dt(lt==="date"?"date":"month",Ze),At(Ze,"mouse")}})))}var Ra=la;function Xa(V){var ae=V.prefixCls,ge=V.generateConfig,ve=V.viewDate,Xe=V.onPrevDecades,Re=V.onNextDecades,ze=D.useContext(a),lt=ze.hideHeader;if(lt)return null;var At="".concat(ae,"-header"),Dt=ge.getYear(ve),Ie=Math.floor(Dt/Ga)*Ga,ft=Ie+Ga-1;return D.createElement(i,Object.assign({},V,{prefixCls:At,onSuperPrev:Xe,onSuperNext:Re}),Ie,"-",ft)}var vr=Xa,rn=3,Xn=4;function hr(V){var ae=$a-1,ge=V.prefixCls,ve=V.viewDate,Xe=V.generateConfig,Re=V.disabledDate,ze="".concat(ge,"-cell"),lt=Xe.getYear(ve),At=Math.floor(lt/$a)*$a,Dt=Math.floor(lt/Ga)*Ga,Ie=Dt+Ga-1,ft=Xe.setYear(ve,Dt-Math.ceil((rn*Xn*$a-Ga)/2)),$e=function(dt){var Tt,at=Re&&Re(dt),Ut=Xe.getYear(dt),Yt=Ut+ae;return Tt={},Object(R.a)(Tt,"".concat(ze,"-disabled"),at),Object(R.a)(Tt,"".concat(ze,"-in-view"),Dt<=Ut&&Yt<=Ie),Object(R.a)(Tt,"".concat(ze,"-selected"),Ut===At),Tt};return D.createElement(Ue,Object.assign({},V,{rowNum:Xn,colNum:rn,baseDate:ft,getCellText:function(dt){var Tt=Xe.getYear(dt);return"".concat(Tt,"-").concat(Tt+ae)},getCellClassName:$e,getCellDate:function(dt,Tt){return Xe.addYear(dt,Tt*$a)}}))}var xr=hr,$a=10,Ga=$a*10;function Aa(V){var ae=V.prefixCls,ge=V.onViewDateChange,ve=V.generateConfig,Xe=V.viewDate,Re=V.operationRef,ze=V.onSelect,lt=V.onPanelChange,At="".concat(ae,"-decade-panel");Re.current={onKeyDown:function($e){return _($e,{onLeftRight:function(dt){ze(ve.addYear(Xe,dt*$a),"key")},onCtrlLeftRight:function(dt){ze(ve.addYear(Xe,dt*Ga),"key")},onUpDown:function(dt){ze(ve.addYear(Xe,dt*$a*rn),"key")},onEnter:function(){lt("year",Xe)}})}};var Dt=function($e){var Ze=ve.addYear(Xe,$e*Ga);ge(Ze),lt(null,Ze)},Ie=function($e){ze($e,"mouse"),lt("year",$e)};return D.createElement("div",{className:At},D.createElement(vr,Object.assign({},V,{prefixCls:ae,onPrevDecades:function(){Dt(-1)},onNextDecades:function(){Dt(1)}})),D.createElement(xr,Object.assign({},V,{prefixCls:ae,onSelect:Ie})))}var Kn=Aa;function pr(V,ae,ge){return ge?D.createElement("div",{className:"".concat(V,"-footer-extra")},ge(ae)):null}function on(V){var ae=V.prefixCls,ge=V.rangeList,ve=ge===void 0?[]:ge,Xe=V.components,Re=Xe===void 0?{}:Xe,ze=V.needConfirmButton,lt=V.onNow,At=V.onOk,Dt=V.okDisabled,Ie=V.showNow,ft=V.locale,$e,Ze;if(ve.length){var dt=Re.rangeItem||"span";$e=D.createElement(D.Fragment,null,ve.map(function(at){var Ut=at.label,Yt=at.onClick,yn=at.onMouseEnter,In=at.onMouseLeave;return D.createElement("li",{key:Ut,className:"".concat(ae,"-preset")},D.createElement(dt,{onClick:Yt,onMouseEnter:yn,onMouseLeave:In},Ut))}))}if(ze){var Tt=Re.button||"button";lt&&!$e&&Ie!==!1&&($e=D.createElement("li",{className:"".concat(ae,"-now")},D.createElement("a",{className:"".concat(ae,"-now-btn"),onClick:lt},ft.now))),Ze=ze&&D.createElement("li",{className:"".concat(ae,"-ok")},D.createElement(Tt,{disabled:Dt,onClick:At},ft.ok))}return!$e&&!Ze?null:D.createElement("ul",{className:"".concat(ae,"-ranges")},$e,Ze)}function qa(V){var ae,ge=V.prefixCls,ve=ge===void 0?"rc-picker":ge,Xe=V.className,Re=V.style,ze=V.locale,lt=V.generateConfig,At=V.value,Dt=V.defaultValue,Ie=V.pickerValue,ft=V.defaultPickerValue,$e=V.disabledDate,Ze=V.mode,dt=V.picker,Tt=dt===void 0?"date":dt,at=V.tabIndex,Ut=at===void 0?0:at,Yt=V.showNow,yn=V.showTime,In=V.showToday,mn=V.renderExtraFooter,Cn=V.hideHeader,xn=V.onSelect,Et=V.onChange,Xt=V.onPanelChange,Mt=V.onMouseDown,gt=V.onPickerValueChange,Sn=V.onOk,gn=V.components,Nt=V.direction,et=V.hourStep,Rn=et===void 0?1:et,$t=V.minuteStep,Bn=$t===void 0?1:$t,jt=V.secondStep,vn=jt===void 0?1:jt,Dn=Tt==="date"&&!!yn||Tt==="time",tn=24%Rn===0,oa=60%Bn===0,_n=60%vn===0,hn=D.useContext(a),bt=hn.operationRef,He=hn.panelRef,Ct=hn.onSelect,xt=hn.hideRanges,Vt=hn.defaultOpenValue,kn=D.useContext(rt),On=kn.inRange,Yn=kn.panelPosition,Wn=kn.rangedValue,pa=kn.hoverRangedValue,na=D.useRef({}),ua=D.useRef(!0),Ba=Object(m.a)(null,{value:At,defaultValue:Dt,postState:function(It){return!It&&Vt&&Tt==="time"?Vt:It}}),Ia=Object(F.a)(Ba,2),ja=Ia[0],or=Ia[1],sr=Object(m.a)(null,{value:Ie,defaultValue:ft||ja,postState:function(It){return It||lt.getNow()}}),pe=Object(F.a)(sr,2),Se=pe[0],je=pe[1],_e=function(It){je(It),gt&>(It)},q=function(It){var kt=W[Tt];return kt?kt(It):It},oe=Object(m.a)(function(){return Tt==="time"?"time":q("date")},{value:Ze}),ne=Object(F.a)(oe,2),ye=ne[0],Te=ne[1];D.useEffect(function(){Te(Tt)},[Tt]);var We=D.useState(function(){return ye}),we=Object(F.a)(We,2),Je=we[0],St=we[1],Wt=function(It,kt){var ea=q(It||ye);St(ye),Te(ea),Xt&&(ye!==ea||Ye(lt,Se,Se))&&Xt(kt,ea)},Zt=function(It,kt){var ea=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(ye===Tt||ea)&&(or(It),xn&&xn(It),Ct&&Ct(It,kt),Et&&!Ye(lt,It,ja)&&Et(It))},Pn=function(It){return na.current&&na.current.onKeyDown?([d.a.LEFT,d.a.RIGHT,d.a.UP,d.a.DOWN,d.a.PAGE_UP,d.a.PAGE_DOWN,d.a.ENTER].includes(It.which)&&It.preventDefault(),na.current.onKeyDown(It)):(Object(b.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Nn=function(It){na.current&&na.current.onBlur&&na.current.onBlur(It)};bt&&Yn!=="right"&&(bt.current={onKeyDown:Pn,onClose:function(){na.current&&na.current.onClose&&na.current.onClose()}}),D.useEffect(function(){At&&!ua.current&&je(At)},[At]),D.useEffect(function(){ua.current=!1},[]);var qn,Qn=Object(P.a)(Object(P.a)({},V),{},{operationRef:na,prefixCls:ve,viewDate:Se,value:ja,onViewDateChange:_e,sourceMode:Je,onPanelChange:Wt,disabledDate:ye!=="decade"?$e:void 0});delete Qn.onChange,delete Qn.onSelect;switch(ye){case"decade":qn=D.createElement(Kn,Object.assign({},Qn,{onSelect:function(It,kt){_e(It),Zt(It,kt)}}));break;case"year":qn=D.createElement(Ra,Object.assign({},Qn,{onSelect:function(It,kt){_e(It),Zt(It,kt)}}));break;case"month":qn=D.createElement(Ot,Object.assign({},Qn,{onSelect:function(It,kt){_e(It),Zt(It,kt)}}));break;case"quarter":qn=D.createElement(cn,Object.assign({},Qn,{onSelect:function(It,kt){_e(It),Zt(It,kt)}}));break;case"week":qn=D.createElement(an,Object.assign({},Qn,{onSelect:function(It,kt){_e(It),Zt(It,kt)}}));break;case"time":delete Qn.showTime,qn=D.createElement(Fe,Object.assign({},Qn,Object(h.a)(yn)==="object"?yn:null,{onSelect:function(It,kt){_e(It),Zt(It,kt)}}));break;default:yn?qn=D.createElement(ct,Object.assign({},Qn,{onSelect:function(It,kt){_e(It),Zt(It,kt)}})):qn=D.createElement(re,Object.assign({},Qn,{onSelect:function(It,kt){_e(It),Zt(It,kt)}}))}var da,ma,aa=function(){var It=lt.getNow(),kt=Ae(lt.getHour(It),lt.getMinute(It),lt.getSecond(It),tn?Rn:1,oa?Bn:1,_n?vn:1),ea=Le(lt,It,kt[0],kt[1],kt[2]);Zt(ea,"submit")};xt||(da=pr(ve,ye,mn),ma=on({prefixCls:ve,components:gn,needConfirmButton:Dn,okDisabled:!ja||$e&&$e(ja),locale:ze,showNow:Yt,onNow:Dn&&aa,onOk:function(){ja&&(Zt(ja,"submit",!0),Sn&&Sn(ja))}}));var ca;if(In&&ye==="date"&&Tt==="date"&&!yn){var ya=lt.getNow(),en="".concat(ve,"-today-btn"),Ht=$e&&$e(ya);ca=D.createElement("a",{className:A()(en,Ht&&"".concat(en,"-disabled")),"aria-disabled":Ht,onClick:function(){Ht||Zt(ya,"mouse",!0)}},ze.today)}return D.createElement(a.Provider,{value:Object(P.a)(Object(P.a)({},hn),{},{hideHeader:"hideHeader"in V?Cn:hn.hideHeader,hidePrevBtn:On&&Yn==="right",hideNextBtn:On&&Yn==="left"})},D.createElement("div",{tabIndex:Ut,className:A()("".concat(ve,"-panel"),Xe,(ae={},Object(R.a)(ae,"".concat(ve,"-panel-has-range"),Wn&&Wn[0]&&Wn[1]),Object(R.a)(ae,"".concat(ve,"-panel-has-range-hover"),pa&&pa[0]&&pa[1]),Object(R.a)(ae,"".concat(ve,"-panel-rtl"),Nt==="rtl"),ae)),style:Re,onKeyDown:Pn,onBlur:Nn,onMouseDown:Mt,ref:He},qn,da||ma||ca?D.createElement("div",{className:"".concat(ve,"-footer")},da,ma,ca):null))}var Ka=qa,Tr=M("uciX"),mr={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 nr(V){var ae,ge=V.prefixCls,ve=V.popupElement,Xe=V.popupStyle,Re=V.visible,ze=V.dropdownClassName,lt=V.dropdownAlign,At=V.transitionName,Dt=V.getPopupContainer,Ie=V.children,ft=V.range,$e=V.popupPlacement,Ze=V.direction,dt="".concat(ge,"-dropdown"),Tt=function(){return $e!==void 0?$e:Ze==="rtl"?"bottomRight":"bottomLeft"};return D.createElement(Tr.a,{showAction:[],hideAction:[],popupPlacement:Tt(),builtinPlacements:mr,prefixCls:dt,popupTransitionName:At,popup:ve,popupAlign:lt,popupVisible:Re,popupClassName:A()(ze,(ae={},Object(R.a)(ae,"".concat(dt,"-range"),ft),Object(R.a)(ae,"".concat(dt,"-rtl"),Ze==="rtl"),ae)),popupStyle:Xe,getPopupContainer:Dt},Ie)}var Br=nr;function Hr(V){var ae=V.open,ge=V.value,ve=V.isClickOutside,Xe=V.triggerOpen,Re=V.forwardKeyDown,ze=V.blurToCancel,lt=V.onSubmit,At=V.onCancel,Dt=V.onFocus,Ie=V.onBlur,ft=Object(D.useState)(!1),$e=Object(F.a)(ft,2),Ze=$e[0],dt=$e[1],Tt=Object(D.useState)(!1),at=Object(F.a)(Tt,2),Ut=at[0],Yt=at[1],yn=Object(D.useRef)(!1),In=Object(D.useRef)(!1),mn={onMouseDown:function(){dt(!0),Xe(!0)},onKeyDown:function(xn){switch(xn.which){case d.a.ENTER:{ae?lt()!==!1&&dt(!0):Xe(!0),xn.preventDefault();return}case d.a.TAB:{Ze&&ae&&!xn.shiftKey?(dt(!1),xn.preventDefault()):!Ze&&ae&&(!Re(xn)&&xn.shiftKey&&(dt(!0),xn.preventDefault()));return}case d.a.ESC:{dt(!0),At();return}}!ae&&![d.a.SHIFT].includes(xn.which)?Xe(!0):Ze||Re(xn)},onFocus:function(xn){dt(!0),Yt(!0),Dt&&Dt(xn)},onBlur:function(xn){if(yn.current||!ve(document.activeElement)){yn.current=!1;return}ze?setTimeout(function(){ve(document.activeElement)&&At()},0):ae&&(Xe(!1),In.current&<()),Yt(!1),Ie&&Ie(xn)}};return Object(D.useEffect)(function(){In.current=!1},[ae]),Object(D.useEffect)(function(){In.current=!0},[ge]),Object(D.useEffect)(function(){return p(function(Cn){var xn=Cn.target;ae&&(ve(xn)?Ut||Xe(!1):(yn.current=!0,requestAnimationFrame(function(){yn.current=!1})))})}),[mn,{focused:Ut,typing:Ze}]}function ar(V){var ae=V.valueTexts,ge=V.onTextChange,ve=D.useState(""),Xe=Object(F.a)(ve,2),Re=Xe[0],ze=Xe[1],lt=D.useRef([]);lt.current=ae;function At(Ie){ze(Ie),ge(Ie)}function Dt(){ze(lt.current[0])}return D.useEffect(function(){ae.every(function(Ie){return Ie!==Re})&&Dt()},[ae.join("||")]),[Re,At,Dt]}var Ea=M("Gytx"),Sr=M.n(Ea);function Rr(V,ae){var ge=ae.formatList,ve=ae.generateConfig,Xe=ae.locale;return Object(C.a)(function(){if(!V)return[[""],""];for(var Re="",ze=[],lt=0;lt<ge.length;lt+=1){var At=ge[lt],Dt=ve.locale.format(Xe.locale,V,At);ze.push(Dt),lt===0&&(Re=Dt)}return[ze,Re]},[V,ge],function(Re,ze){return Re[0]!==ze[0]||!Sr()(Re[1],ze[1])})}function ur(V,ae){var ge=ae.formatList,ve=ae.generateConfig,Xe=ae.locale,Re=Object(D.useState)(null),ze=Object(F.a)(Re,2),lt=ze[0],At=ze[1],Dt=Object(D.useRef)(null);function Ie(at){var Ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Dt.current),Ut){At(at);return}Dt.current=requestAnimationFrame(function(){At(at)})}var ft=Rr(lt,{formatList:ge,generateConfig:ve,locale:Xe}),$e=Object(F.a)(ft,2),Ze=$e[1];function dt(at){Ie(at)}function Tt(){var at=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ie(null,at)}return Object(D.useEffect)(function(){Tt(!0)},[V]),Object(D.useEffect)(function(){return function(){return cancelAnimationFrame(Dt.current)}},[]),[Ze,dt,Tt]}function _r(V){var ae,ge=V.prefixCls,ve=ge===void 0?"rc-picker":ge,Xe=V.id,Re=V.tabIndex,ze=V.style,lt=V.className,At=V.dropdownClassName,Dt=V.dropdownAlign,Ie=V.popupStyle,ft=V.transitionName,$e=V.generateConfig,Ze=V.locale,dt=V.inputReadOnly,Tt=V.allowClear,at=V.autoFocus,Ut=V.showTime,Yt=V.picker,yn=Yt===void 0?"date":Yt,In=V.format,mn=V.use12Hours,Cn=V.value,xn=V.defaultValue,Et=V.open,Xt=V.defaultOpen,Mt=V.defaultOpenValue,gt=V.suffixIcon,Sn=V.clearIcon,gn=V.disabled,Nt=V.disabledDate,et=V.placeholder,Rn=V.getPopupContainer,$t=V.pickerRef,Bn=V.panelRender,jt=V.onChange,vn=V.onOpenChange,Dn=V.onFocus,tn=V.onBlur,oa=V.onMouseDown,_n=V.onMouseUp,hn=V.onMouseEnter,bt=V.onMouseLeave,He=V.onContextMenu,Ct=V.onClick,xt=V.direction,Vt=V.autoComplete,kn=Vt===void 0?"off":Vt,On=D.useRef(null),Yn=yn==="date"&&!!Ut||yn==="time",Wn=se(y(In,yn,Ut,mn)),pa=D.useRef(null),na=D.useRef(null),ua=Object(m.a)(null,{value:Cn,defaultValue:xn}),Ba=Object(F.a)(ua,2),Ia=Ba[0],ja=Ba[1],or=D.useState(Ia),sr=Object(F.a)(or,2),pe=sr[0],Se=sr[1],je=D.useRef(null),_e=Object(m.a)(!1,{value:Et,defaultValue:Xt,postState:function(ra){return gn?!1:ra},onChange:function(ra){vn&&vn(ra),!ra&&je.current&&je.current.onClose&&je.current.onClose()}}),q=Object(F.a)(_e,2),oe=q[0],ne=q[1],ye=Rr(pe,{formatList:Wn,generateConfig:$e,locale:Ze}),Te=Object(F.a)(ye,2),We=Te[0],we=Te[1],Je=ar({valueTexts:We,onTextChange:function(ra){var lr=$e.locale.parse(Ze.locale,ra,Wn);lr&&(!Nt||!Nt(lr))&&Se(lr)}}),St=Object(F.a)(Je,3),Wt=St[0],Zt=St[1],Pn=St[2],Nn=function(ra){Se(ra),ja(ra),jt&&!Ye($e,Ia,ra)&&jt(ra,ra?$e.locale.format(Ze.locale,ra,Wn[0]):"")},qn=function(ra){if(gn&&ra)return;ne(ra)},Qn=function(ra){return oe&&je.current&&je.current.onKeyDown?je.current.onKeyDown(ra):(Object(b.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},da=function(){_n&&_n.apply(void 0,arguments),On.current&&(On.current.focus(),qn(!0))},ma=Hr({blurToCancel:Yn,open:oe,value:Wt,triggerOpen:qn,forwardKeyDown:Qn,isClickOutside:function(ra){return!j([pa.current,na.current],ra)},onSubmit:function(){return Nt&&Nt(pe)?!1:(Nn(pe),qn(!1),Pn(),!0)},onCancel:function(){qn(!1),Se(Ia),Pn()},onFocus:Dn,onBlur:tn}),aa=Object(F.a)(ma,2),ca=aa[0],ya=aa[1],en=ya.focused,Ht=ya.typing;D.useEffect(function(){oe||(Se(Ia),!We.length||We[0]===""?Zt(""):we!==Wt&&Pn())},[oe,We]),D.useEffect(function(){oe||Pn()},[yn]),D.useEffect(function(){Se(Ia)},[Ia]),$t&&($t.current={focus:function(){On.current&&On.current.focus()},blur:function(){On.current&&On.current.blur()}});var dn=Object(P.a)(Object(P.a)({},V),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),It=D.createElement(Ka,Object.assign({},dn,{generateConfig:$e,className:A()(Object(R.a)({},"".concat(ve,"-panel-focused"),!Ht)),value:pe,locale:Ze,tabIndex:-1,onChange:Se,direction:xt}));Bn&&(It=Bn(It));var kt=D.createElement("div",{className:"".concat(ve,"-panel-container"),onMouseDown:function(ra){ra.preventDefault()}},It),ea;gt&&(ea=D.createElement("span",{className:"".concat(ve,"-suffix")},gt));var ba;Tt&&Ia&&!gn&&(ba=D.createElement("span",{onMouseDown:function(ra){ra.preventDefault(),ra.stopPropagation()},onMouseUp:function(ra){ra.preventDefault(),ra.stopPropagation(),Nn(null),qn(!1)},className:"".concat(ve,"-clear")},Sn||D.createElement("span",{className:"".concat(ve,"-clear-btn")})));var Gn=function(ra,lr){(lr==="submit"||lr!=="key"&&!Yn)&&(Nn(ra),qn(!1))},Oa=xt==="rtl"?"bottomRight":"bottomLeft",Va=ur(Wt,{formatList:Wn,generateConfig:$e,locale:Ze}),Ca=Object(F.a)(Va,3),ka=Ca[0],La=Ca[1],Da=Ca[2];return D.createElement(a.Provider,{value:{operationRef:je,hideHeader:yn==="time",panelRef:pa,onSelect:Gn,open:oe,defaultOpenValue:Mt,onDateMouseEnter:La,onDateMouseLeave:Da}},D.createElement(Br,{visible:oe,popupElement:kt,popupStyle:Ie,prefixCls:ve,dropdownClassName:At,dropdownAlign:Dt,getPopupContainer:Rn,transitionName:ft,popupPlacement:Oa,direction:xt},D.createElement("div",{className:A()(ve,lt,(ae={},Object(R.a)(ae,"".concat(ve,"-disabled"),gn),Object(R.a)(ae,"".concat(ve,"-focused"),en),Object(R.a)(ae,"".concat(ve,"-rtl"),xt==="rtl"),ae)),style:ze,onMouseDown:oa,onMouseUp:da,onMouseEnter:hn,onMouseLeave:bt,onContextMenu:He,onClick:Ct},D.createElement("div",{className:A()("".concat(ve,"-input"),Object(R.a)({},"".concat(ve,"-input-placeholder"),!!ka)),ref:na},D.createElement("input",Object.assign({id:Xe,tabIndex:Re,disabled:gn,readOnly:dt||!Ht,value:ka||Wt,onChange:function(ra){Zt(ra.target.value)},autoFocus:at,placeholder:et,ref:On,title:Wt},ca,{size:f(yn,Wn[0])},Be(V),{autoComplete:kn})),ea,ba))))}var oi=function(V){Object(I.a)(ge,V);var ae=Object(B.a)(ge);function ge(){var ve;return Object(Q.a)(this,ge),ve=ae.apply(this,arguments),ve.pickerRef=D.createRef(),ve.focus=function(){ve.pickerRef.current&&ve.pickerRef.current.focus()},ve.blur=function(){ve.pickerRef.current&&ve.pickerRef.current.blur()},ve}return Object(z.a)(ge,[{key:"render",value:function(){return D.createElement(_r,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),ge}(D.Component),$r=oi;function va(V,ae,ge){var ve=V.picker,Xe=V.locale,Re=V.selectedValue,ze=V.disabledDate,lt=V.disabled,At=V.generateConfig,Dt=me(Re,0),Ie=me(Re,1);function ft(at){var Ut=At.getYear(at),Yt=At.locale.getWeek(Xe.locale,at);return Ut*100+Yt}function $e(at){var Ut=At.getYear(at),Yt=At.getMonth(at);return Ut*100+Yt}function Ze(at){var Ut=At.getYear(at),Yt=Ft(At,at);return Ut*10+Yt}var dt=D.useCallback(function(at){if(ze&&ze(at))return!0;if(lt[1]&&Ie)return!bn(At,at,Ie)&&At.isAfter(at,Ie);if(ae&&Ie)switch(ve){case"quarter":return Ze(at)>Ze(Ie);case"month":return $e(at)>$e(Ie);case"week":return ft(at)>ft(Ie);default:return!bn(At,at,Ie)&&At.isAfter(at,Ie)}return!1},[ze,lt[1],Ie,ae]),Tt=D.useCallback(function(at){if(ze&&ze(at))return!0;if(lt[0]&&Dt)return!bn(At,at,Ie)&&At.isAfter(Dt,at);if(ge&&Dt)switch(ve){case"quarter":return Ze(at)<Ze(Dt);case"month":return $e(at)<$e(Dt);case"week":return ft(at)<ft(Dt);default:return!bn(At,at,Dt)&&At.isAfter(Dt,at)}return!1},[ze,lt[0],Dt,ge]);return[dt,Tt]}function _a(V,ae,ge,ve){var Xe=ke(V,ge,ve,1);function Re(ze){return ze(V,ae)?"same":ze(Xe,ae)?"closing":"far"}switch(ge){case"year":return Re(function(ze,lt){return Rt(ve,ze,lt)});case"quarter":case"month":return Re(function(ze,lt){return Ge(ve,ze,lt)});default:return Re(function(ze,lt){return yt(ve,ze,lt)})}}function ir(V,ae,ge,ve){var Xe=me(V,0),Re=me(V,1);if(ae===0)return Xe;if(Xe&&Re){var ze=_a(Xe,Re,ge,ve);switch(ze){case"same":return Xe;case"closing":return Xe;default:return ke(Re,ge,ve,-1)}}return Xe}function Pa(V){var ae=V.values,ge=V.picker,ve=V.defaultDates,Xe=V.generateConfig,Re=D.useState(function(){return[me(ve,0),me(ve,1)]}),ze=Object(F.a)(Re,2),lt=ze[0],At=ze[1],Dt=D.useState(null),Ie=Object(F.a)(Dt,2),ft=Ie[0],$e=Ie[1],Ze=me(ae,0),dt=me(ae,1);function Tt(Ut){return lt[Ut]?lt[Ut]:me(ft,Ut)||ir(ae,Ut,ge,Xe)||Ze||dt||Xe.getNow()}function at(Ut,Yt){if(Ut){var yn=xe(ft,Ut,Yt);At(xe(lt,null,Yt)||[null,null]);var In=(Yt+1)%2;me(ae,In)||(yn=xe(yn,Ut,In)),$e(yn)}else(Ze||dt)&&$e(null)}return[Tt,at]}function Mn(V,ae){return V&&V[0]&&V[1]&&ae.isAfter(V[0],V[1])?[V[1],V[0]]:V}function ln(V,ae,ge,ve){return V||ve&&ve[ae]?!0:!!ge[(ae+1)%2]}function Tn(V){var ae,ge,ve,Xe=V.prefixCls,Re=Xe===void 0?"rc-picker":Xe,ze=V.id,lt=V.style,At=V.className,Dt=V.popupStyle,Ie=V.dropdownClassName,ft=V.transitionName,$e=V.dropdownAlign,Ze=V.getPopupContainer,dt=V.generateConfig,Tt=V.locale,at=V.placeholder,Ut=V.autoFocus,Yt=V.disabled,yn=V.format,In=V.picker,mn=In===void 0?"date":In,Cn=V.showTime,xn=V.use12Hours,Et=V.separator,Xt=Et===void 0?"~":Et,Mt=V.value,gt=V.defaultValue,Sn=V.defaultPickerValue,gn=V.open,Nt=V.defaultOpen,et=V.disabledDate,Rn=V.disabledTime,$t=V.dateRender,Bn=V.panelRender,jt=V.ranges,vn=V.allowEmpty,Dn=V.allowClear,tn=V.suffixIcon,oa=V.clearIcon,_n=V.pickerRef,hn=V.inputReadOnly,bt=V.mode,He=V.renderExtraFooter,Ct=V.onChange,xt=V.onOpenChange,Vt=V.onPanelChange,kn=V.onCalendarChange,On=V.onFocus,Yn=V.onBlur,Wn=V.onOk,pa=V.components,na=V.order,ua=V.direction,Ba=V.activePickerIndex,Ia=V.autoComplete,ja=Ia===void 0?"off":Ia,or=mn==="date"&&!!Cn||mn==="time",sr=Object(D.useRef)({}),pe=Object(D.useRef)(null),Se=Object(D.useRef)(null),je=Object(D.useRef)(null),_e=Object(D.useRef)(null),q=Object(D.useRef)(null),oe=Object(D.useRef)(null),ne=Object(D.useRef)(null),ye=se(y(yn,mn,Cn,xn)),Te=Object(m.a)(0,{value:Ba}),We=Object(F.a)(Te,2),we=We[0],Je=We[1],St=Object(D.useRef)(null),Wt=D.useMemo(function(){return Array.isArray(Yt)?Yt:[Yt||!1,Yt||!1]},[Yt]),Zt=Object(m.a)(null,{value:Mt,defaultValue:gt,postState:function(Fn){return mn==="time"&&!na?Fn:Mn(Fn,dt)}}),Pn=Object(F.a)(Zt,2),Nn=Pn[0],qn=Pn[1],Qn=Pa({values:Nn,picker:mn,defaultDates:Sn,generateConfig:dt}),da=Object(F.a)(Qn,2),ma=da[0],aa=da[1],ca=Object(m.a)(Nn,{postState:function(Fn){var Jn=Fn;if(Wt[0]&&Wt[1])return Jn;for(var xa=0;xa<2;xa+=1)Wt[xa]&&!me(Jn,xa)&&!me(vn,xa)&&(Jn=xe(Jn,dt.getNow(),xa));return Jn}}),ya=Object(F.a)(ca,2),en=ya[0],Ht=ya[1],dn=Object(m.a)([mn,mn],{value:bt}),It=Object(F.a)(dn,2),kt=It[0],ea=It[1];Object(D.useEffect)(function(){ea([mn,mn])},[mn]);var ba=function(Fn,Jn){ea(Fn),Vt&&Vt(Jn,Fn)},Gn=va({picker:mn,selectedValue:en,locale:Tt,disabled:Wt,disabledDate:et,generateConfig:dt},sr.current[1],sr.current[0]),Oa=Object(F.a)(Gn,2),Va=Oa[0],Ca=Oa[1],ka=Object(m.a)(!1,{value:gn,defaultValue:Nt,postState:function(Fn){return Wt[we]?!1:Fn},onChange:function(Fn){xt&&xt(Fn),!Fn&&St.current&&St.current.onClose&&St.current.onClose()}}),La=Object(F.a)(ka,2),Da=La[0],Sa=La[1],ra=Da&&we===0,lr=Da&&we===1,Qr=Object(D.useState)(0),kr=Object(F.a)(Qr,2),Or=kr[0],Qa=kr[1];Object(D.useEffect)(function(){!Da&&pe.current&&Qa(pe.current.offsetWidth)},[Da]);var Ha=D.useRef();function za(ha,Fn){if(ha)clearTimeout(Ha.current),sr.current[Fn]=!0,Je(Fn),Sa(ha),Da||aa(null,Fn);else if(we===Fn){Sa(ha);var Jn=sr.current;Ha.current=setTimeout(function(){Jn===sr.current&&(sr.current={})})}}function Ja(ha){za(!0,ha),setTimeout(function(){var Fn=[oe,ne][ha];Fn.current&&Fn.current.focus()},0)}function Nr(ha,Fn){var Jn=ha,xa=me(Jn,0),er=me(Jn,1);xa&&er&&dt.isAfter(xa,er)&&(mn==="week"&&!sn(dt,Tt.locale,xa,er)||mn==="quarter"&&!wt(dt,xa,er)||mn!=="week"&&mn!=="quarter"&&mn!=="time"&&!bn(dt,xa,er)?(Fn===0?(Jn=[xa,null],er=null):(xa=null,Jn=[null,er]),sr.current=Object(R.a)({},Fn,!0)):(mn!=="time"||na!==!1)&&(Jn=Mn(Jn,dt))),Ht(Jn);var gi=Jn&&Jn[0]?dt.locale.format(Tt.locale,Jn[0],ye[0]):"",ri=Jn&&Jn[1]?dt.locale.format(Tt.locale,Jn[1],ye[0]):"";if(kn){var Dr={range:Fn===0?"start":"end"};kn(Jn,[gi,ri],Dr)}var Yr=ln(xa,0,Wt,vn),vi=ln(er,1,Wt,vn),Wi=Jn===null||Yr&&vi;Wi&&(qn(Jn),Ct&&(!Ye(dt,me(Nn,0),xa)||!Ye(dt,me(Nn,1),er))&&Ct(Jn,[gi,ri]));var Cr=null;Fn===0&&!Wt[1]?Cr=1:Fn===1&&!Wt[0]&&(Cr=0),Cr!==null&&Cr!==we&&(!sr.current[Cr]||!me(Jn,Cr))&&me(Jn,Fn)?Ja(Cr):za(!1,Fn)}var fi=function(Fn){return Da&&St.current&&St.current.onKeyDown?St.current.onKeyDown(Fn):(Object(b.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},si={formatList:ye,generateConfig:dt,locale:Tt},Wa=Rr(me(en,0),si),Jr=Object(F.a)(Wa,2),Zr=Jr[0],Ya=Jr[1],Fa=Rr(me(en,1),si),yr=Object(F.a)(Fa,2),Mi=yr[0],no=yr[1],li=function(Fn,Jn){var xa=dt.locale.parse(Tt.locale,Fn,ye),er=Jn===0?Va:Ca;xa&&!er(xa)&&(Ht(xe(en,xa,Jn)),aa(xa,Jn))},Oi=ar({valueTexts:Zr,onTextChange:function(Fn){return li(Fn,0)}}),Ci=Object(F.a)(Oi,3),wi=Ci[0],Ii=Ci[1],co=Ci[2],Ro=ar({valueTexts:Mi,onTextChange:function(Fn){return li(Fn,1)}}),Gi=Object(F.a)(Ro,3),Si=Gi[0],Vi=Gi[1],_i=Gi[2],Ri=Object(D.useState)(null),fo=Object(F.a)(Ri,2),Yi=fo[0],Ai=fo[1],Di=Object(D.useState)(null),yi=Object(F.a)(Di,2),Mr=yi[0],hi=yi[1],pi=ur(wi,{formatList:ye,generateConfig:dt,locale:Tt}),bi=Object(F.a)(pi,3),mi=bi[0],Xi=bi[1],$i=bi[2],Qi=ur(Si,{formatList:ye,generateConfig:dt,locale:Tt}),ki=Object(F.a)(Qi,3),ui=ki[0],Ei=ki[1],ao=ki[2],Ao=function(Fn){hi(xe(en,Fn,we)),we===0?Xi(Fn):Ei(Fn)},Do=function(){hi(xe(en,null,we)),we===0?$i():ao()},ho=function(Fn,Jn){return{blurToCancel:or,forwardKeyDown:fi,onBlur:Yn,isClickOutside:function(er){return!j([Se.current,je.current,_e.current],er)},onFocus:function(er){Je(Fn),On&&On(er)},triggerOpen:function(er){za(er,Fn)},onSubmit:function(){Nr(en,Fn),Jn()},onCancel:function(){za(!1,Fn),Ht(Nn),Jn()}}},ro=Hr(Object(P.a)(Object(P.a)({},ho(0,co)),{},{open:ra,value:wi})),po=Object(F.a)(ro,2),Wr=po[0],dr=po[1],Ar=dr.focused,cr=dr.typing,Ni=Hr(Object(P.a)(Object(P.a)({},ho(1,_i)),{},{open:lr,value:Si})),mo=Object(F.a)(Ni,2),qr=mo[0],io=mo[1],oo=io.focused,so=io.typing,xi=function(Fn){!Da&&!oe.current.contains(Fn.target)&&!ne.current.contains(Fn.target)&&(Wt[0]?Wt[1]||Ja(1):Ja(0))},Ji=function(Fn){Da&&(Ar||oo)&&!oe.current.contains(Fn.target)&&!ne.current.contains(Fn.target)&&Fn.preventDefault()},Ui=Nn&&Nn[0]?dt.locale.format(Tt.locale,Nn[0],"YYYYMMDDHHmmss"):"",go=Nn&&Nn[1]?dt.locale.format(Tt.locale,Nn[1],"YYYYMMDDHHmmss"):"";Object(D.useEffect)(function(){Da||(Ht(Nn),!Zr.length||Zr[0]===""?Ii(""):Ya!==wi&&co(),!Mi.length||Mi[0]===""?Vi(""):no!==Si&&_i())},[Da,Zr,Mi]),Object(D.useEffect)(function(){Ht(Nn)},[Ui,go]),_n&&(_n.current={focus:function(){oe.current&&oe.current.focus()},blur:function(){oe.current&&oe.current.blur(),ne.current&&ne.current.blur()}});var Zi=Object.keys(jt||{}),Na=Zi.map(function(ha){var Fn=jt[ha],Jn=typeof Fn=="function"?Fn():Fn;return{label:ha,onClick:function(){Nr(Jn,null),za(!1,we)},onMouseEnter:function(){Ai(Jn)},onMouseLeave:function(){Ai(null)}}});function Ta(){var ha=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Fn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Jn=null;Da&&Mr&&Mr[0]&&Mr[1]&&dt.isAfter(Mr[1],Mr[0])&&(Jn=Mr);var xa=Cn;if(Cn&&Object(h.a)(Cn)==="object"&&Cn.defaultValue){var er=Cn.defaultValue;xa=Object(P.a)(Object(P.a)({},Cn),{},{defaultValue:me(er,we)||void 0})}var gi=null;return $t&&(gi=function(Dr,Yr){return $t(Dr,Yr,{range:we?"end":"start"})}),D.createElement(rt.Provider,{value:{inRange:!0,panelPosition:ha,rangedValue:Yi||en,hoverRangedValue:Jn}},D.createElement(Ka,Object.assign({},V,Fn,{dateRender:gi,showTime:xa,mode:kt[we],generateConfig:dt,style:void 0,direction:ua,disabledDate:we===0?Va:Ca,disabledTime:function(Dr){return Rn?Rn(Dr,we===0?"start":"end"):!1},className:A()(Object(R.a)({},"".concat(Re,"-panel-focused"),we===0?!cr:!so)),value:me(en,we),locale:Tt,tabIndex:-1,onPanelChange:function(Dr,Yr){ba(xe(kt,Yr,we),xe(en,Dr,we));var vi=Dr;ha==="right"&&kt[we]===Yr&&(vi=ke(vi,Yr,dt,-1)),aa(vi,we)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var rr=0,Ur=0;we&&je.current&&q.current&&Se.current&&(rr=je.current.offsetWidth+q.current.offsetWidth,Se.current.offsetWidth&&rr>Se.current.offsetWidth&&(Ur=rr));var Pi=ua==="rtl"?{right:rr}:{left:rr};function di(){var ha,Fn=pr(Re,kt[we],He),Jn=on({prefixCls:Re,components:pa,needConfirmButton:or,okDisabled:!me(en,we)||et&&et(en[we]),locale:Tt,rangeList:Na,onOk:function(){me(en,we)&&(Nr(en,we),Wn&&Wn(en))}});if(mn!=="time"&&!Cn){var xa=ma(we),er=ke(xa,mn,dt),gi=kt[we],ri=gi===mn,Dr=Ta(ri?"left":!1,{pickerValue:xa,onPickerValueChange:function(Cr){aa(Cr,we)}}),Yr=Ta("right",{pickerValue:er,onPickerValueChange:function(Cr){aa(ke(Cr,mn,dt,-1),we)}});ua==="rtl"?ha=D.createElement(D.Fragment,null,Yr,ri&&Dr):ha=D.createElement(D.Fragment,null,Dr,ri&&Yr)}else ha=Ta();var vi=D.createElement(D.Fragment,null,D.createElement("div",{className:"".concat(Re,"-panels")},ha),(Fn||Jn)&&D.createElement("div",{className:"".concat(Re,"-footer")},Fn,Jn));return Bn&&(vi=Bn(vi)),D.createElement("div",{className:"".concat(Re,"-panel-container"),style:{marginLeft:Ur},ref:Se,onMouseDown:function(Cr){Cr.preventDefault()}},vi)}var ji=D.createElement("div",{className:A()("".concat(Re,"-range-wrapper"),"".concat(Re,"-").concat(mn,"-range-wrapper")),style:{minWidth:Or}},D.createElement("div",{className:"".concat(Re,"-range-arrow"),style:Pi}),di()),ci;tn&&(ci=D.createElement("span",{className:"".concat(Re,"-suffix")},tn));var br;Dn&&(me(Nn,0)&&!Wt[0]||me(Nn,1)&&!Wt[1])&&(br=D.createElement("span",{onMouseDown:function(Fn){Fn.preventDefault(),Fn.stopPropagation()},onMouseUp:function(Fn){Fn.preventDefault(),Fn.stopPropagation();var Jn=Nn;Wt[0]||(Jn=xe(Jn,null,0)),Wt[1]||(Jn=xe(Jn,null,1)),Nr(Jn,null),za(!1,we)},className:"".concat(Re,"-clear")},oa||D.createElement("span",{className:"".concat(Re,"-clear-btn")})));var Fi={size:f(mn,ye[0])},Bi=0,Hi=0;je.current&&_e.current&&q.current&&(we===0?Hi=je.current.offsetWidth:(Bi=rr,Hi=_e.current.offsetWidth));var Kr=ua==="rtl"?{right:Bi}:{left:Bi},Ma=function(Fn,Jn){var xa=xe(en,Fn,we);Jn==="submit"||Jn!=="key"&&!or?(Nr(xa,we),we===0?$i():ao()):Ht(xa)};return D.createElement(a.Provider,{value:{operationRef:St,hideHeader:mn==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Ma,open:Da}},D.createElement(Br,{visible:Da,popupElement:ji,popupStyle:Dt,prefixCls:Re,dropdownClassName:Ie,dropdownAlign:$e,getPopupContainer:Ze,transitionName:ft,range:!0,direction:ua},D.createElement("div",Object.assign({ref:pe,className:A()(Re,"".concat(Re,"-range"),At,(ae={},Object(R.a)(ae,"".concat(Re,"-disabled"),Wt[0]&&Wt[1]),Object(R.a)(ae,"".concat(Re,"-focused"),we===0?Ar:oo),Object(R.a)(ae,"".concat(Re,"-rtl"),ua==="rtl"),ae)),style:lt,onClick:xi,onMouseDown:Ji},Be(V)),D.createElement("div",{className:A()("".concat(Re,"-input"),(ge={},Object(R.a)(ge,"".concat(Re,"-input-active"),we===0),Object(R.a)(ge,"".concat(Re,"-input-placeholder"),!!mi),ge)),ref:je},D.createElement("input",Object.assign({id:ze,disabled:Wt[0],readOnly:hn||!cr,value:mi||wi,onChange:function(Fn){Ii(Fn.target.value)},autoFocus:Ut,placeholder:me(at,0)||"",ref:oe},Wr,Fi,{autoComplete:ja}))),D.createElement("div",{className:"".concat(Re,"-range-separator"),ref:q},Xt),D.createElement("div",{className:A()("".concat(Re,"-input"),(ve={},Object(R.a)(ve,"".concat(Re,"-input-active"),we===1),Object(R.a)(ve,"".concat(Re,"-input-placeholder"),!!ui),ve)),ref:_e},D.createElement("input",Object.assign({disabled:Wt[1],readOnly:hn||!so,value:ui||Si,onChange:function(Fn){Vi(Fn.target.value)},placeholder:me(at,1)||"",ref:ne},qr,Fi,{autoComplete:ja}))),D.createElement("div",{className:"".concat(Re,"-active-bar"),style:Object(P.a)(Object(P.a)({},Kr),{},{width:Hi,position:"absolute"})}),ci,br)))}var fn=function(V){Object(I.a)(ge,V);var ae=Object(B.a)(ge);function ge(){var ve;return Object(Q.a)(this,ge),ve=ae.apply(this,arguments),ve.pickerRef=D.createRef(),ve.focus=function(){ve.pickerRef.current&&ve.pickerRef.current.focus()},ve.blur=function(){ve.pickerRef.current&&ve.pickerRef.current.blur()},ve}return Object(z.a)(ge,[{key:"render",value:function(){return D.createElement(Tn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),ge}(D.Component),$n=fn,Zn=Ke.b=$r},osHv:function(zt,Ke,M){(function(Q){Q(M("VrN/"))})(function(Q){"use strict";var z=Q.Pos;function I(u,s){return u.line-s.line||u.ch-s.ch}var B="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",R=B+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+B+"]["+R+"]*)","g");function F(u,s,i,n){this.line=s,this.ch=i,this.cm=u,this.text=u.getLine(s),this.min=n?Math.max(n.from,u.firstLine()):u.firstLine(),this.max=n?Math.min(n.to-1,u.lastLine()):u.lastLine()}function D(u,s){var i=u.cm.getTokenTypeAt(z(u.line,s));return i&&/\btag\b/.test(i)}function L(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function A(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function b(u){for(;;){var s=u.text.indexOf(">",u.ch);if(s==-1){if(L(u))continue;return}if(!D(u,s+1)){u.ch=s+1;continue}var i=u.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(u.text.slice(i+1,s));return u.ch=s+1,n?"selfClose":"regular"}}function m(u){for(;;){var s=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(s==-1){if(A(u))continue;return}if(!D(u,s+1)){u.ch=s;continue}P.lastIndex=s,u.ch=s;var i=P.exec(u.text);if(i&&i.index==s)return i}}function h(u){for(;;){P.lastIndex=u.ch;var s=P.exec(u.text);if(!s){if(L(u))continue;return}if(!D(u,s.index+1)){u.ch=s.index+1;continue}return u.ch=s.index+s[0].length,s}}function d(u){for(;;){var s=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(s==-1){if(A(u))continue;return}if(!D(u,s+1)){u.ch=s;continue}var i=u.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(u.text.slice(i+1,s));return u.ch=s+1,n?"selfClose":"regular"}}function o(u,s){for(var i=[];;){var n=h(u),S,C=u.line,x=u.ch-(n?n[0].length:0);if(!n||!(S=b(u)))return;if(S=="selfClose")continue;if(n[1]){for(var w=i.length-1;w>=0;--w)if(i[w]==n[2]){i.length=w;break}if(w<0&&(!s||s==n[2]))return{tag:n[2],from:z(C,x),to:z(u.line,u.ch)}}else i.push(n[2])}}function a(u,s){for(var i=[];;){var n=d(u);if(!n)return;if(n=="selfClose"){m(u);continue}var S=u.line,C=u.ch,x=m(u);if(!x)return;if(x[1])i.push(x[2]);else{for(var w=i.length-1;w>=0;--w)if(i[w]==x[2]){i.length=w;break}if(w<0&&(!s||s==x[2]))return{tag:x[2],from:z(u.line,u.ch),to:z(S,C)}}}}Q.registerHelper("fold","xml",function(u,s){for(var i=new F(u,s.line,0);;){var n=h(i);if(!n||i.line!=s.line)return;var S=b(i);if(!S)return;if(!n[1]&&S!="selfClose"){var C=z(i.line,i.ch),x=o(i,n[2]);return x&&I(x.from,C)>0?{from:C,to:x.from}:null}}}),Q.findMatchingTag=function(u,s,i){var n=new F(u,s.line,s.ch,i);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var S=b(n),C=S&&z(n.line,n.ch),x=S&&m(n);if(!S||!x||I(n,s)>0)return;var w={from:z(n.line,n.ch),to:C,tag:x[2]};return S=="selfClose"?{open:w,close:null,at:"open"}:x[1]?{open:a(n,x[2]),close:w,at:"close"}:(n=new F(u,C.line,C.ch,i),{open:w,close:o(n,x[2]),at:"open"})},Q.findEnclosingTag=function(u,s,i,n){for(var S=new F(u,s.line,s.ch,i);;){var C=a(S,n);if(!C)break;var x=new F(u,s.line,s.ch,i),w=o(x,C.tag);if(w)return{open:C,close:w}}},Q.scanForClosingTag=function(u,s,i,n){var S=new F(u,s.line,s.ch,n?{from:0,to:n}:null);return o(S,i)}})},p5ED:function(zt,Ke,M){"use strict";var Q=M("+L6B"),z=M("2/Rp"),I=M("5Dmo"),B=M("3S7+"),R=M("k1fw"),P=M("tJVT"),F=M("cDcd"),D=M.n(F),L=M("vHTk"),A=M.n(L),b=M("yEEn"),m=M("ZW9T"),h=M("1vsH");Ke.a=function(d){var o=d.name,a=d.data,u=d.theme,s=d.type,i=d.filename,n=d.monacoEditor,S=d.className,C=d.style,x=d.close,w=d.onClose,T=d.hasMask,_=Object(F.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),y=Object(P.a)(_,2),f=y[0],c=y[1],v=Object(F.useState)(""),p=Object(P.a)(v,2),E=p[0],k=p[1],U,H=1024*1024,W=10*H,j=Object(F.useRef)();s==="office"&&(U=Object(h.V)(a).filesize,U>W&&(s="other")),i&&(n.filename=i),Object(F.useEffect)(function(){var Y,ee,se=(Y=document.cookie)===null||Y===void 0||((ee=Y.replace(/\s/g,""))===null||ee===void 0)?void 0:ee.split(";");se==null||se.map(function(Be){var me=Be.split("=");me[0]==="_educoder_session"&&k(me[1])})},[]);var O=function(){if(a.startsWith("http")||a.startsWith("/")){K();return}Object(h.z)(i||"educoder",a,i)},K=function(){Object(h.x)(i||o,a)};return console.log("data:",a,"fileanme:",i," name:",o),D.a.createElement("div",{style:Object(R.a)({},C||{}),className:"".concat(T&&A.a.bgBlack," ").concat(s?A.a.wrp:"hide")},x&&D.a.createElement("div",{className:A.a.close,ref:j},D.a.createElement(B.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return j.current}},D.a.createElement("span",{onClick:K},D.a.createElement("i",{className:"icon-quxiaozhiding"}))),D.a.createElement(B.a,{title:"\u5173\u95ED",getPopupContainer:function(){return j.current}},D.a.createElement("span",{className:"",onClick:w},D.a.createElement("i",{className:"icon-guanbi1"})))),D.a.createElement("div",{className:"".concat(A.a[S]," ").concat(S," ").concat(A.a.monaco," ").concat(s==="txt"?"show":"hide")},s==="txt"&&D.a.createElement(m.b,n)),s==="audio"&&D.a.createElement("audio",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?a:"data:audio/mp3;base64,").concat(a),autoPlay:!0}),s==="video"&&D.a.createElement(D.a.Fragment,null,a!=null&&a.startsWith("/")?D.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):D.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),s==="html"&&D.a.createElement("iframe",{src:a+"&disposition=inline"}),s==="pdf"&&D.a.createElement("embed",{className:A.a.embed,src:a}),s==="image"&&D.a.createElement(D.a.Fragment,null,D.a.createElement("img",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(a)})),s==="other"&&D.a.createElement("div",null,D.a.createElement(z.a,{type:"primary",size:"large",onClick:O},D.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(s==="download"||s==="office")&&D.a.createElement(z.a,{type:"primary",size:"large",onClick:O},D.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(zt,Ke,M){},psGv:function(zt,Ke,M){var Q,z;(function(){var I;(function(){"use strict";var F=[,,function(b){function m(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var o=new m(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},m.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},m.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},m.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},m.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function h(o,a){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}h.prototype.get_indent_size=function(o,a){var u=this.__base_string_length;return a=a||0,o<0&&(u=0),u+=o*this.__indent_size,u+=a,u},h.prototype.get_indent_string=function(o,a){var u=this.__base_string;return a=a||0,o<0&&(o=0,u=""),a+=o*this.__indent_size,this.__ensure_cache(a),u+=this.__cache[a],u},h.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var o=this.__cache.length,a=0,u="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,u=new Array(a+1).join(this.__indent_string)),o&&(u+=new Array(o+1).join(" ")),this.__cache.push(u)};function d(o,a){this.__indent_cache=new h(o,a),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},d.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(u=u.replace(/[\n]/g,o)),u},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.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(" "))},d.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(o,a){for(var u=this.__lines.length-2;u>=0;){var s=this.__lines[u];if(s.is_empty())break;if(s.item(0).indexOf(o)!==0&&s.item(-1)!==a){this.__lines.splice(u+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},b.exports.Output=d},function(b){function m(h,d,o,a){this.type=h,this.text=d,this.comments_before=null,this.newlines=o||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=m},,,function(b){function m(o,a){this.raw_options=h(o,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(o,a){var u=this.raw_options[o],s=a||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(s=u.concat()):typeof u=="string"&&(s=u.split(/[^a-zA-Z0-9_\/\-]+/)),s},m.prototype._get_boolean=function(o,a){var u=this.raw_options[o],s=u===void 0?!!a:!!u;return s},m.prototype._get_characters=function(o,a){var u=this.raw_options[o],s=a||"";return typeof u=="string"&&(s=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},m.prototype._get_number=function(o,a){var u=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(u,10);return isNaN(s)&&(s=a),s},m.prototype._get_selection=function(o,a,u){var s=this._get_selection_list(o,a,u);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return s[0]},m.prototype._get_selection_list=function(o,a,u){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[a[0]],!this._is_valid_selection(u,a))throw new Error("Invalid Default Value!");var s=this._get_array(o,u);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return s},m.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(u){return a.indexOf(u)===-1})};function h(o,a){var u={};o=d(o);var s;for(s in o)s!==a&&(u[s]=o[s]);if(a&&o[a])for(s in o[a])u[s]=o[a][s];return u}function d(o){var a={},u;for(u in o){var s=u.replace(/-/g,"_");a[s]=o[u]}return a}b.exports.Options=m,b.exports.normalizeOpts=d,b.exports.mergeOpts=h},,function(b){var m=RegExp.prototype.hasOwnProperty("sticky");function h(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},h.prototype.peek=function(d){var o=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(o=this.__input.charAt(d)),o},h.prototype.__match=function(d,o){d.lastIndex=o;var a=d.exec(this.__input);return a&&!(m&&d.sticky)&&(a.index!==o&&(a=null)),a},h.prototype.test=function(d,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(d,o):!1},h.prototype.testChar=function(d,o){var a=this.peek(o);return d.lastIndex=0,a!==null&&d.test(a)},h.prototype.match=function(d){var o=this.__match(d,this.__position);return o?this.__position+=o[0].length:o=null,o},h.prototype.read=function(d,o,a){var u="",s;return d&&(s=this.match(d),s&&(u+=s[0])),o&&(s||!d)&&(u+=this.readUntil(o,a)),u},h.prototype.readUntil=function(d,o){var a="",u=this.__position;d.lastIndex=this.__position;var s=d.exec(this.__input);return s?(u=s.index,o&&(u+=s[0].length)):u=this.__input_length,a=this.__input.substring(this.__position,u),this.__position=u,a},h.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},h.prototype.get_regexp=function(d,o){var a=null,u="g";return o&&m&&(u="y"),typeof d=="string"&&d!==""?a=new RegExp(d,u):d&&(a=new RegExp(d.source,u)),a},h.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(d){var o=this.__position,a=this.readUntilAfter(d);return this.__position=o,a},h.prototype.lookBack=function(d){var o=this.__position-1;return o>=d.length&&this.__input.substring(o-d.length,o).toLowerCase()===d},b.exports.InputScanner=h},function(b,m,h){var d=h(8).InputScanner,o=h(3).Token,a=h(10).TokenStream,u=h(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(n,S){this._input=new d(n),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var n,S=new o(s.START,""),C=null,x=[],w=new a;S.type!==s.EOF;){for(n=this._get_next_token(S,C);this._is_comment(n);)w.add(n),n=this._get_next_token(S,C);w.isEmpty()||(n.comments_before=w,w=new a),n.parent=C,this._is_opening(n)?(x.push(C),C=n):C&&this._is_closing(n,C)&&(n.opened=C,C.closed=n,C=x.pop(),n.parent=C),n.previous=S,S.next=n,this.__tokens.add(n),S=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,S){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(s.RAW,C):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,S){return!1},i.prototype._create_token=function(n,S){var C=new o(n,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=i,b.exports.TOKEN=s},function(b){function m(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},m.prototype.peek=function(h){var d=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(d=this.__tokens[h]),d},m.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},b.exports.TokenStream=m},function(b,m,h){var d=h(12).Pattern;function o(a,u){d.call(this,a,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new d,o.prototype.__set_whitespace_patterns=function(a,u){a+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var u=this.__split(this._newline_regexp,a);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return a},o.prototype.matching=function(a,u){var s=this._create();return s.__set_whitespace_patterns(a,u),s._update(),s},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(a,u){a.lastIndex=0;for(var s=0,i=[],n=a.exec(u);n;)i.push(u.substring(s,n.index)),s=n.index+n[0].length,n=a.exec(u);return s<u.length?i.push(u.substring(s,u.length)):i.push(""),i},b.exports.WhitespacePattern=o},function(b){function m(h,d){this._input=h,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}m.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(h){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(h),d._update(),d},m.prototype.until=function(h){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(h),d._update(),d},m.prototype.starting_with=function(h){var d=this._create();return d._starting_pattern=this._input.get_regexp(h,!0),d._update(),d},m.prototype.matching=function(h){var d=this._create();return d._match_pattern=this._input.get_regexp(h,!0),d._update(),d},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},b.exports.Pattern=m},function(b){function m(h,d){h=typeof h=="string"?h:h.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+d,"g")}m.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(h);o;)d[o[1]]=o[2],o=this.__directive_pattern.exec(h);return d},m.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=m},function(b,m,h){var d=h(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(u,s){d.call(this,u,s),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),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 d(u);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}/)}}a.prototype=new d,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(u){var s=this._create();return s._disabled[u]=!0,s._update(),s},a.prototype.read_options=function(u){var s=this._create();for(var i in o)s._disabled[i]=u.templating.indexOf(i)===-1;return s._update(),s},a.prototype.exclude=function(u){var s=this._create();return s._excluded[u]=!0,s._update(),s},a.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=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),u+=s,s=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},a.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},a.prototype._read_template=function(){var u="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(u=u||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},b.exports.TemplatablePattern=a},,,,function(b,m,h){var d=h(19).Beautifier,o=h(20).Options;function a(u,s,i,n){var S=new d(u,s,i,n);return S.beautify()}b.exports=a,b.exports.defaultOptions=function(){return new o}},function(b,m,h){var d=h(20).Options,o=h(2).Output,a=h(21).Tokenizer,u=h(21).TOKEN,s=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,n=function(v,p){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=v.max_preserve_newlines,this.preserve_newlines=v.preserve_newlines,this._output=new o(v,p)};n.prototype.current_line_has_match=function(v){return this._output.current_line.has_match(v)},n.prototype.set_space_before_token=function(v,p){this._output.space_before_token=v,this._output.non_breaking_space=p},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(v){this._output.add_raw_token(v)},n.prototype.print_preserved_newlines=function(v){var p=0;v.type!==u.TEXT&&v.previous.type!==u.TEXT&&(p=v.newlines?1:0),this.preserve_newlines&&(p=v.newlines<this.max_preserve_newlines+1?v.newlines:this.max_preserve_newlines+1);for(var E=0;E<p;E++)this.print_newline(E>0);return p!==0},n.prototype.traverse_whitespace=function(v){return v.whitespace_before||v.newlines?(this.print_preserved_newlines(v)||(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(v){this._output.add_new_line(v)},n.prototype.print_token=function(v){v.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(v.text))},n.prototype.indent=function(){this.indent_level++},n.prototype.get_full_indent=function(v){return v=this.indent_level+(v||0),v<1?"":this._output.get_indent_string(v)};var S=function(v){for(var p=null,E=v.next;E.type!==u.EOF&&v.closed!==E;){if(E.type===u.ATTRIBUTE&&E.text==="type"){E.next&&E.next.type===u.EQUALS&&E.next.next&&E.next.next.type===u.VALUE&&(p=E.next.next.text);break}E=E.next}return p},C=function(v,p){var E=null,k=null;return p.closed?(v==="script"?E="text/javascript":v==="style"&&(E="text/css"),E=S(p)||E,E.search("text/css")>-1?k="css":E.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?k="javascript":E.search(/(text|application|dojo)\/(x-)?(html)/)>-1?k="html":E.search(/test\/null/)>-1&&(k="null"),k):null};function x(v,p){return p.indexOf(v)!==-1}function w(v,p,E){this.parent=v||null,this.tag=p?p.tag_name:"",this.indent_level=E||0,this.parser_token=p||null}function T(v){this._printer=v,this._current_frame=null}T.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},T.prototype.record_tag=function(v){var p=new w(this._current_frame,v,this._printer.indent_level);this._current_frame=p},T.prototype._try_pop_frame=function(v){var p=null;return v&&(p=v.parser_token,this._printer.indent_level=v.indent_level,this._current_frame=v.parent),p},T.prototype._get_frame=function(v,p){for(var E=this._current_frame;E&&!(v.indexOf(E.tag)!==-1);){if(p&&p.indexOf(E.tag)!==-1){E=null;break}E=E.parent}return E},T.prototype.try_pop=function(v,p){var E=this._get_frame([v],p);return this._try_pop_frame(E)},T.prototype.indent_to_tag=function(v){var p=this._get_frame(v);p&&(this._printer.indent_level=p.indent_level)};function _(v,p,E,k){this._source_text=v||"",p=p||{},this._js_beautify=E,this._css_beautify=k,this._tag_stack=null;var U=new d(p,"html");this._options=U,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,p=this._options.eol;this._options.eol==="auto"&&(p=`
|
|
`,v&&s.test(v)&&(p=v.match(s)[0])),v=v.replace(i,`
|
|
`);var E=v.match(/^[\t ]*/)[0],k={text:"",type:""},U=new y,H=new n(this._options,E),W=new a(v,this._options).tokenize();this._tag_stack=new T(H);for(var j=null,O=W.next();O.type!==u.EOF;)O.type===u.TAG_OPEN||O.type===u.COMMENT?(j=this._handle_tag_open(H,O,U,k),U=j):O.type===u.ATTRIBUTE||O.type===u.EQUALS||O.type===u.VALUE||O.type===u.TEXT&&!U.tag_complete?j=this._handle_inside_tag(H,O,U,W):O.type===u.TAG_CLOSE?j=this._handle_tag_close(H,O,U):O.type===u.TEXT?j=this._handle_text(H,O,U):H.add_raw_token(O),k=j,O=W.next();var K=H._output.get_code(p);return K},_.prototype._handle_tag_close=function(v,p,E){var k={text:p.text,type:p.type};return v.alignment_size=0,E.tag_complete=!0,v.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),E.is_unformatted?v.add_raw_token(p):(E.tag_start_char==="<"&&(v.set_space_before_token(p.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&E.has_wrapped_attrs&&v.print_newline(!1)),v.print_token(p)),E.indent_content&&!(E.is_unformatted||E.is_content_unformatted)&&(v.indent(),E.indent_content=!1),!E.is_inline_element&&!(E.is_unformatted||E.is_content_unformatted)&&v.set_wrap_point(),k},_.prototype._handle_inside_tag=function(v,p,E,k){var U=E.has_wrapped_attrs,H={text:p.text,type:p.type};if(v.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),E.is_unformatted)v.add_raw_token(p);else if(E.tag_start_char==="{"&&p.type===u.TEXT)v.print_preserved_newlines(p)?(p.newlines=0,v.add_raw_token(p)):v.print_token(p);else{if(p.type===u.ATTRIBUTE?(v.set_space_before_token(!0),E.attr_count+=1):(p.type===u.EQUALS||p.type===u.VALUE&&p.previous.type===u.EQUALS)&&v.set_space_before_token(!1),p.type===u.ATTRIBUTE&&E.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(v.traverse_whitespace(p),U=U||p.newlines!==0),this._is_wrap_attributes_force)){var W=E.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&E.attr_count===1){var j=!0,O=0,K;do{if(K=k.peek(O),K.type===u.ATTRIBUTE){j=!1;break}O+=1}while(O<4&&K.type!==u.EOF&&K.type!==u.TAG_CLOSE);W=!j}W&&(v.print_newline(!1),U=!0)}v.print_token(p),U=U||v.previous_token_wrapped(),E.has_wrapped_attrs=U}return H},_.prototype._handle_text=function(v,p,E){var k={text:p.text,type:"TK_CONTENT"};return E.custom_beautifier_name?this._print_custom_beatifier_text(v,p,E):E.is_unformatted||E.is_content_unformatted?v.add_raw_token(p):(v.traverse_whitespace(p),v.print_token(p)),k},_.prototype._print_custom_beatifier_text=function(v,p,E){var k=this;if(p.text!==""){var U=p.text,H,W=1,j="",O="";E.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?H=this._js_beautify:E.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?H=this._css_beautify:E.custom_beautifier_name==="html"&&(H=function(me,xe){var Le=new _(me,xe,k._js_beautify,k._css_beautify);return Le.beautify()}),this._options.indent_scripts==="keep"?W=0:this._options.indent_scripts==="separate"&&(W=-v.indent_level);var K=v.get_full_indent(W);if(U=U.replace(/\n[ \t]*$/,""),E.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var Y=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!Y){v.add_raw_token(p);return}j=K+Y[1]+`
|
|
`,U=Y[4],Y[5]&&(O=K+Y[5]),U=U.replace(/\n[ \t]*$/,""),(Y[2]||Y[3].indexOf(`
|
|
`)!==-1)&&(Y=Y[3].match(/[ \t]+$/),Y&&(p.whitespace_before=Y[0]))}if(U)if(H){var ee=function(){this.eol=`
|
|
`};ee.prototype=this._options.raw_options;var se=new ee;U=H(K+U,se)}else{var Be=p.whitespace_before;Be&&(U=U.replace(new RegExp(`
|
|
(`+Be+")?","g"),`
|
|
`)),U=K+U.replace(/\n/g,`
|
|
`+K)}j&&(U?U=j+U+`
|
|
`+O:U=j+O),v.print_newline(!1),U&&(p.text=U,p.whitespace_before="",p.newlines=0,v.add_raw_token(p),v.print_newline(!0))}},_.prototype._handle_tag_open=function(v,p,E,k){var U=this._get_tag_open_token(p);return(E.is_unformatted||E.is_content_unformatted)&&!E.is_empty_element&&p.type===u.TAG_OPEN&&p.text.indexOf("</")===0?(v.add_raw_token(p),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(v.traverse_whitespace(p),this._set_tag_position(v,p,U,E,k),U.is_inline_element||v.set_wrap_point(),v.print_token(p)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=p.text.length+1),!U.tag_complete&&!U.is_unformatted&&(v.alignment_size=U.alignment_size),U};var y=function(v,p){if(this.parent=v||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="",!p)this.tag_complete=!0;else{var E;this.tag_start_char=p.text[0],this.text=p.text,this.tag_start_char==="<"?(E=p.text.match(/^<([^\s>]*)/),this.tag_check=E?E[1]:""):(E=p.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=E?E[1]:"",(p.text.startsWith("{{#>")||p.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&p.next!==null?this.tag_check=p.next.text.split(" ")[0]:this.tag_check=p.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),p.type===u.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||p.closed&&p.closed.text==="/>";var k=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(k=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(k)))}};_.prototype._get_tag_open_token=function(v){var p=new y(this._tag_stack.get_parser_token(),v);return p.alignment_size=this._options.wrap_attributes_indent_size,p.is_end_tag=p.is_end_tag||x(p.tag_check,this._options.void_elements),p.is_empty_element=p.tag_complete||p.is_start_tag&&p.is_end_tag,p.is_unformatted=!p.tag_complete&&x(p.tag_check,this._options.unformatted),p.is_content_unformatted=!p.is_empty_element&&x(p.tag_check,this._options.content_unformatted),p.is_inline_element=x(p.tag_name,this._options.inline)||p.tag_name.includes("-")||p.tag_start_char==="{",p},_.prototype._set_tag_position=function(v,p,E,k,U){if(E.is_empty_element||(E.is_end_tag?E.start_tag_token=this._tag_stack.try_pop(E.tag_name):(this._do_optional_end_element(E)&&(E.is_inline_element||v.print_newline(!1)),this._tag_stack.record_tag(E),(E.tag_name==="script"||E.tag_name==="style")&&!(E.is_unformatted||E.is_content_unformatted)&&(E.custom_beautifier_name=C(E.tag_check,p)))),x(E.tag_check,this._options.extra_liners)&&(v.print_newline(!1),v._output.just_added_blankline()||v.print_newline(!0)),E.is_empty_element){if(E.tag_start_char==="{"&&E.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),E.indent_content=!0;var H=v.current_line_has_match(/{{#if/);H||v.print_newline(!1)}E.tag_name==="!--"&&U.type===u.TAG_CLOSE&&k.is_end_tag&&E.text.indexOf(`
|
|
`)===-1||(E.is_inline_element||E.is_unformatted||v.print_newline(!1),this._calcluate_parent_multiline(v,E))}else if(E.is_end_tag){var W=!1;W=E.start_tag_token&&E.start_tag_token.multiline_content,W=W||!E.is_inline_element&&!(k.is_inline_element||k.is_unformatted)&&!(U.type===u.TAG_CLOSE&&E.start_tag_token===k)&&U.type!=="TK_CONTENT",(E.is_content_unformatted||E.is_unformatted)&&(W=!1),W&&v.print_newline(!1)}else E.indent_content=!E.custom_beautifier_name,E.tag_start_char==="<"&&(E.tag_name==="html"?E.indent_content=this._options.indent_inner_html:E.tag_name==="head"?E.indent_content=this._options.indent_head_inner_html:E.tag_name==="body"&&(E.indent_content=this._options.indent_body_inner_html)),!(E.is_inline_element||E.is_unformatted)&&(U.type!=="TK_CONTENT"||E.is_content_unformatted)&&v.print_newline(!1),this._calcluate_parent_multiline(v,E)},_.prototype._calcluate_parent_multiline=function(v,p){p.parent&&v._output.just_added_newline()&&!((p.is_inline_element||p.is_unformatted)&&p.parent.is_inline_element)&&(p.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"],c=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(v){var p=null;if(v.is_empty_element||!v.is_start_tag||!v.parent)return;if(v.tag_name==="body")p=p||this._tag_stack.try_pop("head");else if(v.tag_name==="li")p=p||this._tag_stack.try_pop("li",["ol","ul"]);else if(v.tag_name==="dd"||v.tag_name==="dt")p=p||this._tag_stack.try_pop("dt",["dl"]),p=p||this._tag_stack.try_pop("dd",["dl"]);else if(v.parent.tag_name==="p"&&f.indexOf(v.tag_name)!==-1){var E=v.parent.parent;(!E||c.indexOf(E.tag_name)===-1)&&(p=p||this._tag_stack.try_pop("p"))}else v.tag_name==="rp"||v.tag_name==="rt"?(p=p||this._tag_stack.try_pop("rt",["ruby","rtc"]),p=p||this._tag_stack.try_pop("rp",["ruby","rtc"])):v.tag_name==="optgroup"?p=p||this._tag_stack.try_pop("optgroup",["select"]):v.tag_name==="option"?p=p||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):v.tag_name==="colgroup"?p=p||this._tag_stack.try_pop("caption",["table"]):v.tag_name==="thead"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"])):v.tag_name==="tbody"||v.tag_name==="tfoot"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("thead",["table"]),p=p||this._tag_stack.try_pop("tbody",["table"])):v.tag_name==="tr"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(v.tag_name==="th"||v.tag_name==="td")&&(p=p||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),p=p||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return v.parent=this._tag_stack.get_parser_token(),p},b.exports.Beautifier=_},function(b,m,h){var d=h(6).Options;function o(a){d.call(this,a,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new d,b.exports.Options=o},function(b,m,h){var d=h(9).Tokenizer,o=h(9).TOKEN,a=h(13).Directives,u=h(14).TemplatablePattern,s=h(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:o.START,RAW:o.RAW,EOF:o.EOF},n=new a(/<\!--/,/-->/),S=function(C,x){d.call(this,C,x),this._current_tag_name="";var w=new u(this._input).read_options(this._options),T=new s(this._input);if(this.__patterns={word:w.until(/[\n\r\t <]/),single_quote:w.until_after(/'/),double_quote:w.until_after(/"/),attribute:w.until(/[\n\r\t =>]|\/>/),element_name:w.until(/[\n\r\t >\/]/),handlebars_comment:T.starting_with(/{{!--/).until_after(/--}}/),handlebars:T.starting_with(/{{/).until_after(/}}/),handlebars_open:T.until(/[\n\r\t }]/),handlebars_raw_close:T.until(/}}/),comment:T.starting_with(/<!--/).until_after(/-->/),cdata:T.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:T.starting_with(/<!\[/).until_after(/]>/),processing:T.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 _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=T.matching(_).until_after(_)}};S.prototype=new d,S.prototype._is_comment=function(C){return!1},S.prototype._is_opening=function(C){return C.type===i.TAG_OPEN},S.prototype._is_closing=function(C,x){return C.type===i.TAG_CLOSE&&x&&((C.text===">"||C.text==="/>")&&x.text[0]==="<"||C.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(C,x){var w=null;this._readWhitespace();var T=this._input.peek();return T===null?this._create_token(i.EOF,""):(w=w||this._read_open_handlebars(T,x),w=w||this._read_attribute(T,C,x),w=w||this._read_close(T,x),w=w||this._read_raw_content(T,C,x),w=w||this._read_content_word(T),w=w||this._read_comment_or_cdata(T),w=w||this._read_processing(T),w=w||this._read_open(T,x),w=w||this._create_token(i.UNKNOWN,this._input.next()),w)},S.prototype._read_comment_or_cdata=function(C){var x=null,w=null,T=null;if(C==="<"){var _=this._input.peek(1);_==="!"&&(w=this.__patterns.comment.read(),w?(T=n.get_directives(w),T&&T.ignore==="start"&&(w+=n.readIgnored(this._input))):w=this.__patterns.cdata.read()),w&&(x=this._create_token(i.COMMENT,w),x.directives=T)}return x},S.prototype._read_processing=function(C){var x=null,w=null,T=null;if(C==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(w=this.__patterns.conditional_comment.read(),w=w||this.__patterns.processing.read()),w&&(x=this._create_token(i.COMMENT,w),x.directives=T)}return x},S.prototype._read_open=function(C,x){var w=null,T=null;return x||C==="<"&&(w=this._input.next(),this._input.peek()==="/"&&(w+=this._input.next()),w+=this.__patterns.element_name.read(),T=this._create_token(i.TAG_OPEN,w)),T},S.prototype._read_open_handlebars=function(C,x){var w=null,T=null;return x||this._options.indent_handlebars&&C==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(w=this.__patterns.handlebars_comment.read(),w=w||this.__patterns.handlebars.read(),T=this._create_token(i.COMMENT,w)):(w=this.__patterns.handlebars_open.read(),T=this._create_token(i.TAG_OPEN,w))),T},S.prototype._read_close=function(C,x){var w=null,T=null;return x&&(x.text[0]==="<"&&(C===">"||C==="/"&&this._input.peek(1)===">")?(w=this._input.next(),C==="/"&&(w+=this._input.next()),T=this._create_token(i.TAG_CLOSE,w)):x.text[0]==="{"&&C==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),T=this._create_token(i.TAG_CLOSE,"}}"))),T},S.prototype._read_attribute=function(C,x,w){var T=null,_="";if(w&&w.text[0]==="<")if(C==="=")T=this._create_token(i.EQUALS,this._input.next());else if(C==='"'||C==="'"){var y=this._input.next();C==='"'?y+=this.__patterns.double_quote.read():y+=this.__patterns.single_quote.read(),T=this._create_token(i.VALUE,y)}else _=this.__patterns.attribute.read(),_&&(x.type===i.EQUALS?T=this._create_token(i.VALUE,_):T=this._create_token(i.ATTRIBUTE,_));return T},S.prototype._is_content_unformatted=function(C){return this._options.void_elements.indexOf(C)===-1&&(this._options.content_unformatted.indexOf(C)!==-1||this._options.unformatted.indexOf(C)!==-1)},S.prototype._read_raw_content=function(C,x,w){var T="";if(w&&w.text[0]==="{")T=this.__patterns.handlebars_raw_close.read();else if(x.type===i.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var _=x.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var y=this._read_comment_or_cdata(C);if(y)return y.type=i.TEXT,y;T=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(T=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return T?this._create_token(i.TEXT,T):null},S.prototype._read_content_word=function(C){var x="";if(this._options.unformatted_content_delimiter&&(C===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(i.TEXT,x)},b.exports.Tokenizer=S,b.exports.TOKEN=i}],D={};function L(b){var m=D[b];if(m!==void 0)return m.exports;var h=D[b]={exports:{}};return F[b](h,h.exports,L),h.exports}var A=L(18);I=A})();var B=I;if(!0)!(Q=[M,M("6UM0"),M("TXwP")],z=function(F){var D=M("6UM0"),L=M("TXwP");return{html_beautify:function(A,b){return B(A,b,D.js_beautify,L.css_beautify)}}}.apply(Ke,Q),z!==void 0&&(zt.exports=z));else var R,P})()},"rAM+":function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return z});var Q=M("Qw5x");function z(I,B){var R;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(R=Object(Q.a)(I))||B&&I&&typeof I.length=="number"){R&&(I=R);var P=0,F=function(){};return{s:F,n:function(){return P>=I.length?{done:!0}:{done:!1,value:I[P++]}},e:function(m){throw m},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D=!0,L=!1,A;return{s:function(){R=I[Symbol.iterator]()},n:function(){var m=R.next();return D=m.done,m},e:function(m){L=!0,A=m},f:function(){try{!D&&R.return!=null&&R.return()}finally{if(L)throw A}}}}},rUJ1:function(zt,Ke){const M=/[&<>"']/,Q=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,B={"&":"&","<":"<",">":">",'"':""","'":"'"},R=T=>B[T];function P(T,_){if(_){if(M.test(T))return T.replace(Q,R)}else if(z.test(T))return T.replace(I,R);return T}const F=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function D(T){return T.replace(F,(_,y)=>(y=y.toLowerCase(),y==="colon"?":":y.charAt(0)==="#"?y.charAt(1)==="x"?String.fromCharCode(parseInt(y.substring(2),16)):String.fromCharCode(+y.substring(1)):""))}const L=/(^|[^\[])\^/g;function A(T,_){T=T.source||T,_=_||"";const y={replace:(f,c)=>(c=c.source||c,c=c.replace(L,"$1"),T=T.replace(f,c),y),getRegex:()=>new RegExp(T,_)};return y}const b=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(T,_,y){if(T){let f;try{f=decodeURIComponent(D(y)).replace(b,"").toLowerCase()}catch(c){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}_&&!m.test(y)&&(y=s(_,y));try{y=encodeURI(y).replace(/%25/g,"%")}catch(f){return null}return y}const d={},o=/^[^:]+:\/*[^/]*$/,a=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(T,_){d[" "+T]||(o.test(T)?d[" "+T]=T+"/":d[" "+T]=C(T,"/",!0)),T=d[" "+T];const y=T.indexOf(":")===-1;return _.substring(0,2)==="//"?y?_:T.replace(a,"$1")+_:_.charAt(0)==="/"?y?_:T.replace(u,"$1")+_:T+_}const i={exec:function(){}};function n(T){let _=1,y,f;for(;_<arguments.length;_++){y=arguments[_];for(f in y)Object.prototype.hasOwnProperty.call(y,f)&&(T[f]=y[f])}return T}function S(T,_){const y=T.replace(/\|/g,(v,p,E)=>{let k=!1,U=p;for(;--U>=0&&E[U]==="\\";)k=!k;return k?"|":" |"}),f=y.split(/ \|/);let c=0;if(f.length>_)f.splice(_);else for(;f.length<_;)f.push("");for(;c<f.length;c++)f[c]=f[c].trim().replace(/\\\|/g,"|");return f}function C(T,_,y){const f=T.length;if(f===0)return"";let c=0;for(;c<f;){const v=T.charAt(f-c-1);if(v===_&&!y)c++;else if(v!==_&&y)c++;else break}return T.substr(0,f-c)}function x(T,_){if(T.indexOf(_[1])===-1)return-1;const y=T.length;let f=0,c=0;for(;c<y;c++)if(T[c]==="\\")c++;else if(T[c]===_[0])f++;else if(T[c]===_[1]&&(f--,f<0))return c;return-1}function w(T){T&&T.sanitize&&!T.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")}zt.exports={escape:P,unescape:D,edit:A,cleanUrl:h,resolveUrl:s,noopTest:i,merge:n,splitCells:S,rtrim:C,findClosingBracket:x,checkSanitizeDeprecation:w}},sR1s:function(zt,Ke,M){"use strict";M.d(Ke,"b",function(){return B}),M.d(Ke,"a",function(){return R}),M.d(Ke,"c",function(){return P}),M.d(Ke,"d",function(){return F});var Q=M("U8pU"),z="RC_TABLE_KEY";function I(D){return D==null?[]:Array.isArray(D)?D:[D]}function B(D,L){if(!L&&typeof L!="number")return D;for(var A=I(L),b=D,m=0;m<A.length;m+=1){if(!b)return null;var h=A[m];b=b[h]}return b}function R(D){var L=[],A={};return D.forEach(function(b){for(var m=b||{},h=m.key,d=m.dataIndex,o=h||I(d).join("-")||z;A[o];)o="".concat(o,"_next");A[o]=!0,L.push(o)}),L}function P(){var D={};function L(h,d){d&&Object.keys(d).forEach(function(o){var a=d[o];a&&Object(Q.a)(a)==="object"?(h[o]=h[o]||{},L(h[o],a)):h[o]=a})}for(var A=arguments.length,b=new Array(A),m=0;m<A;m++)b[m]=arguments[m];return b.forEach(function(h){L(D,h)}),D}function F(D){return D!=null}},sboe:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return I});var Q=M("cDcd"),z=M.n(Q),I=Q.createContext(null)},t23M:function(zt,Ke,M){"use strict";var Q=M("VTBJ"),z=M("1OyB"),I=M("vuIU"),B=M("Ji7U"),R=M("LK+K"),P=M("cDcd"),F=M.n(P),D=M("m+aA"),L=M("Zm9Q"),A=M("Kwbf"),b=M("c+Xe"),m=M("bdgK"),h="rc-observer-key",d=function(o){Object(B.a)(u,o);var a=Object(R.a)(u);function u(){var s;return Object(z.a)(this,u),s=a.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,S=i[0].target,C=S.getBoundingClientRect(),x=C.width,w=C.height,T=S.offsetWidth,_=S.offsetHeight,y=Math.floor(x),f=Math.floor(w);if(s.state.width!==y||s.state.height!==f||s.state.offsetWidth!==T||s.state.offsetHeight!==_){var c={width:y,height:f,offsetWidth:T,offsetHeight:_};s.setState(c),n&&Promise.resolve().then(function(){n(Object(Q.a)(Object(Q.a)({},c),{},{offsetWidth:T,offsetHeight:_}))})}},s.setChildNode=function(i){s.childNode=i},s}return Object(I.a)(u,[{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(D.a)(this.childNode||this),S=n!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=n),!this.resizeObserver&&n&&(this.resizeObserver=new m.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(L.a)(i);if(n.length>1)Object(A.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(n.length===0)return Object(A.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=n[0];if(P.isValidElement(S)&&Object(b.c)(S)){var C=S.ref;n[0]=P.cloneElement(S,{ref:Object(b.a)(C,this.setChildNode)})}return n.length===1?n[0]:n.map(function(x,w){return!P.isValidElement(x)||"key"in x&&x.key!==null?x:P.cloneElement(x,{key:"".concat(h,"-").concat(w)})})}}]),u}(P.Component);d.displayName="ResizeObserver",Ke.a=d},ulZh:function(zt,Ke,M){typeof window!="undefined"&&function(z,I){zt.exports=I()}(this,function(){return function(Q){var z={};function I(B){if(z[B])return z[B].exports;var R=z[B]={i:B,l:!1,exports:{}};return Q[B].call(R.exports,R,R.exports,I),R.l=!0,R.exports}return I.m=Q,I.c=z,I.d=function(B,R,P){I.o(B,R)||Object.defineProperty(B,R,{enumerable:!0,get:P})},I.r=function(B){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})},I.t=function(B,R){if(R&1&&(B=I(B)),R&8)return B;if(R&4&&typeof B=="object"&&B&&B.__esModule)return B;var P=Object.create(null);if(I.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:B}),R&2&&typeof B!="string")for(var F in B)I.d(P,F,function(D){return B[D]}.bind(null,F));return P},I.n=function(B){var R=B&&B.__esModule?function(){return B.default}:function(){return B};return I.d(R,"a",R),R},I.o=function(B,R){return Object.prototype.hasOwnProperty.call(B,R)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Q,z,I){"use strict";var B=Object.prototype.hasOwnProperty,R="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(R=!1));function F(b,m,h){this.fn=b,this.context=m,this.once=h||!1}function D(b,m,h,d,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var a=new F(h,d||b,o),u=R?R+m:m;return b._events[u]?b._events[u].fn?b._events[u]=[b._events[u],a]:b._events[u].push(a):(b._events[u]=a,b._eventsCount++),b}function L(b,m){--b._eventsCount===0?b._events=new P:delete b._events[m]}function A(){this._events=new P,this._eventsCount=0}A.prototype.eventNames=function(){var m=[],h,d;if(this._eventsCount===0)return m;for(d in h=this._events)B.call(h,d)&&m.push(R?d.slice(1):d);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(h)):m},A.prototype.listeners=function(m){var h=R?R+m:m,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var o=0,a=d.length,u=new Array(a);o<a;o++)u[o]=d[o].fn;return u},A.prototype.listenerCount=function(m){var h=R?R+m:m,d=this._events[h];return d?d.fn?1:d.length:0},A.prototype.emit=function(m,h,d,o,a,u){var s=R?R+m:m;if(!this._events[s])return!1;var i=this._events[s],n=arguments.length,S,C;if(i.fn){i.once&&this.removeListener(m,i.fn,void 0,!0);switch(n){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,h),!0;case 3:return i.fn.call(i.context,h,d),!0;case 4:return i.fn.call(i.context,h,d,o),!0;case 5:return i.fn.call(i.context,h,d,o,a),!0;case 6:return i.fn.call(i.context,h,d,o,a,u),!0}for(C=1,S=new Array(n-1);C<n;C++)S[C-1]=arguments[C];i.fn.apply(i.context,S)}else{var x=i.length,w;for(C=0;C<x;C++){i[C].once&&this.removeListener(m,i[C].fn,void 0,!0);switch(n){case 1:i[C].fn.call(i[C].context);break;case 2:i[C].fn.call(i[C].context,h);break;case 3:i[C].fn.call(i[C].context,h,d);break;case 4:i[C].fn.call(i[C].context,h,d,o);break;default:if(!S)for(w=1,S=new Array(n-1);w<n;w++)S[w-1]=arguments[w];i[C].fn.apply(i[C].context,S)}}}return!0},A.prototype.on=function(m,h,d){return D(this,m,h,d,!1)},A.prototype.once=function(m,h,d){return D(this,m,h,d,!0)},A.prototype.removeListener=function(m,h,d,o){var a=R?R+m:m;if(!this._events[a])return this;if(!h)return L(this,a),this;var u=this._events[a];if(u.fn)u.fn===h&&(!o||u.once)&&(!d||u.context===d)&&L(this,a);else{for(var s=0,i=[],n=u.length;s<n;s++)(u[s].fn!==h||o&&!u[s].once||d&&u[s].context!==d)&&i.push(u[s]);i.length?this._events[a]=i.length===1?i[0]:i:L(this,a)}return this},A.prototype.removeAllListeners=function(m){var h;return m?(h=R?R+m:m,this._events[h]&&L(this,h)):(this._events=new P,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=R,A.EventEmitter=A,Q.exports=A},"./node_modules/url-toolkit/src/url-toolkit.js":function(Q,z,I){(function(B){var R=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,F=/(?:\/|^)\.(?=\/)/g,D=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,L={buildAbsoluteURL:function(A,b,m){if(m=m||{},A=A.trim(),b=b.trim(),!b){if(!m.alwaysNormalize)return A;var h=L.parseURL(A);if(!h)throw new Error("Error trying to parse base URL.");return h.path=L.normalizePath(h.path),L.buildURLFromParts(h)}var d=L.parseURL(b);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return m.alwaysNormalize?(d.path=L.normalizePath(d.path),L.buildURLFromParts(d)):b;var o=L.parseURL(A);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var a=P.exec(o.path);o.netLoc=a[1],o.path=a[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(u.netLoc=o.netLoc,d.path[0]!=="/"))if(!d.path)u.path=o.path,d.params||(u.params=o.params,d.query||(u.query=o.query));else{var s=o.path,i=s.substring(0,s.lastIndexOf("/")+1)+d.path;u.path=L.normalizePath(i)}return u.path===null&&(u.path=m.alwaysNormalize?L.normalizePath(d.path):d.path),L.buildURLFromParts(u)},parseURL:function(A){var b=R.exec(A);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(F,"");A.length!==(A=A.replace(D,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};Q.exports=L})(this)},"./node_modules/webworkify-webpack/index.js":function(Q,z,I){function B(m){var h={};function d(a){if(h[a])return h[a].exports;var u=h[a]={i:a,l:!1,exports:{}};return m[a].call(u.exports,u,u.exports,d),u.l=!0,u.exports}d.m=m,d.c=h,d.i=function(a){return a},d.d=function(a,u,s){d.o(a,u)||Object.defineProperty(a,u,{configurable:!1,enumerable:!0,get:s})},d.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},d.n=function(a){var u=a&&a.__esModule?function(){return a.default}:function(){return a};return d.d(u,"a",u),u},d.o=function(a,u){return Object.prototype.hasOwnProperty.call(a,u)},d.p="/",d.oe=function(a){throw console.error(a),a};var o=d(d.s=ENTRY_MODULE);return o.default||o}var R="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+R+").*?\\)";function F(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function D(m){return!isNaN(1*m)}function L(m,h,d){var o={};o[d]=[];var a=h.toString(),u=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return o;for(var s=u[1],i=new RegExp("(\\\\n|\\W)"+F(s)+P,"g"),n;n=i.exec(a);){if(n[3]==="dll-reference")continue;o[d].push(n[3])}for(i=new RegExp("\\("+F(s)+'\\("(dll-reference\\s('+R+'))"\\)\\)'+P,"g");n=i.exec(a);)m[n[2]]||(o[d].push(n[1]),m[n[2]]=I(n[1]).m),o[n[2]]=o[n[2]]||[],o[n[2]].push(n[4]);for(var S=Object.keys(o),C=0;C<S.length;C++)for(var x=0;x<o[S[C]].length;x++)D(o[S[C]][x])&&(o[S[C]][x]=1*o[S[C]][x]);return o}function A(m){var h=Object.keys(m);return h.reduce(function(d,o){return d||m[o].length>0},!1)}function b(m,h){for(var d={main:[h]},o={main:[]},a={main:{}};A(d);)for(var u=Object.keys(d),s=0;s<u.length;s++){var i=u[s],n=d[i],S=n.pop();if(a[i]=a[i]||{},a[i][S]||!m[i][S])continue;a[i][S]=!0,o[i]=o[i]||[],o[i].push(S);for(var C=L(m,m[i][S],i),x=Object.keys(C),w=0;w<x.length;w++)d[x[w]]=d[x[w]]||[],d[x[w]]=d[x[w]].concat(C[x[w]])}return o}Q.exports=function(m,h){h=h||{};var d={main:I.m},o=h.all?{main:Object.keys(d.main)}:b(d,m),a="";Object.keys(o).filter(function(S){return S!=="main"}).forEach(function(S){for(var C=0;o[S][C];)C++;o[S].push(C),d[S][C]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+S+" = ("+B.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+o[S].map(function(x){return""+JSON.stringify(x)+": "+d[S][x].toString()}).join(",")+`});
|
|
`}),a=a+"new (("+B.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+o.main.map(function(S){return""+JSON.stringify(S)+": "+d.main[S].toString()}).join(",")+"}))(self);";var u=new window.Blob([a],{type:"text/javascript"});if(h.bare)return u;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,i=s.createObjectURL(u),n=new window.Worker(i);return n.objectURL=i,n}},"./src/config.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"hlsDefaultConfig",function(){return w}),I.d(z,"mergeConfig",function(){return _}),I.d(z,"enableStreamingMode",function(){return y});var B=I("./src/controller/abr-controller.ts"),R=I("./src/controller/audio-stream-controller.ts"),P=I("./src/controller/audio-track-controller.ts"),F=I("./src/controller/subtitle-stream-controller.ts"),D=I("./src/controller/subtitle-track-controller.ts"),L=I("./src/controller/buffer-controller.ts"),A=I("./src/controller/timeline-controller.ts"),b=I("./src/controller/cap-level-controller.ts"),m=I("./src/controller/fps-controller.ts"),h=I("./src/controller/eme-controller.ts"),d=I("./src/controller/cmcd-controller.ts"),o=I("./src/utils/xhr-loader.ts"),a=I("./src/utils/fetch-loader.ts"),u=I("./src/utils/cues.ts"),s=I("./src/utils/mediakeys-helper.ts"),i=I("./src/utils/logger.ts");function n(){return n=Object.assign||function(f){for(var c=1;c<arguments.length;c++){var v=arguments[c];for(var p in v)Object.prototype.hasOwnProperty.call(v,p)&&(f[p]=v[p])}return f},n.apply(this,arguments)}function S(f,c){var v=Object.keys(f);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(f);c&&(p=p.filter(function(E){return Object.getOwnPropertyDescriptor(f,E).enumerable})),v.push.apply(v,p)}return v}function C(f){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?S(Object(v),!0).forEach(function(p){x(f,p,v[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(v)):S(Object(v)).forEach(function(p){Object.defineProperty(f,p,Object.getOwnPropertyDescriptor(v,p))})}return f}function x(f,c,v){return c in f?Object.defineProperty(f,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):f[c]=v,f}var w=C(C({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:B.default,bufferController:L.default,capLevelController:b.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},T()),{},{subtitleStreamController:F.SubtitleStreamController,subtitleTrackController:D.default,timelineController:A.TimelineController,audioStreamController:R.default,audioTrackController:P.default,emeController:h.default,cmcdController:d.default});function T(){return{cueHandler:u.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 _(f,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},f,c)}function y(f){var c=f.loader;if(c!==a.default&&c!==o.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var v=Object(a.fetchSupported)();v&&(f.loader=a.default,f.progressive=!0,f.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/polyfills/number.ts"),R=I("./src/utils/ewma-bandwidth-estimator.ts"),P=I("./src/events.ts"),F=I("./src/utils/buffer-helper.ts"),D=I("./src/errors.ts"),L=I("./src/types/loader.ts"),A=I("./src/utils/logger.ts");function b(d,o){for(var a=0;a<o.length;a++){var u=o[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}function m(d,o,a){return o&&b(d.prototype,o),a&&b(d,a),d}var h=function(){function d(a){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=a;var u=a.config;this.bwEstimator=new R.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var o=d.prototype;return o.registerListeners=function(){var u=this.hls;u.on(P.Events.FRAG_LOADING,this.onFragLoading,this),u.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(P.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var u=this.hls;u.off(P.Events.FRAG_LOADING,this.onFragLoading,this),u.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(P.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(u,s){var i=s.frag;if(i.type===L.PlaylistLevelType.MAIN&&!this.timer){var n;this.fragCurrent=i,this.partCurrent=(n=s.part)!=null?n:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(u,s){var i=this.hls.config;s.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var u=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.autoLevelEnabled,S=i.config,C=i.media;if(!u||!C)return;var x=s?s.stats:u.stats,w=s?s.duration:u.duration;if(x.aborted){A.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||C.paused||!C.playbackRate||!C.readyState)return;var T=performance.now()-x.loading.start,_=Math.abs(C.playbackRate);if(T<=500*w/_)return;var y=i.levels,f=i.minAutoLevel,c=y[u.level],v=x.total||Math.max(x.loaded,Math.round(w*c.maxBitrate/8)),p=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/T),E=(v-x.loaded)/p,k=C.currentTime,U=(F.BufferHelper.bufferInfo(C,k,S.maxBufferHole).end-k)/_;if(U>=2*w/_||E<=U)return;var H=Number.POSITIVE_INFINITY,W;for(W=u.level-1;W>f;W--){var j=y[W].maxBitrate;if(H=w*j/(8*.8*p),H<U)break}if(H>=E)return;var O=this.bwEstimator.getEstimate();A.logger.warn("Fragment "+u.sn+(s?" part "+s.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
|
|
Current BW estimate: `+(Object(B.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+E.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+H.toFixed(3)+` s
|
|
Time to underbuffer: `+U.toFixed(3)+" s"),i.nextLoadLevel=W,this.bwEstimator.sample(T,x.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),i.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:s,stats:x})},o.onFragLoaded=function(u,s){var i=s.frag,n=s.part;if(i.type===L.PlaylistLevelType.MAIN&&Object(B.isFiniteNumber)(i.sn)){var S=n?n.stats:i.stats,C=n?n.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[i.level],w=(x.loaded?x.loaded.bytes:0)+S.loaded,T=(x.loaded?x.loaded.duration:0)+C;x.loaded={bytes:w,duration:T},x.realBitrate=Math.round(8*w/T)}if(i.bitrateTest){var _={stats:S,frag:i,part:n,id:i.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,_),i.bitrateTest=!1}}},o.onFragBuffered=function(u,s){var i=s.frag,n=s.part,S=n?n.stats:i.stats;if(S.aborted)return;if(i.type!==L.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var C=S.parsing.end-S.loading.start;this.bwEstimator.sample(C,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=C/1e3:this.bitrateTestDelay=0},o.onError=function(u,s){switch(s.details){case D.ErrorDetails.FRAG_LOAD_ERROR:case D.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var u=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.maxAutoLevel,S=i.config,C=i.minAutoLevel,x=i.media,w=s?s.duration:u?u.duration:0,T=x?x.currentTime:0,_=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,y=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,f=(F.BufferHelper.bufferInfo(x,T,S.maxBufferHole).end-T)/_,c=this.findBestLevel(y,C,n,f,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(c>=0)return c;A.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=w?Math.min(w,S.maxStarvationDelay):S.maxStarvationDelay,p=S.abrBandWidthFactor,E=S.abrBandWidthUpFactor;if(!f){var k=this.bitrateTestDelay;if(k){var U=w?Math.min(w,S.maxLoadingDelay):S.maxLoadingDelay;v=U-k,A.logger.trace("bitrate test took "+Math.round(1e3*k)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),p=E=1}}return c=this.findBestLevel(y,C,n,f+v,p,E),Math.max(c,0)},o.findBestLevel=function(u,s,i,n,S,C){for(var x,w=this.fragCurrent,T=this.partCurrent,_=this.lastLoadedFragLevel,y=this.hls.levels,f=y[_],c=!!(f!=null&&(x=f.details)!==null&&x!==void 0&&x.live),v=f==null?void 0:f.codecSet,p=T?T.duration:w?w.duration:0,E=i;E>=s;E--){var k=y[E];if(!k||v&&k.codecSet!==v)continue;var U=k.details,H=(T?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||p,W=void 0;E<=_?W=S*u:W=C*u;var j=y[E].maxBitrate,O=j*H/W;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round(W)+"/"+j+"/"+H+"/"+n+"/"+O),W>j&&(!O||c&&!this.bitrateTestDelay||O<n))return E}return-1},m(d,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,s=this.bwEstimator;if(u!==-1&&(!s||!s.canEstimate()))return u;var i=this.getNextABRAutoLevel();return u!==-1&&(i=Math.min(u,i)),i},set:function(u){this._nextAutoLevel=u}}]),d}();z.default=h},"./src/controller/audio-stream-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/polyfills/number.ts"),R=I("./src/controller/base-stream-controller.ts"),P=I("./src/events.ts"),F=I("./src/utils/buffer-helper.ts"),D=I("./src/controller/fragment-tracker.ts"),L=I("./src/types/level.ts"),A=I("./src/types/loader.ts"),b=I("./src/loader/fragment.ts"),m=I("./src/demux/chunk-cache.ts"),h=I("./src/demux/transmuxer-interface.ts"),d=I("./src/types/transmuxer.ts"),o=I("./src/controller/fragment-finders.ts"),a=I("./src/utils/discontinuities.ts"),u=I("./src/errors.ts"),s=I("./src/utils/logger.ts");function i(){return i=Object.assign||function(w){for(var T=1;T<arguments.length;T++){var _=arguments[T];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(w[y]=_[y])}return w},i.apply(this,arguments)}function n(w,T){w.prototype=Object.create(T.prototype),w.prototype.constructor=w,S(w,T)}function S(w,T){return S=Object.setPrototypeOf||function(y,f){return y.__proto__=f,y},S(w,T)}var C=100,x=function(w){n(T,w);function T(y,f){var c;return c=w.call(this,y,f,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var _=T.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var f=this.hls;f.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(P.Events.ERROR,this.onError,this),f.on(P.Events.BUFFER_RESET,this.onBufferReset,this),f.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var f=this.hls;f.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(P.Events.ERROR,this.onError,this),f.off(P.Events.BUFFER_RESET,this.onBufferReset,this),f.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(f,c){var v=c.frag,p=c.id,E=c.initPTS;if(p==="main"){var k=v.cc;this.initPTS[v.cc]=E,this.log("InitPTS for cc: "+k+" found from main: "+E),this.videoTrackCC=k,this.state===R.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=R.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(C),this.fragLoadError=0,c>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=R.State.IDLE):(this.loadedmetadata=!1,this.state=R.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},_.doTick=function(){switch(this.state){case R.State.IDLE:this.doTickIdle();break;case R.State.WAITING_TRACK:{var f,c=this.levels,v=this.trackId,p=c==null||((f=c[v])===null||f===void 0)?void 0:f.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=R.State.WAITING_INIT_PTS}break}case R.State.FRAG_LOADING_WAITING_RETRY:{var E,k=performance.now(),U=this.retryDate;(!U||k>=U||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=R.State.IDLE);break}case R.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var W=H.frag,j=H.part,O=H.cache,K=H.complete;if(this.initPTS[W.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=R.State.FRAG_LOADING;var Y=O.flush(),ee={frag:W,part:j,payload:Y,networkDetails:null};this._handleFragmentLoadProgress(ee),K&&w.prototype._handleFragmentLoadComplete.call(this,ee)}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(),Be=F.BufferHelper.bufferInfo(this.mediaBuffer,se,this.config.maxBufferHole),me=Object(o.fragmentWithinToleranceTest)(Be.end,this.config.maxFragLookUpTolerance,W);me<0&&(s.logger.log("Waiting fragment cc ("+W.cc+") @ "+W.start+" cancelled because another fragment at "+Be.end+" is needed"),this.clearWaitingFragment())}}else this.state=R.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=R.State.IDLE)},_.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:f,v=c.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},_.doTickIdle=function(){var f,c,v=this.hls,p=this.levels,E=this.media,k=this.trackId,U=v.config;if(!p||!p[k])return;if(!E&&(this.startFragRequested||!U.startFragPrefetch))return;var H=p[k],W=H.details;if(!W||W.live&&this.levelLastLoaded!==k||this.waitForCdnTuneIn(W)){this.state=R.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,A.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,A.PlaylistLevelType.AUDIO);if(j===null)return;var O=j.len,K=this.getMaxBufferLength(),Y=this.audioSwitch;if(O>=K&&!Y)return;if(!Y&&this._streamEnded(j,W)){v.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=R.State.ENDED;return}var ee=W.fragments,se=ee[0].start,Be=j.end;if(Y){var me=this.getLoadPosition();Be=me,W.PTSKnown&&me<se&&((j.end>se||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),E.currentTime=se+.05))}var xe=this.getNextFragment(Be,W);if(!xe){this.bufferFlushed=!0;return}((f=xe.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((c=xe.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(xe,W):this.loadFragment(xe,W,Be)},_.getMaxBufferLength=function(){var f=w.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,A.PlaylistLevelType.MAIN);return c===null?f:Math.max(f,c.len)},_.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(f,c){var v=c.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(p){return new L.Level(p)})},_.onAudioTrackSwitching=function(f,c){var v=!!c.url;this.trackId=c.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(C):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=R.State.IDLE):this.state=R.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(f,c){this.mainDetails=c.details},_.onAudioTrackLoaded=function(f,c){var v,p=this.levels,E=c.details,k=c.id;if(!p){this.warn("Audio tracks were reset while loading level "+k);return}this.log("Track "+k+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var U=p[k],H=0;if(E.live||(v=U.details)!==null&&v!==void 0&&v.live){var W=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!W)return;!U.details&&E.hasProgramDateTime&&W.hasProgramDateTime?(Object(a.alignMediaPlaylistByPDT)(E,W),H=E.fragments[0].start):H=this.alignPlaylists(E,U.details)}U.details=E,this.levelLastLoaded=k,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(U.details,H),this.state===R.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=R.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(f){var c,v=f.frag,p=f.part,E=f.payload,k=this.config,U=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var W=H[U];console.assert(W,"Audio track is defined on fragment load progress");var j=W.details;console.assert(j,"Audio track details are defined on fragment load progress");var O=k.defaultAudioCodec||W.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new h.default(this.hls,A.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Y=this.initPTS[v.cc],ee=(c=v.initSegment)===null||c===void 0?void 0:c.data;if(Y!==void 0){var se=!1,Be=p?p.index:-1,me=Be!==-1,xe=new d.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,E.byteLength,Be,me);K.push(E,ee,O,"",v,p,j.totalduration,se,xe,Y)}else{s.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+U);var Le=this.waitingData=this.waitingData||{frag:v,part:p,cache:new m.default,complete:!1},Ae=Le.cache;Ae.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=R.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,f)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(f,c){var v=c.tracks.audio;v&&(this.mediaBuffer=v.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},_.onFragBuffered=function(f,c){var v=c.frag,p=c.part;if(v.type!==A.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(p?" p: "+p.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,p)},_.onError=function(f,c){switch(c.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.AUDIO,c);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==R.State.ERROR&&this.state!==R.State.STOPPED&&(this.state=c.fatal?R.State.ERROR:R.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===R.State.PARSING||this.state===R.State.PARSED)){var v=!0,p=this.getFwdBufferInfo(this.mediaBuffer,A.PlaylistLevelType.AUDIO);p&&p.len>.5&&(v=!this.reduceMaxBufferLength(p.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(f,c){var v=c.type;v===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(f){var c,v="audio",p=this.hls,E=f.remuxResult,k=f.chunkMeta,U=this.getCurrentContext(k);if(!U){this.warn("The loading context changed while buffering fragment "+k.sn+" of level "+k.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(k.level);return}var H=U.frag,W=U.part,j=E.audio,O=E.text,K=E.id3,Y=E.initSegment;if(this.fragContextChanged(H))return;if(this.state=R.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),Y!=null&&Y.tracks&&(this._bufferInitSegment(Y.tracks,H,k),p.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:v,tracks:Y.tracks})),j){var ee=j.startPTS,se=j.endPTS,Be=j.startDTS,me=j.endDTS;W&&(W.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ee,endPTS:se,startDTS:Be,endDTS:me}),H.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ee,se,Be,me),this.bufferFragmentData(j,H,W,k)}if(K!=null&&(c=K.samples)!==null&&c!==void 0&&c.length){var xe=i({frag:H,id:v},K);p.trigger(P.Events.FRAG_PARSING_METADATA,xe)}if(O){var Le=i({frag:H,id:v},O);p.trigger(P.Events.FRAG_PARSING_USERDATA,Le)}},_._bufferInitSegment=function(f,c,v){if(this.state!==R.State.PARSING)return;f.video&&delete f.video;var p=f.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,f);var E=p.initSegment;if(E!=null&&E.byteLength){var k={type:"audio",frag:c,part:null,chunkMeta:v,parent:c.type,data:E};this.hls.trigger(P.Events.BUFFER_APPENDING,k)}this.tick()},_.loadFragment=function(f,c,v){var p=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||p===D.FragmentState.NOT_LOADED||p===D.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):c.live&&!Object(B.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=R.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,f,c,v)))},_.completeAudioSwitch=function(){var f=this.hls,c=this.media,v=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:v})},T}(R.default);z.default=x},"./src/controller/audio-track-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/events.ts"),R=I("./src/errors.ts"),P=I("./src/controller/base-playlist-controller.ts"),F=I("./src/types/loader.ts");function D(h,d){for(var o=0;o<d.length;o++){var a=d[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(h,a.key,a)}}function L(h,d,o){return d&&D(h.prototype,d),o&&D(h,o),h}function A(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,b(h,d)}function b(h,d){return b=Object.setPrototypeOf||function(a,u){return a.__proto__=u,a},b(h,d)}var m=function(h){A(d,h);function d(a){var u;return u=h.call(this,a,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var o=d.prototype;return o.registerListeners=function(){var u=this.hls;u.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(B.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var u=this.hls;u.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(B.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(u,s){this.tracks=s.audioTracks||[]},o.onAudioTrackLoaded=function(u,s){var i=s.id,n=s.details,S=this.tracksInGroup[i];if(!S){this.warn("Invalid audio track id "+i);return}var C=S.details;S.details=s.details,this.log("audioTrack "+i+" loaded ["+n.startSN+"-"+n.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,s,C))},o.onLevelLoading=function(u,s){this.switchLevel(s.level)},o.onLevelSwitching=function(u,s){this.switchLevel(s.level)},o.switchLevel=function(u){var s=this.hls.levels[u];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(C){return!i||C.groupId===i});this.selectDefaultTrack&&!n.some(function(C){return C.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var S={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(B.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},o.onError=function(u,s){if(h.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===F.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},o.setAudioTrack=function(u){var s=this.tracksInGroup;if(u<0||u>=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 "+u);var n=s[u],S=n.id,C=n.groupId,x=C===void 0?"":C,w=n.name,T=n.type,_=n.url;if(this.trackId=u,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:x,name:w,type:T,url:_}),n.details&&!n.details.live)return;var y=this.switchParams(n.url,i==null?void 0:i.details);this.loadPlaylist(y)},o.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.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(B.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(u){for(var s=this.tracksInGroup,i=0;i<s.length;i++){var n=s[i];if((!this.selectDefaultTrack||n.default)&&(!u||u===n.name))return n.id}return-1},o.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var i=s.id,n=s.groupId,S=s.url;if(u)try{S=u.addDirectives(S)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(B.Events.AUDIO_TRACK_LOADING,{url:S,id:i,groupId:n,deliveryDirectives:u||null})}},L(d,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),d}(P.default);z.default=m},"./src/controller/base-playlist-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return L});var B=I("./src/polyfills/number.ts"),R=I("./src/types/level.ts"),P=I("./src/controller/level-helper.ts"),F=I("./src/utils/logger.ts"),D=I("./src/errors.ts"),L=function(){function A(m,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=F.logger.log.bind(F.logger,h+":"),this.warn=F.logger.warn.bind(F.logger,h+":"),this.hls=m}var b=A.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(h,d){d.fatal&&d.type===D.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(h,d){var o=d==null?void 0:d.renditionReports;if(o)for(var a=0;a<o.length;a++){var u=o[a],s=""+u.URI;if(s===h.substr(-s.length)){var i=parseInt(u["LAST-MSN"]),n=parseInt(u["LAST-PART"]);if(d&&this.hls.config.lowLatencyMode){var S=Math.min(d.age-d.partTarget,d.targetduration);n!==void 0&&S>d.partTarget&&(n+=1)}if(Object(B.isFiniteNumber)(i))return new R.HlsUrlParameters(i,Object(B.isFiniteNumber)(n)?n:void 0,R.HlsSkip.No)}}},b.loadPlaylist=function(h){},b.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},b.playlistLoaded=function(h,d,o){var a=this,u=d.details,s=d.stats,i=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(u.advancedDateTime=Date.now()-i,u.live||o!=null&&o.live){if(u.reloaded(o),o&&this.log("live playlist "+h+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),o&&u.fragments.length>0&&Object(P.mergeDetails)(o,u),!this.canLoad||!u.live)return;var n,S=void 0,C=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var x=this.hls.config.lowLatencyMode,w=u.lastPartSn,T=u.endSN,_=u.lastPartIndex,y=_!==-1,f=w===T,c=x?0:_;y?(S=f?T+1:w,C=f?c:_+1):S=T+1;var v=u.age,p=v+u.ageHeader,E=Math.min(p-u.partTarget,u.targetduration*1.5);if(E>0){if(o&&E>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+E+" with playlist age: "+u.age),E=0;else{var k=Math.floor(E/u.targetduration);if(S+=k,C!==void 0){var U=Math.round(E%u.targetduration/u.partTarget);C+=U}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+E+" skip sn "+k+" to part "+C)}u.tuneInGoal=E}if(n=this.getDeliveryDirectives(u,d.deliveryDirectives,S,C),x||!f){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(u,d.deliveryDirectives,S,C);var H=Object(P.computeReloadInterval)(u,s);S!==void 0&&u.canBlockReload&&(H-=u.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return a.loadPlaylist(n)},H)}else this.clearTimer()},b.getDeliveryDirectives=function(h,d,o,a){var u=Object(R.getSkipValue)(h,o);return d!=null&&d.skip&&h.deltaUpdateFailed&&(o=d.msn,a=d.part,u=R.HlsSkip.No),new R.HlsUrlParameters(o,a,u)},b.retryLoadingOrFail=function(h){var d=this,o=this.hls.config,a=this.retryCount<o.levelLoadingMaxRetry;if(a){var u;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(u=h.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return a},A}()},"./src/controller/base-stream-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"State",function(){return T}),I.d(z,"default",function(){return _});var B=I("./src/polyfills/number.ts"),R=I("./src/task-loop.ts"),P=I("./src/controller/fragment-tracker.ts"),F=I("./src/utils/buffer-helper.ts"),D=I("./src/utils/logger.ts"),L=I("./src/events.ts"),A=I("./src/errors.ts"),b=I("./src/types/transmuxer.ts"),m=I("./src/utils/mp4-tools.ts"),h=I("./src/utils/discontinuities.ts"),d=I("./src/controller/fragment-finders.ts"),o=I("./src/controller/level-helper.ts"),a=I("./src/loader/fragment-loader.ts"),u=I("./src/crypt/decrypter.ts"),s=I("./src/utils/time-ranges.ts"),i=I("./src/types/loader.ts");function n(y,f){for(var c=0;c<f.length;c++){var v=f[c];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(y,v.key,v)}}function S(y,f,c){return f&&n(y.prototype,f),c&&n(y,c),y}function C(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function x(y,f){y.prototype=Object.create(f.prototype),y.prototype.constructor=y,w(y,f)}function w(y,f){return w=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},w(y,f)}var T={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"},_=function(y){x(f,y);function f(v,p,E){var k;return k=y.call(this)||this,k.hls=void 0,k.fragPrevious=null,k.fragCurrent=null,k.fragmentTracker=void 0,k.transmuxer=null,k._state=T.STOPPED,k.media=void 0,k.mediaBuffer=void 0,k.config=void 0,k.bitrateTest=!1,k.lastCurrentTime=0,k.nextLoadPosition=0,k.startPosition=0,k.loadedmetadata=!1,k.fragLoadError=0,k.retryDate=0,k.levels=null,k.fragmentLoader=void 0,k.levelLastLoaded=null,k.startFragRequested=!1,k.decrypter=void 0,k.initPTS=[],k.onvseeking=null,k.onvended=null,k.logPrefix="",k.log=void 0,k.warn=void 0,k.logPrefix=E,k.log=D.logger.log.bind(D.logger,E+":"),k.warn=D.logger.warn.bind(D.logger,E+":"),k.hls=v,k.fragmentLoader=new a.default(v.config),k.fragmentTracker=p,k.config=v.config,k.decrypter=new u.default(v,v.config),v.on(L.Events.KEY_LOADED,k.onKeyLoaded,C(k)),k}var c=f.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(p){},c.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=T.STOPPED},c._streamEnded=function(p,E){var k=this.fragCurrent,U=this.fragmentTracker;if(!E.live&&k&&k.sn===E.endSN&&!p.nextStart){var H=U.getState(k);return H===P.FragmentState.PARTIAL||H===P.FragmentState.OK}return!1},c.onMediaAttached=function(p,E){var k=this.media=this.mediaBuffer=E.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),k.addEventListener("seeking",this.onvseeking),k.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===T.STOPPED&&this.startLoad(U.startPosition)},c.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var p=this.config,E=this.fragCurrent,k=this.media,U=this.mediaBuffer,H=this.state,W=k?k.currentTime:0,j=F.BufferHelper.bufferInfo(U||k,W,p.maxBufferHole);if(this.log("media seeking to "+(Object(B.isFiniteNumber)(W)?W.toFixed(3):W)+", state: "+H),H===T.ENDED)this.resetLoadingState();else if(E&&!j.len){var O=p.maxFragLookUpTolerance,K=E.start-O,Y=E.start+E.duration+O,ee=W>Y;(W<K||ee)&&(ee&&E.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),E.loader.abort()),this.resetLoadingState())}k&&(this.lastCurrentTime=W),!this.loadedmetadata&&!j.len&&(this.nextLoadPosition=this.startPosition=W),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(p,E){if(this.state!==T.KEY_LOADING||E.frag!==this.fragCurrent||!this.levels)return;this.state=T.IDLE;var k=this.levels[E.frag.level].details;k&&this.loadFragment(E.frag,k,E.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),y.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=T.STOPPED,this.hls.off(L.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,y.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(p,E){this.log("Loading key for "+p.sn+" of ["+E.startSN+"-"+E.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=T.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(L.Events.KEY_LOADING,{frag:p})},c.loadFragment=function(p,E,k){this._loadFragForPlayback(p,E,k)},c._loadFragForPlayback=function(p,E,k){var U=this,H=function(j){if(U.fragContextChanged(p)){U.warn("Fragment "+p.sn+(j.part?" p: "+j.part.index:"")+" of level "+p.level+" was dropped during download."),U.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,U._handleFragmentLoadProgress(j)};this._doFragLoad(p,E,k,H).then(function(W){if(!W)return;U.fragLoadError=0;var j=U.state;if(U.fragContextChanged(p)){(j===T.FRAG_LOADING||j===T.BACKTRACKING||!U.fragCurrent&&j===T.PARSING)&&(U.fragmentTracker.removeFragment(p),U.state=T.IDLE);return}if("payload"in W&&(U.log("Loaded fragment "+p.sn+" of level "+p.level),U.hls.trigger(L.Events.FRAG_LOADED,W),U.state===T.BACKTRACKING)){U.fragmentTracker.backtrack(p,W),U.resetFragmentLoading(p);return}U._handleFragmentLoadComplete(W)}).catch(function(W){U.warn(W),U.resetFragmentLoading(p)})},c.flushMainBuffer=function(p,E,k){if(k===void 0&&(k=null),!(p-E))return;var U={startOffset:p,endOffset:E,type:k};this.fragLoadError=0,this.hls.trigger(L.Events.BUFFER_FLUSHING,U)},c._loadInitSegment=function(p){var E=this;this._doFragLoad(p).then(function(k){if(!k||E.fragContextChanged(p)||!E.levels)throw new Error("init load aborted");return k}).then(function(k){var U=E.hls,H=k.payload,W=p.decryptdata;if(H&&H.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var j=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(H),W.key.buffer,W.iv.buffer).then(function(O){var K=self.performance.now();return U.trigger(L.Events.FRAG_DECRYPTED,{frag:p,payload:O,stats:{tstart:j,tdecrypt:K}}),k.payload=O,k})}return k}).then(function(k){var U=E.fragCurrent,H=E.hls,W=E.levels;if(!W)throw new Error("init load aborted, missing levels");var j=W[p.level].details;console.assert(j,"Level details are defined when init segment is loaded");var O=p.stats;E.state=T.IDLE,E.fragLoadError=0,p.data=new Uint8Array(k.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),k.frag===U&&H.trigger(L.Events.FRAG_BUFFERED,{stats:O,frag:U,part:null,id:p.type}),E.tick()}).catch(function(k){E.warn(k),E.resetFragmentLoading(p)})},c.fragContextChanged=function(p){var E=this.fragCurrent;return!p||!E||p.level!==E.level||p.sn!==E.sn||p.urlId!==E.urlId},c.fragBufferedComplete=function(p,E){var k=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(E?" part: "+E.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+s.default.toString(F.BufferHelper.getBuffered(k))),this.state=T.IDLE,this.tick()},c._handleFragmentLoadComplete=function(p){var E=this.transmuxer;if(!E)return;var k=p.frag,U=p.part,H=p.partsLoaded,W=!H||H.length===0||H.some(function(O){return!O}),j=new b.ChunkMetadata(k.level,k.sn,k.stats.chunkCount+1,0,U?U.index:-1,!W);E.flush(j)},c._handleFragmentLoadProgress=function(p){},c._doFragLoad=function(p,E,k,U){var H=this;if(k===void 0&&(k=null),!this.levels)throw new Error("frag load aborted, missing levels");if(k=Math.max(p.start,k||0),this.config.lowLatencyMode&&E){var W=E.partList;if(W&&U){k>p.end&&E.fragmentHint&&(p=E.fragmentHint);var j=this.getNextPart(W,p,k);if(j>-1){var O=W[j];return this.log("Loading part sn: "+p.sn+" p: "+O.index+" cc: "+p.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+j+"-"+(W.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(k.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=T.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:p,part:W[j],targetBufferTime:k}),this.doFragPartsLoad(p,W,j,U).catch(function(K){return H.handleFragLoadError(K)})}else if(!p.url||this.loadedEndOfParts(W,k))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(E?"of ["+E.startSN+"-"+E.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(k.toFixed(3))),Object(B.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=T.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:p,targetBufferTime:k}),this.fragmentLoader.load(p,U).catch(function(K){return H.handleFragLoadError(K)})},c.doFragPartsLoad=function(p,E,k,U){var H=this;return new Promise(function(W,j){var O=[],K=function Y(ee){var se=E[ee];H.fragmentLoader.loadPart(p,se,U).then(function(Be){O[se.index]=Be;var me=Be.part;H.hls.trigger(L.Events.FRAG_LOADED,Be);var xe=E[ee+1];if(xe&&xe.fragment===p)Y(ee+1);else return W({frag:p,part:me,partsLoaded:O})}).catch(j)};K(k)})},c.handleFragLoadError=function(p){var E=p.data;return E&&E.details===A.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(L.Events.ERROR,E),null},c._handleTransmuxerFlush=function(p){var E=this.getCurrentContext(p);if(!E||this.state!==T.PARSING){this.fragCurrent||(this.state=T.IDLE);return}var k=E.frag,U=E.part,H=E.level,W=self.performance.now();k.stats.parsing.end=W,U&&(U.stats.parsing.end=W),this.updateLevelTiming(k,U,H,p.partial)},c.getCurrentContext=function(p){var E=this.levels,k=p.level,U=p.sn,H=p.part;if(!E||!E[k])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+k+". The current chunk will not be buffered."),null;var W=E[k],j=H>-1?Object(o.getPartWith)(W,U,H):null,O=j?j.fragment:Object(o.getFragmentWithSN)(W,U,this.fragCurrent);return O?{frag:O,part:j,level:W}:null},c.bufferFragmentData=function(p,E,k,U){if(!p||this.state!==T.PARSING)return;var H=p.data1,W=p.data2,j=H;if(H&&W&&(j=Object(m.appendUint8Array)(H,W)),!j||!j.length)return;var O={type:p.type,frag:E,part:k,chunkMeta:U,parent:E.type,data:j};this.hls.trigger(L.Events.BUFFER_APPENDING,O),p.dropped&&p.independent&&!k&&this.flushBufferGap(E)},c.flushBufferGap=function(p){var E=this.media;if(!E)return;if(!F.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,p.start);return}var k=E.currentTime,U=F.BufferHelper.bufferInfo(E,k,0),H=p.duration,W=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),j=Math.max(Math.min(p.start-W,U.end-W),k+W);p.start-j>W&&this.flushMainBuffer(j,p.start)},c.getFwdBufferInfo=function(p,E){var k=this.config,U=this.getLoadPosition();if(!Object(B.isFiniteNumber)(U))return null;var H=F.BufferHelper.bufferInfo(p,U,k.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var W=this.fragmentTracker.getBufferedFrag(U,E);if(W&&H.nextStart<W.end)return F.BufferHelper.bufferInfo(p,U,Math.max(H.nextStart,k.maxBufferHole))}return H},c.getMaxBufferLength=function(p){var E=this.config,k;return p?k=Math.max(8*E.maxBufferSize/p,E.maxBufferLength):k=E.maxBufferLength,Math.min(k,E.maxMaxBufferLength)},c.reduceMaxBufferLength=function(p){var E=this.config,k=p||E.maxBufferLength;return E.maxMaxBufferLength>=k?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(p,E){var k,U,H=E.fragments,W=H.length;if(!W)return null;var j=this.config,O=H[0].start,K;if(E.live){var Y=j.initialLiveManifestSize;if(W<Y)return this.warn("Not enough fragments to start playback (have: "+W+", need: "+Y+")"),null;!E.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(E,H),this.startPosition=K?this.hls.liveSyncPosition||K.start:p)}else p<=O&&(K=H[0]);if(!K){var ee=j.lowLatencyMode?E.partEnd:E.fragmentEnd;K=this.getFragmentAtPosition(p,ee,E)}return(k=K)!==null&&k!==void 0&&k.initSegment&&!((U=K)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},c.getNextPart=function(p,E,k){for(var U=-1,H=!1,W=!0,j=0,O=p.length;j<O;j++){var K=p[j];if(W=W&&!K.independent,U>-1&&k<K.start)break;var Y=K.loaded;!Y&&(H||K.independent||W)&&K.fragment===E&&(U=j),H=Y}return U},c.loadedEndOfParts=function(p,E){var k=p[p.length-1];return k&&E>k.start&&k.loaded},c.getInitialLiveFragment=function(p,E){var k=this.fragPrevious,U=null;if(k){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+k.programDateTime),U=Object(d.findFragmentByPDT)(E,k.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var H=k.sn+1;if(H>=p.startSN&&H<=p.endSN){var W=E[H-p.startSN];k.cc===W.cc&&(U=W,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(d.findFragWithCC)(E,k.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(U=this.getFragmentAtPosition(j,this.bitrateTest?p.fragmentEnd:p.edge,p))}return U},c.getFragmentAtPosition=function(p,E,k){var U=this.config,H=this.fragPrevious,W=k.fragments,j=k.endSN,O=k.fragmentHint,K=U.maxFragLookUpTolerance,Y=!!(U.lowLatencyMode&&k.partList&&O);Y&&O&&!this.bitrateTest&&(W=W.concat(O),j=O.sn);var ee;if(p<E){var se=p>E-K?0:K;ee=Object(d.findFragmentByPTS)(H,W,p,se)}else ee=W[W.length-1];if(ee){var Be=ee.sn-k.startSN,me=H&&ee.level===H.level,xe=W[Be+1],Le=this.fragmentTracker.getState(ee);if(Le===P.FragmentState.BACKTRACKED){ee=null;for(var Ae=Be;W[Ae]&&this.fragmentTracker.getState(W[Ae])===P.FragmentState.BACKTRACKED;)H?ee=W[Ae--]:ee=W[--Ae];ee||(ee=xe)}else H&&ee.sn===H.sn&&!Y&&(me&&(ee.sn<j&&this.fragmentTracker.getState(xe)!==P.FragmentState.OK?(this.log("SN "+ee.sn+" just loaded, load next one: "+xe.sn),ee=xe):ee=null))}return ee},c.synchronizeToLiveEdge=function(p){var E=this.config,k=this.media;if(!k)return;var U=this.hls.liveSyncPosition,H=k.currentTime,W=p.fragments[0].start,j=p.edge,O=H>=W-E.maxFragLookUpTolerance&&H<=j;if(U!==null&&k.duration>U&&(H<U||!O)){var K=E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:E.liveMaxLatencyDurationCount*p.targetduration;(!O&&k.readyState<4||H<j-K)&&(this.loadedmetadata||(this.nextLoadPosition=U),k.readyState&&(this.warn("Playback: "+H.toFixed(3)+" is located too far from the end of live sliding playlist: "+j+", reset currentTime to : "+U.toFixed(3)),k.currentTime=U))}},c.alignPlaylists=function(p,E){var k=this.levels,U=this.levelLastLoaded,H=this.fragPrevious,W=U!==null?k[U]:null,j=p.fragments.length;if(!j)return this.warn("No fragments in live playlist"),0;var O=p.fragments[0].start,K=!E,Y=p.alignedSliding&&Object(B.isFiniteNumber)(O);if(K||!Y&&!O){Object(h.alignStream)(H,W,p);var ee=p.fragments[0].start;return this.log("Live playlist sliding: "+ee.toFixed(2)+" start-sn: "+(E?E.startSN:"na")+"->"+p.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+j),ee}return O},c.waitForCdnTuneIn=function(p){var E=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*E)},c.setStartPosition=function(p,E){var k=this.startPosition;if(k<E&&(k=-1),k===-1||this.lastCurrentTime===-1){var U=p.startTimeOffset;Object(B.isFiniteNumber)(U)?(k=E+U,U<0&&(k+=p.totalduration),k=Math.min(Math.max(E,k),E+p.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+k),this.startPosition=k):p.live?k=this.hls.liveSyncPosition||E:this.startPosition=k=0,this.lastCurrentTime=k}this.nextLoadPosition=k},c.getLoadPosition=function(){var p=this.media,E=0;return this.loadedmetadata&&p?E=p.currentTime:this.nextLoadPosition&&(E=this.nextLoadPosition),E},c.handleFragLoadAborted=function(p,E){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(E?" part"+E.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},c.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=T.IDLE)},c.onFragmentOrKeyLoadError=function(p,E){if(E.fatal)return;var k=E.frag;if(!k||k.type!==p)return;var U=this.fragCurrent;console.assert(U&&k.sn===U.sn&&k.level===U.level&&k.urlId===U.urlId,"Frag load error must match current frag to retry");var H=this.config;if(this.fragLoadError+1<=H.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(k.level))return;var W=Math.min(Math.pow(2,this.fragLoadError)*H.fragLoadingRetryDelay,H.fragLoadingMaxRetryTimeout);this.warn("Fragment "+k.sn+" of "+p+" "+k.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=T.FRAG_LOADING_WAITING_RETRY}else E.levelRetry?(p===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=T.IDLE):(D.logger.error(E.details+" reaches max retry, redispatch as fatal ..."),E.fatal=!0,this.hls.stopLoad(),this.state=T.ERROR)},c.afterBufferFlushed=function(p,E,k){if(!p)return;var U=F.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(E,U,k),this.state===T.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=T.IDLE},c.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var E=this.levels?this.levels[p].details:null;if(E!=null&&E.live)return this.startPosition=-1,this.setStartPosition(E,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(p,E,k,U){var H=this,W=k.details;console.assert(!!W,"level.details must be defined");var j=Object.keys(p.elementaryStreams).reduce(function(O,K){var Y=p.elementaryStreams[K];if(Y){var ee=Y.endPTS-Y.startPTS;if(ee<=0)return H.warn("Could not parse fragment "+p.sn+" "+K+" duration reliably ("+ee+") resetting transmuxer to fallback to playlist timing"),H.resetTransmuxer(),O||!1;var se=U?0:Object(o.updateFragPTSDTS)(W,p,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return H.hls.trigger(L.Events.LEVEL_PTS_UPDATED,{details:W,level:k,drift:se,type:K,frag:p,start:Y.startPTS,end:Y.endPTS}),!0}return O},!1);j?(this.state=T.PARSED,this.hls.trigger(L.Events.FRAG_PARSED,{frag:p,part:E})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(f,[{key:"state",get:function(){return this._state},set:function(p){var E=this._state;E!==p&&(this._state=p,this.log(E+"->"+p))}}]),f}(R.default)},"./src/controller/buffer-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return d});var B=I("./src/polyfills/number.ts"),R=I("./src/events.ts"),P=I("./src/utils/logger.ts"),F=I("./src/errors.ts"),D=I("./src/utils/buffer-helper.ts"),L=I("./src/utils/mediasource-helper.ts"),A=I("./src/loader/fragment.ts"),b=I("./src/controller/buffer-operation-queue.ts"),m=Object(L.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function o(u){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,S=s.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),n&&(s.updateMediaElementDuration(),i.trigger(R.Events.MEDIA_ATTACHED,{media:n})),S&&S.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var a=o.prototype;return a.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},a.destroy=function(){this.unregisterListeners(),this.details=null},a.registerListeners=function(){var s=this.hls;s.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(R.Events.BUFFER_RESET,this.onBufferReset,this),s.on(R.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(R.Events.BUFFER_EOS,this.onBufferEos,this),s.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(R.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(R.Events.FRAG_PARSED,this.onFragParsed,this),s.on(R.Events.FRAG_CHANGED,this.onFragChanged,this)},a.unregisterListeners=function(){var s=this.hls;s.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(R.Events.BUFFER_RESET,this.onBufferReset,this),s.off(R.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(R.Events.BUFFER_EOS,this.onBufferEos,this),s.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(R.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(R.Events.FRAG_PARSED,this.onFragParsed,this),s.off(R.Events.FRAG_CHANGED,this.onFragChanged,this)},a._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},a.onManifestParsed=function(s,i){var n=2;(i.audio&&!i.video||!i.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},a.onMediaAttaching=function(s,i){var n=this.media=i.media;if(n&&m){var S=this.mediaSource=new m;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(S),this._objectUrl=n.src}},a.onMediaDetaching=function(){var s=this.media,i=this.mediaSource,n=this._objectUrl;if(i){if(P.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(S){P.logger.warn("[buffer-controller]: onMediaDetaching: "+S.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()):P.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(R.Events.MEDIA_DETACHED,void 0)},a.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(S){P.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",S)}}),this._initSourceBuffer()},a.onBufferCodecs=function(s,i){var n=this,S=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(C){if(S){var x=n.tracks[C];if(x&&typeof x.buffer.changeType=="function"){var w=i[C],T=w.codec,_=w.levelCodec,y=w.container,f=(x.levelCodec||x.codec).replace(h,"$1"),c=(_||T).replace(h,"$1");if(f!==c){var v=y+";codecs="+(_||T);n.appendChangeType(C,v)}}}else n.pendingTracks[C]=i[C]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},a.appendChangeType=function(s,i){var n=this,S=this.operationQueue,C={execute:function(){var w=n.sourceBuffer[s];w&&(P.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+i),w.changeType(i)),S.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(w){P.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",w)}};S.append(C,s)},a.onBufferAppending=function(s,i){var n=this,S=this.hls,C=this.operationQueue,x=this.tracks,w=i.data,T=i.type,_=i.frag,y=i.part,f=i.chunkMeta,c=f.buffering[T],v=self.performance.now();c.start=v;var p=_.stats.buffering,E=y?y.stats.buffering:null;p.start===0&&(p.start=v),E&&E.start===0&&(E.start=v);var k=x.audio,U=T==="audio"&&f.id===1&&(k==null?void 0:k.container)==="audio/mpeg",H={execute:function(){if(c.executeStart=self.performance.now(),U){var j=n.sourceBuffer[T];if(j){var O=_.start-j.timestampOffset;Math.abs(O)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+O+") sn: "+_.sn+")"),j.timestampOffset=_.start)}}n.appendExecutor(w,T)},onStart:function(){},onComplete:function(){var j=self.performance.now();c.executeEnd=c.end=j,p.first===0&&(p.first=j),E&&E.first===0&&(E.first=j);var O=n.sourceBuffer,K={};for(var Y in O)K[Y]=D.BufferHelper.getBuffered(O[Y]);n.appendError=0,n.hls.trigger(R.Events.BUFFER_APPENDED,{type:T,frag:_,part:y,chunkMeta:f,parent:_.type,timeRanges:K})},onError:function(j){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+T+" SourceBuffer",j);var O={type:F.ErrorTypes.MEDIA_ERROR,parent:_.type,details:F.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=F.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,O.details=F.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>S.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),S.trigger(R.Events.ERROR,O)}};C.append(H,T)},a.onBufferFlushing=function(s,i){var n=this,S=this.operationQueue,C=function(w){return{execute:n.removeExecutor.bind(n,w,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(R.Events.BUFFER_FLUSHED,{type:w})},onError:function(_){P.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",_)}}};i.type?S.append(C(i.type),i.type):this.getSourceBufferTypes().forEach(function(x){S.append(C(x),x)})},a.onFragParsed=function(s,i){var n=this,S=i.frag,C=i.part,x=[],w=C?C.elementaryStreams:S.elementaryStreams;w[A.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(w[A.ElementaryStreamTypes.AUDIO]&&x.push("audio"),w[A.ElementaryStreamTypes.VIDEO]&&x.push("video"));var T=function(){var y=self.performance.now();S.stats.buffering.end=y,C&&(C.stats.buffering.end=y);var f=C?C.stats:S.stats;n.hls.trigger(R.Events.FRAG_BUFFERED,{frag:S,part:C,stats:f,id:S.type})};x.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(T,x)},a.onFragChanged=function(s,i){this.flushBackBuffer()},a.onBufferEos=function(s,i){var n=this,S=this.getSourceBufferTypes().reduce(function(C,x){var w=n.sourceBuffer[x];return(!i.type||i.type===x)&&(w&&!w.ended&&(w.ended=!0,P.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),C&&!!(!w||w.ended)},!0);S&&this.blockBuffers(function(){var C=n.mediaSource;if(!C||C.readyState!=="open")return;C.endOfStream()})},a.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()},a.flushBackBuffer=function(){var s=this.hls,i=this.details,n=this.media,S=this.sourceBuffer;if(!n||i===null)return;var C=this.getSourceBufferTypes();if(!C.length)return;var x=i.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(B.isFiniteNumber)(x)||x<0)return;var w=n.currentTime,T=i.levelTargetDuration,_=Math.max(x,T),y=Math.floor(w/T)*T-_;C.forEach(function(f){var c=S[f];if(c){var v=D.BufferHelper.getBuffered(c);v.length>0&&y>v.start(0)&&(s.trigger(R.Events.BACK_BUFFER_REACHED,{bufferEnd:y}),i.live&&s.trigger(R.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:y}),s.trigger(R.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:y,type:f}))}})},a.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,i=this.hls,n=this.media,S=this.mediaSource,C=s.fragments[0].start+s.totalduration,x=n.duration,w=Object(B.isFiniteNumber)(S.duration)?S.duration:0;s.live&&i.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(s)):(C>w&&C>x||!Object(B.isFiniteNumber)(x))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+C.toFixed(3)),S.duration=C)},a.updateSeekableRange=function(s){var i=this.mediaSource,n=s.fragments,S=n.length;if(S&&s.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var C=Math.max(0,n[0].start),x=Math.max(C,C+s.totalduration);i.setLiveSeekableRange(C,x)}},a.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,i=this.operationQueue,n=this.pendingTracks,S=Object.keys(n).length;if(S&&!s||S===2){this.createSourceBuffers(n),this.pendingTracks={};var C=this.getSourceBufferTypes();if(C.length===0){this.hls.trigger(R.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}C.forEach(function(x){i.executeNext(x)})}},a.createSourceBuffers=function(s){var i=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var C in s)if(!i[C]){var x=s[C];if(!x)throw Error("source buffer exists for track "+C+", however track does not");var w=x.levelCodec||x.codec,T=x.container+";codecs="+w;P.logger.log("[buffer-controller]: creating sourceBuffer("+T+")");try{var _=i[C]=n.addSourceBuffer(T),y=C;this.addBufferListener(y,"updatestart",this._onSBUpdateStart),this.addBufferListener(y,"updateend",this._onSBUpdateEnd),this.addBufferListener(y,"error",this._onSBUpdateError),this.tracks[C]={buffer:_,codec:w,container:x.container,levelCodec:x.levelCodec,id:x.id},S++}catch(f){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(R.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:T})}}S&&this.hls.trigger(R.Events.BUFFER_CREATED,{tracks:this.tracks})},a._onSBUpdateStart=function(s){var i=this.operationQueue,n=i.current(s);n.onStart()},a._onSBUpdateEnd=function(s){var i=this.operationQueue,n=i.current(s);n.onComplete(),i.shiftAndExecuteNext(s)},a._onSBUpdateError=function(s,i){P.logger.error("[buffer-controller]: "+s+" SourceBuffer error",i),this.hls.trigger(R.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(s);n&&n.onError(i)},a.removeExecutor=function(s,i,n){var S=this.media,C=this.mediaSource,x=this.operationQueue,w=this.sourceBuffer,T=w[s];if(!S||!C||!T){P.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(s);return}var _=Object(B.isFiniteNumber)(S.duration)?S.duration:Infinity,y=Object(B.isFiniteNumber)(C.duration)?C.duration:Infinity,f=Math.max(0,i),c=Math.min(n,_,y);c>f?(P.logger.log("[buffer-controller]: Removing ["+f+","+c+"] from the "+s+" SourceBuffer"),console.assert(!T.updating,s+" sourceBuffer must not be updating"),T.remove(f,c)):x.shiftAndExecuteNext(s)},a.appendExecutor=function(s,i){var n=this.operationQueue,S=this.sourceBuffer,C=S[i];if(!C){P.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(i);return}C.ended=!1,console.assert(!C.updating,i+" sourceBuffer must not be updating"),C.appendBuffer(s)},a.blockBuffers=function(s,i){var n=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var S=this.operationQueue,C=i.map(function(x){return S.appendBlocker(x)});Promise.all(C).then(function(){s(),i.forEach(function(x){var w=n.sourceBuffer[x];(!w||!w.updating)&&S.shiftAndExecuteNext(x)})})},a.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},a.addBufferListener=function(s,i,n){var S=this.sourceBuffer[s];if(!S)return;var C=n.bind(this,s);this.listeners[s].push({event:i,listener:C}),S.addEventListener(i,C)},a.removeBufferListeners=function(s){var i=this.sourceBuffer[s];if(!i)return;this.listeners[s].forEach(function(n){i.removeEventListener(n.event,n.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return R});var B=I("./src/utils/logger.ts"),R=function(){function P(D){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=D}var F=P.prototype;return F.append=function(L,A){var b=this.queues[A];b.push(L),b.length===1&&this.buffers[A]&&this.executeNext(A)},F.insertAbort=function(L,A){var b=this.queues[A];b.unshift(L),this.executeNext(A)},F.appendBlocker=function(L){var A,b=new Promise(function(h){A=h}),m={execute:A,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,L),b},F.executeNext=function(L){var A=this.buffers,b=this.queues,m=A[L],h=b[L];if(h.length){var d=h[0];try{d.execute()}catch(o){B.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(o),(!m||!m.updating)&&(h.shift(),this.executeNext(L))}}},F.shiftAndExecuteNext=function(L){this.queues[L].shift(),this.executeNext(L)},F.current=function(L){return this.queues[L][0]},P}()},"./src/controller/cap-level-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/events.ts");function R(D,L){for(var A=0;A<L.length;A++){var b=L[A];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(D,b.key,b)}}function P(D,L,A){return L&&R(D.prototype,L),A&&R(D,A),D}var F=function(){function D(A){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=A,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var L=D.prototype;return L.setStreamController=function(b){this.streamController=b},L.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},L.registerListeners=function(){var b=this.hls;b.on(B.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.unregisterListener=function(){var b=this.hls;b.off(B.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.onFpsDropLevelCapping=function(b,m){D.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},L.onMediaAttaching=function(b,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},L.onManifestParsed=function(b,m){var h=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,h.config.capLevelToPlayerSize&&m.video&&this.startCapping()},L.onBufferCodecs=function(b,m){var h=this.hls;h.config.capLevelToPlayerSize&&m.video&&this.startCapping()},L.onMediaDetaching=function(){this.stopCapping()},L.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(b.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},L.getMaxLevel=function(b){var m=this,h=this.hls.levels;if(!h.length)return-1;var d=h.filter(function(o,a){return D.isLevelAllowed(a,m.restrictedLevels)&&a<=b});return this.clientRect=null,D.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},L.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},L.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},L.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,m={width:0,height:0};if(b){var h=b.getBoundingClientRect();m.width=h.width,m.height=h.height,!m.width&&!m.height&&(m.width=h.right-h.left||b.width||0,m.height=h.bottom-h.top||b.height||0)}return this.clientRect=m,m},D.isLevelAllowed=function(b,m){return m===void 0&&(m=[]),m.indexOf(b)===-1},D.getMaxLevelByMediaSize=function(b,m,h){if(!b||!b.length)return-1;for(var d=function(i,n){return n?i.width!==n.width||i.height!==n.height:!0},o=b.length-1,a=0;a<b.length;a+=1){var u=b[a];if((u.width>=m||u.height>=h)&&d(u,b[a+1])){o=a;break}}return o},P(D,[{key:"mediaWidth",get:function(){return this.getDimensions().width*D.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*D.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(m){}return b}}]),D}();z.default=F},"./src/controller/cmcd-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return d});var B=I("./src/events.ts"),R=I("./src/types/cmcd.ts"),P=I("./src/utils/buffer-helper.ts"),F=I("./src/utils/logger.ts");function D(o,a){for(var u=0;u<a.length;u++){var s=a[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function L(o,a,u){return a&&D(o.prototype,a),u&&D(o,u),o}function A(o,a){var u=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(u)return(u=u.call(o)).next.bind(u);if(Array.isArray(o)||(u=b(o))||a&&o&&typeof o.length=="number"){u&&(o=u);var s=0;return function(){return s>=o.length?{done:!0}:{done:!1,value:o[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 b(o,a){if(!o)return;if(typeof o=="string")return m(o,a);var u=Object.prototype.toString.call(o).slice(8,-1);if(u==="Object"&&o.constructor&&(u=o.constructor.name),u==="Map"||u==="Set")return Array.from(o);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return m(o,a)}function m(o,a){(a==null||a>o.length)&&(a=o.length);for(var u=0,s=new Array(a);u<a;u++)s[u]=o[u];return s}function h(){return h=Object.assign||function(o){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(o[s]=u[s])}return o},h.apply(this,arguments)}var d=function(){function o(u){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(S){try{s.apply(S,{ot:R.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(C){F.logger.warn("Could not generate manifest CMCD data.",C)}},this.applyFragmentData=function(S){try{var C=S.frag,x=s.hls.levels[C.level],w=s.getObjectType(C),T={d:C.duration*1e3,ot:w};(w===R.CMCDObjectType.VIDEO||w===R.CMCDObjectType.AUDIO||w==R.CMCDObjectType.MUXED)&&(T.br=x.bitrate/1e3,T.tb=s.getTopBandwidth(w),T.bl=s.getBufferLength(w)),s.apply(S,T)}catch(_){F.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=u;var i=this.config=u.config,n=i.cmcd;n!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||o.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var a=o.prototype;return a.registerListeners=function(){var s=this.hls;s.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this)},a.unregisterListeners=function(){var s=this.hls;s.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},a.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},a.onMediaAttached=function(s,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},a.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},a.onBufferCreated=function(s,i){var n,S;this.audioBuffer=(n=i.tracks.audio)===null||n===void 0?void 0:n.buffer,this.videoBuffer=(S=i.tracks.video)===null||S===void 0?void 0:S.buffer},a.createData=function(){var s;return{v:R.CMCDVersion,sf:R.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}},a.apply=function(s,i){i===void 0&&(i={}),h(i,this.createData());var n=i.ot===R.CMCDObjectType.INIT||i.ot===R.CMCDObjectType.VIDEO||i.ot===R.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 S=o.toHeaders(i);if(!Object.keys(S).length)return;s.headers||(s.headers={}),h(s.headers,S)}else{var C=o.toQuery(i);if(!C)return;s.url=o.appendQueryToUri(s.url,C)}},a.getObjectType=function(s){var i=s.type;return i==="subtitle"?R.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?R.CMCDObjectType.INIT:i==="audio"?R.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?R.CMCDObjectType.VIDEO:R.CMCDObjectType.MUXED:void 0},a.getTopBandwidth=function(s){for(var i=0,n=s===R.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=A(n),C;!(C=S()).done;){var x=C.value;x.bitrate>i&&(i=x.bitrate)}return i>0?i:NaN},a.getBufferLength=function(s){var i=this.hls.media,n=s===R.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!i)return NaN;var S=P.BufferHelper.bufferInfo(n,i.currentTime,this.config.maxBufferHole);return S.len*1e3},a.createPlaylistLoader=function(){var s=this.config.pLoader,i=this.applyPlaylistData,n=s||this.config.loader;return function(){function S(x){this.loader=void 0,this.loader=new n(x)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(w,T,_){i(w),this.loader.load(w,T,_)},L(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},a.createFragmentLoader=function(){var s=this.config.fLoader,i=this.applyFragmentData,n=s||this.config.loader;return function(){function S(x){this.loader=void 0,this.loader=new n(x)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(w,T,_){i(w),this.loader.load(w,T,_)},L(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},o.uuid=function(){var s=URL.createObjectURL(new Blob),i=s.toString();return URL.revokeObjectURL(s),i.substr(i.lastIndexOf("/")+1)},o.serialize=function(s){for(var i=[],n=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},S=function(U){return Math.round(U)},C=function(U){return S(U/100)*100},x=function(U){return encodeURIComponent(U)},w={br:S,d:S,bl:C,dl:C,mtp:C,nor:x,rtp:C,tb:S},T=Object.keys(s||{}).sort(),_=A(T),y;!(y=_()).done;){var f=y.value,c=s[f];if(!n(c))continue;if(f==="v"&&c===1)continue;if(f=="pr"&&c===1)continue;var v=w[f];v&&(c=v(c));var p=typeof c,E=void 0;f==="ot"||f==="sf"||f==="st"?E=f+"="+c:p==="boolean"?E=f:p==="number"?E=f+"="+c:E=f+"="+JSON.stringify(c),i.push(E)}return i.join(",")},o.toHeaders=function(s){for(var i=Object.keys(s),n={},S=["Object","Request","Session","Status"],C=[{},{},{},{}],x={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},w=0,T=i;w<T.length;w++){var _=T[w],y=x[_]!=null?x[_]:1;C[y][_]=s[_]}for(var f=0;f<C.length;f++){var c=o.serialize(C[f]);c&&(n["CMCD-"+S[f]]=c)}return n},o.toQuery=function(s){return"CMCD="+encodeURIComponent(o.serialize(s))},o.appendQueryToUri=function(s,i){if(!i)return s;var n=s.includes("?")?"&":"?";return""+s+n+i},o}()},"./src/controller/eme-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/events.ts"),R=I("./src/errors.ts"),P=I("./src/utils/logger.ts"),F=I("./src/utils/mediakeys-helper.ts");function D(d,o){for(var a=0;a<o.length;a++){var u=o[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}function L(d,o,a){return o&&D(d.prototype,o),a&&D(d,a),d}var A=3,b=function(o,a,u){var s={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(i){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:u.audioRobustness||""})}),a.forEach(function(i){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:u.videoRobustness||""})}),[s]},m=function(o,a,u,s){switch(o){case F.KeySystems.WIDEVINE:return b(a,u,s);default:throw new Error("Unknown key-system: "+o)}},h=function(){function d(a){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=a,this._config=a.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var o=d.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(B.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(u){switch(u){case F.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},o._attemptKeySystemAccess=function(u,s,i){var n=this,S=m(u,s,i,this._drmSystemOptions);P.logger.log("Requesting encrypted media key-system access");var C=this.requestMediaKeySystemAccess(u,S);this.mediaKeysPromise=C.then(function(x){return n._onMediaKeySystemAccessObtained(u,x)}),C.catch(function(x){P.logger.error('Failed to obtain key-system "'+u+'" access:',x)})},o._onMediaKeySystemAccessObtained=function(u,s){var i=this;P.logger.log('Access for key-system "'+u+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:u};this._mediaKeysList.push(n);var S=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(C){return n.mediaKeys=C,P.logger.log('Media-keys created for key-system "'+u+'"'),i._onMediaKeysCreated(),C});return S.catch(function(C){P.logger.error("Failed to create media-keys:",C)}),S},o._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),u._onNewMediaKeySession(s.mediaKeysSession))})},o._onNewMediaKeySession=function(u){var s=this;P.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(i){s._onKeySessionMessage(u,i.message)},!1)},o._onKeySessionMessage=function(u,s){P.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(i){P.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),u.update(i)})},o.onMediaEncrypted=function(u){var s=this;if(P.logger.log('Media is encrypted using "'+u.initDataType+'" init data type'),!this.mediaKeysPromise){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(S){if(!s._media)return;s._attemptSetMediaKeys(S),s._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(i).catch(i)},o._attemptSetMediaKeys=function(u){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){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(u,s){var i=this,n=this._mediaKeysList[0];if(!n){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(n.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var S=n.mediaKeysSession;if(!S){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+u+'" init data type'),n.mediaKeysSessionInitialized=!0,S.generateRequest(u,s).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(C){P.logger.error("Error generating key-session request:",C),i.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(u,s,i){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,u,s,i);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,n,u),S=void 0}catch(C){P.logger.error(C)}try{n.readyState||n.open("POST",u,!0),S&&S.call(this.hls,n,u)}catch(C){throw new Error("issue setting up KeySystem license XHR "+C)}return n},o._onLicenseRequestReadyStageChange=function(u,s,i,n){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var S=u.response,C=this._licenseResponseCallback;if(C)try{S=C.call(this.hls,u,s)}catch(w){P.logger.error(w)}n(S)}else{if(P.logger.error("License Request XHR failed ("+s+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A){this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=A-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(i,n)}break}},o._generateLicenseRequestChallenge=function(u,s){switch(u.mediaKeySystemDomain){case F.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},o._requestLicense=function(u,s){P.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(i.mediaKeySystemDomain),S=this._createLicenseXhr(n,u,s);P.logger.log("Sending license request to URL: "+n);var C=this._generateLicenseRequestChallenge(i,u);S.send(C)}catch(x){P.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(u,s){if(!this._emeEnabled)return;var i=s.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var u=this._media,s=this._mediaKeysList;if(!u)return;u.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 u.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(u,s){if(!this._emeEnabled)return;var i=s.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),n=s.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(F.KeySystems.WIDEVINE,i,n)},L(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();z.default=h},"./src/controller/fps-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/events.ts"),R=I("./src/utils/logger.ts"),P=function(){function F(L){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=L,this.registerListeners()}var D=F.prototype;return D.setStreamController=function(A){this.streamController=A},D.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},D.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching)},D.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},D.onMediaAttaching=function(A,b){var m=this.hls.config;if(m.capLevelOnFPSDrop){var h=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},D.checkFPS=function(A,b,m){var h=performance.now();if(b){if(this.lastTime){var d=h-this.lastTime,o=m-this.lastDroppedFrames,a=b-this.lastDecodedFrames,u=1e3*o/d,s=this.hls;if(s.trigger(B.Events.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:m}),u>0&&o>s.config.fpsDroppedMonitoringThreshold*a){var i=s.currentLevel;R.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(B.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:s.currentLevel}),s.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=m,this.lastDecodedFrames=b}},D.checkFPSInterval=function(){var A=this.media;if(A)if(this.isVideoPlaybackQualityAvailable){var b=A.getVideoPlaybackQuality();this.checkFPS(A,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(A,A.webkitDecodedFrameCount,A.webkitDroppedFrameCount)},F}();z.default=P},"./src/controller/fragment-finders.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"findFragmentByPDT",function(){return P}),I.d(z,"findFragmentByPTS",function(){return F}),I.d(z,"fragmentWithinToleranceTest",function(){return D}),I.d(z,"pdtWithinToleranceTest",function(){return L}),I.d(z,"findFragWithCC",function(){return A});var B=I("./src/polyfills/number.ts"),R=I("./src/utils/binary-search.ts");function P(b,m,h){if(m===null||!Array.isArray(b)||!b.length||!Object(B.isFiniteNumber)(m))return null;var d=b[0].programDateTime;if(m<(d||0))return null;var o=b[b.length-1].endProgramDateTime;if(m>=(o||0))return null;h=h||0;for(var a=0;a<b.length;++a){var u=b[a];if(L(m,h,u))return u}return null}function F(b,m,h,d){h===void 0&&(h=0),d===void 0&&(d=0);var o=null;if(b?o=m[b.sn-m[0].sn+1]||null:h===0&&m[0].start===0&&(o=m[0]),o&&D(h,d,o)===0)return o;var a=R.default.search(m,D.bind(null,h,d));return a||o}function D(b,m,h){b===void 0&&(b=0),m===void 0&&(m=0);var d=Math.min(m,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-d<=b?1:h.start-d>b&&h.start?-1:0}function L(b,m,h){var d=Math.min(m,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,o=h.endProgramDateTime||0;return o-d>b}function A(b,m){return R.default.search(b,function(h){return h.cc<m?1:h.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"FragmentState",function(){return P}),I.d(z,"FragmentTracker",function(){return F});var B=I("./src/events.ts"),R=I("./src/types/loader.ts"),P;(function(A){A.NOT_LOADED="NOT_LOADED",A.BACKTRACKED="BACKTRACKED",A.APPENDING="APPENDING",A.PARTIAL="PARTIAL",A.OK="OK"})(P||(P={}));var F=function(){function A(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var b=A.prototype;return b._registerListeners=function(){var h=this.hls;h.on(B.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(B.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var h=this.hls;h.off(B.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(B.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(h,d){if(d===R.PlaylistLevelType.MAIN){var o=this.activeFragment,a=this.activeParts;if(!o)return null;if(a)for(var u=a.length;u--;){var s=a[u],i=s?s.end:o.appendedPTS;if(s.start<=h&&i!==void 0&&h<=i)return u>9&&(this.activeParts=a.slice(u-9)),s}else if(o.start<=h&&o.appendedPTS!==void 0&&h<=o.appendedPTS)return o}return this.getBufferedFrag(h,d)},b.getBufferedFrag=function(h,d){for(var o=this.fragments,a=Object.keys(o),u=a.length;u--;){var s=o[a[u]];if((s==null?void 0:s.body.type)===d&&s.buffered){var i=s.body;if(i.start<=h&&h<=i.end)return i}}return null},b.detectEvictedFragments=function(h,d,o){var a=this;Object.keys(this.fragments).forEach(function(u){var s=a.fragments[u];if(!s)return;if(!s.buffered){s.body.type===o&&a.removeFragment(s.body);return}var i=s.range[h];if(!i)return;i.time.some(function(n){var S=!a.isTimeBuffered(n.startPTS,n.endPTS,d);return S&&a.removeFragment(s.body),S})})},b.detectPartialFragments=function(h){var d=this,o=this.timeRanges,a=h.frag,u=h.part;if(!o||a.sn==="initSegment")return;var s=L(a),i=this.fragments[s];if(!i)return;Object.keys(o).forEach(function(n){var S=a.elementaryStreams[n];if(!S)return;var C=o[n],x=u!==null||S.partial===!0;i.range[n]=d.getBufferedTimes(a,u,x,C)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},b.fragBuffered=function(h){var d=L(h),o=this.fragments[d];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},b.getBufferedTimes=function(h,d,o,a){for(var u={time:[],partial:o},s=d?d.start:h.start,i=d?d.end:h.end,n=h.minEndPTS||i,S=h.maxStartPTS||s,C=0;C<a.length;C++){var x=a.start(C)-this.bufferPadding,w=a.end(C)+this.bufferPadding;if(S>=x&&n<=w){u.time.push({startPTS:Math.max(s,a.start(C)),endPTS:Math.min(i,a.end(C))});break}else if(s<w&&i>x)u.partial=!0,u.time.push({startPTS:Math.max(s,a.start(C)),endPTS:Math.min(i,a.end(C))});else if(i<=x)break}return u},b.getPartialFragment=function(h){var d=null,o,a,u,s=0,i=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(S){var C=n[S];if(!C)return;D(C)&&(a=C.body.start-i,u=C.body.end+i,h>=a&&h<=u&&(o=Math.min(h-a,u-h),s<=o&&(d=C.body,s=o)))}),d},b.getState=function(h){var d=L(h),o=this.fragments[d];return o?o.buffered?D(o)?P.PARTIAL:P.OK:o.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},b.backtrack=function(h,d){var o=L(h),a=this.fragments[o];if(!a||a.backtrack)return null;var u=a.backtrack=d||a.loaded;return a.loaded=null,u},b.getBacktrackData=function(h){var d=L(h),o=this.fragments[d];if(o){var a,u=o.backtrack;if(u!=null&&(a=u.payload)!==null&&a!==void 0&&a.byteLength)return u;this.removeFragment(h)}return null},b.isTimeBuffered=function(h,d,o){for(var a,u,s=0;s<o.length;s++){if(a=o.start(s)-this.bufferPadding,u=o.end(s)+this.bufferPadding,h>=a&&d<=u)return!0;if(d<=a)return!1}return!1},b.onFragLoaded=function(h,d){var o=d.frag,a=d.part;if(o.sn==="initSegment"||o.bitrateTest||a)return;var u=L(o);this.fragments[u]={body:o,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(h,d){var o=this,a=d.frag,u=d.part,s=d.timeRanges;if(a.type===R.PlaylistLevelType.MAIN)if(this.activeFragment=a,u){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(u)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(n){var S=s[n];if(o.detectEvictedFragments(n,S),!u)for(var C=0;C<S.length;C++)a.appendedPTS=Math.max(S.end(C),a.appendedPTS||0)})},b.onFragBuffered=function(h,d){this.detectPartialFragments(d)},b.hasFragment=function(h){var d=L(h);return!!this.fragments[d]},b.removeFragmentsInRange=function(h,d,o){var a=this;Object.keys(this.fragments).forEach(function(u){var s=a.fragments[u];if(!s)return;if(s.buffered){var i=s.body;i.type===o&&i.start<d&&i.end>h&&a.removeFragment(i)}})},b.removeFragment=function(h){var d=L(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[d]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},A}();function D(A){var b,m;return A.buffered&&(((b=A.range.video)===null||b===void 0?void 0:b.partial)||((m=A.range.audio)===null||m===void 0?void 0:m.partial))}function L(A){return A.type+"_"+A.level+"_"+A.urlId+"_"+A.sn}},"./src/controller/gap-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"STALL_MINIMUM_DURATION_MS",function(){return D}),I.d(z,"MAX_START_GAP_JUMP",function(){return L}),I.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return A}),I.d(z,"SKIP_BUFFER_RANGE_START",function(){return b}),I.d(z,"default",function(){return m});var B=I("./src/utils/buffer-helper.ts"),R=I("./src/errors.ts"),P=I("./src/events.ts"),F=I("./src/utils/logger.ts"),D=250,L=2,A=.1,b=.05,m=function(){function h(o,a,u,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=o,this.media=a,this.fragmentTracker=u,this.hls=s}var d=h.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(a){var u=this.config,s=this.media,i=this.stalled,n=s.currentTime,S=s.seeking,C=this.seeking&&!S,x=!this.seeking&&S;if(this.seeking=S,n!==a){if(this.moved=!0,i!==null){if(this.stallReported){var w=self.performance.now()-i;F.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||C)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!B.BufferHelper.getBuffered(s).length)return;var T=B.BufferHelper.bufferInfo(s,n,0),_=T.len>0,y=T.nextStart||0;if(!_&&!y)return;if(S){var f=T.len>L,c=!y||y-n>L&&!this.fragmentTracker.getPartialFragment(n);if(f||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,p=Math.max(y,T.start||0)-n,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,k=E==null||((v=E.details)===null||v===void 0)?void 0:v.live,U=k?E.details.targetduration*2:L;if(p>0&&p<=U){this._trySkipBufferHole(null);return}}var H=self.performance.now();if(i===null){this.stalled=H;return}var W=H-i;!S&&W>=D&&this._reportStall(T.len);var j=B.BufferHelper.bufferInfo(s,n,u.maxBufferHole);this._tryFixBufferStall(j,W)},d._tryFixBufferStall=function(a,u){var s=this.config,i=this.fragmentTracker,n=this.media,S=n.currentTime,C=i.getPartialFragment(S);if(C){var x=this._trySkipBufferHole(C);if(x)return}a.len>s.maxBufferHole&&u>s.highBufferWatchdogPeriod*1e3&&(F.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(a){var u=this.hls,s=this.media,i=this.stallReported;i||(this.stallReported=!0,F.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+a+")"),u.trigger(P.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:a}))},d._trySkipBufferHole=function(a){for(var u=this.config,s=this.hls,i=this.media,n=i.currentTime,S=0,C=B.BufferHelper.getBuffered(i),x=0;x<C.length;x++){var w=C.start(x);if(n+u.maxBufferHole>=S&&n<w){var T=Math.max(w+b,i.currentTime+A);return F.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+T),this.moved=!0,this.stalled=null,i.currentTime=T,a&&s.trigger(P.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+T,frag:a}),T}S=C.end(x)}return 0},d._tryNudgeBuffer=function(){var a=this.config,u=this.hls,s=this.media,i=s.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<a.nudgeMaxRetry){var S=i+n*a.nudgeOffset;F.logger.warn("Nudging 'currentTime' from "+i+" to "+S),s.currentTime=S,u.trigger(P.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else F.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+a.nudgeMaxRetry+" nudges"),u.trigger(P.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/events.ts"),R=I("./src/utils/texttrack-utils.ts"),P=I("./src/demux/id3.ts"),F=.25,D=function(){function L(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var A=L.prototype;return A.destroy=function(){this._unregisterListeners()},A._registerListeners=function(){var m=this.hls;m.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(B.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var m=this.hls;m.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(B.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.onMediaAttached=function(m,h){this.media=h.media},A.onMediaDetaching=function(){if(!this.id3Track)return;Object(R.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},A.getID3Track=function(m){if(!this.media)return;for(var h=0;h<m.length;h++){var d=m[h];if(d.kind==="metadata"&&d.label==="id3")return Object(R.sendAddTrackEvent)(d,this.media),d}return this.media.addTextTrack("metadata","id3")},A.onFragParsingMetadata=function(m,h){if(!this.media)return;var d=h.frag,o=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var a=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<o.length;u++){var s=P.getID3Frames(o[u].data);if(s){var i=o[u].pts,n=u<o.length-1?o[u+1].pts:d.end,S=n-i;S<=0&&(n=i+F);for(var C=0;C<s.length;C++){var x=s[C];if(!P.isTimeStampFrame(x)){var w=new a(i,n,"");w.value=x,this.id3Track.addCue(w)}}}}},A.onBufferFlushing=function(m,h){var d=h.startOffset,o=h.endOffset,a=h.type;if(!a||a==="audio"){var u=this.id3Track;u&&Object(R.removeCuesInRange)(u,d,o)}},L}();z.default=D},"./src/controller/latency-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return L});var B=I("./src/errors.ts"),R=I("./src/events.ts"),P=I("./src/utils/logger.ts");function F(A,b){for(var m=0;m<b.length;m++){var h=b[m];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(A,h.key,h)}}function D(A,b,m){return b&&F(A.prototype,b),m&&F(A,m),A}var L=function(){function A(m){var h=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 h.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var b=A.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(R.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(R.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(R.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(R.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(R.Events.ERROR,this.onError)},b.onMediaAttached=function(h,d){this.media=d.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(h,d){var o=d.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(h,d){if(d.details!==B.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var h=this.media,d=this.levelDetails;if(!h||!d)return;this.currentTime=h.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var a=this.config,u=a.lowLatencyMode,s=a.maxLiveSyncPlaybackRate;if(!u||s===1)return;var i=this.targetLatency;if(i===null)return;var n=o-i,S=Math.min(this.maxLatency,i+d.targetduration),C=n<S;if(d.live&&C&&n>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,s)),w=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;h.playbackRate=Math.min(x,Math.max(1,w))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},b.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},b.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},D(A,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,d=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:d?h.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var d=h.holdBack,o=h.partHoldBack,a=h.targetduration,u=this.config,s=u.liveSyncDuration,i=u.liveSyncDurationCount,n=u.lowLatencyMode,S=this.hls.userConfig,C=n&&o||d;(S.liveSyncDuration||S.liveSyncDurationCount||C===0)&&(C=s!==void 0?s:i*a);var x=a,w=1;return C+Math.min(this.stallCount*w,x)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),d=this.targetLatency,o=this.levelDetails;if(h===null||d===null||o===null)return null;var a=o.edge,u=h-d-this.edgeStalled,s=a-o.totalduration,i=a-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(s,u),i)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var d=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-d,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,d=this.levelDetails;if(!h||!d)return 0;var o=h.buffered.length;return o?h.buffered.end(o-1):d.edge-this.currentTime}}]),A}()},"./src/controller/level-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return u});var B=I("./src/types/level.ts"),R=I("./src/events.ts"),P=I("./src/errors.ts"),F=I("./src/utils/codecs.ts"),D=I("./src/controller/level-helper.ts"),L=I("./src/controller/base-playlist-controller.ts"),A=I("./src/types/loader.ts");function b(){return b=Object.assign||function(s){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var S in n)Object.prototype.hasOwnProperty.call(n,S)&&(s[S]=n[S])}return s},b.apply(this,arguments)}function m(s,i){for(var n=0;n<i.length;n++){var S=i[n];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(s,S.key,S)}}function h(s,i,n){return i&&m(s.prototype,i),n&&m(s,n),s}function d(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,o(s,i)}function o(s,i){return o=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},o(s,i)}var a=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(s){d(i,s);function i(S){var C;return C=s.call(this,S,"[level-controller]")||this,C._levels=[],C._firstLevel=-1,C._startLevel=void 0,C.currentLevelIndex=-1,C.manualLevelIndex=-1,C.onParsedComplete=void 0,C._registerListeners(),C}var n=i.prototype;return n._registerListeners=function(){var C=this.hls;C.on(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(R.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),C.on(R.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var C=this.hls;C.off(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(R.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),C.off(R.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 C=this._levels;C.forEach(function(x){x.loadError=0}),s.prototype.startLoad.call(this)},n.onManifestLoaded=function(C,x){var w=[],T=[],_=[],y,f={},c,v=!1,p=!1,E=!1;if(x.levels.forEach(function(W){var j=W.attrs;v=v||!!(W.width&&W.height),p=p||!!W.videoCodec,E=E||!!W.audioCodec,a&&W.audioCodec&&W.audioCodec.indexOf("mp4a.40.34")!==-1&&(W.audioCodec=void 0);var O=W.bitrate+"-"+W.attrs.RESOLUTION+"-"+W.attrs.CODECS;c=f[O],c?c.url.push(W.url):(c=new B.Level(W),f[O]=c,w.push(c)),j&&(j.AUDIO&&Object(D.addGroupId)(c,"audio",j.AUDIO),j.SUBTITLES&&Object(D.addGroupId)(c,"text",j.SUBTITLES))}),(v||p)&&E&&(w=w.filter(function(W){var j=W.videoCodec,O=W.width,K=W.height;return!!j||!!(O&&K)})),w=w.filter(function(W){var j=W.audioCodec,O=W.videoCodec;return(!j||Object(F.isCodecSupportedInMp4)(j,"audio"))&&(!O||Object(F.isCodecSupportedInMp4)(O,"video"))}),x.audioTracks&&(T=x.audioTracks.filter(function(W){return!W.audioCodec||Object(F.isCodecSupportedInMp4)(W.audioCodec,"audio")}),Object(D.assignTrackIdsByGroup)(T)),x.subtitles&&(_=x.subtitles,Object(D.assignTrackIdsByGroup)(_)),w.length>0){y=w[0].bitrate,w.sort(function(W,j){return W.bitrate-j.bitrate}),this._levels=w;for(var k=0;k<w.length;k++)if(w[k].bitrate===y){this._firstLevel=k,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+y);break}var U=E&&!p,H={levels:w,audioTracks:T,subtitleTracks:_,firstLevel:this._firstLevel,stats:x.stats,audio:E,video:p,altAudio:!U&&T.some(function(W){return!!W.url})};this.hls.trigger(R.Events.MANIFEST_PARSED,H),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(C,x){if(s.prototype.onError.call(this,C,x),x.fatal)return;var w=x.context,T=this._levels[this.currentLevelIndex];if(w&&(w.type===A.PlaylistContextType.AUDIO_TRACK&&T.audioGroupIds&&w.groupId===T.audioGroupIds[T.urlId]||w.type===A.PlaylistContextType.SUBTITLE_TRACK&&T.textGroupIds&&w.groupId===T.textGroupIds[T.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,y=!0,f;switch(x.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var c=this._levels[x.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=x.frag.level)):f=x.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(y=!1),f=w.level),_=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:f=x.level,_=!0;break}f!==void 0&&this.recoverLevel(x,f,_,y)},n.recoverLevel=function(C,x,w,T){var _=C.details,y=this._levels[x];if(y.loadError++,w){var f=this.retryLoadingOrFail(C);if(f)C.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(T){var c=y.url.length;if(c>1&&y.loadError<c)C.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var v=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(_+": switch to "+v),C.levelRetry=!0,this.hls.nextAutoLevel=v)}}},n.redundantFailover=function(C){var x=this._levels[C],w=x.url.length;if(w>1){var T=(x.urlId+1)%w;this.warn("Switching to redundant URL-id "+T),this._levels.forEach(function(_){_.urlId=T}),this.level=C}},n.onFragLoaded=function(C,x){var w=x.frag;if(w!==void 0&&w.type===A.PlaylistLevelType.MAIN){var T=this._levels[w.level];T!==void 0&&(T.fragmentError=0,T.loadError=0)}},n.onLevelLoaded=function(C,x){var w,T=x.level,_=x.details,y=this._levels[T];if(!y){var f;this.warn("Invalid level index "+T),(f=x.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(_.deltaUpdateFailed=!0);return}T===this.currentLevelIndex?(y.fragmentError===0&&(y.loadError=0,this.retryCount=0),this.playlistLoaded(T,x,y.details)):(w=x.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(_.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(C,x){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var T=-1,_=this.hls.audioTracks[x.id].groupId,y=0;y<w.audioGroupIds.length;y++)if(w.audioGroupIds[y]===_){T=y;break}T!==w.urlId&&(w.urlId=T,this.startLoad())}},n.loadPlaylist=function(C){var x=this.currentLevelIndex,w=this._levels[x];if(this.canLoad&&w&&w.url.length>0){var T=w.urlId,_=w.url[T];if(C)try{_=C.addDirectives(_)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("Attempt loading level index "+x+(C?" at sn "+C.msn+" part "+C.part:"")+" with URL-id "+T+" "+_),this.clearTimer(),this.hls.trigger(R.Events.LEVEL_LOADING,{url:_,level:x,id:T,deliveryDirectives:C||null})}},n.removeLevel=function(C,x){var w=function(y,f){return f!==x},T=this._levels.filter(function(_,y){return y!==C?!0:_.url.length>1&&x!==void 0?(_.url=_.url.filter(w),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(w)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(w)),_.urlId=0,!0):!1}).map(function(_,y){var f=_.details;return f!=null&&f.fragments&&f.fragments.forEach(function(c){c.level=y}),_});this._levels=T,this.hls.trigger(R.Events.LEVELS_UPDATED,{levels:T})},h(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(C){var x,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===C&&(x=w[C])!==null&&x!==void 0&&x.details)return;if(C<0||C>=w.length){var T=C<0;if(this.hls.trigger(R.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:C,fatal:T,reason:"invalid level idx"}),T)return;C=Math.min(C,w.length-1)}this.clearTimer();var _=this.currentLevelIndex,y=w[_],f=w[C];this.log("switching to level "+C+" from "+_),this.currentLevelIndex=C;var c=b({},f,{level:C,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete c._urlId,this.hls.trigger(R.Events.LEVEL_SWITCHING,c);var v=f.details;if(!v||v.live){var p=this.switchParams(f.uri,y==null?void 0:y.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(C){this.manualLevelIndex=C,this._startLevel===void 0&&(this._startLevel=C),C!==-1&&(this.level=C)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(C){this._firstLevel=C}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var C=this.hls.config.startLevel;return C!==void 0?C:this._firstLevel}else return this._startLevel},set:function(C){this._startLevel=C}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(C){this.level=C,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=C)}}]),i}(L.default)},"./src/controller/level-helper.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"addGroupId",function(){return P}),I.d(z,"assignTrackIdsByGroup",function(){return F}),I.d(z,"updatePTS",function(){return D}),I.d(z,"updateFragPTSDTS",function(){return A}),I.d(z,"mergeDetails",function(){return b}),I.d(z,"mapPartIntersection",function(){return m}),I.d(z,"mapFragmentIntersection",function(){return h}),I.d(z,"adjustSliding",function(){return d}),I.d(z,"addSliding",function(){return o}),I.d(z,"computeReloadInterval",function(){return a}),I.d(z,"getFragmentWithSN",function(){return u}),I.d(z,"getPartWith",function(){return s});var B=I("./src/polyfills/number.ts"),R=I("./src/utils/logger.ts");function P(i,n,S){switch(n){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(S);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(S);break}}function F(i){var n={};i.forEach(function(S){var C=S.groupId||"";S.id=n[C]=n[C]||0,n[C]++})}function D(i,n,S){var C=i[n],x=i[S];L(C,x)}function L(i,n){var S=n.startPTS;if(Object(B.isFiniteNumber)(S)){var C=0,x;n.sn>i.sn?(C=S-i.start,x=i):(C=i.start-S,x=n),x.duration!==C&&(x.duration=C)}else if(n.sn>i.sn){var w=i.cc===n.cc;w&&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 A(i,n,S,C,x,w){var T=C-S;T<=0&&(R.logger.warn("Fragment should have a positive duration",n),C=S+n.duration,w=x+n.duration);var _=S,y=C,f=n.startPTS,c=n.endPTS;if(Object(B.isFiniteNumber)(f)){var v=Math.abs(f-S);Object(B.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(v,n.deltaPTS):n.deltaPTS=v,_=Math.max(S,f),S=Math.min(S,f),x=Math.min(x,n.startDTS),y=Math.min(C,c),C=Math.max(C,c),w=Math.max(w,n.endDTS)}n.duration=C-S;var p=S-n.start;n.appendedPTS=C,n.start=n.startPTS=S,n.maxStartPTS=_,n.startDTS=x,n.endPTS=C,n.minEndPTS=y,n.endDTS=w;var E=n.sn;if(!i||E<i.startSN||E>i.endSN)return 0;var k,U=E-i.startSN,H=i.fragments;for(H[U]=n,k=U;k>0;k--)L(H[k],H[k-1]);for(k=U;k<H.length-1;k++)L(H[k],H[k+1]);return i.fragmentHint&&L(H[H.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,p}function b(i,n){for(var S=null,C=i.fragments,x=C.length-1;x>=0;x--){var w=C[x].initSegment;if(w){S=w;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var T=0,_;if(h(i,n,function(k,U){k.relurl&&(T=k.cc-U.cc),Object(B.isFiniteNumber)(k.startPTS)&&Object(B.isFiniteNumber)(k.endPTS)&&(U.start=U.startPTS=k.startPTS,U.startDTS=k.startDTS,U.appendedPTS=k.appendedPTS,U.maxStartPTS=k.maxStartPTS,U.endPTS=k.endPTS,U.endDTS=k.endDTS,U.minEndPTS=k.minEndPTS,U.duration=k.endPTS-k.startPTS,U.duration&&(_=U),n.PTSKnown=n.alignedSliding=!0),U.elementaryStreams=k.elementaryStreams,U.loader=k.loader,U.stats=k.stats,U.urlId=k.urlId,k.initSegment&&(U.initSegment=k.initSegment,S=k.initSegment)}),S){var y=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;y.forEach(function(k){var U;(!k.initSegment||k.initSegment.relurl===((U=S)===null||U===void 0?void 0:U.relurl))&&(k.initSegment=S)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(k){return!k}),n.deltaUpdateFailed)){R.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 c=n.fragments;if(T){R.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<c.length;v++)c[v].cc+=T}n.skippedSegments&&(n.startCC=n.fragments[0].cc),m(i.partList,n.partList,function(k,U){U.elementaryStreams=k.elementaryStreams,U.stats=k.stats}),_?A(n,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):d(i,n),c.length&&(n.totalduration=n.edge-c[0].start),n.driftStartTime=i.driftStartTime,n.driftStart=i.driftStart;var p=n.advancedDateTime;if(n.advanced&&p){var E=n.edge;n.driftStart||(n.driftStartTime=p,n.driftStart=E),n.driftEndTime=p,n.driftEnd=E}else n.driftEndTime=i.driftEndTime,n.driftEnd=i.driftEnd,n.advancedDateTime=i.advancedDateTime}function m(i,n,S){if(i&&n)for(var C=0,x=0,w=i.length;x<=w;x++){var T=i[x],_=n[x+C];T&&_&&T.index===_.index&&T.fragment.sn===_.fragment.sn?S(T,_):C--}}function h(i,n,S){for(var C=n.skippedSegments,x=Math.max(i.startSN,n.startSN)-n.startSN,w=(i.fragmentHint?1:0)+(C?n.endSN:Math.min(i.endSN,n.endSN))-n.startSN,T=n.startSN-i.startSN,_=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,y=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,f=x;f<=w;f++){var c=y[T+f],v=_[f];C&&!v&&f<C&&(v=n.fragments[f]=c),c&&v&&S(c,v)}}function d(i,n){var S=n.startSN+n.skippedSegments-i.startSN,C=i.fragments;if(S<0||S>=C.length)return;o(n,C[S].start)}function o(i,n){if(n){for(var S=i.fragments,C=i.skippedSegments;C<S.length;C++)S[C].start+=n;i.fragmentHint&&(i.fragmentHint.start+=n)}}function a(i,n){var S=1e3*i.levelTargetDuration,C=S/2,x=i.age,w=x>0&&x<S*3,T=n.loading.end-n.loading.start,_,y=i.availabilityDelay;if(i.updated===!1)if(w){var f=333*i.misses;_=Math.max(Math.min(C,T*2),f),i.availabilityDelay=(i.availabilityDelay||0)+_}else _=C;else w?(y=Math.min(y||S/2,x),i.availabilityDelay=y,_=y+S-x):_=S-T;return Math.round(_)}function u(i,n,S){if(!i||!i.details)return null;var C=i.details,x=C.fragments[n-C.startSN];return x||(x=C.fragmentHint,x&&x.sn===n?x:n<C.startSN&&S&&S.sn===n?S:null)}function s(i,n,S){if(!i||!i.details)return null;var C=i.details.partList;if(C)for(var x=C.length;x--;){var w=C[x];if(w.index===S&&w.fragment.sn===n)return w}return null}},"./src/controller/stream-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return C});var B=I("./src/polyfills/number.ts"),R=I("./src/controller/base-stream-controller.ts"),P=I("./src/is-supported.ts"),F=I("./src/events.ts"),D=I("./src/utils/buffer-helper.ts"),L=I("./src/controller/fragment-tracker.ts"),A=I("./src/types/loader.ts"),b=I("./src/loader/fragment.ts"),m=I("./src/demux/transmuxer-interface.ts"),h=I("./src/types/transmuxer.ts"),d=I("./src/controller/gap-controller.ts"),o=I("./src/errors.ts"),a=I("./src/utils/logger.ts");function u(x,w){for(var T=0;T<w.length;T++){var _=w[T];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function s(x,w,T){return w&&u(x.prototype,w),T&&u(x,T),x}function i(x,w){x.prototype=Object.create(w.prototype),x.prototype.constructor=x,n(x,w)}function n(x,w){return n=Object.setPrototypeOf||function(_,y){return _.__proto__=y,_},n(x,w)}var S=100,C=function(x){i(w,x);function w(_,y){var f;return f=x.call(this,_,y,"[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 T=w.prototype;return T._registerListeners=function(){var y=this.hls;y.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),y.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.on(F.Events.ERROR,this.onError,this),y.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),y.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.on(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T._unregisterListeners=function(){var y=this.hls;y.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.off(F.Events.ERROR,this.onError,this),y.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),y.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.off(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},T.startLoad=function(y){if(this.levels){var f=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=c.startLevel;v===-1&&(c.config.testBandwidth?(v=0,this.bitrateTest=!0):v=c.nextAutoLevel),this.level=c.nextLoadLevel=v,this.loadedmetadata=!1}f>0&&y===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),y=f),this.state=R.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=y,this.tick()}else this._forceStartLoad=!0,this.state=R.State.STOPPED},T.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},T.doTick=function(){switch(this.state){case R.State.IDLE:this.doTickIdle();break;case R.State.WAITING_LEVEL:{var y,f=this.levels,c=this.level,v=f==null||((y=f[c])===null||y===void 0)?void 0:y.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=R.State.IDLE;break}break}case R.State.FRAG_LOADING_WAITING_RETRY:{var p,E=self.performance.now(),k=this.retryDate;(!k||E>=k||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=R.State.IDLE)}break;default:break}this.onTickEnd()},T.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},T.doTickIdle=function(){var y,f,c=this.hls,v=this.levelLastLoaded,p=this.levels,E=this.media,k=c.config,U=c.nextLoadLevel;if(v===null||!E&&(this.startFragRequested||!k.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[U])return;var H=p[U];this.level=c.nextLoadLevel=U;var W=H.details;if(!W||this.state===R.State.WAITING_LEVEL||W.live&&this.levelLastLoaded!==U){this.state=R.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,A.PlaylistLevelType.MAIN);if(j===null)return;var O=j.len,K=this.getMaxBufferLength(H.maxBitrate);if(O>=K)return;if(this._streamEnded(j,W)){var Y={};this.altAudio&&(Y.type="video"),this.hls.trigger(F.Events.BUFFER_EOS,Y),this.state=R.State.ENDED;return}var ee=j.end,se=this.getNextFragment(ee,W);if(this.couldBacktrack&&!this.fragPrevious&&se&&se.sn!=="initSegment"){var Be=se.sn-W.startSN;Be>1&&(se=W.fragments[Be-1],this.fragmentTracker.removeFragment(se))}if(se&&this.fragmentTracker.getState(se)===L.FragmentState.OK&&this.nextLoadPosition>ee){var me=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,me,A.PlaylistLevelType.MAIN),se=this.getNextFragment(this.nextLoadPosition,W)}if(!se)return;se.initSegment&&!se.initSegment.data&&!this.bitrateTest&&(se=se.initSegment),((y=se.decryptdata)===null||y===void 0?void 0:y.keyFormat)==="identity"&&!((f=se.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(se,W):this.loadFragment(se,W,ee)},T.loadFragment=function(y,f,c){var v,p=this.fragmentTracker.getState(y);if(this.fragCurrent=y,p===L.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(y);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else p=L.FragmentState.NOT_LOADED}p===L.FragmentState.NOT_LOADED||p===L.FragmentState.PARTIAL?y.sn==="initSegment"?this._loadInitSegment(y):this.bitrateTest?(y.bitrateTest=!0,this.log("Fragment "+y.sn+" of level "+y.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(y)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,y,f,c)):p===L.FragmentState.APPENDING?this.reduceMaxBufferLength(y.duration)&&this.fragmentTracker.removeFragment(y):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},T.getAppendedFrag=function(y){var f=this.fragmentTracker.getAppendedFrag(y,A.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},T.getBufferedFrag=function(y){return this.fragmentTracker.getBufferedFrag(y,A.PlaylistLevelType.MAIN)},T.followingBufferedFrag=function(y){return y?this.getBufferedFrag(y.end+.5):null},T.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},T.nextLevelSwitch=function(){var y=this.levels,f=this.media;if(f!=null&&f.readyState){var c,v=this.getAppendedFrag(f.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!f.paused&&y){var p=this.hls.nextLoadLevel,E=y[p],k=this.fragLastKbps;k&&this.fragCurrent?c=this.fragCurrent.duration*E.maxBitrate/(1e3*k)+1:c=0}else c=0;var U=this.getBufferedFrag(f.currentTime+c);if(U){var H=this.followingBufferedFrag(U);if(H){this.abortCurrentFrag();var W=H.maxStartPTS?H.maxStartPTS:H.start,j=H.duration,O=Math.max(U.end,W+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},T.abortCurrentFrag=function(){var y=this.fragCurrent;this.fragCurrent=null,y!=null&&y.loader&&y.loader.abort(),this.state===R.State.KEY_LOADING&&(this.state=R.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},T.flushMainBuffer=function(y,f){x.prototype.flushMainBuffer.call(this,y,f,this.altAudio?"video":null)},T.onMediaAttached=function(y,f){x.prototype.onMediaAttached.call(this,y,f);var c=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,c,this.fragmentTracker,this.hls)},T.onMediaDetaching=function(){var y=this.media;y&&(y.removeEventListener("playing",this.onvplaying),y.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},T.onMediaPlaying=function(){this.tick()},T.onMediaSeeked=function(){var y=this.media,f=y?y.currentTime:null;Object(B.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},T.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(F.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},T.onManifestParsed=function(y,f){var c=!1,v=!1,p;f.levels.forEach(function(E){p=E.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(c=!0),p.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=c&&v&&!Object(P.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},T.onLevelLoading=function(y,f){var c=this.levels;if(!c||this.state!==R.State.IDLE)return;var v=c[f.level];(!v.details||v.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(v.details))&&(this.state=R.State.WAITING_LEVEL)},T.onLevelLoaded=function(y,f){var c,v=this.levels,p=f.level,E=f.details,k=E.totalduration;if(!v){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+k);var U=this.fragCurrent;U&&(this.state===R.State.FRAG_LOADING||this.state===R.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==f.level&&U.loader&&(this.state=R.State.IDLE,U.loader.abort()));var H=v[p],W=0;if(E.live||(c=H.details)!==null&&c!==void 0&&c.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;W=this.alignPlaylists(E,H.details)}if(H.details=E,this.levelLastLoaded=p,this.hls.trigger(F.Events.LEVEL_UPDATED,{details:E,level:p}),this.state===R.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=R.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,W),this.tick()},T._handleFragmentLoadProgress=function(y){var f,c=y.frag,v=y.part,p=y.payload,E=this.levels;if(!E){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var k=E[c.level],U=k.details;if(!U){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var H=k.videoCodec,W=U.PTSKnown||!U.live,j=(f=c.initSegment)===null||f===void 0?void 0:f.data,O=this._getAudioCodec(k),K=this.transmuxer=this.transmuxer||new m.default(this.hls,A.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Y=v?v.index:-1,ee=Y!==-1,se=new h.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,p.byteLength,Y,ee),Be=this.initPTS[c.cc];K.push(p,j,O,H,c,v,U.totalduration,W,se,Be)},T.onAudioTrackSwitching=function(y,f){var c=this.altAudio,v=!!f.url,p=f.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var E=this.fragCurrent;E!=null&&E.loader&&(this.log("Switching to main audio track, cancel main fragment load"),E.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var k=this.hls;c&&k.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),k.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:p})}},T.onAudioTrackSwitched=function(y,f){var c=f.id,v=!!this.hls.audioTracks[c].url;if(v){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=v,this.tick()},T.onBufferCreated=function(y,f){var c=f.tracks,v,p,E=!1;for(var k in c){var U=c[k];if(U.id==="main"){if(p=k,v=U,k==="video"){var H=c[k];H&&(this.videoBuffer=H.buffer)}}else E=!0}E&&v?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},T.onFragBuffered=function(y,f){var c=f.frag,v=f.part;if(c&&c.type!==A.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(v?" p: "+v.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===R.State.PARSED&&(this.state=R.State.IDLE);return}var p=v?v.stats:c.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,v)},T.onError=function(y,f){switch(f.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.MAIN,f);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==R.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=R.State.ERROR):!f.levelRetry&&this.state===R.State.WAITING_LEVEL&&(this.state=R.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===R.State.PARSING||this.state===R.State.PARSED)){var c=!0,v=this.getFwdBufferInfo(this.media,A.PlaylistLevelType.MAIN);v&&v.len>.5&&(c=!this.reduceMaxBufferLength(v.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},T.checkBuffer=function(){var y=this.media,f=this.gapController;if(!y||!f||!y.readyState)return;var c=D.BufferHelper.getBuffered(y);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=y.currentTime},T.onFragLoadEmergencyAborted=function(){this.state=R.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},T.onBufferFlushed=function(y,f){var c=f.type;if(c!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(c===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,c,A.PlaylistLevelType.MAIN)}},T.onLevelsUpdated=function(y,f){this.levels=f.levels},T.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},T.seekToStartPos=function(){var y=this.media,f=y.currentTime,c=this.startPosition;if(c>=0&&f<c){if(y.seeking){a.logger.log("could not seek to "+c+", already seeking at "+f);return}var v=D.BufferHelper.getBuffered(y),p=v.length?v.start(0):0,E=p-c;E>0&&(E<this.config.maxBufferHole||E<this.config.maxFragLookUpTolerance)&&(a.logger.log("adjusting start position by "+E+" to match buffer start"),c+=E,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+f),y.currentTime=c}},T._getAudioCodec=function(y){var f=this.config.defaultAudioCodec||y.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},T._loadBitrateTestFrag=function(y){var f=this;this._doFragLoad(y).then(function(c){var v=f.hls;if(!c||v.nextLoadLevel||f.fragContextChanged(y))return;f.fragLoadError=0,f.state=R.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var p=y.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),v.trigger(F.Events.FRAG_LOADED,c)})},T._handleTransmuxComplete=function(y){var f,c="main",v=this.hls,p=y.remuxResult,E=y.chunkMeta,k=this.getCurrentContext(E);if(!k){this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(E.level);return}var U=k.frag,H=k.part,W=k.level,j=p.video,O=p.text,K=p.id3,Y=p.initSegment,ee=this.altAudio?void 0:p.audio;if(this.fragContextChanged(U))return;if(this.state=R.State.PARSING,Y){Y.tracks&&(this._bufferInitSegment(W,Y.tracks,U,E),v.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:c,tracks:Y.tracks}));var se=Y.initPTS,Be=Y.timescale;Object(B.isFiniteNumber)(se)&&(this.initPTS[U.cc]=se,v.trigger(F.Events.INIT_PTS_FOUND,{frag:U,id:c,initPTS:se,timescale:Be}))}if(j&&p.independent!==!1){if(W.details){var me=j.startPTS,xe=j.endPTS,Le=j.startDTS,Ae=j.endDTS;if(H)H.elementaryStreams[j.type]={startPTS:me,endPTS:xe,startDTS:Le,endDTS:Ae};else if(j.firstKeyFrame&&j.independent&&(this.couldBacktrack=!0),j.dropped&&j.independent){var le=this.getLoadPosition()+this.config.maxBufferHole;if(le<me){this.backtrack(U);return}U.setElementaryStreamInfo(j.type,U.start,xe,U.start,Ae,!0)}U.setElementaryStreamInfo(j.type,me,xe,Le,Ae),this.bufferFragmentData(j,U,H,E)}}else if(p.independent===!1){this.backtrack(U);return}if(ee){var fe=ee.startPTS,Ve=ee.endPTS,Lt=ee.startDTS,Pt=ee.endDTS;H&&(H.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:Ve,startDTS:Lt,endDTS:Pt}),U.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,fe,Ve,Lt,Pt),this.bufferFragmentData(ee,U,H,E)}if(K!=null&&(f=K.samples)!==null&&f!==void 0&&f.length){var vt={frag:U,id:c,samples:K.samples};v.trigger(F.Events.FRAG_PARSING_METADATA,vt)}if(O){var Fe={frag:U,id:c,samples:O.samples};v.trigger(F.Events.FRAG_PARSING_USERDATA,Fe)}},T._bufferInitSegment=function(y,f,c,v){var p=this;if(this.state!==R.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var E=f.audio,k=f.video,U=f.audiovideo;if(E){var H=y.audioCodec,W=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(H&&(H.indexOf("mp4a.40.5")!==-1?H="mp4a.40.2":H="mp4a.40.5"),E.metadata.channelCount!==1&&W.indexOf("firefox")===-1&&(H="mp4a.40.5")),W.indexOf("android")!==-1&&E.container!=="audio/mpeg"&&(H="mp4a.40.2",this.log("Android: force audio codec to "+H)),y.audioCodec&&y.audioCodec!==H&&this.log('Swapping manifest audio codec "'+y.audioCodec+'" for "'+H+'"'),E.levelCodec=H,E.id="main",this.log("Init audio buffer, container:"+E.container+", codecs[selected/level/parsed]=["+(H||"")+"/"+(y.audioCodec||"")+"/"+E.codec+"]")}k&&(k.levelCodec=y.videoCodec,k.id="main",this.log("Init video buffer, container:"+k.container+", codecs[level/parsed]=["+(y.videoCodec||"")+"/"+k.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(y.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(j){var O=f[j],K=O.initSegment;K!=null&&K.byteLength&&p.hls.trigger(F.Events.BUFFER_APPENDING,{type:j,data:K,frag:c,part:null,chunkMeta:v,parent:c.type})}),this.tick()},T.backtrack=function(y){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(y);var f=this.fragmentTracker.backtrack(y);this.fragPrevious=null,this.nextLoadPosition=y.start,f?this.resetFragmentLoading(y):this.state=R.State.BACKTRACKING},T.checkFragmentChanged=function(){var y=this.media,f=null;if(y&&y.readyState>1&&y.seeking===!1){var c=y.currentTime;if(D.BufferHelper.isBuffered(y,c)?f=this.getAppendedFrag(c):D.BufferHelper.isBuffered(y,c+.1)&&(f=this.getAppendedFrag(c+.1)),f){var v=this.fragPlaying,p=f.level;(!v||f.sn!==v.sn||v.level!==p||f.urlId!==v.urlId)&&(this.hls.trigger(F.Events.FRAG_CHANGED,{frag:f}),(!v||v.level!==p)&&this.hls.trigger(F.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=f)}}},s(w,[{key:"nextLevel",get:function(){var y=this.nextBufferedFrag;return y?y.level:-1}},{key:"currentLevel",get:function(){var y=this.media;if(y){var f=this.getAppendedFrag(y.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var y=this.media;if(y){var f=this.getAppendedFrag(y.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(R.default)},"./src/controller/subtitle-stream-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"SubtitleStreamController",function(){return i});var B=I("./src/events.ts"),R=I("./src/utils/logger.ts"),P=I("./src/utils/buffer-helper.ts"),F=I("./src/controller/fragment-finders.ts"),D=I("./src/utils/discontinuities.ts"),L=I("./src/controller/level-helper.ts"),A=I("./src/controller/fragment-tracker.ts"),b=I("./src/controller/base-stream-controller.ts"),m=I("./src/types/loader.ts"),h=I("./src/types/level.ts");function d(n,S){for(var C=0;C<S.length;C++){var x=S[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(n,x.key,x)}}function o(n,S,C){return S&&d(n.prototype,S),C&&d(n,C),n}function a(n,S){n.prototype=Object.create(S.prototype),n.prototype.constructor=n,u(n,S)}function u(n,S){return u=Object.setPrototypeOf||function(x,w){return x.__proto__=w,x},u(n,S)}var s=500,i=function(n){a(S,n);function S(x,w){var T;return T=n.call(this,x,w,"[subtitle-stream-controller]")||this,T.levels=[],T.currentTrackId=-1,T.tracksBuffered=[],T.mainDetails=null,T._registerListeners(),T}var C=S.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var w=this.hls;w.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(B.Events.ERROR,this.onError,this),w.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(B.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(B.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var w=this.hls;w.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(B.Events.ERROR,this.onError,this),w.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(B.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(B.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(s),this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},C.onLevelLoaded=function(w,T){this.mainDetails=T.details},C.onSubtitleFragProcessed=function(w,T){var _=T.frag,y=T.success;if(this.fragPrevious=_,this.state=b.State.IDLE,!y)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var c,v=_.start,p=0;p<f.length;p++)if(v>=f[p].start&&v<=f[p].end){c=f[p];break}var E=_.start+_.duration;c?c.end=E:(c={start:v,end:E},f.push(c)),this.fragmentTracker.fragBuffered(_)},C.onBufferFlushing=function(w,T){var _=T.startOffset,y=T.endOffset;if(_===0&&y!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,c=this.levels;if(!c.length||!c[f]||!c[f].details)return;var v=c[f].details,p=v.targetduration,E=y-p;if(E<=0)return;T.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(k){for(var U=0;U<k.length;){if(k[U].end<=E){k.shift();continue}else if(k[U].start<E)k[U].start=E;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(_,E,m.PlaylistLevelType.SUBTITLE)}},C.onError=function(w,T){var _,y=T.frag;if(!y||y.type!==m.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},C.onSubtitleTracksUpdated=function(w,T){var _=this,y=T.subtitleTracks;this.tracksBuffered=[],this.levels=y.map(function(f){return new h.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){_.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},C.onSubtitleTrackSwitch=function(w,T){if(this.currentTrackId=T.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(s)},C.onSubtitleTrackLoaded=function(w,T){var _,y=T.details,f=T.id,c=this.currentTrackId,v=this.levels;if(!v.length)return;var p=v[c];if(f>=v.length||f!==c||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,y.live||(_=p.details)!==null&&_!==void 0&&_.live){var E=this.mainDetails;if(y.deltaUpdateFailed||!E)return;var k=E.fragments[0];if(!p.details)y.hasProgramDateTime&&E.hasProgramDateTime?Object(D.alignMediaPlaylistByPDT)(y,E):k&&Object(L.addSliding)(y,k.start);else{var U=this.alignPlaylists(y,p.details);U===0&&k&&Object(L.addSliding)(y,k.start)}}if(p.details=y,this.levelLastLoaded=f,this.tick(),y.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var H=Object(F.findFragmentByPTS)(null,y.fragments,this.media.currentTime,0);H||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},C._handleFragmentLoadComplete=function(w){var T=w.frag,_=w.payload,y=T.decryptdata,f=this.hls;if(this.fragContextChanged(T))return;if(_&&_.byteLength>0&&y&&y.key&&y.iv&&y.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),y.key.buffer,y.iv.buffer).then(function(v){var p=performance.now();f.trigger(B.Events.FRAG_DECRYPTED,{frag:T,payload:v,stats:{tstart:c,tdecrypt:p}})})}},C.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var w,T=this.currentTrackId,_=this.levels;if(!_.length||!_[T]||!_[T].details)return;var y=_[T].details,f=y.targetduration,c=this.config,v=this.media,p=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-f,c.maxBufferHole),E=p.end,k=p.len,U=this.getMaxBufferLength()+f;if(k>U)return;console.assert(y,"Subtitle track details are defined on idle subtitle stream controller tick");var H=y.fragments,W=H.length,j=y.edge,O,K=this.fragPrevious;if(E<j){var Y=c.maxFragLookUpTolerance;K&&y.hasProgramDateTime&&(O=Object(F.findFragmentByPDT)(H,K.endProgramDateTime,Y)),O||(O=Object(F.findFragmentByPTS)(K,H,E,Y),!O&&K&&K.start<H[0].start&&(O=H[0]))}else O=H[W-1];(w=O)!==null&&w!==void 0&&w.encrypted?(R.logger.log("Loading key for "+O.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(B.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===A.FragmentState.NOT_LOADED&&this.loadFragment(O,y,E)}},C.loadFragment=function(w,T,_){this.fragCurrent=w,n.prototype.loadFragment.call(this,w,T,_)},o(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(b.default)},"./src/controller/subtitle-track-controller.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/events.ts"),R=I("./src/utils/texttrack-utils.ts"),P=I("./src/controller/base-playlist-controller.ts"),F=I("./src/types/loader.ts");function D(d,o){for(var a=0;a<o.length;a++){var u=o[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}function L(d,o,a){return o&&D(d.prototype,o),a&&D(d,a),d}function A(d,o){d.prototype=Object.create(o.prototype),d.prototype.constructor=d,b(d,o)}function b(d,o){return b=Object.setPrototypeOf||function(u,s){return u.__proto__=s,u},b(d,o)}var m=function(d){A(o,d);function o(u){var s;return s=d.call(this,u,"[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 a=o.prototype;return a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,d.prototype.destroy.call(this)},a.registerListeners=function(){var s=this.hls;s.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(B.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(B.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(B.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(B.Events.ERROR,this.onError,this)},a.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)},a.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},a.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=h(this.media.textTracks);s.forEach(function(i){Object(R.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},a.onManifestParsed=function(s,i){this.tracks=i.subtitleTracks},a.onSubtitleTrackLoaded=function(s,i){var n=i.id,S=i.details,C=this.trackId,x=this.tracksInGroup[C];if(!x){this.warn("Invalid subtitle track id "+n);return}var w=x.details;x.details=i.details,this.log("subtitle track "+n+" loaded ["+S.startSN+"-"+S.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,i,w))},a.onLevelLoading=function(s,i){this.switchLevel(i.level)},a.onLevelSwitching=function(s,i){this.switchLevel(i.level)},a.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 S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,C=this.tracks.filter(function(T){return!n||T.groupId===n});this.tracksInGroup=C;var x=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=n;var w={subtitleTracks:C};this.log("Updating subtitle tracks, "+C.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(B.Events.SUBTITLE_TRACKS_UPDATED,w),x!==-1&&this.setSubtitleTrack(x,S)}},a.findTrackId=function(s){for(var i=this.tracksInGroup,n=0;n<i.length;n++){var S=i[n];if((!this.selectDefaultTrack||S.default)&&(!s||s===S.name))return S.id}return-1},a.onError=function(s,i){if(d.prototype.onError.call(this,s,i),i.fatal||!i.context)return;i.context.type===F.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},a.loadPlaylist=function(s){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var n=i.id,S=i.groupId,C=i.url;if(s)try{C=s.addDirectives(C)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADING,{url:C,id:n,groupId:S,deliveryDirectives:s||null})}},a.toggleTrackModes=function(s){var i=this,n=this.media,S=this.subtitleDisplay,C=this.trackId;if(!n)return;var x=h(n.textTracks),w=x.filter(function(y){return y.groupId===i.groupId});if(s===-1)[].slice.call(x).forEach(function(y){y.mode="disabled"});else{var T=w[C];T&&(T.mode="disabled")}var _=w[s];_&&(_.mode=S?"showing":"hidden")},a.setSubtitleTrack=function(s,i){var n,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(n=S[s])!==null&&n!==void 0&&n.details)||s<-1||s>=S.length)return;this.clearTimer();var C=S[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,C){var x=C.id,w=C.groupId,T=w===void 0?"":w,_=C.name,y=C.type,f=C.url;this.hls.trigger(B.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:T,name:_,type:y,url:f});var c=this.switchParams(C.url,i==null?void 0:i.details);this.loadPlaylist(c)}else this.hls.trigger(B.Events.SUBTITLE_TRACK_SWITCH,{id:s})},a.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,i=h(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)},L(o,[{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)}}]),o}(P.default);function h(d){for(var o=[],a=0;a<d.length;a++){var u=d[a];u.kind==="subtitles"&&u.label&&o.push(d[a])}return o}z.default=m},"./src/controller/timeline-controller.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"TimelineController",function(){return h});var B=I("./src/polyfills/number.ts"),R=I("./src/events.ts"),P=I("./src/utils/cea-608-parser.ts"),F=I("./src/utils/output-filter.ts"),D=I("./src/utils/webvtt-parser.ts"),L=I("./src/utils/texttrack-utils.ts"),A=I("./src/utils/imsc1-ttml-parser.ts"),b=I("./src/types/loader.ts"),m=I("./src/utils/logger.ts"),h=function(){function u(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=a(),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 F.default(this,"textTrack1"),S=new F.default(this,"textTrack2"),C=new F.default(this,"textTrack3"),x=new F.default(this,"textTrack4");this.cea608Parser1=new P.default(1,n,S),this.cea608Parser2=new P.default(3,C,x)}i.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(R.Events.FRAG_LOADING,this.onFragLoading,this),i.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(R.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(R.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(R.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=u.prototype;return s.destroy=function(){var n=this.hls;n.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.off(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.off(R.Events.FRAG_LOADING,this.onFragLoading,this),n.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(R.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.off(R.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(R.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(n,S,C,x,w){for(var T=!1,_=w.length;_--;){var y=w[_],f=o(y[0],y[1],S,C);if(f>=0&&(y[0]=Math.min(y[0],S),y[1]=Math.max(y[1],C),T=!0,f/(C-S)>.5))return}if(T||w.push([S,C]),this.config.renderTextTracksNatively){var c=this.captionsTracks[n];this.Cues.newCue(c,S,C,x)}else{var v=this.Cues.newCue(null,S,C,x);this.hls.trigger(R.Events.CUES_PARSED,{type:"captions",cues:v,track:n})}},s.onInitPtsFound=function(n,S){var C=this,x=S.frag,w=S.id,T=S.initPTS,_=S.timescale,y=this.unparsedVttFrags;w==="main"&&(this.initPTS[x.cc]=T,this.timescale[x.cc]=_),y.length&&(this.unparsedVttFrags=[],y.forEach(function(f){C.onFragLoaded(R.Events.FRAG_LOADED,f)}))},s.getExistingTrack=function(n){var S=this.media;if(S)for(var C=0;C<S.textTracks.length;C++){var x=S.textTracks[C];if(x[n])return x}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 S=this.captionsProperties,C=this.captionsTracks,x=this.media,w=S[n],T=w.label,_=w.languageCode,y=this.getExistingTrack(n);if(y)C[n]=y,Object(L.clearCurrentCues)(C[n]),Object(L.sendAddTrackEvent)(C[n],x);else{var f=this.createTextTrack("captions",T,_);f&&(f[n]=!0,C[n]=f)}},s.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var S=this.captionsProperties[n];if(!S)return;var C=S.label,x={_id:n,label:C,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[n]=x,this.hls.trigger(R.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},s.createTextTrack=function(n,S,C){var x=this.media;return x?x.addTextTrack(n,S,C):void 0},s.onMediaAttaching=function(n,S){this.media=S.media,this._cleanTracks()},s.onMediaDetaching=function(){var n=this.captionsTracks;Object.keys(n).forEach(function(S){Object(L.clearCurrentCues)(n[S]),delete n[S]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=a(),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 S=n.textTracks;if(S)for(var C=0;C<S.length;C++)Object(L.clearCurrentCues)(S[C])},s.onSubtitleTracksUpdated=function(n,S){var C=this;this.textTracks=[];var x=S.subtitleTracks||[],w=x.some(function(f){return f.textCodec===A.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var T=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,c){var v;if(c<_.length){for(var p=null,E=0;E<_.length;E++)if(d(_[E],f)){p=_[E];break}p&&(v=p)}v?Object(L.clearCurrentCues)(v):(v=C.createTextTrack("subtitles",f.name,f.lang),v&&(v.mode="disabled")),v&&(v.groupId=f.groupId,C.textTracks.push(v))})}else if(!T&&this.tracks&&this.tracks.length){var y=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(R.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:y})}}},s.onManifestLoaded=function(n,S){var C=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(x){var w=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!w)return;var T="textTrack"+w[1],_=C.captionsProperties[T];if(!_)return;_.label=x.name,x.lang&&(_.languageCode=x.lang),_.media=x})},s.onFragLoading=function(n,S){var C=this.cea608Parser1,x=this.cea608Parser2,w=this.lastSn,T=this.lastPartIndex;if(!this.enabled||!(C&&x))return;if(S.frag.type===b.PlaylistLevelType.MAIN){var _,y,f=S.frag.sn,c=(_=S==null||((y=S.part)===null||y===void 0)?void 0:y.index)!=null?_:-1;f===w+1||f===w&&c===T+1||(C.reset(),x.reset()),this.lastSn=f,this.lastPartIndex=c}},s.onFragLoaded=function(n,S){var C=S.frag,x=S.payload,w=this.initPTS,T=this.unparsedVttFrags;if(C.type===b.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(B.isFiniteNumber)(w[C.cc])){T.push(S),w.length&&this.hls.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Missing initial subtitle PTS")});return}var _=C.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var y=this.tracks[C.level],f=this.vttCCs;f[C.cc]||(f[C.cc]={start:C.start,prevCC:this.prevCC,new:!0},this.prevCC=C.cc),y&&y.textCodec===A.IMSC1_CODEC?this._parseIMSC1(C,x):this._parseVTTs(C,x,f)}}else this.hls.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(n,S){var C=this,x=this.hls;Object(A.parseIMSC1)(S,this.initPTS[n.cc],this.timescale[n.cc],function(w){C._appendCues(w,n.level),x.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(w){m.logger.log("Failed to parse IMSC1: "+w),x.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:w})})},s._parseVTTs=function(n,S,C){var x=this,w=this.hls;Object(D.parseWebVTT)(S,this.initPTS[n.cc],this.timescale[n.cc],C,n.cc,n.start,function(T){x._appendCues(T,n.level),w.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(T){x._fallbackToIMSC1(n,S),m.logger.log("Failed to parse VTT cue: "+T),w.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:T})})},s._fallbackToIMSC1=function(n,S){var C=this,x=this.tracks[n.level];x.textCodec||Object(A.parseIMSC1)(S,this.initPTS[n.cc],this.timescale[n.cc],function(){x.textCodec=A.IMSC1_CODEC,C._parseIMSC1(n,S)},function(){x.textCodec="wvtt"})},s._appendCues=function(n,S){var C=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[S];if(x.mode==="disabled")return;n.forEach(function(_){return Object(L.addCueToTrack)(x,_)})}else{var w=this.tracks[S],T=w.default?"default":"subtitles"+S;C.trigger(R.Events.CUES_PARSED,{type:"subtitles",cues:n,track:T})}},s.onFragDecrypted=function(n,S){var C=S.frag;if(C.type===b.PlaylistLevelType.SUBTITLE){if(!Object(B.isFiniteNumber)(this.initPTS[C.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(R.Events.FRAG_LOADED,S)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(n,S){var C=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(C&&x))return;for(var w=0;w<S.samples.length;w++){var T=S.samples[w].bytes;if(T){var _=this.extractCea608Data(T);C.addData(S.samples[w].pts,_[0]),x.addData(S.samples[w].pts,_[1])}}},s.onBufferFlushing=function(n,S){var C=S.startOffset,x=S.endOffset,w=S.endOffsetSubtitles,T=S.type,_=this.media;if(!_||_.currentTime<x)return;if(!T||T==="video"){var y=this.captionsTracks;Object.keys(y).forEach(function(c){return Object(L.removeCuesInRange)(y[c],C,x)})}if(this.config.renderTextTracksNatively&&(C===0&&w!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(c){return Object(L.removeCuesInRange)(f[c],C,w)})}},s.extractCea608Data=function(n){for(var S=n[0]&31,C=2,x=[[],[]],w=0;w<S;w++){var T=n[C++],_=127&n[C++],y=127&n[C++],f=(4&T)!==0,c=3&T;if(_===0&&y===0)continue;f&&((c===0||c===1)&&(x[c].push(_),x[c].push(y)))}return x},u}();function d(u,s){return u&&u.label===s.name&&!(u.textTrack1||u.textTrack2)}function o(u,s,i,n){return Math.min(s,n)-Math.max(u,i)}function a(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return B});var B=function(){function R(F,D){this.subtle=void 0,this.aesIV=void 0,this.subtle=F,this.aesIV=D}var P=R.prototype;return P.decrypt=function(D,L){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},L,D)},R}()},"./src/crypt/aes-decryptor.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"removePadding",function(){return R}),I.d(z,"default",function(){return P});var B=I("./src/utils/typed-array.ts");function R(F){var D=F.byteLength,L=D&&new DataView(F.buffer).getUint8(D-1);return L?Object(B.sliceUint8)(F,0,D-L):F}var P=function(){function F(){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 D=F.prototype;return D.uint8ArrayToUint32Array_=function(A){for(var b=new DataView(A),m=new Uint32Array(4),h=0;h<4;h++)m[h]=b.getUint32(h*4);return m},D.initTable=function(){var A=this.sBox,b=this.invSBox,m=this.subMix,h=m[0],d=m[1],o=m[2],a=m[3],u=this.invSubMix,s=u[0],i=u[1],n=u[2],S=u[3],C=new Uint32Array(256),x=0,w=0,T=0;for(T=0;T<256;T++)T<128?C[T]=T<<1:C[T]=T<<1^283;for(T=0;T<256;T++){var _=w^w<<1^w<<2^w<<3^w<<4;_=_>>>8^_&255^99,A[x]=_,b[_]=x;var y=C[x],f=C[y],c=C[f],v=C[_]*257^_*16843008;h[x]=v<<24|v>>>8,d[x]=v<<16|v>>>16,o[x]=v<<8|v>>>24,a[x]=v,v=c*16843009^f*65537^y*257^x*16843008,s[_]=v<<24|v>>>8,i[_]=v<<16|v>>>16,n[_]=v<<8|v>>>24,S[_]=v,x?(x=y^C[C[C[c^y]]],w^=C[C[w]]):x=w=1}},D.expandKey=function(A){for(var b=this.uint8ArrayToUint32Array_(A),m=!0,h=0;h<b.length&&m;)m=b[h]===this.key[h],h++;if(m)return;this.key=b;var d=this.keySize=b.length;if(d!==4&&d!==6&&d!==8)throw new Error("Invalid aes key size="+d);var o=this.ksRows=(d+6+1)*4,a,u,s=this.keySchedule=new Uint32Array(o),i=this.invKeySchedule=new Uint32Array(o),n=this.sBox,S=this.rcon,C=this.invSubMix,x=C[0],w=C[1],T=C[2],_=C[3],y,f;for(a=0;a<o;a++){if(a<d){y=s[a]=b[a];continue}f=y,a%d===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^=S[a/d|0]<<24):d>6&&a%d===4&&(f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255]),s[a]=y=(s[a-d]^f)>>>0}for(u=0;u<o;u++)a=o-u,u&3?f=s[a]:f=s[a-4],u<4||a<=4?i[u]=f:i[u]=x[n[f>>>24]]^w[n[f>>>16&255]]^T[n[f>>>8&255]]^_[n[f&255]],i[u]=i[u]>>>0},D.networkToHostOrderSwap=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},D.decrypt=function(A,b,m){for(var h=this.keySize+6,d=this.invKeySchedule,o=this.invSBox,a=this.invSubMix,u=a[0],s=a[1],i=a[2],n=a[3],S=this.uint8ArrayToUint32Array_(m),C=S[0],x=S[1],w=S[2],T=S[3],_=new Int32Array(A),y=new Int32Array(_.length),f,c,v,p,E,k,U,H,W,j,O,K,Y,ee,se=this.networkToHostOrderSwap;b<_.length;){for(W=se(_[b]),j=se(_[b+1]),O=se(_[b+2]),K=se(_[b+3]),E=W^d[0],k=K^d[1],U=O^d[2],H=j^d[3],Y=4,ee=1;ee<h;ee++)f=u[E>>>24]^s[k>>16&255]^i[U>>8&255]^n[H&255]^d[Y],c=u[k>>>24]^s[U>>16&255]^i[H>>8&255]^n[E&255]^d[Y+1],v=u[U>>>24]^s[H>>16&255]^i[E>>8&255]^n[k&255]^d[Y+2],p=u[H>>>24]^s[E>>16&255]^i[k>>8&255]^n[U&255]^d[Y+3],E=f,k=c,U=v,H=p,Y=Y+4;f=o[E>>>24]<<24^o[k>>16&255]<<16^o[U>>8&255]<<8^o[H&255]^d[Y],c=o[k>>>24]<<24^o[U>>16&255]<<16^o[H>>8&255]<<8^o[E&255]^d[Y+1],v=o[U>>>24]<<24^o[H>>16&255]<<16^o[E>>8&255]<<8^o[k&255]^d[Y+2],p=o[H>>>24]<<24^o[E>>16&255]<<16^o[k>>8&255]<<8^o[U&255]^d[Y+3],y[b]=se(f^C),y[b+1]=se(p^x),y[b+2]=se(v^w),y[b+3]=se(c^T),C=W,x=j,w=O,T=K,b=b+4}return y.buffer},F}()},"./src/crypt/decrypter.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return b});var B=I("./src/crypt/aes-crypto.ts"),R=I("./src/crypt/fast-aes-key.ts"),P=I("./src/crypt/aes-decryptor.ts"),F=I("./src/utils/logger.ts"),D=I("./src/utils/mp4-tools.ts"),L=I("./src/utils/typed-array.ts"),A=16,b=function(){function m(d,o,a){var u=a===void 0?{}:a,s=u.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=d,this.config=o,this.removePKCS7Padding=i,i)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=m.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var a=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(P.removePadding)(a):a},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(o,a,u,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),a,u);var i=this.flush();i&&s(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),a,u).then(s)},h.softwareDecrypt=function(o,a,u){var s=this.currentIV,i=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(o=Object(D.appendUint8Array)(n,o),this.remainderData=null);var S=this.getValidChunk(o);if(!S.length)return null;s&&(u=s);var C=this.softwareDecrypter;C||(C=this.softwareDecrypter=new P.default),C.expandKey(a);var x=i;return this.currentResult=C.decrypt(S.buffer,0,u),this.currentIV=Object(L.sliceUint8)(S,-16).buffer,x||null},h.webCryptoDecrypt=function(o,a,u){var s=this,i=this.subtle;return(this.key!==a||!this.fastAesKey)&&(this.key=a,this.fastAesKey=new R.default(i,a)),this.fastAesKey.expandKey().then(function(n){if(!i)return Promise.reject(new Error("web crypto not initialized"));var S=new B.default(i,u);return S.decrypt(o.buffer,n)}).catch(function(n){return s.onWebCryptoError(n,o,a,u)})},h.onWebCryptoError=function(o,a,u,s){return F.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(a,u,s)},h.getValidChunk=function(o){var a=o,u=o.length-o.length%A;return u!==o.length&&(a=Object(L.sliceUint8)(o,0,u),this.remainderData=Object(L.sliceUint8)(o,u)),a},h.logOnce=function(o){if(!this.logEnabled)return;F.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return B});var B=function(){function R(F,D){this.subtle=void 0,this.key=void 0,this.subtle=F,this.key=D}var P=R.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},R}()},"./src/demux/aacdemuxer.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/demux/base-audio-demuxer.ts"),R=I("./src/demux/adts.ts"),P=I("./src/utils/logger.ts"),F=I("./src/demux/id3.ts");function D(b,m){b.prototype=Object.create(m.prototype),b.prototype.constructor=b,L(b,m)}function L(b,m){return L=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},L(b,m)}var A=function(b){D(m,b);function m(d,o){var a;return a=b.call(this)||this,a.observer=void 0,a.config=void 0,a.observer=d,a.config=o,a}var h=m.prototype;return h.resetInitSegment=function(o,a,u){b.prototype.resetInitSegment.call(this,o,a,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:u,inputTimeScale:9e4,dropped:0}},m.probe=function(o){if(!o)return!1;for(var a=F.getID3Data(o,0)||[],u=a.length,s=o.length;u<s;u++)if(R.probe(o,u))return P.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(o,a){return R.canParse(o,a)},h.appendFrame=function(o,a,u){R.initTrackConfig(o,this.observer,a,u,o.manifestCodec);var s=R.appendFrame(o,a,u,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},m}(B.default);A.minProbeByteLength=9,z.default=A},"./src/demux/adts.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"getAudioConfig",function(){return F}),I.d(z,"isHeaderPattern",function(){return D}),I.d(z,"getHeaderLength",function(){return L}),I.d(z,"getFullFrameLength",function(){return A}),I.d(z,"canGetFrameLength",function(){return b}),I.d(z,"isHeader",function(){return m}),I.d(z,"canParse",function(){return h}),I.d(z,"probe",function(){return d}),I.d(z,"initTrackConfig",function(){return o}),I.d(z,"getFrameDuration",function(){return a}),I.d(z,"parseFrameHeader",function(){return u}),I.d(z,"appendFrame",function(){return s});var B=I("./src/utils/logger.ts"),R=I("./src/errors.ts"),P=I("./src/events.ts");function F(i,n,S,C){var x,w,T,_,y=navigator.userAgent.toLowerCase(),f=C,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((n[S+2]&192)>>>6)+1;var v=(n[S+2]&60)>>>2;if(v>c.length-1){i.trigger(P.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return T=(n[S+2]&1)<<2,T|=(n[S+3]&192)>>>6,B.logger.log("manifest codec:"+C+", ADTS type:"+x+", samplingIndex:"+v),/firefox/i.test(y)?v>=6?(x=5,_=new Array(4),w=v-3):(x=2,_=new Array(2),w=v):y.indexOf("android")!==-1?(x=2,_=new Array(2),w=v):(x=5,_=new Array(4),C&&(C.indexOf("mp4a.40.29")!==-1||C.indexOf("mp4a.40.5")!==-1)||!C&&v>=6?w=v-3:((C&&C.indexOf("mp4a.40.2")!==-1&&(v>=6&&T===1||/vivaldi/i.test(y))||!C&&T===1)&&(x=2,_=new Array(2)),w=v)),_[0]=x<<3,_[0]|=(v&14)>>1,_[1]|=(v&1)<<7,_[1]|=T<<3,x===5&&(_[1]|=(w&14)>>1,_[2]=(w&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:c[v],channelCount:T,codec:"mp4a.40."+x,manifestCodec:f}}function D(i,n){return i[n]===255&&(i[n+1]&246)===240}function L(i,n){return i[n+1]&1?7:9}function A(i,n){return(i[n+3]&3)<<11|i[n+4]<<3|(i[n+5]&224)>>>5}function b(i,n){return n+5<i.length}function m(i,n){return n+1<i.length&&D(i,n)}function h(i,n){return b(i,n)&&D(i,n)&&A(i,n)<=i.length-n}function d(i,n){if(m(i,n)){var S=L(i,n);if(n+S>=i.length)return!1;var C=A(i,n);if(C<=S)return!1;var x=n+C;return x===i.length||m(i,x)}return!1}function o(i,n,S,C,x){if(!i.samplerate){var w=F(n,S,C,x);if(!w)return;i.config=w.config,i.samplerate=w.samplerate,i.channelCount=w.channelCount,i.codec=w.codec,i.manifestCodec=w.manifestCodec,B.logger.log("parsed codec:"+i.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function a(i){return 1024*9e4/i}function u(i,n,S,C,x){var w=L(i,n),T=A(i,n);if(T-=w,T>0){var _=S+C*x;return{headerLength:w,frameLength:T,stamp:_}}}function s(i,n,S,C,x){var w=a(i.samplerate),T=u(n,S,C,x,w);if(T){var _=T.frameLength,y=T.headerLength,f=T.stamp,c=y+_,v=Math.max(0,S+c-n.length),p;v?(p=new Uint8Array(c-y),p.set(n.subarray(S+y,n.length),0)):p=n.subarray(S+y,S+c);var E={unit:p,pts:f};return v||i.samples.push(E),{sample:E,length:c,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"initPTSFn",function(){return A});var B=I("./src/polyfills/number.ts"),R=I("./src/demux/id3.ts"),P=I("./src/demux/dummy-demuxed-track.ts"),F=I("./src/utils/mp4-tools.ts"),D=I("./src/utils/typed-array.ts"),L=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=b.prototype;return m.resetInitSegment=function(d,o,a){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(d,o){return!1},m.appendFrame=function(d,o,a){},m.demux=function(d,o){this.cachedData&&(d=Object(F.appendUint8Array)(this.cachedData,d),this.cachedData=null);var a=R.getID3Data(d,0),u=a?a.length:0,s,i,n=this._audioTrack,S=this._id3Track,C=a?R.getTimeStamp(a):void 0,x=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=A(C,o)),a&&a.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:a}),i=this.initPTS;u<x;){if(this.canParse(d,u)){var w=this.appendFrame(n,d,u);w?(this.frameIndex++,i=w.sample.pts,u+=w.length,s=u):u=x}else R.canParse(d,u)?(a=R.getID3Data(d,u),S.samples.push({pts:i,dts:i,data:a}),u+=a.length,s=u):u++;if(u===x&&s!==x){var T=Object(D.sliceUint8)(d,s);this.cachedData?this.cachedData=Object(F.appendUint8Array)(this.cachedData,T):this.cachedData=T}}return{audioTrack:n,avcTrack:Object(P.dummyTrack)(),id3Track:S,textTrack:Object(P.dummyTrack)()}},m.demuxSampleAes=function(d,o,a){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(d){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},m.destroy=function(){},b}(),A=function(m,h){return Object(B.isFiniteNumber)(m)?m*90:h*9e4};z.default=L},"./src/demux/chunk-cache.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return B});var B=function(){function P(){this.chunks=[],this.dataLength=0}var F=P.prototype;return F.push=function(L){this.chunks.push(L),this.dataLength+=L.length},F.flush=function(){var L=this.chunks,A=this.dataLength,b;if(L.length)L.length===1?b=L[0]:b=R(L,A);else return new Uint8Array(0);return this.reset(),b},F.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function R(P,F){for(var D=new Uint8Array(F),L=0,A=0;A<P.length;A++){var b=P[A];D.set(b,L),L+=b.length}return D}},"./src/demux/dummy-demuxed-track.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"dummyTrack",function(){return B});function B(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/utils/logger.ts"),R=function(){function P(D){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=D,this.bytesAvailable=D.byteLength,this.word=0,this.bitsAvailable=0}var F=P.prototype;return F.loadWord=function(){var L=this.data,A=this.bytesAvailable,b=L.byteLength-A,m=new Uint8Array(4),h=Math.min(4,A);if(h===0)throw new Error("no bytes available");m.set(L.subarray(b,b+h)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},F.skipBits=function(L){var A;this.bitsAvailable>L?(this.word<<=L,this.bitsAvailable-=L):(L-=this.bitsAvailable,A=L>>3,L-=A>>3,this.bytesAvailable-=A,this.loadWord(),this.word<<=L,this.bitsAvailable-=L)},F.readBits=function(L){var A=Math.min(this.bitsAvailable,L),b=this.word>>>32-A;return L>32&&B.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=A,this.bitsAvailable>0?this.word<<=A:this.bytesAvailable>0&&this.loadWord(),A=L-A,A>0&&this.bitsAvailable?b<<A|this.readBits(A):b},F.skipLZ=function(){var L;for(L=0;L<this.bitsAvailable;++L)if((this.word&2147483648>>>L)!==0)return this.word<<=L,this.bitsAvailable-=L,L;return this.loadWord(),L+this.skipLZ()},F.skipUEG=function(){this.skipBits(1+this.skipLZ())},F.skipEG=function(){this.skipBits(1+this.skipLZ())},F.readUEG=function(){var L=this.skipLZ();return this.readBits(L+1)-1},F.readEG=function(){var L=this.readUEG();return 1&L?1+L>>>1:-1*(L>>>1)},F.readBoolean=function(){return this.readBits(1)===1},F.readUByte=function(){return this.readBits(8)},F.readUShort=function(){return this.readBits(16)},F.readUInt=function(){return this.readBits(32)},F.skipScalingList=function(L){for(var A=8,b=8,m,h=0;h<L;h++)b!==0&&(m=this.readEG(),b=(A+m+256)%256),A=b===0?A:b},F.readSPS=function(){var L=0,A=0,b=0,m=0,h,d,o,a=this.readUByte.bind(this),u=this.readBits.bind(this),s=this.readUEG.bind(this),i=this.readBoolean.bind(this),n=this.skipBits.bind(this),S=this.skipEG.bind(this),C=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);a();var w=a();if(u(5),n(3),a(),C(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var T=s();if(T===3&&n(1),C(),C(),n(1),i())for(d=T!==3?8:12,o=0;o<d;o++)i()&&(o<6?x(16):x(64))}C();var _=s();if(_===0)s();else if(_===1)for(n(1),S(),S(),h=s(),o=0;o<h;o++)S();C(),n(1);var y=s(),f=s(),c=u(1);c===0&&n(1),n(1),i()&&(L=s(),A=s(),b=s(),m=s());var v=[1,1];if(i()&&i()){var p=a();switch(p){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[a()<<8|a(),a()<<8|a()];break}}}return{width:Math.ceil((y+1)*16-L*2-A*2),height:(2-c)*(f+1)*16-(c?2:4)*(b+m),pixelRatio:v}},F.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();z.default=R},"./src/demux/id3.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"isHeader",function(){return B}),I.d(z,"isFooter",function(){return R}),I.d(z,"getID3Data",function(){return P}),I.d(z,"canParse",function(){return D}),I.d(z,"getTimeStamp",function(){return L}),I.d(z,"isTimeStampFrame",function(){return A}),I.d(z,"getID3Frames",function(){return m}),I.d(z,"decodeFrame",function(){return h}),I.d(z,"utf8ArrayToStr",function(){return s}),I.d(z,"testables",function(){return i});var B=function(x,w){return w+10<=x.length&&(x[w]===73&&x[w+1]===68&&x[w+2]===51&&(x[w+3]<255&&x[w+4]<255&&(x[w+6]<128&&x[w+7]<128&&x[w+8]<128&&x[w+9]<128)))},R=function(x,w){return w+10<=x.length&&(x[w]===51&&x[w+1]===68&&x[w+2]===73&&(x[w+3]<255&&x[w+4]<255&&(x[w+6]<128&&x[w+7]<128&&x[w+8]<128&&x[w+9]<128)))},P=function(x,w){for(var T=w,_=0;B(x,w);){_+=10;var y=F(x,w+6);_+=y,R(x,w+10)&&(_+=10),w+=_}return _>0?x.subarray(T,T+_):void 0},F=function(x,w){var T=0;return T=(x[w]&127)<<21,T|=(x[w+1]&127)<<14,T|=(x[w+2]&127)<<7,T|=x[w+3]&127,T},D=function(x,w){return B(x,w)&&F(x,w+6)+10<=x.length-w},L=function(x){for(var w=m(x),T=0;T<w.length;T++){var _=w[T];if(A(_))return u(_)}return},A=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},b=function(x){var w=String.fromCharCode(x[0],x[1],x[2],x[3]),T=F(x,4),_=10;return{type:w,size:T,data:x.subarray(_,_+T)}},m=function(x){for(var w=0,T=[];B(x,w);){var _=F(x,w+6);w+=10;for(var y=w+_;w+8<y;){var f=b(x.subarray(w)),c=h(f);c&&T.push(c),w+=f.size+10}R(x,w)&&(w+=10)}return T},h=function(x){return x.type==="PRIV"?d(x):x.type[0]==="W"?a(x):o(x)},d=function(x){if(x.size<2)return;var w=s(x.data,!0),T=new Uint8Array(x.data.subarray(w.length+1));return{key:x.type,info:w,data:T.buffer}},o=function(x){if(x.size<2)return;if(x.type==="TXXX"){var w=1,T=s(x.data.subarray(w),!0);w+=T.length+1;var _=s(x.data.subarray(w));return{key:x.type,info:T,data:_}}var y=s(x.data.subarray(1));return{key:x.type,data:y}},a=function(x){if(x.type==="WXXX"){if(x.size<2)return;var w=1,T=s(x.data.subarray(w),!0);w+=T.length+1;var _=s(x.data.subarray(w));return{key:x.type,info:T,data:_}}var y=s(x.data);return{key:x.type,data:y}},u=function(x){if(x.data.byteLength===8){var w=new Uint8Array(x.data),T=w[3]&1,_=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return _/=45,T&&(_+=4772185884e-2),Math.round(_)}return},s=function(x,w){w===void 0&&(w=!1);var T=S();if(T){var _=T.decode(x);if(w){var y=_.indexOf("\0");return y!==-1?_.substring(0,y):_}return _.replace(/\0/g,"")}for(var f=x.length,c,v,p,E="",k=0;k<f;){if(c=x[k++],c===0&&w)return E;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:E+=String.fromCharCode(c);break;case 12:case 13:v=x[k++],E+=String.fromCharCode((c&31)<<6|v&63);break;case 14:v=x[k++],p=x[k++],E+=String.fromCharCode((c&15)<<12|(v&63)<<6|(p&63)<<0);break;default:}}return E},i={decodeTextFrame:o},n;function S(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/demux/base-audio-demuxer.ts"),R=I("./src/demux/id3.ts"),P=I("./src/utils/logger.ts"),F=I("./src/demux/mpegaudio.ts");function D(b,m){b.prototype=Object.create(m.prototype),b.prototype.constructor=b,L(b,m)}function L(b,m){return L=Object.setPrototypeOf||function(d,o){return d.__proto__=o,d},L(b,m)}var A=function(b){D(m,b);function m(){return b.apply(this,arguments)||this}var h=m.prototype;return h.resetInitSegment=function(o,a,u){b.prototype.resetInitSegment.call(this,o,a,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:u,inputTimeScale:9e4,dropped:0}},m.probe=function(o){if(!o)return!1;for(var a=R.getID3Data(o,0)||[],u=a.length,s=o.length;u<s;u++)if(F.probe(o,u))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(o,a){return F.canParse(o,a)},h.appendFrame=function(o,a,u){return this.initPTS===null?void 0:F.appendFrame(o,a,u,this.initPTS,this.frameIndex)},m}(B.default);A.minProbeByteLength=4,z.default=A},"./src/demux/mp4demuxer.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/utils/mp4-tools.ts"),R=I("./src/demux/dummy-demuxed-track.ts"),P=function(){function F(L,A){this.remainderData=null,this.config=void 0,this.config=A}var D=F.prototype;return D.resetTimeStamp=function(){},D.resetInitSegment=function(){},D.resetContiguity=function(){},F.probe=function(A){return Object(B.findBox)({data:A,start:0,end:Math.min(A.length,16384)},["moof"]).length>0},D.demux=function(A){var b=A,m=Object(R.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(B.appendUint8Array)(this.remainderData,A));var h=Object(B.segmentValidRange)(b);this.remainderData=h.remainder,m.samples=h.valid||new Uint8Array}else m.samples=b;return{audioTrack:Object(R.dummyTrack)(),avcTrack:m,id3Track:Object(R.dummyTrack)(),textTrack:Object(R.dummyTrack)()}},D.flush=function(){var A=Object(R.dummyTrack)();return A.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(R.dummyTrack)(),avcTrack:A,id3Track:Object(R.dummyTrack)(),textTrack:Object(R.dummyTrack)()}},D.demuxSampleAes=function(A,b,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},D.destroy=function(){},F}();P.minProbeByteLength=1024,z.default=P},"./src/demux/mpegaudio.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"appendFrame",function(){return L}),I.d(z,"parseHeader",function(){return A}),I.d(z,"isHeaderPattern",function(){return b}),I.d(z,"isHeader",function(){return m}),I.d(z,"canParse",function(){return h}),I.d(z,"probe",function(){return d});var B=null,R=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],F=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],D=[0,1,1,4];function L(o,a,u,s,i){if(u+24>a.length)return;var n=A(a,u);if(n&&u+n.frameLength<=a.length){var S=n.samplesPerFrame*9e4/n.sampleRate,C=s+i*S,x={unit:a.subarray(u,u+n.frameLength),pts:C,dts:C};return o.config=[],o.channelCount=n.channelCount,o.samplerate=n.sampleRate,o.samples.push(x),{sample:x,length:n.frameLength,missing:0}}}function A(o,a){var u=o[a+1]>>3&3,s=o[a+1]>>1&3,i=o[a+2]>>4&15,n=o[a+2]>>2&3;if(u!==1&&i!==0&&i!==15&&n!==3){var S=o[a+2]>>1&1,C=o[a+3]>>6,x=u===3?3-s:s===3?3:4,w=R[x*14+i-1]*1e3,T=u===3?0:u===2?1:2,_=P[T*3+n],y=C===3?1:2,f=F[u][s],c=D[s],v=f*8*c,p=Math.floor(f*w/_+S)*c;if(B===null){var E=navigator.userAgent||"",k=E.match(/Chrome\/(\d+)/i);B=k?parseInt(k[1]):0}var U=!!B&&B<=87;return U&&s===2&&w>=224e3&&C===0&&(o[a+3]=o[a+3]|128),{sampleRate:_,channelCount:y,frameLength:p,samplesPerFrame:v}}}function b(o,a){return o[a]===255&&(o[a+1]&224)===224&&(o[a+1]&6)!==0}function m(o,a){return a+1<o.length&&b(o,a)}function h(o,a){var u=4;return b(o,a)&&u<=o.length-a}function d(o,a){if(a+1<o.length&&b(o,a)){var u=4,s=A(o,a),i=u;s!=null&&s.frameLength&&(i=s.frameLength);var n=a+i;return n===o.length||m(o,n)}return!1}},"./src/demux/sample-aes.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/crypt/decrypter.ts"),R=I("./src/demux/tsdemuxer.ts"),P=function(){function F(L,A,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new B.default(L,A,{removePKCS7Padding:!1})}var D=F.prototype;return D.decryptBuffer=function(A,b){this.decrypter.decrypt(A,this.keyData.key.buffer,this.keyData.iv.buffer,b)},D.decryptAacSample=function(A,b,m,h){var d=A[b].unit,o=d.subarray(16,d.length-d.length%16),a=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),u=this;this.decryptBuffer(a,function(s){var i=new Uint8Array(s);d.set(i,16),h||u.decryptAacSamples(A,b+1,m)})},D.decryptAacSamples=function(A,b,m){for(;;b++){if(b>=A.length){m();return}if(A[b].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(A,b,m,h),!h)return}},D.getAvcEncryptedData=function(A){for(var b=Math.floor((A.length-48)/160)*16+16,m=new Int8Array(b),h=0,d=32;d<=A.length-16;d+=160,h+=16)m.set(A.subarray(d,d+16),h);return m},D.getAvcDecryptedUnit=function(A,b){for(var m=new Uint8Array(b),h=0,d=32;d<=A.length-16;d+=160,h+=16)A.set(m.subarray(h,h+16),d);return A},D.decryptAvcSample=function(A,b,m,h,d,o){var a=Object(R.discardEPB)(d.data),u=this.getAvcEncryptedData(a),s=this;this.decryptBuffer(u.buffer,function(i){d.data=s.getAvcDecryptedUnit(a,i),o||s.decryptAvcSamples(A,b,m+1,h)})},D.decryptAvcSamples=function(A,b,m,h){if(A instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,m=0){if(b>=A.length){h();return}for(var d=A[b].units;!(m>=d.length);m++){var o=d[m];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var a=this.decrypter.isSync();if(this.decryptAvcSample(A,b,m,h,o,a),!a)return}}},F}();z.default=P},"./src/demux/transmuxer-interface.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return d});var B=I("./node_modules/webworkify-webpack/index.js"),R=I.n(B),P=I("./src/events.ts"),F=I("./src/demux/transmuxer.ts"),D=I("./src/utils/logger.ts"),L=I("./src/errors.ts"),A=I("./src/utils/mediasource-helper.ts"),b=I("./node_modules/eventemitter3/index.js"),m=I.n(b),h=Object(A.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function o(u,s,i,n){var S=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=u,this.id=s,this.onTransmuxComplete=i,this.onFlush=n;var C=u.config,x=function(f,c){c=c||{},c.frag=S.frag,c.id=S.id,u.trigger(f,c)};this.observer=new b.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,x),this.observer.on(P.Events.ERROR,x);var w={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},T=navigator.vendor;if(C.enableWorker&&typeof Worker!="undefined"){D.logger.log("demuxing in webworker");var _;try{_=this.worker=B("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(y){u.trigger(P.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(y.message+" ("+y.filename+":"+y.lineno+")")})},_.postMessage({cmd:"init",typeSupported:w,vendor:T,id:s,config:JSON.stringify(C)})}catch(y){D.logger.warn("Error in worker:",y),D.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new F.default(this.observer,w,C,T,s),this.worker=null}}else this.transmuxer=new F.default(this.observer,w,C,T,s)}var a=o.prototype;return a.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},a.push=function(s,i,n,S,C,x,w,T,_,y){var f=this;_.transmuxing.start=self.performance.now();var c=this.transmuxer,v=this.worker,p=x?x.start:C.start,E=C.decryptdata,k=this.frag,U=!(k&&C.cc===k.cc),H=!(k&&_.level===k.level),W=k?_.sn-k.sn:-1,j=this.part?_.part-this.part.index:1,O=!H&&(W===1||W===0&&j===1),K=self.performance.now();(H||W||C.stats.parsing.start===0)&&(C.stats.parsing.start=K),x&&(j||!O)&&(x.stats.parsing.start=K);var Y=new F.TransmuxState(U,O,T,H,p);if(!O||U){D.logger.log("[transmuxer-interface, "+C.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
|
|
discontinuity: `+U+`
|
|
trackSwitch: `+H+`
|
|
contiguous: `+O+`
|
|
accurateTimeOffset: `+T+`
|
|
timeOffset: `+p);var ee=new F.TransmuxConfig(n,S,i,w,y);this.configureTransmuxer(ee)}if(this.frag=C,this.part=x,v)v.postMessage({cmd:"demux",data:s,decryptdata:E,chunkMeta:_,state:Y},s instanceof ArrayBuffer?[s]:[]);else if(c){var se=c.push(s,E,_,Y);Object(F.isPromise)(se)?se.then(function(Be){f.handleTransmuxComplete(Be)}):this.handleTransmuxComplete(se)}},a.flush=function(s){var i=this;s.transmuxing.start=self.performance.now();var n=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:s});else if(n){var C=n.flush(s);Object(F.isPromise)(C)?C.then(function(x){i.handleFlushResult(x,s)}):this.handleFlushResult(C,s)}},a.handleFlushResult=function(s,i){var n=this;s.forEach(function(S){n.handleTransmuxComplete(S)}),this.onFlush(i)},a.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}}},a.configureTransmuxer=function(s){var i=this.worker,n=this.transmuxer;i?i.postMessage({cmd:"configure",config:s}):n&&n.configure(s)},a.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},o}()},"./src/demux/transmuxer-worker.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return L});var B=I("./src/demux/transmuxer.ts"),R=I("./src/events.ts"),P=I("./src/utils/logger.ts"),F=I("./node_modules/eventemitter3/index.js"),D=I.n(F);function L(d){var o=new F.EventEmitter,a=function(s,i){d.postMessage({event:s,data:i})};o.on(R.Events.FRAG_DECRYPTED,a),o.on(R.Events.ERROR,a),d.addEventListener("message",function(u){var s=u.data;switch(s.cmd){case"init":{var i=JSON.parse(s.config);d.transmuxer=new B.default(o,s.typeSupported,i,s.vendor,s.id),Object(P.enableLogs)(i.debug),a("init",null);break}case"configure":{d.transmuxer.configure(s.config);break}case"demux":{var n=d.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(B.isPromise)(n)?n.then(function(x){A(d,x)}):A(d,n);break}case"flush":{var S=s.chunkMeta,C=d.transmuxer.flush(S);Object(B.isPromise)(C)?C.then(function(x){m(d,x,S)}):m(d,C,S);break}default:break}})}function A(d,o){if(h(o.remuxResult))return;var a=[],u=o.remuxResult,s=u.audio,i=u.video;s&&b(a,s),i&&b(a,i),d.postMessage({event:"transmuxComplete",data:o},a)}function b(d,o){o.data1&&d.push(o.data1.buffer),o.data2&&d.push(o.data2.buffer)}function m(d,o,a){o.forEach(function(u){A(d,u)}),d.postMessage({event:"flush",data:a})}function h(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return i}),I.d(z,"isPromise",function(){return C}),I.d(z,"TransmuxConfig",function(){return x}),I.d(z,"TransmuxState",function(){return w});var B=I("./src/events.ts"),R=I("./src/errors.ts"),P=I("./src/crypt/decrypter.ts"),F=I("./src/demux/aacdemuxer.ts"),D=I("./src/demux/mp4demuxer.ts"),L=I("./src/demux/tsdemuxer.ts"),A=I("./src/demux/mp3demuxer.ts"),b=I("./src/remux/mp4-remuxer.ts"),m=I("./src/remux/passthrough-remuxer.ts"),h=I("./src/demux/chunk-cache.ts"),d=I("./src/utils/mp4-tools.ts"),o=I("./src/utils/logger.ts"),a;try{a=self.performance.now.bind(self.performance)}catch(T){o.logger.debug("Unable to use Performance API on this environment"),a=self.Date.now}var u=[{demux:L.default,remux:b.default},{demux:D.default,remux:m.default},{demux:F.default,remux:b.default},{demux:A.default,remux:b.default}],s=1024;u.forEach(function(T){var _=T.demux;s=Math.max(s,_.minProbeByteLength)});var i=function(){function T(y,f,c,v,p){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 h.default,this.observer=y,this.typeSupported=f,this.config=c,this.vendor=v,this.id=p}var _=T.prototype;return _.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},_.push=function(f,c,v,p){var E=this,k=v.transmuxing;k.executeStart=a();var U=new Uint8Array(f),H=this.cache,W=this.config,j=this.currentTransmuxState,O=this.transmuxConfig;p&&(this.currentTransmuxState=p);var K=n(U,c);if(K&&K.method==="AES-128"){var Y=this.getDecrypter();if(W.enableSoftwareAES){var ee=Y.softwareDecrypt(U,K.key.buffer,K.iv.buffer);if(!ee)return k.executeEnd=a(),S(v);U=new Uint8Array(ee)}else return this.decryptionPromise=Y.webCryptoDecrypt(U,K.key.buffer,K.iv.buffer).then(function(tt){var Rt=E.push(tt,null,v);return E.decryptionPromise=null,Rt}),this.decryptionPromise}var se=p||j,Be=se.contiguous,me=se.discontinuity,xe=se.trackSwitch,Le=se.accurateTimeOffset,Ae=se.timeOffset,le=O.audioCodec,fe=O.videoCodec,Ve=O.defaultInitPts,Lt=O.duration,Pt=O.initSegmentData;if((me||xe)&&this.resetInitSegment(Pt,le,fe,Lt),me&&this.resetInitialTimestamp(Ve),Be||this.resetContiguity(),this.needsProbing(U,me,xe)){if(H.dataLength){var vt=H.flush();U=Object(d.appendUint8Array)(vt,U)}this.configureTransmuxer(U,O)}var Fe=this.transmux(U,K,Ae,Le,v),_t=this.currentTransmuxState;return _t.contiguous=!0,_t.discontinuity=!1,_t.trackSwitch=!1,k.executeEnd=a(),Fe},_.flush=function(f){var c=this,v=f.transmuxing;v.executeStart=a();var p=this.decrypter,E=this.cache,k=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return c.flush(f)});var H=[],W=k.timeOffset;if(p){var j=p.flush();j&&H.push(this.push(j,null,f))}var O=E.dataLength;E.reset();var K=this.demuxer,Y=this.remuxer;if(!K||!Y)return O>=s&&this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=a(),[S(f)];var ee=K.flush(W);return C(ee)?ee.then(function(se){return c.flushRemux(H,se,f),H}):(this.flushRemux(H,ee,f),H)},_.flushRemux=function(f,c,v){var p=c.audioTrack,E=c.avcTrack,k=c.id3Track,U=c.textTrack,H=this.currentTransmuxState,W=H.accurateTimeOffset,j=H.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var O=this.remuxer.remux(p,E,k,U,j,W,!0,this.id);f.push({remuxResult:O,chunkMeta:v}),v.transmuxing.executeEnd=a()},_.resetInitialTimestamp=function(f){var c=this.demuxer,v=this.remuxer;if(!c||!v)return;c.resetTimeStamp(f),v.resetTimeStamp(f)},_.resetContiguity=function(){var f=this.demuxer,c=this.remuxer;if(!f||!c)return;f.resetContiguity(),c.resetNextTimestamp()},_.resetInitSegment=function(f,c,v,p){var E=this.demuxer,k=this.remuxer;if(!E||!k)return;E.resetInitSegment(c,v,p),k.resetInitSegment(f,c,v)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(f,c,v,p,E){var k;return c&&c.method==="SAMPLE-AES"?k=this.transmuxSampleAes(f,c,v,p,E):k=this.transmuxUnencrypted(f,v,p,E),k},_.transmuxUnencrypted=function(f,c,v,p){var E=this.demuxer.demux(f,c,!1,!this.config.progressive),k=E.audioTrack,U=E.avcTrack,H=E.id3Track,W=E.textTrack,j=this.remuxer.remux(k,U,H,W,c,v,!1,this.id);return{remuxResult:j,chunkMeta:p}},_.transmuxSampleAes=function(f,c,v,p,E){var k=this;return this.demuxer.demuxSampleAes(f,c,v).then(function(U){var H=k.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,v,p,!1,k.id);return{remuxResult:H,chunkMeta:E}})},_.configureTransmuxer=function(f,c){for(var v=this.config,p=this.observer,E=this.typeSupported,k=this.vendor,U=c.audioCodec,H=c.defaultInitPts,W=c.duration,j=c.initSegmentData,O=c.videoCodec,K,Y=0,ee=u.length;Y<ee;Y++)if(u[Y].demux.probe(f)){K=u[Y];break}K||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:D.default,remux:m.default});var se=this.demuxer,Be=this.remuxer,me=K.remux,xe=K.demux;(!Be||!(Be instanceof me))&&(this.remuxer=new me(p,v,E,k)),(!se||!(se instanceof xe))&&(this.demuxer=new xe(p,v,E),this.probe=xe.probe),this.resetInitSegment(j,U,O,W),this.resetInitialTimestamp(H)},_.needsProbing=function(f,c,v){return!this.demuxer||!this.remuxer||c||v},_.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new P.default(this.observer,this.config)),f},T}();function n(T,_){var y=null;return T.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(y=_),y}var S=function(_){return{remuxResult:{},chunkMeta:_}};function C(T){return"then"in T&&T.then instanceof Function}var x=function(_,y,f,c,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=y,this.initSegmentData=f,this.duration=c,this.defaultInitPts=v},w=function(_,y,f,c,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=y,this.accurateTimeOffset=f,this.trackSwitch=c,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"discardEPB",function(){return S});var B=I("./src/demux/adts.ts"),R=I("./src/demux/mpegaudio.ts"),P=I("./src/demux/exp-golomb.ts"),F=I("./src/demux/id3.ts"),D=I("./src/demux/sample-aes.ts"),L=I("./src/events.ts"),A=I("./src/utils/mp4-tools.ts"),b=I("./src/utils/logger.ts"),m=I("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},d=function(){function C(w,T,_){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=w,this.config=T,this.typeSupported=_}C.probe=function(T){var _=C.syncOffset(T);return _<0?!1:(_&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},C.syncOffset=function(T){for(var _=Math.min(1e3,T.length-3*188),y=0;y<_;){if(T[y]===71&&T[y+188]===71&&T[y+2*188]===71)return y;y++}return-1},C.createTrack=function(T,_){return{container:T==="video"||T==="audio"?"video/mp2t":void 0,type:T,id:h[T],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:T==="audio"?_:void 0}};var x=C.prototype;return x.resetInitSegment=function(T,_,y){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=C.createTrack("video",y),this._audioTrack=C.createTrack("audio",y),this._id3Track=C.createTrack("id3",y),this._txtTrack=C.createTrack("text",y),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=T,this.videoCodec=_,this._duration=y},x.resetTimeStamp=function(){},x.resetContiguity=function(){var T=this._audioTrack,_=this._avcTrack,y=this._id3Track;T&&(T.pesData=null),_&&(_.pesData=null),y&&(y.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(T,_,y,f){y===void 0&&(y=!1),f===void 0&&(f=!1),y||(this.sampleAes=null);var c,v=this._avcTrack,p=this._audioTrack,E=this._id3Track,k=v.pid,U=v.pesData,H=p.pid,W=E.pid,j=p.pesData,O=E.pesData,K=!1,Y=this.pmtParsed,ee=this._pmtId,se=T.length;if(this.remainderData&&(T=Object(A.appendUint8Array)(this.remainderData,T),se=T.length,this.remainderData=null),se<188&&!f)return this.remainderData=T,{audioTrack:p,avcTrack:v,id3Track:E,textTrack:this._txtTrack};var Be=Math.max(0,C.syncOffset(T));se-=(se+Be)%188,se<T.byteLength&&!f&&(this.remainderData=new Uint8Array(T.buffer,se,T.buffer.byteLength-se));for(var me=Be;me<se;me+=188)if(T[me]===71){var xe=!!(T[me+1]&64),Le=((T[me+1]&31)<<8)+T[me+2],Ae=(T[me+3]&48)>>4,le=void 0;if(Ae>1){if(le=me+5+T[me+4],le===me+188)continue}else le=me+4;switch(Le){case k:xe&&(U&&(c=s(U))&&this.parseAVCPES(c,!1),U={data:[],size:0}),U&&(U.data.push(T.subarray(le,me+188)),U.size+=me+188-le);break;case H:xe&&(j&&(c=s(j))&&(p.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),j={data:[],size:0}),j&&(j.data.push(T.subarray(le,me+188)),j.size+=me+188-le);break;case W:xe&&(O&&(c=s(O))&&this.parseID3PES(c),O={data:[],size:0}),O&&(O.data.push(T.subarray(le,me+188)),O.size+=me+188-le);break;case 0:xe&&(le+=T[le]+1),ee=this._pmtId=a(T,le);break;case ee:{xe&&(le+=T[le]+1);var fe=u(T,le,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,y);k=fe.avc,k>0&&(v.pid=k),H=fe.audio,H>0&&(p.pid=H,p.isAAC=fe.isAAC),W=fe.id3,W>0&&(E.pid=W),K&&!Y&&(b.logger.log("reparse from beginning"),K=!1,me=Be-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=U,p.pesData=j,E.pesData=O;var Ve={audioTrack:p,avcTrack:v,id3Track:E,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(Ve),Ve},x.flush=function(){var T=this.remainderData;this.remainderData=null;var _;return T?_=this.demux(T,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},x.extractRemainingSamples=function(T){var _=T.audioTrack,y=T.avcTrack,f=T.id3Track,c=y.pesData,v=_.pesData,p=f.pesData,E;c&&(E=s(c))?(this.parseAVCPES(E,!0),y.pesData=null):y.pesData=c,v&&(E=s(v))?(_.isAAC?this.parseAACPES(E):this.parseMPEGPES(E),_.pesData=null):(v!=null&&v.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=v),p&&(E=s(p))?(this.parseID3PES(E),f.pesData=null):f.pesData=p},x.demuxSampleAes=function(T,_,y){var f=this.demux(T,y,!0,!this.config.progressive),c=this.sampleAes=new D.default(this.observer,this.config,_);return this.decrypt(f,c)},x.decrypt=function(T,_){return new Promise(function(y){var f=T.audioTrack,c=T.avcTrack;f.samples&&f.isAAC?_.decryptAacSamples(f.samples,0,function(){c.samples?_.decryptAvcSamples(c.samples,0,0,function(){y(T)}):y(T)}):c.samples&&_.decryptAvcSamples(c.samples,0,0,function(){y(T)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(T,_){var y=this,f=this._avcTrack,c=this.parseAVCNALu(T.data),v=!1,p=this.avcSample,E,k=!1;T.data=null,p&&c.length&&!f.audFound&&(i(p,f),p=this.avcSample=o(!1,T.pts,T.dts,"")),c.forEach(function(U){switch(U.type){case 1:{E=!0,p||(p=y.avcSample=o(!0,T.pts,T.dts,"")),v&&(p.debug+="NDR "),p.frame=!0;var H=U.data;if(k&&H.length>4){var W=new P.default(H).readSliceType();(W===2||W===4||W===7||W===9)&&(p.key=!0)}break}case 5:E=!0,p||(p=y.avcSample=o(!0,T.pts,T.dts,"")),v&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{E=!0,v&&p&&(p.debug+="SEI ");var j=new P.default(S(U.data));j.readUByte();for(var O=0,K=0,Y=!1,ee=0;!Y&&j.bytesAvailable>1;){O=0;do ee=j.readUByte(),O+=ee;while(ee===255);K=0;do ee=j.readUByte(),K+=ee;while(ee===255);if(O===4&&j.bytesAvailable!==0){Y=!0;var se=j.readUByte();if(se===181){var Be=j.readUShort();if(Be===49){var me=j.readUInt();if(me===1195456820){var xe=j.readUByte();if(xe===3){for(var Le=j.readUByte(),Ae=j.readUByte(),le=31&Le,fe=[Le,Ae],Ve=0;Ve<le;Ve++)fe.push(j.readUByte()),fe.push(j.readUByte()),fe.push(j.readUByte());n(y._txtTrack.samples,{type:3,pts:T.pts,bytes:fe})}}}}}else if(O===5&&j.bytesAvailable!==0){if(Y=!0,K>16){for(var Lt=[],Pt=0;Pt<16;Pt++)Lt.push(j.readUByte().toString(16)),(Pt===3||Pt===5||Pt===7||Pt===9)&&Lt.push("-");for(var vt=K-16,Fe=new Uint8Array(vt),_t=0;_t<vt;_t++)Fe[_t]=j.readUByte();n(y._txtTrack.samples,{pts:T.pts,payloadType:O,uuid:Lt.join(""),userData:Object(F.utf8ArrayToStr)(Fe),userDataBytes:Fe})}}else if(K<j.bytesAvailable)for(var tt=0;tt<K;tt++)j.readUByte()}break}case 7:if(E=!0,k=!0,v&&p&&(p.debug+="SPS "),!f.sps){var Rt=new P.default(U.data),Ge=Rt.readSPS();f.width=Ge.width,f.height=Ge.height,f.pixelRatio=Ge.pixelRatio,f.sps=[U.data],f.duration=y._duration;for(var Ft=U.data.subarray(1,4),wt="avc1.",yt=0;yt<3;yt++){var bn=Ft[yt].toString(16);bn.length<2&&(bn="0"+bn),wt+=bn}f.codec=wt}break;case 8:E=!0,v&&p&&(p.debug+="PPS "),f.pps||(f.pps=[U.data]);break;case 9:E=!1,f.audFound=!0,p&&i(p,f),p=y.avcSample=o(!1,T.pts,T.dts,v?"AUD ":"");break;case 12:E=!1;break;default:E=!1,p&&(p.debug+="unknown NAL "+U.type+" ");break}if(p&&E){var un=p.units;un.push(U)}}),_&&p&&(i(p,f),this.avcSample=null)},x.getLastNalUnit=function(){var T,_=this.avcSample,y;if(!_||_.units.length===0){var f=this._avcTrack.samples;_=f[f.length-1]}if((T=_)!==null&&T!==void 0&&T.units){var c=_.units;y=c[c.length-1]}return y},x.parseAVCNALu=function(T){var _=T.byteLength,y=this._avcTrack,f=y.naluState||0,c=f,v=[],p=0,E,k,U,H=-1,W=0;for(f===-1&&(H=0,W=T[0]&31,f=0,p=1);p<_;){if(E=T[p++],!f){f=E?0:1;continue}if(f===1){f=E?0:2;continue}if(!E)f=3;else if(E===1){if(H>=0){var j={data:T.subarray(H,p-f-1),type:W};v.push(j)}else{var O=this.getLastNalUnit();if(O&&(c&&p<=4-c&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-c))),k=p-f-1,k>0)){var K=new Uint8Array(O.data.byteLength+k);K.set(O.data,0),K.set(T.subarray(0,k),O.data.byteLength),O.data=K,O.state=0}}p<_?(U=T[p]&31,H=p,W=U,f=0):f=-1}else f=0}if(H>=0&&f>=0){var Y={data:T.subarray(H,_),type:W,state:f};v.push(Y)}if(v.length===0){var ee=this.getLastNalUnit();if(ee){var se=new Uint8Array(ee.data.byteLength+T.byteLength);se.set(ee.data,0),se.set(T,ee.data.byteLength),ee.data=se}}return y.naluState=f,v},x.parseAACPES=function(T){var _=0,y=this._audioTrack,f=this.aacOverFlow,c=T.data;if(f){this.aacOverFlow=null;var v=f.sample.unit.byteLength,p=Math.min(f.missing,v),E=v-p;f.sample.unit.set(c.subarray(0,p),E),y.samples.push(f.sample),_=f.missing}var k,U;for(k=_,U=c.length;k<U-1&&!B.isHeader(c,k);k++);if(k!==_){var H,W;if(k<U-1?(H="AAC PES did not start with ADTS header,offset:"+k,W=!1):(H="no ADTS header found in AAC PES",W=!0),b.logger.warn("parsing error:"+H),this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:W,reason:H}),W)return}B.initTrackConfig(y,this.observer,c,k,this.audioCodec);var j;if(T.pts!==void 0)j=T.pts;else if(f){var O=B.getFrameDuration(y.samplerate);j=f.sample.pts+O}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;k<U;)if(B.isHeader(c,k)){if(k+5<U){var Y=B.appendFrame(y,c,k,j,K);if(Y)if(Y.missing)this.aacOverFlow=Y;else{k+=Y.length,K++;continue}}break}else k++},x.parseMPEGPES=function(T){var _=T.data,y=_.length,f=0,c=0,v=T.pts;if(v===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<y;)if(R.isHeader(_,c)){var p=R.appendFrame(this._audioTrack,_,c,v,f);if(p)c+=p.length,f++;else break}else c++},x.parseID3PES=function(T){if(T.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(T)},C}();d.minProbeByteLength=188;function o(C,x,w,T){return{key:C,frame:!1,pts:x,dts:w,units:[],debug:T,length:0}}function a(C,x){return(C[x+10]&31)<<8|C[x+11]}function u(C,x,w,T){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},y=(C[x+1]&15)<<8|C[x+2],f=x+3+y-4,c=(C[x+10]&15)<<8|C[x+11];for(x+=12+c;x<f;){var v=(C[x+1]&31)<<8|C[x+2];switch(C[x]){case 207:if(!T){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=v);break;case 21:_.id3===-1&&(_.id3=v);break;case 219:if(!T){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=v);break;case 3:case 4:w?_.audio===-1&&(_.audio=v,_.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((C[x+3]&15)<<8|C[x+4])+5}return _}function s(C){var x=0,w,T,_,y,f,c=C.data;if(!C||C.size===0)return null;for(;c[0].length<19&&c.length>1;){var v=new Uint8Array(c[0].length+c[1].length);v.set(c[0]),v.set(c[1],c[0].length),c[0]=v,c.splice(1,1)}w=c[0];var p=(w[0]<<16)+(w[1]<<8)+w[2];if(p===1){if(T=(w[4]<<8)+w[5],T&&T>C.size-6)return null;var E=w[7];E&192&&(y=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,E&64?(f=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,y-f>60*9e4&&(b.logger.warn(Math.round((y-f)/9e4)+"s delta between PTS and DTS, align them"),y=f)):f=y),_=w[8];var k=_+9;if(C.size<=k)return null;C.size-=k;for(var U=new Uint8Array(C.size),H=0,W=c.length;H<W;H++){w=c[H];var j=w.byteLength;if(k)if(k>j){k-=j;continue}else w=w.subarray(k),j-=k,k=0;U.set(w,x),x+=j}return T&&(T-=_+3),{data:U,pts:y,dts:f,len:T}}return null}function i(C,x){if(C.units.length&&C.frame){if(C.pts===void 0){var w=x.samples,T=w.length;if(T){var _=w[T-1];C.pts=_.pts,C.dts=_.dts}else{x.dropped++;return}}x.samples.push(C)}C.debug.length&&b.logger.log(C.pts+"/"+C.dts+":"+C.debug)}function n(C,x){var w=C.length;if(w>0){if(x.pts>=C[w-1].pts)C.push(x);else for(var T=w-1;T>=0;T--)if(x.pts<C[T].pts){C.splice(T,0,x);break}}else C.push(x)}function S(C){for(var x=C.byteLength,w=[],T=1;T<x-2;)C[T]===0&&C[T+1]===0&&C[T+2]===3?(w.push(T+2),T+=2):T++;if(w.length===0)return C;var _=x-w.length,y=new Uint8Array(_),f=0;for(T=0;T<_;f++,T++)f===w[0]&&(f++,w.shift()),y[T]=C[f];return y}z.default=d},"./src/errors.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"ErrorTypes",function(){return B}),I.d(z,"ErrorDetails",function(){return R});var B;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})(B||(B={}));var R;(function(P){P.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",P.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",P.KEY_SYSTEM_NO_SESSION="keySystemNoSession",P.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",P.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",P.MANIFEST_LOAD_ERROR="manifestLoadError",P.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",P.MANIFEST_PARSING_ERROR="manifestParsingError",P.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",P.LEVEL_EMPTY_ERROR="levelEmptyError",P.LEVEL_LOAD_ERROR="levelLoadError",P.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",P.LEVEL_SWITCH_ERROR="levelSwitchError",P.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",P.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",P.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",P.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",P.FRAG_LOAD_ERROR="fragLoadError",P.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",P.FRAG_DECRYPT_ERROR="fragDecryptError",P.FRAG_PARSING_ERROR="fragParsingError",P.REMUX_ALLOC_ERROR="remuxAllocError",P.KEY_LOAD_ERROR="keyLoadError",P.KEY_LOAD_TIMEOUT="keyLoadTimeOut",P.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",P.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",P.BUFFER_APPEND_ERROR="bufferAppendError",P.BUFFER_APPENDING_ERROR="bufferAppendingError",P.BUFFER_STALLED_ERROR="bufferStalledError",P.BUFFER_FULL_ERROR="bufferFullError",P.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",P.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",P.INTERNAL_EXCEPTION="internalException",P.INTERNAL_ABORTED="aborted",P.UNKNOWN="unknown"})(R||(R={}))},"./src/events.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"Events",function(){return B});var B;(function(R){R.MEDIA_ATTACHING="hlsMediaAttaching",R.MEDIA_ATTACHED="hlsMediaAttached",R.MEDIA_DETACHING="hlsMediaDetaching",R.MEDIA_DETACHED="hlsMediaDetached",R.BUFFER_RESET="hlsBufferReset",R.BUFFER_CODECS="hlsBufferCodecs",R.BUFFER_CREATED="hlsBufferCreated",R.BUFFER_APPENDING="hlsBufferAppending",R.BUFFER_APPENDED="hlsBufferAppended",R.BUFFER_EOS="hlsBufferEos",R.BUFFER_FLUSHING="hlsBufferFlushing",R.BUFFER_FLUSHED="hlsBufferFlushed",R.MANIFEST_LOADING="hlsManifestLoading",R.MANIFEST_LOADED="hlsManifestLoaded",R.MANIFEST_PARSED="hlsManifestParsed",R.LEVEL_SWITCHING="hlsLevelSwitching",R.LEVEL_SWITCHED="hlsLevelSwitched",R.LEVEL_LOADING="hlsLevelLoading",R.LEVEL_LOADED="hlsLevelLoaded",R.LEVEL_UPDATED="hlsLevelUpdated",R.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",R.LEVELS_UPDATED="hlsLevelsUpdated",R.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",R.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",R.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",R.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",R.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",R.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",R.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",R.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",R.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",R.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",R.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",R.CUES_PARSED="hlsCuesParsed",R.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",R.INIT_PTS_FOUND="hlsInitPtsFound",R.FRAG_LOADING="hlsFragLoading",R.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",R.FRAG_LOADED="hlsFragLoaded",R.FRAG_DECRYPTED="hlsFragDecrypted",R.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",R.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",R.FRAG_PARSING_METADATA="hlsFragParsingMetadata",R.FRAG_PARSED="hlsFragParsed",R.FRAG_BUFFERED="hlsFragBuffered",R.FRAG_CHANGED="hlsFragChanged",R.FPS_DROP="hlsFpsDrop",R.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",R.ERROR="hlsError",R.DESTROYING="hlsDestroying",R.KEY_LOADING="hlsKeyLoading",R.KEY_LOADED="hlsKeyLoaded",R.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",R.BACK_BUFFER_REACHED="hlsBackBufferReached"})(B||(B={}))},"./src/hls.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return C});var B=I("./node_modules/url-toolkit/src/url-toolkit.js"),R=I.n(B),P=I("./src/loader/playlist-loader.ts"),F=I("./src/loader/key-loader.ts"),D=I("./src/controller/id3-track-controller.ts"),L=I("./src/controller/latency-controller.ts"),A=I("./src/controller/level-controller.ts"),b=I("./src/controller/fragment-tracker.ts"),m=I("./src/controller/stream-controller.ts"),h=I("./src/is-supported.ts"),d=I("./src/utils/logger.ts"),o=I("./src/config.ts"),a=I("./node_modules/eventemitter3/index.js"),u=I.n(a),s=I("./src/events.ts"),i=I("./src/errors.ts");function n(x,w){for(var T=0;T<w.length;T++){var _=w[T];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function S(x,w,T){return w&&n(x.prototype,w),T&&n(x,T),x}var C=function(){x.isSupported=function(){return Object(h.isSupported)()};function x(T){T===void 0&&(T={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new a.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 _=this.config=Object(o.mergeConfig)(x.DefaultConfig,T);this.userConfig=T,Object(d.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(o.enableStreamingMode)(_);var y=_.abrController,f=_.bufferController,c=_.capLevelController,v=_.fpsController,p=this.abrController=new y(this),E=this.bufferController=new f(this),k=this.capLevelController=new c(this),U=new v(this),H=new P.default(this),W=new F.default(this),j=new D.default(this),O=this.levelController=new A.default(this),K=new b.FragmentTracker(this),Y=this.streamController=new m.default(this,K);k.setStreamController(Y),U.setStreamController(Y);var ee=[O,Y];this.networkControllers=ee;var se=[H,W,p,E,k,U,j,K];this.audioTrackController=this.createController(_.audioTrackController,null,ee),this.createController(_.audioStreamController,K,ee),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,ee),this.createController(_.subtitleStreamController,K,ee),this.createController(_.timelineController,null,se),this.emeController=this.createController(_.emeController,null,se),this.cmcdController=this.createController(_.cmcdController,null,se),this.latencyController=this.createController(L.default,null,se),this.coreComponents=se}var w=x.prototype;return w.createController=function(_,y,f){if(_){var c=y?new _(this,y):new _(this);return f&&f.push(c),c}return null},w.on=function(_,y,f){f===void 0&&(f=this),this._emitter.on(_,y,f)},w.once=function(_,y,f){f===void 0&&(f=this),this._emitter.once(_,y,f)},w.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},w.off=function(_,y,f,c){f===void 0&&(f=this),this._emitter.off(_,y,f,c)},w.listeners=function(_){return this._emitter.listeners(_)},w.emit=function(_,y,f){return this._emitter.emit(_,y,f)},w.trigger=function(_,y){if(this.config.debug)return this.emit(_,_,y);try{return this.emit(_,_,y)}catch(f){d.logger.error("An internal error happened while handling event "+_+'. 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:_,error:f})}return!1},w.listenerCount=function(_){return this._emitter.listenerCount(_)},w.destroy=function(){d.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},w.attachMedia=function(_){d.logger.log("attachMedia"),this._media=_,this.trigger(s.Events.MEDIA_ATTACHING,{media:_})},w.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(_){this.stopLoad();var y=this.media,f=this.url,c=this.url=B.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});d.logger.log("loadSource:"+c),y&&f&&f!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(y)),this.trigger(s.Events.MANIFEST_LOADING,{url:_})},w.startLoad=function(_){_===void 0&&(_=-1),d.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(y){y.startLoad(_)})},w.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},w.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){d.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},w.removeLevel=function(_,y){y===void 0&&(y=0),this.levelController.removeLevel(_,y)},S(x,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){d.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){d.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){d.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){d.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){d.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var y=!!_;y!==this.config.capLevelToPlayerSize&&(y?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=y)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(d.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,y=this.config.minAutoBitrate;if(!_)return 0;for(var f=_.length,c=0;c<f;c++)if(_[c].maxBitrate>y)return c;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,y=this.autoLevelCapping,f;return y===-1&&_&&_.length?f=_.length-1:f=y,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var y=this.audioTrackController;y&&(y.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var y=this.subtitleTrackController;y&&(y.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var y=this.subtitleTrackController;y&&(y.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{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 x.defaultConfig?x.defaultConfig:o.hlsDefaultConfig},set:function(_){x.defaultConfig=_}}]),x}();C.defaultConfig=void 0},"./src/is-supported.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"isSupported",function(){return P}),I.d(z,"changeTypeSupported",function(){return F});var B=I("./src/utils/mediasource-helper.ts");function R(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var D=Object(B.getMediaSource)();if(!D)return!1;var L=R(),A=D&&typeof D.isTypeSupported=="function"&&D.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!L||L.prototype&&typeof L.prototype.appendBuffer=="function"&&typeof L.prototype.remove=="function";return!!A&&!!b}function F(){var D,L=R();return typeof(L==null||((D=L.prototype)===null||D===void 0)?void 0:D.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return d}),I.d(z,"LoadError",function(){return a});var B=I("./src/polyfills/number.ts"),R=I("./src/errors.ts");function P(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,b(u,s)}function F(u){var s=typeof Map=="function"?new Map:void 0;return F=function(n){if(n===null||!A(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,S)}function S(){return D(n,arguments,m(this).constructor)}return S.prototype=Object.create(n.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b(S,n)},F(u)}function D(u,s,i){return L()?D=Reflect.construct:D=function(S,C,x){var w=[null];w.push.apply(w,C);var T=Function.bind.apply(S,w),_=new T;return x&&b(_,x.prototype),_},D.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function A(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function b(u,s){return b=Object.setPrototypeOf||function(n,S){return n.__proto__=S,n},b(u,s)}function m(u){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},m(u)}var h=Math.pow(2,17),d=function(){function u(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var s=u.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,S){var C=this,x=n.url;if(!x)return Promise.reject(new a({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var w=this.config,T=w.fLoader,_=w.loader;return new Promise(function(y,f){C.loader&&C.loader.destroy();var c=C.loader=n.loader=T?new T(w):new _(w),v=o(n),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:h};n.stats=c.stats,c.load(v,p,{onSuccess:function(k,U,H,W){C.resetLoader(n,c),y({frag:n,part:null,payload:k.data,networkDetails:W})},onError:function(k,U,H){C.resetLoader(n,c),f(new a({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:k,networkDetails:H}))},onAbort:function(k,U,H){C.resetLoader(n,c),f(new a({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:H}))},onTimeout:function(k,U,H){C.resetLoader(n,c),f(new a({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:H}))},onProgress:function(k,U,H,W){S&&S({frag:n,part:null,payload:H,networkDetails:W})}})})},s.loadPart=function(n,S,C){var x=this;this.abort();var w=this.config,T=w.fLoader,_=w.loader;return new Promise(function(y,f){x.loader&&x.loader.destroy();var c=x.loader=n.loader=T?new T(w):new _(w),v=o(n,S),p={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:h};S.stats=c.stats,c.load(v,p,{onSuccess:function(k,U,H,W){x.resetLoader(n,c),x.updateStatsFromPart(n,S);var j={frag:n,part:S,payload:k.data,networkDetails:W};C(j),y(j)},onError:function(k,U,H){x.resetLoader(n,c),f(new a({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:S,response:k,networkDetails:H}))},onAbort:function(k,U,H){n.stats.aborted=S.stats.aborted,x.resetLoader(n,c),f(new a({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:S,networkDetails:H}))},onTimeout:function(k,U,H){x.resetLoader(n,c),f(new a({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:S,networkDetails:H}))}})})},s.updateStatsFromPart=function(n,S){var C=n.stats,x=S.stats,w=x.total;if(C.loaded+=x.loaded,w){var T=Math.round(n.duration/S.duration),_=Math.min(Math.round(C.loaded/w),T),y=T-_,f=y*Math.round(C.loaded/_);C.total=C.loaded+f}else C.total=Math.max(C.loaded,C.total);var c=C.loading,v=x.loading;c.start?c.first+=v.first-v.start:(c.start=v.start,c.first=v.first),c.end=v.end},s.resetLoader=function(n,S){n.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},u}();function o(u,s){s===void 0&&(s=null);var i=s||u,n={frag:u,part:s,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},S=i.byteRangeStartOffset,C=i.byteRangeEndOffset;return Object(B.isFiniteNumber)(S)&&Object(B.isFiniteNumber)(C)&&(n.rangeStart=S,n.rangeEnd=C),n}var a=function(u){P(s,u);function s(i){for(var n,S=arguments.length,C=new Array(S>1?S-1:0),x=1;x<S;x++)C[x-1]=arguments[x];return n=u.call.apply(u,[this].concat(C))||this,n.data=void 0,n.data=i,n}return s}(F(Error))},"./src/loader/fragment.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"ElementaryStreamTypes",function(){return d}),I.d(z,"BaseSegment",function(){return o}),I.d(z,"Fragment",function(){return a}),I.d(z,"Part",function(){return u});var B=I("./src/polyfills/number.ts"),R=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(R),F=I("./src/utils/logger.ts"),D=I("./src/loader/level-key.ts"),L=I("./src/loader/load-stats.ts");function A(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,b(s,i)}function b(s,i){return b=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},b(s,i)}function m(s,i){for(var n=0;n<i.length;n++){var S=i[n];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(s,S.key,S)}}function h(s,i,n){return i&&m(s.prototype,i),n&&m(s,n),s}var d;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(d||(d={}));var o=function(){function s(n){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[d.AUDIO]=null,S[d.VIDEO]=null,S[d.AUDIOVIDEO]=null,S),this.baseurl=n}var i=s.prototype;return i.setByteRange=function(S,C){var x=S.split("@",2),w=[];x.length===1?w[0]=C?C.byteRangeEndOffset:0:w[0]=parseInt(x[1]),w[1]=parseInt(x[0])+w[0],this._byteRange=w},h(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(R.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),s}(),a=function(s){A(i,s);function i(S,C){var x;return x=s.call(this,C)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new L.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=S,x}var n=i.prototype;return n.createInitializationVector=function(C){for(var x=new Uint8Array(16),w=12;w<16;w++)x[w]=C>>8*(15-w)&255;return x},n.setDecryptDataFromLevelKey=function(C,x){var w=C;return(C==null?void 0:C.method)==="AES-128"&&C.uri&&!C.iv&&(w=D.LevelKey.fromURI(C.uri),w.method=C.method,w.iv=this.createInitializationVector(x),w.keyFormat="identity"),w},n.setElementaryStreamInfo=function(C,x,w,T,_,y){y===void 0&&(y=!1);var f=this.elementaryStreams,c=f[C];if(!c){f[C]={startPTS:x,endPTS:w,startDTS:T,endDTS:_,partial:y};return}c.startPTS=Math.min(c.startPTS,x),c.endPTS=Math.max(c.endPTS,w),c.startDTS=Math.min(c.startDTS,T),c.endDTS=Math.max(c.endDTS,_)},n.clearElementaryStreamInfo=function(){var C=this.elementaryStreams;C[d.AUDIO]=null,C[d.VIDEO]=null,C[d.AUDIOVIDEO]=null},h(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var C=this.sn;typeof C!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&F.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),C=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,C)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(B.isFiniteNumber)(this.programDateTime))return null;var C=Object(B.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+C*1e3}},{key:"encrypted",get:function(){var C;return!!((C=this.decryptdata)!==null&&C!==void 0&&C.keyFormat&&this.decryptdata.uri)}}]),i}(o),u=function(s){A(i,s);function i(n,S,C,x,w){var T;T=s.call(this,C)||this,T.fragOffset=0,T.duration=0,T.gap=!1,T.independent=!1,T.relurl=void 0,T.fragment=void 0,T.index=void 0,T.stats=new L.LoadStats,T.duration=n.decimalFloatingPoint("DURATION"),T.gap=n.bool("GAP"),T.independent=n.bool("INDEPENDENT"),T.relurl=n.enumeratedString("URI"),T.fragment=S,T.index=x;var _=n.enumeratedString("BYTERANGE");return _&&T.setByteRange(_,w),w&&(T.fragOffset=w.fragOffset+w.duration),T}return h(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 S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),i}(o)},"./src/loader/key-loader.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return F});var B=I("./src/events.ts"),R=I("./src/errors.ts"),P=I("./src/utils/logger.ts"),F=function(){function D(A){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=A,this._registerListeners()}var L=D.prototype;return L._registerListeners=function(){this.hls.on(B.Events.KEY_LOADING,this.onKeyLoading,this)},L._unregisterListeners=function(){this.hls.off(B.Events.KEY_LOADING,this.onKeyLoading)},L.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var m=this.loaders[b];m&&m.destroy()}this.loaders={}},L.onKeyLoading=function(b,m){var h=m.frag,d=h.type,o=this.loaders[d];if(!h.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var a=h.decryptdata.uri;if(a!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(o&&(P.logger.warn("abort previous key loader for type:"+d),o.abort()),!a){P.logger.warn("key uri is falsy");return}var s=u.loader,i=h.loader=this.loaders[d]=new s(u);this.decrypturl=a,this.decryptkey=null;var n={url:a,frag:h,responseType:"arraybuffer"},S={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},C={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(n,S,C)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(B.Events.KEY_LOADED,{frag:h}))},L.loadsuccess=function(b,m,h){var d=h.frag;if(!d.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(b.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(B.Events.KEY_LOADED,{frag:d})},L.loaderror=function(b,m){var h=m.frag,d=h.loader;d&&d.abort(),delete this.loaders[h.type],this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:b})},L.loadtimeout=function(b,m){var h=m.frag,d=h.loader;d&&d.abort(),delete this.loaders[h.type],this.hls.trigger(B.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},D}()},"./src/loader/level-details.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"LevelDetails",function(){return D});var B=I("./src/polyfills/number.ts");function R(L,A){for(var b=0;b<A.length;b++){var m=A[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(L,m.key,m)}}function P(L,A,b){return A&&R(L.prototype,A),b&&R(L,b),L}var F=10,D=function(){function L(b){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=b}var A=L.prototype;return A.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-m.lastPartSn,d=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!d||!!h,this.advanced=this.endSN>m.endSN||h>0||h===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},P(L,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(B.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||F}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var h=this.driftEnd-this.driftStart;return h*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),L}()},"./src/loader/level-key.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"LevelKey",function(){return D});var B=I("./node_modules/url-toolkit/src/url-toolkit.js"),R=I.n(B);function P(L,A){for(var b=0;b<A.length;b++){var m=A[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(L,m.key,m)}}function F(L,A,b){return A&&P(L.prototype,A),b&&P(L,b),L}var D=function(){L.fromURL=function(b,m){return new L(b,m)},L.fromURI=function(b){return new L(b)};function L(A,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(B.buildAbsoluteURL)(A,b,{alwaysNormalize:!0}):this._uri=A}return F(L,[{key:"uri",get:function(){return this._uri}}]),L}()},"./src/loader/load-stats.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"LoadStats",function(){return B});var B=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,z,I){"use strict";I.r(z),I.d(z,"default",function(){return i});var B=I("./src/polyfills/number.ts"),R=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(R),F=I("./src/loader/fragment.ts"),D=I("./src/loader/level-details.ts"),L=I("./src/loader/level-key.ts"),A=I("./src/utils/attr-list.ts"),b=I("./src/utils/logger.ts"),m=I("./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,d=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),a=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("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function s(w){var T,_;return u.test((T=(_=R.parseURL(w))===null||_===void 0?void 0:_.path)!=null?T:"")}var i=function(){function w(){}return w.findGroup=function(_,y){for(var f=0;f<_.length;f++){var c=_[f];if(c.id===y)return c}},w.convertAVC1ToAVCOTI=function(_){var y=_.split(".");if(y.length>2){var f=y.shift()+".";return f+=parseInt(y.shift()).toString(16),f+=("000"+parseInt(y.shift()).toString(16)).substr(-4),f}return _},w.resolve=function(_,y){return R.buildAbsoluteURL(y,_,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(_,y){var f=[],c={},v=!1;h.lastIndex=0;for(var p;(p=h.exec(_))!=null;)if(p[1]){var E=new A.AttrList(p[1]),k={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:w.resolve(p[2],y)},U=E.decimalResolution("RESOLUTION");U&&(k.width=U.width,k.height=U.height),n((E.CODECS||"").split(/[ ,]+/).filter(function(W){return W}),k),k.videoCodec&&k.videoCodec.indexOf("avc1")!==-1&&(k.videoCodec=w.convertAVC1ToAVCOTI(k.videoCodec)),f.push(k)}else if(p[3]){var H=new A.AttrList(p[3]);H["DATA-ID"]&&(v=!0,c[H["DATA-ID"]]=H)}return{levels:f,sessionData:v?c:null}},w.parseMasterPlaylistMedia=function(_,y,f,c){c===void 0&&(c=[]);var v,p=[],E=0;for(d.lastIndex=0;(v=d.exec(_))!==null;){var k=new A.AttrList(v[1]);if(k.TYPE===f){var U={attrs:k,bitrate:0,id:E++,groupId:k["GROUP-ID"],instreamId:k["INSTREAM-ID"],name:k.NAME||k.LANGUAGE||"",type:f,default:k.bool("DEFAULT"),autoselect:k.bool("AUTOSELECT"),forced:k.bool("FORCED"),lang:k.LANGUAGE,url:k.URI?w.resolve(k.URI,y):""};if(c.length){var H=w.findGroup(c,U.groupId)||c[0];S(U,H,"audioCodec"),S(U,H,"textCodec")}p.push(U)}}return p},w.parseLevelPlaylist=function(_,y,f,c,v){var p=new D.LevelDetails(y),E=p.fragments,k=null,U=0,H=0,W=0,j=0,O=null,K=new F.Fragment(c,y),Y,ee,se,Be=-1,me=!1;for(o.lastIndex=0,p.m3u8=_;(Y=o.exec(_))!==null;){me&&(me=!1,K=new F.Fragment(c,y),K.start=W,K.sn=U,K.cc=j,K.level=f,k&&(K.initSegment=k,K.rawProgramDateTime=k.rawProgramDateTime));var xe=Y[1];if(xe){K.duration=parseFloat(xe);var Le=(" "+Y[2]).slice(1);K.title=Le||null,K.tagList.push(Le?["INF",xe,Le]:["INF",xe])}else if(Y[3])Object(B.isFiniteNumber)(K.duration)&&(K.start=W,se&&(K.levelkey=se),K.sn=U,K.level=f,K.cc=j,K.urlId=v,E.push(K),K.relurl=(" "+Y[3]).slice(1),x(K,O),O=K,W+=K.duration,U++,H=0,me=!0);else if(Y[4]){var Ae=(" "+Y[4]).slice(1);O?K.setByteRange(Ae,O):K.setByteRange(Ae)}else if(Y[5])K.rawProgramDateTime=(" "+Y[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),Be===-1&&(Be=E.length);else{if(Y=Y[0].match(a),!Y){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(ee=1;ee<Y.length&&!(typeof Y[ee]!="undefined");ee++);var le=(" "+Y[ee]).slice(1),fe=(" "+Y[ee+1]).slice(1),Ve=Y[ee+2]?(" "+Y[ee+2]).slice(1):"";switch(le){case"PLAYLIST-TYPE":p.type=fe.toUpperCase();break;case"MEDIA-SEQUENCE":U=p.startSN=parseInt(fe);break;case"SKIP":{var Lt=new A.AttrList(fe),Pt=Lt.decimalInteger("SKIPPED-SEGMENTS");if(Object(B.isFiniteNumber)(Pt)){p.skippedSegments=Pt;for(var vt=Pt;vt--;)E.unshift(null);U+=Pt}var Fe=Lt.enumeratedString("RECENTLY-REMOVED-DATERANGES");Fe&&(p.recentlyRemovedDateranges=Fe.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(fe);break;case"VERSION":p.version=parseInt(fe);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(fe||Ve)&&K.tagList.push(Ve?[fe,Ve]:[fe]);break;case"DIS":j++;case"GAP":K.tagList.push([le]);break;case"BITRATE":K.tagList.push([le,fe]);break;case"DISCONTINUITY-SEQ":j=parseInt(fe);break;case"KEY":{var _t,tt=new A.AttrList(fe),Rt=tt.enumeratedString("METHOD"),Ge=tt.URI,Ft=tt.hexadecimalInteger("IV"),wt=tt.enumeratedString("KEYFORMATVERSIONS"),yt=tt.enumeratedString("KEYID"),bn=(_t=tt.enumeratedString("KEYFORMAT"))!=null?_t:"identity",un=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(un.indexOf(bn)>-1){b.logger.warn("Keyformat "+bn+" is not supported from the manifest");continue}else if(bn!=="identity")continue;Rt&&(se=L.LevelKey.fromURL(y,Ge),Ge&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Rt)>=0&&(se.method=Rt,se.keyFormat=bn,yt&&(se.keyID=yt),wt&&(se.keyFormatVersions=wt),se.iv=Ft));break}case"START":{var sn=new A.AttrList(fe),Ye=sn.decimalFloatingPoint("TIME-OFFSET");Object(B.isFiniteNumber)(Ye)&&(p.startTimeOffset=Ye);break}case"MAP":{var nn=new A.AttrList(fe);K.relurl=nn.URI,nn.BYTERANGE&&K.setByteRange(nn.BYTERANGE),K.level=f,K.sn="initSegment",se&&(K.levelkey=se),K.initSegment=null,k=K,me=!0;break}case"SERVER-CONTROL":{var An=new A.AttrList(fe);p.canBlockReload=An.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=An.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&An.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=An.optionalFloat("PART-HOLD-BACK",0),p.holdBack=An.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ke=new A.AttrList(fe);p.partTarget=ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Pe=p.partList;Pe||(Pe=p.partList=[]);var rt=H>0?Pe[Pe.length-1]:void 0,ht=H++,Ue=new F.Part(new A.AttrList(fe),K,y,ht,rt);Pe.push(Ue),K.duration+=Ue.duration;break}case"PRELOAD-HINT":{var ut=new A.AttrList(fe);p.preloadHint=ut;break}case"RENDITION-REPORT":{var Ee=new A.AttrList(fe);p.renditionReports=p.renditionReports||[],p.renditionReports.push(Ee);break}default:b.logger.warn("line parsed but not handled: "+Y);break}}}O&&!O.relurl?(E.pop(),W-=O.duration,p.partList&&(p.fragmentHint=O)):p.partList&&(x(K,O),K.cc=j,p.fragmentHint=K);var ce=E.length,he=E[0],J=E[ce-1];if(W+=p.skippedSegments*p.targetduration,W>0&&ce&&J){p.averagetargetduration=W/ce;var Z=J.sn;p.endSN=Z!=="initSegment"?Z:0,he&&(p.startCC=he.cc,he.initSegment||p.fragments.every(function(re){return re.relurl&&s(re.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new F.Fragment(c,y),K.relurl=J.relurl,K.level=f,K.sn="initSegment",he.initSegment=K,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(W+=p.fragmentHint.duration),p.totalduration=W,p.endCC=j,Be>0&&C(E,Be),p},w}();function n(w,T){["video","audio","text"].forEach(function(_){var y=w.filter(function(c){return Object(m.isCodecType)(c,_)});if(y.length){var f=y.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});T[_+"Codec"]=f.length>0?f[0]:y[0],w=w.filter(function(c){return y.indexOf(c)===-1})}}),T.unknownCodecs=w}function S(w,T,_){var y=T[_];y&&(w[_]=y)}function C(w,T){for(var _=w[T],y=T;y--;){var f=w[y];if(!f)return;f.programDateTime=_.programDateTime-f.duration*1e3,_=f}}function x(w,T){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):T!=null&&T.programDateTime&&(w.programDateTime=T.endProgramDateTime),Object(B.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/polyfills/number.ts"),R=I("./src/events.ts"),P=I("./src/errors.ts"),F=I("./src/utils/logger.ts"),D=I("./src/utils/mp4-tools.ts"),L=I("./src/loader/m3u8-parser.ts"),A=I("./src/types/loader.ts"),b=I("./src/utils/attr-list.ts");function m(o){var a=o.type;switch(a){case A.PlaylistContextType.AUDIO_TRACK:return A.PlaylistLevelType.AUDIO;case A.PlaylistContextType.SUBTITLE_TRACK:return A.PlaylistLevelType.SUBTITLE;default:return A.PlaylistLevelType.MAIN}}function h(o,a){var u=o.url;return(u===void 0||u.indexOf("data:")===0)&&(u=a.url),u}var d=function(){function o(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var a=o.prototype;return a.registerListeners=function(){var s=this.hls;s.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(R.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(R.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.unregisterListeners=function(){var s=this.hls;s.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(R.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(R.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.createInternalLoader=function(s){var i=this.hls.config,n=i.pLoader,S=i.loader,C=n||S,x=new C(i);return s.loader=x,this.loaders[s.type]=x,x},a.getInternalLoader=function(s){return this.loaders[s.type]},a.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},a.destroyInternalLoaders=function(){for(var s in this.loaders){var i=this.loaders[s];i&&i.destroy(),this.resetInternalLoader(s)}},a.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},a.onManifestLoading=function(s,i){var n=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},a.onLevelLoading=function(s,i){var n=i.id,S=i.level,C=i.url,x=i.deliveryDirectives;this.load({id:n,groupId:null,level:S,responseType:"text",type:A.PlaylistContextType.LEVEL,url:C,deliveryDirectives:x})},a.onAudioTrackLoading=function(s,i){var n=i.id,S=i.groupId,C=i.url,x=i.deliveryDirectives;this.load({id:n,groupId:S,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:C,deliveryDirectives:x})},a.onSubtitleTrackLoading=function(s,i){var n=i.id,S=i.groupId,C=i.url,x=i.deliveryDirectives;this.load({id:n,groupId:S,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:C,deliveryDirectives:x})},a.load=function(s){var i,n=this.hls.config,S=this.getInternalLoader(s);if(S){var C=S.context;if(C&&C.url===s.url){F.logger.trace("[playlist-loader]: playlist request ongoing");return}F.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),S.abort()}var x,w,T,_;switch(s.type){case A.PlaylistContextType.MANIFEST:x=n.manifestLoadingMaxRetry,w=n.manifestLoadingTimeOut,T=n.manifestLoadingRetryDelay,_=n.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:x=0,w=n.levelLoadingTimeOut;break;default:x=n.levelLoadingMaxRetry,w=n.levelLoadingTimeOut,T=n.levelLoadingRetryDelay,_=n.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(s),(i=s.deliveryDirectives)!==null&&i!==void 0&&i.part){var y;if(s.type===A.PlaylistContextType.LEVEL&&s.level!==null?y=this.hls.levels[s.level].details:s.type===A.PlaylistContextType.AUDIO_TRACK&&s.id!==null?y=this.hls.audioTracks[s.id].details:s.type===A.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(y=this.hls.subtitleTracks[s.id].details),y){var f=y.partTarget,c=y.targetduration;f&&c&&(w=Math.min(Math.max(f*3,c*.8)*1e3,w))}}var v={timeout:w,maxRetry:x,retryDelay:T,maxRetryDelay:_,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(s,v,p)},a.loadsuccess=function(s,i,n,S){if(S===void 0&&(S=null),n.isSidxRequest){this.handleSidxRequest(s,n),this.handlePlaylistLoaded(s,i,n,S);return}this.resetInternalLoader(n.type);var C=s.data;if(C.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,n,"no EXTM3U delimiter",S);return}i.parsing.start=performance.now(),C.indexOf("#EXTINF:")>0||C.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,i,n,S):this.handleMasterPlaylist(s,i,n,S)},a.loaderror=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!1,s)},a.loadtimeout=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!0)},a.handleMasterPlaylist=function(s,i,n,S){var C=this.hls,x=s.data,w=h(s,n),T=L.default.parseMasterPlaylist(x,w),_=T.levels,y=T.sessionData;if(!_.length){this.handleManifestParsingError(s,n,"no level found in manifest",S);return}var f=_.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),c=_.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),v=L.default.parseMasterPlaylistMedia(x,w,"AUDIO",f),p=L.default.parseMasterPlaylistMedia(x,w,"SUBTITLES",c),E=L.default.parseMasterPlaylistMedia(x,w,"CLOSED-CAPTIONS");if(v.length){var k=v.some(function(U){return!U.url});!k&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(F.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}C.trigger(R.Events.MANIFEST_LOADED,{levels:_,audioTracks:v,subtitles:p,captions:E,url:w,stats:i,networkDetails:S,sessionData:y})},a.handleTrackOrLevelPlaylist=function(s,i,n,S){var C=this.hls,x=n.id,w=n.level,T=n.type,_=h(s,n),y=Object(B.isFiniteNumber)(x)?x:0,f=Object(B.isFiniteNumber)(w)?w:y,c=m(n),v=L.default.parseLevelPlaylist(s.data,_,f,c,y);if(!v.fragments.length){C.trigger(R.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(T===A.PlaylistContextType.MANIFEST){var p={attrs:new b.AttrList({}),bitrate:0,details:v,name:"",url:_};C.trigger(R.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:_,stats:i,networkDetails:S,sessionData:null})}if(i.parsing.end=performance.now(),v.needSidxRanges){var E,k=(E=v.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:k,isSidxRequest:!0,type:T,level:w,levelDetails:v,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=v,this.handlePlaylistLoaded(s,i,n,S)},a.handleSidxRequest=function(s,i){var n=Object(D.parseSegmentIndex)(new Uint8Array(s.data));if(!n)return;var S=n.references,C=i.levelDetails;S.forEach(function(x,w){var T=x.info,_=C.fragments[w];_.byteRange.length===0&&_.setByteRange(String(1+T.end-T.start)+"@"+String(T.start)),_.initSegment&&_.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},a.handleManifestParsingError=function(s,i,n,S){this.hls.trigger(R.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===A.PlaylistContextType.MANIFEST,url:s.url,reason:n,response:s,context:i,networkDetails:S})},a.handleNetworkError=function(s,i,n,S){n===void 0&&(n=!1),F.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 C=P.ErrorDetails.UNKNOWN,x=!1,w=this.getInternalLoader(s);switch(s.type){case A.PlaylistContextType.MANIFEST:C=n?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case A.PlaylistContextType.LEVEL:C=n?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case A.PlaylistContextType.AUDIO_TRACK:C=n?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:C=n?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}w&&this.resetInternalLoader(s.type);var T={type:P.ErrorTypes.NETWORK_ERROR,details:C,fatal:x,url:s.url,loader:w,context:s,networkDetails:i};S&&(T.response=S),this.hls.trigger(R.Events.ERROR,T)},a.handlePlaylistLoaded=function(s,i,n,S){var C=n.type,x=n.level,w=n.id,T=n.groupId,_=n.loader,y=n.levelDetails,f=n.deliveryDirectives;if(!(y!=null&&y.targetduration)){this.handleManifestParsingError(s,n,"invalid target duration",S);return}if(!_)return;y.live&&(_.getCacheAge&&(y.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(y.ageHeader))&&(y.ageHeader=0));switch(C){case A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(R.Events.LEVEL_LOADED,{details:y,level:x||0,id:w||0,stats:i,networkDetails:S,deliveryDirectives:f});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(R.Events.AUDIO_TRACK_LOADED,{details:y,id:w||0,groupId:T||"",stats:i,networkDetails:S,deliveryDirectives:f});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(R.Events.SUBTITLE_TRACK_LOADED,{details:y,id:w||0,groupId:T||"",stats:i,networkDetails:S,deliveryDirectives:f});break}},o}();z.default=d},"./src/polyfills/number.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"isFiniteNumber",function(){return B}),I.d(z,"MAX_SAFE_INTEGER",function(){return R});var B=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},R=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Q,z,I){"use strict";I.r(z);var B=function(){function R(){}return R.getSilentFrame=function(F,D){switch(F){case"mp4a.40.2":if(D===1)return new Uint8Array([0,200,0,128,35,128]);if(D===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(D===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(D===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(D===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(D===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(D===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(D===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(D===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},R}();z.default=B},"./src/remux/mp4-generator.ts":function(Q,z,I){"use strict";I.r(z);var B=Math.pow(2,32)-1,R=function(){function P(){}return P.init=function(){P.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var D;for(D in P.types)P.types.hasOwnProperty(D)&&(P.types[D]=[D.charCodeAt(0),D.charCodeAt(1),D.charCodeAt(2),D.charCodeAt(3)]);var L=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),A=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);P.HDLR_TYPES={video:L,audio:A};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=m,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var h=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,h,o,h,d),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,b))},P.box=function(D){for(var L=8,A=arguments.length,b=new Array(A>1?A-1:0),m=1;m<A;m++)b[m-1]=arguments[m];for(var h=b.length,d=h;h--;)L+=b[h].byteLength;var o=new Uint8Array(L);for(o[0]=L>>24&255,o[1]=L>>16&255,o[2]=L>>8&255,o[3]=L&255,o.set(D,4),h=0,L=8;h<d;h++)o.set(b[h],L),L+=b[h].byteLength;return o},P.hdlr=function(D){return P.box(P.types.hdlr,P.HDLR_TYPES[D])},P.mdat=function(D){return P.box(P.types.mdat,D)},P.mdhd=function(D,L){L*=D;var A=Math.floor(L/(B+1)),b=Math.floor(L%(B+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,A>>24,A>>16&255,A>>8&255,A&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},P.mdia=function(D){return P.box(P.types.mdia,P.mdhd(D.timescale,D.duration),P.hdlr(D.type),P.minf(D))},P.mfhd=function(D){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255]))},P.minf=function(D){return D.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(D)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(D))},P.moof=function(D,L,A){return P.box(P.types.moof,P.mfhd(D),P.traf(A,L))},P.moov=function(D){for(var L=D.length,A=[];L--;)A[L]=P.trak(D[L]);return P.box.apply(null,[P.types.moov,P.mvhd(D[0].timescale,D[0].duration)].concat(A).concat(P.mvex(D)))},P.mvex=function(D){for(var L=D.length,A=[];L--;)A[L]=P.trex(D[L]);return P.box.apply(null,[P.types.mvex].concat(A))},P.mvhd=function(D,L){L*=D;var A=Math.floor(L/(B+1)),b=Math.floor(L%(B+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,A>>24,A>>16&255,A>>8&255,A&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return P.box(P.types.mvhd,m)},P.sdtp=function(D){var L=D.samples||[],A=new Uint8Array(4+L.length),b,m;for(b=0;b<L.length;b++)m=L[b].flags,A[b+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return P.box(P.types.sdtp,A)},P.stbl=function(D){return P.box(P.types.stbl,P.stsd(D),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))},P.avc1=function(D){var L=[],A=[],b,m,h;for(b=0;b<D.sps.length;b++)m=D.sps[b],h=m.byteLength,L.push(h>>>8&255),L.push(h&255),L=L.concat(Array.prototype.slice.call(m));for(b=0;b<D.pps.length;b++)m=D.pps[b],h=m.byteLength,A.push(h>>>8&255),A.push(h&255),A=A.concat(Array.prototype.slice.call(m));var d=P.box(P.types.avcC,new Uint8Array([1,L[3],L[4],L[5],252|3,224|D.sps.length].concat(L).concat([D.pps.length]).concat(A))),o=D.width,a=D.height,u=D.pixelRatio[0],s=D.pixelRatio[1];return P.box(P.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,o&255,a>>8&255,a&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]),d,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,s>>24,s>>16&255,s>>8&255,s&255])))},P.esds=function(D){var L=D.config.length;return new Uint8Array([0,0,0,0,3,23+L,0,1,0,4,15+L,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([L]).concat(D.config).concat([6,1,2]))},P.mp4a=function(D){var L=D.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,D.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]),P.box(P.types.esds,P.esds(D)))},P.mp3=function(D){var L=D.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,D.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]))},P.stsd=function(D){return D.type==="audio"?!D.isAAC&&D.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(D)):P.box(P.types.stsd,P.STSD,P.mp4a(D)):P.box(P.types.stsd,P.STSD,P.avc1(D))},P.tkhd=function(D){var L=D.id,A=D.duration*D.timescale,b=D.width,m=D.height,h=Math.floor(A/(B+1)),d=Math.floor(A%(B+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,d>>24,d>>16&255,d>>8&255,d&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,b>>8&255,b&255,0,0,m>>8&255,m&255,0,0]))},P.traf=function(D,L){var A=P.sdtp(D),b=D.id,m=Math.floor(L/(B+1)),h=Math.floor(L%(B+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,h>>24,h>>16&255,h>>8&255,h&255])),P.trun(D,A.length+16+20+8+16+8+8),A)},P.trak=function(D){return D.duration=D.duration||4294967295,P.box(P.types.trak,P.tkhd(D),P.mdia(D))},P.trex=function(D){var L=D.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(D,L){var A=D.samples||[],b=A.length,m=12+16*b,h=new Uint8Array(m),d,o,a,u,s,i;for(L+=8+m,h.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255],0),d=0;d<b;d++)o=A[d],a=o.duration,u=o.size,s=o.flags,i=o.cts,h.set([a>>>24&255,a>>>16&255,a>>>8&255,a&255,u>>>24&255,u>>>16&255,u>>>8&255,u&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*d);return P.box(P.types.trun,h)},P.initSegment=function(D){P.types||P.init();var L=P.moov(D),A=new Uint8Array(P.FTYP.byteLength+L.byteLength);return A.set(P.FTYP),A.set(L,P.FTYP.byteLength),A},P}();R.types=void 0,R.HDLR_TYPES=void 0,R.STTS=void 0,R.STSC=void 0,R.STCO=void 0,R.STSZ=void 0,R.VMHD=void 0,R.SMHD=void 0,R.STSD=void 0,R.FTYP=void 0,R.DINF=void 0,z.default=R},"./src/remux/mp4-remuxer.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return i}),I.d(z,"normalizePts",function(){return n});var B=I("./src/polyfills/number.ts"),R=I("./src/remux/aac-helper.ts"),P=I("./src/remux/mp4-generator.ts"),F=I("./src/events.ts"),D=I("./src/errors.ts"),L=I("./src/utils/logger.ts"),A=I("./src/types/loader.ts"),b=I("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(w){for(var T=1;T<arguments.length;T++){var _=arguments[T];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(w[y]=_[y])}return w},m.apply(this,arguments)}var h=10*1e3,d=1024,o=1152,a=null,u=null,s=!1,i=function(){function w(_,y,f,c){if(c===void 0&&(c=""),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=_,this.config=y,this.typeSupported=f,this.ISGenerated=!1,a===null){var v=navigator.userAgent||"",p=v.match(/Chrome\/(\d+)/i);a=p?parseInt(p[1]):0}if(u===null){var E=navigator.userAgent.match(/Safari\/(\d+)/i);u=E?parseInt(E[1]):0}s=!!a&&a<75||!!u&&u<600}var T=w.prototype;return T.destroy=function(){},T.resetTimeStamp=function(y){L.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=y},T.resetNextTimestamp=function(){L.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},T.resetInitSegment=function(){L.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},T.getVideoStartPts=function(y){var f=!1,c=y.reduce(function(v,p){var E=p.pts-v;return E<-4294967296?(f=!0,n(v,p.pts)):E>0?v:p.pts},y[0].pts);return f&&L.logger.debug("PTS rollover detected"),c},T.remux=function(y,f,c,v,p,E,k,U){var H,W,j,O,K,Y,ee=p,se=p,Be=y.pid>-1,me=f.pid>-1,xe=f.samples.length,Le=y.samples.length>0,Ae=xe>1,le=(!Be||Le)&&(!me||Ae)||this.ISGenerated||k;if(le){this.ISGenerated||(j=this.generateIS(y,f,p));var fe=this.isVideoContiguous,Ve=-1;if(Ae&&(Ve=S(f.samples),!fe&&this.config.forceKeyFrameOnDiscontinuity))if(Y=!0,Ve>0){L.logger.warn("[mp4-remuxer]: Dropped "+Ve+" out of "+xe+" video samples due to a missing keyframe");var Lt=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(Ve),f.dropped+=Ve,se+=(f.samples[0].pts-Lt)/(f.timescale||9e4)}else Ve===-1&&(L.logger.warn("[mp4-remuxer]: No keyframe found out of "+xe+" video samples"),Y=!1);if(this.ISGenerated){if(Le&&Ae){var Pt=this.getVideoStartPts(f.samples),vt=n(y.samples[0].pts,Pt)-Pt,Fe=vt/f.inputTimeScale;ee+=Math.max(0,Fe),se+=Math.max(0,-Fe)}if(Le){if(y.samplerate||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(y,f,p)),W=this.remuxAudio(y,ee,this.isAudioContiguous,E,me||Ae||U===A.PlaylistLevelType.AUDIO?se:void 0),Ae){var _t=W?W.endPTS-W.startPTS:0;f.inputTimeScale||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(y,f,p)),H=this.remuxVideo(f,se,fe,_t)}}else Ae&&(H=this.remuxVideo(f,se,fe,0));H&&(H.firstKeyFrame=Ve,H.independent=Ve!==-1)}}return this.ISGenerated&&(c.samples.length&&(K=this.remuxID3(c,p)),v.samples.length&&(O=this.remuxText(v,p))),{audio:W,video:H,initSegment:j,independent:Y,text:O,id3:K}},T.generateIS=function(y,f,c){var v=y.samples,p=f.samples,E=this.typeSupported,k={},U=!Object(B.isFiniteNumber)(this._initPTS),H="audio/mp4",W,j,O;if(U&&(W=j=Infinity),y.config&&v.length&&(y.timescale=y.samplerate,y.isAAC||(E.mpeg?(H="audio/mpeg",y.codec=""):E.mp3&&(y.codec="mp3")),k.audio={id:"audio",container:H,codec:y.codec,initSegment:!y.isAAC&&E.mpeg?new Uint8Array(0):P.default.initSegment([y]),metadata:{channelCount:y.channelCount}},U&&(O=y.inputTimeScale,W=j=v[0].pts-Math.round(O*c))),f.sps&&f.pps&&p.length&&(f.timescale=f.inputTimeScale,k.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:P.default.initSegment([f]),metadata:{width:f.width,height:f.height}},U)){O=f.inputTimeScale;var K=this.getVideoStartPts(p),Y=Math.round(O*c);j=Math.min(j,n(p[0].dts,K)-Y),W=Math.min(W,K-Y)}if(Object.keys(k).length)return this.ISGenerated=!0,U&&(this._initPTS=W,this._initDTS=j),{tracks:k,initPTS:W,timescale:O}},T.remuxVideo=function(y,f,c,v){var p=y.inputTimeScale,E=y.samples,k=[],U=E.length,H=this._initPTS,W=this.nextAvcDts,j=8,O,K,Y,ee=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,Be=0,me=!1;if(!c||W===null){var xe=f*p,Le=E[0].pts-n(E[0].dts,E[0].pts);W=xe-Le}for(var Ae=0;Ae<U;Ae++){var le=E[Ae];if(le.pts=n(le.pts-H,W),le.dts=n(le.dts-H,W),le.dts>le.pts){var fe=9e4*.2;Be=Math.max(Math.min(Be,le.pts-le.dts),-1*fe)}le.dts<E[Ae>0?Ae-1:Ae].dts&&(me=!0)}me&&E.sort(function(qt,st){var pt=qt.dts-st.dts,Qe=qt.pts-st.pts;return pt||Qe}),K=E[0].dts,Y=E[E.length-1].dts;var Ve=Math.round((Y-K)/(U-1));if(Be<0){if(Be<Ve*-2){L.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-Ve,!0)+" ms");for(var Lt=Be,Pt=0;Pt<U;Pt++)E[Pt].dts=Lt=Math.max(Lt,E[Pt].pts-Ve),E[Pt].pts=Math.max(Lt,E[Pt].pts)}else{L.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(Be,!0)+" ms to overcome this issue");for(var vt=0;vt<U;vt++)E[vt].dts=E[vt].dts+Be}K=E[0].dts}if(c){var Fe=K-W,_t=Fe>Ve,tt=Fe<-1;if(_t||tt){_t?L.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(Fe,!0)+" ms ("+Fe+"dts) hole between fragments detected, filling it"):L.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-Fe,!0)+" ms ("+Fe+"dts) overlapping between fragments detected"),K=W;var Rt=E[0].pts-Fe;E[0].dts=K,E[0].pts=Rt,L.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Rt,!0)+"/"+Object(b.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(Fe,!0)+" ms")}}s&&(K=Math.max(0,K));for(var Ge=0,Ft=0,wt=0;wt<U;wt++){for(var yt=E[wt],bn=yt.units,un=bn.length,sn=0,Ye=0;Ye<un;Ye++)sn+=bn[Ye].data.length;Ft+=sn,Ge+=un,yt.length=sn,yt.dts=Math.max(yt.dts,K),yt.pts=Math.max(yt.pts,yt.dts,0),ee=Math.min(yt.pts,ee),se=Math.max(yt.pts,se)}Y=E[U-1].dts;var nn=Ft+4*Ge+8,An;try{An=new Uint8Array(nn)}catch(qt){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:D.ErrorTypes.MUX_ERROR,details:D.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:nn,reason:"fail allocating video mdat "+nn});return}var ke=new DataView(An.buffer);ke.setUint32(0,nn),An.set(P.default.types.mdat,4);for(var Pe=0;Pe<U;Pe++){for(var rt=E[Pe],ht=rt.units,Ue=0,ut=0,Ee=ht.length;ut<Ee;ut++){var ce=ht[ut],he=ce.data,J=ce.data.byteLength;ke.setUint32(j,J),j+=4,An.set(he,j),j+=J,Ue+=4+J}if(Pe<U-1)O=E[Pe+1].dts-rt.dts;else{var Z=this.config,re=rt.dts-E[Pe>0?Pe-1:Pe].dts;if(Z.stretchShortVideoTrack&&this.nextAudioPts!==null){var ue=Math.floor(Z.maxBufferHole*p),de=(v?ee+v*p:this.nextAudioPts)-rt.pts;de>ue?(O=de-re,O<0&&(O=re),L.logger.log("[mp4-remuxer]: It is approximately "+de/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=re}else O=re}var Ne=Math.round(rt.pts-rt.dts);k.push(new C(rt.key,O,Ue,Ne))}if(k.length&&a&&a<70){var ct=k[0].flags;ct.dependsOn=2,ct.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=W=Y+O,this.isVideoContiguous=!0;var Gt=P.default.moof(y.sequenceNumber++,K,m({},y,{samples:k})),an="video",it={data1:Gt,data2:An,startPTS:ee/p,endPTS:(se+O)/p,startDTS:K/p,endDTS:W/p,type:an,hasAudio:!1,hasVideo:!0,nb:k.length,dropped:y.dropped};return y.samples=[],y.dropped=0,console.assert(An.length,"MDAT length must not be zero"),it},T.remuxAudio=function(y,f,c,v,p){var E=y.inputTimeScale,k=y.samplerate?y.samplerate:E,U=E/k,H=y.isAAC?d:o,W=H*U,j=this._initPTS,O=!y.isAAC&&this.typeSupported.mpeg,K=[],Y=y.samples,ee=O?0:8,se=this.nextAudioPts||-1,Be=f*E;if(this.isAudioContiguous=c=c||Y.length&&se>0&&(v&&Math.abs(Be-se)<9e3||Math.abs(n(Y[0].pts-j,Be)-se)<20*W),Y.forEach(function(he){he.pts=n(he.pts-j,Be)}),!c||se<0){if(Y=Y.filter(function(he){return he.pts>=0}),!Y.length)return;p===0?se=0:v?se=Math.max(0,Be):se=Y[0].pts}if(y.isAAC)for(var me=p!==void 0,xe=this.config.maxAudioFramesDrift,Le=0,Ae=se;Le<Y.length;Le++){var le=Y[Le],fe=le.pts,Ve=fe-Ae,Lt=Math.abs(1e3*Ve/E);if(Ve<=-xe*W&&me)Le===0&&(L.logger.warn("Audio frame @ "+(fe/E).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ve/E)+" ms."),this.nextAudioPts=se=Ae=fe);else if(Ve>=xe*W&&Lt<h&&me){var Pt=Math.round(Ve/W);Ae=fe-Pt*W,Ae<0&&(Pt--,Ae+=W),Le===0&&(this.nextAudioPts=se=Ae),L.logger.warn("[mp4-remuxer]: Injecting "+Pt+" audio frame @ "+(Ae/E).toFixed(3)+"s due to "+Math.round(1e3*Ve/E)+" ms gap.");for(var vt=0;vt<Pt;vt++){var Fe=Math.max(Ae,0),_t=R.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);_t||(L.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),_t=le.unit.subarray()),Y.splice(Le,0,{unit:_t,pts:Fe}),Ae+=W,Le++}}le.pts=Ae,Ae+=W}for(var tt=null,Rt=null,Ge,Ft=0,wt=Y.length;wt--;)Ft+=Y[wt].unit.byteLength;for(var yt=0,bn=Y.length;yt<bn;yt++){var un=Y[yt],sn=un.unit,Ye=un.pts;if(Rt!==null){var nn=K[yt-1];nn.duration=Math.round((Ye-Rt)/U)}else if(c&&y.isAAC&&(Ye=se),tt=Ye,Ft>0){Ft+=ee;try{Ge=new Uint8Array(Ft)}catch(he){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:D.ErrorTypes.MUX_ERROR,details:D.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ft,reason:"fail allocating audio mdat "+Ft});return}if(!O){var An=new DataView(Ge.buffer);An.setUint32(0,Ft),Ge.set(P.default.types.mdat,4)}}else return;Ge.set(sn,ee);var ke=sn.byteLength;ee+=ke,K.push(new C(!0,H,ke,0)),Rt=Ye}var Pe=K.length;if(!Pe)return;var rt=K[K.length-1];this.nextAudioPts=se=Rt+U*rt.duration;var ht=O?new Uint8Array(0):P.default.moof(y.sequenceNumber++,tt/U,m({},y,{samples:K}));y.samples=[];var Ue=tt/E,ut=se/E,Ee="audio",ce={data1:ht,data2:Ge,startPTS:Ue,endPTS:ut,startDTS:Ue,endDTS:ut,type:Ee,hasAudio:!0,hasVideo:!1,nb:Pe};return this.isAudioContiguous=!0,console.assert(Ge.length,"MDAT length must not be zero"),ce},T.remuxEmptyAudio=function(y,f,c,v){var p=y.inputTimeScale,E=y.samplerate?y.samplerate:p,k=p/E,U=this.nextAudioPts,H=(U!==null?U:v.startDTS*p)+this._initDTS,W=v.endDTS*p+this._initDTS,j=k*d,O=Math.ceil((W-H)/j),K=R.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);if(L.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){L.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Y=[],ee=0;ee<O;ee++){var se=H+ee*j;Y.push({unit:K,pts:se,dts:se})}return y.samples=Y,this.remuxAudio(y,f,c,!1)},T.remuxID3=function(y,f){var c=y.samples.length;if(!c)return;for(var v=y.inputTimeScale,p=this._initPTS,E=this._initDTS,k=0;k<c;k++){var U=y.samples[k];U.pts=n(U.pts-p,f*v)/v,U.dts=n(U.dts-E,f*v)/v}var H=y.samples;return y.samples=[],{samples:H}},T.remuxText=function(y,f){var c=y.samples.length;if(!c)return;for(var v=y.inputTimeScale,p=this._initPTS,E=0;E<c;E++){var k=y.samples[E];k.pts=n(k.pts-p,f*v)/v}y.samples.sort(function(H,W){return H.pts-W.pts});var U=y.samples;return y.samples=[],{samples:U}},w}();function n(w,T){var _;if(T===null)return w;for(T<w?_=-8589934592:_=8589934592;Math.abs(w-T)>4294967296;)w+=_;return w}function S(w){for(var T=0;T<w.length;T++)if(w[T].key)return T;return-1}var C=function(T,_,y,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=y,this.cts=f,this.flags=new x(T)},x=function(T){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=T?2:1,this.isNonSync=T?0:1}},"./src/remux/passthrough-remuxer.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/polyfills/number.ts"),R=I("./src/utils/mp4-tools.ts"),P=I("./src/loader/fragment.ts"),F=I("./src/utils/logger.ts"),D=function(){function b(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=b.prototype;return m.destroy=function(){},m.resetTimeStamp=function(d){this.initPTS=d,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(d,o,a){this.audioCodec=o,this.videoCodec=a,this.generateInitSegment(d),this.emitInitSegment=!0},m.generateInitSegment=function(d){var o=this.audioCodec,a=this.videoCodec;if(!d||!d.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(R.parseInitSegment)(d);o||(o=A(u.audio,P.ElementaryStreamTypes.AUDIO)),a||(a=A(u.video,P.ElementaryStreamTypes.VIDEO));var s={};u.audio&&u.video?s.audiovideo={container:"video/mp4",codec:o+","+a,initSegment:d,id:"main"}:u.audio?s.audio={container:"audio/mp4",codec:o,initSegment:d,id:"audio"}:u.video?s.video={container:"video/mp4",codec:a,initSegment:d,id:"main"}:F.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},m.remux=function(d,o,a,u,s){var i=this.initPTS,n=this.lastEndDTS,S={audio:void 0,video:void 0,text:u,id3:a,initSegment:void 0};Object(B.isFiniteNumber)(n)||(n=this.lastEndDTS=s||0);var C=o.samples;if(!C||!C.length)return S;var x={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(C),w=this.initData),!w||!w.length)return F.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(B.isFiniteNumber)(i)||(this.initPTS=x.initPTS=i=L(w,C,n));var T=Object(R.getDuration)(C,w),_=n,y=T+_;Object(R.offsetStartDTS)(w,C,i),T>0?this.lastEndDTS=y:(F.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!w.audio,c=!!w.video,v="";f&&(v+="audio"),c&&(v+="video");var p={data1:C,startPTS:_,startDTS:_,endPTS:y,endDTS:y,type:v,hasAudio:f,hasVideo:c,nb:1,dropped:0};return S.audio=p.type==="audio"?p:void 0,S.video=p.type!=="audio"?p:void 0,S.text=u,S.id3=a,S.initSegment=x,S},b}(),L=function(m,h,d){return Object(R.getStartDTS)(m,h)-d};function A(b,m){var h=b==null?void 0:b.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||m===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=D},"./src/task-loop.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return B});var B=function(){function R(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=R.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(D){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,D),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},R}()},"./src/types/cmcd.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"CMCDVersion",function(){return B}),I.d(z,"CMCDObjectType",function(){return R}),I.d(z,"CMCDStreamingFormat",function(){return P}),I.d(z,"CMCDStreamType",function(){return F});var B=1,R;(function(D){D.MANIFEST="m",D.AUDIO="a",D.VIDEO="v",D.MUXED="av",D.INIT="i",D.CAPTION="c",D.TIMED_TEXT="tt",D.KEY="k",D.OTHER="o"})(R||(R={}));var P;(function(D){D.DASH="d",D.HLS="h",D.SMOOTH="s",D.OTHER="o"})(P||(P={}));var F;(function(D){D.VOD="v",D.LIVE="l"})(F||(F={}))},"./src/types/level.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"HlsSkip",function(){return P}),I.d(z,"getSkipValue",function(){return F}),I.d(z,"HlsUrlParameters",function(){return D}),I.d(z,"Level",function(){return L});function B(A,b){for(var m=0;m<b.length;m++){var h=b[m];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(A,h.key,h)}}function R(A,b,m){return b&&B(A.prototype,b),m&&B(A,m),A}var P;(function(A){A.No="",A.Yes="YES",A.v2="v2"})(P||(P={}));function F(A,b){var m=A.canSkipUntil,h=A.canSkipDateRanges,d=A.endSN,o=b!==void 0?b-d:0;return m&&o<m?h?P.v2:P.Yes:P.No}var D=function(){function A(m,h,d){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=h,this.skip=d}var b=A.prototype;return b.addDirectives=function(h){var d=new self.URL(h);return this.msn!==void 0&&d.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&d.searchParams.set("_HLS_part",this.part.toString()),this.skip&&d.searchParams.set("_HLS_skip",this.skip),d.toString()},A}(),L=function(){function A(b){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return R(A,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var h=m%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),A}()},"./src/types/loader.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"PlaylistContextType",function(){return B}),I.d(z,"PlaylistLevelType",function(){return R});var B;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})(B||(B={}));var R;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(R||(R={}))},"./src/types/transmuxer.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"ChunkMetadata",function(){return B});var B=function(F,D,L,A,b,m){A===void 0&&(A=0),b===void 0&&(b=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=R(),this.buffering={audio:R(),video:R(),audiovideo:R()},this.level=F,this.sn=D,this.id=L,this.size=A,this.part=b,this.partial=m};function R(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"AttrList",function(){return P});var B=/^(\d+)x(\d+)$/,R=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function F(L){typeof L=="string"&&(L=F.parseAttrList(L));for(var A in L)L.hasOwnProperty(A)&&(this[A]=L[A])}var D=F.prototype;return D.decimalInteger=function(A){var b=parseInt(this[A],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},D.hexadecimalInteger=function(A){if(this[A]){var b=(this[A]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var m=new Uint8Array(b.length/2),h=0;h<b.length/2;h++)m[h]=parseInt(b.slice(h*2,h*2+2),16);return m}else return null},D.hexadecimalIntegerAsNumber=function(A){var b=parseInt(this[A],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},D.decimalFloatingPoint=function(A){return parseFloat(this[A])},D.optionalFloat=function(A,b){var m=this[A];return m?parseFloat(m):b},D.enumeratedString=function(A){return this[A]},D.bool=function(A){return this[A]==="YES"},D.decimalResolution=function(A){var b=B.exec(this[A]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},F.parseAttrList=function(A){var b,m={},h='"';for(R.lastIndex=0;(b=R.exec(A))!==null;){var d=b[2];d.indexOf(h)===0&&d.lastIndexOf(h)===d.length-1&&(d=d.slice(1,-1)),m[b[1]]=d}return m},F}()},"./src/utils/binary-search.ts":function(Q,z,I){"use strict";I.r(z);var B={search:function(P,F){for(var D=0,L=P.length-1,A=null,b=null;D<=L;){A=(D+L)/2|0,b=P[A];var m=F(b);if(m>0)D=A+1;else if(m<0)L=A-1;else return b}return null}};z.default=B},"./src/utils/buffer-helper.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"BufferHelper",function(){return P});var B=I("./src/utils/logger.ts"),R={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function F(){}return F.isBuffered=function(L,A){try{if(L){for(var b=F.getBuffered(L),m=0;m<b.length;m++)if(A>=b.start(m)&&A<=b.end(m))return!0}}catch(h){}return!1},F.bufferInfo=function(L,A,b){try{if(L){var m=F.getBuffered(L),h=[],d;for(d=0;d<m.length;d++)h.push({start:m.start(d),end:m.end(d)});return this.bufferedInfo(h,A,b)}}catch(o){}return{len:0,start:A,end:A,nextStart:void 0}},F.bufferedInfo=function(L,A,b){A=Math.max(0,A),L.sort(function(x,w){var T=x.start-w.start;return T||w.end-x.end});var m=[];if(b)for(var h=0;h<L.length;h++){var d=m.length;if(d){var o=m[d-1].end;L[h].start-o<b?L[h].end>o&&(m[d-1].end=L[h].end):m.push(L[h])}else m.push(L[h])}else m=L;for(var a=0,u,s=A,i=A,n=0;n<m.length;n++){var S=m[n].start,C=m[n].end;if(A+b>=S&&A<C)s=S,i=C,a=i-A;else if(A+b<S){u=S;break}}return{len:a,start:s||0,end:i||0,nextStart:u}},F.getBuffered=function(L){try{return L.buffered}catch(A){return B.logger.log("failed to get media.buffered",A),R}},F}()},"./src/utils/cea-608-parser.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"Row",function(){return i}),I.d(z,"CaptionScreen",function(){return n});var B=I("./src/utils/logger.ts"),R={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},P=function(y){var f=y;return R.hasOwnProperty(y)&&(f=R[y]),String.fromCharCode(f)},F=15,D=100,L={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},A={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],d;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(d||(d={}));var o=function(){function _(){this.time=null,this.verboseLevel=d.ERROR}var y=_.prototype;return y.log=function(c,v){this.verboseLevel>=c&&B.logger.log(this.time+" ["+c+"] "+v)},_}(),a=function(y){for(var f=[],c=0;c<y.length;c++)f.push(y[c].toString(16));return f},u=function(){function _(f,c,v,p,E){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=c||!1,this.italics=v||!1,this.background=p||"black",this.flash=E||!1}var y=_.prototype;return y.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},y.setStyles=function(c){for(var v=["foreground","underline","italics","background","flash"],p=0;p<v.length;p++){var E=v[p];c.hasOwnProperty(E)&&(this[E]=c[E])}},y.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},y.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},y.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},y.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),s=function(){function _(f,c,v,p,E,k){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new u(c,v,p,E,k)}var y=_.prototype;return y.reset=function(){this.uchar=" ",this.penState.reset()},y.setChar=function(c,v){this.uchar=c,this.penState.copy(v)},y.setPenState=function(c){this.penState.copy(c)},y.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},y.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},y.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),i=function(){function _(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 c=0;c<D;c++)this.chars.push(new s);this.logger=f,this.pos=0,this.currPenState=new u}var y=_.prototype;return y.equals=function(c){for(var v=!0,p=0;p<D;p++)if(!this.chars[p].equals(c.chars[p])){v=!1;break}return v},y.copy=function(c){for(var v=0;v<D;v++)this.chars[v].copy(c.chars[v])},y.isEmpty=function(){for(var c=!0,v=0;v<D;v++)if(!this.chars[v].isEmpty()){c=!1;break}return c},y.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(d.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>D&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=D)},y.moveCursor=function(c){var v=this.pos+c;if(c>1)for(var p=this.pos+1;p<v+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(v)},y.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},y.insertChar=function(c){c>=144&&this.backSpace();var v=P(c);if(this.pos>=D){this.logger.log(d.ERROR,"Cannot insert "+c.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},y.clearFromPos=function(c){var v;for(v=c;v<D;v++)this.chars[v].reset()},y.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},y.clearToEndOfRow=function(){this.clearFromPos(this.pos)},y.getTextString=function(){for(var c=[],v=!0,p=0;p<D;p++){var E=this.chars[p].uchar;E!==" "&&(v=!1),c.push(E)}return v?"":c.join("")},y.setPenStyles=function(c){this.currPenState.setStyles(c);var v=this.chars[this.pos];v.setPenState(this.currPenState)},_}(),n=function(){function _(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 c=0;c<F;c++)this.rows.push(new i(f));this.logger=f,this.currRow=F-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var y=_.prototype;return y.reset=function(){for(var c=0;c<F;c++)this.rows[c].clear();this.currRow=F-1},y.equals=function(c){for(var v=!0,p=0;p<F;p++)if(!this.rows[p].equals(c.rows[p])){v=!1;break}return v},y.copy=function(c){for(var v=0;v<F;v++)this.rows[v].copy(c.rows[v])},y.isEmpty=function(){for(var c=!0,v=0;v<F;v++)if(!this.rows[v].isEmpty()){c=!1;break}return c},y.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},y.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},y.insertChar=function(c){var v=this.rows[this.currRow];v.insertChar(c)},y.setPen=function(c){var v=this.rows[this.currRow];v.setPenStyles(c)},y.moveCursor=function(c){var v=this.rows[this.currRow];v.moveCursor(c)},y.setCursor=function(c){this.logger.log(d.INFO,"setCursor: "+c);var v=this.rows[this.currRow];v.setCursor(c)},y.setPAC=function(c){this.logger.log(d.INFO,"pacData = "+JSON.stringify(c));var v=c.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var p=0;p<F;p++)this.rows[p].clear();var E=this.currRow+1-this.nrRollUpRows,k=this.lastOutputScreen;if(k){var U=k.rows[E].cueStartTime,H=this.logger.time;if(U&&H!==null&&U<H)for(var W=0;W<this.nrRollUpRows;W++)this.rows[v-this.nrRollUpRows+W+1].copy(k.rows[E+W])}}this.currRow=v;var j=this.rows[this.currRow];if(c.indent!==null){var O=c.indent,K=Math.max(O-1,0);j.setCursor(c.indent),c.color=j.chars[K].penState.foreground}var Y={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(Y)},y.setBkgData=function(c){this.logger.log(d.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},y.setRollUpRows=function(c){this.nrRollUpRows=c},y.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(d.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(d.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(c,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(d.INFO,"Rolling up")},y.getDisplayText=function(c){c=c||!1;for(var v=[],p="",E=-1,k=0;k<F;k++){var U=this.rows[k].getTextString();U&&(E=k+1,c?v.push("Row "+E+": '"+U+"'"):v.push(U.trim()))}return v.length>0&&(c?p="["+v.join(" | ")+"]":p=v.join(`
|
|
`)),p},y.getTextAndFormat=function(){return this.rows},_}(),S=function(){function _(f,c,v){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=c,this.mode=null,this.verbose=0,this.displayedMemory=new n(v),this.nonDisplayedMemory=new n(v),this.lastOutputScreen=new n(v),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var y=_.prototype;return y.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},y.getHandler=function(){return this.outputFilter},y.setHandler=function(c){this.outputFilter=c},y.setPAC=function(c){this.writeScreen.setPAC(c)},y.setBkgData=function(c){this.writeScreen.setBkgData(c)},y.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(d.INFO,"MODE="+c),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=c},y.insertChars=function(c){for(var v=0;v<c.length;v++)this.writeScreen.insertChar(c[v]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(d.INFO,p+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(d.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},y.ccRCL=function(){this.logger.log(d.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},y.ccBS=function(){if(this.logger.log(d.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},y.ccAOF=function(){},y.ccAON=function(){},y.ccDER=function(){this.logger.log(d.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},y.ccRU=function(c){this.logger.log(d.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},y.ccFON=function(){this.logger.log(d.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},y.ccRDC=function(){this.logger.log(d.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},y.ccTR=function(){this.logger.log(d.INFO,"TR"),this.setMode("MODE_TEXT")},y.ccRTD=function(){this.logger.log(d.INFO,"RTD"),this.setMode("MODE_TEXT")},y.ccEDM=function(){this.logger.log(d.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},y.ccCR=function(){this.logger.log(d.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},y.ccENM=function(){this.logger.log(d.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},y.ccEOC=function(){if(this.logger.log(d.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(d.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},y.ccTO=function(c){this.logger.log(d.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},y.ccMIDROW=function(c){var v={flash:!1};if(v.underline=c%2===1,v.italics=c>=46,v.italics)v.foreground="white";else{var p=Math.floor(c/2)-16,E=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=E[p]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},y.outputDataUpdate=function(c){c===void 0&&(c=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},y.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},_}(),C=function(){function _(f,c,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new o;this.channels=[null,new S(f,c,p),new S(f+1,v,p)],this.cmdHistory=T(),this.logger=p}var y=_.prototype;return y.getHandler=function(c){return this.channels[c].getHandler()},y.setHandler=function(c,v){this.channels[c].setHandler(v)},y.addData=function(c,v){var p,E,k,U=!1;this.logger.time=c;for(var H=0;H<v.length;H+=2){if(E=v[H]&127,k=v[H+1]&127,E===0&&k===0)continue;if(this.logger.log(d.DATA,"["+a([v[H],v[H+1]])+"] -> ("+a([E,k])+")"),p=this.parseCmd(E,k),p||(p=this.parseMidrow(E,k)),p||(p=this.parsePAC(E,k)),p||(p=this.parseBackgroundAttributes(E,k)),!p&&(U=this.parseChars(E,k),U)){var W=this.currentChannel;if(W&&W>0){var j=this.channels[W];j.insertChars(U)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!U&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+a([E,k])+" orig: "+a([v[H],v[H+1]]))}},y.parseCmd=function(c,v){var p=this.cmdHistory,E=(c===20||c===28||c===21||c===29)&&v>=32&&v<=47,k=(c===23||c===31)&&v>=33&&v<=35;if(!(E||k))return!1;if(w(c,v,p))return x(null,null,p),this.logger.log(d.DEBUG,"Repeated command ("+a([c,v])+") is dropped"),!0;var U=c===20||c===21||c===23?1:2,H=this.channels[U];return c===20||c===21||c===28||c===29?v===32?H.ccRCL():v===33?H.ccBS():v===34?H.ccAOF():v===35?H.ccAON():v===36?H.ccDER():v===37?H.ccRU(2):v===38?H.ccRU(3):v===39?H.ccRU(4):v===40?H.ccFON():v===41?H.ccRDC():v===42?H.ccTR():v===43?H.ccRTD():v===44?H.ccEDM():v===45?H.ccCR():v===46?H.ccENM():v===47&&H.ccEOC():H.ccTO(v-32),x(c,v,p),this.currentChannel=U,!0},y.parseMidrow=function(c,v){var p=0;if((c===17||c===25)&&v>=32&&v<=47){if(c===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var E=this.channels[p];return E?(E.ccMIDROW(v),this.logger.log(d.DEBUG,"MIDROW ("+a([c,v])+")"),!0):!1}return!1},y.parsePAC=function(c,v){var p,E=this.cmdHistory,k=(c>=17&&c<=23||c>=25&&c<=31)&&v>=64&&v<=127,U=(c===16||c===24)&&v>=64&&v<=95;if(!(k||U))return!1;if(w(c,v,E))return x(null,null,E),!0;var H=c<=23?1:2;v>=64&&v<=95?p=H===1?L[c]:b[c]:p=H===1?A[c]:m[c];var W=this.channels[H];return W?(W.setPAC(this.interpretPAC(p,v)),x(c,v,E),this.currentChannel=H,!0):!1},y.interpretPAC=function(c,v){var p,E={color:null,italics:!1,indent:null,underline:!1,row:c};return v>95?p=v-96:p=v-64,E.underline=(p&1)===1,p<=13?E.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(E.italics=!0,E.color="white"):E.indent=Math.floor((p-16)/2)*4,E},y.parseChars=function(c,v){var p,E=null,k=null;if(c>=25?(p=2,k=c-8):(p=1,k=c),k>=17&&k<=19){var U;k===17?U=v+80:k===18?U=v+112:U=v+144,this.logger.log(d.INFO,"Special char '"+P(U)+"' in channel "+p),E=[U]}else c>=32&&c<=127&&(E=v===0?[c]:[c,v]);if(E){var H=a(E);this.logger.log(d.DEBUG,"Char codes = "+H.join(",")),x(c,v,this.cmdHistory)}return E},y.parseBackgroundAttributes=function(c,v){var p=(c===16||c===24)&&v>=32&&v<=47,E=(c===23||c===31)&&v>=45&&v<=47;if(!(p||E))return!1;var k,U={};c===16||c===24?(k=Math.floor((v-32)/2),U.background=h[k],v%2===1&&(U.background=U.background+"_semi")):v===45?U.background="transparent":(U.foreground="black",v===47&&(U.underline=!0));var H=c<=23?1:2,W=this.channels[H];return W.setBkgData(U),x(c,v,this.cmdHistory),!0},y.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var v=this.channels[c];v&&v.reset()}this.cmdHistory=T()},y.cueSplitAtTime=function(c){for(var v=0;v<this.channels.length;v++){var p=this.channels[v];p&&p.cueSplitAtTime(c)}},_}();function x(_,y,f){f.a=_,f.b=y}function w(_,y,f){return f.a===_&&f.b===y}function T(){return{a:null,b:null}}z.default=C},"./src/utils/codecs.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"isCodecType",function(){return R}),I.d(z,"isCodecSupportedInMp4",function(){return P});var B={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 R(F,D){var L=B[D];return!!L&&L[F.slice(0,4)]===!0}function P(F,D){return MediaSource.isTypeSupported((D||"video")+'/mp4;codecs="'+F+'"')}},"./src/utils/cues.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/utils/vttparser.ts"),R=I("./src/utils/webvtt-parser.ts"),P=I("./src/utils/texttrack-utils.ts"),F=/\s/,D={newCue:function(A,b,m,h){for(var d=[],o,a,u,s,i,n=self.VTTCue||self.TextTrackCue,S=0;S<h.rows.length;S++)if(o=h.rows[S],u=!0,s=0,i="",!o.isEmpty()){for(var C=0;C<o.chars.length;C++)F.test(o.chars[C].uchar)&&u?s++:(i+=o.chars[C].uchar,u=!1);o.cueStartTime=b,b===m&&(m+=1e-4),s>=16?s--:s++;var x=Object(B.fixLineBreaks)(i.trim()),w=Object(R.generateCueId)(b,m,x);(!A||!A.cues||!A.cues.getCueById(w))&&(a=new n(b,m,x),a.id=w,a.line=S+1,a.align="left",a.position=10+Math.min(80,Math.floor(s*8/32)*10),d.push(a))}return A&&d.length&&(d.sort(function(T,_){return T.line==="auto"||_.line==="auto"?0:T.line>8&&_.line>8?_.line-T.line:T.line-_.line}),d.forEach(function(T){return Object(P.addCueToTrack)(A,T)})),d}};z.default=D},"./src/utils/discontinuities.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"findFirstFragWithCC",function(){return F}),I.d(z,"shouldAlignOnDiscontinuities",function(){return D}),I.d(z,"findDiscontinuousReferenceFrag",function(){return L}),I.d(z,"adjustSlidingStart",function(){return b}),I.d(z,"alignStream",function(){return m}),I.d(z,"alignPDT",function(){return d}),I.d(z,"alignFragmentByPDTDelta",function(){return o}),I.d(z,"alignMediaPlaylistByPDT",function(){return a});var B=I("./src/polyfills/number.ts"),R=I("./src/utils/logger.ts"),P=I("./src/controller/level-helper.ts");function F(u,s){for(var i=null,n=0,S=u.length;n<S;n++){var C=u[n];if(C&&C.cc===s){i=C;break}}return i}function D(u,s,i){return!!(s.details&&(i.endCC>i.startCC||u&&u.cc<i.startCC))}function L(u,s){var i=u.fragments,n=s.fragments;if(!n.length||!i.length){R.logger.log("No fragments to align");return}var S=F(i,n[0].cc);if(!S||S&&!S.startPTS){R.logger.log("No frag in previous level to align on");return}return S}function A(u,s){if(u){var i=u.start+s;u.start=u.startPTS=i,u.endPTS=i+u.duration}}function b(u,s){for(var i=s.fragments,n=0,S=i.length;n<S;n++)A(i[n],u);s.fragmentHint&&A(s.fragmentHint,u),s.alignedSliding=!0}function m(u,s,i){if(!s)return;h(u,i,s),!i.alignedSliding&&s.details&&d(i,s.details),!i.alignedSliding&&s.details&&!i.skippedSegments&&Object(P.adjustSliding)(s.details,i)}function h(u,s,i){if(D(u,i,s)){var n=L(i.details,s);n&&Object(B.isFiniteNumber)(n.start)&&(R.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),b(n.start,s))}}function d(u,s){if(!s.fragments.length||!u.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=u.fragments[0].programDateTime,S=(n-i)/1e3+s.fragments[0].start;S&&Object(B.isFiniteNumber)(S)&&(R.logger.log("Adjusting PTS using programDateTime delta "+(n-i)+"ms, sliding:"+S.toFixed(3)+" "+u.url+" "),b(S,u))}function o(u,s){var i=u.programDateTime;if(!i)return;var n=(i-s)/1e3;u.start=u.startPTS=n,u.endPTS=n+u.duration}function a(u,s){if(!s.fragments.length||!u.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=s.fragments[0].start,S=i-n*1e3;u.fragments.forEach(function(C){o(C,S)}),u.fragmentHint&&o(u.fragmentHint,S),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/utils/ewma.ts"),R=function(){function P(D,L,A){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=A,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new B.default(D),this.fast_=new B.default(L)}var F=P.prototype;return F.update=function(L,A){var b=this.slow_,m=this.fast_;this.slow_.halfLife!==L&&(this.slow_=new B.default(L,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==A&&(this.fast_=new B.default(A,m.getEstimate(),m.getTotalWeight()))},F.sample=function(L,A){L=Math.max(L,this.minDelayMs_);var b=8*A,m=L/1e3,h=b/m;this.fast_.sample(m,h),this.slow_.sample(m,h)},F.canEstimate=function(){var L=this.fast_;return L&&L.getTotalWeight()>=this.minWeight_},F.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},F.destroy=function(){},P}();z.default=R},"./src/utils/ewma.ts":function(Q,z,I){"use strict";I.r(z);var B=function(){function R(F,D,L){D===void 0&&(D=0),L===void 0&&(L=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=F,this.alpha_=F?Math.exp(Math.log(.5)/F):0,this.estimate_=D,this.totalWeight_=L}var P=R.prototype;return P.sample=function(D,L){var A=Math.pow(this.alpha_,D);this.estimate_=L*(1-A)+A*this.estimate_,this.totalWeight_+=D},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var D=1-Math.pow(this.alpha_,this.totalWeight_);if(D)return this.estimate_/D}return this.estimate_},R}();z.default=B},"./src/utils/fetch-loader.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"fetchSupported",function(){return o});var B=I("./src/polyfills/number.ts"),R=I("./src/loader/load-stats.ts"),P=I("./src/demux/chunk-cache.ts");function F(n,S){n.prototype=Object.create(S.prototype),n.prototype.constructor=n,m(n,S)}function D(n){var S=typeof Map=="function"?new Map:void 0;return D=function(x){if(x===null||!b(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(x))return S.get(x);S.set(x,w)}function w(){return L(x,arguments,h(this).constructor)}return w.prototype=Object.create(x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),m(w,x)},D(n)}function L(n,S,C){return A()?L=Reflect.construct:L=function(w,T,_){var y=[null];y.push.apply(y,T);var f=Function.bind.apply(w,y),c=new f;return _&&m(c,_.prototype),c},L.apply(null,arguments)}function A(){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 b(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function m(n,S){return m=Object.setPrototypeOf||function(x,w){return x.__proto__=w,x},m(n,S)}function h(n){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},h(n)}function d(){return d=Object.assign||function(n){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var x in C)Object.prototype.hasOwnProperty.call(C,x)&&(n[x]=C[x])}return n},d.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var a=function(){function n(C){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=C.fetchSetup||s,this.controller=new self.AbortController,this.stats=new R.LoadStats}var S=n.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(x,w,T){var _=this,y=this.stats;if(y.loading.start)throw new Error("Loader can only be used once.");y.loading.start=self.performance.now();var f=u(x,this.controller.signal),c=T.onProgress,v=x.responseType==="arraybuffer",p=v?"byteLength":"length";this.context=x,this.config=w,this.callbacks=T,this.request=this.fetchSetup(x,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),T.onTimeout(y,x,_.response)},w.timeout),self.fetch(this.request).then(function(E){if(_.response=_.loader=E,!E.ok){var k=E.status,U=E.statusText;throw new i(U||"fetch, bad network response",k,E)}return y.loading.first=Math.max(self.performance.now(),y.loading.start),y.total=parseInt(E.headers.get("Content-Length")||"0"),c&&Object(B.isFiniteNumber)(w.highWaterMark)?_.loadProgressively(E,y,x,w.highWaterMark,c):v?E.arrayBuffer():E.text()}).then(function(E){var k=_.response;self.clearTimeout(_.requestTimeout),y.loading.end=Math.max(self.performance.now(),y.loading.first),y.loaded=y.total=E[p];var U={url:k.url,data:E};c&&!Object(B.isFiniteNumber)(w.highWaterMark)&&c(y,x,E,k),T.onSuccess(U,y,x,k)}).catch(function(E){if(self.clearTimeout(_.requestTimeout),y.aborted)return;var k=E.code||0;T.onError({code:k,text:E.message},x,E.details)})},S.getCacheAge=function(){var x=null;if(this.response){var w=this.response.headers.get("age");x=w?parseFloat(w):null}return x},S.loadProgressively=function(x,w,T,_,y){_===void 0&&(_=0);var f=new P.default,c=x.body.getReader(),v=function p(){return c.read().then(function(E){if(E.done)return f.dataLength&&y(w,T,f.flush(),x),Promise.resolve(new ArrayBuffer(0));var k=E.value,U=k.length;return w.loaded+=U,U<_||f.dataLength?(f.push(k),f.dataLength>=_&&y(w,T,f.flush(),x)):y(w,T,k,x),p()}).catch(function(){return Promise.reject()})};return v()},n}();function u(n,S){var C={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(d({},n.headers))};return n.rangeEnd&&C.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),C}function s(n,S){return new self.Request(n.url,S)}var i=function(n){F(S,n);function S(C,x,w){var T;return T=n.call(this,C)||this,T.code=void 0,T.details=void 0,T.code=x,T.details=w,T}return S}(D(Error));z.default=a},"./src/utils/imsc1-ttml-parser.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"IMSC1_CODEC",function(){return b}),I.d(z,"parseIMSC1",function(){return o});var B=I("./src/utils/mp4-tools.ts"),R=I("./src/utils/vttparser.ts"),P=I("./src/utils/vttcue.ts"),F=I("./src/demux/id3.ts"),D=I("./src/utils/timescale-conversion.ts"),L=I("./src/utils/webvtt-parser.ts");function A(){return A=Object.assign||function(_){for(var y=1;y<arguments.length;y++){var f=arguments[y];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(_[c]=f[c])}return _},A.apply(this,arguments)}var b="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,d={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(_,y,f,c,v){var p=Object(B.findBox)(new Uint8Array(_),["mdat"]);if(p.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var E=p[0],k=Object(F.utf8ArrayToStr)(new Uint8Array(_,E.start,E.end-E.start)),U=Object(D.toTimescaleFromScale)(y,1,f);try{c(a(k,U))}catch(H){v(H)}}function a(_,y){var f=new DOMParser,c=f.parseFromString(_,"text/xml"),v=c.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},E=Object.keys(p).reduce(function(j,O){return j[O]=v.getAttribute("ttp:"+O)||p[O],j},{}),k=v.getAttribute("xml:space")!=="preserve",U=s(u(v,"styling","style")),H=s(u(v,"layout","region")),W=u(v,"body","[begin]");return[].map.call(W,function(j){var O=i(j,k);if(!O||!j.hasAttribute("begin"))return null;var K=x(j.getAttribute("begin"),E),Y=x(j.getAttribute("dur"),E),ee=x(j.getAttribute("end"),E);if(K===null)throw C(j);if(ee===null){if(Y===null)throw C(j);ee=K+Y}var se=new P.default(K-y,ee-y,O);se.id=Object(L.generateCueId)(se.startTime,se.endTime,se.text);var Be=H[j.getAttribute("region")],me=U[j.getAttribute("style")];se.position=10,se.size=80;var xe=n(Be,me),Le=xe.textAlign;if(Le){var Ae=d[Le];Ae&&(se.lineAlign=Ae),se.align=Le}return A(se,xe),se}).filter(function(j){return j!==null})}function u(_,y,f){var c=_.getElementsByTagName(y)[0];return c?[].slice.call(c.querySelectorAll(f)):[]}function s(_){return _.reduce(function(y,f){var c=f.getAttribute("xml:id");return c&&(y[c]=f),y},{})}function i(_,y){return[].slice.call(_.childNodes).reduce(function(f,c,v){var p;return c.nodeName==="br"&&v?f+`
|
|
`:(p=c.childNodes)!==null&&p!==void 0&&p.length?i(c,y):y?f+c.textContent.trim().replace(/\s+/g," "):f+c.textContent},"")}function n(_,y){var f="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(v,p){var E=S(y,f,p)||S(_,f,p);return E&&(v[p]=E),v},{})}function S(_,y,f){return _.hasAttributeNS(y,f)?_.getAttributeNS(y,f):null}function C(_){return new Error("Could not parse ttml timestamp "+_)}function x(_,y){if(!_)return null;var f=Object(R.parseTimeStamp)(_);return f===null&&(m.test(_)?f=w(_,y):h.test(_)&&(f=T(_,y))),f}function w(_,y){var f=m.exec(_),c=(f[4]|0)+(f[5]|0)/y.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+c/y.frameRate}function T(_,y){var f=h.exec(_),c=Number(f[1]),v=f[2];switch(v){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/y.frameRate;case"t":return c/y.tickRate}return c}},"./src/utils/logger.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"enableLogs",function(){return L}),I.d(z,"logger",function(){return A});var B=function(){},R={trace:B,debug:B,log:B,warn:B,info:B,error:B},P=R;function F(b){var m=self.console[b];return m?m.bind(self.console,"["+b+"] >"):B}function D(b){for(var m=arguments.length,h=new Array(m>1?m-1:0),d=1;d<m;d++)h[d-1]=arguments[d];h.forEach(function(o){P[o]=b[o]?b[o].bind(b):F(o)})}function L(b){if(self.console&&b===!0||typeof b=="object"){D(b,"debug","log","info","warn","error");try{P.log()}catch(m){P=R}}else P=R}var A=P},"./src/utils/mediakeys-helper.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"KeySystems",function(){return B}),I.d(z,"requestMediaKeySystemAccess",function(){return R});var B;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})(B||(B={}));var R=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"getMediaSource",function(){return B});function B(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"bin2str",function(){return D}),I.d(z,"readUint16",function(){return L}),I.d(z,"readUint32",function(){return A}),I.d(z,"writeUint32",function(){return b}),I.d(z,"findBox",function(){return m}),I.d(z,"parseSegmentIndex",function(){return h}),I.d(z,"parseInitSegment",function(){return d}),I.d(z,"getStartDTS",function(){return o}),I.d(z,"getDuration",function(){return a}),I.d(z,"computeRawDurationFromSamples",function(){return u}),I.d(z,"offsetStartDTS",function(){return s}),I.d(z,"segmentValidRange",function(){return i}),I.d(z,"appendUint8Array",function(){return n});var B=I("./src/utils/typed-array.ts"),R=I("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,F=[].push;function D(S){return String.fromCharCode.apply(null,S)}function L(S,C){"data"in S&&(C+=S.start,S=S.data);var x=S[C]<<8|S[C+1];return x<0?65536+x:x}function A(S,C){"data"in S&&(C+=S.start,S=S.data);var x=S[C]<<24|S[C+1]<<16|S[C+2]<<8|S[C+3];return x<0?4294967296+x:x}function b(S,C,x){"data"in S&&(C+=S.start,S=S.data),S[C]=x>>24,S[C+1]=x>>16&255,S[C+2]=x>>8&255,S[C+3]=x&255}function m(S,C){var x=[];if(!C.length)return x;var w,T,_;"data"in S?(w=S.data,T=S.start,_=S.end):(w=S,T=0,_=w.byteLength);for(var y=T;y<_;){var f=A(w,y),c=D(w.subarray(y+4,y+8)),v=f>1?y+f:_;if(c===C[0])if(C.length===1)x.push({data:w,start:y+8,end:v});else{var p=m({data:w,start:y+8,end:v},C.slice(1));p.length&&F.apply(x,p)}y=v}return x}function h(S){var C=m(S,["moov"]),x=C[0],w=x?x.end:null,T=m(S,["sidx"]);if(!T||!T[0])return null;var _=[],y=T[0],f=y.data[0],c=f===0?8:16,v=A(y,c);c+=4;var p=0,E=0;f===0?c+=8:c+=16,c+=2;var k=y.end+E,U=L(y,c);c+=2;for(var H=0;H<U;H++){var W=c,j=A(y,W);W+=4;var O=j&2147483647,K=(j&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Y=A(y,W);W+=4,_.push({referenceSize:O,subsegmentDuration:Y,info:{duration:Y/v,start:k,end:k+O-1}}),k+=O,W+=4,c=W}return{earliestPresentationTime:p,timescale:v,version:f,referencesCount:U,references:_,moovEndOffset:w}}function d(S){for(var C=[],x=m(S,["moov","trak"]),w=0;w<x.length;w++){var T=x[w],_=m(T,["tkhd"])[0];if(_){var y=_.data[_.start],f=y===0?12:20,c=A(_,f),v=m(T,["mdia","mdhd"])[0];if(v){y=v.data[v.start],f=y===0?12:20;var p=A(v,f),E=m(T,["mdia","hdlr"])[0];if(E){var k=D(E.data.subarray(E.start+8,E.start+12)),U={soun:R.ElementaryStreamTypes.AUDIO,vide:R.ElementaryStreamTypes.VIDEO}[k];if(U){var H=m(T,["mdia","minf","stbl","stsd"])[0],W=void 0;H&&(W=D(H.data.subarray(H.start+12,H.start+16))),C[c]={timescale:p,type:U},C[U]={timescale:p,id:c,codec:W}}}}}}var j=m(S,["moov","mvex","trex"]);return j.forEach(function(O){var K=A(O,4),Y=C[K];Y&&(Y.default={duration:A(O,12),flags:A(O,20)})}),C}function o(S,C){return m(C,["moof","traf"]).reduce(function(x,w){var T=m(w,["tfdt"])[0],_=T.data[T.start],y=m(w,["tfhd"]).reduce(function(f,c){var v=A(c,4),p=S[v];if(p){var E=A(T,4);_===1&&(E*=Math.pow(2,32),E+=A(T,8));var k=p.timescale||9e4,U=E/k;if(isFinite(U)&&(f===null||U<f))return U}return f},null);return y!==null&&isFinite(y)&&(x===null||y<x)?y:x},null)||0}function a(S,C){for(var x=0,w=0,T=0,_=m(S,["moof","traf"]),y=0;y<_.length;y++){var f=_[y],c=m(f,["tfhd"])[0],v=A(c,4),p=C[v];if(!p)continue;var E=p.default,k=A(c,0)|(E==null?void 0:E.flags),U=E==null?void 0:E.duration;k&8&&(k&2?U=A(c,12):U=A(c,8));for(var H=p.timescale||9e4,W=m(f,["trun"]),j=0;j<W.length;j++){if(U){var O=A(W[j],4);x=U*O}else x=u(W[j]);p.type===R.ElementaryStreamTypes.VIDEO?w+=x/H:p.type===R.ElementaryStreamTypes.AUDIO&&(T+=x/H)}}if(w===0&&T===0){var K=h(S);if(K!=null&&K.references)return K.references.reduce(function(Y,ee){return Y+ee.info.duration||0},0)}return w||T}function u(S){var C=A(S,0),x=8;C&1&&(x+=4),C&4&&(x+=4);for(var w=0,T=A(S,4),_=0;_<T;_++){if(C&256){var y=A(S,x);w+=y,x+=4}C&512&&(x+=4),C&1024&&(x+=4),C&2048&&(x+=4)}return w}function s(S,C,x){m(C,["moof","traf"]).forEach(function(w){m(w,["tfhd"]).forEach(function(T){var _=A(T,4),y=S[_];if(!y)return;var f=y.timescale||9e4;m(w,["tfdt"]).forEach(function(c){var v=c.data[c.start],p=A(c,4);if(v===0)b(c,4,p-x*f);else{p*=Math.pow(2,32),p+=A(c,8),p-=x*f,p=Math.max(p,0);var E=Math.floor(p/(P+1)),k=Math.floor(p%(P+1));b(c,4,E),b(c,8,k)}})})})}function i(S){var C={valid:null,remainder:null},x=m(S,["moof"]);if(x){if(x.length<2)return C.remainder=S,C}else return C;var w=x[x.length-1];return C.valid=Object(B.sliceUint8)(S,0,w.start-8),C.remainder=Object(B.sliceUint8)(S,w.start-8),C}function n(S,C){var x=new Uint8Array(S.length+C.length);return x.set(S),x.set(C,S.length),x}},"./src/utils/output-filter.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"default",function(){return B});var B=function(){function R(F,D){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=F,this.trackName=D}var P=R.prototype;return P.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},P.newCue=function(D,L,A){(this.startTime===null||this.startTime>D)&&(this.startTime=D),this.endTime=L,this.screen=A,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},R}()},"./src/utils/texttrack-utils.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"sendAddTrackEvent",function(){return R}),I.d(z,"addCueToTrack",function(){return P}),I.d(z,"clearCurrentCues",function(){return F}),I.d(z,"removeCuesInRange",function(){return D}),I.d(z,"getCuesInRange",function(){return A});var B=I("./src/utils/logger.ts");function R(b,m){var h;try{h=new Event("addtrack")}catch(d){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=b,m.dispatchEvent(h)}function P(b,m){var h=b.mode;if(h==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(m.id))try{if(b.addCue(m),!b.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(o){B.logger.debug("[texttrack-utils]: "+o);var d=new self.TextTrackCue(m.startTime,m.endTime,m.text);d.id=m.id,b.addCue(d)}h==="disabled"&&(b.mode=h)}function F(b){var m=b.mode;if(m==="disabled"&&(b.mode="hidden"),b.cues)for(var h=b.cues.length;h--;)b.removeCue(b.cues[h]);m==="disabled"&&(b.mode=m)}function D(b,m,h){var d=b.mode;if(d==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var o=A(b.cues,m,h),a=0;a<o.length;a++)b.removeCue(o[a]);d==="disabled"&&(b.mode=d)}function L(b,m){if(m<b[0].startTime)return 0;var h=b.length-1;if(m>b[h].endTime)return-1;for(var d=0,o=h;d<=o;){var a=Math.floor((o+d)/2);if(m<b[a].startTime)o=a-1;else if(m>b[a].startTime&&d<h)d=a+1;else return a}return b[d].startTime-m<m-b[o].startTime?d:o}function A(b,m,h){var d=[],o=L(b,m);if(o>-1)for(var a=o,u=b.length;a<u;a++){var s=b[a];if(s.startTime>=m&&s.endTime<=h)d.push(s);else if(s.startTime>h)return d}return d}},"./src/utils/time-ranges.ts":function(Q,z,I){"use strict";I.r(z);var B={toString:function(P){for(var F="",D=P.length,L=0;L<D;L++)F+="["+P.start(L).toFixed(3)+","+P.end(L).toFixed(3)+"]";return F}};z.default=B},"./src/utils/timescale-conversion.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"toTimescaleFromBase",function(){return R}),I.d(z,"toTimescaleFromScale",function(){return P}),I.d(z,"toMsFromMpegTsClock",function(){return F}),I.d(z,"toMpegTsClockFromTimescale",function(){return D});var B=9e4;function R(L,A,b,m){b===void 0&&(b=1),m===void 0&&(m=!1);var h=L*A*b;return m?Math.round(h):h}function P(L,A,b,m){return b===void 0&&(b=1),m===void 0&&(m=!1),R(L,A,1/b,m)}function F(L,A){return A===void 0&&(A=!1),R(L,1e3,1/B,A)}function D(L,A){return A===void 0&&(A=1),R(L,B,1/A)}},"./src/utils/typed-array.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"sliceUint8",function(){return B});function B(R,P,F){return Uint8Array.prototype.slice?R.slice(P,F):new Uint8Array(Array.prototype.slice.call(R,P,F))}},"./src/utils/vttcue.ts":function(Q,z,I){"use strict";I.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var B=["","lr","rl"],R=["start","middle","end","left","right"];function P(b,m){if(typeof m!="string")return!1;if(!Array.isArray(b))return!1;var h=m.toLowerCase();return~b.indexOf(h)?h:!1}function F(b){return P(B,b)}function D(b){return P(R,b)}function L(b){for(var m=arguments.length,h=new Array(m>1?m-1:0),d=1;d<m;d++)h[d-1]=arguments[d];for(var o=1;o<arguments.length;o++){var a=arguments[o];for(var u in a)b[u]=a[u]}return b}function A(b,m,h){var d=this,o={enumerable:!0};d.hasBeenReset=!1;var a="",u=!1,s=b,i=m,n=h,S=null,C="",x=!0,w="auto",T="start",_=50,y="middle",f=50,c="middle";Object.defineProperty(d,"id",L({},o,{get:function(){return a},set:function(p){a=""+p}})),Object.defineProperty(d,"pauseOnExit",L({},o,{get:function(){return u},set:function(p){u=!!p}})),Object.defineProperty(d,"startTime",L({},o,{get:function(){return s},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");s=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"endTime",L({},o,{get:function(){return i},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");i=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"text",L({},o,{get:function(){return n},set:function(p){n=""+p,this.hasBeenReset=!0}})),Object.defineProperty(d,"region",L({},o,{get:function(){return S},set:function(p){S=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"vertical",L({},o,{get:function(){return C},set:function(p){var E=F(p);if(E===!1)throw new SyntaxError("An invalid or illegal string was specified.");C=E,this.hasBeenReset=!0}})),Object.defineProperty(d,"snapToLines",L({},o,{get:function(){return x},set:function(p){x=!!p,this.hasBeenReset=!0}})),Object.defineProperty(d,"line",L({},o,{get:function(){return w},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"lineAlign",L({},o,{get:function(){return T},set:function(p){var E=D(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");T=E,this.hasBeenReset=!0}})),Object.defineProperty(d,"position",L({},o,{get:function(){return _},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");_=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",L({},o,{get:function(){return y},set:function(p){var E=D(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");y=E,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",L({},o,{get:function(){return f},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");f=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",L({},o,{get:function(){return c},set:function(p){var E=D(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");c=E,this.hasBeenReset=!0}})),d.displayState=void 0}return A.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},A}()},"./src/utils/vttparser.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"parseTimeStamp",function(){return P}),I.d(z,"fixLineBreaks",function(){return m}),I.d(z,"VTTParser",function(){return h});var B=I("./src/utils/vttcue.ts"),R=function(){function d(){}var o=d.prototype;return o.decode=function(u,s){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},d}();function P(d){function o(u,s,i,n){return(u|0)*3600+(s|0)*60+(i|0)+parseFloat(n||0)}var a=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return a?parseFloat(a[2])>59?o(a[2],a[3],0,a[4]):o(a[1],a[2],a[3],a[4]):null}var F=function(){function d(){this.values=Object.create(null)}var o=d.prototype;return o.set=function(u,s){!this.get(u)&&s!==""&&(this.values[u]=s)},o.get=function(u,s,i){return i?this.has(u)?this.values[u]:s[i]:this.has(u)?this.values[u]:s},o.has=function(u){return u in this.values},o.alt=function(u,s,i){for(var n=0;n<i.length;++n)if(s===i[n]){this.set(u,s);break}},o.integer=function(u,s){/^-?\d+$/.test(s)&&this.set(u,parseInt(s,10))},o.percent=function(u,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var i=parseFloat(s);if(i>=0&&i<=100)return this.set(u,i),!0}return!1},d}();function D(d,o,a,u){var s=u?d.split(u):[d];for(var i in s){if(typeof s[i]!="string")continue;var n=s[i].split(a);if(n.length!==2)continue;var S=n[0],C=n[1];o(S,C)}}var L=new B.default(0,0,""),A=L.align==="middle"?"middle":"center";function b(d,o,a){var u=d;function s(){var S=P(d);if(S===null)throw new Error("Malformed timestamp: "+u);return d=d.replace(/^[^\sa-zA-Z-]+/,""),S}function i(S,C){var x=new F;D(S,function(_,y){var f;switch(_){case"region":for(var c=a.length-1;c>=0;c--)if(a[c].id===y){x.set(_,a[c].region);break}break;case"vertical":x.alt(_,y,["rl","lr"]);break;case"line":f=y.split(","),x.integer(_,f[0]),x.percent(_,f[0])&&x.set("snapToLines",!1),x.alt(_,f[0],["auto"]),f.length===2&&x.alt("lineAlign",f[1],["start",A,"end"]);break;case"position":f=y.split(","),x.percent(_,f[0]),f.length===2&&x.alt("positionAlign",f[1],["start",A,"end","line-left","line-right","auto"]);break;case"size":x.percent(_,y);break;case"align":x.alt(_,y,["start",A,"end","left","right"]);break}},/:/,/\s/),C.region=x.get("region",null),C.vertical=x.get("vertical","");var w=x.get("line","auto");w==="auto"&&L.line===-1&&(w=-1),C.line=w,C.lineAlign=x.get("lineAlign","start"),C.snapToLines=x.get("snapToLines",!0),C.size=x.get("size",100),C.align=x.get("align",A);var T=x.get("position","auto");T==="auto"&&L.position===50&&(T=C.align==="start"||C.align==="left"?0:C.align==="end"||C.align==="right"?100:50),C.position=T}function n(){d=d.replace(/^\s+/,"")}if(n(),o.startTime=s(),n(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);d=d.substr(3),n(),o.endTime=s(),n(),i(d,o)}function m(d){return d.replace(/<br(?: \/)?>/gi,`
|
|
`)}var h=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new R,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=d.prototype;return o.parse=function(u){var s=this;u&&(s.buffer+=s.decoder.decode(u,{stream:!0}));function i(){var T=s.buffer,_=0;for(T=m(T);_<T.length&&T[_]!=="\r"&&T[_]!==`
|
|
`;)++_;var y=T.substr(0,_);return T[_]==="\r"&&++_,T[_]===`
|
|
`&&++_,s.buffer=T.substr(_),y}function n(T){D(T,function(_,y){},/:/)}try{var S="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;S=i();var C=S.match(/^()?WEBVTT([ \t].*)?$/);if(!C||!C[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var x=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;x?x=!1:S=i();switch(s.state){case"HEADER":/:/.test(S)?n(S):S||(s.state="ID");continue;case"NOTE":S||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){s.state="NOTE";break}if(!S)continue;if(s.cue=new B.default(0,0,""),s.state="CUE",S.indexOf("-->")===-1){s.cue.id=S;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{b(S,s.cue,s.regionList)}catch(T){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var w=S.indexOf("-->")!==-1;if(!S||w&&(x=!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+=S}continue;case"BADCUE":S||(s.state="ID")}}}catch(T){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
|
|
|
|
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){u.onparsingerror&&u.onparsingerror(s)}return u.onflush&&u.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(Q,z,I){"use strict";I.r(z),I.d(z,"generateCueId",function(){return h}),I.d(z,"parseWebVTT",function(){return o});var B=I("./src/polyfills/number.ts"),R=I("./src/utils/vttparser.ts"),P=I("./src/demux/id3.ts"),F=I("./src/utils/timescale-conversion.ts"),D=I("./src/remux/mp4-remuxer.ts"),L=/\r\n|\n\r|\n|\r/g,A=function(u,s,i){return i===void 0&&(i=0),u.substr(i,s.length)===s},b=function(u){var s=parseInt(u.substr(-3)),i=parseInt(u.substr(-6,2)),n=parseInt(u.substr(-9,2)),S=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(B.isFiniteNumber)(s)||!Object(B.isFiniteNumber)(i)||!Object(B.isFiniteNumber)(n)||!Object(B.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return s+=1e3*i,s+=60*1e3*n,s+=60*60*1e3*S,s},m=function(u){for(var s=5381,i=u.length;i;)s=s*33^u.charCodeAt(--i);return(s>>>0).toString()};function h(a,u,s){return m(a.toString())+m(u.toString())+m(s)}var d=function(u,s,i){var n=u[s],S=u[n.prevCC];if(!S||!S.new&&n.new){u.ccOffset=u.presentationOffset=n.start,n.new=!1;return}for(;(C=S)!==null&&C!==void 0&&C.new;){var C;u.ccOffset+=n.start-S.start,n.new=!1,n=S,S=u[n.prevCC]}u.presentationOffset=i};function o(a,u,s,i,n,S,C,x){var w=new R.VTTParser,T=Object(P.utf8ArrayToStr)(new Uint8Array(a)).trim().replace(L,`
|
|
`).split(`
|
|
`),_=[],y=Object(F.toMpegTsClockFromTimescale)(u,s),f="00:00.000",c=0,v=0,p,E=!0,k=!1;w.oncue=function(U){var H=i[n],W=i.ccOffset,j=(c-y)/9e4;if(H!=null&&H.new&&(v!==void 0?W=i.ccOffset=H.start:d(i,n,j)),j&&(W=j-i.presentationOffset),k){var O=U.endTime-U.startTime,K=Object(D.normalizePts)((U.startTime+W-v)*9e4,S*9e4)/9e4;U.startTime=K,U.endTime=K+O}var Y=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(Y)),U.id||(U.id=h(U.startTime,U.endTime,Y)),U.endTime>0&&_.push(U)},w.onparsingerror=function(U){p=U},w.onflush=function(){if(p){x(p);return}C(_)},T.forEach(function(U){if(E)if(A(U,"X-TIMESTAMP-MAP=")){E=!1,k=!0,U.substr(16).split(",").forEach(function(H){A(H,"LOCAL:")?f=H.substr(6):A(H,"MPEGTS:")&&(c=parseInt(H.substr(7)))});try{v=b(f)/1e3}catch(H){k=!1,p=H}return}else U===""&&(E=!1);w.parse(U+`
|
|
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(Q,z,I){"use strict";I.r(z);var B=I("./src/utils/logger.ts"),R=I("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,F=function(){function D(A){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=A?A.xhrSetup:null,this.stats=new R.LoadStats,this.retryDelay=0}var L=D.prototype;return L.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},L.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},L.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},L.load=function(b,m,h){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=m,this.callbacks=h,this.retryDelay=m.retryDelay,this.loadInternal()},L.loadInternal=function(){var b=this.config,m=this.context;if(!b)return;var h=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var o=this.xhrSetup;try{if(o)try{o(h,m.url)}catch(s){h.open("GET",m.url,!0),o(h,m.url)}h.readyState||h.open("GET",m.url,!0);var a=this.context.headers;if(a)for(var u in a)h.setRequestHeader(u,a[u])}catch(s){this.callbacks.onError({code:h.status,text:s.message},m,h);return}m.rangeEnd&&h.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),h.send()},L.readystatechange=function(){var b=this.context,m=this.loader,h=this.stats;if(!b||!m)return;var d=m.readyState,o=this.config;if(h.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),d===4){m.onreadystatechange=null,m.onprogress=null;var a=m.status;if(a>=200&&a<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var u,s;if(b.responseType==="arraybuffer"?(u=m.response,s=u.byteLength):(u=m.responseText,s=u.length),h.loaded=h.total=s,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(h,b,u,m),!this.callbacks)return;var n={url:m.responseURL,data:u};this.callbacks.onSuccess(n,h,b,m)}else h.retry>=o.maxRetry||a>=400&&a<499?(B.logger.error(a+" while loading "+b.url),this.callbacks.onError({code:a,text:m.statusText},b,m)):(B.logger.warn(a+" while loading "+b.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},L.loadtimeout=function(){B.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},L.loadprogress=function(b){var m=this.stats;m.loaded=b.loaded,b.lengthComputable&&(m.total=b.total)},L.getCacheAge=function(){var b=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");b=m?parseFloat(m):null}return b},D}();z.default=F}}).default})},vHTk:function(zt,Ke,M){zt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return sn});var Q=M("rePB"),z=M("VTBJ"),I=M("KQm4"),B=M("U8pU"),R=M("ODXe"),P=M("cDcd"),F=M("TSYQ"),D=M.n(F),L=M("Gytx"),A=M.n(L),b=M("Kwbf"),m=M("t23M"),h=M("qx4F"),d=M("6eGT"),o=M("IBYe"),a=M("Ff2n"),u=M("c+Xe"),s=M("fyJ8"),i=M("biw7");function n(ke,Pe,rt,ht,Ue){var ut=rt[ke]||{},Ee=rt[Pe]||{},ce,he;ut.fixed==="left"?ce=ht.left[ke]:Ee.fixed==="right"&&(he=ht.right[Pe]);var J=!1,Z=!1,re=!1,ue=!1,de=rt[Pe+1],Ne=rt[ke-1];if(Ue==="rtl"){if(ce!==void 0){var ct=Ne&&Ne.fixed==="left";ue=!ct}else if(he!==void 0){var Gt=de&&de.fixed==="right";re=!Gt}}else if(ce!==void 0){var an=de&&de.fixed==="left";J=!an}else if(he!==void 0){var it=Ne&&Ne.fixed==="right";Z=!it}return{fixLeft:ce,fixRight:he,lastFixLeft:J,firstFixRight:Z,lastFixRight:re,firstFixLeft:ue,isSticky:ht.isSticky}}var S=M("sR1s");function C(ke){var Pe=ke.cells,rt=ke.stickyOffsets,ht=ke.flattenColumns,Ue=ke.rowComponent,ut=ke.cellComponent,Ee=ke.onHeaderRow,ce=ke.index,he=P.useContext(i.a),J=he.prefixCls,Z=he.direction,re;Ee&&(re=Ee(Pe.map(function(de){return de.column}),ce));var ue=Object(S.a)(Pe.map(function(de){return de.column}));return P.createElement(Ue,Object.assign({},re),Pe.map(function(de,Ne){var ct=de.column,Gt=n(de.colStart,de.colEnd,ht,rt,Z),an;return ct&&ct.onHeaderCell&&(an=de.column.onHeaderCell(ct)),P.createElement(s.a,Object.assign({},de,{ellipsis:ct.ellipsis,align:ct.align,component:ut,prefixCls:J,key:ue[Ne]},Gt,{additionalProps:an,rowType:"header"}))}))}C.displayName="HeaderRow";var x=C;function w(ke){var Pe=[];function rt(Ee,ce){var he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Pe[he]=Pe[he]||[];var J=ce,Z=Ee.filter(Boolean).map(function(re){var ue={key:re.key,className:re.className||"",children:re.title,column:re,colStart:J},de=1,Ne=re.children;return Ne&&Ne.length>0&&(de=rt(Ne,J,he+1).reduce(function(ct,Gt){return ct+Gt},0),ue.hasSubColumns=!0),"colSpan"in re&&(de=re.colSpan),"rowSpan"in re&&(ue.rowSpan=re.rowSpan),ue.colSpan=de,ue.colEnd=ue.colStart+de-1,Pe[he].push(ue),J+=de,de});return Z}rt(ke,0);for(var ht=Pe.length,Ue=function(ce){Pe[ce].forEach(function(he){!("rowSpan"in he)&&!he.hasSubColumns&&(he.rowSpan=ht-ce)})},ut=0;ut<ht;ut+=1)Ue(ut);return Pe}function T(ke){var Pe=ke.stickyOffsets,rt=ke.columns,ht=ke.flattenColumns,Ue=ke.onHeaderRow,ut=P.useContext(i.a),Ee=ut.prefixCls,ce=ut.getComponent,he=P.useMemo(function(){return w(rt)},[rt]),J=ce(["header","wrapper"],"thead"),Z=ce(["header","row"],"tr"),re=ce(["header","cell"],"th");return P.createElement(J,{className:"".concat(Ee,"-thead")},he.map(function(ue,de){var Ne=P.createElement(x,{key:de,flattenColumns:ht,cells:ue,stickyOffsets:Pe,rowComponent:Z,cellComponent:re,onHeaderRow:Ue,index:de});return Ne}))}var _=T,y=M("hW8S");function f(ke){for(var Pe=ke.colWidths,rt=ke.columns,ht=ke.columCount,Ue=[],ut=ht||rt.length,Ee=!1,ce=ut-1;ce>=0;ce-=1){var he=Pe[ce],J=rt&&rt[ce],Z=J&&J[y.a];(he||Z||Ee)&&(Ue.unshift(P.createElement("col",Object.assign({key:ce,style:{width:he,minWidth:he}},Z))),Ee=!0)}return P.createElement("colgroup",null,Ue)}var c=f;function v(ke,Pe){return Object(P.useMemo)(function(){for(var rt=[],ht=0;ht<Pe;ht+=1){var Ue=ke[ht];if(Ue!==void 0)rt[ht]=Ue;else return null}return rt},[ke.join("_"),Pe])}var p=P.forwardRef(function(ke,Pe){var rt=ke.noData,ht=ke.columns,Ue=ke.flattenColumns,ut=ke.colWidths,Ee=ke.columCount,ce=ke.stickyOffsets,he=ke.direction,J=ke.fixHeader,Z=ke.offsetHeader,re=ke.stickyClassName,ue=ke.onScroll,de=Object(a.a)(ke,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ne=P.useContext(i.a),ct=Ne.prefixCls,Gt=Ne.scrollbarSize,an=Ne.isSticky,it=an&&!J?0:Gt,qt=P.useRef(null),st=P.useCallback(function(Bt){Object(u.b)(Pe,Bt),Object(u.b)(qt,Bt)},[]);P.useEffect(function(){var Bt;function Qt(Ce){var De=Ce.currentTarget,mt=Ce.deltaX;mt&&(ue({currentTarget:De,scrollLeft:De.scrollLeft+mt}),Ce.preventDefault())}return(Bt=qt.current)===null||Bt===void 0||Bt.addEventListener("wheel",Qt),function(){var Ce;(Ce=qt.current)===null||Ce===void 0||Ce.removeEventListener("wheel",Qt)}},[]);var pt=Ue[Ue.length-1],Qe={fixed:pt?pt.fixed:null,onHeaderCell:function(){return{className:"".concat(ct,"-cell-scrollbar")}}},ie=Object(P.useMemo)(function(){return it?[].concat(Object(I.a)(ht),[Qe]):ht},[it,ht]),be=Object(P.useMemo)(function(){return it?[].concat(Object(I.a)(Ue),[Qe]):Ue},[it,Ue]),Ot=Object(P.useMemo)(function(){var Bt=ce.right,Qt=ce.left;return Object(z.a)(Object(z.a)({},ce),{},{left:he==="rtl"?[].concat(Object(I.a)(Qt.map(function(Ce){return Ce+it})),[0]):Qt,right:he==="rtl"?Bt:[].concat(Object(I.a)(Bt.map(function(Ce){return Ce+it})),[0]),isSticky:an})},[it,ce,an]),qe=v(ut,Ee);return P.createElement("div",{style:Object(z.a)({overflow:"hidden"},an?{top:Z}:{}),ref:st,className:D()("".concat(ct,"-header"),Object(Q.a)({},re,!!re))},P.createElement("table",{style:{tableLayout:"fixed",visibility:rt||qe?null:"hidden"}},P.createElement(c,{colWidths:qe?[].concat(Object(I.a)(qe),[it]):[],columCount:Ee+1,columns:be}),P.createElement(_,Object.assign({},de,{stickyOffsets:Ot,columns:ie,flattenColumns:be}))))});p.displayName="FixedHeader";var E=p,k=P.createContext(null),U=k;function H(ke){var Pe=ke.prefixCls,rt=ke.children,ht=ke.component,Ue=ke.cellComponent,ut=ke.fixHeader,Ee=ke.fixColumn,ce=ke.horizonScroll,he=ke.className,J=ke.expanded,Z=ke.componentWidth,re=ke.colSpan,ue=P.useContext(i.a),de=ue.scrollbarSize;return P.useMemo(function(){var Ne=rt;return Ee&&(Ne=P.createElement("div",{style:{width:Z-(ut?de:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Pe,"-expanded-row-fixed")},Ne)),P.createElement(ht,{className:he,style:{display:J?null:"none"}},P.createElement(s.a,{component:Ue,prefixCls:Pe,colSpan:re},Ne))},[rt,ht,ut,ce,he,J,Z,re,de])}var W=H;function j(ke){var Pe=ke.className,rt=ke.style,ht=ke.record,Ue=ke.index,ut=ke.rowKey,Ee=ke.getRowKey,ce=ke.rowExpandable,he=ke.expandedKeys,J=ke.onRow,Z=ke.indent,re=Z===void 0?0:Z,ue=ke.rowComponent,de=ke.cellComponent,Ne=ke.childrenColumnName,ct=P.useContext(i.a),Gt=ct.prefixCls,an=ct.fixedInfoList,it=P.useContext(U),qt=it.fixHeader,st=it.fixColumn,pt=it.horizonScroll,Qe=it.componentWidth,ie=it.flattenColumns,be=it.expandableType,Ot=it.expandRowByClick,qe=it.onTriggerExpand,Bt=it.rowClassName,Qt=it.expandedRowClassName,Ce=it.indentSize,De=it.expandIcon,mt=it.expandedRowRender,Jt=it.expandIconColumnIndex,cn=P.useState(!1),wn=Object(R.a)(cn,2),sa=wn[0],zn=wn[1],En=he&&he.has(ke.recordKey);P.useEffect(function(){En&&zn(!0)},[En]);var ga=be==="row"&&(!ce||ce(ht)),Ua=be==="nest",ta=Ne&&ht&&ht[Ne],la=ga||Ua,Ra;J&&(Ra=J(ht,Ue));var Xa=function(Kn){if(Ot&&la&&qe(ht,Kn),Ra&&Ra.onClick){for(var pr,on=arguments.length,qa=new Array(on>1?on-1:0),Ka=1;Ka<on;Ka++)qa[Ka-1]=arguments[Ka];(pr=Ra).onClick.apply(pr,[Kn].concat(qa))}},vr;typeof Bt=="string"?vr=Bt:typeof Bt=="function"&&(vr=Bt(ht,Ue,re));var rn=Object(S.a)(ie),Xn=P.createElement(ue,Object.assign({},Ra,{"data-row-key":ut,className:D()(Pe,"".concat(Gt,"-row"),"".concat(Gt,"-row-level-").concat(re),vr,Ra&&Ra.className),style:Object(z.a)(Object(z.a)({},rt),Ra?Ra.style:null),onClick:Xa}),ie.map(function(Aa,Kn){var pr=Aa.render,on=Aa.dataIndex,qa=Aa.className,Ka=rn[Kn],Tr=an[Kn],mr;Kn===(Jt||0)&&Ua&&(mr=P.createElement(P.Fragment,null,P.createElement("span",{style:{paddingLeft:"".concat(Ce*re,"px")},className:"".concat(Gt,"-row-indent indent-level-").concat(re)}),De({prefixCls:Gt,expanded:En,expandable:ta,record:ht,onExpand:qe})));var nr;return Aa.onCell&&(nr=Aa.onCell(ht,Ue)),P.createElement(s.a,Object.assign({className:qa,ellipsis:Aa.ellipsis,align:Aa.align,component:de,prefixCls:Gt,key:Ka,record:ht,index:Ue,dataIndex:on,render:pr,shouldCellUpdate:Aa.shouldCellUpdate},Tr,{appendNode:mr,additionalProps:nr}))})),hr;if(ga&&(sa||En)){var xr=mt(ht,Ue,re+1,En),$a=Qt&&Qt(ht,Ue,re);hr=P.createElement(W,{expanded:En,className:D()("".concat(Gt,"-expanded-row"),"".concat(Gt,"-expanded-row-level-").concat(re+1),$a),prefixCls:Gt,fixHeader:qt,fixColumn:st,horizonScroll:pt,component:ue,componentWidth:Qe,cellComponent:de,colSpan:ie.length},xr)}var Ga;return ta&&En&&(Ga=(ht[Ne]||[]).map(function(Aa,Kn){var pr=Ee(Aa,Kn);return P.createElement(j,Object.assign({},ke,{key:pr,rowKey:pr,record:Aa,recordKey:pr,index:Kn,indent:re+1}))})),P.createElement(P.Fragment,null,Xn,hr,Ga)}j.displayName="BodyRow";var O=j,K=P.createContext(null),Y=K;function ee(ke){var Pe=ke.columnKey,rt=ke.onColumnResize,ht=P.useRef();return P.useEffect(function(){ht.current&&rt(Pe,ht.current.offsetWidth)},[]),P.createElement(m.a,{onResize:function(ut){var Ee=ut.offsetWidth;rt(Pe,Ee)}},P.createElement("td",{ref:ht,style:{padding:0,border:0,height:0}},P.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function se(ke){var Pe=ke.data,rt=ke.getRowKey,ht=ke.measureColumnWidth,Ue=ke.expandedKeys,ut=ke.onRow,Ee=ke.rowExpandable,ce=ke.emptyNode,he=ke.childrenColumnName,J=P.useContext(Y),Z=J.onColumnResize,re=P.useContext(i.a),ue=re.prefixCls,de=re.getComponent,Ne=P.useContext(U),ct=Ne.fixHeader,Gt=Ne.horizonScroll,an=Ne.flattenColumns,it=Ne.componentWidth;return P.useMemo(function(){var qt=de(["body","wrapper"],"tbody"),st=de(["body","row"],"tr"),pt=de(["body","cell"],"td"),Qe;Pe.length?Qe=Pe.map(function(be,Ot){var qe=rt(be,Ot);return P.createElement(O,{key:qe,rowKey:qe,record:be,recordKey:qe,index:Ot,rowComponent:st,cellComponent:pt,expandedKeys:Ue,onRow:ut,getRowKey:rt,rowExpandable:Ee,childrenColumnName:he})}):Qe=P.createElement(W,{expanded:!0,className:"".concat(ue,"-placeholder"),prefixCls:ue,fixHeader:ct,fixColumn:Gt,horizonScroll:Gt,component:st,componentWidth:it,cellComponent:pt,colSpan:an.length},ce);var ie=Object(S.a)(an);return P.createElement(qt,{className:"".concat(ue,"-tbody")},ht&&P.createElement("tr",{"aria-hidden":"true",className:"".concat(ue,"-measure-row"),style:{height:0}},ie.map(function(be){return P.createElement(ee,{key:be,columnKey:be,onColumnResize:Z})})),Qe)},[Pe,ue,ut,ht,Ue,rt,de,it,ce,an])}var Be=P.memo(se);Be.displayName="Body";var me=Be,xe=M("wRmb"),Le=M("xEkU"),Ae=M.n(Le);function le(ke){var Pe=Object(P.useRef)(ke),rt=Object(P.useState)({}),ht=Object(R.a)(rt,2),Ue=ht[1],ut=Object(P.useRef)(null),Ee=Object(P.useRef)([]);function ce(he){ut.current===null&&(Ee.current=[],ut.current=Ae()(function(){Ee.current.forEach(function(J){Pe.current=J(Pe.current)}),ut.current=null,Ue({})})),Ee.current.push(he)}return Object(P.useEffect)(function(){return function(){Ae.a.cancel(ut.current)}},[]),[Pe.current,ce]}function fe(ke){var Pe=Object(P.useRef)(ke),rt=Object(P.useRef)(null);function ht(){window.clearTimeout(rt.current)}function Ue(Ee){Pe.current=Ee,ht(),rt.current=window.setTimeout(function(){Pe.current=null,rt.current=null},100)}function ut(){return Pe.current}return Object(P.useEffect)(function(){return ht},[]),[Ue,ut]}function Ve(ke,Pe,rt){var ht=Object(P.useMemo)(function(){for(var Ue=[],ut=[],Ee=0,ce=0,he=0;he<Pe;he+=1)if(rt==="rtl"){ut[he]=ce,ce+=ke[he]||0;var J=Pe-he-1;Ue[J]=Ee,Ee+=ke[J]||0}else{Ue[he]=Ee,Ee+=ke[he]||0;var Z=Pe-he-1;ut[Z]=ce,ce+=ke[Z]||0}return{left:Ue,right:ut}},[ke,Pe,rt]);return ht}var Lt=Ve;function Pt(ke){var Pe=ke.className,rt=ke.children;return P.createElement("div",{className:Pe},rt)}var vt=Pt,Fe=M("n6Qo");function _t(ke){var Pe,rt=ke.prefixCls,ht=ke.record,Ue=ke.onExpand,ut=ke.expanded,Ee=ke.expandable,ce="".concat(rt,"-row-expand-icon");if(!Ee)return P.createElement("span",{className:D()(ce,"".concat(rt,"-row-spaced"))});var he=function(Z){Ue(ht,Z),Z.stopPropagation()};return P.createElement("span",{className:D()(ce,(Pe={},Object(Q.a)(Pe,"".concat(rt,"-row-expanded"),ut),Object(Q.a)(Pe,"".concat(rt,"-row-collapsed"),!ut),Pe)),onClick:he})}function tt(ke,Pe,rt){var ht=[];function Ue(ut){(ut||[]).forEach(function(Ee,ce){ht.push(Pe(Ee,ce)),Ue(Ee[rt])})}return Ue(ke),ht}var Rt=M("zT1h"),Ge=M("y0+3"),Ft=function(Pe,rt){var ht,Ue,ut=Pe.scrollBodyRef,Ee=Pe.onScroll,ce=Pe.offsetScroll,he=P.useContext(i.a),J=he.prefixCls,Z=((ht=ut.current)===null||ht===void 0?void 0:ht.scrollWidth)||0,re=((Ue=ut.current)===null||Ue===void 0?void 0:Ue.clientWidth)||0,ue=Z&&re*(re/Z),de=P.useRef(),Ne=le({scrollLeft:0,isHiddenScrollBar:!1}),ct=Object(R.a)(Ne,2),Gt=ct[0],an=ct[1],it=P.useRef({delta:0,x:0}),qt=P.useState(!1),st=Object(R.a)(qt,2),pt=st[0],Qe=st[1],ie=function(){Qe(!1)},be=function(Ce){Ce.persist(),it.current.delta=Ce.pageX-Gt.scrollLeft,it.current.x=0,Qe(!0),Ce.preventDefault()},Ot=function(Ce){var De,mt=Ce||((De=window)===null||De===void 0?void 0:De.event),Jt=mt.buttons;if(!pt||Jt===0){pt&&Qe(!1);return}var cn=it.current.x+Ce.pageX-it.current.x-it.current.delta;cn<=0&&(cn=0),cn+ue>=re&&(cn=re-ue),Ee({scrollLeft:cn/re*(Z+2)}),it.current.x=Ce.pageX},qe=function(){var Ce=Object(Ge.b)(ut.current).top,De=Ce+ut.current.offsetHeight,mt=document.documentElement.scrollTop+window.innerHeight;De-Object(h.a)()<=mt||Ce>=mt-ce?an(function(Jt){return Object(z.a)(Object(z.a)({},Jt),{},{isHiddenScrollBar:!0})}):an(function(Jt){return Object(z.a)(Object(z.a)({},Jt),{},{isHiddenScrollBar:!1})})},Bt=function(Ce){an(function(De){return Object(z.a)(Object(z.a)({},De),{},{scrollLeft:Ce/Z*re||0})})};return P.useImperativeHandle(rt,function(){return{setScrollLeft:Bt}}),P.useEffect(function(){var Qt=Object(Rt.a)(document.body,"mouseup",ie,!1),Ce=Object(Rt.a)(document.body,"mousemove",Ot,!1);return qe(),function(){Qt.remove(),Ce.remove()}},[ue,pt]),P.useEffect(function(){var Qt=Object(Rt.a)(window,"scroll",qe,!1),Ce=Object(Rt.a)(window,"resize",qe,!1);return function(){Qt.remove(),Ce.remove()}},[]),P.useEffect(function(){Gt.isHiddenScrollBar||an(function(Qt){var Ce,De;return Object(z.a)(Object(z.a)({},Qt),{},{scrollLeft:ut.current.scrollLeft/((Ce=ut.current)===null||Ce===void 0?void 0:Ce.scrollWidth)*((De=ut.current)===null||De===void 0?void 0:De.clientWidth)})})},[Gt.isHiddenScrollBar]),Z<=re||!ue||Gt.isHiddenScrollBar?null:P.createElement("div",{style:{height:Object(h.a)(),width:re,bottom:ce},className:"".concat(J,"-sticky-scroll")},P.createElement("div",{onMouseDown:be,ref:de,className:D()("".concat(J,"-sticky-scroll-bar"),Object(Q.a)({},"".concat(J,"-sticky-scroll-bar-active"),pt)),style:{width:"".concat(ue,"px"),transform:"translate3d(".concat(Gt.scrollLeft,"px, 0, 0)")}}))},wt=P.forwardRef(Ft);function yt(ke,Pe){return P.useMemo(function(){var rt=!!ke;return{isSticky:rt,stickyClassName:rt?"".concat(Pe,"-sticky-header"):"",offsetHeader:Object(B.a)(ke)==="object"&&ke.offsetHeader||0,offsetScroll:Object(B.a)(ke)==="object"&&ke.offsetScroll||0}},[ke,Pe])}var bn=[],un={},sn="rc-table-internal-hook",Ye=P.memo(function(ke){var Pe=ke.children;return Pe},function(ke,Pe){return A()(ke.props,Pe.props)?ke.pingLeft!==Pe.pingLeft||ke.pingRight!==Pe.pingRight:!1});function nn(ke){var Pe,rt=ke.prefixCls,ht=ke.className,Ue=ke.rowClassName,ut=ke.style,Ee=ke.data,ce=ke.rowKey,he=ke.scroll,J=ke.tableLayout,Z=ke.direction,re=ke.title,ue=ke.footer,de=ke.summary,Ne=ke.id,ct=ke.showHeader,Gt=ke.components,an=ke.emptyText,it=ke.onRow,qt=ke.onHeaderRow,st=ke.internalHooks,pt=ke.transformColumns,Qe=ke.internalRefs,ie=ke.sticky,be=Ee||bn,Ot=!!be.length,qe=P.useState(0),Bt=Object(R.a)(qe,2),Qt=Bt[0],Ce=Bt[1];P.useEffect(function(){Ce(Object(h.a)())});var De=P.useMemo(function(){return Object(S.c)(Gt,{})},[Gt]),mt=P.useCallback(function(_n,hn){return Object(S.b)(De,_n)||hn},[De]),Jt=P.useMemo(function(){return typeof ce=="function"?ce:function(_n){var hn=_n&&_n[ce];return hn}},[ce]),cn=Object(y.c)(ke),wn=cn.expandIcon,sa=cn.expandedRowKeys,zn=cn.defaultExpandedRowKeys,En=cn.defaultExpandAllRows,ga=cn.expandedRowRender,Ua=cn.onExpand,ta=cn.onExpandedRowsChange,la=cn.expandRowByClick,Ra=cn.rowExpandable,Xa=cn.expandIconColumnIndex,vr=cn.expandedRowClassName,rn=cn.childrenColumnName,Xn=cn.indentSize,hr=wn||_t,xr=rn||"children",$a=P.useMemo(function(){return ga?"row":ke.expandable&&st===sn&&ke.expandable.__PARENT_RENDER_ICON__||be.some(function(_n){return _n&&Object(B.a)(_n)==="object"&&_n[xr]})?"nest":!1},[!!ga,be]),Ga=P.useState(function(){return zn||(En?tt(be,Jt,xr):[])}),Aa=Object(R.a)(Ga,2),Kn=Aa[0],pr=Aa[1],on=P.useMemo(function(){return new Set(sa||Kn||[])},[sa,Kn]),qa=P.useCallback(function(_n){var hn=Jt(_n,be.indexOf(_n)),bt,He=on.has(hn);He?(on.delete(hn),bt=Object(I.a)(on)):bt=[].concat(Object(I.a)(on),[hn]),pr(bt),Ua&&Ua(!He,_n),ta&&ta(bt)},[Jt,on,be,Ua,ta]),Ka=P.useState(0),Tr=Object(R.a)(Ka,2),mr=Tr[0],nr=Tr[1],Br=Object(xe.b)(Object(z.a)(Object(z.a)(Object(z.a)({},ke),cn),{},{expandable:!!ga,expandedKeys:on,getRowKey:Jt,onTriggerExpand:qa,expandIcon:hr,expandIconColumnIndex:Xa,direction:Z}),st===sn?pt:null),Hr=Object(R.a)(Br,2),ar=Hr[0],Ea=Hr[1],Sr=P.useMemo(function(){return{columns:ar,flattenColumns:Ea}},[ar,Ea]),Rr=P.useRef(),ur=P.useRef(),_r=P.useRef(),oi=P.useState(!1),$r=Object(R.a)(oi,2),va=$r[0],_a=$r[1],ir=P.useState(!1),Pa=Object(R.a)(ir,2),Mn=Pa[0],ln=Pa[1],Tn=le(new Map),fn=Object(R.a)(Tn,2),$n=fn[0],Zn=fn[1],V=Object(S.a)(Ea),ae=V.map(function(_n){return $n.get(_n)}),ge=P.useMemo(function(){return ae},[ae.join("_")]),ve=Lt(ge,Ea.length,Z),Xe=he&&Object(S.d)(he.y),Re=he&&Object(S.d)(he.x),ze=Re&&Ea.some(function(_n){var hn=_n.fixed;return hn}),lt=P.useRef(),At=yt(ie,rt),Dt=At.isSticky,Ie=At.offsetHeader,ft=At.offsetScroll,$e=At.stickyClassName,Ze,dt,Tt;Xe&&(dt={overflowY:"scroll",maxHeight:he.y}),Re&&(Ze={overflowX:"auto"},Xe||(dt={overflowY:"hidden"}),Tt={width:he.x===!0?"auto":he.x,minWidth:"100%"});var at=P.useCallback(function(_n,hn){Zn(function(bt){var He=new Map(bt);return He.set(_n,hn),He})},[]),Ut=fe(null),Yt=Object(R.a)(Ut,2),yn=Yt[0],In=Yt[1];function mn(_n,hn){if(!hn)return;typeof hn=="function"?hn(_n):hn.scrollLeft!==_n&&(hn.scrollLeft=_n)}var Cn=function(hn){var bt=hn.currentTarget,He=hn.scrollLeft,Ct=typeof He=="number"?He:bt.scrollLeft,xt=bt||un;if(!In()||In()===xt){var Vt;yn(xt),mn(Ct,ur.current),mn(Ct,_r.current),mn(Ct,(Vt=lt.current)===null||Vt===void 0?void 0:Vt.setScrollLeft)}if(bt){var kn=bt.scrollWidth,On=bt.clientWidth;_a(Ct>0),ln(Ct<kn-On)}},xn=function(){_r.current&&Cn({currentTarget:_r.current})},Et=function(hn){var bt=hn.width;xn(),nr(Rr.current?Rr.current.offsetWidth:bt)};P.useEffect(function(){return xn},[]),P.useEffect(function(){Re&&xn()},[Re]),P.useEffect(function(){st===sn&&Qe&&(Qe.body.current=_r.current)});var Xt=mt(["table"],"table"),Mt=P.useMemo(function(){return J||(ze?he.x==="max-content"?"auto":"fixed":Xe||Ea.some(function(_n){var hn=_n.ellipsis;return hn})?"fixed":"auto")},[Xe,ze,Ea,J]),gt,Sn={colWidths:ge,columCount:Ea.length,stickyOffsets:ve,onHeaderRow:qt,fixHeader:Xe},gn=P.useMemo(function(){return Ot?null:typeof an=="function"?an():an},[Ot,an]),Nt=P.createElement(me,{data:be,measureColumnWidth:Xe||Re||Dt,expandedKeys:on,rowExpandable:Ra,getRowKey:Jt,onRow:it,emptyNode:gn,childrenColumnName:xr}),et=P.createElement(c,{colWidths:Ea.map(function(_n){var hn=_n.width;return hn}),columns:Ea}),Rn=de&&P.createElement(Fe.b,null,de(be)),$t=mt(["body"]);if(Xe||Dt){var Bn;typeof $t=="function"?(Bn=$t(be,{scrollbarSize:Qt,ref:_r,onScroll:Cn}),Sn.colWidths=Ea.map(function(_n,hn){var bt=_n.width,He=hn===ar.length-1?bt-Qt:bt;return typeof He=="number"&&!Number.isNaN(He)?He:(Object(b.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Bn=P.createElement("div",{style:Object(z.a)(Object(z.a)({},Ze),dt),onScroll:Cn,ref:_r,className:D()("".concat(rt,"-body"))},P.createElement(Xt,{style:Object(z.a)(Object(z.a)({},Tt),{},{tableLayout:Mt})},et,Nt,Rn),Dt&&P.createElement(wt,{ref:lt,offsetScroll:ft,scrollBodyRef:_r,onScroll:Cn})),gt=P.createElement(P.Fragment,null,ct!==!1&&P.createElement(E,Object.assign({noData:!be.length},Sn,Sr,{direction:Z,offsetHeader:Ie,stickyClassName:$e,ref:ur,onScroll:Cn})),Bn)}else gt=P.createElement("div",{style:Object(z.a)(Object(z.a)({},Ze),dt),className:D()("".concat(rt,"-content")),onScroll:Cn,ref:_r},P.createElement(Xt,{style:Object(z.a)(Object(z.a)({},Tt),{},{tableLayout:Mt})},et,ct!==!1&&P.createElement(_,Object.assign({},Sn,Sr)),Nt,Rn));var jt=Object(y.b)(ke),vn=P.createElement("div",Object.assign({className:D()(rt,ht,(Pe={},Object(Q.a)(Pe,"".concat(rt,"-rtl"),Z==="rtl"),Object(Q.a)(Pe,"".concat(rt,"-ping-left"),va),Object(Q.a)(Pe,"".concat(rt,"-ping-right"),Mn),Object(Q.a)(Pe,"".concat(rt,"-layout-fixed"),J==="fixed"),Object(Q.a)(Pe,"".concat(rt,"-fixed-header"),Xe),Object(Q.a)(Pe,"".concat(rt,"-fixed-column"),ze),Object(Q.a)(Pe,"".concat(rt,"-scroll-horizontal"),Re),Object(Q.a)(Pe,"".concat(rt,"-has-fix-left"),Ea[0]&&Ea[0].fixed),Object(Q.a)(Pe,"".concat(rt,"-has-fix-right"),Ea[Ea.length-1]&&Ea[Ea.length-1].fixed==="right"),Pe)),style:ut,id:Ne,ref:Rr},jt),P.createElement(Ye,{pingLeft:va,pingRight:Mn,props:Object(z.a)(Object(z.a)({},ke),{},{stickyOffsets:ve,mergedExpandedKeys:on})},re&&P.createElement(vt,{className:"".concat(rt,"-title")},re(be)),P.createElement("div",{className:"".concat(rt,"-container")},gt),ue&&P.createElement(vt,{className:"".concat(rt,"-footer")},ue(be))));Re&&(vn=P.createElement(m.a,{onResize:Et},vn));var Dn=P.useMemo(function(){return{prefixCls:rt,getComponent:mt,scrollbarSize:Qt,direction:Z,fixedInfoList:Ea.map(function(_n,hn){return n(hn,hn,Ea,ve,Z)}),isSticky:Dt}},[rt,mt,Qt,Z,Ea,ve,Z,Dt]),tn=P.useMemo(function(){return Object(z.a)(Object(z.a)({},Sr),{},{tableLayout:Mt,rowClassName:Ue,expandedRowClassName:vr,componentWidth:mr,fixHeader:Xe,fixColumn:ze,horizonScroll:Re,expandIcon:hr,expandableType:$a,expandRowByClick:la,expandedRowRender:ga,onTriggerExpand:qa,expandIconColumnIndex:Xa,indentSize:Xn})},[Sr,Mt,Ue,vr,mr,Xe,ze,Re,hr,$a,la,ga,qa,Xa,Xn]),oa=P.useMemo(function(){return{onColumnResize:at}},[at]);return P.createElement(i.a.Provider,{value:Dn},P.createElement(U.Provider,{value:tn},P.createElement(Y.Provider,{value:oa},vn)))}nn.Column=o.a,nn.ColumnGroup=d.a,nn.Summary=Fe.a,nn.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var An=Ke.b=nn},wRmb:function(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return A});var Q=M("rePB"),z=M("KQm4"),I=M("VTBJ"),B=M("Ff2n"),R=M("cDcd"),P=M.n(R),F=M("Kwbf"),D=M("Zm9Q"),L=M("hW8S");function A(o){return Object(D.a)(o).filter(function(a){return R.isValidElement(a)}).map(function(a){var u=a.key,s=a.props,i=s.children,n=Object(B.a)(s,["children"]),S=Object(I.a)({key:u},n);return i&&(S.children=A(i)),S})}function b(o){return o.reduce(function(a,u){var s=u.fixed,i=s===!0?"left":s,n=u.children;return n&&n.length>0?[].concat(Object(z.a)(a),Object(z.a)(b(n).map(function(S){return Object(I.a)({fixed:i},S)}))):[].concat(Object(z.a)(a),[Object(I.a)(Object(I.a)({},u),{},{fixed:i})])},[])}function m(o){for(var a=!0,u=0;u<o.length;u+=1){var s=o[u];if(a&&s.fixed!=="left")a=!1;else if(!a&&s.fixed==="left"){Object(F.a)(!1,"Index ".concat(u-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,n=o.length-1;n>=0;n-=1){var S=o[n];if(i&&S.fixed!=="right")i=!1;else if(!i&&S.fixed==="right"){Object(F.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function h(o){return o.map(function(a){var u=a.fixed,s=Object(B.a)(a,["fixed"]),i=u;return u==="left"?i="right":u==="right"&&(i="left"),Object(I.a)({fixed:i},s)})}function d(o,a){var u=o.prefixCls,s=o.columns,i=o.children,n=o.expandable,S=o.expandedKeys,C=o.getRowKey,x=o.onTriggerExpand,w=o.expandIcon,T=o.rowExpandable,_=o.expandIconColumnIndex,y=o.direction,f=o.expandRowByClick,c=R.useMemo(function(){return s||A(i)},[s,i]),v=R.useMemo(function(){if(n){var k,U=_||0,H=c[U],W=(k={},Object(Q.a)(k,L.a,{className:"".concat(u,"-expand-icon-col")}),Object(Q.a)(k,"title",""),Object(Q.a)(k,"fixed",H?H.fixed:null),Object(Q.a)(k,"className","".concat(u,"-row-expand-icon-cell")),Object(Q.a)(k,"render",function(K,Y,ee){var se=C(Y,ee),Be=S.has(se),me=T?T(Y):!0,xe=w({prefixCls:u,expanded:Be,expandable:me,record:Y,onExpand:x});return f?R.createElement("span",{onClick:function(Ae){return Ae.stopPropagation()}},xe):xe}),k),j=c.slice();return U>=0&&j.splice(U,0,W),j}return c},[n,c,C,S,w,y]),p=R.useMemo(function(){var k=v;return a&&(k=a(k)),k.length||(k=[{render:function(){return null}}]),k},[a,v,y]),E=R.useMemo(function(){return y==="rtl"?h(b(p)):b(p)},[p,y]);return[p,E]}Ke.b=d},wwSX:function(zt,Ke,M){zt.exports=M.p+"static/b2.2c844a2a.svg"},xOL1:function(zt,Ke){zt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(zt,Ke,M){zt.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(zt,Ke,M){"use strict";M.d(Ke,"a",function(){return b}),M.d(Ke,"b",function(){return h});var Q=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},I={cssFloat:1,styleFloat:1,float:1};function B(d){return d.nodeType===1?d.ownerDocument.defaultView.getComputedStyle(d,null):{}}function R(d,o,a){if(o=o.toLowerCase(),a==="auto"){if(o==="height")return d.offsetHeight;if(o==="width")return d.offsetWidth}return o in z||(z[o]=Q.test(o)),z[o]?parseFloat(a)||0:a}function P(d,o){var a=arguments.length,u=B(d);return o=I[o]?"cssFloat"in d.style?"cssFloat":"styleFloat":o,a===1?u:R(d,o,u[o]||d.style[o])}function F(d,o,a){var u=arguments.length;if(o=I[o]?"cssFloat"in d.style?"cssFloat":"styleFloat":o,u===3)return typeof a=="number"&&Q.test(o)&&(a="".concat(a,"px")),d.style[o]=a,a;for(var s in o)o.hasOwnProperty(s)&&F(d,s,o[s]);return B(d)}function D(d){return d===document.body?document.documentElement.clientWidth:d.offsetWidth}function L(d){return d===document.body?window.innerHeight||document.documentElement.clientHeight:d.offsetHeight}function A(){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:d,height:o}}function b(){var d=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:d,height:o}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(d){var o=d.getBoundingClientRect(),a=document.documentElement;return{left:o.left+(window.pageXOffset||a.scrollLeft)-(a.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||a.scrollTop)-(a.clientTop||document.body.clientTop||0)}}},zetH:function(zt,Ke,M){zt.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(zt,Ke,M){zt.exports=M.p+"static/b3.30079151.svg"}}]);
|