(window.webpackJsonp=window.webpackJsonp||[]).push([[105,3,5,7,8,13],{"+92d":function(tn,Qe,I){tn.exports=I.p+"static/b1.8d46544a.svg"},"+NIl":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"use strict";te.defineMode("stex",function(Y,N){"use strict";function K(d,s){d.cmdState.push(s)}function A(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function M(d){var s=d.cmdState.pop();s&&s.closeBracket()}function H(d){for(var s=d.cmdState,r=s.length-1;r>=0;r--){var u=s[r];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function P(d,s,r){return function(){this.name=d,this.bracketNo=0,this.style=s,this.styles=r,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=P("importmodule","tag",["string","builtin"]),k.documentclass=P("documentclass","tag",["","atom"]),k.usepackage=P("usepackage","tag",["atom"]),k.begin=P("begin","tag",["atom"]),k.end=P("end","tag",["atom"]),k.label=P("label","tag",["atom"]),k.ref=P("ref","tag",["atom"]),k.eqref=P("eqref","tag",["atom"]),k.cite=P("cite","tag",["atom"]),k.bibitem=P("bibitem","tag",["atom"]),k.Bibitem=P("Bibitem","tag",["atom"]),k.RBibitem=P("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(d,s){d.f=s}function b(d,s){var r;if(d.match(/^\\[a-zA-Z@]+/)){var u=d.current().slice(1);return r=k.hasOwnProperty(u)?k[u]:k.DEFAULT,r=new r,K(s,r),D(s,f),r.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return D(s,function(a,n){return m(a,n,"\\]")}),"keyword";if(d.match("\\("))return D(s,function(a,n){return m(a,n,"\\)")}),"keyword";if(d.match("$$"))return D(s,function(a,n){return m(a,n,"$$")}),"keyword";if(d.match("$"))return D(s,function(a,n){return m(a,n,"$")}),"keyword";var o=d.next();if(o=="%")return d.skipToEnd(),"comment";if(o=="}"||o=="]"){if(r=A(s),r)r.closeBracket(o),D(s,f);else return"error";return"bracket"}else return o=="{"||o=="["?(r=k.DEFAULT,r=new r,K(s,r),"bracket"):/\d/.test(o)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),r=H(s),r.name=="begin"&&(r.argument=d.current()),r.styleIdentifier())}function m(d,s,r){if(d.eatSpace())return null;if(r&&d.match(r))return D(s,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 f(d,s){var r=d.peek(),u;return r=="{"||r=="["?(u=A(s),u.openBracket(r),d.eat(r),D(s,b),"bracket"):/[ \t\r]/.test(r)?(d.eat(r),null):(D(s,b),M(s),b(d,s))}return{startState:function(){var d=N.inMathMode?function(s,r){return m(s,r)}:b;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,s){return s.f(d,s)},blankLine:function(d){d.f=b,d.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(tn,Qe,I){},"19Vz":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){te.defineOption("placeholder","",function(P,k,D){var b=D&&D!=te.Init;if(k&&!b)P.on("blur",A),P.on("change",M),P.on("swapDoc",M),te.on(P.getInputField(),"compositionupdate",P.state.placeholderCompose=function(){K(P)}),M(P);else if(!k&&b){P.off("blur",A),P.off("change",M),P.off("swapDoc",M),te.off(P.getInputField(),"compositionupdate",P.state.placeholderCompose),Y(P);var m=P.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}k&&!P.hasFocus()&&A(P)});function Y(P){P.state.placeholder&&(P.state.placeholder.parentNode.removeChild(P.state.placeholder),P.state.placeholder=null)}function N(P){Y(P);var k=P.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=P.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var D=P.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),k.appendChild(D),P.display.lineSpace.insertBefore(k,P.display.lineSpace.firstChild)}function K(P){setTimeout(function(){var k=!1,D=P.getInputField();D.nodeName=="TEXTAREA"?k=!D.value:P.lineCount()==1&&(k=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),k?N(P):Y(P)},20)}function A(P){H(P)&&N(P)}function M(P){var k=P.getWrapperElement(),D=H(P);k.className=k.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?N(P):Y(P)}function H(P){return P.lineCount()===1&&P.getLine(0)===""}})},"1ZF9":function(tn,Qe,I){tn.exports=I.p+"static/Authorize.cc9c212f.png"},"1eCo":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"use strict";var Y={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};te.defineMode("xml",function(K,A){var M=K.indentUnit,H={},P=A.htmlMode?Y:N;for(var k in P)H[k]=P[k];for(var k in A)H[k]=A[k];var D,b;function m(c,v){function p(F){return v.tokenize=F,F(c,v)}var E=c.next();if(E=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?p(s("atom","]]>")):null:c.match("--")?p(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),p(r(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),v.tokenize=s("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",v.tokenize=f,"tag bracket");if(E=="&"){var U;return c.eat("#")?c.eat("x")?U=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):U=c.eatWhile(/[\d]/)&&c.eat(";"):U=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),U?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function f(c,v){var p=c.next();if(p==">"||p=="/"&&c.eat(">"))return v.tokenize=m,D=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return D="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=f;break}return"string"};return v.isInAttribute=!0,v}function s(c,v){return function(p,E){for(;!p.eol();){if(p.match(v)){E.tokenize=m;break}p.next()}return c}}function r(c){return function(v,p){for(var E;(E=v.next())!=null;){if(E=="<")return p.tokenize=r(c+1),p.tokenize(v,p);if(E==">")if(c==1){p.tokenize=m;break}else return p.tokenize=r(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,(H.doNotIndent.hasOwnProperty(v)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function o(c){c.context&&(c.context=c.context.prev)}function a(c,v){for(var p;;){if(!c.context)return;if(p=c.context.tagName,!H.contextGrabbers.hasOwnProperty(p)||!H.contextGrabbers[p].hasOwnProperty(v))return;o(c)}}function n(c,v,p){return c=="openTag"?(p.tagStart=v.column(),R):c=="closeTag"?w:n}function R(c,v,p){return c=="word"?(p.tagName=v.current(),b="tag",C):H.allowMissingTagName&&c=="endTag"?(b="tag bracket",C(c,v,p)):(b="error",R)}function w(c,v,p){if(c=="word"){var E=v.current();return p.context&&p.context.tagName!=E&&H.implicitlyClosed.hasOwnProperty(p.context.tagName)&&o(p),p.context&&p.context.tagName==E||H.matchClosing===!1?(b="tag",x):(b="tag error",O)}else return H.allowMissingTagName&&c=="endTag"?(b="tag bracket",x(c,v,p)):(b="error",O)}function x(c,v,p){return c!="endTag"?(b="error",x):(o(p),n)}function O(c,v,p){return b="error",x(c,v,p)}function C(c,v,p){if(c=="word")return b="attribute",_;if(c=="endTag"||c=="selfcloseTag"){var E=p.tagName,U=p.tagStart;return p.tagName=p.tagStart=null,c=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(E)?a(p,E):(a(p,E),p.context=new u(p,E,U==p.indented)),n}return b="error",C}function _(c,v,p){return c=="equals"?y:(H.allowMissing||(b="error"),C(c,v,p))}function y(c,v,p){return c=="string"?h:c=="word"&&H.allowUnquoted?(b="string",C):(b="error",C(c,v,p))}function h(c,v,p){return c=="string"?h:C(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;D=null;var p=v.tokenize(c,v);return(p||D)&&p!="comment"&&(b=null,v.state=v.state(D||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+M;if(E&&E.noIndent)return te.Pass;if(c.tokenize!=f&&c.tokenize!=m)return p?p.match(/^(\s*)/)[0].length:0;if(c.tagName)return H.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+M*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(c){c.state==y&&(c.state=C)},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()}}}),te.defineMIME("text/xml","xml"),te.defineMIME("application/xml","xml"),te.mimeModes.hasOwnProperty("text/html")||te.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(tn,Qe,I){"use strict";I.d(Qe,"d",function(){return An}),I.d(Qe,"b",function(){return me}),I.d(Qe,"c",function(){return Tt}),I.d(Qe,"a",function(){return En});var te=I("VTBJ"),Y=I("1OyB"),N=I("vuIU"),K=I("JX7q"),A=I("Ji7U"),M=I("LK+K"),H=I("q1tI"),P=I("I8Z2"),k=I("BGR+"),D=I("wx14"),b=I("rePB"),m=I("4IlW"),f=I("2GS6"),d=I("Gytx"),s=I.n(d),r=I("TSYQ"),u=I.n(r),o=I("U8pU"),a=I("ODXe"),n=/iPhone/i,R=/iPod/i,w=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,O=/Android/i,C=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,y=/Windows Phone/i,h=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,v=/BB10/i,p=/Opera Mini/i,E=/\b(CriOS|Chrome)(?:.+)Mobile/i,U=/Mobile(?:.+)Firefox\b/i;function F(Qt,gt){return Qt.test(gt)}function z(Qt){var gt=Qt||(typeof navigator!="undefined"?navigator.userAgent:""),yt=gt.split("[FBAN");if(typeof yt[1]!="undefined"){var rt=yt,ce=Object(a.a)(rt,1);gt=ce[0]}if(yt=gt.split("Twitter"),typeof yt[1]!="undefined"){var Re=yt,At=Object(a.a)(Re,1);gt=At[0]}var ot={apple:{phone:F(n,gt)&&!F(y,gt),ipod:F(R,gt),tablet:!F(n,gt)&&F(w,gt)&&!F(y,gt),device:(F(n,gt)||F(R,gt)||F(w,gt))&&!F(y,gt)},amazon:{phone:F(C,gt),tablet:!F(C,gt)&&F(_,gt),device:F(C,gt)||F(_,gt)},android:{phone:!F(y,gt)&&F(C,gt)||!F(y,gt)&&F(x,gt),tablet:!F(y,gt)&&!F(C,gt)&&!F(x,gt)&&(F(_,gt)||F(O,gt)),device:!F(y,gt)&&(F(C,gt)||F(_,gt)||F(x,gt)||F(O,gt))||F(/\bokhttp\b/i,gt)},windows:{phone:F(y,gt),tablet:F(h,gt),device:F(y,gt)||F(h,gt)},other:{blackberry:F(c,gt),blackberry10:F(v,gt),opera:F(p,gt),firefox:F(U,gt),chrome:F(E,gt),device:F(c,gt)||F(v,gt)||F(p,gt)||F(U,gt)||F(E,gt)},any:null,phone:null,tablet:null};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}var G=Object(te.a)(Object(te.a)({},z()),{},{isMobile:z}),B=G;function T(){}function V(Qt,gt,yt){var rt=gt||"";return Qt.key||"".concat(rt,"item_").concat(yt)}function Z(Qt){return"".concat(Qt,"-menu-")}function oe(Qt,gt){var yt=-1;H.Children.forEach(Qt,function(rt){yt+=1,rt&&rt.type&&rt.type.isMenuItemGroup?H.Children.forEach(rt.props.children,function(ce){yt+=1,gt(ce,yt)}):gt(rt,yt)})}function pe(Qt,gt,yt){if(!Qt||yt.find)return;H.Children.forEach(Qt,function(rt){if(rt){var ce=rt.type;if(!ce||!(ce.isSubMenu||ce.isMenuItem||ce.isMenuItemGroup))return;gt.indexOf(rt.key)!==-1?yt.find=!0:rt.props.children&&pe(rt.props.children,gt,yt)}})}var Ye=["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"],xe=function(gt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rt=gt&&typeof gt.getBoundingClientRect=="function"&>.getBoundingClientRect().width;if(rt){if(yt){var ce=getComputedStyle(gt),Re=ce.marginLeft,At=ce.marginRight;rt+=+Re.replace("px","")+ +At.replace("px","")}rt=+rt.toFixed(6)}return rt||0},Ie=function(gt,yt,rt){gt&&Object(o.a)(gt.style)==="object"&&(gt.style[yt]=rt)},Je=function(){return B.any},Ke=I("KQm4"),be=I("Ff2n"),de=I("i8i4"),nt=I("bdgK"),Kt=I("uciX"),jt=I("8XRh"),wt={adjustX:1,adjustY:1},ze={topLeft:{points:["bl","tl"],overflow:wt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:wt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:wt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:wt,offset:[4,0]}},ft={topLeft:{points:["bl","tl"],overflow:wt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:wt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:wt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:wt,offset:[4,0]}},dt=ze,Nt=0,Ze={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Bt=function(gt,yt,rt){var ce=Z(yt),Re=gt.getState();gt.setState({defaultActiveFirst:Object(te.a)(Object(te.a)({},Re.defaultActiveFirst),{},Object(b.a)({},ce,rt))})},Ut=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(rt){var ce;Object(Y.a)(this,yt),ce=gt.call(this,rt),ce.onDestroy=function(_e){ce.props.onDestroy(_e)},ce.onKeyDown=function(_e){var Ne=_e.keyCode,xt=ce.menuInstance,Xt=ce.props,vn=Xt.isOpen,Mn=Xt.store;if(Ne===m.a.ENTER)return ce.onTitleClick(_e),Bt(Mn,ce.props.eventKey,!0),!0;if(Ne===m.a.RIGHT)return vn?xt.onKeyDown(_e):(ce.triggerOpenChange(!0),Bt(Mn,ce.props.eventKey,!0)),!0;if(Ne===m.a.LEFT){var ci;if(vn)ci=xt.onKeyDown(_e);else return;return ci||(ce.triggerOpenChange(!1),ci=!0),ci}return vn&&(Ne===m.a.UP||Ne===m.a.DOWN)?xt.onKeyDown(_e):void 0},ce.onOpenChange=function(_e){ce.props.onOpenChange(_e)},ce.onPopupVisibleChange=function(_e){ce.triggerOpenChange(_e,_e?"mouseenter":"mouseleave")},ce.onMouseEnter=function(_e){var Ne=ce.props,xt=Ne.eventKey,Xt=Ne.onMouseEnter,vn=Ne.store;Bt(vn,ce.props.eventKey,!1),Xt({key:xt,domEvent:_e})},ce.onMouseLeave=function(_e){var Ne=ce.props,xt=Ne.parentMenu,Xt=Ne.eventKey,vn=Ne.onMouseLeave;xt.subMenuInstance=Object(K.a)(ce),vn({key:Xt,domEvent:_e})},ce.onTitleMouseEnter=function(_e){var Ne=ce.props,xt=Ne.eventKey,Xt=Ne.onItemHover,vn=Ne.onTitleMouseEnter;Xt({key:xt,hover:!0}),vn({key:xt,domEvent:_e})},ce.onTitleMouseLeave=function(_e){var Ne=ce.props,xt=Ne.parentMenu,Xt=Ne.eventKey,vn=Ne.onItemHover,Mn=Ne.onTitleMouseLeave;xt.subMenuInstance=Object(K.a)(ce),vn({key:Xt,hover:!1}),Mn({key:Xt,domEvent:_e})},ce.onTitleClick=function(_e){var Ne=Object(K.a)(ce),xt=Ne.props;if(xt.onTitleClick({key:xt.eventKey,domEvent:_e}),xt.triggerSubMenuAction==="hover")return;ce.triggerOpenChange(!xt.isOpen,"click"),Bt(xt.store,ce.props.eventKey,!1)},ce.onSubMenuClick=function(_e){typeof ce.props.onClick=="function"&&ce.props.onClick(ce.addKeyPath(_e))},ce.onSelect=function(_e){ce.props.onSelect(_e)},ce.onDeselect=function(_e){ce.props.onDeselect(_e)},ce.getPrefixCls=function(){return"".concat(ce.props.rootPrefixCls,"-submenu")},ce.getActiveClassName=function(){return"".concat(ce.getPrefixCls(),"-active")},ce.getDisabledClassName=function(){return"".concat(ce.getPrefixCls(),"-disabled")},ce.getSelectedClassName=function(){return"".concat(ce.getPrefixCls(),"-selected")},ce.getOpenClassName=function(){return"".concat(ce.props.rootPrefixCls,"-submenu-open")},ce.saveMenuInstance=function(_e){ce.menuInstance=_e},ce.addKeyPath=function(_e){return Object(te.a)(Object(te.a)({},_e),{},{keyPath:(_e.keyPath||[]).concat(ce.props.eventKey)})},ce.triggerOpenChange=function(_e,Ne){var xt=ce.props.eventKey,Xt=function(){ce.onOpenChange({key:xt,item:Object(K.a)(ce),trigger:Ne,open:_e})};Ne==="mouseenter"?ce.mouseenterTimeout=setTimeout(function(){Xt()},0):Xt()},ce.isChildrenSelected=function(){var _e={find:!1};return pe(ce.props.children,ce.props.selectedKeys,_e),_e.find},ce.isOpen=function(){return ce.props.openKeys.indexOf(ce.props.eventKey)!==-1},ce.adjustWidth=function(){if(!ce.subMenuTitle||!ce.menuInstance)return;var _e=de.findDOMNode(ce.menuInstance);if(_e.offsetWidth>=ce.subMenuTitle.offsetWidth)return;_e.style.minWidth="".concat(ce.subMenuTitle.offsetWidth,"px")},ce.saveSubMenuTitle=function(_e){ce.subMenuTitle=_e},ce.getBaseProps=function(){var _e=Object(K.a)(ce),Ne=_e.props;return{mode:Ne.mode==="horizontal"?"vertical":Ne.mode,visible:ce.props.isOpen,level:Ne.level+1,inlineIndent:Ne.inlineIndent,focusable:!1,onClick:ce.onSubMenuClick,onSelect:ce.onSelect,onDeselect:ce.onDeselect,onDestroy:ce.onDestroy,selectedKeys:Ne.selectedKeys,eventKey:"".concat(Ne.eventKey,"-menu-"),openKeys:Ne.openKeys,motion:Ne.motion,onOpenChange:ce.onOpenChange,subMenuOpenDelay:Ne.subMenuOpenDelay,parentMenu:Object(K.a)(ce),subMenuCloseDelay:Ne.subMenuCloseDelay,forceSubMenuRender:Ne.forceSubMenuRender,triggerSubMenuAction:Ne.triggerSubMenuAction,builtinPlacements:Ne.builtinPlacements,defaultActiveFirst:Ne.store.getState().defaultActiveFirst[Z(Ne.eventKey)],multiple:Ne.multiple,prefixCls:Ne.rootPrefixCls,id:ce.internalMenuId,manualRef:ce.saveMenuInstance,itemIcon:Ne.itemIcon,expandIcon:Ne.expandIcon,direction:Ne.direction}},ce.getMotion=function(_e,Ne){var xt=Object(K.a)(ce),Xt=xt.haveRendered,vn=ce.props,Mn=vn.motion,ci=vn.rootPrefixCls,$n=Object(te.a)(Object(te.a)({},Mn),{},{leavedClassName:"".concat(ci,"-hidden"),removeOnLeave:!1,motionAppear:Xt||!Ne||_e!=="inline"});return $n};var Re=rt.store,At=rt.eventKey,ot=Re.getState(),Yt=ot.defaultActiveFirst;ce.isRootMenu=!1;var rn=!1;return Yt&&(rn=Yt[At]),Bt(Re,At,rn),ce}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ce=this,Re=this.props,At=Re.mode,ot=Re.parentMenu,Yt=Re.manualRef;if(Yt&&Yt(this),At!=="horizontal"||!ot.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ce.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ce=this.props,Re=ce.onDestroy,At=ce.eventKey;Re&&Re(At),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ce){var Re=this,At=this.getBaseProps(),ot=this.getMotion(At.mode,At.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||At.visible||At.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var Yt=At.direction;return H.createElement(jt.default,Object.assign({visible:At.visible},ot),function(rn){var _e=rn.className,Ne=rn.style,xt=u()("".concat(At.prefixCls,"-sub"),_e,Object(b.a)({},"".concat(At.prefixCls,"-rtl"),Yt==="rtl"));return H.createElement(Ae,Object.assign({},At,{id:Re.internalMenuId,className:xt,style:Ne}),ce)})}},{key:"render",value:function(){var ce,Re=Object(te.a)({},this.props),At=Re.isOpen,ot=this.getPrefixCls(),Yt=Re.mode==="inline",rn=u()(ot,"".concat(ot,"-").concat(Re.mode),(ce={},Object(b.a)(ce,Re.className,!!Re.className),Object(b.a)(ce,this.getOpenClassName(),At),Object(b.a)(ce,this.getActiveClassName(),Re.active||At&&!Yt),Object(b.a)(ce,this.getDisabledClassName(),Re.disabled),Object(b.a)(ce,this.getSelectedClassName(),this.isChildrenSelected()),ce));this.internalMenuId||(Re.eventKey?this.internalMenuId="".concat(Re.eventKey,"$Menu"):(Nt+=1,this.internalMenuId="$__$".concat(Nt,"$Menu")));var _e={},Ne={},xt={};Re.disabled||(_e={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ne={onClick:this.onTitleClick},xt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Xt={},vn=Re.direction;Yt&&(vn==="rtl"?Xt.paddingRight=Re.inlineIndent*Re.level:Xt.paddingLeft=Re.inlineIndent*Re.level);var Mn={};this.props.isOpen&&(Mn={"aria-owns":this.internalMenuId});var ci=null;Re.mode!=="horizontal"&&(ci=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ci=H.createElement(this.props.expandIcon,Object(te.a)({},this.props))));var $n=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Xt,className:"".concat(ot,"-title"),role:"button"},xt,Ne,{"aria-expanded":At},Mn,{"aria-haspopup":"true",title:typeof Re.title=="string"?Re.title:void 0}),Re.title,ci||H.createElement("i",{className:"".concat(ot,"-arrow")})),Cn=this.renderChildren(Re.children),Ti=Re.parentMenu.isRootMenu?Re.parentMenu.props.getPopupContainer:function(tr){return tr.parentNode},Wi=Ze[Re.mode],hi=Re.popupOffset?{offset:Re.popupOffset}:{},fi=Re.mode==="inline"?"":Re.popupClassName;fi+=vn==="rtl"?" ".concat(ot,"-rtl"):"";var ji=Re.disabled,er=Re.triggerSubMenuAction,yr=Re.subMenuOpenDelay,cn=Re.forceSubMenuRender,ri=Re.subMenuCloseDelay,pr=Re.builtinPlacements;Ye.forEach(function(tr){return delete Re[tr]}),delete Re.onClick;var Cr=vn==="rtl"?Object.assign({},ft,pr):Object.assign({},ze,pr);return delete Re.direction,H.createElement("li",Object.assign({},Re,_e,{className:rn,role:"menuitem"}),Yt&&$n,Yt&&Cn,!Yt&&H.createElement(Kt.a,{prefixCls:ot,popupClassName:u()("".concat(ot,"-popup"),fi),getPopupContainer:Ti,builtinPlacements:Cr,popupPlacement:Wi,popupVisible:At,popupAlign:hi,popup:Cn,action:ji?[]:[er],mouseEnterDelay:yr,mouseLeaveDelay:ri,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:cn},$n))}}]),yt}(H.Component);Ut.defaultProps={onMouseEnter:T,onMouseLeave:T,onTitleMouseEnter:T,onTitleMouseLeave:T,onTitleClick:T,manualRef:T,mode:"vertical",title:""};var Mt=Object(P.b)(function(Qt,gt){var yt=Qt.openKeys,rt=Qt.activeKey,ce=Qt.selectedKeys,Re=gt.eventKey,At=gt.subMenuKey;return{isOpen:yt.indexOf(Re)>-1,active:rt[At]===Re,selectedKeys:ce}})(Ut);Mt.isSubMenu=!0;var An=Mt,mn="menuitem-overflowed",pn=.5,tt=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(){var rt;return Object(Y.a)(this,yt),rt=gt.apply(this,arguments),rt.resizeObserver=null,rt.mutationObserver=null,rt.originalTotalWidth=0,rt.overflowedItems=[],rt.menuItemSizes=[],rt.cancelFrameId=null,rt.state={lastVisibleIndex:void 0},rt.getMenuItemNodes=function(){var ce=rt.props.prefixCls,Re=de.findDOMNode(Object(K.a)(rt));return Re?[].slice.call(Re.children).filter(function(At){return At.className.split(" ").indexOf("".concat(ce,"-overflowed-submenu"))<0}):[]},rt.getOverflowedSubMenuItem=function(ce,Re,At){var ot=rt.props,Yt=ot.overflowedIndicator,rn=ot.level,_e=ot.mode,Ne=ot.prefixCls,xt=ot.theme;if(rn!==1||_e!=="horizontal")return null;var Xt=rt.props.children[0],vn=Xt.props,Mn=vn.children,ci=vn.title,$n=vn.style,Cn=Object(be.a)(vn,["children","title","style"]),Ti=Object(te.a)({},$n),Wi="".concat(ce,"-overflowed-indicator"),hi="".concat(ce,"-overflowed-indicator");Re.length===0&&At!==!0?Ti=Object(te.a)(Object(te.a)({},Ti),{},{display:"none"}):At&&(Ti=Object(te.a)(Object(te.a)({},Ti),{},{visibility:"hidden",position:"absolute"}),Wi="".concat(Wi,"-placeholder"),hi="".concat(hi,"-placeholder"));var fi=xt?"".concat(Ne,"-").concat(xt):"",ji={};return Ye.forEach(function(er){Cn[er]!==void 0&&(ji[er]=Cn[er])}),H.createElement(An,Object.assign({title:Yt,className:"".concat(Ne,"-overflowed-submenu"),popupClassName:fi},ji,{key:Wi,eventKey:hi,disabled:!1,style:Ti}),Re)},rt.setChildrenWidthAndResize=function(){if(rt.props.mode!=="horizontal")return;var ce=de.findDOMNode(Object(K.a)(rt));if(!ce)return;var Re=ce.children;if(!Re||Re.length===0)return;var At=ce.children[Re.length-1];Ie(At,"display","inline-block");var ot=rt.getMenuItemNodes(),Yt=ot.filter(function(rn){return rn.className.split(" ").indexOf(mn)>=0});Yt.forEach(function(rn){Ie(rn,"display","inline-block")}),rt.menuItemSizes=ot.map(function(rn){return xe(rn,!0)}),Yt.forEach(function(rn){Ie(rn,"display","none")}),rt.overflowedIndicatorWidth=xe(ce.children[ce.children.length-1],!0),rt.originalTotalWidth=rt.menuItemSizes.reduce(function(rn,_e){return rn+_e},0),rt.handleResize(),Ie(At,"display","none")},rt.handleResize=function(){if(rt.props.mode!=="horizontal")return;var ce=de.findDOMNode(Object(K.a)(rt));if(!ce)return;var Re=xe(ce);rt.overflowedItems=[];var At=0,ot;rt.originalTotalWidth>Re+pn&&(ot=-1,rt.menuItemSizes.forEach(function(Yt){At+=Yt,At+rt.overflowedIndicatorWidth<=Re&&(ot+=1)})),rt.setState({lastVisibleIndex:ot})},rt}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){var ce=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Re=de.findDOMNode(this);if(!Re)return;this.resizeObserver=new nt.default(function(At){At.forEach(function(){var ot=ce.cancelFrameId;cancelAnimationFrame(ot),ce.cancelFrameId=requestAnimationFrame(ce.setChildrenWidthAndResize)})}),[].slice.call(Re.children).concat(Re).forEach(function(At){ce.resizeObserver.observe(At)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ce.resizeObserver.disconnect(),[].slice.call(Re.children).concat(Re).forEach(function(At){ce.resizeObserver.observe(At)}),ce.setChildrenWidthAndResize()}),this.mutationObserver.observe(Re,{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(ce){var Re=this,At=this.state.lastVisibleIndex;return(ce||[]).reduce(function(ot,Yt,rn){var _e=Yt;if(Re.props.mode==="horizontal"){var Ne=Re.getOverflowedSubMenuItem(Yt.props.eventKey,[]);At!==void 0&&Re.props.className.indexOf("".concat(Re.props.prefixCls,"-root"))!==-1&&(rn>At&&(_e=H.cloneElement(Yt,{style:{display:"none"},eventKey:"".concat(Yt.props.eventKey,"-hidden"),className:"".concat(mn)})),rn===At+1&&(Re.overflowedItems=ce.slice(At+1).map(function(Xt){return H.cloneElement(Xt,{key:Xt.props.eventKey,mode:"vertical-left"})}),Ne=Re.getOverflowedSubMenuItem(Yt.props.eventKey,Re.overflowedItems)));var xt=[].concat(Object(Ke.a)(ot),[Ne,_e]);return rn===ce.length-1&&xt.push(Re.getOverflowedSubMenuItem(Yt.props.eventKey,[],!0)),xt}return[].concat(Object(Ke.a)(ot),[_e])},[])}},{key:"render",value:function(){var ce=this.props,Re=ce.visible,At=ce.prefixCls,ot=ce.overflowedIndicator,Yt=ce.mode,rn=ce.level,_e=ce.tag,Ne=ce.children,xt=ce.theme,Xt=Object(be.a)(ce,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),vn=_e;return H.createElement(vn,Object.assign({},Xt),this.renderChildren(Ne))}}]),yt}(H.Component);tt.defaultProps={tag:"div",className:""};var fn=tt;function In(Qt){return Qt.length?Qt.every(function(gt){return!!gt.props.disabled}):!0}function He(Qt,gt,yt){var rt=Qt.getState();Qt.setState({activeKey:Object(te.a)(Object(te.a)({},rt.activeKey),{},Object(b.a)({},gt,yt))})}function Ue(Qt){return Qt.eventKey||"0-menu-"}function pt(Qt,gt){var yt=gt,rt=Qt.children,ce=Qt.eventKey;if(yt){var Re;if(oe(rt,function(At,ot){At&&At.props&&!At.props.disabled&&yt===V(At,ce,ot)&&(Re=!0)}),Re)return yt}return yt=null,Qt.defaultActiveFirst&&oe(rt,function(At,ot){!yt&&At&&!At.props.disabled&&(yt=V(At,ce,ot))}),yt}function Ct(Qt){if(Qt){var gt=this.instanceArray.indexOf(Qt);gt!==-1?this.instanceArray[gt]=Qt:this.instanceArray.push(Qt)}}var Ge=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(rt){var ce;return Object(Y.a)(this,yt),ce=gt.call(this,rt),ce.onKeyDown=function(Re,At){var ot=Re.keyCode,Yt;if(ce.getFlatInstanceArray().forEach(function(_e){_e&&_e.props.active&&_e.onKeyDown&&(Yt=_e.onKeyDown(Re))}),Yt)return 1;var rn=null;return(ot===m.a.UP||ot===m.a.DOWN)&&(rn=ce.step(ot===m.a.UP?-1:1)),rn?(Re.preventDefault(),He(ce.props.store,Ue(ce.props),rn.props.eventKey),typeof At=="function"&&At(rn),1):void 0},ce.onItemHover=function(Re){var At=Re.key,ot=Re.hover;He(ce.props.store,Ue(ce.props),ot?At:null)},ce.onDeselect=function(Re){ce.props.onDeselect(Re)},ce.onSelect=function(Re){ce.props.onSelect(Re)},ce.onClick=function(Re){ce.props.onClick(Re)},ce.onOpenChange=function(Re){ce.props.onOpenChange(Re)},ce.onDestroy=function(Re){ce.props.onDestroy(Re)},ce.getFlatInstanceArray=function(){return ce.instanceArray},ce.step=function(Re){var At=ce.getFlatInstanceArray(),ot=ce.props.store.getState().activeKey[Ue(ce.props)],Yt=At.length;if(!Yt)return null;Re<0&&(At=At.concat().reverse());var rn=-1;if(At.every(function(Xt,vn){return Xt&&Xt.props.eventKey===ot?(rn=vn,!1):!0}),!ce.props.defaultActiveFirst&&rn!==-1&&In(At.slice(rn,Yt-1)))return;var _e=(rn+1)%Yt,Ne=_e;do{var xt=At[Ne];if(!xt||xt.props.disabled)Ne=(Ne+1)%Yt;else return xt}while(Ne!==_e);return null},ce.renderCommonMenuItem=function(Re,At,ot){var Yt=ce.props.store.getState(),rn=Object(K.a)(ce),_e=rn.props,Ne=V(Re,_e.eventKey,At),xt=Re.props;if(!xt||typeof Re.type=="string")return Re;var Xt=Ne===Yt.activeKey,vn=Object(te.a)(Object(te.a)({mode:xt.mode||_e.mode,level:_e.level,inlineIndent:_e.inlineIndent,renderMenuItem:ce.renderMenuItem,rootPrefixCls:_e.prefixCls,index:At,parentMenu:_e.parentMenu,manualRef:xt.disabled?void 0:Object(f.a)(Re.ref,Ct.bind(Object(K.a)(ce))),eventKey:Ne,active:!xt.disabled&&Xt,multiple:_e.multiple,onClick:function(ci){(xt.onClick||T)(ci),ce.onClick(ci)},onItemHover:ce.onItemHover,motion:_e.motion,subMenuOpenDelay:_e.subMenuOpenDelay,subMenuCloseDelay:_e.subMenuCloseDelay,forceSubMenuRender:_e.forceSubMenuRender,onOpenChange:ce.onOpenChange,onDeselect:ce.onDeselect,onSelect:ce.onSelect,builtinPlacements:_e.builtinPlacements,itemIcon:xt.itemIcon||ce.props.itemIcon,expandIcon:xt.expandIcon||ce.props.expandIcon},ot),{},{direction:_e.direction});return(_e.mode==="inline"||Je())&&(vn.triggerSubMenuAction="click"),H.cloneElement(Re,vn)},ce.renderMenuItem=function(Re,At,ot){if(!Re)return null;var Yt=ce.props.store.getState(),rn={openKeys:Yt.openKeys,selectedKeys:Yt.selectedKeys,triggerSubMenuAction:ce.props.triggerSubMenuAction,subMenuKey:ot};return ce.renderCommonMenuItem(Re,At,rn)},rt.store.setState({activeKey:Object(te.a)(Object(te.a)({},rt.store.getState().activeKey),{},Object(b.a)({},rt.eventKey,pt(rt,rt.activeKey)))}),ce.instanceArray=[],ce}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ce){return this.props.visible||ce.visible||this.props.className!==ce.className||!s()(this.props.style,ce.style)}},{key:"componentDidUpdate",value:function(ce){var Re=this.props,At="activeKey"in Re?Re.activeKey:Re.store.getState().activeKey[Ue(Re)],ot=pt(Re,At);if(ot!==At)He(Re.store,Ue(Re),ot);else if("activeKey"in ce){var Yt=pt(ce,ce.activeKey);ot!==Yt&&He(Re.store,Ue(Re),ot)}}},{key:"render",value:function(){var ce=this,Re=Object(D.a)({},this.props);this.instanceArray=[];var At=u()(Re.prefixCls,Re.className,"".concat(Re.prefixCls,"-").concat(Re.mode)),ot={className:At,role:Re.role||"menu"};Re.id&&(ot.id=Re.id),Re.focusable&&(ot.tabIndex=0,ot.onKeyDown=this.onKeyDown);var Yt=Re.prefixCls,rn=Re.eventKey,_e=Re.visible,Ne=Re.level,xt=Re.mode,Xt=Re.overflowedIndicator,vn=Re.theme;return Ye.forEach(function(Mn){return delete Re[Mn]}),delete Re.onClick,H.createElement(fn,Object.assign({},Re,{prefixCls:Yt,mode:xt,tag:"ul",level:Ne,theme:vn,visible:_e,overflowedIndicator:Xt},ot),H.Children.map(Re.children,function(Mn,ci){return ce.renderMenuItem(Mn,ci,rn||"0-menu-")}))}}]),yt}(H.Component);Ge.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:T};var vt=Object(P.b)()(Ge),Ae=vt,ge=I("Kwbf");function Ee(Qt,gt,yt){var rt=Qt.prefixCls,ce=Qt.motion,Re=Qt.defaultMotions,At=Re===void 0?{}:Re,ot=Qt.openAnimation,Yt=Qt.openTransitionName,rn=gt.switchingModeFromInline;if(ce)return ce;if(Object(o.a)(ot)==="object"&&ot)Object(ge.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ot=="string")return{motionName:"".concat(rt,"-open-").concat(ot)};if(Yt)return{motionName:Yt};var _e=At[yt];return _e||(rn?null:At.other)}var ae=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(rt){var ce;Object(Y.a)(this,yt),ce=gt.call(this,rt),ce.inlineOpenKeys=[],ce.onSelect=function(ot){var Yt=Object(K.a)(ce),rn=Yt.props;if(rn.selectable){var _e=ce.store.getState(),Ne=_e.selectedKeys,xt=ot.key;rn.multiple?Ne=Ne.concat([xt]):Ne=[xt],"selectedKeys"in rn||ce.store.setState({selectedKeys:Ne}),rn.onSelect(Object(te.a)(Object(te.a)({},ot),{},{selectedKeys:Ne}))}},ce.onClick=function(ot){var Yt=ce.getRealMenuMode(),rn=Object(K.a)(ce),_e=rn.store,Ne=rn.props.onOpenChange;Yt!=="inline"&&!("openKeys"in ce.props)&&(_e.setState({openKeys:[]}),Ne([])),ce.props.onClick(ot)},ce.onKeyDown=function(ot,Yt){ce.innerMenu.getWrappedInstance().onKeyDown(ot,Yt)},ce.onOpenChange=function(ot){var Yt=Object(K.a)(ce),rn=Yt.props,_e=ce.store.getState().openKeys.concat(),Ne=!1,xt=function(vn){var Mn=!1;if(vn.open)Mn=_e.indexOf(vn.key)===-1,Mn&&_e.push(vn.key);else{var ci=_e.indexOf(vn.key);Mn=ci!==-1,Mn&&_e.splice(ci,1)}Ne=Ne||Mn};Array.isArray(ot)?ot.forEach(xt):xt(ot),Ne&&("openKeys"in ce.props||ce.store.setState({openKeys:_e}),rn.onOpenChange(_e))},ce.onDeselect=function(ot){var Yt=Object(K.a)(ce),rn=Yt.props;if(rn.selectable){var _e=ce.store.getState().selectedKeys.concat(),Ne=ot.key,xt=_e.indexOf(Ne);xt!==-1&&_e.splice(xt,1),"selectedKeys"in rn||ce.store.setState({selectedKeys:_e}),rn.onDeselect(Object(te.a)(Object(te.a)({},ot),{},{selectedKeys:_e}))}},ce.onMouseEnter=function(ot){ce.restoreModeVerticalFromInline();var Yt=ce.props.onMouseEnter;Yt&&Yt(ot)},ce.onTransitionEnd=function(ot){var Yt=ot.propertyName==="width"&&ot.target===ot.currentTarget,rn=ot.target.className,_e=Object.prototype.toString.call(rn)==="[object SVGAnimatedString]"?rn.animVal:rn,Ne=ot.propertyName==="font-size"&&_e.indexOf("anticon")>=0;(Yt||Ne)&&ce.restoreModeVerticalFromInline()},ce.setInnerMenu=function(ot){ce.innerMenu=ot},ce.isRootMenu=!0;var Re=rt.defaultSelectedKeys,At=rt.defaultOpenKeys;return"selectedKeys"in rt&&(Re=rt.selectedKeys||[]),"openKeys"in rt&&(At=rt.openKeys||[]),ce.store=Object(P.c)({selectedKeys:Re,openKeys:At,activeKey:{"0-menu-":pt(rt,rt.activeKey)}}),ce.state={switchingModeFromInline:!1},ce}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ce){this.updateOpentKeysWhenSwitchMode(ce),this.updateMiniStore();var Re=this.props,At=Re.siderCollapsed,ot=Re.inlineCollapsed,Yt=Re.onOpenChange;(!ce.inlineCollapsed&&ot||!ce.siderCollapsed&&At)&&Yt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ce){var Re=this.props,At=this.store,ot=this.inlineOpenKeys,Yt=At.getState(),rn={};ce.mode==="inline"&&Re.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Re||((Re.inlineCollapsed&&!ce.inlineCollapsed||Re.siderCollapsed&&!ce.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Yt.openKeys.concat(),rn.openKeys=[]),(!Re.inlineCollapsed&&ce.inlineCollapsed||!Re.siderCollapsed&&ce.siderCollapsed)&&(rn.openKeys=ot,this.inlineOpenKeys=[])),Object.keys(rn).length&&At.setState(rn)}},{key:"updateMenuDisplay",value:function(){var ce=this.props.collapsedWidth,Re=this.store,At=this.prevOpenKeys,ot=this.getInlineCollapsed()&&(ce===0||ce==="0"||ce==="0px");ot?(this.prevOpenKeys=Re.getState().openKeys.concat(),this.store.setState({openKeys:[]})):At&&(this.store.setState({openKeys:At}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ce=this.props.mode,Re=this.state.switchingModeFromInline,At=this.getInlineCollapsed();return Re&&At?"inline":At?"vertical":ce}},{key:"getInlineCollapsed",value:function(){var ce=this.props,Re=ce.inlineCollapsed,At=ce.siderCollapsed;return At!==void 0?At:Re}},{key:"restoreModeVerticalFromInline",value:function(){var ce=this.state.switchingModeFromInline;ce&&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 ce=Object(te.a)({},Object(k.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Re=this.getRealMenuMode();return ce.className+=" ".concat(ce.prefixCls,"-root"),ce.direction==="rtl"&&(ce.className+=" ".concat(ce.prefixCls,"-rtl")),ce=Object(te.a)(Object(te.a)({},ce),{},{mode:Re,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ee(this.props,this.state,Re)}),delete ce.openAnimation,delete ce.openTransitionName,H.createElement(P.a,{store:this.store},H.createElement(Ae,Object.assign({},ce,{ref:this.setInnerMenu}),this.props.children))}}]),yt}(H.Component);ae.defaultProps={selectable:!0,onClick:T,onSelect:T,onOpenChange:T,onDeselect:T,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var re=ae,he=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(){var rt;return Object(Y.a)(this,yt),rt=gt.apply(this,arguments),rt.onKeyDown=function(ce){var Re=ce.keyCode;return Re===m.a.ENTER?(rt.onClick(ce),!0):void 0},rt.onMouseLeave=function(ce){var Re=rt.props,At=Re.eventKey,ot=Re.onItemHover,Yt=Re.onMouseLeave;ot({key:At,hover:!1}),Yt({key:At,domEvent:ce})},rt.onMouseEnter=function(ce){var Re=rt.props,At=Re.eventKey,ot=Re.onItemHover,Yt=Re.onMouseEnter;ot({key:At,hover:!0}),Yt({key:At,domEvent:ce})},rt.onClick=function(ce){var Re=rt.props,At=Re.eventKey,ot=Re.multiple,Yt=Re.onClick,rn=Re.onSelect,_e=Re.onDeselect,Ne=Re.isSelected,xt={key:At,keyPath:[At],item:Object(K.a)(rt),domEvent:ce};Yt(xt),ot?Ne?_e(xt):rn(xt):Ne||rn(xt)},rt.saveNode=function(ce){rt.node=ce},rt}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ce=this.props;ce.onDestroy&&ce.onDestroy(ce.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 ce,Re=Object(te.a)({},this.props),At=u()(this.getPrefixCls(),Re.className,(ce={},Object(b.a)(ce,this.getActiveClassName(),!Re.disabled&&Re.active),Object(b.a)(ce,this.getSelectedClassName(),Re.isSelected),Object(b.a)(ce,this.getDisabledClassName(),Re.disabled),ce)),ot=Object(te.a)(Object(te.a)({},Re.attribute),{},{title:typeof Re.title=="string"?Re.title:void 0,className:At,role:Re.role||"menuitem","aria-disabled":Re.disabled});Re.role==="option"?ot=Object(te.a)(Object(te.a)({},ot),{},{role:"option","aria-selected":Re.isSelected}):(Re.role===null||Re.role==="none")&&(ot.role="none");var Yt={onClick:Re.disabled?null:this.onClick,onMouseLeave:Re.disabled?null:this.onMouseLeave,onMouseEnter:Re.disabled?null:this.onMouseEnter},rn=Object(te.a)({},Re.style);Re.mode==="inline"&&(Re.direction==="rtl"?rn.paddingRight=Re.inlineIndent*Re.level:rn.paddingLeft=Re.inlineIndent*Re.level),Ye.forEach(function(Ne){return delete Re[Ne]}),delete Re.direction;var _e=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(_e=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(k.default)(Re,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ot,Yt,{style:rn,ref:this.saveNode}),Re.children,_e)}}]),yt}(H.Component);he.isMenuItem=!0,he.defaultProps={onSelect:T,onMouseEnter:T,onMouseLeave:T,manualRef:T};var ve=Object(P.b)(function(Qt,gt){var yt=Qt.activeKey,rt=Qt.selectedKeys,ce=gt.eventKey,Re=gt.subMenuKey;return{active:yt[Re]===ce,isSelected:rt.indexOf(ce)!==-1}})(he),me=ve,Be=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(){var rt;return Object(Y.a)(this,yt),rt=gt.apply(this,arguments),rt.renderInnerMenuItem=function(ce){var Re=rt.props,At=Re.renderMenuItem,ot=Re.index;return At(ce,ot,rt.props.subMenuKey)},rt}return Object(N.a)(yt,[{key:"render",value:function(){var ce=Object(D.a)({},this.props),Re=ce.className,At=Re===void 0?"":Re,ot=ce.rootPrefixCls,Yt="".concat(ot,"-item-group-title"),rn="".concat(ot,"-item-group-list"),_e=ce.title,Ne=ce.children;return Ye.forEach(function(xt){return delete ce[xt]}),delete ce.onClick,delete ce.direction,H.createElement("li",Object.assign({},ce,{className:"".concat(At," ").concat(ot,"-item-group")}),H.createElement("div",{className:Yt,title:typeof _e=="string"?_e:void 0},_e),H.createElement("ul",{className:rn},H.Children.map(Ne,this.renderInnerMenuItem)))}}]),yt}(H.Component);Be.isMenuItemGroup=!0,Be.defaultProps={disabled:!0};var Tt=Be,Jt=function(gt){var yt=gt.className,rt=gt.rootPrefixCls,ce=gt.style;return H.createElement("li",{className:"".concat(yt," ").concat(rt,"-item-divider"),style:ce})};Jt.defaultProps={disabled:!0,className:"",style:{}};var En=Jt,mt=Qe.e=re},"4wi7":function(tn,Qe,I){"use strict";var te=I("14J3"),Y=I("BMrR"),N=I("sRBo"),K=I("kaz8"),A=I("5NDa"),M=I("5rEg"),H=I("9og8"),P=I("tJVT"),k=I("WmNS"),D=I.n(k),b=I("q1tI"),m=I.n(b),f=I("oOBs"),d=I.n(f),s=I("xOL1"),r=I.n(s),u=I("BdwD"),o=function(n){var R=n.data,w=n.value,x=w===void 0?[]:w,O=n.handleChangePage,C=n.setSelectedRowKeys,_=n.selectedRowKeys,y=n.onChange,h=y===void 0?function(){}:y,c=Object(b.useState)([]),v=Object(P.a)(c,2),p=v[0],E=v[1],U=Object(b.useState)([]),F=Object(P.a)(U,2),z=F[0],G=F[1],B=Object(b.useState)([]),T=Object(P.a)(B,2),V=T[0],Z=T[1],oe=Object(b.useState)(1),pe=Object(P.a)(oe,2),Ye=pe[0],xe=pe[1],Ie=Object(b.useState)(),Je=Object(P.a)(Ie,2),Ke=Je[0],be=Je[1];return Object(b.useEffect)(function(){E(R),G([]),Z([])},[R]),Object(b.useEffect)(function(){C&&(G(_),Z(_))},[_]),m.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},m.a.createElement("div",{className:d.a.leftdiv},m.a.createElement(M.a.Search,{size:"large",onChange:function(){var de=Object(H.a)(D.a.mark(function nt(Kt){return D.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:E(R.filter(function(ze){var ft;return ze==null||((ft=ze.name)===null||ft===void 0)?void 0:ft.includes(Kt.target.value)}));case 1:case"end":return wt.stop()}},nt)}));return function(nt){return de.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(K.a.Group,{value:z.map(function(de){return"".concat(de.id)}),onChange:function(nt){C(p.filter(function(Kt){return nt.includes("".concat(Kt.id))}))},style:{marginTop:"10px"}},p.map(function(de,nt){return m.a.createElement(Y.a,{key:de.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},m.a.createElement(K.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:de.is_published,value:"".concat(de.id)},m.a.createElement("div",{className:d.a.listClass},m.a.createElement("span",{className:d.a.spantitle,style:{width:de.is_published?"108px":"170px"}},de.name),de.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(M.a.Search,{onChange:function(nt){Z(z.filter(function(Kt){return Kt.name.includes(nt.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),V.length===0&&m.a.createElement(u.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),V.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}},V.map(function(de,nt){return m.a.createElement(Y.a,{justify:"space-between",style:{marginTop:"10px"},key:de.id},m.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},de.name),m.a.createElement("img",{src:r.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){C(z.filter(function(jt){return"".concat(jt.id)!="".concat(de.id)}))}}))})))))};Qe.a=o},"55Ip":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return a});var te=I("Ty5D"),Y=I("dI71"),N=I("q1tI"),K=I.n(N),A=I("YS25"),M=I("17x9"),H=I.n(M),P=I("wx14"),k=I("zLVn"),D=I("9R94"),b=function(y){Object(Y.a)(h,y);function h(){for(var v,p=arguments.length,E=new Array(p),U=0;U=0||p.relatedTarget.className.indexOf("".concat(z,"-next"))>=0))return;y.setState({goInputText:""}),F(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(A.a)(_,[{key:"getValidValue",value:function(){var h=this.state,c=h.goInputText,v=h.current;return!c||isNaN(c)?v:Number(c)}},{key:"getPageSizeOptions",value:function(){var h=this.props,c=h.pageSize,v=h.pageSizeOptions;return v.some(function(p){return p.toString()===c.toString()})?v:v.concat([c.toString()]).sort(function(p,E){var U=isNaN(Number(p))?0:Number(p),F=isNaN(Number(E))?0:Number(E);return U-F})}},{key:"render",value:function(){var h=this,c=this.props,v=c.pageSize,p=c.locale,E=c.rootPrefixCls,U=c.changeSize,F=c.quickGo,z=c.goButton,G=c.selectComponentClass,B=c.buildOptionText,T=c.selectPrefixCls,V=c.disabled,Z=this.state.goInputText,oe="".concat(E,"-options"),pe=G,Ye=null,xe=null,Ie=null;if(!U&&!F)return null;var Je=this.getPageSizeOptions();if(U&&pe){var Ke=Je.map(function(be,de){return k.a.createElement(pe.Option,{key:de,value:be.toString()},(B||h.buildOptionText)(be))});Ye=k.a.createElement(pe,{disabled:V,prefixCls:T,showSearch:!1,className:"".concat(oe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||Je[0]).toString(),onChange:this.changeSize,getPopupContainer:function(de){return de.parentNode}},Ke)}return F&&(z&&(Ie=typeof z=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(oe,"-quick-jumper-button")},p.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},z)),xe=k.a.createElement("div",{className:"".concat(oe,"-quick-jumper")},p.jump_to,k.a.createElement("input",{disabled:V,type:"text",value:Z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,Ie)),k.a.createElement("li",{className:"".concat(oe)},Ye,xe)}}]),_}(k.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var r=s,u=I("N2Kk");function o(){}function a(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function n(O,C,_){return _}function R(O,C,_){var y=typeof O=="undefined"?C.pageSize:O;return Math.floor((_.total-1)/y)+1}var w=function(O){Object(M.a)(_,O);var C=Object(H.a)(_);function _(y){var h;Object(K.a)(this,_),h=C.call(this,y),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(R(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(U,F){var z=h.props.prefixCls,G=U||k.a.createElement("button",{type:"button","aria-label":F,className:"".concat(z,"-item-link")});return typeof U=="function"&&(G=k.a.createElement(U,Object(N.a)({},h.props))),G},h.savePaginationNode=function(U){h.paginationNode=U},h.isValid=function(U){return a(U)&&U!==h.state.current},h.shouldDisplayQuickJumper=function(){var U=h.props,F=U.showQuickJumper,z=U.pageSize,G=U.total;return G<=z?!1:F},h.handleKeyDown=function(U){(U.keyCode===d.ARROW_UP||U.keyCode===d.ARROW_DOWN)&&U.preventDefault()},h.handleKeyUp=function(U){var F=h.getValidValue(U),z=h.state.currentInputValue;F!==z&&h.setState({currentInputValue:F}),U.keyCode===d.ENTER?h.handleChange(F):U.keyCode===d.ARROW_UP?h.handleChange(F-1):U.keyCode===d.ARROW_DOWN&&h.handleChange(F+1)},h.changePageSize=function(U){var F=h.state.current,z=R(U,h.state,h.props);F=F>z?z:F,z===0&&(F=h.state.current),typeof U=="number"&&("pageSize"in h.props||h.setState({pageSize:U}),"current"in h.props||h.setState({current:F,currentInputValue:F})),h.props.onShowSizeChange(F,U),"onChange"in h.props&&h.props.onChange&&h.props.onChange(F,U)},h.handleChange=function(U){var F=h.props.disabled,z=U;if(h.isValid(z)&&!F){var G=R(void 0,h.state,h.props);z>G?z=G:z<1&&(z=1),"current"in h.props||h.setState({current:z,currentInputValue:z});var B=h.state.pageSize;return h.props.onChange(z,B),z}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current2?z-2:0),B=2;B=v?E=v:E=Number(c),E}},{key:"getShowSizeChanger",value:function(){var h=this.props,c=h.showSizeChanger,v=h.total,p=h.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:v>p}},{key:"renderPrev",value:function(h){var c=this.props,v=c.prevIcon,p=c.itemRender,E=p(h,"prev",this.getItemIcon(v,"prev page")),U=!this.hasPrev();return Object(P.isValidElement)(E)?Object(P.cloneElement)(E,{disabled:U}):E}},{key:"renderNext",value:function(h){var c=this.props,v=c.nextIcon,p=c.itemRender,E=p(h,"next",this.getItemIcon(v,"next page")),U=!this.hasNext();return Object(P.isValidElement)(E)?Object(P.cloneElement)(E,{disabled:U}):E}},{key:"render",value:function(){var h=this,c=this.props,v=c.prefixCls,p=c.className,E=c.style,U=c.disabled,F=c.hideOnSinglePage,z=c.total,G=c.locale,B=c.showQuickJumper,T=c.showLessItems,V=c.showTitle,Z=c.showTotal,oe=c.simple,pe=c.itemRender,Ye=c.showPrevNextJumpers,xe=c.jumpPrevIcon,Ie=c.jumpNextIcon,Je=c.selectComponentClass,Ke=c.selectPrefixCls,be=c.pageSizeOptions,de=this.state,nt=de.current,Kt=de.pageSize,jt=de.currentInputValue;if(F===!0&&z<=Kt)return null;var wt=R(void 0,this.state,this.props),ze=[],ft=null,dt=null,Nt=null,Ze=null,Bt=null,Ut=B&&B.goButton,Mt=T?1:2,An=nt-1>0?nt-1:0,mn=nt+1=Mt*2&&nt!==1+2&&(ze[0]=Object(P.cloneElement)(ze[0],{className:"".concat(v,"-item-after-jump-prev")}),ze.unshift(ft)),wt-nt>=Mt*2&&nt!==wt-2&&(ze[ze.length-1]=Object(P.cloneElement)(ze[ze.length-1],{className:"".concat(v,"-item-before-jump-next")}),ze.push(dt)),pt!==1&&ze.unshift(Nt),Ct!==wt&&ze.push(Ze)}var Ae=null;Z&&(Ae=k.a.createElement("li",{className:"".concat(v,"-total-text")},Z(z,[z===0?0:(nt-1)*Kt+1,nt*Kt>z?z:nt*Kt])));var ge=!this.hasPrev()||!wt,Ee=!this.hasNext()||!wt;return k.a.createElement("ul",Object(te.a)({className:b()(v,p,Object(Y.a)({},"".concat(v,"-disabled"),U)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},pn),Ae,k.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:ge?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(v,"-prev"),Object(Y.a)({},"".concat(v,"-disabled"),ge)),"aria-disabled":ge},this.renderPrev(An)),ze,k.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:Ee?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(v,"-next"),Object(Y.a)({},"".concat(v,"-disabled"),Ee)),"aria-disabled":Ee},this.renderNext(mn)),k.a.createElement(r,{disabled:U,locale:G,rootPrefixCls:v,selectComponentClass:Je,selectPrefixCls:Ke,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:nt,pageSize:Kt,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ut}))}}],[{key:"getDerivedStateFromProps",value:function(h,c){var v={};if("current"in h&&(v.current=h.current,h.current!==c.current&&(v.currentInputValue=v.current)),"pageSize"in h&&h.pageSize!==c.pageSize){var p=c.current,E=R(h.pageSize,c,h);p=p>E?E:p,"current"in h||(v.current=p,v.currentInputValue=p),v.pageSize=h.pageSize}return v}}]),_}(k.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:o,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:o,locale:u.a,style:{},itemRender:n,totalBoundaryShowSizeChanger:50};var x=w},"6RRn":function(tn,Qe,I){"use strict";var te=I("wCXF"),Y=I("n6Qo");I.d(Qe,"b",function(){return Y.a});var N=I("IBYe"),K=I("6eGT"),A=I("hW8S");I.d(Qe,"a",function(){return A.a}),Qe.c=te.b},"6UM0":function(tn,Qe,I){var te,Y;(function(){var N;(function(){"use strict";var A=[function(k,D,b){var m=b(1).Beautifier,f=b(5).Options;function d(s,r){var u=new m(s,r);return u.beautify()}k.exports=d,k.exports.defaultOptions=function(){return new f}},function(k,D,b){var m=b(2).Output,f=b(3).Token,d=b(4),s=b(5).Options,r=b(7).Tokenizer,u=b(7).line_starters,o=b(7).positionable_operators,a=b(7).TOKEN;function n(T,V){return V.indexOf(T)!==-1}function R(T){return T.replace(/^\s+/g,"")}function w(T){for(var V={},Z=0;ZZ&&(Z=T.line_indent_level));var oe={mode:V,parent:T,last_token:T?T.last_token:new f(a.START_BLOCK,""),last_word:T?T.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Z,alignment:0,line_indent_level:T?T.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},G.prototype._reset=function(T){var V=T.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var Z=new r(T,this._options);return this._tokens=Z.tokenize(),T},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T,V=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=` `,V&&d.lineBreak.test(V||"")&&(Z=V.match(d.lineBreak)[0]));for(var oe=this._tokens.next();oe;)this.handle_token(oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=oe,oe=this._tokens.next();return T=this._output.get_code(Z),T},G.prototype.handle_token=function(T,V){T.type===a.START_EXPR?this.handle_start_expr(T):T.type===a.END_EXPR?this.handle_end_expr(T):T.type===a.START_BLOCK?this.handle_start_block(T):T.type===a.END_BLOCK?this.handle_end_block(T):T.type===a.WORD?this.handle_word(T):T.type===a.RESERVED?this.handle_word(T):T.type===a.SEMICOLON?this.handle_semicolon(T):T.type===a.STRING?this.handle_string(T):T.type===a.EQUALS?this.handle_equals(T):T.type===a.OPERATOR?this.handle_operator(T):T.type===a.COMMA?this.handle_comma(T):T.type===a.BLOCK_COMMENT?this.handle_block_comment(T,V):T.type===a.COMMENT?this.handle_comment(T,V):T.type===a.DOT?this.handle_dot(T):T.type===a.EOF?this.handle_eof(T):T.type===a.UNKNOWN?this.handle_unknown(T,V):this.handle_unknown(T,V)},G.prototype.handle_whitespace_and_comments=function(T,V){var Z=T.newlines,oe=this._options.keep_array_indentation&&E(this._flags.mode);if(T.comments_before)for(var pe=T.comments_before.next();pe;)this.handle_whitespace_and_comments(pe,V),this.handle_token(pe,V),pe=T.comments_before.next();if(oe)for(var Ye=0;Ye0,V);else if(this._options.max_preserve_newlines&&Z>this._options.max_preserve_newlines&&(Z=this._options.max_preserve_newlines),this._options.preserve_newlines&&Z>1){this.print_newline(!1,V);for(var xe=1;xe0&&(!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))},G.prototype.set_mode=function(T){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,T),this._flags=this.create_flags(this._previous_flags,T),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.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))},G.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||O(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(T){var V=!1;return V=V||O(this._flags.last_token,["var","let","const"])&&T.type===a.WORD,V=V||x(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&O(this._flags.last_token,B)&&!T.newlines,V=V||x(this._flags.last_token,"else")&&!(x(T,"if")&&!T.comments_before),V=V||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),V=V||this._flags.last_token.type===a.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(T.text==="--"||T.text==="++")&&this._last_last_text!=="function"&&T.type!==a.WORD&&T.type!==a.RESERVED,V=V||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),V?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(T,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T,O(T,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T);var V=c.Expression;if(T.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,u)&&(this._output.space_before_token=!0),this.print_token(T),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=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,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=c.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=c.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&T.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===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var Z=this._tokens.peek(-3);if(this._options.space_after_named_function&&Z){var oe=this._tokens.peek(-4);O(Z,["async","function"])||Z.text==="*"&&O(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Z.text==="{"||Z.text===","||Z.text==="*"&&(oe.text==="{"||oe.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(T);(this._flags.last_token.type===a.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===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(T,T.newlines),this.print_token(T),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(T){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(T,T.text==="]"&&E(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.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(T),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)},G.prototype.handle_start_block=function(T){this.handle_whitespace_and_comments(T);var V=this._tokens.peek(),Z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):Z&&(n(Z.text,[":",","])&&n(V.type,[a.STRING,a.WORD,a.RESERVED])||n(V.text,["get","set","..."])&&n(Z.type,[a.WORD,a.RESERVED]))?n(this._last_last_text,["class","interface"])&&!n(Z.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):n(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var oe=!V.comments_before&&V.text==="}",pe=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Ye=0,xe=null;this._flags.inline_frame=!0;do if(Ye+=1,xe=this._tokens.peek(Ye-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==a.EOF&&!(xe.type===a.END_BLOCK&&xe.opened===T))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(pe||this._flags.last_token.type===a.EQUALS||O(this._flags.last_token,C)&&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===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(T),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(T),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(T){for(this.handle_whitespace_and_comments(T);this._flags.mode===c.Statement;)this.restore_mode();var V=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(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(T)},G.prototype.handle_word=function(T){if(T.type===a.RESERVED){if(n(T.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)T.type=a.WORD;else if(T.text==="import"&&n(this._tokens.peek().text,["(","."]))T.type=a.WORD;else if(n(T.text,["as","from"])&&!this._flags.import_block)T.type=a.WORD;else if(this._flags.mode===c.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(T.type=a.WORD)}}if(this.start_of_statement(T)?O(this._flags.last_token,["var","let","const"])&&T.type===a.WORD&&(this._flags.declaration_statement=!0):T.newlines&&!U(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(T),this.print_newline()):this.handle_whitespace_and_comments(T),this._flags.do_block&&!this._flags.do_while)if(x(T,"while")){this._output.space_before_token=!0,this.print_token(T),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(T,"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&&O(T,["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(T),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T)),x(T,"function")){(n(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(n(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!T.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,B)?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===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||E(this._flags.mode))||this.print_newline(),this.print_token(T),this._flags.last_word=T.text;return}var Z="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":O(T,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===c.BlockStatement?Z="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&U(this._flags.mode)?Z="SPACE":this._flags.last_token.type===a.STRING?Z="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&n(this._last_last_text,["{",","]))?Z="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),O(T,u)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Z="SPACE":Z="NEWLINE"),O(T,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var oe=this._output.current_line;oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Z==="NEWLINE"?O(this._flags.last_token,C)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(T,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!O(T,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(T,"if")&&x(T.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(T,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():Z==="SPACE"&&(this._output.space_before_token=!0);T.previous&&(T.previous.type===a.WORD||T.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(T),this._flags.last_word=T.text,T.type===a.RESERVED&&(T.text==="do"?this._flags.do_block=!0:T.text==="if"?this._flags.if_block=!0:T.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(T,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(T){this.start_of_statement(T)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(T);for(var V=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(T)},G.prototype.handle_string=function(T){T.text.startsWith("`")&&T.newlines===0&&T.whitespace_before===""&&(T.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(T)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(T),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T):T.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(T.previous.text==="]"||T.previous.text===")")&&T.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(T)},G.prototype.handle_equals=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0},G.prototype.handle_comma=function(T){this.handle_whitespace_and_comments(T,!0),this.print_token(T),this._output.space_before_token=!0,this._flags.declaration_statement?(U(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(T)):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(T)},G.prototype.handle_operator=function(T){var V=T.text==="*"&&(O(this._flags.last_token,["function","yield"])||n(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),Z=n(T.text,["-","+"])&&(n(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||n(this._flags.last_token.text,u)||this._flags.last_token.text===",");if(!this.start_of_statement(T)){var oe=!V;this.handle_whitespace_and_comments(T,oe)}if(T.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(T);return}if(T.text==="::"){this.print_token(T);return}if(this._flags.last_token.type===a.OPERATOR&&n(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(T),T.text===":"&&this._flags.in_case){this.print_token(T),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.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 pe=!0,Ye=!0,xe=!1;if(T.text===":"?this._flags.ternary_depth===0?pe=!1:(this._flags.ternary_depth-=1,xe=!0):T.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!V&&this._options.preserve_newlines&&n(T.text,o)){var Ie=T.text===":",Je=Ie&&xe,Ke=Ie&&!xe;switch(this._options.operator_position){case y.before_newline:this._output.space_before_token=!Ke,this.print_token(T),(!Ie||Je)&&this.allow_wrap_or_preserved_newline(T),this._output.space_before_token=!0;return;case y.after_newline:this._output.space_before_token=!0,!Ie||Je?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(T):this._output.space_before_token=!1,this.print_token(T),this._output.space_before_token=!0;return;case y.preserve_newline:Ke||this.allow_wrap_or_preserved_newline(T),pe=!(this._output.just_added_newline()||Ke),this._output.space_before_token=pe,this.print_token(T),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(T),pe=!1;var be=this._tokens.peek();Ye=be&&n(be.type,[a.WORD,a.RESERVED])}else if(T.text==="...")this.allow_wrap_or_preserved_newline(T),pe=this._flags.last_token.type===a.START_BLOCK,Ye=!1;else if(n(T.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(T),pe=!1,Ye=!1,T.newlines&&(T.text==="--"||T.text==="++"||T.text==="~")){var de=O(this._flags.last_token,C)&&T.newlines;de&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(de,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(pe=!0),this._flags.last_token.type===a.RESERVED?pe=!0:this._flags.last_token.type===a.END_EXPR?pe=!(this._flags.last_token.text==="]"&&(T.text==="--"||T.text==="++")):this._flags.last_token.type===a.OPERATOR&&(pe=n(T.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(T.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&(Ye=!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||pe,this.print_token(T),this._output.space_before_token=Ye},G.prototype.handle_block_comment=function(T,V){if(this._output.raw){this._output.add_raw_token(T),T.directives&&T.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(T.directives){this.print_newline(!1,V),this.print_token(T),T.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(T.text)&&!T.newlines){this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0;return}else this.print_block_commment(T,V)},G.prototype.print_block_commment=function(T,V){var Z=p(T.text),oe,pe=!1,Ye=!1,xe=T.whitespace_before,Ie=xe.length;if(this.print_newline(!1,V),this.print_token_line_indentation(T),this._output.add_token(Z[0]),this.print_newline(!1,V),Z.length>1){for(Z=Z.slice(1),pe=F(Z,"*"),Ye=z(Z,xe),pe&&(this._flags.alignment=1),oe=0;oe=0;d--)if(this.__items[d].match(f))return!0;return!1},D.prototype.set_indent=function(f,d){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(f){this.__items.push(f);var d=f.lastIndexOf(` `);d!==-1?this.__character_count=f.length-d:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function b(f,d){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),d=d||"",f.indent_level>0&&(d=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}b.prototype.get_indent_size=function(f,d){var s=this.__base_string_length;return d=d||0,f<0&&(s=0),s+=f*this.__indent_size,s+=d,s},b.prototype.get_indent_string=function(f,d){var s=this.__base_string;return d=d||0,f<0&&(f=0,s=""),d+=f*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},b.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var f=this.__cache.length,d=0,s="";this.__indent_size&&f>=this.__indent_size&&(d=Math.floor(f/this.__indent_size),f-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),f&&(s+=new Array(f+1).join(" ")),this.__cache.push(s)};function m(f,d){this.__indent_cache=new b(f,d),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(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(f,d){return this.__indent_cache.get_indent_string(f,d)},m.prototype.get_indent_size=function(f,d){return this.__indent_cache.get_indent_size(f,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(f){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 s=this.__lines.join(` `);return f!==` `&&(s=s.replace(/[\n]/g,f)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(f,d){return f=f||0,d=d||0,this.next_line.set_indent(f,d),this.__lines.length>1?(this.current_line.set_indent(f,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(f){for(var d=0;d1&&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(f,d){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(f)!==0&&r.item(-1)!==d){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},k.exports.Output=m},function(k){function D(b,m,f,d){this.type=b,this.text=m,this.comments_before=null,this.newlines=f||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=D},function(k,D){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",s="(?:\\\\u[0-9a-fA-F]{4}|["+b+f+"])",r="(?:\\\\u[0-9a-fA-F]{4}|["+m+f+d+"])*";D.identifier=new RegExp(s+r,"g"),D.identifierStart=new RegExp(s),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+f+d+"])+");var u=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r |`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(k,D,b){var m=b(6).Options,f=["before-newline","after-newline","preserve-newline"];function d(s){m.call(this,s,"js");var r=this.raw_options.brace_style||null;r==="expand-strict"?this.raw_options.brace_style="expand":r==="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 o=0;o>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var y=new RegExp(_),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=h.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(F,z){f.call(this,F,z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new u(this._input),B=new o(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(r.identifier).matching(r.identifierMatch),number:G.matching(w),punct:G.matching(y),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(//),include:G.starting_with(/#include/).until_after(r.lineBreak),shebang:G.starting_with(/#!/).until_after(r.lineBreak),xml:G.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:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};E.prototype=new f,E.prototype._is_comment=function(F){return F.type===n.COMMENT||F.type===n.BLOCK_COMMENT||F.type===n.UNKNOWN},E.prototype._is_opening=function(F){return F.type===n.START_BLOCK||F.type===n.START_EXPR},E.prototype._is_closing=function(F,z){return(F.type===n.END_BLOCK||F.type===n.END_EXPR)&&z&&(F.text==="]"&&z.text==="["||F.text===")"&&z.text==="("||F.text==="}"&&z.text==="{")},E.prototype._reset=function(){p=!1},E.prototype._get_next_token=function(F,z){var G=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(n.EOF,""):(G=G||this._read_non_javascript(B),G=G||this._read_string(B),G=G||this._read_word(F),G=G||this._read_singles(B),G=G||this._read_comment(B),G=G||this._read_regexp(B,F),G=G||this._read_xml(B,F),G=G||this._read_punctuation(),G=G||this._create_token(n.UNKNOWN,this._input.next()),G)},E.prototype._read_word=function(F){var z;if(z=this.__patterns.identifier.read(),z!=="")return z=z.replace(r.allLineBreaks,` `),!(F.type===n.DOT||F.type===n.RESERVED&&(F.text==="set"||F.text==="get"))&&v.test(z)?(z==="in"||z==="of")&&(F.type===n.WORD||F.type===n.STRING)?this._create_token(n.OPERATOR,z):this._create_token(n.RESERVED,z):this._create_token(n.WORD,z);if(z=this.__patterns.number.read(),z!=="")return this._create_token(n.WORD,z)},E.prototype._read_singles=function(F){var z=null;return F==="("||F==="["?z=this._create_token(n.START_EXPR,F):F===")"||F==="]"?z=this._create_token(n.END_EXPR,F):F==="{"?z=this._create_token(n.START_BLOCK,F):F==="}"?z=this._create_token(n.END_BLOCK,F):F===";"?z=this._create_token(n.SEMICOLON,F):F==="."&&O.test(this._input.peek(1))?z=this._create_token(n.DOT,F):F===","&&(z=this._create_token(n.COMMA,F)),z&&this._input.next(),z},E.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(n.EQUALS,F):F==="?."?this._create_token(n.DOT,F):this._create_token(n.OPERATOR,F)},E.prototype._read_non_javascript=function(F){var z="";if(F==="#"){if(this._is_first_token()&&(z=this.__patterns.shebang.read(),z))return this._create_token(n.UNKNOWN,z.trim()+` `);if(z=this.__patterns.include.read(),z)return this._create_token(n.UNKNOWN,z.trim()+` `);F=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(x)){do F=this._input.next(),G+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(n.WORD,G)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(z=this.__patterns.html_comment_start.read(),z){for(;this._input.hasNext()&&!this._input.testChar(r.newline);)z+=this._input.next();return p=!0,this._create_token(n.COMMENT,z)}}else if(p&&F==="-"&&(z=this.__patterns.html_comment_end.read(),z))return p=!1,this._create_token(n.COMMENT,z);return null},E.prototype._read_comment=function(F){var z=null;if(F==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var B=R.get_directives(G);B&&B.ignore==="start"&&(G+=R.readIgnored(this._input)),G=G.replace(r.allLineBreaks,` `),z=this._create_token(n.BLOCK_COMMENT,G),z.directives=B}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),z=this._create_token(n.COMMENT,G))}return z},E.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var z=this._input.next();return this.has_char_escapes=!1,F==="`"?z+=this._read_string_recursive("`",!0,"${"):z+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(z=U(z)),this._input.peek()===F&&(z+=this._input.next()),z=z.replace(r.allLineBreaks,` `),this._create_token(n.STRING,z)}return null},E.prototype._allow_regexp_or_xml=function(F){return F.type===n.RESERVED&&a(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===n.END_EXPR&&F.text===")"&&F.opened.previous.type===n.RESERVED&&a(F.opened.previous.text,["if","while","for"])||a(F.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},E.prototype._read_regexp=function(F,z){if(F==="/"&&this._allow_regexp_or_xml(z)){for(var G=this._input.next(),B=!1,T=!1;this._input.hasNext()&&(B||T||this._input.peek()!==F)&&!this._input.testChar(r.newline);)G+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?T=!0:this._input.peek()==="]"&&(T=!1)),this._input.next();return this._input.peek()===F&&(G+=this._input.next(),G+=this._input.read(r.identifier)),this._create_token(n.STRING,G)}return null},E.prototype._read_xml=function(F,z){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(z)){var G="",B=this.__patterns.xml.read_match();if(B){for(var T=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=T.indexOf("{")===0,Z=0;B;){var oe=!!B[1],pe=B[2],Ye=!!B[B.length-1]||pe.slice(0,8)==="![CDATA[";if(!Ye&&(pe===T||V&&pe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--Z:++Z),G+=B[0],Z<=0)break;B=this.__patterns.xml.read_match()}return B||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(r.allLineBreaks,` `),this._create_token(n.STRING,G)}}return null};function U(F){for(var z="",G=0,B=new m(F),T=null;B.hasNext();)if(T=B.match(/([\s]|[^\\]|\\\\)+/g),T&&(z+=T[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")T=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")T=B.match(/u([0-9A-Fa-f]{4})/g);else{z+="\\",B.hasNext()&&(z+=B.next());continue}if(!T)return F;if(G=parseInt(T[1],16),G>126&&G<=255&&T[0].indexOf("x")===0)return F;if(G>=0&&G<32){z+="\\"+T[0];continue}else G===34||G===39||G===92?z+="\\"+String.fromCharCode(G):z+=String.fromCharCode(G)}return z}E.prototype._read_string_recursive=function(F,z,G){var B,T;F==="'"?T=this.__patterns.single_quote:F==='"'?T=this.__patterns.double_quote:F==="`"?T=this.__patterns.template_text:F==="}"&&(T=this.__patterns.template_expression);for(var V=T.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===F||!z&&r.newline.test(Z)){this._input.back();break}else Z==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===` `&&this._input.next(),Z+=this._input.next()):G&&(G==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),G===Z&&(F==="`"?Z+=this._read_string_recursive("}",z,"`"):Z+=this._read_string_recursive("`",z,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=T.read(),V+=Z}return V},k.exports.Tokenizer=E,k.exports.TOKEN=n,k.exports.positionable_operators=C.slice(),k.exports.line_starters=h.slice()},function(k){var D=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=0&&m=0&&f=m.length&&this.__input.substring(f-m.length,f).toLowerCase()===m},k.exports.InputScanner=b},function(k,D,b){var m=b(8).InputScanner,f=b(3).Token,d=b(10).TokenStream,s=b(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(o,a){this._input=new m(o),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var o,a=new f(r.START,""),n=null,R=[],w=new d;a.type!==r.EOF;){for(o=this._get_next_token(a,n);this._is_comment(o);)w.add(o),o=this._get_next_token(a,n);w.isEmpty()||(o.comments_before=w,w=new d),o.parent=n,this._is_opening(o)?(R.push(n),n=o):n&&this._is_closing(o,n)&&(o.opened=n,n.closed=o,n=R.pop(),o.parent=n),o.previous=a,a.next=o,this.__tokens.add(o),a=o}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(o,a){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(r.RAW,n):this._create_token(r.EOF,"")},u.prototype._is_comment=function(o){return!1},u.prototype._is_opening=function(o){return!1},u.prototype._is_closing=function(o,a){return!1},u.prototype._create_token=function(o,a){var n=new f(o,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=u,k.exports.TOKEN=r},function(k){function D(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position=0&&b/),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(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},d.prototype.read_options=function(s){var r=this._create();for(var u in f)r._disabled[u]=s.templating.indexOf(u)===-1;return r._update(),r},d.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},d.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),s+=r,r=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},d.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},d.prototype._read_template=function(){var s="",r=this._input.peek();if(r==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(s=s||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},k.exports.TemplatablePattern=d}],M={};function H(k){var D=M[k];if(D!==void 0)return D.exports;var b=M[k]={exports:{}};return A[k](b,b.exports,H),b.exports}var P=H(0);N=P})();var K=N;!(te=[],Y=function(){return{js_beautify:K}}.apply(Qe,te),Y!==void 0&&(tn.exports=Y))})()},"6eGT":function(tn,Qe,I){"use strict";function te(Y){return null}Qe.a=te},"7Cbv":function(tn,Qe,I){"use strict";var te=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function N(){if(!te)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Y)}var K=/^(?:[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 A(f){return typeof f=="string"&&K.test(f)}for(var M=A,H=[],P=0;P<256;++P)H.push((P+256).toString(16).substr(1));function k(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(H[f[d+0]]+H[f[d+1]]+H[f[d+2]]+H[f[d+3]]+"-"+H[f[d+4]]+H[f[d+5]]+"-"+H[f[d+6]]+H[f[d+7]]+"-"+H[f[d+8]]+H[f[d+9]]+"-"+H[f[d+10]]+H[f[d+11]]+H[f[d+12]]+H[f[d+13]]+H[f[d+14]]+H[f[d+15]]).toLowerCase();if(!M(s))throw TypeError("Stringified UUID is invalid");return s}var D=k;function b(f,d,s){f=f||{};var r=f.random||(f.rng||N)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,d){s=s||0;for(var u=0;u<16;++u)d[s+u]=r[u];return d}return D(r)}var m=Qe.a=b},"7ahc":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return R});var te=I("k1fw"),Y=I("0Owb"),N=I("+L6B"),K=I("2/Rp"),A=I("y8nQ"),M=I("Vl3Y"),H=I("tJVT"),P=I("OaEy"),k=I("2fM7"),D=I("q1tI"),b=I.n(D),m=I("VrN/"),f=I.n(m),d=I("p77/"),s=I.n(d),r=I("c5Ni"),u=I.n(r),o=k.a.Option,a={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"]};Qe.b=function(w){var x=w.callback,O=w.onCancel,C=Object(D.useState)("python"),_=Object(H.a)(C,2),y=_[0],h=_[1];function c(p){h(n[p][1])}function v(p){x(p)}return b.a.createElement(M.a,Object(Y.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:v}),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(k.a,{onChange:c},Object.keys(n).map(function(p){return b.a.createElement(o,{key:p,value:p},n[p][0])}))),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(R,{mode:y})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(K.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function R(w){var x=w.value,O=w.onChange,C=w.mode,_=w.options,y=_===void 0?{}:_,h=Object(D.useRef)(),c=Object(D.useState)(),v=Object(H.a)(c,2),p=v[0],E=v[1];return Object(D.useEffect)(function(){if(p){function U(F){var z=F.getValue();O&&O(z)}return p.on("change",U),function(){p.off("change",U)}}},[p,O]),Object(D.useEffect)(function(){p&&p.setOption("mode",C)},[p,C]),Object(D.useEffect)(function(){p&&((x!==p.getValue()||x==="")&&setTimeout(function(){p.setValue(x||" ")},300))},[p,x]),Object(D.useEffect)(function(){if(h.current&&!p){var U=f.a.fromTextArea(h.current,Object(te.a)({mode:C,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},y));E(U)}},[h.current,p]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:h}))}},"7ixt":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return N});var te={adjustX:1,adjustY:1},Y=[0,0],N={left:{points:["cr","cl"],overflow:te,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:te,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:te,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:te,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:te,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:te,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:te,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:te,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:te,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:te,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:te,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:te,offset:[-4,0],targetOffset:Y}},K=N},"815F":function(tn,Qe,I){"use strict";I.d(Qe,"e",function(){return H}),I.d(Qe,"c",function(){return k}),I.d(Qe,"d",function(){return D}),I.d(Qe,"a",function(){return m}),I.d(Qe,"f",function(){return f}),I.d(Qe,"b",function(){return d});var te=I("KQm4"),Y=I("VTBJ"),N=I("Ff2n"),K=I("Zm9Q"),A=I("Kwbf"),M=I("OZM5");function H(s,r){return s!=null?s:r}function P(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=new Map;function u(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(o||[]).forEach(function(n){var R=n.key,w=n.children;Object(A.a)(R!=null,"Tree node must have a certain key: [".concat(a).concat(R,"]"));var x=String(R);Object(A.a)(!r.has(x)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(x)),r.set(x,!0),u(w,"".concat(a).concat(x," > "))})}u(s)}function k(s){function r(u){var o=Object(K.a)(u);return o.map(function(a){if(!Object(M.i)(a))return Object(A.a)(!a,"Tree/TreeNode can only accept TreeNode as children."),null;var n=a.key,R=a.props,w=R.children,x=Object(N.a)(R,["children"]),O=Object(Y.a)({key:n},x),C=r(w);return C.length&&(O.children=C),O}).filter(function(a){return a})}return r(s)}function D(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],u=new Set(r===!0?[]:r),o=[];function a(n){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(w,x){var O=Object(M.h)(R?R.pos:"0",x),C=H(w.key,O),_=Object(Y.a)(Object(Y.a)({},w),{},{parent:R,pos:O,children:null,data:w,isStart:[].concat(Object(te.a)(R?R.isStart:[]),[x===0]),isEnd:[].concat(Object(te.a)(R?R.isEnd:[]),[x===n.length-1])});return o.push(_),r===!0||u.has(C)?_.children=a(w.children||[],_):_.children=[],_})}return a(s),o}function b(s,r,u){var o;u?typeof u=="string"?o=function(R){return R[u]}:typeof u=="function"&&(o=function(R){return u(R)}):o=function(R,w){return H(R.key,w)};function a(n,R,w){var x=n?n.children:s,O=n?Object(M.h)(w.pos,R):"0";if(n){var C=o(n,O),_={node:n,index:R,pos:O,key:C,parentPos:w.node?w.pos:null,level:w.level+1};r(_)}x&&x.forEach(function(y,h){a(y,h,{node:n,pos:O,level:w?w.level+1:-1})})}a(null)}function m(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=r.initWrapper,o=r.processEntity,a=r.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,R={},w={},x={posEntities:R,keyEntities:w};return u&&(x=u(x)||x),b(s,function(O){var C=O.node,_=O.index,y=O.pos,h=O.key,c=O.parentPos,v=O.level,p={node:C,index:_,key:h,pos:y,level:v},E=H(h,y);R[y]=p,w[E]=p,p.parent=R[c],p.parent&&(p.parent.children=p.parent.children||[],p.parent.children.push(p)),o&&o(p,x)},n),a&&a(x),x}function f(s,r){var u=r.expandedKeys,o=r.selectedKeys,a=r.loadedKeys,n=r.loadingKeys,R=r.checkedKeys,w=r.halfCheckedKeys,x=r.dragOverNodeKey,O=r.dropPosition,C=r.keyEntities,_=C[s],y={eventKey:s,expanded:u.indexOf(s)!==-1,selected:o.indexOf(s)!==-1,loaded:a.indexOf(s)!==-1,loading:n.indexOf(s)!==-1,checked:R.indexOf(s)!==-1,halfChecked:w.indexOf(s)!==-1,pos:String(_?_.pos:""),dragOver:x===s&&O===0,dragOverGapTop:x===s&&O===-1,dragOverGapBottom:x===s&&O===1};return y}function d(s){var r=s.data,u=s.expanded,o=s.selected,a=s.checked,n=s.loaded,R=s.loading,w=s.halfChecked,x=s.dragOver,O=s.dragOverGapTop,C=s.dragOverGapBottom,_=s.pos,y=s.active,h=Object(Y.a)(Object(Y.a)({},r),{},{expanded:u,selected:o,checked:a,loaded:n,loading:R,halfChecked:w,dragOver:x,dragOverGapTop:O,dragOverGapBottom:C,pos:_,active:y});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(A.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),h}},"8EBN":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"use strict";te.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Y=0;Y-1&&K.substring(H+1,K.length);if(P)return te.findModeByExtension(P)},te.findModeByName=function(K){K=K.toLowerCase();for(var A=0;A=W.length?ne.slice(W.length):ne}).join(` `)}var u=[],o=["
    "],a=new d.a.Renderer,n=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){u.length=0,o=["
      "]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(X,S,L,W){if(S>=X.length||X[S].level<=L)return S;var ne=X[S];W.push("
    • "+ne.text+""),S++;var Q=[];return S=x(X,S,ne.level,Q),Q.length>0&&(W.push("
        "),Q.forEach(function(ke){W.push(ke)}),W.push("
      ")),W.push("
    • "),S=x(X,S,L,W),S}function O(){return x(u,0,0,o),o.push("
    "),o.join("")}var C={heading:function(S){var L=n.exec(S);if(L)return{type:"heading",raw:L[0],depth:L[1].length,text:L[2]}},fences:function(S){var L=this.rules.block.fences.exec(S);if(L){var W=L[0],ne=r(W,L[3]||""),Q=L[2]?L[2].trim():L[2];if(["latex","katex","math"].indexOf(Q)>=0){var ke=h(),Vt=ne;ne=ke,c[ke]={type:"block",expression:Vt}}return{type:"code",raw:W,lang:Q,text:ne}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,y=0,h=function(){return"__special_katext_id_".concat(y++,"__")},c={};function v(){return c}function p(){y=0,c={}}function E(X){return X=X.replace(_,function(S,L){var W=h();return c[W]={type:"inline",expression:L},W}),X}var U=a.listitem;a.listitem=function(X){return U(E(X))};var F=a.paragraph;a.paragraph=function(X){return F(E(X))};var z=a.tablecell;a.tablecell=function(X,S){return z(E(X),S)},a.code=function(X,S,L){var W=(S||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"

    ".concat(X,"

    "):'
    ').concat(L?X:Object(s.escape)(X,!0),`
    `):'
    '+(L?X:Object(s.escape)(X,!0))+"
    "},a.heading=function(X,S,L){var W=this.options.headerPrefix+L.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:W,level:S,text:X}),"'+X+""},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:C,renderer:a});var G=d.a,B=I("SJMd"),T=I("ulZh"),V=I.n(T),Z=I("m3rI"),oe=I("Oy/b"),pe=I("p5ED"),Ye=I("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var xe=function(X,S){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var ne in W)Object.prototype.hasOwnProperty.call(W,ne)&&(L[ne]=W[ne])})(X,S)};function Ie(X,S){function L(){this.constructor=X}xe(X,S),X.prototype=S===null?Object.create(S):(L.prototype=S.prototype,new L)}function Je(X,S,L,W){return new(L||(L=Promise))(function(ne,Q){function ke(Qn){try{kn(W.next(Qn))}catch(nn){Q(nn)}}function Vt(Qn){try{kn(W.throw(Qn))}catch(nn){Q(nn)}}function kn(Qn){var nn;Qn.done?ne(Qn.value):(nn=Qn.value,nn instanceof L?nn:new L(function(ti){ti(nn)})).then(ke,Vt)}kn((W=W.apply(X,S||[])).next())})}function Ke(X,S){var L,W,ne,Q,ke={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return Q={next:Vt(0),throw:Vt(1),return:Vt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function Vt(kn){return function(Qn){return function(nn){if(L)throw new TypeError("Generator is already executing.");for(;ke;)try{if(L=1,W&&(ne=2&nn[0]?W.return:nn[0]?W.throw||((ne=W.return)&&ne.call(W),0):W.next)&&!(ne=ne.call(W,nn[1])).done)return ne;switch(W=0,ne&&(nn=[2&nn[0],ne.value]),nn[0]){case 0:case 1:ne=nn;break;case 4:return ke.label++,{value:nn[1],done:!1};case 5:ke.label++,W=nn[1],nn=[0];continue;case 7:nn=ke.ops.pop(),ke.trys.pop();continue;default:if(!(ne=ke.trys,(ne=ne.length>0&&ne[ne.length-1])||nn[0]!==6&&nn[0]!==2)){ke=0;continue}if(nn[0]===3&&(!ne||nn[1]>ne[0]&&nn[1]',"select"),this.addActionButton(W,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(W,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(W,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(W,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(W,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(W,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(W,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Q){var ke=document.createElement("div");ke.className=""+L.toolbarButtonStyleClass.name,ke.setAttribute("data-type-name",Q.typeName),ke.innerHTML=Q.icon,ke.addEventListener("click",function(){L.markerToolbarButtonClicked(ke,Q)}),L.buttons.push(ke),L.markerButtons.push(ke)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",ne.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ne),this.addActionButton(ne,'',"render"),this.addActionButton(ne,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(S){this.buttonClickListeners.push(S)},X.prototype.removeButtonClickListener=function(S){this.buttonClickListeners.indexOf(S)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(S),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var S=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L0&&this.buttonClickListeners.forEach(function(W){return W("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(S,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(S){this.resetButtonStyles(),S.className=S.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),S.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(S){var L=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===S});L&&this.setActiveButton(L)},X.prototype.setCurrentMarker=function(S){var L=this;this.currentMarker=S,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){L.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},X}(),Nt=function(){function X(S,L,W,ne){this.panels=[],this.panelButtons=[],this.markerjsContainer=S,this.displayMode=L,this.uiStyleSettings=W,this.styles=ne,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var S;this.toolboxStyleClass=this.styles.addClass(new ft("toolbox",` width: 100%; flex-shrink: 0; display: flex; flex-direction: column; font-family: sans-serif; `+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+` box-sizing: content-box; `+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+` `+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+` `+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+` overflow: hidden; `)),this.toolboxStyleColorsClass=this.styles.addClass(new ft("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ft("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ft("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ft("toolbox-panel-row",` display: flex; `+(this.displayMode==="inline"?"position: absolute;":"")+` `+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+` cursor: default; height: `+1.5*this.uiStyleSettings.toolbarHeight+`px; `+(this.displayMode==="inline"?"width: 100%;":"")+` box-sizing: content-box; `)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ft("toolbox-panel-row_colors",` background-color: `+((S=this.uiStyleSettings.toolboxBackgroundColor)!==null&&S!==void 0?S:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new ft("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px; padding: `+L+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ft("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ft("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new ze("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new ze("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},X.prototype.show=function(S){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(S){var L,W,ne=this;this.panels=S,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var ke;Q.uiStyleSettings=ne.uiStyleSettings;var Vt=document.createElement("div");Vt.className=ne.toolboxButtonStyleClass.name+" "+((ke=ne.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ke!==void 0?ke:ne.toolboxButtonStyleColorsClass.name),Vt.innerHTML=Q.icon,Vt.title=Q.title,Vt.addEventListener("click",function(){ne.panelButtonClick(Q)}),ne.panelButtons.push(Vt),ne.buttonRow.appendChild(Vt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(S){var L=this,W=-1;if(S!==this.activePanel){W=this.panels.indexOf(S),this.panelRow.innerHTML="";var ne=S.getUi();ne.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ne),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=S}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,ke){var Vt,kn;Q.className=L.toolboxButtonStyleClass.name+" "+(ke===W?""+((Vt=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Vt!==void 0?Vt:L.toolboxActiveButtonStyleColorsClass.name):""+((kn=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&kn!==void 0?kn:L.toolboxButtonStyleColorsClass.name))})},X}(),Ze=function(X,S){this.title=X,this.icon=S},Bt=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,Q||'')||this;return ke.colors=[],ke.addTransparent=!1,ke.colorBoxes=[],ke.colors=W,ke.currentColor=ne,ke.setCurrentColor=ke.setCurrentColor.bind(ke),ke.getColorBox=ke.getColorBox.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ne){var Q=L.getColorBox(ne);W.appendChild(Q),L.colorBoxes.push(Q)}),W},S.prototype.getColorBox=function(L){var W=this,ne=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-ne,ke=document.createElement("div");ke.style.display="inline-block",ke.style.boxSizing="content-box",ke.style.width=Q-2+"px",ke.style.height=Q-2+"px",ke.style.padding="1px",ke.style.marginRight="2px",ke.style.marginBottom="2px",ke.style.borderWidth="2px",ke.style.borderStyle="solid",ke.style.borderRadius=(Q+2)/2+"px",ke.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ke.addEventListener("click",function(){W.setCurrentColor(L,ke)});var Vt=document.createElement("div");return Vt.style.display="inline-block",Vt.style.width=Q-2+"px",Vt.style.height=Q-2+"px",Vt.style.backgroundColor=L,Vt.style.borderRadius=Q/2+"px",L==="transparent"&&(Vt.style.fill=this.uiStyleSettings.toolboxAccentColor,Vt.innerHTML=` `),ke.appendChild(Vt),ke},S.prototype.setCurrentColor=function(L,W){var ne=this;this.currentColor=L,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},S}(Ze),Ut=function(){function X(S,L,W){this._state="new",this._isSelected=!1,this._container=S,this._overlayContainer=L,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(S){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(S,L){},X.prototype.dblClick=function(S,L){},X.prototype.manipulate=function(S){},X.prototype.pointerUp=function(S){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(S){this.container.childNodes.length>0?this.container.insertBefore(S,this.container.childNodes[0]):this.container.appendChild(S)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(S){this._state=S.state,this.notes=S.notes},X.prototype.scale=function(S,L){},X.prototype.colorChanged=function(S){this.onColorChanged&&this.onColorChanged(S),this.stateChanged()},X.prototype.fillColorChanged=function(S){this.onFillColorChanged&&this.onFillColorChanged(S),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var S=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),S.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(S)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Mt=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(S){return this.topLeft.ownsTarget(S)?this.topLeft:this.topCenter.ownsTarget(S)?this.topCenter:this.topRight.ownsTarget(S)?this.topRight:this.centerLeft.ownsTarget(S)?this.centerLeft:this.centerRight.ownsTarget(S)?this.centerRight:this.bottomLeft.ownsTarget(S)?this.bottomLeft:this.bottomCenter.ownsTarget(S)?this.bottomCenter:this.bottomRight.ownsTarget(S)?this.bottomRight:void 0},X}(),An=function(){function X(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},X}(),mn=function(){function X(){}return X.toITransformMatrix=function(S){return{a:S.a,b:S.b,c:S.c,d:S.d,e:S.e,f:S.f}},X.toSVGMatrix=function(S,L){return S.a=L.a,S.b=L.b,S.c=L.c,S.d=L.d,S.e=L.e,S.f=L.f,S},X}(),pn=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(de.createTransform()),Q.setupControlBox(),Q}return Ie(S,X),Object.defineProperty(S.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var W=de.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(L){return!!X.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ne=this.unrotatePoint(L);if(this.manipulationStartX=ne.x,this.manipulationStartY=ne.y,this.offsetX=ne.x-this.left,this.offsetY=ne.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ke=this.container.transform.baseVal.getItem(0);ke.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ke,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},S.prototype.pointerUp=function(L){var W=this.state;X.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},S.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},S.prototype.manipulate=function(L){var W=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(L)},S.prototype.resize=function(L){var W=this.manipulationStartLeft,ne=this.manipulationStartWidth,Q=this.manipulationStartTop,ke=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+L.x-this.manipulationStartX,ne=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ne=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+L.y-this.manipulationStartY,ke=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ke=this.manipulationStartHeight+L.y-this.manipulationStartY}ne>=0?(this.left=W,this.width=ne):(this.left=W+ne,this.width=-ne),ke>=0?(this.top=Q,this.height=ke):(this.top=Q+ke,this.height=-ke),this.setSize()},S.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},S.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var W=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},S.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},S.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var W=this.container.getCTM(),ne=de.createPoint(L.x,L.y);return{x:(ne=ne.matrixTransform(W)).x,y:ne.y}},S.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var W=this.container.getCTM();W=W.inverse();var ne=de.createPoint(L.x,L.y);return{x:(ne=ne.matrixTransform(W)).x,y:ne.y}},S.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var L=de.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=de.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=de.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Mt,this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},S.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},S.prototype.createGrip=function(){var L=new An;return L.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(L.visual),L},S.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,W=-L/2,ne=W,Q=(this.width+this.CB_DISTANCE)/2-L/2,ke=(this.height+this.CB_DISTANCE)/2-L/2,Vt=this.height+this.CB_DISTANCE-L/2,kn=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ne),this.positionGrip(this.controlGrips.topCenter.visual,Q,ne),this.positionGrip(this.controlGrips.topRight.visual,kn,ne),this.positionGrip(this.controlGrips.centerLeft.visual,W,ke),this.positionGrip(this.controlGrips.centerRight.visual,kn,ke),this.positionGrip(this.controlGrips.bottomLeft.visual,W,Vt),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,Vt),this.positionGrip(this.controlGrips.bottomRight.visual,kn,Vt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,ne-3*this.CB_DISTANCE)},S.prototype.positionGrip=function(L,W,ne){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(W,ne),L.transform.baseVal.replaceItem(Q,0)},S.prototype.hideControlBox=function(){this.controlBox.style.display="none"},S.prototype.showControlBox=function(){this.controlBox.style.display=""},S.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:mn.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:mn.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(mn.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(mn.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W);var ne=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:ne.x*L,y:ne.y*W});this.left=Q.x,this.top=Q.y,this.width=this.width*L,this.height=this.height*W,this.adjustControlBox()},S}(Ut),tt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual)},S.prototype.createVisual=function(){this.visual=de.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.manipulate=function(L){X.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){X.prototype.resize.call(this,L),this.setSize()},S.prototype.setSize=function(){X.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(L){X.prototype.pointerUp.call(this,L),this.setSize()},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},S.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},S.prototype.restoreState=function(L){var W=L;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),X.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.setSize()},S.title="Rectangle marker",S}(pn),fn=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,Q||'')||this;return ke.widths=[],ke.widthBoxes=[],ke.widths=W,ke.currentWidth=ne,ke.setCurrentWidth=ke.setCurrentWidth.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ne){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ne===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentWidth(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.innerText=ne.toString(),ke.style.marginRight="5px",Q.appendChild(ke);var Vt=document.createElement("div");Vt.style.minHeight="20px",Vt.style.flexGrow="2",Vt.style.display="flex",Vt.style.alignItems="center";var kn=document.createElement("hr");kn.style.minWidth="20px",kn.style.border="0px",kn.style.borderTop=ne+"px solid "+L.uiStyleSettings.toolboxColor,kn.style.flexGrow="2",Vt.appendChild(kn),Q.appendChild(Vt),L.widthBoxes.push(Q)}),W},S.prototype.setCurrentWidth=function(L,W){var ne=this;this.currentWidth=L,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},S}(Ze),In=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,Q||'')||this;return ke.styles=[],ke.styleBoxes=[],ke.styles=W,ke.currentStyle=ne,ke.setCurrentStyle=ke.setCurrentStyle.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ne){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.styles.length-5+"%",Q.style.borderColor=ne===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentStyle(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.overflow="hidden";var Vt=` `;ke.innerHTML=Vt,Q.appendChild(ke),L.styleBoxes.push(Q)}),W},S.prototype.setCurrentStyle=function(L,W){var ne=this;this.currentStyle=L,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},S}(Ze),He=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new Bt("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new In("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ie(S,X),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="FrameMarker",S.title="Frame marker",S.icon='',S}(tt),Ue=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},pt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!!X.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},S.prototype.pointerUp=function(L){var W=this.state;X.prototype.pointerUp.call(this,L),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(L),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},S.prototype.adjustVisual=function(){},S.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},S.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},S.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){this.positionGrips()},S.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},S.prototype.createGrip=function(){var L=new An;return L.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(L.visual),L},S.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},S.prototype.positionGrip=function(L,W,ne){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(W,ne),L.transform.baseVal.replaceItem(Q,0)},S.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.x1=this.x1*L,this.y1=this.y1*W,this.x2=this.x2*L,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},S}(Ut),Ct=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new Bt("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new In("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},S.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},S.typeName="LineMarker",S.title="Line marker",S.icon='',S}(pt),Ge=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,Q||'')||this;return ke.fonts=[],ke.fontBoxes=[],ke.fonts=W,ke.currentFont=ne,ke.setCurrentFont=ke.setCurrentFont.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ne){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.fonts.length-5+"%",Q.style.borderColor=ne===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentFont(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.style.display="flex",ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.fontFamily=ne,ke.style.overflow="hidden";var Vt=document.createElement("div");Vt.style.whiteSpace="nowrap",Vt.style.overflow="hidden",Vt.style.textOverflow="ellipsis",Vt.innerHTML="The quick brown fox jumps over the lazy dog",ke.appendChild(Vt),Q.appendChild(ke),L.fontBoxes.push(Q)}),W},S.prototype.setCurrentFont=function(L,W){var ne=this;this.currentFont=L,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},S}(Ze),vt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=ne.defaultColor,Q.fontFamily=ne.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new Bt("Color",ne.defaultColorSet,ne.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new Ge("Font",ne.defaultFontFamilies,ne.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){if(X.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ne){ne===L&&(W=!0)}),W},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.renderText=function(){var L=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(W){L.textElement.appendChild(de.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},S.prototype.getTextScale=function(){var L=this.textElement.getBBox(),W=1;if(L.width>0&&L.height>0){var ne=(1*this.width-this.width*this.padding*2/100)/L.width,Q=(1*this.height-this.height*this.padding*2/100)/L.height;W=Math.min(ne,Q)}return W},S.prototype.getTextPosition=function(L){var W=this.textElement.getBBox(),ne=0,Q=0;return W.width>0&&W.height>0&&(ne=(this.width-W.width*L)/2,Q=this.height/2-W.height*L/2),{x:ne,y:Q}},S.prototype.sizeText=function(){var L=this.textElement.getBBox(),W=this.getTextScale(),ne=this.getTextPosition(W);ne.y-=L.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ne.x+"px, "+ne.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ne.x,ne.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},S.prototype.manipulate=function(L){X.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(L){X.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},S.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},S.prototype.pointerUp=function(L){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,L),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.showTextEditor=function(){var L=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&W>.9;)W-=.1,L.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ne=W.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(ne)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},S.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ne=this.textElement.getBBox(),Q={x:ne.width*L,y:ne.height*L};W.x-=Q.x/2,W.y-=Q.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},S.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},S.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},S.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},S.prototype.dblClick=function(L,W){X.prototype.dblClick.call(this,L,W),this.showTextEditor()},S.prototype.setColor=function(L){this.textElement&&de.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},S.prototype.setFont=function(L){this.textElement&&de.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},S.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},S.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){var W=L;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),X.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.setSize(),this.sizeText(),this.positionTextEditor()},S.typeName="TextMarker",S.title="Text marker",S.icon='',S}(pn),Ae=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=ne.defaultColor,Q.lineWidth=ne.defaultStrokeWidth,Q.pixelRatio=ne.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new Bt("Color",ne.defaultColorSet,ne.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var L=de.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(L.x,L.y),this.drawing=!0):X.prototype.pointerDown.call(this,L,W)},S.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){X.prototype.resize.call(this,L),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,L)},S.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},S.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},S.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},S.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ne=W[0],Q=W[1],ke=W[2],Vt=W[3],kn=!1,Qn=0;Qn0&&(kn=!0,QnVt&&(Vt=Qn),nn>ke&&(ke=nn));if(kn){this.left=ne/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(ke-ne)/this.pixelRatio,this.height=(Vt-Q)/this.pixelRatio;var ti=document.createElement("canvas");ti.width=ke-ne,ti.height=Vt-Q,ti.getContext("2d").putImageData(this.canvasContext.getImageData(ne,Q,ke-ne,Vt-Q),0,0),this.drawingImgUrl=ti.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},S.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},S.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},S.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){this.createVisual(),X.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.setDrawingImage()},S.typeName="FreehandMarker",S.title="Freehand marker",S.icon='',S}(pn),ge=function(X){function S(L,W,ne){var Q=X.call(this,L,ne||'')||this;return Q.typeBoxes=[],Q.currentType=W,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ne=function(Vt){var kn="both";switch(Vt){case 0:kn="both";break;case 1:kn="start";break;case 2:kn="end";break;case 3:kn="none"}var Qn=document.createElement("div");if(Qn.style.display="flex",Qn.style.flexGrow="2",Qn.style.alignItems="center",Qn.style.justifyContent="space-between",Qn.style.padding="5px",Qn.style.borderWidth="2px",Qn.style.borderStyle="solid",Qn.style.borderColor=kn===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",Qn.addEventListener("click",function(){L.setCurrentType(kn,Qn)}),W.appendChild(Qn),kn==="both"||kn==="start"){var nn=document.createElement("div");nn.style.display="flex",nn.style.alignItems="center",nn.style.minHeight="20px",nn.innerHTML=` `,nn.style.marginLeft="5px",Qn.appendChild(nn)}var ti=document.createElement("div");ti.style.display="flex",ti.style.alignItems="center",ti.style.minHeight="20px",ti.style.flexGrow="2";var qn=document.createElement("hr");if(qn.style.minWidth="20px",qn.style.border="0px",qn.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),qn.style.flexGrow="2",ti.appendChild(qn),Qn.appendChild(ti),kn==="both"||kn==="end"){var Li=document.createElement("div");Li.style.display="flex",Li.style.alignItems="center",Li.style.minHeight="20px",Li.innerHTML=` `,Li.style.marginRight="5px",Qn.appendChild(Li)}Q.typeBoxes.push(Qn)},Q=this,ke=0;ke<4;ke++)ne(ke);return W},S.prototype.setCurrentType=function(L,W){var ne=this;this.currentType=L,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},S}(Ze),Ee=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new ge("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},S.prototype.getArrowPoints=function(L,W){var ne=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return L-ne/2+","+(W+Q/2)+" "+L+","+(W-Q/2)+" "+(L+ne/2)+","+(W+Q/2)},S.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ne=this.arrow2.transform.baseVal.getItem(0);ne.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ne,0)}},S.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},S.typeName="ArrowMarker",S.title="Arrow marker",S.icon='',S}(Ct),ae=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.fillColor=ne.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new Bt("Color",ne.defaultColorSet,ne.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return Ie(S,X),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="CoverMarker",S.title="Cover marker",S.icon='',S}(tt),re=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,Q||'')||this;return ke.opacities=[],ke.opacityBoxes=[],ke.opacities=W,ke.currentOpacity=ne,ke.setCurrentOpacity=ke.setCurrentOpacity.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ne){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ne===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentOpacity(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.innerText=100*ne+"%",Q.appendChild(ke),L.opacityBoxes.push(Q)}),W},S.prototype.setCurrentOpacity=function(L,W){var ne=this;this.currentOpacity=L,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},S}(Ze),he=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=ne.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=ne.defaultHighlightOpacity,Q.fillPanel=new Bt("Color",ne.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new re("Opacity",ne.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Ie(S,X),S.prototype.setOpacity=function(L){this.opacity=L,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="HighlightMarker",S.title="Highlight marker",S.icon='',S}(ae),ve='',me=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=ne.defaultStrokeColor,Q.bgColor=ne.defaultFillColor,Q.fontFamily=ne.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new Bt("Text color",ne.defaultColorSet,Q.color,''),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new Bt("Fill color",ne.defaultColorSet,Q.bgColor,ve),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new Ge("Font",ne.defaultFontFamilies,ne.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new An,Q.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return X.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},S.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},S.prototype.pointerDown=function(L,W){this.state==="new"&&X.prototype.pointerDown.call(this,L,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,L,W)},S.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,L);else{var W=this.state==="creating";X.prototype.pointerUp.call(this,L),this.setTipPoints(W),this.positionTip()}},S.prototype.manipulate=function(L){if(this.tipMoving){var W=this.unrotatePoint(L);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,L)},S.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",L]]),de.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},S.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},S.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var W=Math.min(this.height/2,15),ne=this.height/5;L&&(this.tipPosition={x:W+ne/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?Q.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ne=this.tip2.transform.baseVal.getItem(0);ne.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ne,0)}},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},S.typeName="MeasurementMarker",S.title="Measurement marker",S.icon='',S}(Ct),Jt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.strokePanel.colors=ne.defaultColorSet,Q.fillColor="transparent",Q}return Ie(S,X),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="EllipseFrameMarker",S.title="Ellipse frame marker",S.icon='',S}(Be),En=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(S){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(S)||(this.undoStack.push(S),JSON.stringify(this.lastRedoStep)!==JSON.stringify(S)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(S){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=S)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var S=this.undoStack.pop();return S!==void 0&&this.redoStack.push(S),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),mt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new Bt("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new In("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},S.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},S.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},S.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},S.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},S.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),X.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),X.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},S.prototype.scale=function(L,W){this.curveX=this.curveX*L,this.curveY=this.curveY*W,X.prototype.scale.call(this,L,W)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},S.typeName="CurveMarker",S.title="Curve marker",S.icon='',S}(pt),Qt=function(){function X(S,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=S,this.cancelable=L}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),gt=function(X){function S(L,W,ne){var Q=X.call(this,L,!1)||this;return Q.dataUrl=W,Q.state=ne,Q}return Ie(S,X),S}(Qt),yt=function(X){function S(L,W,ne){ne===void 0&&(ne=!1);var Q=X.call(this,L,ne)||this;return Q.marker=W,Q}return Ie(S,X),S}(Qt),rt=function(){function X(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return X.prototype.addEventListener=function(S,L){this[S].push(L)},X.prototype.removeEventListener=function(S,L){var W=this[S].indexOf(L);W>-1&&this[S].splice(W,1)},X}(),ce=function(){function X(S){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ue,this._isOpen=!1,this.undoRedoManager=new En,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new rt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new wt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=S,this.targetRoot=document.body,this.width=S.clientWidth,this.height=S.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[He,Ae,Ee,vt,Jt,Be,he,me,Tt,ae,Ct,mt]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[He,Ae,Ee,vt,Be,he,me]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[He,Ae,Ee,vt,he]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(S){var L=this;this._availableMarkerTypes.splice(0),S.forEach(function(W){if(typeof W=="string"){var ne=L.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===W});ne!==void 0&&L._availableMarkerTypes.push(ne)}else L._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(S){this._zoomLevel=S,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),nt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var S=this;this.styles.styleSheetRoot===void 0&&jt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=jt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new Qt(S))})},X.prototype.render=function(){return Je(this,void 0,void 0,function(){var S;return Ke(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(S=new Kt).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.markersOnly=this.renderMarkersOnly,S.width=this.renderWidth,S.height=this.renderHeight,[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},X.prototype.close=function(S){var L=this;if(S===void 0&&(S=!1),this.isOpen){var W=!1;S||this.eventListeners.beforeclose.forEach(function(ne){var Q=new Qt(L,!0);ne(Q),Q.defaultPrevented&&(W=!0)}),W||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ne){return ne(new Qt(L))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var S,L=[],W=0;Wthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*S:this.editorCanvas.clientWidth,W=L',S.title="Powered by marker.js",S.style.display="grid",S.style.alignItems="center",S.style.justifyItems="center",S.style.padding="3px",S.style.width="20px",S.style.height="20px",this.logoUI.appendChild(S),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new dt(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(S),1),S.dispose()},X.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},X.prototype.toolbarButtonClicked=function(S,L){if(S==="marker"&&L!==void 0)this.createNewMarker(L);else if(S==="action")switch(L){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var S=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ne){var Q=new yt(S,S._currentMarker,!0);ne(Q),Q.defaultPrevented&&(L=!0)}),!L){var W=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ne){return ne(new yt(S,W))})}}},X.prototype.clear=function(){var S=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ke){var Vt=new yt(S,void 0,!0);ke(Vt),Vt.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var W=function(ke){var Vt=ne.markers[ke];ne.setCurrentMarker(ne.markers[ke]),ne._currentMarker.dispose(),ne.markerImage.removeChild(ne._currentMarker.container),ne.markers.splice(ne.markers.indexOf(ne._currentMarker),1),ne.eventListeners.markerdelete.forEach(function(kn){return kn(new yt(S,Vt))})},ne=this,Q=this.markers.length-1;Q>=0;Q--)W(Q);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var S;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(S=this._currentMarker.notes)!==null&&S!==void 0?S:"",this.overlayContainer.appendChild(this.notesArea))},X.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var S=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===L.width&&W.height===L.height){var ne=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),ne1&&this.panTo({x:S.clientX,y:S.clientY}))},X.prototype.onPointerUp=function(S){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(S.clientX,S.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(S){this._currentMarker===void 0||this.notesArea!==void 0||S.key!=="Delete"&&S.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(S,L){var W=this.markerImage.getBoundingClientRect();return{x:(S-W.left)/this.zoomLevel,y:(L-W.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(S){nt.addKey(S)},X.prototype.addEventListener=function(S,L){this.eventListeners.addEventListener(S,L)},X.prototype.removeEventListener=function(S,L){this.eventListeners.removeEventListener(S,L)},X.prototype.renderState=function(S){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var S=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new Qt(S))}))},X.prototype.blur=function(){var S=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new Qt(S))}))},X.instanceCounter=0,X}();/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE copyright Alan Mendelevich see README and LICENSE for details ********************************** *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Re=function(X,S){return(Re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var ne in W)Object.prototype.hasOwnProperty.call(W,ne)&&(L[ne]=W[ne])})(X,S)};function At(X,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function L(){this.constructor=X}Re(X,S),X.prototype=S===null?Object.create(S):(L.prototype=S.prototype,new L)}function ot(X,S,L,W){return new(L||(L=Promise))(function(ne,Q){function ke(Qn){try{kn(W.next(Qn))}catch(nn){Q(nn)}}function Vt(Qn){try{kn(W.throw(Qn))}catch(nn){Q(nn)}}function kn(Qn){var nn;Qn.done?ne(Qn.value):(nn=Qn.value,nn instanceof L?nn:new L(function(ti){ti(nn)})).then(ke,Vt)}kn((W=W.apply(X,S||[])).next())})}function Yt(X,S){var L,W,ne,Q,ke={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return Q={next:Vt(0),throw:Vt(1),return:Vt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function Vt(kn){return function(Qn){return function(nn){if(L)throw new TypeError("Generator is already executing.");for(;ke;)try{if(L=1,W&&(ne=2&nn[0]?W.return:nn[0]?W.throw||((ne=W.return)&&ne.call(W),0):W.next)&&!(ne=ne.call(W,nn[1])).done)return ne;switch(W=0,ne&&(nn=[2&nn[0],ne.value]),nn[0]){case 0:case 1:ne=nn;break;case 4:return ke.label++,{value:nn[1],done:!1};case 5:ke.label++,W=nn[1],nn=[0];continue;case 7:nn=ke.ops.pop(),ke.trys.pop();continue;default:if(!(ne=ke.trys,(ne=ne.length>0&&ne[ne.length-1])||nn[0]!==6&&nn[0]!==2)){ke=0;continue}if(nn[0]===3&&(!ne||nn[1]>ne[0]&&nn[1]0&&L>0){var W=new Ti(S,L),ne=W.ratio>=1?20:W.getHorizontalLength(20),Q=W.ratio<1?20:W.getVerticalLength(20),ke=document.createElementNS("http://www.w3.org/2000/svg","svg");ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),ke.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ke);var Vt=_e.createDefs();ke.appendChild(Vt);var kn=_e.createElement("clipPath",[["id","text-bg-clip"]]);Vt.appendChild(kn);var Qn=_e.createPath(_e.getHollowRectanglePath((24-ne)/2,(24-Q)/2,ne,Q,(24-ne)/2+2,(24-Q)/2+2,ne-4,Q-4));ke.appendChild(Qn);var nn=_e.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);nn.appendChild(_e.createTSpan(S+":"+L)),ke.appendChild(nn);var ti=nn.getBBox();_e.setAttributes(nn,[["x",((24-ti.width)/2).toString()],["y",((24-ti.height)/2-ti.y).toString()]]);var qn=_e.createPath(_e.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ti.width))/2,(24-Math.ceil(ti.height))/2,Math.ceil(ti.width),Math.ceil(ti.height)));return kn.appendChild(qn),_e.setAttributes(Qn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ke),ke.outerHTML}return''},X}(),hi=function(X){function S(L,W,ne){var Q=X.call(this,L,W)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=ne,Q}return At(S,X),S.prototype.setupDropdown=function(){var L=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=L.className,W.colorsClassName=L.colorsClassName,L.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},S.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},S.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},S.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},S.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},S.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},S}($n),fi=function(){function X(S,L){this.GRIP_SIZE=10,this.color=S,this.fillColor=L,this.visual=_e.createGroup(),this.visual.appendChild(_e.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_e.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},X.prototype.setCenter=function(S,L){this.visual.childNodes.forEach(function(W){return _e.setAttributes(W,[["cx",S.toString()],["cy",L.toString()]])})},X}(),ji=function(){function X(S,L,W,ne){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=S,this.canvasHeight=L,this.margin=W,this.container=ne,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(S){this._aspectRatio=S,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.gridContainer&&_e.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(S){this._zoomFactor=S,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var S=this;this.cropShadeElement=_e.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=_e.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var L=0;Lthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-L.height/2),_e.setAttributes(this.cropRectElement,[["x",L.x.toString()],["y",L.y.toString()],["width",L.width.toString()],["height",L.height.toString()]]);var W=L.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,ke){var Vt=L.y+W*(ke+1);_e.setAttributes(Q,[["x1",""+L.x],["y1",""+Vt],["x2",""+(L.x+L.width)],["y2",""+Vt]])});var ne=L.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,ke){var Vt=L.x+ne*(ke+1);_e.setAttributes(Q,[["x1",""+Vt],["y1",""+L.y],["x2",""+Vt],["y2",""+(L.y+L.height)]])}),_e.setAttributes(this.cropShadeElement,[["d",_e.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,L.x,L.y,L.width,L.height)]]),this.topLeftGrip.setCenter(L.x,L.y),this.topRightGrip.setCenter(L.x+L.width,L.y),this.bottomLeftGrip.setCenter(L.x,L.y+L.height),this.bottomRightGrip.setCenter(L.x+L.width,L.y+L.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},X.prototype.clientToLocalCoordinates=function(S,L){var W=this.container.getBoundingClientRect();return{x:S-W.left+this.margin,y:L-W.top+this.margin}},X.prototype.onPointerDown=function(S){this.container.setPointerCapture(S.pointerId),this.previousPoint=this.clientToLocalCoordinates(S.clientX,S.clientY),this.cropRectElement===S.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(S.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(S.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(S.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(S.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(S){if(this.isMoving)this.move(this.clientToLocalCoordinates(S.clientX,S.clientY));else if(this.activeGrip){var L=this.clientToLocalCoordinates(S.clientX,S.clientY);this.resize(L)}S.preventDefault()},X.prototype.onPointerUp=function(S){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(S.pointerId)},X.prototype.move=function(S){var L=S.x-this.previousPoint.x,W=S.y-this.previousPoint.y;this.zoomFactor!==1&&(L=-L/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+L),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=S},X.prototype.resize=function(S){var L=Object.assign({},this.cropRect),W=S.x-this.previousPoint.x,ne=S.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:L.x+Wthis.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-L.width),L.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(L.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),L.height=this.aspectRatio.getVerticalLength(L.width)):(L.y+=ne,L.height=this.cropRect.y+this.cropRect.height-L.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?L.height=this.aspectRatio.getVerticalLength(L.width):L.height+=ne}L.width<10&&(L.x=this.cropRect.x,L.width=10),L.height<10&&(L.y=this.cropRect.y,L.height=10),this.previousPoint=S,L.x>=this.margin&&L.y>=this.margin&&L.x-this.margin+L.width<=this.canvasWidth&&L.y-this.margin+L.height<=this.canvasHeight&&(this.cropRect=L,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var S=this.cropRect.x+this.cropRect.width/2,L=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ne=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=S-this.cropRect.width/2,this.cropRect.y=L-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},X.prototype.getRescaledRect=function(S,L,W,ne,Q,ke){var Vt=W/S,kn=ne/L;return{x:(Q.x-ke)*Vt+ke,y:(Q.y-ke)*kn+ke,width:Q.width*Vt,height:Q.height*kn}},X.prototype.scaleCanvas=function(S,L){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,S,L,this.cropRect,this.margin);this.canvasWidth=S,this.canvasHeight=L,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},X}(),er=function(){function X(S){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=S,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(X.prototype,"angle",{get:function(){return this._angle},set:function(S){this._angle=S,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},X.prototype.onPointerDown=function(S){this.controlContainer.setPointerCapture(S.pointerId),this.isDragging=!0,this.previousPoint={x:S.clientX,y:S.clientY}},X.prototype.onPointerMove=function(S){this.isDragging&&(this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.previousPoint.x=S.clientX)},X.prototype.onPointerUp=function(S){this.isDragging&&this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(S.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var S=this.angleLabelText.getBBox();_e.setAttributes(this.angleLabelElement,[["x",((this.width-S.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var S=this.scaleShape.transform.baseVal.getItem(0);S.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(S,0)}},X.prototype.getVisual=function(){var S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("width",this.width+"px"),S.setAttribute("height",this.height+"px"),S.setAttribute("viewBox","0 0 "+this.width+" "+this.height),S.style.flexShrink="0",document.body.appendChild(S);for(var L="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ne=W%5==0?this.height/3:this.height/6;L+="h4v"+-ne+"h1v"+ne}L+="v1H0Z",this.scaleShape=_e.createPath(L);var Q=_e.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),S.appendChild(this.scaleShape),this.angleLabelElement=_e.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=_e.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ke=_e.createTSpan("");return ke.innerHTML="°",this.angleLabelElement.appendChild(ke),S.appendChild(this.angleLabelElement),document.body.removeChild(S),S},X}(),yr=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(S,L,W,ne,Q,ke,Vt){var kn=this;return new Promise(function(Qn){var nn=document.createElement("canvas");nn.width=S.width.baseVal.value-2*ne,nn.height=S.height.baseVal.value-2*ne;var ti=1,qn=1;kn.naturalSize===!0?(ti=L.naturalWidth/(S.width.baseVal.value-2*ne)/ke,qn=L.naturalHeight/(S.height.baseVal.value-2*ne)/Vt,nn.width=L.naturalWidth/ke,nn.height=L.naturalHeight/Vt):kn.width!==void 0&&kn.height!==void 0&&(ti=kn.width/W.width,qn=kn.height/W.height,nn.width*=ti,nn.height*=qn);var Li=nn.getContext("2d");Li.translate(nn.width/2,nn.height/2),Li.rotate(Q*Math.PI/180),Li.scale(ke,Vt),Li.translate(-nn.width/2,-nn.height/2),Li.drawImage(L,0,0,nn.width,nn.height);var lr=document.createElement("canvas");lr.width=W.width*ti,lr.height=W.height*qn,lr.getContext("2d").putImageData(Li.getImageData((W.x-ne)*ti,(W.y-ne)*qn,W.width*ti,W.height*qn),0,0),Qn(lr.toDataURL(kn.imageType,kn.imageQuality))})},X}(),cn=function(){function X(S){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=X.instanceCounter++,this.styles=new Ne(this.instanceNo),this.target=S,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(S){this._zoomToCropEnabled=S,S?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(S){this._gridLines=S,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(S){this._rotationAngle=S,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var S;return(S=this._aspectRatio)!==null&&S!==void 0?S:this.aspectRatios[0]},set:function(S){this._aspectRatio=S},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(S){S===void 0&&(S=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),S||this.closeEventListeners.forEach(function(L){return L()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(S){this.renderEventListeners.push(S)},X.prototype.removeRenderEventListener=function(S){this.renderEventListeners.indexOf(S)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(S),1)},X.prototype.addCloseEventListener=function(S){this.closeEventListeners.push(S)},X.prototype.removeCloseEventListener=function(S){this.closeEventListeners.indexOf(S)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(S),1)},X.prototype.setupResizeObserver=function(){var S=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var S=1*this.target.clientWidth/this.target.clientHeight,L=this.contentDiv.clientWidth/S>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*S:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=L+2*this.CANVAS_MARGINS+this.CANVAS_MARGIN?this.target.offsetTop-(S+this.CANVAS_MARGIN):0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var S=this;this.topToolbar=new vn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var L=new ci;L.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(L);var W=[];this.aspectRatios.forEach(function(qn){var Li=new $n(Wi.getIcon(qn.horizontal,qn.vertical),qn.horizontal===0&&qn.vertical===0?"FREE":qn.horizontal+":"+qn.vertical);Li.onClick=function(){return S.ratioButtonClicked(qn)},W.push(Li)}),this.aspectRatioButton=new hi(Wi.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,L.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ne=new $n('',"Toggle grid");ne.isActive=this.isGridVisible,ne.onClick=function(){S.isGridVisible=!S.isGridVisible,ne.isActive=S.isGridVisible},L.addButton(ne);var Q=new $n('',"Zoom to selection");if(Q.isActive=this.zoomToCropEnabled,Q.onClick=function(){S.zoomToCropEnabled=!S.zoomToCropEnabled,Q.isActive=S.zoomToCropEnabled},L.addButton(Q),!rn.isLicensed){var ke=new Cn;this.topToolbar.addElementBlock(ke);var Vt=document.createElement("div");Vt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var kn=document.createElement("a");kn.style.color="currentColor",kn.href="https://markerjs.com/products/cropro",kn.target="_blank",kn.innerHTML='',Vt.appendChild(kn),ke.addElement(Vt)}var Qn=new ci;Qn.minWidth=3*this.toolbarHeight+"px",Qn.contentAlign="end",this.topToolbar.addButtonBlock(Qn);var nn=new $n('',"OK");nn.onClick=this.startRenderAndClose,Qn.addButton(nn),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(nn.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ti=new $n('',"Close");ti.onClick=this.close,Qn.addButton(ti),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ti.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var S=this;this.bottomToolbar=new vn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var L=new ci;L.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(L);var W=new $n('',"Rotate left");W.onClick=this.rotateLeftButtonClicked,L.addButton(W);var ne=new $n('',"Rotate right");ne.onClick=this.rotateRightButtonClicked,L.addButton(ne);var Q=new Cn;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new er("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Qn){S.rotateBy(Qn),S.straightener.angle=S.rotationAngle},Q.addElement(this.straightener.getUI());var ke=new ci;ke.minWidth=2*this.toolbarHeight+"px",ke.contentAlign="end",this.bottomToolbar.addButtonBlock(ke);var Vt=new $n('',"Flip horizontal");Vt.onClick=this.flipHorizontallyButtonClicked,ke.addButton(Vt);var kn=new $n('',"Flip vertical");kn.onClick=this.flipVerticallyButtonClicked,ke.addButton(kn)},X.prototype.ratioButtonClicked=function(S){this.aspectRatio=S,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Wi.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ti(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(S){if(S){var L=this.cropLayer.getRescaledRect(S.width,S.height,this.imageWidth,this.imageHeight,S.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(L),this.cropRectChanged(L),this.flippedHorizontally=S.flippedHorizontally,this.flippedVertically=S.flippedVertically,this.applyFlip(),this.rotationAngle=S.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(S,L){var W=this.cropImage.getBoundingClientRect();return{x:S-W.left,y:L-W.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var S=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},X.prototype.rotateLeftButtonClicked=function(){var S=this.rotationAngle-90;this.rotationAngle%90!=0&&(S+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(S)},X.prototype.rotateRightButtonClicked=function(){var S=this.rotationAngle+90;this.rotationAngle%90!=0&&(S-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(S)},X.prototype.rotateTo=function(S){S=(S=S>180?S-360:S)<=-180?S+360:S,this.rotationAngle=S,this.applyRotation()},X.prototype.rotateBy=function(S){this.rotateTo((this.rotationAngle+S)%360)},X.prototype.applyRotation=function(){var S=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var L=this.editingTargetRotationContainer.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(L,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=S},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return ot(this,void 0,void 0,function(){var S,L;return Yt(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return S=W.sent(),L=this.getState(),this.renderEventListeners.forEach(function(ne){return ne(S,L)}),this.close(!0),[2]}})})},X.prototype.render=function(){return ot(this,void 0,void 0,function(){var S;return Yt(this,function(L){switch(L.label){case 0:return(S=new yr).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.width=this.renderWidth,S.height=this.renderHeight,this.unzoomFromCrop(),_e.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return L.sent(),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,L.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Xt("toolbar",` width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`; flex-shrink: 0; display: flex; flex-direction: row; justify-content: space-between; height: `+this.toolbarHeight+`px; box-sizing: content-box; overflow: hidden; line-height: 0px; `)),this.toolbarStyleColorsClass=this.styles.addClass(new Xt("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new Xt("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var S=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Xt("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*S)+`px; height: `+(this.toolbarHeight-2*S)+`px; padding: `+S+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Xt("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Xt("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new xt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new xt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new Xt("toolbar_dropdown",` position: absolute; max-width: `+4*this.toolbarHeight+`px; z-index: 20; white-space: normal; box-sizing: content-box; box-shadow: 3px 3px rgba(33, 33, 33, 0.1); margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px; line-height: 0px; `)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Xt("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Xt("toolbar_straightener_block",` display: flex; overflow: hidden; justify-content: center; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%); `)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Xt("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*S)+`px; padding: `+S+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Xt("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},X.instanceCounter=0,X}(),ri=I("8hTe"),pr=I.n(ri),Cr=/]*>/g;function tr(X){var S=document.createElement("div");return S.innerHTML=X,S.childNodes.length===0?"":S.childNodes[0].nodeValue}var nr=Qe.a=function(X){var S=X.value,L=S===void 0?"":S,W=X.edit,ne=W===void 0?!1:W,Q=X.className,ke=X.showTextOnly,Vt=X.showLines,kn=X.replaces,Qn=X.zoomImg,nn=X.hasMask,ti=X.style,qn=ti===void 0?{}:ti,Li=X.stylesPrev,lr=Li===void 0?{}:Li,ar=String(L),Ki=Object(D.useRef)(),Pr=Object(D.useRef)(),Vr=Object(D.useState)(""),Ai=Object(H.a)(Vr,2),wi=Ai[0],ir=Ai[1],Fi=Object(D.useState)("office"),Bn=Object(H.a)(Fi,2),gn=Bn[0],Tn=Bn[1],_n=function(){var Oe=new cn(Pr.current);Oe.displayMode="popup",Oe.addRenderEventListener(function(){var Ve=Object(M.a)(k.a.mark(function et(Ot){var Et;return k.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return Ki.current.style.display="none",ht.next=3,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ot}});case 3:Et=ht.sent,Et!=null&&Et.id&&kn(Pr.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Et==null?void 0:Et.id,"?type=").concat(Et.content_type));case 5:case"end":return ht.stop()}},et)}));return function(et){return Ve.apply(this,arguments)}}()),Oe.show()},si=function(){var Oe=new ce(Pr.current);Oe.settings.displayMode="popup",Oe.addEventListener("render",function(){var Ve=Object(M.a)(k.a.mark(function et(Ot){var Et;return k.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(Ki.current.style.display="none",!Pr.current){ht.next=6;break}return ht.next=4,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ot.dataUrl}});case 4:Et=ht.sent,Et!=null&&Et.id&&kn(Pr.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Et==null?void 0:Et.id,"?type=").concat(Et.content_type));case 6:case"end":return ht.stop()}},et)}));return function(et){return Ve.apply(this,arguments)}}()),Oe.show(),window.markerArea=Oe},ai=Object(D.useMemo)(function(){Ki.current&&(Ki.current.style.zIndex=-1);try{var qe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Oe=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ve=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ar=ar.replace(qe,"("+Z.a.API_SERVER+"/api/attachments/").replace(Oe,'"'+Z.a.API_SERVER+"/api/attachments/").replace(Ve,'"'+Z.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(je){}var et=G(ar),Ot=v();if(ar.match(/\[TOC\]/)&&(et=et.replace("

    [TOC]

    ",O()),R()),et=et.replace(/(__special_katext_id_\d+__)/g,function(je,ht){var it=Ot[ht],st=it.type,bt=it.expression;return Object(oe.renderToString)(tr(bt)||"",{displayMode:st==="block",throwOnError:!1,output:"html"})}),et=et.replace(/▁/g,"\u2581\u2581\u2581"),p(),ke){var Et=document.createElement("div");return Et.innerHTML=et,Et.innerText}return setTimeout(function(){return Ce()},500),et},[ar]),J=Object(D.useRef)();w.WebkitLineClamp=Vt,Vt&&(qn=Object(A.a)(Object(A.a)({},qn),w));function ue(qe){var Oe=qe.target;if(Oe.tagName.toUpperCase()==="IMG"){if(Qn){var Ve=Oe.getAttribute("src");ir(Ve),Tn("image")}}else if(Oe.tagName.toUpperCase()==="A"){var et=Oe.getAttribute("href");if(et.indexOf("office")>-1)qe.preventDefault(),ir(et),Tn("office");else if(et.indexOf("application/pdf")>-1)qe.preventDefault(),ir(et),Tn("pdf");else if(et.indexOf("text/html")>-1)qe.preventDefault(),ir(et),Tn("html");else if(et.startsWith("#")){qe.preventDefault();var Ot=document.getElementById(et.replace("#",""));Ot&&Ot.scrollIntoView(!0)}}}var Ce=function(){var Oe,Ve=(Oe=J.current)===null||Oe===void 0?void 0:Oe.querySelectorAll("video");Ve==null||Ve.forEach(function(et){if(et.oncontextmenu=function(){return!1},et.src.indexOf(".m3u8")>-1&&!et.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Ot=new V.a;Ot.loadSource(et.src),Ot.attachMedia(et)}}})};Object(D.useEffect)(function(){if(J.current&&ai&&(ai.match(Cr)&&window.PR.prettyPrint()),J.current)return J.current.addEventListener("click",ue),function(){J.current.removeEventListener("click",ue),p(),R()}},[ai,J.current,ue]);var Te=function(Oe){if(!ne)return;Oe.target.nodeName==="IMG"?(Ki.current.style.zIndex=1,Ki.current.style.display="flex",Ki.current.style.width=Oe.target.clientWidth+"px",Ki.current.style.height=Oe.target.clientHeight+"px",Ki.current.style.top=Oe.target.offsetTop+"px",Ki.current.style.left=Oe.target.offsetLeft+"px",Pr.current.src=Oe.target.getAttribute("src")):Ki.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:J,style:Object(A.a)({},qn),className:"".concat(Q||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:Te,dangerouslySetInnerHTML:{__html:ai}}),b.a.createElement("div",{ref:Ki,className:pr.a.button},b.a.createElement(Y.a,null,b.a.createElement(K.a,{onClick:function(){return _n()}},"\u88C1\u526A"),b.a.createElement(K.a,{onClick:function(){return si()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Pr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(pe.a,{close:!0,data:wi,type:wi!=null&&wi.length?gn:"",style:Object(A.a)({},lr),onClose:function(){return ir("")}}))}},"9VGf":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return N});var te=I("q1tI"),Y=I.n(te);function N(K,A){var M=Object(te.useRef)();Object(te.useEffect)(function(){M.current=K}),Object(te.useEffect)(function(){function H(){M.current()}if(A!==null){var P=setInterval(H,A);return function(){return clearInterval(P)}}},[A])}},AHFd:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return P});var te=I("giR+"),Y=I("fyUT"),N=I("OaEy"),K=I("2fM7"),A=I("tJVT"),M=I("q1tI"),H=I.n(M),P;(function(D){D[D.Number=1]="Number",D[D.Percent=2]="Percent"})(P||(P={}));var k=function(b){var m=b.value,f=b.onChange,d=b.disabled,s=b.hidePercentOption,r=s===void 0?!1:s,u=Object(M.useMemo)(function(){return r?P.Number:P.Percent},[r]),o=Object(M.useState)(u),a=Object(A.a)(o,2),n=a[0],R=a[1],w=Object(M.useCallback)(function(O){return n===P.Number?"".concat(O,"\u5206"):"".concat(O,"%")},[n]),x=Object(M.useCallback)(function(O){if(n===P.Number){var C=O.replace("\u5206","");return isNaN(parseInt(C,10))?0:C}else{var _=O.replace("%","");return _}},[n]);return Object(M.useEffect)(function(){R(m.type)},[m]),H.a.createElement("div",{style:{display:"inline-block"}},H.a.createElement(K.a,{onChange:function(C){R(C),f({type:C,inputValue:C===P.Number?5:20})},value:n||u,style:{width:100},options:r?[{label:"\u5206\u503C",value:P.Number}]:[{label:"\u767E\u5206\u6BD4",value:P.Percent},{label:"\u5206\u503C",value:P.Number}],disabled:d}),H.a.createElement(Y.a,{disabled:d,value:m.inputValue,formatter:w,parser:x,max:n===P.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(C){f({type:n,inputValue:C})}}))};Qe.b=k},BU3w:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return M});var te=I("MNnm"),Y="rc-util-key";function N(H){if(H.attachTo)return H.attachTo;var P=document.querySelector("head");return P||document.body}function K(H){var P,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var D=document.createElement("style");if((P=k.csp)===null||P===void 0?void 0:P.nonce){var b;D.nonce=(b=k.csp)===null||b===void 0?void 0:b.nonce}D.innerHTML=H;var m=N(k),f=m.firstChild;return k.prepend&&m.prepend?m.prepend(D):k.prepend&&f?m.insertBefore(D,f):m.appendChild(D),D}var A=new Map;function M(H,P){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=N(k);if(!A.has(D)){var b=K("",k),m=b.parentNode;A.set(D,m),m.removeChild(b)}var f=Array.from(A.get(D).children).find(function(o){return o.tagName==="STYLE"&&o[Y]===P});if(f){var d,s;if(((d=k.csp)===null||d===void 0?void 0:d.nonce)&&f.nonce!==((s=k.csp)===null||s===void 0?void 0:s.nonce)){var r;f.nonce=(r=k.csp)===null||r===void 0?void 0:r.nonce}return f.innerHTML!==H&&(f.innerHTML=H),f}var u=K(H,k);return u[Y]=P,u}},Bd2K:function(tn,Qe,I){(function(te){te(I("VrN/"),I("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(k,D,b){if(b!=te.Init&&b&&k.removeKeyMap("autoCloseTags"),!D)return;var m={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(m["'/'"]=function(f){return M(f)}),(typeof D!="object"||D.whenOpening!==!1)&&(m["'>'"]=function(f){return K(f)}),k.addKeyMap(m)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function K(k){if(k.getOption("disableInput"))return te.Pass;for(var D=k.listSelections(),b=[],m=k.getOption("autoCloseTags"),f=0;fd.ch&&(a=a.slice(0,a.length-s.end+d.ch));var x=a.toLowerCase();if(!a||s.type=="string"&&(s.end!=d.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&o.close||s.string.indexOf("/")==d.ch-s.start-1||R&&H(R,x)>-1||P(k,r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(u)||[],a,d,!0))return te.Pass;var O=typeof m=="object"&&m.emptyTags;if(O&&H(O,a)>-1){b[f]={text:"/>",newPos:te.Pos(d.line,d.ch+2)};continue}var C=w&&H(w,x)>-1;b[f]={indent:C,text:">"+(C?` `:"")+"",newPos:C?te.Pos(d.line+1,0):te.Pos(d.line,d.ch+1)}}for(var _=typeof m=="object"&&m.dontIndentOnAutoClose,f=D.length-1;f>=0;f--){var y=b[f];k.replaceRange(y.text,D[f].head,D[f].anchor,"+insert");var h=k.listSelections().slice(0);h[f]={head:y.newPos,anchor:y.newPos},k.setSelections(h),!_&&y.indent&&(k.indentLine(y.newPos.line,null,!0),k.indentLine(y.newPos.line+1,null,!0))}}function A(k,D){for(var b=k.listSelections(),m=[],f=D?"/":""&&(R+=">"),m[r]=R}if(k.replaceSelections(m),b=k.listSelections(),!s)for(var r=0;r=0&&D[u]==b;u--)++r;m=s.to;for(var u=1;u0){for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:"",D=[],b=0;bAe.length)&&(ge=Ae.length);for(var Ee=0,ae=new Array(ge);Ee=Ae.length?{done:!0}:{done:!1,value:Ae[ae++]}}}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 Ee=Ae[Symbol.iterator](),Ee.next.bind(Ee)}function M(Ae,ge){return ge={exports:{}},Ae(ge,ge.exports),ge.exports}var H=M(function(Ae){function ge(){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 Ee(ae){Ae.exports.defaults=ae}Ae.exports={defaults:ge(),getDefaults:ge,changeDefaults:Ee}}),P=H.defaults,k=H.getDefaults,D=H.changeDefaults,b=/[&<>"']/,m=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},r=function(ge){return s[ge]};function u(Ae,ge){if(ge){if(b.test(Ae))return Ae.replace(m,r)}else if(f.test(Ae))return Ae.replace(d,r);return Ae}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(Ae){return Ae.replace(o,function(ge,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var n=/(^|[^\[])\^/g;function R(Ae,ge){Ae=Ae.source||Ae,ge=ge||"";var Ee={replace:function(re,he){return he=he.source||he,he=he.replace(n,"$1"),Ae=Ae.replace(re,he),Ee},getRegex:function(){return new RegExp(Ae,ge)}};return Ee}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Ae,ge,Ee){if(Ae){var ae;try{ae=decodeURIComponent(a(Ee)).replace(w,"").toLowerCase()}catch(re){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}ge&&!x.test(Ee)&&(Ee=c(ge,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(re){return null}return Ee}var C={},_=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Ae,ge){C[" "+Ae]||(_.test(Ae)?C[" "+Ae]=Ae+"/":C[" "+Ae]=U(Ae,"/",!0)),Ae=C[" "+Ae];var Ee=Ae.indexOf(":")===-1;return ge.substring(0,2)==="//"?Ee?ge:Ae.replace(y,"$1")+ge:ge.charAt(0)==="/"?Ee?ge:Ae.replace(h,"$1")+ge:Ae+ge}var v={exec:function(){}};function p(Ae){for(var ge=1,Ee,ae;ge=0&&me[Tt]==="\\";)Be=!Be;return Be?"|":" |"}),ae=Ee.split(/ \|/),re=0;if(ae.length>ge)ae.splice(ge);else for(;ae.length=ae.length?re.slice(ae.length):re}).join(` `)}var xe=function(){function Ae(Ee){this.options=Ee||B}var ge=Ae.prototype;return ge.space=function(ae){var re=this.rules.block.newline.exec(ae);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:` `}},ge.code=function(ae,re){var he=this.rules.block.code.exec(ae);if(he){var ve=re[re.length-1];if(ve&&ve.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var me=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?me:T(me,` `)}}},ge.fences=function(ae){var re=this.rules.block.fences.exec(ae);if(re){var he=re[0],ve=Ye(he,re[3]||"");return{type:"code",raw:he,lang:re[2]?re[2].trim():re[2],text:ve}}},ge.heading=function(ae){var re=this.rules.block.heading.exec(ae);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},ge.nptable=function(ae){var re=this.rules.block.nptable.exec(ae);if(re){var he={type:"table",header:V(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(` `):[],raw:re[0]};if(he.header.length===he.align.length){var ve=he.align.length,me;for(me=0;me ?/gm,"");return{type:"blockquote",raw:re[0],text:he}}},ge.list=function(ae){var re=this.rules.block.list.exec(ae);if(re){for(var he=re[0],ve=re[2],me=ve.length>1,Be=ve[ve.length-1]===")",Tt={type:"list",raw:he,ordered:me,start:me?+ve.slice(0,-1):"",loose:!1,items:[]},Jt=re[0].match(this.rules.block.item),En=!1,mt,Qt,gt,yt,rt,ce,Re,At=Jt.length,ot=0;ot1||this.options.smartLists&>!==ve)&&(yt=Jt.slice(ot+1).join(` `),Tt.raw=Tt.raw.substring(0,Tt.raw.length-yt.length),ot=At-1)),rt=En||/\n\n(?!\s*$)/.test(mt),ot!==At-1&&(En=mt.charAt(mt.length-1)===` `,rt||(rt=En)),rt&&(Tt.loose=!0),ce=/^\[[ xX]\] /.test(mt),Re=void 0,ce&&(Re=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),Tt.items.push({type:"list_item",raw:he,task:ce,checked:Re,loose:rt,text:mt});return Tt}},ge.html=function(ae){var re=this.rules.block.html.exec(ae);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):Z(re[0]):re[0]}},ge.def=function(ae){var re=this.rules.block.def.exec(ae);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var he=re[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:re[0],href:re[2],title:re[3]}}},ge.table=function(ae){var re=this.rules.block.table.exec(ae);if(re){var he={type:"table",header:V(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(` `):[]};if(he.header.length===he.align.length){he.raw=re[0];var ve=he.align.length,me;for(me=0;me/i.test(ve[0])&&(re=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(ve[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ve[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:ve[0],inLink:re,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):Z(ve[0]):ve[0]}},ge.link=function(ae){var re=this.rules.inline.link.exec(ae);if(re){var he=oe(re[2],"()");if(he>-1){var ve=re[0].indexOf("!")===0?5:4,me=ve+re[1].length+he;re[2]=re[2].substring(0,he),re[0]=re[0].substring(0,me).trim(),re[3]=""}var Be=re[2],Tt="";if(this.options.pedantic){var Jt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Be);Jt?(Be=Jt[1],Tt=Jt[3]):Tt=""}else Tt=re[3]?re[3].slice(1,-1):"";Be=Be.trim().replace(/^<([\s\S]*)>$/,"$1");var En=pe(re,{href:Be&&Be.replace(this.rules.inline._escapes,"$1"),title:Tt&&Tt.replace(this.rules.inline._escapes,"$1")},re[0]);return En}},ge.reflink=function(ae,re){var he;if((he=this.rules.inline.reflink.exec(ae))||(he=this.rules.inline.nolink.exec(ae))){var ve=(he[2]||he[1]).replace(/\s+/g," ");if(ve=re[ve.toLowerCase()],!ve||!ve.href){var me=he[0].charAt(0);return{type:"text",raw:me,text:me}}var Be=pe(he,ve,he[0]);return Be}},ge.strong=function(ae,re,he){he===void 0&&(he="");var ve=this.rules.inline.strong.start.exec(ae);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){re=re.slice(-1*ae.length);var me=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var Be;(ve=me.exec(re))!=null;)if(Be=this.rules.inline.strong.middle.exec(re.slice(0,ve.index+3)),Be)return{type:"strong",raw:ae.slice(0,Be[0].length),text:ae.slice(2,Be[0].length-2)}}},ge.em=function(ae,re,he){he===void 0&&(he="");var ve=this.rules.inline.em.start.exec(ae);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){re=re.slice(-1*ae.length);var me=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var Be;(ve=me.exec(re))!=null;)if(Be=this.rules.inline.em.middle.exec(re.slice(0,ve.index+2)),Be)return{type:"em",raw:ae.slice(0,Be[0].length),text:ae.slice(1,Be[0].length-1)}}},ge.codespan=function(ae){var re=this.rules.inline.code.exec(ae);if(re){var he=re[2].replace(/\n/g," "),ve=/[^ ]/.test(he),me=he.startsWith(" ")&&he.endsWith(" ");return ve&&me&&(he=he.substring(1,he.length-1)),he=Z(he,!0),{type:"codespan",raw:re[0],text:he}}},ge.br=function(ae){var re=this.rules.inline.br.exec(ae);if(re)return{type:"br",raw:re[0]}},ge.del=function(ae){var re=this.rules.inline.del.exec(ae);if(re)return{type:"del",raw:re[0],text:re[1]}},ge.autolink=function(ae,re){var he=this.rules.inline.autolink.exec(ae);if(he){var ve,me;return he[2]==="@"?(ve=Z(this.options.mangle?re(he[1]):he[1]),me="mailto:"+ve):(ve=Z(he[1]),me=ve),{type:"link",raw:he[0],text:ve,href:me,tokens:[{type:"text",raw:ve,text:ve}]}}},ge.url=function(ae,re){var he;if(he=this.rules.inline.url.exec(ae)){var ve,me;if(he[2]==="@")ve=Z(this.options.mangle?re(he[0]):he[0]),me="mailto:"+ve;else{var Be;do Be=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Be!==he[0]);ve=Z(he[0]),he[1]==="www."?me="http://"+ve:me=ve}return{type:"link",raw:he[0],text:ve,href:me,tokens:[{type:"text",raw:ve,text:ve}]}}},ge.inlineText=function(ae,re,he){var ve=this.rules.inline.text.exec(ae);if(ve){var me;return re?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):Z(ve[0]):ve[0]:me=Z(this.options.smartypants?he(ve[0]):ve[0]),{type:"text",raw:ve[0],text:me}}},Ae}(),Ie=G.noopTest,Je=G.edit,Ke=G.merge,be={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ie,table:Ie,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Je(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Je(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Je(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._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",be._comment=//,be.html=Je(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Je(be._paragraph).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Je(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Ke({},be),be.gfm=Ke({},be.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*|$)"}),be.gfm.nptable=Je(be.gfm.nptable).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Je(be.gfm.table).replace("hr",be.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",")|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=Ke({},be.normal,{html:Je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ie,paragraph:Je(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ie,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ie,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",de.punctuation=Je(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",de._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",de.em.start=Je(de.em.start).replace(/punctuation/g,de._punctuation).getRegex(),de.em.middle=Je(de.em.middle).replace(/punctuation/g,de._punctuation).replace(/overlapSkip/g,de._overlapSkip).getRegex(),de.em.endAst=Je(de.em.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.em.endUnd=Je(de.em.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.start=Je(de.strong.start).replace(/punctuation/g,de._punctuation).getRegex(),de.strong.middle=Je(de.strong.middle).replace(/punctuation/g,de._punctuation).replace(/blockSkip/g,de._blockSkip).getRegex(),de.strong.endAst=Je(de.strong.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.endUnd=Je(de.strong.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=Je(de._blockSkip,"g").getRegex(),de.overlapSkip=Je(de._overlapSkip,"g").getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._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])?)+(?![-_])/,de.autolink=Je(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=Je(de.tag).replace("comment",be._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=Je(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=Je(de.reflink).replace("label",de._label).getRegex(),de.reflinkSearch=Je(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=Ke({},de),de.pedantic=Ke({},de.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:Je(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:Je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=Ke({},de.normal,{escape:Je(de.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]*?(?:(?=[\\.5&&(ae="x"+ae.toString(16)),ge+="&#"+ae+";";return ge}var dt=function(){function Ae(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||Kt,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:jt.normal,inline:wt.normal};this.options.pedantic?(ae.block=jt.pedantic,ae.inline=wt.pedantic):this.options.gfm&&(ae.block=jt.gfm,this.options.breaks?ae.inline=wt.breaks:ae.inline=wt.gfm),this.tokenizer.rules=ae}Ae.lex=function(ae,re){var he=new Ae(re);return he.lex(ae)};var ge=Ae.prototype;return ge.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},ge.blockTokens=function(ae,re,he){re===void 0&&(re=[]),he===void 0&&(he=!0),ae=ae.replace(/^ +$/gm,"");for(var ve,me,Be,Tt;ae;){if(ve=this.tokenizer.space(ae)){ae=ae.substring(ve.raw.length),ve.type&&re.push(ve);continue}if(ve=this.tokenizer.code(ae,re)){ae=ae.substring(ve.raw.length),ve.type?re.push(ve):(Tt=re[re.length-1],Tt.raw+=` `+ve.raw,Tt.text+=` `+ve.text);continue}if(ve=this.tokenizer.fences(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.heading(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.nptable(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.hr(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.blockquote(ae)){ae=ae.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],he),re.push(ve);continue}if(ve=this.tokenizer.list(ae)){for(ae=ae.substring(ve.raw.length),Be=ve.items.length,me=0;me0)for(;(Jt=this.tokenizer.rules.inline.reflinkSearch.exec(Tt))!=null;)En.includes(Jt[0].slice(Jt[0].lastIndexOf("[")+1,-1))&&(Tt=Tt.slice(0,Jt.index)+"["+"a".repeat(Jt[0].length-2)+"]"+Tt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Jt=this.tokenizer.rules.inline.blockSkip.exec(Tt))!=null;)Tt=Tt.slice(0,Jt.index)+"["+"a".repeat(Jt[0].length-2)+"]"+Tt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Be=this.tokenizer.escape(ae)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.tag(ae,he,ve)){ae=ae.substring(Be.raw.length),he=Be.inLink,ve=Be.inRawBlock,re.push(Be);continue}if(Be=this.tokenizer.link(ae)){ae=ae.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,ve)),re.push(Be);continue}if(Be=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,ve)),re.push(Be);continue}if(Be=this.tokenizer.strong(ae,Tt,me)){ae=ae.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],he,ve),re.push(Be);continue}if(Be=this.tokenizer.em(ae,Tt,me)){ae=ae.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],he,ve),re.push(Be);continue}if(Be=this.tokenizer.codespan(ae)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.br(ae)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.del(ae)){ae=ae.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],he,ve),re.push(Be);continue}if(Be=this.tokenizer.autolink(ae,ft)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(!he&&(Be=this.tokenizer.url(ae,ft))){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.inlineText(ae,ve,ze)){ae=ae.substring(Be.raw.length),me=Be.raw.slice(-1),re.push(Be);continue}if(ae){var mt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return re},Y(Ae,null,[{key:"rules",get:function(){return{block:jt,inline:wt}}}]),Ae}(),Nt=H.defaults,Ze=G.cleanUrl,Bt=G.escape,Ut=function(){function Ae(Ee){this.options=Ee||Nt}var ge=Ae.prototype;return ge.code=function(ae,re,he){var ve=(re||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(ae,ve);me!=null&&me!==ae&&(he=!0,ae=me)}return ve?'
    '+(he?ae:Bt(ae,!0))+`
    `:"
    "+(he?ae:Bt(ae,!0))+`
    `},ge.blockquote=function(ae){return`
    `+ae+`
    `},ge.html=function(ae){return ae},ge.heading=function(ae,re,he,ve){return this.options.headerIds?"'+ae+" `:""+ae+" `},ge.hr=function(){return this.options.xhtml?`
    `:`
    `},ge.list=function(ae,re,he){var ve=re?"ol":"ul",me=re&&he!==1?' start="'+he+'"':"";return"<"+ve+me+`> `+ae+" `},ge.listitem=function(ae){return"
  • "+ae+`
  • `},ge.checkbox=function(ae){return" "},ge.paragraph=function(ae){return"

    "+ae+`

    `},ge.table=function(ae,re){return re&&(re=""+re+""),` `+ae+` `+re+`
    `},ge.tablerow=function(ae){return` `+ae+` `},ge.tablecell=function(ae,re){var he=re.header?"th":"td",ve=re.align?"<"+he+' align="'+re.align+'">':"<"+he+">";return ve+ae+" `},ge.strong=function(ae){return""+ae+""},ge.em=function(ae){return""+ae+""},ge.codespan=function(ae){return""+ae+""},ge.br=function(){return this.options.xhtml?"
    ":"
    "},ge.del=function(ae){return""+ae+""},ge.link=function(ae,re,he){if(ae=Ze(this.options.sanitize,this.options.baseUrl,ae),ae===null)return he;var ve='",ve},ge.image=function(ae,re,he){if(ae=Ze(this.options.sanitize,this.options.baseUrl,ae),ae===null)return he;var ve=''+he+'":">",ve},ge.text=function(ae){return ae},Ae}(),Mt=function(){function Ae(){}var ge=Ae.prototype;return ge.strong=function(ae){return ae},ge.em=function(ae){return ae},ge.codespan=function(ae){return ae},ge.del=function(ae){return ae},ge.html=function(ae){return ae},ge.text=function(ae){return ae},ge.link=function(ae,re,he){return""+he},ge.image=function(ae,re,he){return""+he},ge.br=function(){return""},Ae}(),An=function(){function Ae(){this.seen={}}var ge=Ae.prototype;return ge.slug=function(ae){var re=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var he=re;do this.seen[he]++,re=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},Ae}(),mn=H.defaults,pn=G.unescape,tt=function(){function Ae(Ee){this.options=Ee||mn,this.options.renderer=this.options.renderer||new Ut,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Mt,this.slugger=new An}Ae.parse=function(ae,re){var he=new Ae(re);return he.parse(ae)};var ge=Ae.prototype;return ge.parse=function(ae,re){re===void 0&&(re=!0);var he="",ve,me,Be,Tt,Jt,En,mt,Qt,gt,yt,rt,ce,Re,At,ot,Yt,rn,_e,Ne=ae.length;for(ve=0;ve0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=_e+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=_e+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:_e}):At+=_e),At+=this.parse(ot.tokens,Re),gt+=this.renderer.listitem(At,rn,Yt);he+=this.renderer.list(gt,rt,ce);continue}case"html":{he+=this.renderer.html(yt.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(yt.tokens));continue}case"text":{for(gt=yt.tokens?this.parseInline(yt.tokens):yt.text;ve+1An error occurred:

    "+He(Be.message+"",!0)+"
    ";throw Be}}Ge.options=Ge.setOptions=function(Ae){return fn(Ge.defaults,Ae),pt(Ge.defaults),Ge},Ge.getDefaults=Ue,Ge.defaults=Ct,Ge.use=function(Ae){var ge=fn({},Ae);if(Ae.renderer&&function(){var ae=Ge.defaults.renderer||new Ut,re=function(me){var Be=ae[me];ae[me]=function(){for(var Tt=arguments.length,Jt=new Array(Tt),En=0;En`,triples:"",explode:"[]{}"},N=te.Pos;te.defineOption("autoCloseBrackets",!1,function(s,r,u){u&&u!=te.Init&&(s.removeKeyMap(A),s.state.closeBrackets=null),r&&(M(K(r,"pairs")),s.state.closeBrackets=r,s.addKeyMap(A))});function K(s,r){return r=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[r]!=null?s[r]:Y[r]}var A={Backspace:k,Enter:D};function M(s){for(var r=0;r=0;a--){var R=o[a].head;s.replaceRange("",N(R.line,R.ch-1),N(R.line,R.ch+1),"+delete")}}function D(s){var r=P(s),u=r&&K(r,"explode");if(!u||s.getOption("disableInput"))return te.Pass;for(var o=s.listSelections(),a=0;a0;return{anchor:new N(s.anchor.line,s.anchor.ch+(r?-1:1)),head:new N(s.head.line,s.head.ch+(r?1:-1))}}function m(s,r){var u=P(s);if(!u||s.getOption("disableInput"))return te.Pass;var o=K(u,"pairs"),a=o.indexOf(r);if(a==-1)return te.Pass;for(var n=K(u,"closeBefore"),R=K(u,"triples"),w=o.charAt(a+1)==r,x=s.listSelections(),O=a%2==0,C,_=0;_=0&&s.getRange(h,N(h.line,h.ch+3))==r+r+r?c="skipThree":c="skip";else if(w&&h.ch>1&&R.indexOf(r)>=0&&s.getRange(N(h.line,h.ch-2),h)==r+r){if(h.ch>2&&/\bstring/.test(s.getTokenTypeAt(N(h.line,h.ch-2))))return te.Pass;c="addFour"}else if(w){var p=h.ch==0?" ":s.getRange(N(h.line,h.ch-1),h);if(!te.isWordChar(v)&&p!=r&&!te.isWordChar(p))c="both";else return te.Pass}else if(O&&(v.length===0||/\s/.test(v)||n.indexOf(v)>-1))c="both";else return te.Pass;if(!C)C=c;else if(C!=c)return te.Pass}var E=a%2?o.charAt(a-1):r,U=a%2?r:o.charAt(a+1);s.operation(function(){if(C=="skip")s.execCommand("goCharRight");else if(C=="skipThree")for(var F=0;F<3;F++)s.execCommand("goCharRight");else if(C=="surround"){for(var z=s.getSelections(),F=0;F>>6)+k(128|U&63):k(224|U>>>12&15)+k(128|U>>>6&63)+k(128|U&63)}else{var U=65536+(E.charCodeAt(0)-55296)*1024+(E.charCodeAt(1)-56320);return k(240|U>>>18&7)+k(128|U>>>12&63)+k(128|U>>>6&63)+k(128|U&63)}},b=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(E){return E.replace(b,D)},f=function(E){var U=[0,2,1][E.length%3],F=E.charCodeAt(0)<<16|(E.length>1?E.charCodeAt(1):0)<<8|(E.length>2?E.charCodeAt(2):0),z=[H.charAt(F>>>18),H.charAt(F>>>12&63),U>=2?"=":H.charAt(F>>>6&63),U>=1?"=":H.charAt(F&63)];return z.join("")},d=K.btoa&&typeof K.btoa=="function"?function(E){return K.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,f)},s=function(E){return d(m(String(E)))},r=function(E){return E.replace(/[+\/]/g,function(U){return U=="+"?"-":"_"}).replace(/=/g,"")},u=function(E,U){return U?r(s(E)):s(E)},o=function(E){return u(E,!0)},a;K.Uint8Array&&(a=function(E,U){for(var F="",z=0,G=E.length;z>>18)+H.charAt(Z>>>12&63)+(typeof T!="undefined"?H.charAt(Z>>>6&63):"=")+(typeof V!="undefined"?H.charAt(Z&63):"=")}return U?r(F):F});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=function(E){switch(E.length){case 4:var U=(7&E.charCodeAt(0))<<18|(63&E.charCodeAt(1))<<12|(63&E.charCodeAt(2))<<6|63&E.charCodeAt(3),F=U-65536;return k((F>>>10)+55296)+k((F&1023)+56320);case 3:return k((15&E.charCodeAt(0))<<12|(63&E.charCodeAt(1))<<6|63&E.charCodeAt(2));default:return k((31&E.charCodeAt(0))<<6|63&E.charCodeAt(1))}},w=function(E){return E.replace(n,R)},x=function(E){var U=E.length,F=U%4,z=(U>0?P[E.charAt(0)]<<18:0)|(U>1?P[E.charAt(1)]<<12:0)|(U>2?P[E.charAt(2)]<<6:0)|(U>3?P[E.charAt(3)]:0),G=[k(z>>>16),k(z>>>8&255),k(z&255)];return G.length-=[0,0,2,1][F],G.join("")},O=K.atob&&typeof K.atob=="function"?function(E){return K.atob(E)}:function(E){return E.replace(/\S{1,4}/g,x)},C=function(E){return O(String(E).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(E){return w(O(E))},y=function(E){return String(E).replace(/[-_]/g,function(U){return U=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(E){return _(y(E))},c;K.Uint8Array&&(c=function(E){return Uint8Array.from(C(y(E)),function(U){return U.charCodeAt(0)})});var v=function(){var E=K.Base64;return K.Base64=A,E};if(K.Base64={VERSION:M,atob:C,btoa:d,fromBase64:h,toBase64:u,utob:m,encode:u,encodeURI:o,btou:w,decode:h,noConflict:v,fromUint8Array:a,toUint8Array:c},typeof Object.defineProperty=="function"){var p=function(E){return{value:E,enumerable:!1,writable:!0,configurable:!0}};K.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",p(function(){return h(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 K.Meteor&&(Base64=K.Base64),tn.exports?tn.exports.Base64=K.Base64:!(Y=[],N=function(){return K.Base64}.apply(Qe,Y),N!==void 0&&(tn.exports=N)),{Base64:K.Base64}})}).call(this,I("IyRk"))},LSTS:function(tn,Qe,I){"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});var te=function(){function m(f,d){for(var s=0;s=0)continue;if(!Object.prototype.hasOwnProperty.call(m,s))continue;d[s]=m[s]}return d}function P(m,f){if(!(m instanceof f))throw new TypeError("Cannot call a class as a function")}function k(m,f){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:m}function D(m,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);m.prototype=Object.create(f&&f.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(m,f):m.__proto__=f)}var b=function(m){D(f,m);function f(d){P(this,f);var s=k(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,d));return s.scrollListener=s.scrollListener.bind(s),s.eventListenerOptions=s.eventListenerOptions.bind(s),s.mousewheelListener=s.mousewheelListener.bind(s),s}return te(f,[{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 s=this.getParentElement(this.scrollComponent);s.scrollTop=s.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var s=!1,r={get passive(){s=!0}};try{document.addEventListener("test",null,r),document.removeEventListener("test",null,r)}catch(u){}return s}},{key:"eventListenerOptions",value:function(){var s=this.props.useCapture;return this.isPassiveSupported()&&(s={useCapture:this.props.useCapture,passive:!0}),s}},{key:"setDefaultLoader",value:function(s){this.defaultLoader=s}},{key:"detachMousewheelListener",value:function(){var s=window;this.props.useWindow===!1&&(s=this.scrollComponent.parentNode),s.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var s=window;this.props.useWindow===!1&&(s=this.getParentElement(this.scrollComponent)),s.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(s){var r=this.props.getScrollParent&&this.props.getScrollParent();return r!=null?r:s&&s.parentNode}},{key:"filterProps",value:function(s){return s}},{key:"attachScrollListener",value:function(){var s=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!s)return;var r=window;this.props.useWindow===!1&&(r=s),r.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),r.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),r.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(s){s.deltaY===1&&!this.isPassiveSupported()&&s.preventDefault()}},{key:"scrollListener",value:function(){var s=this.scrollComponent,r=window,u=this.getParentElement(s),o=void 0;if(this.props.useWindow){var a=document.documentElement||document.body.parentNode||document.body,n=r.pageYOffset!==void 0?r.pageYOffset:a.scrollTop;this.props.isReverse?o=n:o=this.calculateOffset(s,n)}else this.props.isReverse?o=u.scrollTop:o=s.scrollHeight-u.scrollTop-u.clientHeight;o1&&arguments[1]!==void 0?arguments[1]:1,Ee=Mt.length,ae=0;ae1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(T).map(function(Z,oe){if(!A.isValidElement(Z)||!Z.type)return null;var pe=Z.type.isSelectOptGroup,Ye=Z.key,xe=Z.props,Ie=xe.children,Je=Object(H.a)(xe,["children"]);return V||!pe?C(Z):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Ye===null?oe:Ye,"__"),label:Ye},Je),{},{options:_(Ie)})}).filter(function(Z){return Z})}var y=I("2Qr1"),h=I("qNPg"),c=I("U8pU"),v=I("Kwbf"),p=I("WKfj");function E(T){var V=T.mode,Z=T.options,oe=T.children,pe=T.backfill,Ye=T.allowClear,xe=T.placeholder,Ie=T.getInputElement,Je=T.showSearch,Ke=T.onSearch,be=T.defaultOpen,de=T.autoFocus,nt=T.labelInValue,Kt=T.value,jt=T.inputValue,wt=T.optionLabelProp,ze=V==="multiple"||V==="tags",ft=Je!==void 0?Je:ze||V==="combobox",dt=Z||_(oe);if(Object(v.a)(V!=="tags"||dt.every(function(Ut){return!Ut.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Nt=dt.some(function(Ut){return Ut.options?Ut.options.some(function(Mt){return typeof("value"in Mt?Mt.value:Mt.key)=="number"}):typeof("value"in Ut?Ut.value:Ut.key)=="number"});Object(v.a)(!Nt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(V!=="combobox"||!wt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(V==="combobox"||!pe,"`backfill` only works with `combobox` mode."),Object(v.a)(V==="combobox"||!Ie,"`getInputElement` only work with `combobox` mode."),Object(v.b)(V!=="combobox"||!Ie||!Ye||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ke&&!ft&&V!=="combobox"&&V!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!be||de,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Kt!=null){var Ze=Object(p.d)(Kt);Object(v.a)(!nt||Ze.every(function(Ut){return Object(c.a)(Ut)==="object"&&("key"in Ut||"value"in Ut)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!ze||Array.isArray(Kt),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Bt=null;Object(O.a)(oe).some(function(Ut){if(!A.isValidElement(Ut)||!Ut.type)return!1;var Mt=Ut.type;if(Mt.isSelectOption)return!1;if(Mt.isSelectOptGroup){var An=Object(O.a)(Ut.props.children).every(function(mn){return!A.isValidElement(mn)||!Ut.type||mn.type.isSelectOption?!0:(Bt=mn.type,!1)});return!An}return Bt=Mt,!0}),Bt&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Bt.displayName||Bt.name||Bt,"`.")),Object(v.a)(jt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=E,F=Object(h.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:_,flattenOptions:y.d,getLabeledValue:y.e,filterOptions:y.b,isValueDisabled:y.g,findValueOption:y.c,warningProps:U,fillOptionsWithMissingValue:y.a}),z=function(T){Object(N.a)(Z,T);var V=Object(K.a)(Z);function Z(){var oe;return Object(te.a)(this,Z),oe=V.apply(this,arguments),oe.selectRef=A.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(Y.a)(Z,[{key:"render",value:function(){return A.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Z}(A.Component);z.Option=n,z.OptGroup=w;var G=z,B=Qe.c=G},M8RZ:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return k});var te=I("fWQN"),Y=I("mtLc"),N=I("yKVA"),K=I("879j"),A=I("q1tI"),M=I.n(A),H=I("i8i4"),P=I.n(H),k=function(D){Object(N.a)(m,D);var b=Object(K.a)(m);function m(f){var d;Object(te.a)(this,m),d=b.call(this,f);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(Y.a)(m,[{key:"render",value:function(){var d=this.props.children;return Object(H.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(M.a.Component)},NLgs:function(tn,Qe,I){"use strict";I.d(Qe,"e",function(){return n}),I.d(Qe,"f",function(){return R}),I.d(Qe,"d",function(){return x}),I.d(Qe,"c",function(){return O}),I.d(Qe,"a",function(){return C}),I.d(Qe,"b",function(){return _});var te=I("miYZ"),Y=I("tsqr"),N=I("9og8"),K=I("2qtc"),A=I("kLXV"),M=I("WmNS"),H=I.n(M),P=I("q1tI"),k=I.n(P),D=I("9kvl"),b=I("xKgJ"),m=I("1vsH"),f=I("RCxd"),d=I("yTi+"),s=I.n(d),r=I("1ZF9"),u=I.n(r),o=I("NoGO"),a=I.n(o),n=function(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(R(h)&&w(c))},R=function(h){return Object(b.p)()?!0:(h({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},w=function(){var h,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,v=Object(D.c)()._store.getState(),p=v.user;return(h=p.userInfo)!==null&&h!==void 0&&h.profile_completed?!0:(A.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(){D.d.push("/account/profile/edit")}}),!1)},x=function(){var h,c=Object(D.c)()._store.getState(),v=c.user;return(h=v.userInfo)!==null&&h!==void 0&&h.professional_certification?!0:(A.a.confirm({title:"\u63D0\u793A",centered:!0,content:k.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.S)("/account/certification")}}),!1)},O=function(){return Object(b.a)()?!0:(A.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),k.a.createElement("img",{src:a.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},C=function(h,c){return h?!0:(A.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",null,k.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"),k.a.createElement("div",{style:{marginLeft:"110px"}},k.a.createElement("img",{src:u.a,width:200}),k.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(m.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},_=function(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",v=Object(D.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?(A.a.info({centered:!0,icon:k.a.createElement(f.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},k.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"),k.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),k.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:s.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(p==null?void 0:p.shixun_status)===2?(A.a.confirm({centered:!0,icon:k.a.createElement(f.a,null),title:"\u63D0\u793A",content:k.a.createElement("div",null,k.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",c,"\u3002"),k.a.createElement("br",null),k.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(){A.a.confirm({width:440,centered:!0,icon:k.a.createElement(f.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 U=Object(N.a)(H.a.mark(function z(){var G;return H.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,h({type:"shixunsDetail/cancelRelease",payload:{id:p==null?void 0:p.identifier}});case 2:G=T.sent,G.status!==401&&(Y.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),h({type:"shixunsDetail/getShixunsDetail",payload:{id:p==null?void 0:p.identifier}}),h({type:"practiceSetting/getCommonData",payload:{id:p==null?void 0:p.identifier}}));case 4:case"end":return T.stop()}},z)}));function F(){return U.apply(this,arguments)}return F}()})}}),!0):!1}},Nd3P:function(tn,Qe,I){tn.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(tn,Qe,I){tn.exports=I.p+"static/newqrcode.d852fdfc.png"},NvD2:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return M});var te=I("Kwbf");function Y(H,P){var k=new Set;return H.forEach(function(D){P.has(D)||k.add(D)}),k}function N(H){var P=H||{},k=P.disabled,D=P.disableCheckbox,b=P.checkable;return!!(k||D)||b===!1}function K(H,P,k,D){for(var b=new Set(H),m=new Set,f=0;f<=k;f+=1){var d=P.get(f)||new Set;d.forEach(function(o){var a=o.key,n=o.node,R=o.children,w=R===void 0?[]:R;b.has(a)&&!D(n)&&w.filter(function(x){return!D(x.node)}).forEach(function(x){b.add(x.key)})})}for(var s=new Set,r=k;r>=0;r-=1){var u=P.get(r)||new Set;u.forEach(function(o){var a=o.parent,n=o.node;if(D(n)||!o.parent||s.has(o.parent.key))return;if(D(o.parent.node)){s.add(a.key);return}var R=!0,w=!1;(a.children||[]).filter(function(x){return!D(x.node)}).forEach(function(x){var O=x.key,C=b.has(O);R&&!C&&(R=!1),!w&&(C||m.has(O))&&(w=!0)}),R&&b.add(a.key),w&&m.add(a.key),s.add(a.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(Y(m,b))}}function A(H,P,k,D,b){for(var m=new Set(H),f=new Set(P),d=0;d<=D;d+=1){var s=k.get(d)||new Set;s.forEach(function(a){var n=a.key,R=a.node,w=a.children,x=w===void 0?[]:w;!m.has(n)&&!f.has(n)&&!b(R)&&x.filter(function(O){return!b(O.node)}).forEach(function(O){m.delete(O.key)})})}f=new Set;for(var r=new Set,u=D;u>=0;u-=1){var o=k.get(u)||new Set;o.forEach(function(a){var n=a.parent,R=a.node;if(b(R)||!a.parent||r.has(a.parent.key))return;if(b(a.parent.node)){r.add(n.key);return}var w=!0,x=!1;(n.children||[]).filter(function(O){return!b(O.node)}).forEach(function(O){var C=O.key,_=m.has(C);w&&!_&&(w=!1),!x&&(_||f.has(C))&&(x=!0)}),w||m.delete(n.key),x&&f.add(n.key),r.add(n.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Y(f,m))}}function M(H,P,k,D){var b=[],m;D?m=D:m=N;var f=new Set(H.filter(function(u){var o=!!k[u];return o||b.push(u),o})),d=new Map,s=0;Object.keys(k).forEach(function(u){var o=k[u],a=o.level,n=d.get(a);n||(n=new Set,d.set(a,n)),n.add(o),s=Math.max(s,a)}),Object(te.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var r;return P===!0?r=K(f,d,s,m):r=A(f,P.halfCheckedKeys,d,s,m),r}},OH33:function(tn,Qe,I){"use strict";I.r(Qe);var te=I("g9YV"),Y=I("wCAj"),N=I("Znn+"),K=I("ZTPi"),A=I("5Dmo"),M=I("3S7+"),H=I("sPJy"),P=I("bE4q"),k=I("+L6B"),D=I("2/Rp"),b=I("miYZ"),m=I("tsqr"),f=I("9og8"),d=I("2qtc"),s=I("kLXV"),r=I("tJVT"),u=I("WmNS"),o=I.n(u),a=I("q1tI"),n=I.n(a),R=I("ErOA"),w=I("Ty5D"),x=I("55Ip"),O=I("9kvl"),C=I("jhfD"),_=I("1vsH"),y=I("T2oS"),h=I("W9HT"),c=I("DjyN"),v=I("NUBc"),p=I("k1fw"),E=I("9Bee"),U=function(gn){var Tn=gn.shixunHomeworks,_n=gn.dispatch,si=Object(w.i)();return n.a.createElement(s.a,{centered:!0,title:"\u63D0\u793A",visible:Tn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(f.a)(o.a.mark(function ai(){var J;return o.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,_n({type:"shixunHomeworks/deleteReply",payload:{object_id:Tn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:J=Ce.sent,J.status===0&&(m.b.success("\u5220\u9664\u6210\u529F"),_n({type:"shixunHomeworks/setActionTabs",payload:{}}),_n({type:"shixunHomeworks/getReplyList",payload:Object(p.a)({},Tn.actionTabs.params)}));case 4:case"end":return Ce.stop()}},ai)})),onCancel:function(){_n({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},F=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(U),z=I("wd/R"),G=I.n(z),B=I("iF7n"),T=I.n(B),V=I("xKgJ"),Z=I("BdwD");G.a.lang("ZH-cn");var oe=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],pe=function(gn){var Tn,_n,si=gn.shixunHomeworks,ai=gn.classroomList,J=gn.globalSetting,ue=gn.user,Ce=gn.loading,Te=gn.dispatch,qe=Object(a.useState)(Object(p.a)(Object(p.a)({},Object(w.i)()),{},{per_page:10})),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)([]),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=Object(a.useState)(-1),st=Object(r.a)(it,2),bt=st[0],Lt=st[1],ct=Object(a.useState)(""),Gt=Object(r.a)(ct,2),on=Gt[0],Dn=Gt[1],Kn=Object(a.useState)(""),wn=Object(r.a)(Kn,2),Nn=wn[0],Pn=wn[1],Dt=ai.detailLeftMenus,sn=Object(w.h)(),Ft=Object(a.useState)({}),St=Object(r.a)(Ft,2),Un=St[0],Sn=St[1],zt=si.workDetail,lt=si.workList,jn=Object(a.useState)("1"),ln=Object(r.a)(jn,2),Jn=ln[0],$t=ln[1],On=Object(a.useState)(!1),Fn=Object(r.a)(On,2),hn=Fn[0],yi=Fn[1];Object(a.useEffect)(function(){lt.homework_status&&Rn()},[lt]);function Rn(){return bn.apply(this,arguments)}function bn(){return bn=Object(f.a)(o.a.mark(function Rt(){var Xe,kt,Pt;return o.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return yi(!0),zn.next=3,Object(R.a)("/api/courses/".concat(Ve.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(p.a)(Object(p.a)({},Ve),{},{id:Ve.categoryId})});case 3:Pt=zn.sent,ht(Pt),yi(!1),Ve.defaultExpandedRowKeys=["".concat(Pt==null||((Xe=Pt.data)===null||Xe===void 0||((kt=Xe[0])===null||kt===void 0))?void 0:kt.identifier)],Jn!="2"&&$t(Pt!=null&&Pt.description?"1":"2"),et(Object(p.a)({},Ve));case 9:case"end":return zn.stop()}},Rt)})),bn.apply(this,arguments)}return n.a.createElement("section",{className:T.a.bg},n.a.createElement(h.a,{spinning:hn},n.a.createElement(K.a,{onChange:function(Xe){$t(Xe)},activeKey:Jn},n.a.createElement(K.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(je!=null&&je.description)&&n.a.createElement(Z.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(E.a,{value:(je==null?void 0:je.description)||""}))),n.a.createElement(K.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"}},Ve.defaultExpandedRowKeys&&n.a.createElement(Y.a,{dataSource:je==null?void 0:je.data,rowKey:function(Xe){return Xe==null?void 0:Xe.identifier},pagination:!1,expandable:{expandedRowRender:function(Xe){var kt,Pt;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",Xe==null?void 0:Xe.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",Xe==null?void 0:Xe.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(V.c)()&&(je==null||((kt=je.homework_status)===null||kt===void 0)?void 0:kt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(D.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(Xe==null?void 0:Xe.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[Ve.coursesId,Ve.categoryId])}},"\u7F16\u8F91"),Object(V.c)()&&(je==null||((Pt=je.homework_status)===null||Pt===void 0)?void 0:Pt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(D.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){s.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var zn=Object(f.a)(o.a.mark(function oi(){var ei;return o.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return mi.next=2,Object(R.a)("/api/problems/".concat(Xe==null?void 0:Xe.identifier,".json"),{method:"delete"});case 2:ei=mi.sent,(ei==null?void 0:ei.status)===0&&(m.b.info("\u5220\u9664\u6210\u529F"),Ve.page=1,Rn());case 4:case"end":return mi.stop()}},oi)}));function Ln(){return zn.apply(this,arguments)}return Ln}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:Ve.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(Xe,kt,Pt){return n.a.createElement("div",null,oe[Xe])}},{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(Xe,kt,Pt){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat(Ve.coursesId,"/program_homework/").concat(Ve.categoryId,"/").concat(Xe,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(f.a)(o.a.mark(function an(){var zn;return o.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:return oi.next=2,Object(R.a)("/api/problems/".concat(kt==null?void 0:kt.identifier,"/start.json"),{method:"get"});case 2:zn=oi.sent,zn&&(window.open("/myproblems/".concat(zn==null?void 0:zn.identifier,"?type=1")),localStorage.setItem("program_homework",[Ve.coursesId,Ve.categoryId]));case 4:case"end":return oi.stop()}},an)})),style:{margin:"0px 20px"}},Object(V.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(je==null||((Tn=je.data)===null||Tn===void 0||((_n=Tn[0])===null||_n===void 0))?void 0:_n.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(v.a,{defaultCurrent:1,total:je==null?void 0:je.count,hideOnSinglePage:!0,showTotal:function(Xe){return n.a.createElement("span",null,"\u5171",Xe,"\u6761")},current:Ve.page||1,pageSize:Ve.per_page||10,onChange:function(Xe,kt){Ve.page=Xe,Ve.per_page=kt,et(Object(p.a)({},Ve)),Rn()}})))))),n.a.createElement(F,null))},Ye=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.classroomList,_n=Bn.loading,si=Bn.user,ai=Bn.globalSetting;return{shixunHomeworks:gn,globalSetting:ai,classroomList:Tn,user:si,loading:_n.effects}})(pe),xe=I("oBTY"),Ie=I("giR+"),Je=I("fyUT"),Ke=I("7Kak"),be=I("9yH6"),de=I("qVdP"),nt=I("jsC+"),Kt=I("5NDa"),jt=I("5rEg"),wt=I("14J3"),ze=I("BMrR"),ft=I("sRBo"),dt=I("kaz8"),Nt=I("jCWc"),Ze=I("kPKH"),Bt=I("lUTK"),Ut=I("BvKs"),Mt=I("jrin"),An=I("y8nQ"),mn=I("Vl3Y"),pn=I("8Skl"),tt=I("y3Kf"),fn=I("Llu2"),In=I("0NbB"),He=I("T7RX"),Ue=I("PpiC"),pt=I("IMoZ"),Ct=function(gn){var Tn=gn.shixunHomeworks,_n=gn.dispatch,si=Object(Ue.a)(gn,["shixunHomeworks","dispatch"]),ai=Object(w.i)(),J=Object(a.useState)(!0),ue=Object(r.a)(J,2),Ce=ue[0],Te=ue[1],qe=Object(a.useState)(!1),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=mn.a.useForm(),Et=Object(r.a)(Ot,1),je=Et[0],ht=function(){var it=Object(f.a)(o.a.mark(function st(){var bt,Lt;return o.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return bt=je.getFieldValue(),Gt.next=3,Object(R.a)("/api/homework_commons/".concat(ai.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(xe.a)(Tn.actionTabs.selectArrs),cover_all:Ce,hidden_comment:bt.hidden_comment,comment:bt.comment}});case 3:Lt=Gt.sent,Lt.status===0&&(m.b.success("\u8BC4\u9605\u6210\u529F"),je.resetFields(),_n({type:"shixunHomeworks/setActionTabs",payload:{}}),_n({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},Tn.actionTabs.params)}));case 5:case"end":return Gt.stop()}},st)}));return function(){return it.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(s.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:Tn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(f.a)(o.a.mark(function it(){var st;return o.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:st=je.getFieldValue(),JSON.stringify(st)==="{}"||st.hidden_comment===""&&st.comment===""?et(!0):Tn.workList.partial_comment?_n({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:Tn.actionTabs.selectArrs,params:Tn.actionTabs.params}}):ht();case 2:case"end":return Lt.stop()}},it)})),onCancel:function(){_n({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(mn.a,{form:je,onChange:function(){Ve&&et(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(mn.a.Item,{name:"comment"},n.a.createElement(jt.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(mn.a.Item,{name:"hidden_comment"},n.a.createElement(jt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Ve&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(s.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(pt.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(){ht()},onCancel:function(){_n({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(be.a.Group,{onChange:function(st){Te(st.target.value)},value:Ce},n.a.createElement(be.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(be.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},Ge=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(Ct),vt=I("XYT7"),Ae=I("Nd3P"),ge=I.n(Ae),Ee=function(gn){var Tn,_n,si,ai,J=gn.shixunHomeworks,ue=gn.dispatch,Ce=Object(Ue.a)(gn,["shixunHomeworks","dispatch"]),Te=Object(w.i)(),qe=Object(a.useState)(!1),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)((Tn=J.actionTabs.selectArrs)===null||Tn===void 0||((_n=Tn.data)===null||_n===void 0)?void 0:_n.name),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=mn.a.useForm(),st=Object(r.a)(it,1),bt=st[0];Object(a.useEffect)(function(){var ct,Gt,on,Dn,Kn,wn;J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&bt.setFieldsValue({comment:(ct=J.actionTabs.selectArrs)===null||ct===void 0||((Gt=ct.data)===null||Gt===void 0)?void 0:Gt.work_comment,hidden_comment:(on=J.actionTabs.selectArrs)===null||on===void 0||((Dn=on.data)===null||Dn===void 0)?void 0:Dn.work_comment_hidden}),ht((Kn=J.actionTabs.selectArrs)===null||Kn===void 0||((wn=Kn.data)===null||wn===void 0)?void 0:wn.name)},[J.actionTabs.key]);var Lt=function(){var ct=Object(f.a)(o.a.mark(function Gt(){var on,Dn,Kn,wn;return o.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Kn=bt.getFieldValue(),Pn.next=3,Object(R.a)("/api/student_works/".concat((on=J.actionTabs.selectArrs)===null||on===void 0||((Dn=on.data)===null||Dn===void 0)?void 0:Dn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:Kn.hidden_comment,comment:Kn.comment}});case 3:if(wn=Pn.sent,!(wn.status===0)){Pn.next=9;break}return m.b.success("\u8BC4\u9605\u6210\u529F"),bt.resetFields(),ue({type:"shixunHomeworks/setActionTabs",payload:{}}),Pn.abrupt("return",ue({type:"shixunHomeworks/getWorkList",payload:Te}));case 9:case"end":return Pn.stop()}},Gt)}));return function(){return ct.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(s.a,{centered:!0,title:(si=J.actionTabs.selectArrs)!==null&&si!==void 0&&(ai=si.data)!==null&&ai!==void 0&&ai.work_comment_hidden?"\u66F4\u6539"+je+"\u70B9\u8BC4":je+"\u70B9\u8BC4",visible:J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(f.a)(o.a.mark(function ct(){var Gt;return o.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:Gt=bt.getFieldValue(),JSON.stringify(Gt)==="{}"||Gt.hidden_comment===""&&Gt.comment===""?et(!0):Lt();case 2:case"end":return Dn.stop()}},ct)})),onCancel:function(){ue({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(mn.a,{form:bt,onChange:function(){Ve&&et(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(mn.a.Item,{name:"comment"},n.a.createElement(jt.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(mn.a.Item,{name:"hidden_comment"},n.a.createElement(jt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Ve&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},ae=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(Ee),re=function(gn){var Tn=gn.shixunHomeworks,_n=gn.dispatch,si=Object(Ue.a)(gn,["shixunHomeworks","dispatch"]),ai=Object(w.i)(),J=Object(a.useState)([]),ue=Object(r.a)(J,2),Ce=ue[0],Te=ue[1],qe=Object(a.useState)([]),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1];Object(a.useEffect)(function(){Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&Ot()},[Tn.actionTabs.key]);function Ot(){return Et.apply(this,arguments)}function Et(){return Et=Object(f.a)(o.a.mark(function ht(){var it;return o.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(R.a)("/api/homework_commons/".concat(ai.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:it=bt.sent,Te(it);case 4:case"end":return bt.stop()}},ht)})),Et.apply(this,arguments)}var je=[{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(s.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(f.a)(o.a.mark(function ht(){var it;return o.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(R.a)("/api/homework_commons/".concat(ai.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:Ve}});case 2:it=bt.sent,(it==null?void 0:it.status)===0&&(O.d.replace("/classrooms/".concat(ai.coursesId,"/shixun_homework/").concat(ai.categoryId,"/detail?tabs=4")),window.location.reload(),_n({type:"shixunHomeworks/setActionTabs",payload:{}}),et([]));case 4:case"end":return bt.stop()}},ht)})),onCancel:function(){et([]),_n({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Y.a,{rowSelection:{type:"checkbox",onChange:function(it,st){et(Object(xe.a)(it))},selectedRowKeys:Ve,getCheckboxProps:function(it){return{disabled:it.status==="\u8FDB\u884C\u4E2D"||it.works_count===0}}},rowKey:function(it){return it.key||it.id},scroll:{y:300},pagination:!1,columns:je,dataSource:Ce==null?void 0:Ce.group_list})))},he=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(re),ve=I("Ot1p"),me=I("mgmH"),Be=function(gn){var Tn,_n,si,ai,J,ue,Ce,Te,qe,Oe=gn.shixunHomeworks,Ve=gn.loading,et=gn.dispatch,Ot=gn.setExportParams,Et=gn.user,je=Object(w.i)(),ht=Object(a.useState)(Object(p.a)(Object(p.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),je)),it=Object(r.a)(ht,2),st=it[0],bt=it[1],Lt=mn.a.useForm(),ct=Object(r.a)(Lt,1),Gt=ct[0],on=Object(a.useState)(),Dn=Object(r.a)(on,2),Kn=Dn[0],wn=Dn[1],Nn=Object(a.useState)({}),Pn=Object(r.a)(Nn,2),Dt=Pn[0],sn=Pn[1],Ft=Object(a.useState)([]),St=Object(r.a)(Ft,2),Un=St[0],Sn=St[1],zt=Object(a.useState)(!1),lt=Object(r.a)(zt,2),jn=lt[0],ln=lt[1],Jn=Object(a.useState)([]),$t=Object(r.a)(Jn,2),On=$t[0],Fn=$t[1],hn=Object(a.useState)(!1),yi=Object(r.a)(hn,2),Rn=yi[0],bn=yi[1],Rt=Object(a.useState)(),Xe=Object(r.a)(Rt,2),kt=Xe[0],Pt=Xe[1],an=Object(a.useState)(1),zn=Object(r.a)(an,2),Ln=zn[0],oi=zn[1],ei=Object(a.useState)(),Oi=Object(r.a)(ei,2),mi=Oi[0],bi=Oi[1],Ji=Object(a.useState)(),Vi=Object(r.a)(Ji,2),$i=Vi[0],gr=Vi[1],vr=Object(a.useState)(),ye=Object(r.a)(vr,2),Me=ye[0],We=ye[1],we=Object(a.useState)(),ie=Object(r.a)(we,2),fe=ie[0],le=ie[1],Se=Object(a.useState)(),De=Object(r.a)(Se,2),$e=De[0],Le=De[1],at=Object(a.useState)(!1),It=Object(r.a)(at,2),qt=It[0],un=It[1],Hn=Object(w.h)();Object(a.useEffect)(function(){return Gn(!0),function(){sn([]),Sn([])}},[st.coursesId]),Object(a.useEffect)(function(){var dn,Zt=JSON.parse(JSON.stringify(Oe.workList));!(Zt!=null&&(dn=Zt.student_works)!==null&&dn!==void 0&&dn.length)&&Zt!==null&&Zt!==void 0&&Zt.id?(Zt.student_works=[Object(p.a)({},Zt)],sn(Zt)):(Zt!=null&&Zt.id&&Sn([Object(p.a)(Object(p.a)({},Zt),{number:"\u6211"})]),sn(Object(p.a)({},Zt)))},[Oe.workList]);var Gn=function(Zt){Ot(Object(p.a)({},st));var yn=et({type:"shixunHomeworks/getWorkList",payload:st});return Zt&&yn.then(function(Ht){var Wt,pi,Pi;(Ht!=null&&(Wt=Ht.homework_status)!==null&&Wt!==void 0&&Wt.includes("\u8FDB\u884C\u4E2D")||Ht!=null&&(pi=Ht.homework_status)!==null&&pi!==void 0&&pi.includes("\u8865\u4EA4\u4E2D")||Ht!=null&&(Pi=Ht.homework_status)!==null&&Pi!==void 0&&Pi.includes("\u63D0\u4EA4\u4E2D"))&&!Object(V.s)()&&li()}),yn};Object(a.useEffect)(function(){di()},[]);var di=function(){var dn=Object(f.a)(o.a.mark(function Zt(){var yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(vt.I)({categoryId:je.categoryId});case 2:yn=Wt.sent,wn(yn==null?void 0:yn.update_score);case 4:case"end":return Wt.stop()}},Zt)}));return function(){return dn.apply(this,arguments)}}(),li=function(){var dn=Object(f.a)(o.a.mark(function Zt(){var yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return et({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),Wt.next=3,Object(vt.Z)({categoryId:je.categoryId});case 3:yn=Wt.sent,et({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(yn==null?void 0:yn.status)===0&&(m.b.success(yn==null?void 0:yn.message),Gn());case 6:case"end":return Wt.stop()}},Zt)}));return function(){return dn.apply(this,arguments)}}(),Ei=function(){st.page=1;var Zt=Object.assign({},Gt.getFieldValue());delete st.course_group,delete st.teacher_comment,Object.keys(Zt).map(function(yn){switch(yn){case"task_status":Zt[yn].includes("all")||!Zt[yn].length?(delete st.work_status,Gt.setFieldsValue(Object(Mt.a)({},"task_status","all"))):(st.work_status=Zt[yn],Gt.setFieldsValue(Object(Mt.a)({},"task_status",st.work_status)));break;case"course_group_info":Zt[yn].includes("all")||!Zt[yn].length?(delete st.course_group,Gt.setFieldsValue(Object(Mt.a)({},"course_group_info","all"))):(st.course_group=Zt[yn],Gt.setFieldsValue(Object(Mt.a)({},"course_group_info",st.course_group)));break;case"teacher_comment":if(Zt[yn].includes("all")||!Zt[yn].length)delete st.teacher_comment,Gt.setFieldsValue(Object(Mt.a)({},"teacher_comment","all"));else{var Ht;st.teacher_comment=((Ht=Zt[yn])===null||Ht===void 0?void 0:Ht.length)===1?Number(Zt[yn][0]):"",Gt.setFieldsValue(Object(Mt.a)({},"teacher_comment",Zt[yn]))}break}}),Gn()};Object(a.useEffect)(function(){if(document.getElementById("divhe")){var dn=document.getElementById("divhe").scrollHeight;dn>47&&(Le(47),un(!0))}},[document.getElementById("divhe")]);var Ri=function(Zt,yn){st.page=Zt,st.limit=20,Gn()};function gi(){oi(1),bi(""),gr(""),We(""),le(""),Fn([])}var xi=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(Zt,yn,Ht){return st.limit*(st.page-1)+Ht+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(Zt){return n.a.createElement(M.a,{placement:"bottomLeft",title:Zt},n.a.createElement("span",{className:"current"},Zt))}},!(Dt!=null&&Dt.is_excellent)&&!Object(V.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:st.order==="student_id"?st.b_order==="desc"?"descend":"ascend":null,render:function(Zt){return n.a.createElement(M.a,{placement:"bottomLeft",title:Zt||"--"},n.a.createElement("span",{className:"current"},Zt||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(Zt,yn){return Zt?n.a.createElement(M.a,{placement:"bottom",title:Zt},n.a.createElement("span",{className:"current"},Zt)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:st.order==="work_status"?st.b_order==="desc"?"descend":"ascend":null,render:function(Zt){return n.a.createElement(_.f,{status:Zt})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(Zt,yn){return n.a.createElement(M.a,{placement:"bottomLeft",title:Zt},n.a.createElement("span",{className:"current"},Zt))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(Zt,yn){return n.a.createElement("span",null,Zt||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(Zt,yn){return n.a.createElement("span",null,Zt||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(Zt,yn){return Zt&&Zt!="--"?n.a.createElement(M.a,{placement:"bottom",title:Zt},n.a.createElement("span",{className:"current"},Zt)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(Zt){return Zt?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(Zt,yn){return Object(V.s)()?n.a.createElement("div",null,Object(_.B)(yn==null?void 0:yn.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(x.a,{target:"_blank",onClick:function(Wt){Wt.stopPropagation()},to:"/classrooms/".concat(st.coursesId,"/program_homework/").concat(st.categoryId,"/").concat(yn.id,"/").concat(yn.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(Wt){var pi;if(Wt.stopPropagation(),(pi=Et.userInfo)!==null&&pi!==void 0&&pi.professional_certification)window.open("/classrooms/".concat(st.coursesId,"/program_homework/").concat(st.categoryId,"/").concat(yn.id,"/").concat(yn.user_id,"/comment"),"_blank");else return s.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(_.S)("/account/certification")}}),!1}},"\u67E5\u770B\u4F5C\u4E1A")}}].filter(function(dn){return!!dn}),Di=function(){return n.a.createElement(Ut.a,null,n.a.createElement(Ut.a.Item,{onClick:function(){Object(me.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(Ut.a.Item,{key:"2"},n.a.createElement(x.a,{to:"/classrooms/".concat(st.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(ge.a.wrap," minH500 bg-white pl30 pr30 pt30")},((Tn=Dt.homework_status)===null||Tn===void 0?void 0:Tn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(Z.a,null),!((_n=Dt.homework_status)!==null&&_n!==void 0&&_n.includes("\u672A\u53D1\u5E03"))&&n.a.createElement("aside",null,!Object(V.c)()&&n.a.createElement("div",{className:"c-light-black font12"},n.a.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4 ",Dt==null?void 0:Dt.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",Dt==null?void 0:Dt.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(Dt==null?void 0:Dt.late_time)||"- -")),Object(V.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(mn.a,{form:Gt,onChange:Ei,initialValues:(si={},Object(Mt.a)(si,"task_status","all"),Object(Mt.a)(si,"course_group_info","all"),Object(Mt.a)(si,"teacher_comment","all"),si)},((ai=Dt.task_status)===null||ai===void 0?void 0:ai.length)>0&&n.a.createElement(mn.a.Item,{name:"task_status"},n.a.createElement(dt.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1"},Dt.task_status&&Dt.task_status.map(function(dn,Zt){return n.a.createElement(dt.a,{name:"task_status",value:dn.id},dn.name,"(",dn.count,")")}))))),((J=Dt.course_group_info)===null||J===void 0?void 0:J.length)>0&&n.a.createElement(mn.a.Item,{name:"course_group_info"},n.a.createElement(dt.a.Group,{style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1",id:"divhe",style:{height:$e+"px",overflow:"hidden"}},(ue=Dt.course_group_info)===null||ue===void 0?void 0:ue.map(function(dn,Zt){return n.a.createElement(dt.a,{value:dn.course_group_id},dn.group_group_name,"(",dn.count,")")})),qt&&n.a.createElement("span",{onClick:function(){var Zt=document.getElementById("divhe").scrollHeight;$e>47?Le(47):Le(Zt)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},$e===47?"\u5C55\u5F00":"\u6536\u8D77",$e===47?n.a.createElement(pn.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(tt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((Ce=Dt.teacher_comment)===null||Ce===void 0?void 0:Ce.length)>0&&n.a.createElement(mn.a.Item,{name:"teacher_comment"},n.a.createElement(dt.a.Group,{style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1"},Dt.teacher_comment&&Dt.teacher_comment.map(function(dn,Zt){return n.a.createElement(dt.a,{value:String(dn.id)},dn.name,"(",dn.count,")")})))))),n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,{flex:"1"},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,null,n.a.createElement(jt.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Zt){st.search=Zt,st.page=1,Gn()},style:{width:240}})),n.a.createElement(Ze.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},Dt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Dt.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(Ze.a,null,Object(V.c)()&&n.a.createElement(D.a,{className:"ml10",onClick:function(){et({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Dt.student_works.map(function(Zt){return Zt.id}),params:st}})}},n.a.createElement("span",{className:"".concat(ge.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(V.c)()&&n.a.createElement(D.a,{className:"ml10",onClick:li},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(V.c)()&&n.a.createElement(nt.a,{overlay:Di,className:"ml10"},n.a.createElement(D.a,null,n.a.createElement(fn.a,null),"\u5BFC\u51FA",n.a.createElement(In.a,null)))))),n.a.createElement(ze.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(V.c)()&&Kn&&n.a.createElement("span",null,n.a.createElement("span",{style:{color:"red"}},"*"),"\u5217\u8868\u4E2D\u4F5C\u4E1A\u8BB0\u5F55\u5B58\u5728\u5DEE\u5F02\uFF0C\u8BF7\u70B9\u51FB\u201C\u66F4\u65B0\u6210\u7EE9\u201D\u6309\u94AE")),n.a.createElement(Y.a,{className:"mt30",loading:Ve["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(Zt){return{onClick:function(Ht){window.open("/classrooms/".concat(st.coursesId,"/program_homework/").concat(st.categoryId,"/").concat(Zt.id,"/").concat(Zt.user_id,"/comment"),"_blank")}}},dataSource:Dt.student_works,columns:xi,onChange:function(Zt,yn,Ht){Ht.field&&(st.order=Ht.field),Ht.order||(st.b_order="asc"),Ht.order==="ascend"&&(st.b_order="asc"),Ht.order==="descend"&&(st.b_order="desc"),Ht.order||(st.b_order="asc"),Gn()}}),n.a.createElement(Ge,null),n.a.createElement(ae,null),n.a.createElement(He.a,null)),n.a.createElement(s.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:jn,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(f.a)(o.a.mark(function dn(){var Zt,yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(!(Ln===2)){Wt.next=13;break}if(!(On.length<=0)){Wt.next=4;break}return m.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),Wt.abrupt("return");case 4:if(fe){Wt.next=7;break}return m.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 7:return Wt.next=9,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,status:On}});case 9:Zt=Wt.sent,Zt.status===0&&(Pt(Zt),ln(!1),bn(!0)),Wt.next=32;break;case 13:if(!(Me===0||$i===0)){Wt.next=16;break}Wt.next=22;break;case 16:if(Me){Wt.next=19;break}return m.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 19:if($i){Wt.next=22;break}return m.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 22:if(!(Me>$i)){Wt.next=25;break}return m.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),Wt.abrupt("return");case 25:if(fe){Wt.next=28;break}return m.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 28:return Wt.next=30,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,min_score:Me,max_score:$i}});case 30:yn=Wt.sent,yn.status===0&&(Pt(yn),ln(!1),bn(!0));case 32:case"end":return Wt.stop()}},dn)})),onCancel:function(){ln(!1),gi()}},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(be.a.Group,{value:Ln,onChange:function(Zt){oi(Zt.target.value)}},n.a.createElement(be.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(be.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),Ln===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(Je.a,{min:0,max:100,value:Me,onChange:function(Zt){return We(Zt)},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(Je.a,{min:0,max:100,value:$i,onChange:function(Zt){return gr(Zt)},style:{width:"100px"}})),Ln===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(dt.a.Group,{onChange:function(Zt){Fn(Object(xe.a)(Zt))},style:{width:"100%"}},(Te=Dt.task_status)===null||Te===void 0?void 0:Te.map(function(dn,Zt){return n.a.createElement(dt.a,{name:"task_status",value:dn.id},dn.name,"(",dn.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(ve.a,{className:ge.a.MdEditor,onChange:function(Zt){return le(Zt)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(s.a,{visible:Rn,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(f.a)(o.a.mark(function dn(){var Zt,yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(!(Ln===2)){Wt.next=7;break}return Wt.next=3,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,status:On}});case 3:Zt=Wt.sent,Zt.status===0&&(m.b.info("\u6253\u56DE\u6210\u529F"),gi(),Gn(),bn(!1)),Wt.next=11;break;case 7:return Wt.next=9,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,min_score:Me,max_score:$i}});case 9:yn=Wt.sent,yn.status===0&&(m.b.info("\u6253\u56DE\u6210\u529F"),gi(),Gn(),bn(!1));case 11:case"end":return Wt.stop()}},dn)})),onCancel:function(){gi(),bn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},Ln===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",Me,"-",$i,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),Ln===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((qe=Dt.task_status)===null||qe===void 0?void 0:qe.filter(function(dn){return On==null?void 0:On.includes(dn.id)}).map(function(dn){return dn.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",kt==null?void 0:kt.count,"\u540D\u5B66\u751F")))),n.a.createElement(he,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:Ri,current:st.page||1,defaultPageSize:20,total:Dt.work_count})))},Tt=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading,_n=Bn.user;return{shixunHomeworks:gn,loading:Tn.effects,user:_n}})(Be),Jt=I("fOrg"),En=I("+KLJ"),mt=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.loading,ai=gn.dispatch,J=Object(w.i)(),ue=Object(a.useState)(Object(p.a)(Object(p.a)({},{page:1,limit:20,group_ids:[]}),J)),Ce=Object(r.a)(ue,2),Te=Ce[0],qe=Ce[1],Oe=Object(w.h)(),Ve=_n.codeReview,et=Object(a.useState)({}),Ot=Object(r.a)(et,2),Et=Ot[0],je=Ot[1],ht=mn.a.useForm(),it=Object(r.a)(ht,1),st=it[0];Te.order="code_rate",Te.sort="desc",Te.category=Te.categoryId,Object(a.useEffect)(function(){bt(),console.log("params",Te)},[Te]),Object(a.useEffect)(function(){_n.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&bt()},[_n.actionTabs.key]);var bt=function(){var on=Object(f.a)(o.a.mark(function Dn(){var Kn;return o.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,ai({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},Te)});case 2:Kn=Nn.sent,Kn.status===-2&&setTimeout(function(){return bt()},1500);case 4:case"end":return Nn.stop()}},Dn)}));return function(){return on.apply(this,arguments)}}(),Lt=function(){},ct=function(Dn,Kn){Te.page=Dn,Te.limit=20,ai({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},Te)})},Gt=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(Dn,Kn,wn){return Te.limit*(Te.page-1)+wn+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(Dn){return n.a.createElement("span",{className:"c-orange"},Dn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(Dn,Kn){return n.a.createElement("div",null,n.a.createElement(x.a,{target:"_blank",to:"/classrooms/".concat(Te.coursesId,"/program_homework/").concat(Te.categoryId,"/review_detail/").concat(Kn.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(Ve==null?void 0:Ve.status)===-2&&n.a.createElement(En.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",Ve.last_review_time,n.a.createElement(D.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){ai({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Te}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(Ze.a,null,n.a.createElement(jt.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Dn){Te.search=Dn,ai({type:"shixunHomeworks/getCodeReview",payload:Te})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((Tn=Ve.group_info)===null||Tn===void 0?void 0:Tn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{checked:Te.group_ids=="",value:"all",onChange:function(Dn){delete Te.group_ids,Te.group_ids=[],Te.page=1,qe(Object(p.a)({},Te))}},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1"},Ve.group_info&&Ve.group_info.map(function(on,Dn){return n.a.createElement(dt.a,{style:{marginLeft:0},value:on.id,checked:Te.group_ids.includes(on.id),onChange:function(wn){wn.target.checked?Te.group_ids.push(on.id):Te.group_ids.splice(Te.group_ids.indexOf(on.id),1),Te.page=1,qe(Object(p.a)({},Te))}},on.name,"(",on.members_count,")")}))),n.a.createElement(ze.a,{className:"font14 c-red mt5"},n.a.createElement(Ze.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"},Ve.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",Ve.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(Y.a,{className:"mt30",loading:si["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:Ve.users_reviews,columns:Gt,onChange:function(Dn,Kn,wn){wn.order==="ascend"&&(Te.b_order="asc"),wn.order==="descend"&&(Te.b_order="desc"),wn.order||delete Te.b_order,ai({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},Te)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showSizeChanger:!1,onChange:ct,defaultCurrent:Te.page||1,current:Te.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:Ve.copy_reviews_count})))},Qt=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(mt),gt=I("OaEy"),yt=I("2fM7"),rt=I("iQDF"),ce=I("+eQT"),Re=I("/MfK"),At=I("w5pM"),ot=I("Lyp1"),Yt=I("LvDl"),rn=I("xb3X"),_e=I.n(rn),Ne=I("AHFd"),xt=I("eozf"),Xt=ce.a.RangePicker,vn=yt.a.Option,Mn=function(gn){var Tn,_n,si,ai,J,ue,Ce,Te,qe,Oe,Ve=gn.shixunHomeworks,et=gn.loading,Ot=gn.dispatch,Et=Object(w.i)(),je=Ve.workSetting,ht=Ve.workList,it=Ve.changeData,st=Object(a.useState)(!0),bt=Object(r.a)(st,2),Lt=bt[0],ct=bt[1],Gt=Object(a.useState)(!1),on=Object(r.a)(Gt,2),Dn=on[0],Kn=on[1],wn=Object(a.useState)([]),Nn=Object(r.a)(wn,2),Pn=Nn[0],Dt=Nn[1],sn=Object(a.useState)([]),Ft=Object(r.a)(sn,2),St=Ft[0],Un=Ft[1],Sn=Object(a.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:Ne.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}),zt=Object(r.a)(Sn,2),lt=zt[0],jn=zt[1];Object(a.useEffect)(function(){return ln(),function(){Dt([].concat())}},[]);var ln=function(){Ot({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},Et)})};Object(a.useEffect)(function(){var Rt;if(!(je!=null&&je.course_id))return;Object.keys(lt).map(function(Xe){lt[Xe]=je[Xe]}),(!lt.allow_late||!lt.unified_late)&&(lt.late_minus_score=20,lt.penalty_type=Ne.a.Percent),lt.unified_setting||(lt.unified_late=!1,lt.unified_anonymous_comment=!1,lt.unified_anonymous_appeal=!1),Pn=JSON.parse(JSON.stringify(je.group_settings.map(function(Xe){return Object(p.a)(Object(p.a)({},Xe),{},{group_name:[Xe.group_name]})}).filter(function(Xe){return Xe.publish_time!==null}))),St=JSON.parse(JSON.stringify(je.allow_late_settings.map(function(Xe){return Object(p.a)(Object(p.a)({},Xe),{},{group_name:[Xe.group_name]})}).filter(function(Xe){return Xe.late_time!==null}))),lt.difficult_settings.length===0&&(lt.difficult_settings=[0,0,0]),jn(Object(p.a)({},lt)),Dt(Object(xe.a)(Pn)),((Rt=St)===null||Rt===void 0?void 0:Rt.length)<=0?Un([{late_minus_score:20}]):Un(Object(xe.a)(St))},[je]);var Jn=function(){var Xe,kt=JSON.parse(JSON.stringify(lt));if(kt.categoryId=Et.categoryId,lt.unified_setting||(Pn=(Xe=Pn)===null||Xe===void 0?void 0:Xe.map(function(an){var zn;if(!an.publish_time||!an.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(!an.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return an.group_name=typeof(an==null?void 0:an.group_name)=="string"?[an==null?void 0:an.group_name]:an==null?void 0:an.group_name,an.group_id=(zn=je.group_settings)===null||zn===void 0?void 0:zn.filter(function(Ln){var oi;return an==null||((oi=an.group_name)===null||oi===void 0)?void 0:oi.includes(Ln.group_name)}).map(function(Ln){return Ln.group_id||Ln.id}).toString().split(","),an})),kt.group_settings=Pn,lt.allow_late)if(lt.unified_late){if(lt.late_minus_score===null||lt.late_minus_score===void 0||lt.late_minus_score<0||lt.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(!lt.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 Pt;St=(Pt=St)===null||Pt===void 0?void 0:Pt.map(function(an){var zn,Ln;if(an.late_minus_score===null||an.late_minus_score===void 0||an.late_minus_score<0||an.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(!an.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(!an.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return an.group_name=typeof(an==null?void 0:an.group_name)=="string"?[an==null?void 0:an.group_name]:an==null?void 0:an.group_name,an.group_id=an==null||((zn=an.group_name)===null||zn===void 0||((Ln=zn.map(function(oi){var ei,Oi,mi=(ei=je.group_settings)===null||ei===void 0||((Oi=ei.filter(function(bi){return(bi==null?void 0:bi.group_name)===oi}))===null||Oi===void 0)?void 0:Oi[0];return mi==null?void 0:mi.group_id}))===null||Ln===void 0))?void 0:Ln.toString().split(","),an}),kt.allow_late_settings=St}kt.send_type===1&&(kt.difficult_settings=kt.difficult_settings.map(function(an){return an||0})),$t(kt)},$t=function(Xe){var kt;if(Xe.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Xe!=null&&Xe.work_efficiency&&Xe.eff_score===null){m.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Pt={shixun_evaluation:Xe.shixun_evaluation,challenge_settings:Xe.challenge_settings},an=function(){var zn=Object(f.a)(o.a.mark(function Ln(){var oi;return o.a.wrap(function(Oi){for(;;)switch(Oi.prev=Oi.next){case 0:return Kn(!0),Oi.next=3,Object(R.a)("/api/homework_commons/".concat(Et.categoryId,"/publish_setting.json"),{method:"post",body:Object(p.a)({},Xe)});case 3:oi=Oi.sent,oi.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),ct(!0),ln(),Ot({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},Et)})),Kn(!1);case 6:case"end":return Oi.stop()}},Ln)}));return function(){return zn.apply(this,arguments)}}();!Object(Yt.isEqual)(it,Pt)&&!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))?s.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:an}):an()},On=function(Xe,kt){var Pt,an=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return kt?kt.find(function(zn){return zn[an]===Xe}):je==null||((Pt=je.group_settings)===null||Pt===void 0)?void 0:Pt.find(function(zn){return zn.group_id[0]===Xe})},Fn=(je==null?void 0:je.allow_late)||(je==null?void 0:je.anonymous_comment),hn=function(Xe){var kt=On(Xe,je==null?void 0:je.allow_late_settings,"id"),Pt=On(Xe,je==null?void 0:je.anonymous_comment_settings);return(je==null?void 0:je.allow_late)&&kt&&(kt==null?void 0:kt.late_time)!==null||(je==null?void 0:je.anonymous_comment)&&Pt&&(Pt==null?void 0:Pt.evaluation_start)!==null},yi=Object(a.useMemo)(function(){var Rt;if(je!=null&&je.unified_setting){var Xe;return!(ht!=null&&(Xe=ht.homework_status)!==null&&Xe!==void 0&&Xe.includes("\u5DF2\u622A\u6B62"))||(je==null?void 0:je.allow_late)||(je==null?void 0:je.anonymous_comment)}var kt=je==null||((Rt=je.group_settings)===null||Rt===void 0)?void 0:Rt.some(function(Pt){return G()(Pt.end_time)<=G()()});return!kt||(je==null?void 0:je.allow_late)||(je==null?void 0:je.all_group_late)},[je,ht]),Rn=je==null?void 0:je.anonymous_comment,bn=function(Xe){if(!Xe)return!1;var kt=On(Xe,je==null?void 0:je.anonymous_comment_settings);return(je==null?void 0:je.anonymous_comment)&&kt&&(kt==null?void 0:kt.evaluation_start)!==null};return n.a.createElement("section",{className:_e.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,{flex:"1"},n.a.createElement("div",{className:_e.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(Ze.a,null,Object(V.c)()&&n.a.createElement(D.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return ct(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(be.a.Group,{disabled:Lt||!(ht!=null&&(Tn=ht.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),value:lt.send_type,onChange:function(Xe){lt.send_type=Xe.target.value,jn(Object.assign({},lt))}},n.a.createElement(be.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(be.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),lt.send_type===1&&n.a.createElement(ze.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(Ze.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:Lt||!(ht!=null&&(_n=ht.homework_status)!==null&&_n!==void 0&&_n.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(lt.difficult_count[0]||0),min:0,max:lt.difficult_count[0]||0,value:lt.difficult_settings[0],onChange:function(Xe){lt.difficult_settings[0]=Xe,jn(Object.assign({},lt))},className:"ml10 mr20"})),n.a.createElement(Ze.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:Lt||!(ht!=null&&(si=ht.homework_status)!==null&&si!==void 0&&si.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(lt.difficult_count[1]||0),min:0,max:lt.difficult_count[1]||0,value:lt.difficult_settings[1],onChange:function(Xe){lt.difficult_settings[1]=Xe,jn(Object.assign({},lt))},className:"ml10 mr20"})),n.a.createElement(Ze.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:Lt||!(ht!=null&&(ai=ht.homework_status)!==null&&ai!==void 0&&ai.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(lt.difficult_count[2]||0),min:0,max:lt.difficult_count[2]||0,value:lt.difficult_settings[2],onChange:function(Xe){lt.difficult_settings[2]=Xe,jn(Object.assign({},lt))},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(be.a.Group,{disabled:Lt||!(ht!=null&&(J=ht.homework_status)!==null&&J!==void 0&&J.includes("\u672A\u53D1\u5E03")),value:lt.unified_setting,onChange:function(Xe){var kt;if(!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))){m.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(lt.unified_setting=!lt.unified_setting,lt.unified_setting||(lt.unified_late=!1),jn(Object.assign({},lt)),lt.unified_setting===!1&&Pn==""){Dt(Pn.concat({}));return}lt.unified_setting&&(Dt([]),Un([{late_minus_score:5}]))}},n.a.createElement(be.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(be.a,{className:"ml20",disabled:(je==null||((ue=je.group_settings)===null||ue===void 0)?void 0:ue.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(je==null||((Ce=je.group_settings)===null||Ce===void 0)?void 0:Ce.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")),lt.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(ce.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(Xe){return Object(xt.b)(Xe,je==null?void 0:je.course_end_date)},disabledTime:function(Xe){return Object(xt.c)(Xe)},disabled:Lt||!(ht!=null&&(Te=ht.homework_status)!==null&&Te!==void 0&&Te.includes("\u672A\u53D1\u5E03")),value:lt.publish_time?G()(lt.publish_time):"",onChange:function(Xe,kt){lt.publish_time=kt,(lt.end_time==""||!lt.end_time)&<.unified_setting&&(lt.end_time=G()(Xe).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),jn(Object.assign({},lt))}})),n.a.createElement(Ze.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(ce.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Lt||Fn,disabledDate:function(Xe){return Object(xt.b)(Xe,je==null?void 0:je.course_end_date,lt.publish_time)},disabledTime:function(Xe){return Object(xt.c)(Xe,lt.publish_time)},value:lt.end_time?G()(lt.end_time):"",onChange:function(Xe,kt){lt.end_time=kt,jn(Object.assign({},lt))}})),n.a.createElement(Ze.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)")))),!lt.unified_setting&&((qe=Pn)===null||qe===void 0?void 0:qe.length)>0&&n.a.createElement(ze.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(Ze.a,{span:24},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{span:10}),n.a.createElement(Ze.a,{span:10},n.a.createElement(ze.a,{className:"c-grey-c ml30"},n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(Ze.a,{span:4}))),Pn&&Pn.map(function(Rt,Xe){var kt,Pt,an,zn,Ln;return n.a.createElement(Ze.a,{span:24,key:Xe},n.a.createElement(ze.a,{gutter:[8,16]},n.a.createElement(Ze.a,{span:10},n.a.createElement(ze.a,{gutter:[8,16]},n.a.createElement(Ze.a,null,"\u53D1\u5E03\u89C4\u5219 ",Xe+1),n.a.createElement(Ze.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(yt.a,{disabled:Lt||!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))&&Rt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Rt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(ei){Pn[Xe].group_name=ei,Pn[Xe].group_id=Rt.group_id;var Oi=Object(Yt.flattenDeep)(Pn.map(function(bi){return bi.group_name})),mi=St.map(function(bi){var Ji=(bi==null?void 0:bi.group_name)||[];return Object(p.a)(Object(p.a)({},bi),{},{group_name:Object(Yt.remove)(Ji,function(Vi){return Oi.includes(Vi)})})});Un(mi),Dt(Pn.slice())}},je.group_settings&&je.group_settings.map(function(oi){if(!Pn.map(function(ei){return ei.group_name}).toString().split(",").includes(String(oi.group_name)))return n.a.createElement(vn,{value:oi.group_name,key:oi.id},oi.group_name)}))))),n.a.createElement(Ze.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Xt,{allowClear:!1,ranges:{\u6B64\u523B:[Rt.publish_time?G()(Rt.publish_time):G()(),G()()]},disabled:Lt||(G()()<=G()((Pt=On((an=Rt.group_id)===null||an===void 0?void 0:an[0]))===null||Pt===void 0?void 0:Pt.publish_time)?!1:[!0,hn((zn=Rt.group_id)===null||zn===void 0?void 0:zn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(ei){return Object(xt.b)(ei,je==null?void 0:je.course_end_date)},disabledTime:function(ei){return Object(xt.c)(ei)},showTime:{format:"HH:mm",defaultValue:[G()(Object(_.d)(),"HH:mm"),G()(Object(_.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Rt.publish_time&&[G()(Rt.publish_time),Rt.end_time?G()(Rt.end_time):void 0],onChange:function(ei,Oi){Pn[Xe].publish_time=Oi[0],Pn[Xe].end_time=Oi[1],Dt(Object(xe.a)(Pn))}}))),!Lt&&n.a.createElement(Ze.a,{span:4},Xe>0&&!Rt.id&&n.a.createElement(Re.a,{onClick:function(){Pn=Pn.filter(function(ei,Oi){return Xe!==Oi}),Dt(Pn.slice()),setTimeout(function(){return Dt(Pn.slice())},10)}}),Pn.length<(je==null||((Ln=je.group_settings)===null||Ln===void 0)?void 0:Ln.length)&&n.a.createElement(At.a,{className:"c-green ml20",onClick:function(){Dt(Pn.concat({}))}}))))})),n.a.createElement(ze.a,{className:"mt30"},n.a.createElement(Ze.a,null,n.a.createElement(ze.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(M.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(ot.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(Ze.a,{span:24,className:"mt10"},n.a.createElement(dt.a,{checked:lt.allow_late,disabled:Lt||yi,onChange:function(){lt.allow_late=!lt.allow_late,St==""&&Un([{late_minus_score:5}]),jn(Object.assign({},lt))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(M.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(ot.a,null)))),(lt==null?void 0:lt.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(be.a.Group,{disabled:Lt||(je==null?void 0:je.anonymous_comment)||(je==null?void 0:je.allow_late),value:lt.unified_late,onChange:function(Xe){lt.unified_late=Xe.target.value,St==""&&!Xe.target.value&&Un([{late_minus_score:5}]),jn(Object(p.a)({},lt))}},(lt==null?void 0:lt.unified_setting)&&n.a.createElement(be.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(je==null||((Oe=je.group_settings)===null||Oe===void 0)?void 0:Oe.length)&&n.a.createElement(be.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),lt!=null&<.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(Ze.a,{className:"ml5"},n.a.createElement(Ne.b,{disabled:Lt||Rn,value:{type:lt.penalty_type,inputValue:lt.late_minus_score},onChange:function(Xe){jn(Object(p.a)(Object(p.a)({},lt),{},{late_minus_score:Xe.inputValue,penalty_type:Xe.type}))}})),n.a.createElement(Ze.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},lt.penalty_type===Ne.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(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(Ze.a,{className:"ml5"},n.a.createElement(ce.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Lt||Rn,value:lt.late_time?G()(lt.late_time):"",disabledDate:function(Xe){return Object(xt.b)(Xe,je==null?void 0:je.course_end_date)},disabledTime:function(Xe){return Object(xt.c)(Xe)},onChange:function(Xe,kt){lt.late_time=kt,jn(Object.assign({},lt))}})),n.a.createElement(Ze.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)")))):St.map(function(Rt,Xe){var kt;return n.a.createElement(Ze.a,{span:24,key:Xe},n.a.createElement(ze.a,{className:"mt25"},n.a.createElement(Ze.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Xe+1,"\uFF1A"),n.a.createElement(yt.a,{disabled:Lt||!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))&&Rt.id||(je==null?void 0:je.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Rt.group_name=="string"?[Rt.group_name]:Rt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(an){St[Xe].group_name=an,St[Xe].group_id=Rt.group_id,Un(St.slice())}},je.group_settings&&je.group_settings.map(function(Pt){if(lt!=null&<.unified_setting&&!St.map(function(an){return an.group_name}).toString().split(",").includes(String(Pt.group_name)))return n.a.createElement(vn,{value:Pt.group_name,key:Pt.id},Pt.group_name);if(Pn.map(function(an){return an.group_name}).toString().split(",").includes(String(Pt.group_name))&&(!St.map(function(an){return an.group_name}).toString().split(",").includes(String(Pt.group_name))&&G()(Pt.end_time)<=G()()))return n.a.createElement(vn,{value:Pt.group_name,key:Pt.id},Pt.group_name)}))),n.a.createElement(Ze.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(Ne.b,{disabled:Lt||bn(Rt.id),value:{type:Rt.penalty_type,inputValue:Rt.late_minus_score},onChange:function(an){St[Xe].late_minus_score=an.inputValue,St[Xe].penalty_type=an.type,Un(Object(xe.a)(St))}})),n.a.createElement(Ze.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(ce.a,{disabled:Lt||bn(Rt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(an){return Object(xt.b)(an,je==null?void 0:je.course_end_date)},disabledTime:function(an){return Object(xt.c)(an)},format:"YYYY-MM-DD HH:mm",value:Rt!=null&&Rt.late_time?G()(Rt.late_time):void 0,onChange:function(an,zn){St[Xe].late_time=zn,Un(Object(xe.a)(St))}})),!Lt&&n.a.createElement(Ze.a,{className:"ml20"},Xe>0&&!Rt.id&&n.a.createElement(Re.a,{onClick:function(){St=St.filter(function(an,zn){return Xe!==zn}),Un(St.slice()),setTimeout(function(){return Un(St.slice())},10)}}),n.a.createElement(At.a,{className:"c-green ml20",onClick:function(){Un(St.concat({penalty_type:Ne.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!Lt&&n.a.createElement("div",{className:_e.a.btns},n.a.createElement(D.a,{type:"primary",loading:Dn,onClick:function(){return Jn()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){ct(!0),ln()}},"\u53D6\u6D88")))},ci=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(Mn);function $n(Bn,gn){for(var Tn=[],_n=Bn;_nG()(Ce.rank_forbidden_start),value:hn.rank_forbidden_start?G()(hn.rank_forbidden_start):"",onChange:function(Pt,an){hn.rank_forbidden_start=an,(hn.end_time==""||!hn.end_time)&&hn.unified_setting&&(hn.end_time=G()(Pt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),yi(Object.assign({},hn))}})),n.a.createElement(Ze.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(ze.a,{align:"middle",className:"mt25"},n.a.createElement(Ze.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(ce.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:et,disabledDate:bn,value:hn.rank_forbidden_end?G()(hn.rank_forbidden_end):"",onChange:function(Pt,an){hn.rank_forbidden_end=an,yi(Object.assign({},hn))}})),n.a.createElement(Ze.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))))),console.log("----",Nn),!hn.unified_setting&&((Tn=Nn)===null||Tn===void 0?void 0:Tn.length)>0&&!!hn.rank_forbidden&&n.a.createElement(ze.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(Ze.a,{span:24},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{span:10}),n.a.createElement(Ze.a,{span:10},n.a.createElement(ze.a,{className:"c-grey-c ml30"},n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(Ze.a,{span:4}))),Ft.map(function(kt,Pt){var an,zn,Ln,oi,ei,Oi,mi;return n.a.createElement(Ze.a,{span:24,key:Pt},n.a.createElement(ze.a,{className:"mt25"},n.a.createElement(Ze.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",Pt+1,"\uFF1A"),n.a.createElement(yt.a,{disabled:et||!(Te!=null&&(an=Te.homework_status)!==null&&an!==void 0&&an.includes("\u672A\u53D1\u5E03"))&&kt.id,mode:"multiple",style:{width:306},value:typeof kt.group_name=="string"?[kt.group_name]:kt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Ji){Ft[Pt].group_name=Ji,Ft[Pt].group_id=kt.group_id,St(Ft.slice())}},Ce.group_settings&&Ce.group_settings.map(function(bi){if(hn!=null&&hn.unified_setting&&!Ft.map(function(Ji){return Ji.group_name}).toString().split(",").includes(String(bi.group_name)))return n.a.createElement(Wi,{value:bi.group_name,key:bi.id},bi.group_name);if(Nn.map(function(Ji){return Ji.group_name}).toString().split(",").includes(String(bi.group_name))&&!Ft.map(function(Ji){return Ji.group_name}).toString().split(",").includes(String(bi.group_name)))return n.a.createElement(Wi,{value:bi.group_name,key:bi.id},bi.group_name)}))),n.a.createElement(Ze.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Ti,{allowClear:!1,disabled:et||(Ce!=null&&(zn=Ce.group_settings)!==null&&zn!==void 0&&(Ln=zn.filter(function(bi){return bi.id===kt.id}))!==null&&Ln!==void 0&&(oi=Ln[0])!==null&&oi!==void 0&&oi.rank_forbidden_start?G()()0&&!kt.id&&n.a.createElement(Re.a,{onClick:function(){Ft=Ft.filter(function(Ji,Vi){return Pt!==Vi}),St(Ft.slice()),setTimeout(function(){return St(Ft.slice())},10)}}),n.a.createElement(At.a,{className:"c-green ml20",onClick:function(){St(Ft.concat({}))}}))))})),!et&&n.a.createElement("div",{className:_e.a.btns},n.a.createElement(D.a,{type:"primary",loading:Lt,onClick:function(){return Rt()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){Ot(!0),Rn()}},"\u53D6\u6D88"))),n.a.createElement(s.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:zt,onCancel:function(){return lt(!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(jt.a.Search,{onChange:function(Pt){}})),n.a.createElement(Y.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Pt,an){$t(Pt)}},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"}]}))))},fi=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(hi),ji=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.loading,ai=gn.dispatch,J=Object(w.i)(),ue=_n.workSetting,Ce=_n.workList,Te=_n.changeData,qe=Object(a.useState)(!0),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)(!1),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=Object(a.useState)(!1),st=Object(r.a)(it,2),bt=st[0],Lt=st[1],ct=mn.a.useForm(),Gt=Object(r.a)(ct,1),on=Gt[0],Dn=Object(a.useState)([]),Kn=Object(r.a)(Dn,2),wn=Kn[0],Nn=Kn[1],Pn=Object(a.useState)([]),Dt=Object(r.a)(Pn,2),sn=Dt[0],Ft=Dt[1],St=!(Ce!=null&&(Tn=Ce.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),Un=Object(a.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}),Sn=Object(r.a)(Un,2),zt=Sn[0],lt=Sn[1];Object(a.useEffect)(function(){return jn(),function(){Nn([].concat())}},[]);var jn=function(){ai({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},J)})};Object(a.useEffect)(function(){if(!(ue!=null&&ue.course_id))return;Object.keys(zt).map(function(On){zt[On]=ue[On]}),(!zt.allow_late||!zt.unified_late)&&(zt.late_penalty=5),wn=JSON.parse(JSON.stringify(ue.group_settings.map(function(On){return Object(p.a)(Object(p.a)({},On),{},{group_name:[On.group_name]})}).filter(function(On){return On.publish_time!==null}))),sn=JSON.parse(JSON.stringify(ue.allow_late_settings.map(function(On){return Object(p.a)(Object(p.a)({},On),{},{group_name:[On.group_name]})}).filter(function(On){return On.late_time!==null}))),$t(),lt(Object(p.a)({},zt)),Nn(Object(xe.a)(wn)),Ft(Object(xe.a)(sn))},[ue]);var ln=function(){var Fn=JSON.parse(JSON.stringify(zt));Jn(Fn)},Jn=function(Fn){if(console.log(Fn.total_score,Fn.eff_score),Fn.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var hn=function(){var yi=Object(f.a)(o.a.mark(function Rn(){var bn;return o.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return ht(!0),Xe.next=3,Object(R.a)("/api/homework_commons/".concat(J.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(p.a)({},Fn)});case 3:bn=Xe.sent,bn.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),et(!0),jn(),ai({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},J)})),ht(!1);case 6:case"end":return Xe.stop()}},Rn)}));return function(){return yi.apply(this,arguments)}}();(zt==null?void 0:zt.hack_score_settings)!==(ue==null?void 0:ue.hack_score_settings)&&St?s.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:hn}):hn()},$t=function(){var Fn,hn=zt.total_score,yi=(Fn=zt.hack_settings)===null||Fn===void 0?void 0:Fn.length,Rn=0,bn;switch(zt.hack_score_settings){case 0:var Rt=(hn/yi).toFixed(2);zt.hack_settings.map(function(ei,Oi){Rn=Oi,ei.hack_score=Rt>0?Rt:0}),bn=(hn-Rt*(yi-1)).toFixed(2),zt.hack_settings[Rn].hack_score=bn>0?bn:0;break;case 1:var Xe=[0,1,3,6],kt=0,Pt=zt.hack_settings.filter(function(ei){return ei.difficult===1}).length*Xe[1],an=zt.hack_settings.filter(function(ei){return ei.difficult===2}).length*Xe[2],zn=zt.hack_settings.filter(function(ei){return ei.difficult===3}).length*Xe[3],Ln=hn/(Pt+an+zn);console.log(Ln,2222),zt.hack_settings.map(function(ei,Oi){Rn=Oi,ei.hack_score=(Xe[ei.difficult]*Ln).toFixed(2),kt=kt+Number(ei.hack_score)});var oi=zt.hack_settings[Rn].hack_score;bn=(hn-kt+Number(oi)).toFixed(2),zt.hack_settings[Rn].hack_score=bn>0?bn:0;break}};return n.a.createElement("section",{className:_e.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,{flex:"1"}),n.a.createElement(Ze.a,null,(ue==null?void 0:ue.can_edit)&&n.a.createElement(D.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return et(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement(Je.a,{min:0,className:"ml10 mr10",style:{width:160},value:zt.total_score,disabled:Ve||St,onChange:function(Fn){zt.total_score=Fn,lt(Object.assign({},zt)),$t()}}),"\xA0\u5206"),n.a.createElement(Ze.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement(Je.a,{className:"ml10 mr10",style:{width:160},min:0,value:zt.punish_time,precision:0,disabled:Ve,onChange:function(Fn){zt.punish_time=Fn,lt(Object.assign({},zt)),$t()}}),"\xA0\u5206\u949F")),n.a.createElement(ze.a,{align:"middle",style:{marginTop:20}},n.a.createElement(Ze.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(Ze.a,{flex:"1"},n.a.createElement(mn.a.Item,{className:"ml20"},n.a.createElement(be.a.Group,{disabled:Ve||St,value:zt.hack_score_settings,onChange:function(Fn){zt.hack_score_settings=Fn.target.value,lt(Object.assign({},zt)),$t()}},n.a.createElement(be.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(be.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(be.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:_e.a.hackList},zt.hack_settings&&zt.hack_settings.map(function(On,Fn){return n.a.createElement(ze.a,{key:Fn,align:"middle",style:{marginTop:20}},n.a.createElement(Ze.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,On.hack_name)),n.a.createElement(Ze.a,{flex:"150px"},n.a.createElement(Je.a,{min:0,step:.1,value:On.hack_score,disabled:Ve||zt.hack_score_settings!==2||St,onChange:function(yi){zt.hack_settings[Fn].hack_score=yi;var Rn=zt.hack_settings.reduce(function(bn,Rt){return bn+Number(Rt.hack_score)},0);zt.total_score=Rn.toFixed(2),lt(Object(p.a)({},zt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(Ze.a,{style:{lineHeight:"20px"}},On.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),On.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),On.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}}),!Ve&&n.a.createElement("div",{className:_e.a.btns},n.a.createElement(D.a,{type:"primary",loading:je,onClick:function(){return ln()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){et(!0),jn()}},"\u53D6\u6D88")))},er=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(ji),yr=function(gn){var Tn,_n,si=gn.shixunHomeworks,ai=gn.loading,J=gn.dispatch,ue=Object(a.useState)(!0),Ce=Object(r.a)(ue,2),Te=Ce[0],qe=Ce[1],Oe=Object(a.useState)(!1),Ve=Object(r.a)(Oe,2),et=Ve[0],Ot=Ve[1],Et=Object(a.useState)([]),je=Object(r.a)(Et,2),ht=je[0],it=je[1],st=Object(a.useState)([]),bt=Object(r.a)(st,2),Lt=bt[0],ct=bt[1],Gt=Object(a.useState)([]),on=Object(r.a)(Gt,2),Dn=on[0],Kn=on[1],wn=Object(a.useState)([]),Nn=Object(r.a)(wn,2),Pn=Nn[0],Dt=Nn[1],sn=Object(w.i)();function Ft(){return St.apply(this,arguments)}function St(){return St=Object(f.a)(o.a.mark(function lt(){var jn;return o.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(R.a)("/api/homework_commons/".concat(sn.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:jn=Jn.sent,ct(jn);case 4:case"end":return Jn.stop()}},lt)})),St.apply(this,arguments)}function Un(){return Sn.apply(this,arguments)}function Sn(){return Sn=Object(f.a)(o.a.mark(function lt(){var jn;return o.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(R.a)("/api/courses/".concat(sn==null?void 0:sn.coursesId,"/teachers"),{method:"get",params:{homework_id:sn.categoryId}});case 2:jn=Jn.sent,jn==null||jn.teacher_list.map(function($t){$t.key=$t.user_id}),Kn(jn==null?void 0:jn.teacher_list),Dt(jn==null?void 0:jn.teacher_list);case 6:case"end":return Jn.stop()}},lt)})),Sn.apply(this,arguments)}Object(a.useEffect)(function(){Ft(),Un()},[sn]);var zt=function(){};return n.a.createElement("section",{className:_e.a.form},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(Lt==null?void 0:Lt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){Ot(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),n.a.createElement(ze.a,{style:{marginTop:"20px",marginBottom:"20px"}},(Lt==null||((Tn=Lt.data)===null||Tn===void 0)?void 0:Tn.length)<=0&&n.a.createElement(Z.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),Lt==null||((_n=Lt.data)===null||_n===void 0)?void 0:_n.map(function(lt){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"}},lt==null?void 0:lt.real_name),(Lt==null?void 0:Lt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(f.a)(o.a.mark(function jn(){var ln;return o.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(R.a)("/api/homework_commons/".concat(sn.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:lt.id}});case 2:ln=$t.sent,ln.status===0&&(m.b.info("\u5220\u9664\u6210\u529F"),Ft(),Un());case 4:case"end":return $t.stop()}},jn)}))},"X"))})),n.a.createElement(ze.a,null,!Te&&n.a.createElement(Ze.a,{className:"mb50"},n.a.createElement(D.a,{type:"primary",size:"large",onClick:function(){return zt()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){qe(!0)}},"\u53D6\u6D88"))),n.a.createElement(s.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:et,onCancel:function(){return Ot(!1)},onOk:Object(f.a)(o.a.mark(function lt(){var jn;return o.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:if(!(ht.length===0)){Jn.next=3;break}return m.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),Jn.abrupt("return");case 3:return Jn.next=5,Object(R.a)("/api/homework_commons/".concat(sn.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:ht}});case 5:jn=Jn.sent,jn.status===0&&(m.b.info("\u6DFB\u52A0\u6210\u529F"),it([]),Ft(),Un(),Ot(!1));case 7:case"end":return Jn.stop()}},lt)}))},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(jt.a.Search,{onChange:function(jn){Kn(Pn.filter(function(ln){return ln.name.indexOf(jn.target.value)>-1}))}})),n.a.createElement(Y.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(jn,ln){it(jn)},selectedRowKeys:ht,getCheckboxProps:function(jn){return{disabled:jn.is_collaborator}}},pagination:!1,dataSource:Dn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},cn=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(yr),ri=ce.a.RangePicker,pr=yt.a.Option,Cr=function(gn){var Tn=gn.shixunHomeworks,_n=gn.loading,si=gn.dispatch;return n.a.createElement("section",{className:"bg-white pl30 pr30 pt10 mb10"},n.a.createElement(K.a,null,n.a.createElement(K.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},n.a.createElement(ci,null)),n.a.createElement(K.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(er,null)),n.a.createElement(K.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(fi,null)),n.a.createElement(K.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(cn,null))))},tr=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(Cr),nr=I("RotF"),X=I.n(nr),S=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.loading,ai=gn.dispatch,J=Object(w.i)(),ue=Object(w.h)(),Ce=Object(a.useState)([]),Te=Object(r.a)(Ce,2),qe=Te[0],Oe=Te[1],Ve=Object(a.useState)([]),et=Object(r.a)(Ve,2),Ot=et[0],Et=et[1],je=Object(a.useState)(!0),ht=Object(r.a)(je,2),it=ht[0],st=ht[1],bt=Object(a.useState)(!1),Lt=Object(r.a)(bt,2),ct=Lt[0],Gt=Lt[1],on=Object(a.useState)(1),Dn=Object(r.a)(on,2),Kn=Dn[0],wn=Dn[1],Nn=Object(a.useState)([]),Pn=Object(r.a)(Nn,2),Dt=Pn[0],sn=Pn[1],Ft=Object(a.useState)(!1),St=Object(r.a)(Ft,2),Un=St[0],Sn=St[1],zt=Object(a.useState)(!1),lt=Object(r.a)(zt,2),jn=lt[0],ln=lt[1];Object(a.useEffect)(function(){_n.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(On.resetFields(),Oe([]),Sn(!0),hn()):Sn(!1)},[_n.actionTabs.key]);var Jn=mn.a.useForm(),$t=Object(r.a)(Jn,1),On=$t[0],Fn=[],hn=function(){var bn=Object(f.a)(o.a.mark(function Rt(){var Xe,kt,Pt;return o.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(!(it&&!ct)){zn.next=11;break}return Gt(!0),wn(Kn+1),zn.next=5,Object(vt.x)(Object(p.a)(Object(p.a)({},J),{},{page:Kn}));case 5:kt=zn.sent,Pt=Object(xe.a)(kt.group_list),kt!=null&&kt.ungroup_list&&Pt.push({id:kt==null?void 0:kt.ungroup_list.id,name:kt==null?void 0:kt.ungroup_list.name,works_count:kt==null?void 0:kt.ungroup_list.work_count,last_review_time:kt==null?void 0:kt.ungroup_list.last_review_time}),Oe([].concat(Object(xe.a)(qe),Object(xe.a)(Pt))),Gt(!1),((Xe=kt.group_list)===null||Xe===void 0?void 0:Xe.length)<10&&st(!1);case 11:case"end":return zn.stop()}},Rt)}));return function(){return bn.apply(this,arguments)}}(),yi=function(){ai({type:"shixunHomeworks/setActionTabs",payload:{}}),ln(!1),st(!0),Gt(!1),wn(1),Oe([]),On.resetFields()},Rn=[{title:"",dataIndex:"id",width:280,render:function(Rt,Xe){return n.a.createElement(dt.a,{disabled:!(Xe.works_count>1),value:String(Xe.id)},Xe.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(s.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Un,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(f.a)(o.a.mark(function bn(){var Rt,Xe;return o.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Rt=On.getFieldValue(),Pt.next=3,Object(R.a)("/api/homework_commons/".concat(J.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(xe.a)(Rt.group_ids)}});case 3:if(Xe=Pt.sent,!(Xe.status===0)){Pt.next=11;break}return yi(),m.b.success("\u64CD\u4F5C\u6210\u529F"),Pt.next=9,ai({type:"shixunHomeworks/getWorkList",payload:_n.actionTabs.params});case 9:O.d.push("/classrooms/".concat(J.coursesId,"/program_homework/").concat(J.categoryId,"/detail?tabs=2")),ai({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return Pt.stop()}},bn)})),onCancel:yi},_n.codeReviewCourse&&n.a.createElement(mn.a,{form:On,onChange:function(Rt){sn(Object(p.a)({},On.getFieldValue()))},initialValues:(Tn={},Object(Mt.a)(Tn,"group_ids",Fn),Object(Mt.a)(Tn,"end_time",G()(G()().add(7,"days").format("YYYY-MM-DD HH:mm"))),Tn)},n.a.createElement("div",{className:"flexd-table-header mt20"},n.a.createElement(Y.a,{pagination:!1,dataSource:[],columns:Rn})),n.a.createElement(mn.a.Item,{name:"group_ids"},n.a.createElement(dt.a.Group,{className:"w100"},n.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},n.a.createElement(X.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(Rt){hn()},hasMore:it,useWindow:!1},n.a.createElement(Y.a,{loading:si.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:Rn,dataSource:qe,pagination:!1})))))),n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(dt.a,{checked:jn,onChange:function(Rt){ln(Rt.target.checked);var Xe=[];Rt.target.checked&&(Xe=qe.filter(function(kt){return kt.works_count>1}).map(function(kt){return kt.id+""})),On.setFieldsValue(Object(Mt.a)({},"group_ids",Xe))}},"\u5168\u9009"))))},L=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn}})(S),W=I("nPLb"),ne=I("XpUO"),Q=I("bTeP"),ke=I.n(Q),Vt=I("HBuW"),kn=I("NLgs"),Qn=I("m3rI"),nn=I("+92d"),ti=I.n(nn),qn=I("wwSX"),Li=I.n(qn),lr=I("zlzj"),ar=I.n(lr),Ki=I("deN7"),Pr=[ti.a,Li.a,ar.a],Vr=function(gn){var Tn,_n,si=gn.user,ai=Object(a.useState)(Object(p.a)(Object(p.a)({},Object(w.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(V.s)()?[si.userInfo.course.course_group_id]:[]},Object(w.i)())),J=Object(r.a)(ai,2),ue=J[0],Ce=J[1],Te=Object(a.useState)([]),qe=Object(r.a)(Te,2),Oe=qe[0],Ve=qe[1],et=Object(a.useState)([]),Ot=Object(r.a)(et,2),Et=Ot[0],je=Ot[1],ht=Object(a.useState)([]),it=Object(r.a)(ht,2),st=it[0],bt=it[1],Lt=Object(a.useState)(!1),ct=Object(r.a)(Lt,2),Gt=ct[0],on=ct[1],Dn=Object(a.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(Ft,St,Un){return Ft<4?n.a.createElement("img",{src:Pr[Ft-1]}):Ft}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(Ft,St,Un){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Qn.a.IMG_SERVER+"/images/"+(St==null?void 0:St.image_url)}),Ft)}},{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(Ft){return Ft||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),Kn=Object(r.a)(Dn,2),wn=Kn[0],Nn=Kn[1];Object(a.useEffect)(function(){wn.splice(7);for(var sn=function(Sn){var zt,lt,jn,ln,Jn={};Jn.title=Oe!=null&&Oe.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Sn+1)+"\uFF08".concat(Oe==null||((zt=Oe.question_data)===null||zt===void 0||((lt=zt[Sn])===null||lt===void 0))?void 0:lt.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(f.a)(o.a.mark(function $t(){var On,Fn,hn;return o.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return Rn.next=2,Object(R.a)("/api/problems/".concat(Oe==null||((On=Oe.question_data)===null||On===void 0||((Fn=On[Sn])===null||Fn===void 0))?void 0:Fn.identifier,"/start.json"),{method:"get"});case 2:hn=Rn.sent,hn&&(window.open("/myproblems/".concat(hn==null?void 0:hn.identifier,"?type=1")),localStorage.setItem("program_homework",[ue.coursesId,ue.categoryId]));case 4:case"end":return Rn.stop()}},$t)}))},"\u9898\u76EE"+(Sn+1)+"\uFF08".concat(Oe==null||((jn=Oe.question_data)===null||jn===void 0||((ln=jn[Sn])===null||ln===void 0))?void 0:ln.question_score,"\uFF09")),Jn.dataIndex="question_data",Jn.width=250,Jn.render=function($t,On){var Fn,hn,yi,Rn,bn;return n.a.createElement("div",null,($t==null||((Fn=$t[Sn])===null||Fn===void 0)?void 0:Fn.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(f.a)(o.a.mark(function Rt(){var Xe,kt,Pt,an,zn,Ln,oi,ei;return o.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:if($t!=null&&(Xe=$t[Sn])!==null&&Xe!==void 0&&Xe.open_code){mi.next=3;break}return m.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),mi.abrupt("return");case 3:return mi.next=5,Object(R.a)("/api/courses/view_code.json",{method:"get",params:Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,homework_common_id:ue.categoryId,hack_user_code_id:$t==null||((kt=$t[Sn])===null||kt===void 0)?void 0:kt.hack_user_code_id})});case 5:ei=mi.sent,s.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",$t==null||((Pt=$t[Sn])===null||Pt===void 0)?void 0:Pt.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",$t==null||((an=$t[Sn])===null||an===void 0)?void 0:an.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",$t==null||((zn=$t[Sn])===null||zn===void 0)?void 0:zn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",$t==null||((Ln=$t[Sn])===null||Ln===void 0)?void 0:Ln.score)),content:n.a.createElement(Ki.a,{languages:[{language:$t==null||((oi=$t[Sn])===null||oi===void 0)?void 0:oi.language,code:ei==null?void 0:ei.code}],v:$t,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:$t.language,game_id:$t.id,diff_code_count:$t.diff_code_count})});case 7:case"end":return mi.stop()}},Rt)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},($t==null||((hn=$t[Sn])===null||hn===void 0)?void 0:hn.answer_question_time)||"- -"),$t!=null&&(yi=$t[Sn])!==null&&yi!==void 0&&yi.submit_count?n.a.createElement(M.a,{title:"".concat(($t==null||((Rn=$t[Sn])===null||Rn===void 0)?void 0:Rn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),($t==null||((bn=$t[Sn])===null||bn===void 0)?void 0:bn.submit_count)||0):null))},wn.push(Jn)},Ft=0;Ft<(Oe==null||((St=Oe.question_data)===null||St===void 0)?void 0:St.length);Ft++){var St;sn(Ft)}Nn(Object(xe.a)(wn))},[Oe==null?void 0:Oe.question_data]),Object(a.useEffect)(function(){var sn;si!=null&&(sn=si.userInfo)!==null&&sn!==void 0&&sn.course&&(Object(V.s)()&&(ue.course_group=Object(V.s)()?[si.userInfo.course.course_group_id]:[],Ce(Object(p.a)({},ue))),Pn(1))},[si==null?void 0:si.userInfo]);function Pn(sn){return Dt.apply(this,arguments)}function Dt(){return Dt=Object(f.a)(o.a.mark(function sn(Ft){var St,Un,Sn,zt,lt,jn,ln;return o.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return on(!0),$t.next=3,Object(R.a)("/api/courses/rank_list.json",{method:"get",params:Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,rank_type:2,homework_common_id:ue.categoryId})});case 3:if(St=$t.sent,Ve(St),on(!1),Object(V.s)()?(Ft===1&&je([St==null||((Un=St.course_group)===null||Un===void 0||((Sn=Un[0])===null||Sn===void 0))?void 0:Sn.id]),St!=null&&St.my_rank?bt([St==null?void 0:St.my_rank].concat(Object(xe.a)(St==null?void 0:St.rank_list))):bt(Object(xe.a)(St==null?void 0:St.rank_list))):bt(Object(xe.a)(St==null?void 0:St.rank_list)),Ft===1){for(zt={title:n.a.createElement(M.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(St==null?void 0:St.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"},wn.push(zt),lt=function(Fn){var hn,yi,Rn,bn,Rt={};Rt.title=St!=null&&St.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(St==null||((hn=St.question_data)===null||hn===void 0||((yi=hn[Fn])===null||yi===void 0))?void 0:yi.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(f.a)(o.a.mark(function Xe(){var kt,Pt,an;return o.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Ln.next=2,Object(R.a)("/api/problems/".concat(St==null||((kt=St.question_data)===null||kt===void 0||((Pt=kt[Fn])===null||Pt===void 0))?void 0:Pt.identifier,"/start.json"),{method:"get"});case 2:an=Ln.sent,an&&(window.open("/myproblems/".concat(an==null?void 0:an.identifier,"?type=1")),localStorage.setItem("program_homework",[ue.coursesId,ue.categoryId]));case 4:case"end":return Ln.stop()}},Xe)}))},"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(St==null||((Rn=St.question_data)===null||Rn===void 0||((bn=Rn[Fn])===null||bn===void 0))?void 0:bn.question_score,"\uFF09")),Rt.dataIndex="question_data",Rt.width=250,Rt.render=function(Xe,kt){var Pt,an,zn,Ln,oi;return n.a.createElement("div",null,(Xe==null||((Pt=Xe[Fn])===null||Pt===void 0)?void 0:Pt.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(f.a)(o.a.mark(function ei(){var Oi,mi,bi,Ji,Vi,$i,gr,vr;return o.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(Xe!=null&&(Oi=Xe[Fn])!==null&&Oi!==void 0&&Oi.open_code){Me.next=3;break}return m.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),Me.abrupt("return");case 3:return Me.next=5,Object(R.a)("/api/courses/view_code.json",{method:"get",params:Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,homework_common_id:ue.categoryId,hack_user_code_id:Xe==null||((mi=Xe[Fn])===null||mi===void 0)?void 0:mi.hack_user_code_id})});case 5:vr=Me.sent,s.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",Xe==null||((bi=Xe[Fn])===null||bi===void 0)?void 0:bi.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Xe==null||((Ji=Xe[Fn])===null||Ji===void 0)?void 0:Ji.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Xe==null||((Vi=Xe[Fn])===null||Vi===void 0)?void 0:Vi.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Xe==null||(($i=Xe[Fn])===null||$i===void 0)?void 0:$i.score)),content:n.a.createElement(Ki.a,{languages:[{language:Xe==null||((gr=Xe[Fn])===null||gr===void 0)?void 0:gr.language,code:vr==null?void 0:vr.code}],v:Xe,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Xe.language,game_id:Xe.id,diff_code_count:Xe.diff_code_count})});case 7:case"end":return Me.stop()}},ei)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Xe==null||((an=Xe[Fn])===null||an===void 0)?void 0:an.answer_question_time)||"- -"),Xe!=null&&(zn=Xe[Fn])!==null&&zn!==void 0&&zn.submit_count?n.a.createElement(M.a,{title:"".concat((Xe==null||((Ln=Xe[Fn])===null||Ln===void 0)?void 0:Ln.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Xe==null||((oi=Xe[Fn])===null||oi===void 0)?void 0:oi.submit_count)||0):null))},wn.push(Rt)},jn=0;jn<(St==null||((ln=St.question_data)===null||ln===void 0)?void 0:ln.length);jn++)lt(jn);Nn(Object(xe.a)(wn))}case 8:case"end":return $t.stop()}},sn)})),Dt.apply(this,arguments)}return console.log("----",wn),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(Oe==null?void 0:Oe.message)==="\u5C01\u699C\u4E2D"?n.a.createElement(Z.a,{customText:"\u7B54\u9898\u65F6\u95F4\u8FDB\u5165\u5012\u8BA1\u65F6\uFF0C\u6682\u65F6\u5C01\u699C\uFF0C\u8BF7\u52A0\u901F\u7ADE\u6280\u901A\u5173\u7B54\u9898"}):n.a.createElement("div",{style:{background:"#fff",padding:20}},n.a.createElement("div",{style:{display:"inline-flex"}},n.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5\uFF1A"),Object(V.c)()&&n.a.createElement("div",{style:{flex:1}},n.a.createElement(dt.a.Group,{className:ke.a.checkboxgroup,value:Et,onChange:function(Ft){if(ue.type===1)je([]),ue.course_group=[],ue.page=1,Ce(Object(p.a)({},ue)),Pn();else if(ue.type===2){var St;je(["\u5168\u90E8"].concat()),ue.course_group=Oe==null||((St=Oe.course_group)===null||St===void 0)?void 0:St.map(function(Un){return Un.id}),ue.page=1,Ce(Object(p.a)({},ue)),Pn()}else je(Object(xe.a)(Ft.filter(function(Un){return Un!="\u5168\u90E8"}))),ue.course_group=Ft.filter(function(Un){return Un!="\u5168\u90E8"}),ue.page=1,Ce(Object(p.a)({},ue)),Pn()}},n.a.createElement(dt.a,{value:"\u5168\u90E8",onChange:function(Ft){Ft.target.checked?ue.type=2:ue.type=1}},"\u5168\u90E8\u5206\u73ED"),Oe==null||((Tn=Oe.course_group)===null||Tn===void 0)?void 0:Tn.map(function(sn,Ft){return n.a.createElement(dt.a,{onChange:function(Un){ue.type=3},value:sn.id},sn==null?void 0:sn.name)}))),Object(V.s)()&&n.a.createElement(be.a.Group,{onChange:function(Ft){Ft.target.value==="\u5168\u90E8"?(ue.course_group=[],ue.page=1,Ce(Object(p.a)({},ue)),Pn()):(ue.course_group=[Ft.target.value],ue.page=1,Ce(Object(p.a)({},ue)),Pn())},defaultValue:si.userInfo.course.course_group_id},n.a.createElement(be.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Oe==null||((_n=Oe.course_group)===null||_n===void 0)?void 0:_n.map(function(sn,Ft){return n.a.createElement(be.a,{value:sn.id},sn.name)}))),Object(V.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(){s.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(D.a,{onClick:function(){Object(me.v)(Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,rank_type:2,homework_common_id:ue.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(h.a,{spinning:Gt},n.a.createElement(Y.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(Ft,St){return St===0&&Object(V.s)()&&ke.a.tables},dataSource:st,columns:wn})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(v.a,{current:ue.page,pageSize:ue.per_page,total:Oe==null?void 0:Oe.count,hideOnSinglePage:!0,onChange:function(Ft,St){ue.page=Ft,ue.per_page=St,Ce(Object(p.a)({},ue)),Pn()}}))))},Ai=Object(O.a)(function(Bn){var gn=Bn.user;return{user:gn}})(Vr),wi=[{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(gn){var Tn,_n=gn.shixunHomeworks,si=gn.globalSetting,ai=gn.loading,J=gn.dispatch,ue=Object(w.i)(),Ce=Object(w.h)(),Te=Object(w.g)(),qe=Object(a.useState)([]),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)(Ce.query.tabs||"0"),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=Object(a.useState)({}),st=Object(r.a)(it,2),bt=st[0],Lt=st[1],ct=_n.workList,Gt=Object(a.useState)(!1),on=Object(r.a)(Gt,2),Dn=on[0],Kn=on[1],wn;ue.category=Ce.query.category_id,ue.order="work_score",ue.b_order="desc";var Nn=function(zt){ht(zt),zt==="0"&&J({type:"shixunHomeworks/getWorkList",payload:ue})},Pn=function(){s.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 zt=Object(f.a)(o.a.mark(function jn(){var ln,Jn,$t;return o.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Jn=(ln=_n.workList)===null||ln===void 0?void 0:ln.myshixun_identifier,Fn.next=3,Object(vt.X)({id:Jn});case 3:$t=Fn.sent,$t&&(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`),J({type:"shixunHomeworks/getWorkList",payload:bt}));case 5:case"end":return Fn.stop()}},jn)}));function lt(){return zt.apply(this,arguments)}return lt}()})},Dt=function Sn(zt){var lt;zt=(lt=zt)!==null&<!==void 0&<.includes(".json")?zt:"".concat(zt,".json"),s.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var jn=Object(f.a)(o.a.mark(function Jn(){var $t,On;return o.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(Vt.Bb)({url:zt});case 2:if($t=hn.sent,$t){hn.next=5;break}return hn.abrupt("return");case 5:return m.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),hn.next=8,Object(Vt.E)({id:$t.shixun_identifier});case 8:if(On=hn.sent,!(On!=null&&On.game_identifier)){hn.next=12;break}return Object(_.S)("/tasks/".concat(On.game_identifier,"?coursesId=").concat(ue.coursesId)),hn.abrupt("return");case 12:(On==null?void 0:On.status)===2?Sn(On==null?void 0:On.message):(On==null?void 0:On.status)===3&&sn(On==null?void 0:On.message);case 13:case"end":return hn.stop()}},Jn)}));function ln(){return jn.apply(this,arguments)}return ln}()})},sn=function(zt){s.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",zt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Ft=function(){var Sn=Object(f.a)(o.a.mark(function zt(lt){var jn,ln;return o.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return lt=(jn=lt)!==null&&jn!==void 0&&jn.includes(".json")?lt:"".concat(lt,".json"),$t.next=3,Object(Vt.Bb)({url:lt});case 3:if(ln=$t.sent,console.log(ln,"execRes"),!(ln!=null&&ln.game_identifier)){$t.next=8;break}return Object(_.S)("/tasks/".concat(ln.game_identifier,"?coursesId=").concat(ue.coursesId)),$t.abrupt("return");case 8:(ln==null?void 0:ln.status)===-3?Object(_.q)():(ln==null?void 0:ln.status)===2?Dt(ln==null?void 0:ln.message):(ln==null?void 0:ln.status)===3&&sn(ln==null?void 0:ln.message);case 9:case"end":return $t.stop()}},zt)}));return function(lt){return Sn.apply(this,arguments)}}(),St=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(Tt,{setExportParams:Lt}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement(Ye,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(Ai,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(Qt,null)},{name:Object(V.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement(tr,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(ue.coursesId,"/program_homework/").concat(ue.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(Sn){var zt;if(Object(V.s)())return Sn.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(V.s)()||(ct==null||((zt=ct.homework_status)===null||zt===void 0)?void 0:zt[0])!=="\u5DF2\u622A\u6B62")return Sn.name!=="\u8D28\u91CF\u68C0\u6D4B";var lt;return!ct.code_review&&(ct==null||((lt=ct.homework_status)===null||lt===void 0)?void 0:lt[0])!=="\u672A\u53D1\u5E03"?!0:Sn.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(Sn){return ct.open_code_quality_analysis?!0:Sn.name!=="\u8D28\u91CF\u68C0\u6D4B"}),Un=function(){var zt,lt,jn,ln,Jn,$t,On,Fn;return n.a.createElement("aside",{className:ke.a.workListTabButton},Object(V.s)()&&((zt=_n.workList)===null||zt===void 0?void 0:zt.redo_work)&&n.a.createElement(D.a,{onClick:Pn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((lt=_n.workList)===null||lt===void 0?void 0:lt.shixun_status)>1&&((jn=_n.workList)===null||jn===void 0?void 0:jn.time_status)<5&&Object(V.s)()&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var yi,Rn,bn,Rt,Xe,kt,Pt;if(!Object(kn.e)(J,!0))return;(yi=_n.workList)!==null&&yi!==void 0&&(Rn=yi.task_operation)!==null&&Rn!==void 0&&(bn=Rn[1])!==null&&bn!==void 0&&bn.includes("/")?Ft((Rt=_n.workList)===null||Rt===void 0||((Xe=Rt.task_operation)===null||Xe===void 0)?void 0:Xe[1]):Object(_.S)("/tasks/".concat((kt=_n.workList)===null||kt===void 0||((Pt=kt.task_operation)===null||Pt===void 0)?void 0:Pt[1]))}},(ln=_n.workList)===null||ln===void 0||((Jn=ln.task_operation)===null||Jn===void 0)?void 0:Jn[0]),(($t=_n.workList)===null||$t===void 0?void 0:$t.commit_des)&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var yi;Object(_.S)("/classrooms/".concat(ue.coursesId,"/shixun_homework/").concat(ue.categoryId,"/").concat((yi=_n.workList)===null||yi===void 0?void 0:yi.id,"/commitsummary"))}},(On=_n.workList)===null||On===void 0?void 0:On.commit_des),Object(V.c)()&&(ct==null||((Fn=ct.homework_status)===null||Fn===void 0)?void 0:Fn[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){Te.push("/classrooms/".concat(ue.coursesId,"/program_homework/").concat(ue.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(V.c)()&&ct.publish_immediately&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[ue.categoryId],selectArrsAll:[ct],params:ue,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(V.c)()&&ct.end_immediately&&n.a.createElement(D.a,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:ue,type:2,detail:!0,selectArrs:[ue.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},ct.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},ct.category&&n.a.createElement(P.a,{separator:">"},n.a.createElement(P.a.Item,null,n.a.createElement(x.a,{to:"/classrooms/".concat(ct.course_id,"/program_homework")},ct.course_name)),n.a.createElement(P.a.Item,null,n.a.createElement(x.a,{to:"/classrooms/".concat(ct.course_id,"/program_homework/").concat(ct.category.main?"":ct.category.category_id)},ct.category.category_name)),n.a.createElement(P.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[ke.a.title,"mt20"].join(" ")},n.a.createElement(x.a,{to:"/classrooms/".concat(ct.course_id,"/program_homework/").concat(ct.category.main?"":ct.category.category_id)},n.a.createElement(C.a,{className:"font16 c-black"})),n.a.createElement(M.a,{title:ct.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},ct.homework_name)),n.a.createElement(_.m,{temporary:!0,status:ct.homework_status}),Object(V.s)()&&n.a.createElement("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},n.a.createElement(D.a,{onClick:Object(f.a)(o.a.mark(function Sn(){var zt,lt;return o.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(R.a)("/api/problems/".concat((zt=_n.workList)===null||zt===void 0?void 0:zt.start_identifier,"/start.json"),{method:"get"});case 2:lt=ln.sent,lt&&(window.open("/myproblems/".concat(lt==null?void 0:lt.identifier,"?type=1")),localStorage.setItem("program_homework",[ue.coursesId,ue.categoryId]));case 4:case"end":return ln.stop()}},Sn)})),type:"primary"},(Tn=ct.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(ke.a.workListTabWrap)},n.a.createElement(K.a,{type:"card",defaultActiveKey:je,activeKey:je,tabBarExtraContent:Un(),onChange:Nn},St.map(function(Sn,zt){return n.a.createElement(K.a.TabPane,{tab:Sn.name,key:Sn.id,forceRender:Sn.forceRender},Sn.compontent)})))),n.a.createElement(L,null),n.a.createElement(W.a,{courseEndTime:ct==null?void 0:ct.course_end_date}),n.a.createElement(ne.a,{courseEndTime:ct==null?void 0:ct.course_end_date}),n.a.createElement(s.a,{visible:Dn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){Kn(!1)}},n.a.createElement("p",null,"\u4E00\u3001\u7B49\u7EA7\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"1. \u7F3A\u9677\u7B49\u7EA7"),n.a.createElement("p",{style:{marginLeft:"10px"}},n.a.createElement(Y.a,{dataSource:wi,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")))},Fi=Qe.default=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading,_n=Bn.globalSetting;return{shixunHomeworks:gn,globalSetting:_n,loading:Tn.effects}})(ir)},OLES:function(tn,Qe,I){"use strict";var te=I("U8pU"),Y=I("VTBJ"),N=I("Ff2n"),K=I("q1tI"),A=I("uciX"),M=I("7ixt"),H=function(f){var d=f.overlay,s=f.prefixCls,r=f.id,u=f.overlayInnerStyle;return K.createElement("div",{className:"".concat(s,"-inner"),id:r,role:"tooltip",style:u},typeof d=="function"?d():d)},P=H,k=function(f,d){var s=f.overlayClassName,r=f.trigger,u=r===void 0?["hover"]:r,o=f.mouseEnterDelay,a=o===void 0?0:o,n=f.mouseLeaveDelay,R=n===void 0?.1:n,w=f.overlayStyle,x=f.prefixCls,O=x===void 0?"rc-tooltip":x,C=f.children,_=f.onVisibleChange,y=f.afterVisibleChange,h=f.transitionName,c=f.animation,v=f.placement,p=v===void 0?"right":v,E=f.align,U=E===void 0?{}:E,F=f.destroyTooltipOnHide,z=F===void 0?!1:F,G=f.defaultVisible,B=f.getTooltipContainer,T=f.overlayInnerStyle,V=Object(N.a)(f,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Z=Object(K.useRef)(null);Object(K.useImperativeHandle)(d,function(){return Z.current});var oe=Object(Y.a)({},V);"visible"in f&&(oe.popupVisible=f.visible);var pe=function(){var Ke=f.arrowContent,be=Ke===void 0?null:Ke,de=f.overlay,nt=f.id;return[K.createElement("div",{className:"".concat(O,"-arrow"),key:"arrow"},be),K.createElement(P,{key:"content",prefixCls:O,id:nt,overlay:de,overlayInnerStyle:T})]},Ye=!1,xe=!1;if(typeof z=="boolean")Ye=z;else if(z&&Object(te.a)(z)==="object"){var Ie=z.keepParent;Ye=Ie===!0,xe=Ie===!1}return K.createElement(A.a,Object.assign({popupClassName:s,prefixCls:O,popup:pe,action:u,builtinPlacements:M.a,popupPlacement:p,ref:Z,popupAlign:U,getPopupContainer:B,onPopupVisibleChange:_,afterPopupVisibleChange:y,popupTransitionName:h,popupAnimation:c,defaultPopupVisible:G,destroyPopupOnHide:Ye,autoDestroy:xe,mouseLeaveDelay:R,popupStyle:w,mouseEnterDelay:a},oe),C)},D=Object(K.forwardRef)(k),b=Qe.a=D},OZM5:function(tn,Qe,I){"use strict";I.d(Qe,"b",function(){return D}),I.d(Qe,"a",function(){return b}),I.d(Qe,"k",function(){return m}),I.d(Qe,"h",function(){return f}),I.d(Qe,"i",function(){return d}),I.d(Qe,"g",function(){return s}),I.d(Qe,"c",function(){return r}),I.d(Qe,"d",function(){return u}),I.d(Qe,"j",function(){return n}),I.d(Qe,"e",function(){return R}),I.d(Qe,"f",function(){return w});var te=I("KQm4"),Y=I("U8pU"),N=I("Ff2n"),K=I("q1tI"),A=I.n(K),M=I("Kwbf"),H=I("WaYH"),P=.25,k=2;function D(x,O){var C=x.slice(),_=C.indexOf(O);return _>=0&&C.splice(_,1),C}function b(x,O){var C=x.slice();return C.indexOf(O)===-1&&C.push(O),C}function m(x){return x.split("-")}function f(x,O){return"".concat(x,"-").concat(O)}function d(x){return x&&x.type&&x.type.isTreeNode}function s(x,O){var C=[x],_=O[x];function y(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(c){var v=c.key,p=c.children;C.push(v),y(p)})}return y(_.children),C}function r(x,O){var C=x.clientY,_=O.selectHandle.getBoundingClientRect(),y=_.top,h=_.bottom,c=_.height,v=Math.max(c*P,k);return C<=y+v?-1:C>=h-v?1:0}function u(x,O){if(!x)return;var C=O.multiple;return C?x.slice():x.length?[x[0]]:x}var o=function(O){return O};function a(x,O){if(!x)return[];var C=O||{},_=C.processProps,y=_===void 0?o:_,h=Array.isArray(x)?x:[x];return h.map(function(c){var v=c.children,p=Object(N.a)(c,["children"]),E=a(v,O);return A.a.createElement(H.a,Object.assign({},y(p)),E)})}function n(x){if(!x)return null;var O;if(Array.isArray(x))O={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(Y.a)(x)==="object")O={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function R(x,O){var C=new Set;function _(y){if(C.has(y))return;var h=O[y];if(!h)return;C.add(y);var c=h.parent,v=h.node;if(v.disabled)return;c&&_(c.key)}return(x||[]).forEach(function(y){_(y)}),Object(te.a)(C)}function w(x){var O={};return Object.keys(x).forEach(function(C){(C.startsWith("data-")||C.startsWith("aria-"))&&(O[C]=x[C])}),O}},Ot1p:function(tn,Qe,I){"use strict";var te=I("2qtc"),Y=I("kLXV"),N=I("rAM+"),K=I("miYZ"),A=I("tsqr"),M=I("9og8"),H=I("tJVT"),P=I("jrin"),k=I("WmNS"),D=I.n(k),b=I("q1tI"),m=I.n(b),f=I("VrN/"),d=I.n(f),s=I("bdgK"),r=I("p77/"),u=I("Bd2K"),o=I("ELLl"),a=I("19Vz"),n=I("lZu9"),R=I("+NIl"),w=I("kSUc"),x=I("9Bee"),O=function(me){var Be=me.value,Tt=Be===void 0?"":Be,Jt=me.className,En=me.showTextOnly,mt=me.showLines,Qt=me.style,gt=Qt===void 0?{}:Qt,yt=Object(b.useMemo)(function(){return""},[Tt]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:yt}}))},C=I("0Owb"),_=I("dejd"),y=I("C+DQ"),h=I("1vsH"),c=I("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(me){var Be=me.onActionCallback,Tt=me.title,Jt=me.icon,En=me.actionName,mt=me.className,Qt=mt===void 0?"":mt,gt=me.children;function yt(){Be(En)}return m.a.createElement("a",{title:Tt,className:Qt,onClick:yt},m.a.createElement("i",{className:"md-iconfont ".concat(Jt)}),gt)}var E=function(me){var Be=me.watch,Tt=me.showNullButton,Jt=me.onActionCallback,En=me.fullScreen,mt=me.insertTemp,Qt=me.hidetoolBar,gt=me.uuid,yt=me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(gt,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var rt=[].concat(v,[{title:"".concat(Be?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Be?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!Qt&&rt.map(function(ce,Re){return m.a.createElement("li",{key:Re},ce.actionName?m.a.createElement(p,Object(C.a)({},ce,{onActionCallback:Jt})):m.a.createElement("span",{className:"v-line"}))}),Tt?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:Jt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,mt&&m.a.createElement("li",null,m.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(mt),onActionCallback:Jt},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(En?"icon-shrink":"icon-enlarge"),title:En?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Jt})))},U=I("M8RZ"),F=I("+L6B"),z=I("2/Rp"),G=I("y8nQ"),B=I("Vl3Y"),T=I("5NDa"),V=I("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},oe=function(me){var Be=me.callback,Tt=me.onCancel;function Jt(En){Be(En)}return m.a.createElement(B.a,Object(C.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Jt}),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(V.a,null)),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(V.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(z.a,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))},pe=I("7ahc"),Ye=I("HmJG"),xe=I("BjJ7"),Ie=B.a.useForm,Je={width:280,marginRight:10},Ke={labelCol:{span:5},wrapperCol:{span:19}},be=function(me){var Be=me.callback,Tt=me.onCancel,Jt=Ie(),En=Object(H.a)(Jt,1),mt=En[0];function Qt(rt){Be(rt)}function gt(rt,ce){if(rt.status===-1){A.b.error(rt.message);return}mt.setFieldsValue({src:"/api/attachments/".concat(rt.id),type:ce.type})}function yt(rt){var ce=rt.target.files[0];nt(ce,gt)}return m.a.createElement(B.a,Object(C.a)({form:mt},Ke,{className:"upload-image-panel",onFinish:Qt}),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(V.a,{style:Je})),m.a.createElement(de,{onFileChange:yt}))),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(V.a,{style:{width:264}})),m.a.createElement(B.a.Item,{style:{textAlign:"right"}},m.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(z.a,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))};function de(me){var Be=me.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Be}))}function nt(me,Be){if(!me)throw new String("\u6CA1\u6709\u6587\u4EF6");var Tt=new FormData;Tt.append("editormd-image-file",me),Tt.append("file_param_name","editormd-image-file"),Tt.append("byxhr","true");var Jt=new window.XMLHttpRequest;Jt.withCredentials=!0,Jt.addEventListener("load",function(En){Be(JSON.parse(En.target.responseText),me)},!1),Jt.addEventListener("error",function(En){console.error(En)},!1),Jt.open("POST","".concat(xe.a,"/api/attachments.json")),Jt.send(Tt)}var Kt=I("giR+"),jt=I("fyUT"),wt=I("7Kak"),ze=I("9yH6"),ft=ze.a.Group,dt={margin:"0 8px"},Nt=function(me){var Be=me.callback,Tt=me.onCancel;function Jt(En){Be(En)}return m.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Jt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:dt},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:dt},"\u884C\u6570"),m.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(jt.a,null)),m.a.createElement("span",{style:dt},"\u5217\u6570"),m.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(jt.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:dt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(B.a.Item,{name:"align"},m.a.createElement(ft,null,m.a.createElement(ze.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(ze.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(ze.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(ze.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(z.a,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))},Ze=I("ErOA"),Bt=I("7Cbv"),Ut="link",Mt="upload-image",An="code-block",mn="add-table",pn="------------",tt={default:pn,left:":".concat(pn),center:":".concat(pn,":"),right:"".concat(pn,":")},fn=I("9VGf"),In,He;function Ue(){}var pt=0,Ct=1e4,Ge="\u2581",vt=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ae(me){return/^\d+$/.test(me)?"".concat(me,"px"):me}var ge=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ee=ge?"Cmd":"Ctrl",ae=["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"],re=(In={},Object(P.a)(In,Ee+"-B","bold"),Object(P.a)(In,Ee+"-I","italic"),In),he=(He={},Object(P.a)(He,Ut,"\u6DFB\u52A0\u94FE\u63A5"),Object(P.a)(He,An,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(P.a)(He,Mt,"\u6DFB\u52A0\u6587\u4EF6"),Object(P.a)(He,mn,"\u6DFB\u52A0\u8868\u683C"),He),ve=Qe.a=function(me){var Be=me.defaultValue,Tt=Be===void 0?"":Be,Jt=me.onChange,En=me.width,mt=En===void 0?"100%":En,Qt=me.height,gt=Qt===void 0?400:Qt,yt=me.miniToolbar,rt=yt===void 0?!1:yt,ce=me.isFocus,Re=ce===void 0?!1:ce,At=me.watch,ot=me.insertTemp,Yt=me.mode,rn=Yt===void 0?"markdown":Yt,_e=me.id,Ne=_e===void 0?"markdown-editor-id":_e,xt=me.showResizeBar,Xt=xt===void 0?!1:xt,vn=me.noStorage,Mn=vn===void 0?!1:vn,ci=me.showNullButton,$n=ci===void 0?!1:ci,Cn=me.hidetoolBar,Ti=Cn===void 0?!1:Cn,Wi=me.fullScreen,hi=Wi===void 0?!1:Wi,fi=me.onBlur,ji=me.onCMBeforeChange,er=me.onFullScreen,yr=me.className,cn=yr===void 0?"":yr,ri=me.disablePaste,pr=ri===void 0?!1:ri,Cr=me.placeholder,tr=Cr===void 0?"":Cr,nr=me.values,X=nr===void 0?"":nr,S=Object(b.useState)(null),L=Object(H.a)(S,2),W=L[0],ne=L[1],Q=Object(b.useState)(Tt),ke=Object(H.a)(Q,2),Vt=ke[0],kn=ke[1],Qn=Object(b.useState)(At),nn=Object(H.a)(Qn,2),ti=nn[0],qn=nn[1],Li=Object(b.useState)(hi),lr=Object(H.a)(Li,2),ar=lr[0],Ki=lr[1],Pr=Object(b.useState)(""),Vr=Object(H.a)(Pr,2),Ai=Vr[0],wi=Vr[1],ir=Object(b.useState)(0),Fi=Object(H.a)(ir,2),Bn=Fi[0],gn=Fi[1],Tn=Object(b.useState)(gt),_n=Object(H.a)(Tn,2),si=_n[0],ai=_n[1],J=Object(b.useState)(!1),ue=Object(H.a)(J,2),Ce=ue[0],Te=ue[1],qe=Object(b.useRef)(Object(Bt.a)()),Oe=Object(b.useRef)(!1),Ve=Object(b.useRef)(),et=Object(b.useRef)(),Ot=Object(b.useRef)(),Et=Object(b.useRef)(),je=Object(b.useRef)(),ht=function(){var Dt=Object(M.a)(D.a.mark(function sn(){var Ft,St;return D.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(Ze.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:qe.current}});case 2:St=Sn.sent,St!=null&&(Ft=St.attachments)!==null&&Ft!==void 0&&Ft.length&&(console.log("cm:",W,et),St.attachments.map(function(zt){zt.content_type.indexOf("image")>-1?W.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):zt.content_type.indexOf("video")>-1?W.replaceSelection('')):zt.content_type.indexOf("pdf")>-1?W.replaceSelection('
    ').concat(zt.name,"")):W.replaceSelection("[".concat(zt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}));case 4:case"end":return Sn.stop()}},sn)}));return function(){return Dt.apply(this,arguments)}}();Object(b.useEffect)(function(){kn(X),W==null||W.setValue(X)},[X]),Object(b.useEffect)(function(){er==null||er(ar)},[ar]),Object(b.useEffect)(function(){if(et.current){var Dt=d.a.fromTextArea(et.current,{mode:rn,lineNumbers:!rt,lineWrapping:!0,value:Tt,autoCloseTags:!0,autoCloseBrackets:!0});Re&&Dt.focus();function sn(Ft,St){if(pr){St.preventDefault();return}var Un=St.clipboardData;if(Un){var Sn=Un.types.toString(),zt=Un.items;if(Sn==="Files"||Un.types.indexOf("Files")>-1){if(St.preventDefault(),rn=="stex")return;try{var lt,jn=zt[1];((lt=zt[0])===null||lt===void 0?void 0:lt.kind)==="file"&&(jn=zt[0]);var ln=jn.getAsFile(),Jn=ln.name.split(".").pop();nt(ln,function($t){if($t.id){var On,Fn,hn;(ln==null||((On=ln.type)===null||On===void 0)?void 0:On.indexOf("image"))>-1?Dt.replaceSelection("![,](/api/attachments/".concat($t.id,"?type=").concat($t.content_type,")")):(ln==null||((Fn=ln.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Dt.replaceSelection('')):(ln==null||((hn=ln.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?Dt.replaceSelection('').concat(ln.name,"")):ae.includes(Jn)?Dt.replaceSelection('').concat(ln.name,"")):Dt.replaceSelection("[".concat(ln.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,"?type=").concat($t.content_type,")"))}else($t==null?void 0:$t.status)===401&&(document.location.href="/user/login")})}catch($t){A.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Dt.on("paste",sn),Dt.on("dragleave",function(Ft,St){Ot.current.classList.remove("mouse-hover-md")}),Dt.on("dragover",function(Ft,St){Ot.current.classList.add("mouse-hover-md")}),Dt.on("drop",function(Ft,St){Ot.current.classList.add("mouse-hover-md");var Un;if(Un=St.dataTransfer.files,Un.length>0){St.preventDefault(),St.stopPropagation();for(var Sn=function(jn){var ln=Un[jn],Jn=ln.name.split(".").pop();nt(ln,function($t){if($t.id){var On,Fn,hn;(ln==null||((On=ln.type)===null||On===void 0)?void 0:On.indexOf("image"))>-1?Dt.replaceSelection("![,](/api/attachments/".concat($t.id,"?type=").concat($t.content_type,")")):(ln==null||((Fn=ln.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Dt.replaceSelection('')):(ln==null||((hn=ln.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?Dt.replaceSelection('').concat(ln.name,"")):ae.includes(Jn)?Dt.replaceSelection('').concat(ln.name,"")):Dt.replaceSelection("[".concat(ln.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,"?type=").concat($t.content_type,")"))}else($t==null?void 0:$t.status)===401&&(document.location.href="/user/login")})},zt=0;zt0||zt.target.offsetWidth>0)&&(it(),W.setSize("100%","100%"),W.refresh())}}catch(lt){Un.e(lt)}finally{Un.f()}});return Ft.observe(et.current.parentElement),Ft}if(W){var sn=Dt();return function(){sn.unobserve(et.current.parentElement)}}},[W,it]),Object(b.useEffect)(function(){if(W){for(var Dt=[],sn=function(){var zt=St[Ft];Un=Object(H.a)(zt,2);var lt=Un[0],jn=Un[1],ln=Object(P.a)({},lt,function(){st(jn)});Dt.push(ln),W.addKeyMap(ln)},Ft=0,St=Object.entries(re);Ft0){var Dt=new Date().getTime(),sn=window.sessionStorage.getItem(Ne);Dt>=Bn+Ct&&(!sn||sn!==Vt)&&(window.sessionStorage.setItem(Ne,Vt),Te(!0))}},Ct),Object(b.useEffect)(function(){qn(At)},[W,At]),Object(b.useEffect)(function(){W&&(Re&&W.focus())},[W,Re]),Object(b.useEffect)(function(){if(ti&&W){var Dt=W.getScrollerElement();function sn(Ft){var St=Ft.target;if(je.current){var Un=St.scrollTop/St.scrollHeight;je.current.scrollTop=je.current.scrollHeight*Un}}return Dt.addEventListener("scroll",sn),function(){Dt.removeEventListener("scroll",sn)}}},[W,ti]),Object(b.useEffect)(function(){if(W&&ji){function Dt(sn,Ft){ji(sn,Ft)}return W.on("beforeChange",Dt),function(){W.off("beforeChange",Dt)}}},[W,ji]),Object(b.useEffect)(function(){if(W&&fi){function Dt(){fi(W.getValue())}return W.on("blur",Dt),function(){W.off("blur",Dt)}}},[W,fi]),Object(b.useEffect)(function(){if(W){function Dt(sn){var Ft=sn.getValue();kn(Ft),gn(new Date().getTime()),sn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Jt&&Jt(Ft)}return W.on("change",Dt),function(){W.off("change",Dt)}}},[W,Jt]),Object(b.useEffect)(function(){W&&(Tt==null?(W.setValue(""),kn("")):Tt!==W.getValue()&&(W.setValue(Tt),kn(Tt),W.setCursor(W.lineCount(),0)))},[W,Tt]);var st=Object(b.useCallback)(function(Dt){var sn=W.getCursor(),Ft=W.getSelection(),St=Ft.split(` `);switch(Dt){case"bold":return W.replaceSelection("**"+Ft+"**"),Ft===""&&W.setCursor(sn.line,sn.ch+2),W.focus();case"italic":return W.replaceSelection("*"+Ft+"*"),Ft===""&&W.setCursor(sn.line,sn.ch+1),W.focus();case"code":return W.replaceSelection("`"+Ft+"`"),Ft===""&&W.setCursor(sn.line,sn.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+Ft+"$$`"),Ft===""&&W.setCursor(sn.line,sn.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+Ft+"\n```"),W.setCursor(sn.line+1,Ft.length+1),W.focus();case"line-break":return W.replaceSelection(`
    `),W.focus();case"list-ul":return Ft===""?W.replaceSelection("- "+Ft):W.replaceSelection(St.map(function(Un){return Un===""?"":"- ".concat(Un)}).join(` `)),W.focus();case"list-ol":return Ft===""?W.replaceSelection("1. "+Ft):W.replaceSelection(St.map(function(Un,Sn){return Un===""?"":"".concat(Sn+1,". ").concat(Un)}).join(` `)),W.focus();case"add-null-ch":return Ft===""&&W.setCursor(sn.line,sn.ch+1),W.replaceSelection(Ge),W.focus();case"inster-template-1":return Ft===""&&W.setCursor(sn.line,sn.ch),W.replaceSelection(vt),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return qn(!ti),W.focus();case"trigger-full-screen":return Ki(!ar),W.focus();case Ut:wi(Ut);return;case An:wi(An);return;case Mt:wi(Mt);return;case mn:wi(mn);return;default:throw new Error}},[W,ti,ar]),bt=Object(b.useCallback)(function(Dt){wi("");switch(Ai){case Ut:var sn=Dt.title,Ft=Dt.link;return W.replaceSelection("[".concat(sn,"](").concat(Ft,")")),W.focus();case An:var St=Dt.language,Un=Dt.content;return W.replaceSelection(["```"+St,Un,"```"].join(` `)),W.focus();case Mt:var Sn=Dt.src,zt=Dt.alt;return zt?W.replaceSelection("![ ".concat(zt," ]( ").concat(Sn,' "').concat(zt,'" )')):W.replaceSelection("![,](".concat(Sn,")")),W.focus();case mn:for(var lt=Dt.row,jn=Dt.col,ln=Dt.align,Jn=` `,$t=0;$t300&&(lt=300);var jn=gt+lt+"px";ai(jn)}}return Dt.addEventListener("mousedown",St),document.addEventListener("mousemove",Sn),document.addEventListener("mouseup",Un),function(){Dt.removeEventListener("mousedown",St),document.removeEventListener("mousemove",Sn),document.removeEventListener("mouseup",Un)}}},[W,Et]),Object(b.useEffect)(function(){ai(gt)},[gt]);var Gt=Ae(mt),on=Ae(si),Dn={width:Gt,height:on},Kn=Object(b.useMemo)(function(){if(Bn){var Dt=new Date(Bn),sn=Dt.getHours(),Ft=Dt.getMinutes(),St=Dt.getSeconds();return sn=sn<10?"0"+sn:sn,Ft=Ft<10?"0"+Ft:Ft,St=St<10?"0"+St:St,"".concat(sn,":").concat(Ft,":").concat(St)}return 0},[Bn]);function wn(){window.sessionStorage.removeItem(Ne),Te(!1),gn(0)}function Nn(){Te(!1),gn(0),W.setValue(window.sessionStorage.getItem(Ne))}function Pn(Dt,sn){var Ft=W.getValue();Ft=Ft.replace(Dt,sn),kn(Ft),W==null||W.setValue(Ft)}return m.a.createElement(b.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ot},m.a.createElement("div",{className:"markdown-editor-container ".concat(cn," ").concat(ti?"on-preview":""," ").concat(rt?"mini":""," ").concat(ar?"full-screen":""),style:Dn},m.a.createElement(E,{insertTemp:ot,watch:ti,fullScreen:ar,showNullButton:$n,onActionCallback:st,hidetoolBar:Ti,uuid:qe.current,setOpenPhones:function(){Oe.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:et,placeholder:tr})),ti?m.a.createElement("div",{ref:je,className:"preview-container"},rn==="stex"&&m.a.createElement(O,{value:Vt}),rn!=="stex"&&m.a.createElement(x.a,{edit:!0,value:Vt,replaces:Pn})):null))),Xt?m.a.createElement("a",{ref:Et,className:"editor-resize"}):null,m.a.createElement(U.a,null,he[Ai]?m.a.createElement(Y.a,{centered:!0,title:he[Ai],visible:!0,onCancel:ct,footer:null,className:"markdown-popup-form"},Lt):null))}},RotF:function(tn,Qe,I){tn.exports=I("LSTS")},"SA+Z":function(tn,Qe,I){var te=I("wTVA"),Y=I("EbDI"),N=I("ZhPi"),K=I("wkBT");function A(M){return te(M)||Y(M)||N(M)||K()}tn.exports=A,tn.exports.__esModule=!0,tn.exports.default=tn.exports},SJMd:function(tn,Qe){/** * @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 I,te,Y,N=!1,K,A;window.PR_SHOULD_USE_CONTINUATION=!0;var M,H;(function(){var P=window,k=["break,continue,do,else,for,if,return,while"],D=[k,"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=[D,"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"],f=[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"],s="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",r=[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",o=[k,"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"],a=[k,"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=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,d,f,r,u,o,a,n],w=/^(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",O="kwd",C="com",_="typ",y="lit",h="pun",c="pln",v="tag",p="dec",E="src",U="atn",F="atv",z="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(ft){for(var dt=0,Nt=!1,Ze=!1,Bt=0,Ut=ft.length;Bt122||(ae<65||Ee>90||pt.push([Math.max(65,Ee)|32,Math.min(ae,90)|32]),ae<97||Ee>122||pt.push([Math.max(97,Ee)&~32,Math.min(ae,122)&~32]))}}pt.sort(function(me,Be){return me[0]-Be[0]||Be[1]-me[1]});for(var re=[],he=[],vt=0;vtve[0]&&(ve[1]+1>ve[0]&&Ge.push("-"),Ge.push(pn(ve[1])))}return Ge.push("]"),Ge.join("")}function fn(He){for(var Ue=He.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")),pt=Ue.length,Ct=[],Ge=0,vt=0;Ge=2&&Ee==="["?Ue[Ge]=tt(Ae):Ee!=="\\"&&(Ue[Ge]=Ae.replace(/[a-zA-Z]/g,function(he){var ve=he.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Ue.join("")}for(var In=[],Bt=0,Ut=ft.length;Bt=0;)Nt[In.charAt(He)]=fn;var Ue=fn[1],pt=""+Ue;mn.hasOwnProperty(pt)||(An.push(Ue),mn[pt]=null)}An.push(/[\0-\uffff]/),Ze=B(An)})();var Bt=dt.length,Ut=function(Mt){for(var An=Mt.sourceCode,mn=Mt.basePos,pn=Mt.sourceNode,tt=[mn,c],fn=0,In=An.match(Ze)||[],He={},Ue=0,pt=In.length;Ue=5&&Ge.substring(0,5)==="lang-",Ae&&!(vt&&typeof vt[1]=="string")&&(Ae=!1,Ge=E),Ae||(He[Ct]=Ge)}var ae=fn;if(fn+=Ct.length,!Ae)tt.push(mn+ae,Ge);else{var re=vt[1],he=Ct.indexOf(re),ve=he+re.length;vt[2]&&(ve=Ct.length-vt[2].length,he=ve-re.length);var me=Ge.substring(5);V(pn,mn+ae,Ct.substring(0,he),Ut,tt),V(pn,mn+ae+he,re,de(me,re),tt),V(pn,mn+ae+ve,Ct.substring(ve),Ut,tt)}}Mt.decorations=tt};return Ut}function Ye(ft){var dt=[],Nt=[];ft.tripleQuotedStrings?dt.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ft.multiLineStrings?dt.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):dt.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ft.verbatimStrings&&Nt.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ze=ft.hashComments;Ze&&(ft.cStyleComments?(Ze>1?dt.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):dt.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Nt.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):dt.push([C,/^#[^\r\n]*/,null,"#"])),ft.cStyleComments&&(Nt.push([C,/^\/\/[^\r\n]*/,null]),Nt.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Bt=ft.regexLiterals;if(Bt){var Ut=Bt>1?"":` \r`,Mt=Ut?".":"[\\S\\s]",An="/(?=[^/*"+Ut+"])(?:[^/\\x5B\\x5C"+Ut+"]|\\x5C"+Mt+"|\\x5B(?:[^\\x5C\\x5D"+Ut+"]|\\x5C"+Mt+")*(?:\\x5D|$))+/";Nt.push(["lang-regex",RegExp("^"+G+"("+An+")")])}var mn=ft.types;mn&&Nt.push([_,mn]);var pn=(""+ft.keywords).replace(/^ | $/g,"");pn.length&&Nt.push([O,new RegExp("^(?:"+pn.replace(/[\s,]+/g,"|")+")\\b"),null]),dt.push([c,/^\s+/,null,` \r \xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return ft.regexLiterals&&(tt+="(?!s*/)"),Nt.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],[h,new RegExp(tt),null]),pe(dt,Nt)}var xe=Ye({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ie(ft,dt,Nt){for(var Ze=/(?:^|\s)nocode(?:\s|$)/,Bt=/\r\n?|\n/,Ut=ft.ownerDocument,Mt=Ut.createElement("li");ft.firstChild;)Mt.appendChild(ft.firstChild);var An=[Mt];function mn(Ue){var pt=Ue.nodeType;if(pt==1&&!Ze.test(Ue.className))if(Ue.nodeName==="br")pn(Ue),Ue.parentNode&&Ue.parentNode.removeChild(Ue);else for(var Ct=Ue.firstChild;Ct;Ct=Ct.nextSibling)mn(Ct);else if((pt==3||pt==4)&&Nt){var Ge=Ue.nodeValue,vt=Ge.match(Bt);if(vt){var Ae=Ge.substring(0,vt.index);Ue.nodeValue=Ae;var ge=Ge.substring(vt.index+vt[0].length);if(ge){var Ee=Ue.parentNode;Ee.insertBefore(Ut.createTextNode(ge),Ue.nextSibling)}pn(Ue),Ae||Ue.parentNode.removeChild(Ue)}}}function pn(Ue){for(;!Ue.nextSibling;)if(Ue=Ue.parentNode,!Ue)return;function pt(vt,Ae){var ge=Ae?vt.cloneNode(!1):vt,Ee=vt.parentNode;if(Ee){var ae=pt(Ee,1),re=vt.nextSibling;ae.appendChild(ge);for(var he=re;he;he=re)re=he.nextSibling,ae.appendChild(he)}return ge}for(var Ct=pt(Ue.nextSibling,0),Ge;(Ge=Ct.parentNode)&&Ge.nodeType===1;)Ct=Ge;An.push(Ct)}for(var tt=0;tt=Ee&&(mn+=2),Ut>=ae&&(fn+=2)}}finally{Ge&&(Ge.style.display=vt)}}var Ke={};function be(ft,dt){for(var Nt=dt.length;--Nt>=0;){var Ze=dt[Nt];Ke.hasOwnProperty(Ze)?P.console&&console.warn("cannot override language handler %s",Ze):Ke[Ze]=ft}}function de(ft,dt){return ft&&Ke.hasOwnProperty(ft)||(ft=/^\s*]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),be(pe([[c,/^[\s]+/,null,` \r `],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["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"]),be(pe([],[[F,/^[\s\S]+/]]),["uq.val"]),be(Ye({keywords:m,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),be(Ye({keywords:"null,true,false"}),["json"]),be(Ye({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),be(Ye({keywords:f,cStyleComments:!0}),["java"]),be(Ye({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(Ye({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(Ye({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(Ye({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(Ye({keywords:r,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(Ye({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(pe([],[[x,/^[\s\S]+/]]),["regex"]);function nt(ft){var dt=ft.langExtension;try{var Nt=T(ft.sourceNode,ft.pre),Ze=Nt.sourceCode;ft.sourceCode=Ze,ft.spans=Nt.spans,ft.basePos=0,de(dt,Ze)(ft),Je(ft)}catch(Bt){P.console&&console.log(Bt&&Bt.stack||Bt)}}function Kt(ft,dt,Nt){var Ze=Nt||!1,Bt=dt||null,Ut=document.createElement("div");Ut.innerHTML="
    "+ft+"
    ",Ut=Ut.firstChild,Ze&&Ie(Ut,Ze,!0);var Mt={langExtension:Bt,numberLines:Ze,sourceNode:Ut,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return nt(Mt),Ut.innerHTML}function jt(ft,dt){var Nt=dt||document.body,Ze=Nt.ownerDocument||document;function Bt(ge){return Nt.getElementsByTagName(ge)}for(var Ut=[Bt("pre"),Bt("code"),Bt("xmp")],Mt=[],An=0;An=0;d--)if(this.__items[d].match(f))return!0;return!1},D.prototype.set_indent=function(f,d){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(f){this.__items.push(f);var d=f.lastIndexOf(` `);d!==-1?this.__character_count=f.length-d:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function b(f,d){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),d=d||"",f.indent_level>0&&(d=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}b.prototype.get_indent_size=function(f,d){var s=this.__base_string_length;return d=d||0,f<0&&(s=0),s+=f*this.__indent_size,s+=d,s},b.prototype.get_indent_string=function(f,d){var s=this.__base_string;return d=d||0,f<0&&(f=0,s=""),d+=f*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},b.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var f=this.__cache.length,d=0,s="";this.__indent_size&&f>=this.__indent_size&&(d=Math.floor(f/this.__indent_size),f-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),f&&(s+=new Array(f+1).join(" ")),this.__cache.push(s)};function m(f,d){this.__indent_cache=new b(f,d),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(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(f,d){return this.__indent_cache.get_indent_string(f,d)},m.prototype.get_indent_size=function(f,d){return this.__indent_cache.get_indent_size(f,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(f){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 s=this.__lines.join(` `);return f!==` `&&(s=s.replace(/[\n]/g,f)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(f,d){return f=f||0,d=d||0,this.next_line.set_indent(f,d),this.__lines.length>1?(this.current_line.set_indent(f,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(f){for(var d=0;d1&&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(f,d){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(f)!==0&&r.item(-1)!==d){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},k.exports.Output=m},,,,function(k){function D(f,d){this.raw_options=b(f,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"])}D.prototype._get_array=function(f,d){var s=this.raw_options[f],r=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},D.prototype._get_boolean=function(f,d){var s=this.raw_options[f],r=s===void 0?!!d:!!s;return r},D.prototype._get_characters=function(f,d){var s=this.raw_options[f],r=d||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),r},D.prototype._get_number=function(f,d){var s=this.raw_options[f];d=parseInt(d,10),isNaN(d)&&(d=0);var r=parseInt(s,10);return isNaN(r)&&(r=d),r},D.prototype._get_selection=function(f,d,s){var r=this._get_selection_list(f,d,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values: `+d+` You passed in: '`+this.raw_options[f]+"'");return r[0]},D.prototype._get_selection_list=function(f,d,s){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[d[0]],!this._is_valid_selection(s,d))throw new Error("Invalid Default Value!");var r=this._get_array(f,s);if(!this._is_valid_selection(r,d))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values: `+d+` You passed in: '`+this.raw_options[f]+"'");return r},D.prototype._is_valid_selection=function(f,d){return f.length&&d.length&&!f.some(function(s){return d.indexOf(s)===-1})};function b(f,d){var s={};f=m(f);var r;for(r in f)r!==d&&(s[r]=f[r]);if(d&&f[d])for(r in f[d])s[r]=f[d][r];return s}function m(f){var d={},s;for(s in f){var r=s.replace(/-/g,"_");d[r]=f[s]}return d}k.exports.Options=D,k.exports.normalizeOpts=m,k.exports.mergeOpts=b},,function(k){var D=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=0&&m=0&&f=m.length&&this.__input.substring(f-m.length,f).toLowerCase()===m},k.exports.InputScanner=b},,,,,function(k){function D(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")}D.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(b);f;)m[f[1]]=f[2],f=this.__directive_pattern.exec(b);return m},D.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=D},,function(k,D,b){var m=b(16).Beautifier,f=b(17).Options;function d(s,r){var u=new m(s,r);return u.beautify()}k.exports=d,k.exports.defaultOptions=function(){return new f}},function(k,D,b){var m=b(17).Options,f=b(2).Output,d=b(8).InputScanner,s=b(13).Directives,r=new s(/\/\*/,/\*\//),u=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=/\s/,n=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(O,C){this._source_text=O||"",this._options=new m(C),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(O){var C="";for(this._ch=this._input.next();this._ch;){if(C+=this._ch,this._ch==="\\")C+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return C},x.prototype.eatWhitespace=function(O){for(var C=a.test(this._input.peek()),_=0;a.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===` `&&((_===0||_0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,C=this._options.eol;C==="auto"&&(C=` `,O&&u.test(O||"")&&(C=O.match(u)[0])),O=O.replace(o,` `);var _=O.match(/^[\t ]*/)[0];this._output=new f(this._options,_),this._input=new d(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var y=0,h=!1,c=!1,v=!1,p=!1,E=!1,U=!1,F=this._ch,z=!1,G,B,T;G=this._input.read(n),B=G!=="",T=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(R),Z=r.get_directives(V);Z&&Z.ignore==="start"&&(V+=r.readIgnored(this._input)),this.print_string(V),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(w)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);oe.match(/[ :]$/)&&(oe=this.eatString(": ").replace(/\s$/,""),this.print_string(oe),this._output.space_before_token=!0),oe=oe.replace(/\s$/,""),oe==="extend"?p=!0:oe==="import"&&(E=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!h&&y===0&&oe.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),v?(v=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(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)):(T==="("?this._output.space_before_token=!1:T!==","&&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(),T==="{"&&this._output.trim(!0),E=!1,p=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),h=!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 pe=0;pe"||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&&a.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ie=T==='"'||T==="'";this.preserveSingleSpace(Ie||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&z&&this._output.add_new_line()}var Je=this._output.get_code(C);return Je},k.exports.Beautifier=x},function(k,D,b){var m=b(6).Options;function f(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 s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var u=0;u=15&&(m=!1,k=!0);var x=a&&(D||m&&(w==null||w<12.11)),O=N||H&&P>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var l=e.className,i=C(t).exec(l);if(i){var g=l.slice(i.index+i[0].length);e.className=l.slice(0,i.index)+(g?i[1]+g:"")}};function y(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return y(e).appendChild(t)}function c(e,t,l,i){var g=document.createElement(e);if(l&&(g.className=l),i&&(g.style.cssText=i),typeof t=="string")g.appendChild(document.createTextNode(t));else if(t)for(var j=0;j=t)return $+(t-j);$+=q-j,$+=l-$%l,j=q+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var l=+new Date+e;(!this.id||l=t)return i+Math.min($,t-g);if(g+=j-i,g+=l-g%l,i=j+1,g>=t)return i}}var be=[""];function de(e){for(;be.length<=e;)be.push(nt(be)+" ");return be[e]}function nt(e){return e[e.length-1]}function Kt(e,t){for(var l=[],i=0;i"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ft.test(e))}function Nt(e,t){return t?t.source.indexOf("\\w")>-1&&dt(e)?!0:t.test(e):dt(e)}function Ze(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Bt=/[\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 Ut(e){return e.charCodeAt(0)>=768&&Bt.test(e)}function Mt(e,t,l){for(;(l<0?t>0:tl?-1:1;;){if(t==l)return t;var g=(t+l)/2,j=i<0?Math.ceil(g):Math.floor(g);if(j==t)return e(j)?t:l;e(j)?l=j:t=j+i}}function mn(e,t,l,i){if(!e)return i(t,l,"ltr",0);for(var g=!1,j=0;jt||t==l&&$.to==t)&&(i(Math.max($.from,t),Math.min($.to,l),$.level==1?"rtl":"ltr",j),g=!0)}g||i(t,l,"ltr")}var pn=null;function tt(e,t,l){var i;pn=null;for(var g=0;gt)return g;j.to==t&&(j.from!=j.to&&l=="before"?i=g:pn=g),j.from==t&&(j.from!=j.to&&l!="before"?i=g:pn=g)}return i!=null?i:pn}var fn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function l(se){return se<=247?e.charAt(se):1424<=se&&se<=1524?"R":1536<=se&&se<=1785?t.charAt(se-1536):1774<=se&&se<=2220?"r":8192<=se&&se<=8203?"w":se==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,j=/[LRr]/,$=/[Lb1n]/,q=/[1n]/;function ee(se,Pe,Fe){this.level=se,this.from=Pe,this.to=Fe}return function(se,Pe){var Fe=Pe=="ltr"?"L":"R";if(se.length==0||Pe=="ltr"&&!i.test(se))return!1;for(var _t=se.length,ut=[],en=0;en<_t;++en)ut.push(l(se.charCodeAt(en)));for(var xn=0,Wn=Fe;xn<_t;++xn){var Vn=ut[xn];Vn=="m"?ut[xn]=Wn:Wn=Vn}for(var Zn=0,Yn=Fe;Zn<_t;++Zn){var ii=ut[Zn];ii=="1"&&Yn=="r"?ut[Zn]="n":j.test(ii)&&(Yn=ii,ii=="r"&&(ut[Zn]="R"))}for(var Ci=1,_i=ut[0];Ci<_t-1;++Ci){var Ui=ut[Ci];Ui=="+"&&_i=="1"&&ut[Ci+1]=="1"?ut[Ci]="1":Ui==","&&_i==ut[Ci+1]&&(_i=="1"||_i=="n")&&(ut[Ci]=_i),_i=Ui}for(var fr=0;fr<_t;++fr){var Hr=ut[fr];if(Hr==",")ut[fr]="N";else if(Hr=="%"){var Tr=void 0;for(Tr=fr+1;Tr<_t&&ut[Tr]=="%";++Tr);for(var oa=fr&&ut[fr-1]=="!"||Tr<_t&&ut[Tr]=="1"?"1":"N",na=fr;na-1&&(i[t]=g.slice(0,j).concat(g.slice(j+1)))}}}function Ge(e,t){var l=pt(e,t);if(!l.length)return;for(var i=Array.prototype.slice.call(arguments,2),g=0;g0}function Ee(e){e.prototype.on=function(t,l){Ue(this,t,l)},e.prototype.off=function(t,l){Ct(this,t,l)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ve(e){ae(e),re(e)}function me(e){return e.target||e.srcElement}function Be(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var Tt=function(){if(H&&P<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Jt;function En(e){if(Jt==null){var t=c("span","\u200B");h(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Jt=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&P<8))}var l=Jt?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return l.setAttribute("cm-text",""),l}var mt;function Qt(e){if(mt!=null)return mt;var t=h(e,document.createTextNode("A\u062EA")),l=p(t,0,1).getBoundingClientRect(),i=p(t,1,2).getBoundingClientRect();return y(e),!l||l.left==l.right?!1:mt=i.right-l.right<3}var gt=` b`.split(/\n/).length!=3?function(e){for(var t=0,l=[],i=e.length;t<=i;){var g=e.indexOf(` `,t);g==-1&&(g=e.length);var j=e.slice(t,e.charAt(g-1)=="\r"?g-1:g),$=j.indexOf("\r");$!=-1?(l.push(j.slice(0,$)),t+=$+1):(l.push(j),t=g+1)}return l}:function(e){return e.split(/\r\n?|\n/)},yt=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},rt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ce=null;function Re(e){if(ce!=null)return ce;var t=h(e,c("span","x")),l=t.getBoundingClientRect(),i=p(t,0,1).getBoundingClientRect();return ce=Math.abs(l.left-i.left)>1}var At={},ot={};function Yt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),At[e]=t}function rn(e,t){ot[e]=t}function _e(e){if(typeof e=="string"&&ot.hasOwnProperty(e))e=ot[e];else if(e&&typeof e.name=="string"&&ot.hasOwnProperty(e.name)){var t=ot[e.name];typeof t=="string"&&(t={name:t}),e=ze(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return _e("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return _e("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ne(e,t){t=_e(t);var l=At[t.name];if(!l)return Ne(e,"text/plain");var i=l(e,t);if(xt.hasOwnProperty(t.name)){var g=xt[t.name];for(var j in g){if(!g.hasOwnProperty(j))continue;i.hasOwnProperty(j)&&(i["_"+j]=i[j]),i[j]=g[j]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)i[$]=t.modeProps[$];return i}var xt={};function Xt(e,t){var l=xt.hasOwnProperty(e)?xt[e]:xt[e]={};T(t,l)}function vn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var l={};for(var i in t){var g=t[i];g instanceof Array&&(g=g.concat([])),l[i]=g}return l}function Mn(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 ci(e,t,l){return e.startState?e.startState(t,l):!0}var $n=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};$n.prototype.eol=function(){return this.pos>=this.string.length},$n.prototype.sol=function(){return this.pos==this.lineStart},$n.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$n.prototype.next=function(){if(this.post},$n.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},$n.prototype.skipToEnd=function(){this.pos=this.string.length},$n.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},$n.prototype.backUp=function(e){this.pos-=e},$n.prototype.column=function(){return this.lastColumnPos0?null:(j&&t!==!1&&(this.pos+=j[0].length),j)}},$n.prototype.current=function(){return this.string.slice(this.start,this.pos)},$n.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},$n.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},$n.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Cn(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 i=0;;++i){var g=l.children[i],j=g.chunkSize();if(t=e.first&&tl?cn(l,Cn(e,l).text.length):L(t,Cn(e,t.line).text.length)}function L(e,t){var l=e.ch;return l==null||l>t?cn(e.line,t):l<0?cn(e.line,0):e}function W(e,t){for(var l=[],i=0;ithis.maxLookAhead&&(this.maxLookAhead=e),t},Q.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}},Q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Q.fromSaved=function(e,t,l){return t instanceof ne?new Q(e,vn(e.mode,t.state),l,t.lookAhead):new Q(e,vn(e.mode,t),l)},Q.prototype.save=function(e){var t=e!==!1?vn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ne(t,this.maxLookAhead):t};function ke(e,t,l,i){var g=[e.state.modeGen],j={};ar(e,t.text,e.doc.mode,l,function(se,Pe){return g.push(se,Pe)},j,i);for(var $=l.state,q=function(se){l.baseTokens=g;var Pe=e.state.overlays[se],Fe=1,_t=0;l.state=!0,ar(e,t.text,Pe.mode,l,function(ut,en){for(var xn=Fe;_tut&&g.splice(Fe,1,ut,g[Fe+1],Wn),Fe+=2,_t=Math.min(ut,Wn)}if(!en)return;if(Pe.opaque)g.splice(xn,Fe-xn,ut,"overlay "+en),Fe=xn+2;else for(;xne.options.maxHighlightLength&&vn(e.doc.mode,i.state),j=ke(e,t,i);g&&(i.state=g),t.stateAfter=i.save(!g),t.styles=j.styles,j.classes?t.styleClasses=j.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 kn(e,t,l){var i=e.doc,g=e.display;if(!i.mode.startState)return new Q(i,!0,t);var j=Ki(e,t,l),$=j>i.first&&Cn(i,j-1).stateAfter,q=$?Q.fromSaved(i,$,j):new Q(i,ci(i.mode),j);return i.iter(j,t,function(ee){Qn(e,ee.text,q);var se=q.line;ee.stateAfter=se==t-1||se%5==0||se>=g.viewFrom&&set.start)return j}throw new Error("Mode "+e.name+" failed to advance stream.")}var qn=function(e,t,l){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=l};function Li(e,t,l,i){var g=e.doc,j=g.mode,$;t=S(g,t);var q=Cn(g,t.line),ee=kn(e,t.line,l),se=new $n(q.text,e.options.tabSize,ee),Pe;for(i&&(Pe=[]);(i||se.pose.options.maxHighlightLength?(q=!1,$&&Qn(e,t,i,Pe.pos),Pe.pos=t.length,Fe=null):Fe=lr(ti(l,Pe,i.state,_t),j),_t){var ut=_t[0].name;ut&&(Fe="m-"+(Fe?ut+" "+Fe:ut))}if(!q||se!=Fe){for(;ee$;--q){if(q<=j.first)return j.first;var ee=Cn(j,q-1),se=ee.stateAfter;if(se&&(!l||q+(se instanceof ne?se.lookAhead:0)<=j.modeFrontier))return q;var Pe=V(ee.text,null,e.options.tabSize);(g==null||i>Pe)&&(g=q-1,i=Pe)}return g}function Pr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierl;i--){var g=Cn(e,i).stateAfter;if(g&&(!(g instanceof ne)||i+g.lookAhead=t:j.to>t);(i||(i=[])).push(new Fi($,j.from,ee?null:j.to))}}return i}function si(e,t,l){var i;if(e)for(var g=0;g=t:j.to>t);if(q||j.from==t&&$.type=="bookmark"&&(!l||j.marker.insertLeft)){var ee=j.from==null||($.inclusiveLeft?j.from<=t:j.from0&&q)for(var ii=0;ii0)continue;var Pe=[ee,1],Fe=ri(se.from,q.from),_t=ri(se.to,q.to);(Fe<0||!$.inclusiveLeft&&!Fe)&&Pe.push({from:se.from,to:q.from}),(_t>0||!$.inclusiveRight&&!_t)&&Pe.push({from:q.to,to:se.to}),g.splice.apply(g,Pe),ee+=Pe.length-3}return g}function Ce(e){var t=e.markedSpans;if(!t)return;for(var l=0;lt)&&(!i||Ve(i,j.marker)<0)&&(i=j.marker)}return i}function ht(e,t,l,i,g){var j=Cn(e,t),$=Ai&&j.markedSpans;if($)for(var q=0;q<$.length;++q){var ee=$[q];if(!ee.marker.collapsed)continue;var se=ee.marker.find(0),Pe=ri(se.from,l)||qe(ee.marker)-qe(g),Fe=ri(se.to,i)||Oe(ee.marker)-Oe(g);if(Pe>=0&&Fe<=0||Pe<=0&&Fe>=0)continue;if(Pe<=0&&(ee.marker.inclusiveRight&&g.inclusiveLeft?ri(se.to,l)>=0:ri(se.to,l)>0)||Pe>=0&&(ee.marker.inclusiveRight&&g.inclusiveLeft?ri(se.from,i)<=0:ri(se.from,i)<0))return!0}}function it(e){for(var t;t=Ot(e);)e=t.find(-1,!0).line;return e}function st(e){for(var t;t=Et(e);)e=t.find(1,!0).line;return e}function bt(e){for(var t,l;t=Et(e);)e=t.find(1,!0).line,(l||(l=[])).push(e);return l}function Lt(e,t){var l=Cn(e,t),i=it(l);return l==i?t:fi(i)}function ct(e,t){if(t>e.lastLine())return t;var l=Cn(e,t),i;if(!Gt(e,l))return t;for(;i=Et(l);)l=i.find(1,!0).line;return fi(l)+1}function Gt(e,t){var l=Ai&&t.markedSpans;if(l)for(var i=void 0,g=0;gt.maxLineLength&&(t.maxLineLength=g,t.maxLine=i)})}var Nn=function(e,t,l){this.text=e,Te(this,t),this.height=l?l(this):1};Nn.prototype.lineNo=function(){return fi(this)},Ee(Nn);function Pn(e,t,l,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ce(e),Te(e,l);var g=i?i(e):1;g!=e.height&&hi(e,g)}function Dt(e){e.parent=null,Ce(e)}var sn={},Ft={};function St(e,t){if(!e||/^\s*$/.test(e))return null;var l=t.addModeClass?Ft:sn;return l[e]||(l[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,t){var l=v("span",null,null,k?"padding-right: .1px":null),i={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 j=g?t.rest[g-1]:t.line,$=void 0;i.pos=0,i.addToken=zt,Qt(e.display.measure)&&($=In(j,e.doc.direction))&&(i.addToken=jn(i.addToken,$)),i.map=[];var q=t!=e.display.externalMeasured&&fi(j);Jn(j,i,Vt(e,j,q)),j.styleClasses&&(j.styleClasses.bgClass&&(i.bgClass=z(j.styleClasses.bgClass,i.bgClass||"")),j.styleClasses.textClass&&(i.textClass=z(j.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(En(e.display.measure))),g==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(k){var ee=i.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ge(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=z(i.pre.className,i.textClass||"")),i}function Sn(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 zt(e,t,l,i,g,j,$){if(!t)return;var q=e.splitSpaces?lt(t,e.trailingSpace):t,ee=e.cm.state.specialChars,se=!1,Pe;if(!ee.test(t))e.col+=t.length,Pe=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,Pe),H&&P<9&&(se=!0),e.pos+=t.length;else{Pe=document.createDocumentFragment();for(var Fe=0;;){ee.lastIndex=Fe;var _t=ee.exec(t),ut=_t?_t.index-Fe:t.length-Fe;if(ut){var en=document.createTextNode(q.slice(Fe,Fe+ut));H&&P<9?Pe.appendChild(c("span",[en])):Pe.appendChild(en),e.map.push(e.pos,e.pos+ut,en),e.col+=ut,e.pos+=ut}if(!_t)break;Fe+=ut+1;var xn=void 0;if(_t[0]==" "){var Wn=e.cm.options.tabSize,Vn=Wn-e.col%Wn;xn=Pe.appendChild(c("span",de(Vn),"cm-tab")),xn.setAttribute("role","presentation"),xn.setAttribute("cm-text"," "),e.col+=Vn}else _t[0]=="\r"||_t[0]==` `?(xn=Pe.appendChild(c("span",_t[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),xn.setAttribute("cm-text",_t[0]),e.col+=1):(xn=e.cm.options.specialCharPlaceholder(_t[0]),xn.setAttribute("cm-text",_t[0]),H&&P<9?Pe.appendChild(c("span",[xn])):Pe.appendChild(xn),e.col+=1);e.map.push(e.pos,e.pos+1,xn),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,l||i||g||se||j||$){var Zn=l||"";i&&(Zn+=i),g&&(Zn+=g);var Yn=c("span",[Pe],Zn,j);if($)for(var ii in $)$.hasOwnProperty(ii)&&ii!="style"&&ii!="class"&&Yn.setAttribute(ii,$[ii]);return e.content.appendChild(Yn)}e.content.appendChild(Pe)}function lt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var l=t,i="",g=0;gse&&Fe.from<=se);_t++);if(Fe.to>=Pe)return e(l,i,g,j,$,q,ee);e(l,i.slice(0,Fe.to-se),g,j,null,q,ee),j=null,i=i.slice(Fe.to-se),se=Fe.to}}}function ln(e,t,l,i){var g=!i&&l.widgetNode;g&&e.map.push(e.pos,e.pos+t,g),!i&&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 Jn(e,t,l){var i=e.markedSpans,g=e.text,j=0;if(!i){for(var $=1;$ee||Ui.collapsed&&_i.to==ee&&_i.from==ee)){if(_i.to!=null&&_i.to!=ee&&ut>_i.to&&(ut=_i.to,xn=""),Ui.className&&(en+=" "+Ui.className),Ui.css&&(_t=(_t?_t+";":"")+Ui.css),Ui.startStyle&&_i.from==ee&&(Wn+=" "+Ui.startStyle),Ui.endStyle&&_i.to==ut&&(ii||(ii=[])).push(Ui.endStyle,_i.to),Ui.title&&((Zn||(Zn={})).title=Ui.title),Ui.attributes)for(var fr in Ui.attributes)(Zn||(Zn={}))[fr]=Ui.attributes[fr];Ui.collapsed&&(!Vn||Ve(Vn.marker,Ui)<0)&&(Vn=_i)}else _i.from>ee&&ut>_i.from&&(ut=_i.from)}if(ii)for(var Hr=0;Hr=q)break;for(var oa=Math.min(q,ut);;){if(Pe){var na=ee+Pe.length;if(!Vn){var kr=na>oa?Pe.slice(0,oa-ee):Pe;t.addToken(t,kr,Fe?Fe+en:en,Wn,ee+kr.length==ut?xn:"",_t,Zn)}if(na>=oa){Pe=Pe.slice(oa-ee),ee=oa;break}ee=na,Wn=""}Pe=g.slice(j,j=l[se++]),Fe=St(l[se++],t.cm.options)}}}function $t(e,t,l){this.line=t,this.rest=bt(t),this.size=this.rest?fi(nt(this.rest))-l+1:1,this.node=this.text=null,this.hidden=Gt(e,t)}function On(e,t,l){for(var i=[],g,j=t;j2&&j.push((ee.bottom+se.top)/2-l.top)}}j.push(l.bottom-l.top)}}function le(e,t,l){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;il)return{map:e.measure.maps[g],cache:e.measure.caches[g],before:!0}}function Se(e,t){t=it(t);var l=fi(t),i=e.display.externalMeasured=new $t(e.doc,t,l);i.lineN=l;var g=i.built=Un(e,i);return i.text=g.pre,h(e.display.lineMeasure,g.pre),i}function De(e,t,l,i){return at(e,Le(e,t),l,i)}function $e(e,t){if(t>=e.display.viewFrom&&t=l.lineN&&tt)&&(j=ee-q,g=j-1,t>=ee&&($="right")),g!=null){if(i=e[se+2],q==ee&&l==(i.insertLeft?"left":"right")&&($=l),l=="left"&&g==0)for(;se&&e[se-2]==e[se-3]&&e[se-1].insertLeft;)i=e[(se-=3)+2],$="left";if(l=="right"&&g==ee-q)for(;se=0&&!((l=e[g]).left!=l.right);g--);return l}function Hn(e,t,l,i){var g=qt(t.map,l,i),j=g.node,$=g.start,q=g.end,ee=g.collapse,se;if(j.nodeType==3){for(var Pe=0;Pe<4;Pe++){for(;$&&Ut(t.line.text.charAt(g.coverStart+$));)--$;for(;g.coverStart+q0&&(ee=i="right");var Fe;e.options.lineWrapping&&(Fe=j.getClientRects()).length>1?se=Fe[i=="right"?Fe.length-1:0]:se=j.getBoundingClientRect()}if(H&&P<9&&!$&&(!se||!se.left&&!se.right)){var _t=j.parentNode.getClientRects()[0];_t?se={left:_t.left,right:_t.left+Bi(e.display),top:_t.top,bottom:_t.bottom}:se=It}for(var ut=se.top-t.rect.top,en=se.bottom-t.rect.top,xn=(ut+en)/2,Wn=t.view.measure.heights,Vn=0;Vn=i.text.length?(ee=i.text.length,se="before"):ee<=0&&(ee=0,se="after"),!q)return $(se=="before"?ee-1:ee,se=="before");function Pe(en,xn,Wn){var Vn=q[xn],Zn=Vn.level==1;return $(Wn?en-1:en,Zn!=Wn)}var Fe=tt(q,ee,se),_t=pn,ut=Pe(ee,Fe,se=="before");return _t!=null&&(ut.other=Pe(ee,_t,se!="before")),ut}function Ht(e,t){var l=0;t=S(e.doc,t),e.options.lineWrapping||(l=Bi(e.display)*t.ch);var i=Cn(e.doc,t.line),g=Dn(i)+vr(e.display);return{left:l,right:l,top:g,bottom:g+i.height}}function Wt(e,t,l,i,g){var j=cn(e,t,l);return j.xRel=g,i&&(j.outside=i),j}function pi(e,t,l){var i=e.doc;if(l+=e.display.viewOffset,l<0)return Wt(i.first,0,null,-1,-1);var g=ji(i,l),j=i.first+i.size-1;if(g>j)return Wt(i.first+i.size-1,Cn(i,j).text.length,null,1,1);t<0&&(t=0);for(var $=Cn(i,g);;){var q=or(e,$,g,t,l),ee=je($,q.ch+(q.xRel>0||q.outside>0?1:0));if(!ee)return q;var se=ee.find(1);if(se.line==g)return se;$=Cn(i,g=se.line)}}function Pi(e,t,l,i){i-=xi(t);var g=t.text.length,j=An(function($){return at(e,l,$-1).bottom<=i},g,0);return g=An(function($){return at(e,l,$).top>i},j,g),{begin:j,end:g}}function ni(e,t,l,i){l||(l=Le(e,t));var g=Di(e,t,at(e,l,i),"line").top;return Pi(e,t,l,g)}function Ii(e,t,l,i){return e.bottom<=l?!1:e.top>l?!0:(i?e.left:e.right)>t}function or(e,t,l,i,g){g-=Dn(t);var j=Le(e,t),$=xi(t),q=0,ee=t.text.length,se=!0,Pe=In(t,e.doc.direction);if(Pe){var Fe=(e.options.lineWrapping?Yi:Ni)(e,t,l,j,Pe,i,g);se=Fe.level!=1,q=se?Fe.from:Fe.to-1,ee=se?Fe.to:Fe.from-1}var _t=null,ut=null,en=An(function(Ci){var _i=at(e,j,Ci);return _i.top+=$,_i.bottom+=$,Ii(_i,i,g,!1)?(_i.top<=g&&_i.left<=i&&(_t=Ci,ut=_i),!0):!1},q,ee),xn,Wn,Vn=!1;if(ut){var Zn=i-ut.left=ii.bottom?1:0}return en=Mt(t.text,en,1),Wt(l,en,Wn,Vn,i-xn)}function Ni(e,t,l,i,g,j,$){var q=An(function(Fe){var _t=g[Fe],ut=_t.level!=1;return Ii(yn(e,cn(l,ut?_t.to:_t.from,ut?"before":"after"),"line",t,i),j,$,!0)},0,g.length-1),ee=g[q];if(q>0){var se=ee.level!=1,Pe=yn(e,cn(l,se?ee.from:ee.to,se?"after":"before"),"line",t,i);Ii(Pe,j,$,!0)&&Pe.top>$&&(ee=g[q-1])}return ee}function Yi(e,t,l,i,g,j,$){var q=Pi(e,t,i,$),ee=q.begin,se=q.end;/\s/.test(t.text.charAt(se-1))&&se--;for(var Pe=null,Fe=null,_t=0;_t=se||ut.to<=ee)continue;var en=ut.level!=1,xn=at(e,i,en?Math.min(se,ut.to)-1:Math.max(ee,ut.from)).right,Wn=xnWn)&&(Pe=ut,Fe=Wn)}return Pe||(Pe=g[g.length-1]),Pe.fromse&&(Pe={from:Pe.from,to:se,level:Pe.level}),Pe}var zi;function Hi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(zi==null){zi=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)zi.appendChild(document.createTextNode("x")),zi.appendChild(c("br"));zi.appendChild(document.createTextNode("x"))}h(e.measure,zi);var l=zi.offsetHeight/50;return l>3&&(e.cachedTextHeight=l),y(e.measure),l||1}function Bi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),l=c("pre",[t],"CodeMirror-line-like");h(e.measure,l);var i=t.getBoundingClientRect(),g=(i.right-i.left)/10;return g>2&&(e.cachedCharWidth=g),g||10}function vi(e){for(var t=e.display,l={},i={},g=t.gutters.clientLeft,j=t.gutters.firstChild,$=0;j;j=j.nextSibling,++$){var q=e.display.gutterSpecs[$].className;l[q]=j.offsetLeft+j.clientLeft+g,i[q]=j.clientWidth}return{fixedPos:_r(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:l,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _r(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Jr(e){var t=Hi(e.display),l=e.options.lineWrapping,i=l&&Math.max(5,e.display.scroller.clientWidth/Bi(e.display)-3);return function(g){if(Gt(e.doc,g))return 0;var j=0;if(g.widgets)for(var $=0;$0&&(se=Cn(e.doc,ee.line).text).length==ee.ch){var Pe=V(se,se.length,e.options.tabSize)-se.length;ee=cn(ee.line,Math.max(0,Math.round((j-Me(e.display).left)/Bi(e.display))-Pe))}return ee}function ur(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var l=e.display.view,i=0;it)&&(g.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=g.viewTo)Ai&&Lt(e.doc,t)g.viewFrom?dr(e):(g.viewFrom+=i,g.viewTo+=i);else if(t<=g.viewFrom&&l>=g.viewTo)dr(e);else if(t<=g.viewFrom){var j=Fr(e,l,l+i,1);j?(g.view=g.view.slice(j.index),g.viewFrom=j.lineN,g.viewTo+=i):dr(e)}else if(l>=g.viewTo){var $=Fr(e,t,t,-1);$?(g.view=g.view.slice(0,$.index),g.viewTo=$.lineN):dr(e)}else{var q=Fr(e,t,t,-1),ee=Fr(e,l,l+i,1);q&&ee?(g.view=g.view.slice(0,q.index).concat(On(e,q.lineN,ee.lineN)).concat(g.view.slice(ee.index)),g.viewTo+=i):dr(e)}var se=g.externalMeasured;se&&(l=g.lineN&&t=i.viewTo)return;var j=i.view[ur(e,t)];if(j.node==null)return;var $=j.changes||(j.changes=[]);oe($,l)==-1&&$.push(l)}function dr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fr(e,t,l,i){var g=ur(e,t),j,$=e.display.view;if(!Ai||l==e.doc.first+e.doc.size)return{index:g,lineN:l};for(var q=e.display.viewFrom,ee=0;ee0){if(g==$.length-1)return null;j=q+$[g].size-t,g++}else j=q-t;t+=j,l+=j}for(;Lt(e.doc,l)!=l;){if(g==(i<0?0:$.length-1))return null;l+=i*$[g-(i<0?1:0)].size,g+=i}return{index:g,lineN:l}}function ha(e,t,l){var i=e.display,g=i.view;g.length==0||t>=i.viewTo||l<=i.viewFrom?(i.view=On(e,t,l),i.viewFrom=t):(i.viewFrom>t?i.view=On(e,t,i.viewFrom).concat(i.view):i.viewFroml&&(i.view=i.view.slice(0,ur(e,l)))),i.viewTo=l}function sa(e){for(var t=e.display.view,l=0,i=0;i=e.display.viewTo||q.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Ta(e),t.cursorDiv.style.visibility=(l=!l)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ma(e){e.state.focused||(e.display.input.focus(),la(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ta(e))},100)}function la(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ge(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),wr(e)}function Ta(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ge(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 wa(e){for(var t=e.display,l=t.lineDiv.offsetTop,i=0;i.005||Pe<-.005)&&(hi(g.line,$),Sa(g.line),g.rest))for(var Fe=0;Fee.display.sizerWidth){var _t=Math.ceil(q/Bi(e.display));_t>e.display.maxLineLength&&(e.display.maxLineLength=_t,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}function Sa(e){if(e.widgets)for(var t=0;t=$&&(j=ji(t,Dn(Cn(t,ee))-e.wrapper.clientHeight),$=ee)}return{from:j,to:Math.max($,j+1)}}function co(e,t){if(vt(e,"scrollCursorIntoView"))return;var l=e.display,i=l.sizer.getBoundingClientRect(),g=null;if(t.top+i.top<0?g=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),g!=null&&!s){var j=c("div","\u200B",null,`position: absolute; top: `+(t.top-l.viewOffset-vr(e.display))+`px; height: `+(t.bottom-t.top+We(e)+l.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(j),j.scrollIntoView(g),e.display.lineSpace.removeChild(j)}}function Ro(e,t,l,i){i==null&&(i=0);var g;!e.options.lineWrapping&&t==l&&(t=t.ch?cn(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,l=t.sticky=="before"?cn(t.line,t.ch+1,"before"):t);for(var j=0;j<5;j++){var $=!1,q=yn(e,t),ee=!l||l==t?q:yn(e,l);g={left:Math.min(q.left,ee.left),top:Math.min(q.top,ee.top)-i,right:Math.max(q.left,ee.left),bottom:Math.max(q.bottom,ee.bottom)+i};var se=Oa(e,g),Pe=e.doc.scrollTop,Fe=e.doc.scrollLeft;if(se.scrollTop!=null&&(Da(e,se.scrollTop),Math.abs(e.doc.scrollTop-Pe)>1&&($=!0)),se.scrollLeft!=null&&(Nr(e,se.scrollLeft),Math.abs(e.doc.scrollLeft-Fe)>1&&($=!0)),!$)break}return g}function Ga(e,t){var l=Oa(e,t);l.scrollTop!=null&&Da(e,l.scrollTop),l.scrollLeft!=null&&Nr(e,l.scrollLeft)}function Oa(e,t){var l=e.display,i=Hi(e.display);t.top<0&&(t.top=0);var g=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:l.scroller.scrollTop,j=ie(e),$={};t.bottom-t.top>j&&(t.bottom=t.top+j);var q=e.doc.height+ye(l),ee=t.topq-i;if(t.topg+j){var Pe=Math.min(t.top,(se?q:t.bottom)-j);Pe!=g&&($.scrollTop=Pe)}var Fe=e.options.fixedGutter?0:l.gutters.offsetWidth,_t=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:l.scroller.scrollLeft-Fe,ut=we(e)-l.gutters.offsetWidth,en=t.right-t.left>ut;return en&&(t.right=t.left+ut),t.left<10?$.scrollLeft=0:t.left<_t?$.scrollLeft=Math.max(0,t.left+Fe-(en?0:10)):t.right>ut+_t-3&&($.scrollLeft=t.right+(en?0:10)-ut),$}function Va(e,t){if(t==null)return;Ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){Ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ra(e,t,l){(t!=null||l!=null)&&Ya(e),t!=null&&(e.curOp.scrollLeft=t),l!=null&&(e.curOp.scrollTop=l)}function ho(e,t){Ya(e),e.curOp.scrollToPos=t}function Ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var l=Ht(e,t.from),i=Ht(e,t.to);Aa(e,l,i,t.margin)}}function Aa(e,t,l,i){var g=Oa(e,{left:Math.min(t.left,l.left),top:Math.min(t.top,l.top)-i,right:Math.max(t.right,l.right),bottom:Math.max(t.bottom,l.bottom)+i});Ra(e,g.scrollLeft,g.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Ua(e,{top:t}),ya(e,t,!0),N&&Ua(e),Na(e,100)}function ya(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 Nr(e,t,l,i){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)&&!i)return;e.doc.scrollLeft=t,ki(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,l=t.gutters.offsetWidth,i=Math.round(e.doc.height+ye(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?l:0,docHeight:i,scrollHeight:i+We(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:l}}var pa=function(e,t,l){this.cm=l;var i=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");i.tabIndex=g.tabIndex=-1,e(i),e(g),Ue(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ue(g,"scroll",function(){g.clientWidth&&t(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&P<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,l=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(l){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var g=e.viewHeight-(t?i: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?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var j=e.viewWidth-e.barLeft-(l?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+j)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:l?i:0,bottom:t?i:0}},pa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pa.prototype.zeroWidthHack=function(){var e=a&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},pa.prototype.enableZeroWidthBar=function(e,t,l){e.style.pointerEvents="auto";function i(){var g=e.getBoundingClientRect(),j=l=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);j!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},pa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function ma(e,t){t||(t=fa(e));var l=e.display.barWidth,i=e.display.barHeight;Xa(e,t);for(var g=0;g<4&&l!=e.display.barWidth||i!=e.display.barHeight;g++)l!=e.display.barWidth&&e.options.lineWrapping&&wa(e),Xa(e,fa(e)),l=e.display.barWidth,i=e.display.barHeight}function Xa(e,t){var l=e.display,i=l.scrollbars.update(t);l.sizer.style.paddingRight=(l.barWidth=i.right)+"px",l.sizer.style.paddingBottom=(l.barHeight=i.bottom)+"px",l.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(l.scrollbarFiller.style.display="block",l.scrollbarFiller.style.height=i.bottom+"px",l.scrollbarFiller.style.width=i.right+"px"):l.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(l.gutterFiller.style.display="block",l.gutterFiller.style.height=i.bottom+"px",l.gutterFiller.style.width=t.gutterWidth+"px"):l.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Qa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $a[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ue(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"?Nr(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Ia=0;function ua(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ia},hn(e.curOp)}function Ea(e){var t=e.curOp;t&&Rn(t,function(l){for(var i=0;i=l.viewTo)||l.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ea(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&xa(e.cm,e.update)}function fo(e){var t=e.cm,l=t.display;e.updatedDisplay&&wa(t),e.barMeasure=fa(t),l.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=De(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+We(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,l.sizer.offsetLeft+e.adjustWidthTo-we(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=e.display.viewTo)return;var l=+new Date+e.options.workTime,i=kn(e,t.highlightFrontier),g=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(j){if(i.line>=e.display.viewFrom){var $=j.styles,q=j.text.length>e.options.maxHighlightLength?vn(t.mode,i.state):null,ee=ke(e,j,i,!0);q&&(i.state=q),j.styles=ee.styles;var se=j.styleClasses,Pe=ee.classes;Pe?j.styleClasses=Pe:se&&(j.styleClasses=null);for(var Fe=!$||$.length!=j.styles.length||se!=Pe&&(!se||!Pe||se.bgClass!=Pe.bgClass||se.textClass!=Pe.textClass),_t=0;!Fe&&_t<$.length;++_t)Fe=$[_t]!=j.styles[_t];Fe&&g.push(i.line),j.stateAfter=i.save(),i.nextLine()}else j.text.length<=e.options.maxHighlightLength&&Qn(e,j.text,i),j.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>l)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),g.length&&Kr(e,function(){for(var j=0;j=l.viewFrom&&t.visible.to<=l.viewTo&&(l.updateLineNumbers==null||l.updateLineNumbers>=l.viewTo)&&l.renderedView==l.view&&sa(e)==0)return!1;mr(e)&&(dr(e),t.dims=vi(e));var g=i.first+i.size,j=Math.max(t.visible.from-e.options.viewportMargin,i.first),$=Math.min(g,t.visible.to+e.options.viewportMargin);l.viewFrom$&&l.viewTo-$<20&&($=Math.min(g,l.viewTo)),Ai&&(j=Lt(e.doc,j),$=ct(e.doc,$));var q=j!=l.viewFrom||$!=l.viewTo||l.lastWrapHeight!=t.wrapperHeight||l.lastWrapWidth!=t.wrapperWidth;ha(e,j,$),l.viewOffset=Dn(Cn(e.doc,l.viewFrom)),e.display.mover.style.top=l.viewOffset+"px";var ee=sa(e);if(!q&&ee==0&&!t.force&&l.renderedView==l.view&&(l.updateLineNumbers==null||l.updateLineNumbers>=l.viewTo))return!1;var se=oo(e);return ee>4&&(l.lineDiv.style.display="none"),go(e,l.updateLineNumbers,t.dims),ee>4&&(l.lineDiv.style.display=""),l.renderedView=l.view,so(se),y(l.cursorDiv),y(l.selectionDiv),l.gutters.style.height=l.sizer.style.minHeight=0,q&&(l.lastWrapHeight=t.wrapperHeight,l.lastWrapWidth=t.wrapperWidth,Na(e,400)),l.updateLineNumbers=null,!0}function Ja(e,t){for(var l=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==we(e)){if(l&&l.top!=null&&(l={top:Math.min(e.doc.height+ye(e.display)-ie(e),l.top)}),t.visible=ka(e.display,e.doc,l),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=ka(e.display,e.doc,l));if(!xa(e,t))break;wa(e);var g=fa(e);qi(e),ma(e,g),Xi(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 Ua(e,t){var l=new ea(e,t);if(xa(e,l)){wa(e),Ja(e,l);var i=fa(e);qi(e),ma(e,i),Xi(e,i),l.finish()}}function go(e,t,l){var i=e.display,g=e.options.lineNumbers,j=i.lineDiv,$=j.firstChild;function q(en){var xn=en.nextSibling;return k&&a&&e.display.currentWheelTarget==en?en.style.display="none":en.parentNode.removeChild(en),xn}for(var ee=i.view,se=i.viewFrom,Pe=0;Pe-1&&(ut=!1),kt(e,Fe,se,l)),ut&&(y(Fe.lineNumber),Fe.lineNumber.appendChild(document.createTextNode(yr(e.options,se)))),$=Fe.node.nextSibling}se+=Fe.size}for(;$;)$=q($)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Xi(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+We(e)+"px"}function ki(e){var t=e.display,l=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=_r(t)-t.scroller.scrollLeft+e.doc.scrollLeft,g=t.gutters.offsetWidth,j=i+"px",$=0;$$.clientWidth,ee=$.scrollHeight>$.clientHeight;if(!(i&&q||g&&ee))return;if(g&&a&&k){e:for(var se=t.target,Pe=j.view;se!=$;se=se.parentNode)for(var Fe=0;Fe=0&&ri(e,i.to())<=0)return l}return-1};var Gi=function(e,t){this.anchor=e,this.head=t};Gi.prototype.from=function(){return nr(this.anchor,this.head)},Gi.prototype.to=function(){return tr(this.anchor,this.head)},Gi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Si(e,t,l){var i=e&&e.options.selectionsMayTouch,g=t[l];t.sort(function(_t,ut){return ri(_t.from(),ut.from())}),l=oe(t,g);for(var j=1;j0:ee>=0){var se=nr(q.from(),$.from()),Pe=tr(q.to(),$.to()),Fe=q.empty()?$.from()==$.head:q.from()==q.head;j<=l&&--l,t.splice(--j,2,new Gi(Fe?Pe:se,Fe?se:Pe))}}return new zr(t,l)}function Xn(e,t){return new zr([new Gi(e,t||e)],0)}function ui(e){return e.text?cn(e.from.line+e.text.length-1,nt(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Mi(e,t){if(ri(e,t.from)<0)return e;if(ri(e,t.to)<=0)return ui(t);var l=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=ui(t).ch-t.to.ch),cn(l,i)}function hr(e,t){for(var l=[],i=0;i1&&e.remove(q.line+1,en-1),e.insert(q.line+1,Vn)}Rt(e,"change",e,t)}function Ar(e,t,l){function i(g,j,$){if(g.linked)for(var q=0;q1&&!e.done[e.done.length-2].ranges)return e.done.pop(),nt(e.done)}function bs(e,t,l,i){var g=e.history;g.undone.length=0;var j=+new Date,$,q;if((g.lastOp==i||g.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&g.lastModTime>j-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(g,g.lastOp==i)))q=nt($.changes),ri(t.from,t.to)==0&&ri(t.from,q.to)==0?q.to=ui(t):$.changes.push(is(e,t));else{var ee=nt(g.done);for((!ee||!ee.ranges)&&Go(e.sel,g.done),$={changes:[is(e,t)],generation:g.generation},g.done.push($);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=j,g.lastOp=g.lastSelOp=i,g.lastOrigin=g.lastSelOrigin=t.origin,q||Ge(e,"historyAdded")}function ml(e,t,l,i){var g=t.charAt(0);return g=="*"||g=="+"&&l.ranges.length==i.ranges.length&&l.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,l,i){var g=e.history,j=i&&i.origin;l==g.lastSelOp||j&&g.lastSelOrigin==j&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==j||ml(e,j,nt(g.done),t))?g.done[g.done.length-1]=t:Go(t,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=j,g.lastSelOp=l,i&&i.clearRedo!==!1&&ys(g.undone)}function Go(e,t){var l=nt(t);l&&l.ranges&&l.equals(e)||t.push(e)}function Es(e,t,l,i){var g=t["spans_"+e.id],j=0;e.iter(Math.max(e.first,l),Math.min(e.first+e.size,i),function($){$.markedSpans&&((g||(g=t["spans_"+e.id]={}))[j]=$.markedSpans),++j})}function vl(e){if(!e)return null;for(var t,l=0;l-1&&(nt(q)[Fe]=se[Fe],delete se[Fe]))}}return i}function rs(e,t,l,i){if(i){var g=e.anchor;if(l){var j=ri(t,g)<0;j!=ri(l,g)<0?(g=t,t=l):j!=ri(t,l)<0&&(t=l)}return new Gi(g,t)}else return new Gi(l||t,t)}function Vo(e,t,l,i,g){g==null&&(g=e.cm&&(e.cm.display.shift||e.extend)),Yr(e,new zr([rs(e.sel.primary(),t,l,g)],0),i)}function Cs(e,t,l){for(var i=[],g=e.cm&&(e.cm.display.shift||e.extend),j=0;j=t.ch:q.to>t.ch))){if(g&&(Ge(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(j.markedSpans){--$;continue}else break;if(!ee.atomic)continue;if(l){var Fe=ee.find(i<0?1:-1),_t=void 0;if((i<0?Pe:se)&&(Fe=As(e,Fe,-i,Fe&&Fe.line==t.line?j:null)),Fe&&Fe.line==t.line&&(_t=ri(Fe,l))&&(i<0?_t<0:_t>0))return _o(e,Fe,t,i,g)}var ut=ee.find(i<0?-1:1);return(i<0?se:Pe)&&(ut=As(e,ut,i,ut.line==t.line?j:null)),ut?_o(e,ut,t,i,g):null}}return t}function Xo(e,t,l,i,g){var j=i||1,$=_o(e,t,l,j,g)||!g&&_o(e,t,l,j,!0)||_o(e,t,l,-j,g)||!g&&_o(e,t,l,-j,!0);return $||(e.cantEdit=!0,cn(e.first,0))}function As(e,t,l,i){return l<0&&t.ch==0?t.line>e.first?S(e,cn(t.line-1)):null:l>0&&t.ch==(i||Cn(e,t.line)).text.length?t.line=0;--g)Ls(e,{from:i[g].from,to:i[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]==""&&ri(t.from,t.to)==0)return;var l=hr(e,t);bs(e,t,l,e.cm?e.cm.curOp.id:NaN),Po(e,t,l,ai(e,t));var i=[];Ar(e,function(g,j){!j&&oe(i,g.history)==-1&&(Ns(g.history,t),i.push(g.history)),Po(g,t,null,ai(g,t))})}function $o(e,t,l){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!l)return;for(var g=e.history,j,$=e.sel,q=t=="undo"?g.done:g.undone,ee=t=="undo"?g.undone:g.done,se=0;se=0;--ut){var en=_t(ut);if(en)return en.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new zr(Kt(e.sel.ranges,function(g){return new Gi(cn(g.anchor.line+t,g.anchor.ch),cn(g.head.line+t,g.head.ch))}),e.sel.primIndex),e.cm){Zi(e.cm,e.first,e.first-t,t);for(var l=e.cm.display,i=l.viewFrom;ie.lastLine())return;if(t.from.linej&&(t={from:t.from,to:cn(j,Cn(e,j).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ti(e,t.from,t.to),l||(l=hr(e,t)),e.cm?bl(e.cm,t,i):Wa(e,t,i),Yo(e,l,xe),e.cantEdit&&Xo(e,cn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,l){var i=e.doc,g=e.display,j=t.from,$=t.to,q=!1,ee=j.line;e.options.lineWrapping||(ee=fi(it(Cn(i,j.line))),i.iter(ee,$.line+1,function(ut){if(ut==g.maxLine)return q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Ae(e),Wa(i,t,l,Jr(e)),e.options.lineWrapping||(i.iter(ee,j.line+t.text.length,function(ut){var en=Kn(ut);en>g.maxLineLength&&(g.maxLine=ut,g.maxLineLength=en,g.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),Pr(i,j.line),Na(e,400);var se=t.text.length-($.line-j.line)-1;t.full?Zi(e):j.line==$.line&&t.text.length==1&&!va(e.doc,t)?rr(e,j.line,"text"):Zi(e,j.line,$.line+1,se);var Pe=ge(e,"changes"),Fe=ge(e,"change");if(Fe||Pe){var _t={from:j,to:$,text:t.text,removed:t.removed,origin:t.origin};Fe&&Rt(e,"change",e,_t),Pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(_t)}e.display.selForContextMenu=null}function bo(e,t,l,i,g){var j;i||(i=l),ri(i,l)<0&&(j=[i,l],l=j[0],i=j[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:l,to:i,text:t,origin:g})}function ks(e,t,l,i){l1||!(this.children[0]instanceof Mo))){var q=[];this.collapse(q),this.children=[new Mo(q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var $=g.lines.length%25+25,q=$;q10);e.parent.maybeSpill()},iterN:function(e,t,l){for(var i=0;ie.display.maxLineLength&&(e.display.maxLine=se,e.display.maxLineLength=Pe,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Zi(e,i,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Rt(e,"markerCleared",e,this,i,g),t&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var l,i,g=0;g0||$==0&&j.clearWhenEmpty!==!1)return j;if(j.replacedWith&&(j.collapsed=!0,j.widgetNode=v("span",[j.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||j.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(j.widgetNode.insertLeft=!0)),j.collapsed){if(ht(e,t.line,t,l,j)||t.line!=l.line&&ht(e,l.line,t,l,j))throw new Error("Inserting collapsed marker partially overlapping an existing one");ir()}j.addToHistory&&bs(e,{from:t,to:l,origin:"markText"},e.sel,NaN);var q=t.line,ee=e.cm,se;if(e.iter(q,l.line+1,function(Fe){ee&&j.collapsed&&!ee.options.lineWrapping&&it(Fe)==ee.display.maxLine&&(se=!0),j.collapsed&&q!=t.line&&hi(Fe,0),Tn(Fe,new Fi(j,q==t.line?t.ch:null,q==l.line?l.ch:null)),++q}),j.collapsed&&e.iter(t.line,l.line+1,function(Fe){Gt(e,Fe)&&hi(Fe,0)}),j.clearOnEnter&&Ue(j,"beforeCursorEnter",function(){return j.clear()}),j.readOnly&&(wi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),j.collapsed&&(j.id=++js,j.atomic=!0),ee){if(se&&(ee.curOp.updateMaxLine=!0),j.collapsed)Zi(ee,t.line,l.line+1);else if(j.className||j.startStyle||j.endStyle||j.css||j.attributes||j.title)for(var Pe=t.line;Pe<=l.line;Pe++)rr(ee,Pe,"text");j.atomic&&Os(ee.doc),Rt(ee,"markerAdded",ee,j)}return j}var No=function(e,t){this.markers=e,this.primary=t;for(var l=0;l=0;ee--)yo(this,i[ee]);q?ws(this,q):this.cm&&_a(this.cm)}),undo:Er(function(){$o(this,"undo")}),redo:Er(function(){$o(this,"redo")}),undoSelection:Er(function(){$o(this,"undo",!0)}),redoSelection:Er(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,i=0;i=e.ch)&&t.push(g.marker.parent||g.marker)}return t},findMarks:function(e,t,l){e=S(this,e),t=S(this,t);var i=[],g=e.line;return this.iter(e.line,t.line+1,function(j){var $=j.markedSpans;if($)for(var q=0;q<$.length;q++){var ee=$[q];!(ee.to!=null&&g==e.line&&e.ch>=ee.to||ee.from==null&&g!=e.line||ee.from!=null&&g==t.line&&ee.from>=t.ch)&&(!l||l(ee.marker))&&i.push(ee.marker.parent||ee.marker)}++g}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var l=t.markedSpans;if(l)for(var i=0;ie)return t=e,!0;e-=j,++l}),S(this,cn(l,t))},indexFromPos:function(e){e=S(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Pe=e.dataTransfer.getData("Text");if(Pe){var Fe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Fe=t.listSelections()),Yo(t.doc,Xn(l,l)),Fe)for(var _t=0;_t=0;q--)bo(e.doc,"",i[q].from,i[q].to,"+delete");_a(e)})}function os(e,t,l){var i=Mt(e.text,t+l,l);return i<0||i>e.text.length?null:i}function ss(e,t,l){var i=os(e,t.ch,l);return i==null?null:new cn(t.line,i,l<0?"after":"before")}function ls(e,t,l,i,g){if(e){t.doc.direction=="rtl"&&(g=-g);var j=In(l,t.doc.direction);if(j){var $=g<0?nt(j):j[0],q=g<0==($.level==1),ee=q?"after":"before",se;if($.level>0||t.doc.direction=="rtl"){var Pe=Le(t,l);se=g<0?l.text.length-1:0;var Fe=at(t,Pe,se).top;se=An(function(_t){return at(t,Pe,_t).top==Fe},g<0==($.level==1)?$.from:$.to-1,se),ee=="before"&&(se=os(l,se,1))}else se=g<0?$.to:$.from;return new cn(i,se,ee)}}return new cn(i,g<0?l.text.length:0,g<0?"before":"after")}function kl(e,t,l,i){var g=In(t,e.doc.direction);if(!g)return ss(t,l,i);l.ch>=t.text.length?(l.ch=t.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var j=tt(g,l.ch,l.sticky),$=g[j];if(e.doc.direction=="ltr"&&$.level%2==0&&(i>0?$.to>l.ch:$.from=$.from&&_t>=Pe.begin)){var ut=Fe?"before":"after";return new cn(l.line,_t,ut)}}var en=function(Vn,Zn,Yn){for(var ii=function(fr,Hr){return Hr?new cn(l.line,q(fr,1),"before"):new cn(l.line,fr,"after")};Vn>=0&&Vn0==(Ci.level!=1),Ui=_i?Yn.begin:q(Yn.end,-1);if(Ci.from<=Ui&&Ui0?Pe.end:q(Pe.begin,-1);return Wn!=null&&!(i>0&&Wn==t.text.length)&&(xn=en(i>0?0:g.length-1,i,se(Wn)),xn)?xn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return Co(e,function(t){if(t.empty()){var l=Cn(e.doc,t.head.line).text.length;return t.head.ch==l&&t.head.line0)g=new cn(g.line,g.ch+1),e.replaceRange(j.charAt(g.ch-1)+j.charAt(g.ch-2),cn(g.line,g.ch-2),g,"+transpose");else if(g.line>e.doc.first){var $=Cn(e.doc,g.line-1).text;$&&(g=new cn(g.line,1),e.replaceRange(j.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),cn(g.line-1,$.length-1),g,"+transpose"))}}l.push(new Gi(g,g))}e.setSelections(l)})},newlineAndIndent:function(e){return Kr(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 i=0;ie&&ri(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(vt(t,e)||l.activeTouch&&l.input.supportsTouch())return;if(l.input.ensurePolled(),l.shift=e.shiftKey,gr(l,e)){k||(l.scroller.draggable=!1,setTimeout(function(){return l.scroller.draggable=!0},100));return}if(cs(t,e))return;var i=Rr(t,e),g=Be(e),j=i?Hl(i,g):"single";if(window.focus(),g==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,g,i,j,e))return;g==1?i?zl(t,i,j,e):me(e)==l.scroller&&ae(e):g==2?(i&&Vo(t.doc,i),setTimeout(function(){return l.input.focus()},20)):g==3&&(O?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,l,i,g){var j="Click";return i=="double"?j="Double"+j:i=="triple"&&(j="Triple"+j),j=(t==1?"Left":t==2?"Middle":"Right")+j,Bo(e,Gs(j,g),g,function($){if(typeof $=="string"&&($=Fo[$]),!$)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=$(e,l)!=Ye}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,l){var i=e.getOption("configureMouse"),g=i?i(e,t,l):{};if(g.unit==null){var j=n?l.shiftKey&&l.metaKey:l.altKey;g.unit=j?"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=a?l.metaKey:l.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(a?l.altKey:l.ctrlKey)),g}function zl(e,t,l,i){H?setTimeout(B(Ma,e),0):e.curOp.focus=U();var g=Kl(e,l,i),j=e.doc.sel,$;e.options.dragDrop&&Tt&&!e.isReadOnly()&&l=="single"&&($=j.contains(t))>-1&&(ri(($=j.ranges[$]).from(),t)<0||t.xRel>0)&&(ri($.to(),t)>0||t.xRel<0)?Gl(e,i,t,g):Vl(e,i,t,g)}function Gl(e,t,l,i){var g=e.display,j=!1,$=br(e,function(se){k&&(g.scroller.draggable=!1),e.state.draggingText=!1,Ct(g.wrapper.ownerDocument,"mouseup",$),Ct(g.wrapper.ownerDocument,"mousemove",q),Ct(g.scroller,"dragstart",ee),Ct(g.scroller,"drop",$),j||(ae(se),i.addNew||Vo(e.doc,l,null,null,i.extend),k&&!f||H&&P==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),q=function(se){j=j||Math.abs(t.clientX-se.clientX)+Math.abs(t.clientY-se.clientY)>=10},ee=function(){return j=!0};k&&(g.scroller.draggable=!0),e.state.draggingText=$,$.copy=!i.moveOnDrag,g.scroller.dragDrop&&g.scroller.dragDrop(),Ue(g.wrapper.ownerDocument,"mouseup",$),Ue(g.wrapper.ownerDocument,"mousemove",q),Ue(g.scroller,"dragstart",ee),Ue(g.scroller,"drop",$),no(e),setTimeout(function(){return g.input.focus()},20)}function tl(e,t,l){if(l=="char")return new Gi(t,t);if(l=="word")return e.findWordAt(t);if(l=="line")return new Gi(cn(t.line,0),S(e.doc,cn(t.line+1,0)));var i=l(e,t);return new Gi(i.from,i.to)}function Vl(e,t,l,i){var g=e.display,j=e.doc;ae(t);var $,q,ee=j.sel,se=ee.ranges;if(i.addNew&&!i.extend?(q=j.sel.contains(l),q>-1?$=se[q]:$=new Gi(l,l)):($=j.sel.primary(),q=j.sel.primIndex),i.unit=="rectangle")i.addNew||($=new Gi(l,l)),l=Rr(e,t,!0,!0),q=-1;else{var Pe=tl(e,l,i.unit);i.extend?$=rs($,Pe.anchor,Pe.head,i.extend):$=Pe}i.addNew?q==-1?(q=se.length,Yr(j,Si(e,se.concat([$]),q),{scroll:!1,origin:"*mouse"})):se.length>1&&se[q].empty()&&i.unit=="char"&&!i.extend?(Yr(j,Si(e,se.slice(0,q).concat(se.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),ee=j.sel):as(j,q,$,Ie):(q=0,Yr(j,new zr([$],0),Ie),ee=j.sel);var Fe=l;function _t(Yn){if(ri(Fe,Yn)==0)return;if(Fe=Yn,i.unit=="rectangle"){for(var ii=[],Ci=e.options.tabSize,_i=V(Cn(j,l.line).text,l.ch,Ci),Ui=V(Cn(j,Yn.line).text,Yn.ch,Ci),fr=Math.min(_i,Ui),Hr=Math.max(_i,Ui),Tr=Math.min(l.line,Yn.line),oa=Math.min(e.lastLine(),Math.max(l.line,Yn.line));Tr<=oa;Tr++){var na=Cn(j,Tr).text,kr=Ke(na,fr,Ci);fr==Hr?ii.push(new Gi(cn(Tr,kr),cn(Tr,kr))):na.length>kr&&ii.push(new Gi(cn(Tr,kr),cn(Tr,Ke(na,Hr,Ci))))}ii.length||ii.push(new Gi(l,l)),Yr(j,Si(e,ee.ranges.slice(0,q).concat(ii),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Yn)}else{var ia=$,Gr=tl(e,Yn,i.unit),Ur=ia.anchor,Ir;ri(Gr.anchor,Ur)>0?(Ir=Gr.head,Ur=nr(ia.from(),Gr.anchor)):(Ir=Gr.anchor,Ur=tr(ia.to(),Gr.head));var Or=ee.ranges.slice(0);Or[q]=Yl(e,new Gi(S(j,Ur),Ir)),Yr(j,Si(e,Or,q),Ie)}}var ut=g.wrapper.getBoundingClientRect(),en=0;function xn(Yn){var ii=++en,Ci=Rr(e,Yn,!0,i.unit=="rectangle");if(!Ci)return;if(ri(Ci,Fe)!=0){e.curOp.focus=U(),_t(Ci);var _i=ka(g,j);(Ci.line>=_i.to||Ci.line<_i.from)&&setTimeout(br(e,function(){en==ii&&xn(Yn)}),150)}else{var Ui=Yn.clientYut.bottom?20:0;Ui&&setTimeout(br(e,function(){if(en!=ii)return;g.scroller.scrollTop+=Ui,xn(Yn)}),50)}}function Wn(Yn){e.state.selectingText=!1,en=Infinity,Yn&&(ae(Yn),g.input.focus()),Ct(g.wrapper.ownerDocument,"mousemove",Vn),Ct(g.wrapper.ownerDocument,"mouseup",Zn),j.history.lastSelOrigin=null}var Vn=br(e,function(Yn){Yn.buttons===0||!Be(Yn)?Wn(Yn):xn(Yn)}),Zn=br(e,Wn);e.state.selectingText=Zn,Ue(g.wrapper.ownerDocument,"mousemove",Vn),Ue(g.wrapper.ownerDocument,"mouseup",Zn)}function Yl(e,t){var l=t.anchor,i=t.head,g=Cn(e.doc,l.line);if(ri(l,i)==0&&l.sticky==i.sticky)return t;var j=In(g);if(!j)return t;var $=tt(j,l.ch,l.sticky),q=j[$];if(q.from!=l.ch&&q.to!=l.ch)return t;var ee=$+(q.from==l.ch==(q.level!=1)?0:1);if(ee==0||ee==j.length)return t;var se;if(i.line!=l.line)se=(i.line-l.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Pe=tt(j,i.ch,i.sticky),Fe=Pe-$||(i.ch-l.ch)*(q.level==1?-1:1);Pe==ee-1||Pe==ee?se=Fe<0:se=Fe>0}var _t=j[ee+(se?-1:0)],ut=se==(_t.level==1),en=ut?_t.from:_t.to,xn=ut?"after":"before";return l.ch==en&&l.sticky==xn?t:new Gi(new cn(l.line,en,xn),i)}function nl(e,t,l,i){var g,j;if(t.touches)g=t.touches[0].clientX,j=t.touches[0].clientY;else try{g=t.clientX,j=t.clientY}catch(_t){return!1}if(g>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ae(t);var $=e.display,q=$.lineDiv.getBoundingClientRect();if(j>q.bottom||!ge(e,l))return he(t);j-=q.top-$.viewOffset;for(var ee=0;ee=g){var Pe=ji(e.doc,j),Fe=e.display.gutterSpecs[ee];return Ge(e,l,e,Pe,Fe.className,t),he(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(gr(e.display,t)||Xl(e,t))return;if(vt(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Xl(e,t){return ge(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-"),Ei(e)}var To={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function l(i,g,j,$){e.defaults[i]=g,j&&(t[i]=$?function(q,ee,se){se!=To&&j(q,ee,se)}:j)}e.defineOption=l,e.Init=To,l("value","",function(i,g){return i.setValue(g)},!0),l("mode",null,function(i,g){i.doc.modeOption=g,Mr(i)},!0),l("indentUnit",2,Mr,!0),l("indentWithTabs",!1),l("smartIndent",!0),l("tabSize",4,function(i){$r(i),Ei(i),Zi(i)},!0),l("lineSeparator",null,function(i,g){if(i.doc.lineSep=g,!g)return;var j=[],$=i.doc.first;i.doc.iter(function(ee){for(var se=0;;){var Pe=ee.text.indexOf(g,se);if(Pe==-1)break;se=Pe+g.length,j.push(cn($,Pe))}$++});for(var q=j.length-1;q>=0;q--)bo(i.doc,g,j[q],cn(j[q].line,j[q].ch+g.length))}),l("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,g,j){i.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),j!=To&&i.refresh()}),l("specialCharPlaceholder",Sn,function(i){return i.refresh()},!0),l("electricChars",!0),l("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),l("spellcheck",!1,function(i,g){return i.getInputField().spellcheck=g},!0),l("autocorrect",!1,function(i,g){return i.getInputField().autocorrect=g},!0),l("autocapitalize",!1,function(i,g){return i.getInputField().autocapitalize=g},!0),l("rtlMoveVisually",!R),l("wholeLineUpdateBefore",!0),l("theme","default",function(i){rl(i),da(i)},!0),l("keyMap","default",function(i,g,j){var $=Jo(g),q=j!=To&&Jo(j);q&&q.detach&&q.detach(i,$),$.attach&&$.attach(i,q||null)}),l("extraKeys",null),l("configureMouse",null),l("lineWrapping",!1,Jl,!0),l("gutters",[],function(i,g){i.display.gutterSpecs=Br(g,i.options.lineNumbers),da(i)},!0),l("fixedGutter",!0,function(i,g){i.display.gutters.style.left=g?_r(i.display)+"px":"0",i.refresh()},!0),l("coverGutterNextToScrollbar",!1,function(i){return ma(i)},!0),l("scrollbarStyle","native",function(i){Qa(i),ma(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),l("lineNumbers",!1,function(i,g){i.display.gutterSpecs=Br(i.options.gutters,g),da(i)},!0),l("firstLineNumber",1,da,!0),l("lineNumberFormatter",function(i){return i},da,!0),l("showCursorWhenSelecting",!1,qi,!0),l("resetSelectionOnContextMenu",!0),l("lineWiseCopyCut",!0),l("pasteLinesPerSelection",!0),l("selectionsMayTouch",!1),l("readOnly",!1,function(i,g){g=="nocursor"&&(Ta(i),i.display.input.blur()),i.display.input.readOnlyChanged(g)}),l("screenReaderLabel",null,function(i,g){g=g===""?null:g,i.display.input.screenReaderLabelChanged(g)}),l("disableInput",!1,function(i,g){g||i.display.input.reset()},!0),l("dragDrop",!0,Ql),l("allowDropFileTypes",null),l("cursorBlinkRate",530),l("cursorScrollMargin",0),l("cursorHeight",1,qi,!0),l("singleCursorHeightPerLine",!0,qi,!0),l("workTime",100),l("workDelay",100),l("flattenSpans",!0,$r,!0),l("addModeClass",!1,$r,!0),l("pollInterval",100),l("undoDepth",200,function(i,g){return i.doc.history.undoDepth=g}),l("historyEventDelay",1250),l("viewportMargin",10,function(i){return i.refresh()},!0),l("maxHighlightLength",1e4,$r,!0),l("moveInputWithCursor",!0,function(i,g){g||i.display.input.resetPosition()}),l("tabindex",null,function(i,g){return i.display.input.getField().tabIndex=g||""}),l("autofocus",null),l("direction","ltr",function(i,g){return i.doc.setDirection(g)},!0),l("phrases",null)}function Ql(e,t,l){var i=l&&l!=To;if(!t!=!i){var g=e.display.dragFunctions,j=t?Ue:Ct;j(e.display.scroller,"dragstart",g.start),j(e.display.scroller,"dragenter",g.enter),j(e.display.scroller,"dragover",g.over),j(e.display.scroller,"dragleave",g.leave),j(e.display.scroller,"drop",g.drop)}}function Jl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),wn(e)),jr(e),Zi(e),Ei(e),setTimeout(function(){return ma(e)},100)}function xr(e,t){var l=this;if(!(this instanceof xr))return new xr(e,t);this.options=t=t?T(t):{},T(al,t,!1);var i=t.value;typeof i=="string"?i=new ta(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var g=new xr.inputStyles[t.inputStyle](this),j=this.display=new ja(e,i,g,t);j.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Qa(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Z,keySeq:null,specialChars:null},t.autofocus&&!o&&j.input.focus(),H&&P<11&&setTimeout(function(){return l.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,vs(this,i),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){l.hasFocus()&&!l.state.focused&&la(l)},20):Ta(this);for(var $ in qo)qo.hasOwnProperty($)&&qo[$](this,t[$],To);mr(this),t.finishInit&&t.finishInit(this);for(var q=0;q20*20}Ue(t.scroller,"touchstart",function(ee){if(!vt(e,ee)&&!j(ee)&&!cs(e,ee)){t.input.ensurePolled(),clearTimeout(l);var se=+new Date;t.activeTouch={start:se,moved:!1,prev:se-i.end<=300?i:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ue(t.scroller,"touchend",function(ee){var se=t.activeTouch;if(se&&!gr(t,ee)&&se.left!=null&&!se.moved&&new Date-se.start<300){var Pe=e.coordsChar(t.activeTouch,"page"),Fe;!se.prev||$(se,se.prev)?Fe=new Gi(Pe,Pe):!se.prev.prev||$(se,se.prev.prev)?Fe=e.findWordAt(Pe):Fe=new Gi(cn(Pe.line,0),S(e.doc,cn(Pe.line+1,0))),e.setSelection(Fe.anchor,Fe.head),e.focus(),ae(ee)}g()}),Ue(t.scroller,"touchcancel",g),Ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),Nr(e,t.scroller.scrollLeft,!0),Ge(e,"scroll",e))}),Ue(t.scroller,"mousewheel",function(ee){return Ha(e,ee)}),Ue(t.scroller,"DOMMouseScroll",function(ee){return Ha(e,ee)}),Ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){vt(e,ee)||ve(ee)},over:function(ee){vt(e,ee)||(Rl(e,ee),ve(ee))},start:function(ee){return Ol(e,ee)},drop:br(e,Sl),leave:function(ee){vt(e,ee)||Hs(e)}};var q=t.input.getField();Ue(q,"keyup",function(ee){return Zs.call(e,ee)}),Ue(q,"keydown",br(e,Js)),Ue(q,"keypress",br(e,qs)),Ue(q,"focus",function(ee){return la(e,ee)}),Ue(q,"blur",function(ee){return Ta(e,ee)})}var hs=[];xr.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,l,i){var g=e.doc,j;l==null&&(l="add"),l=="smart"&&(g.mode.indent?j=kn(e,t).state:l="prev");var $=e.options.tabSize,q=Cn(g,t),ee=V(q.text,null,$);q.stateAfter&&(q.stateAfter=null);var se=q.text.match(/^\s*/)[0],Pe;if(!i&&!/\S/.test(q.text))Pe=0,l="not";else if(l=="smart"&&(Pe=g.mode.indent(j,q.text.slice(se.length),q.text),Pe==Ye||Pe>150)){if(!i)return;l="prev"}l=="prev"?t>g.first?Pe=V(Cn(g,t-1).text,null,$):Pe=0:l=="add"?Pe=ee+e.options.indentUnit:l=="subtract"?Pe=ee-e.options.indentUnit:typeof l=="number"&&(Pe=ee+l),Pe=Math.max(0,Pe);var Fe="",_t=0;if(e.options.indentWithTabs)for(var ut=Math.floor(Pe/$);ut;--ut)_t+=$,Fe+=" ";if(_t$,ee=gt(t),se=null;if(q&&i.ranges.length>1)if(Ca&&Ca.text.join(` `)==t){if(i.ranges.length%Ca.text.length==0){se=[];for(var Pe=0;Pe=0;_t--){var ut=i.ranges[_t],en=ut.from(),xn=ut.to();ut.empty()&&(l&&l>0?en=cn(en.line,en.ch-l):e.state.overwrite&&!q?xn=cn(xn.line,Math.min(Cn(j,xn.line).text.length,xn.ch+nt(ee).length)):q&&Ca&&Ca.lineWise&&Ca.text.join(` `)==ee.join(` `)&&(en=xn=cn(en.line,0)));var Wn={from:en,to:xn,text:se?se[_t%se.length]:ee,origin:g||(q?"paste":e.state.cutIncoming>$?"cut":"+input")};yo(e.doc,Wn),Rt(e,"inputRead",e,Wn)}t&&!q&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Fe),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&&Kr(t,function(){return fs(t,l,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var l=e.doc.sel,i=l.ranges.length-1;i>=0;i--){var g=l.ranges[i];if(g.head.ch>100||i&&l.ranges[i-1].head.line==g.head.line)continue;var j=e.getModeAt(g.head),$=!1;if(j.electricChars){for(var q=0;q-1){$=Ko(e,g.head.line,"smart");break}}else j.electricInput&&(j.electricInput.test(Cn(e.doc,g.head.line).text.slice(0,g.head.ch))&&($=Ko(e,g.head.line,"smart")));$&&Rt(e,"electricInput",e,g.head.line)}}function ll(e){for(var t=[],l=[],i=0;ij&&(Ko(this,q.head.line,i,!0),j=q.head.line,$==this.doc.sel.primIndex&&_a(this));else{var ee=q.from(),se=q.to(),Pe=Math.max(j,ee.line);j=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var Fe=Pe;Fe0&&as(this.doc,$,new Gi(ee,_t[$].to()),xe)}}}),getTokenAt:function(i,g){return Li(this,i,g)},getLineTokens:function(i,g){return Li(this,cn(i),g,!0)},getTokenTypeAt:function(i){i=S(this.doc,i);var g=Vt(this,Cn(this.doc,i.line)),j=0,$=(g.length-1)/2,q=i.ch,ee;if(q==0)ee=g[2];else for(;;){var se=j+$>>1;if((se?g[se*2-1]:0)>=q)$=se;else if(g[se*2+1]ee&&(i=ee,$=!0),q=Cn(this.doc,i)}else q=i;return Di(this,q,{top:0,left:0},g||"page",j||$).top+($?this.doc.height-Dn(q):0)},defaultTextHeight:function(){return Hi(this.display)},defaultCharWidth:function(){return Bi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,g,j,$,q){var ee=this.display;i=yn(this,S(this.doc,i));var se=i.bottom,Pe=i.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),ee.sizer.appendChild(g),$=="over")se=i.top;else if($=="above"||$=="near"){var Fe=Math.max(ee.wrapper.clientHeight,this.doc.height),_t=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);($=="above"||i.bottom+g.offsetHeight>Fe)&&i.top>g.offsetHeight?se=i.top-g.offsetHeight:i.bottom+g.offsetHeight<=Fe&&(se=i.bottom),Pe+g.offsetWidth>_t&&(Pe=_t-g.offsetWidth)}g.style.top=se+"px",g.style.left=g.style.right="",q=="right"?(Pe=ee.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(q=="left"?Pe=0:q=="middle"&&(Pe=(ee.sizer.clientWidth-g.offsetWidth)/2),g.style.left=Pe+"px"),j&&Ga(this,{left:Pe,top:se,right:Pe+g.offsetWidth,bottom:se+g.offsetHeight})},triggerOnKeyDown:Lr(Js),triggerOnKeyPress:Lr(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Lr(el),execCommand:function(i){if(Fo.hasOwnProperty(i))return Fo[i].call(null,this)},triggerElectric:Lr(function(i){sl(this,i)}),findPosH:function(i,g,j,$){var q=1;g<0&&(q=-1,g=-g);for(var ee=S(this.doc,i),se=0;se0&&Pe(j.charAt($-1));)--$;for(;q.5||this.options.lineWrapping)&&jr(this),Ge(this,"refresh",this)}),swapDoc:Lr(function(i){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,i),Ei(this),this.display.input.reset(),Ra(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Rt(this,"swapDoc",this,g),g}),phrase:function(i){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,i)?g[i]:i},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}},Ee(e),e.registerHelper=function(i,g,j){l.hasOwnProperty(i)||(l[i]=e[i]={_global:[]}),l[i][g]=j},e.registerGlobalHelper=function(i,g,j,$){e.registerHelper(i,g,$),l[i]._global.push({pred:j,val:$})}}function ps(e,t,l,i,g){var j=t,$=l,q=Cn(e,t.line),ee=g&&e.direction=="rtl"?-l:l;function se(){var Zn=t.line+ee;return Zn=e.first+e.size?!1:(t=new cn(Zn,t.ch,t.sticky),q=Cn(e,Zn))}function Pe(Zn){var Yn;if(i=="codepoint"){var ii=q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(ii)?Yn=null:Yn=new cn(t.line,Math.max(0,Math.min(q.text.length,t.ch+l*(ii>=55296&&ii<56320?2:1))),-l)}else g?Yn=kl(e.cm,q,t,l):Yn=ss(q,t,l);if(Yn==null)if(!Zn&&se())t=ls(g,e.cm,q,t.line,ee);else return!1;else t=Yn;return!0}if(i=="char"||i=="codepoint")Pe();else if(i=="column")Pe(!0);else if(i=="word"||i=="group")for(var Fe=null,_t=i=="group",ut=e.cm&&e.cm.getHelper(t,"wordChars"),en=!0;!(l<0&&!Pe(!en));en=!1){var xn=q.text.charAt(t.ch)||` `,Wn=Nt(xn,ut)?"w":_t&&xn==` `?"n":!_t||/\s/.test(xn)?null:"p";if(_t&&!en&&!Wn&&(Wn="s"),Fe&&Fe!=Wn){l<0&&(l=1,Pe(),t.sticky="after");break}if(Wn&&(Fe=Wn),l>0&&!Pe(!en))break}var Vn=Xo(e,t,j,$,!0);return pr(j,Vn)&&(Vn.hitSide=!0),Vn}function cl(e,t,l,i){var g=e.doc,j=t.left,$;if(i=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(q-.5*Hi(e.display),3);$=(l>0?t.bottom:t.top)+l*ee}else i=="line"&&($=l>0?t.bottom+3:t.top-3);for(var se;!(se=pi(e,j,$),!se.outside);){if(l<0?$<=0:$>=g.height){se.hitSide=!0;break}$+=l*5}return se}var cr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};cr.prototype.init=function(e){var t=this,l=this,i=l.cm,g=l.div=e.lineDiv;ul(g,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function j(q){for(var ee=q.target;ee;ee=ee.parentNode){if(ee==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Ue(g,"paste",function(q){if(!j(q)||vt(i,q)||ol(q,i))return;P<=11&&setTimeout(br(i,function(){return t.updateFromDOM()}),20)}),Ue(g,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Ue(g,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Ue(g,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ue(g,"touchstart",function(){return l.forceCompositionEnd()}),Ue(g,"input",function(){t.composing||t.readFromDOMSoon()});function $(q){if(!j(q)||vt(i,q))return;if(i.somethingSelected())es({lineWise:!1,text:i.getSelections()}),q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var ee=ll(i);es({lineWise:!0,text:ee.text}),q.type=="cut"&&i.operation(function(){i.setSelections(ee.ranges,0,xe),i.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var se=Ca.text.join(` `);if(q.clipboardData.setData("Text",se),q.clipboardData.getData("Text")==se){q.preventDefault();return}}var Pe=dl(),Fe=Pe.firstChild;i.display.lineSpace.insertBefore(Pe,i.display.lineSpace.firstChild),Fe.value=Ca.text.join(` `);var _t=document.activeElement;G(Fe),setTimeout(function(){i.display.lineSpace.removeChild(Pe),_t.focus(),_t==g&&l.showPrimarySelection()},50)}Ue(g,"copy",$),Ue(g,"cut",$)},cr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},cr.prototype.prepareSelection=function(){var e=Zr(this.cm,!1);return e.focus=document.activeElement==this.div,e},cr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},cr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},cr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,l=t.doc.sel.primary(),i=l.from(),g=l.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||g.line=t.display.viewFrom&&hl(t,i)||{node:q[0].measure.map[2],offset:0},se=g.linee.firstLine()&&(i=cn(i.line-1,Cn(e.doc,i.line-1).length)),g.ch==Cn(e.doc,g.line).text.length&&g.linet.viewTo-1)return!1;var j,$,q;i.line==t.viewFrom||(j=ur(e,i.line))==0?($=fi(t.view[0].line),q=t.view[0].node):($=fi(t.view[j].line),q=t.view[j-1].node.nextSibling);var ee=ur(e,g.line),se,Pe;if(ee==t.view.length-1?(se=t.viewTo-1,Pe=t.lineDiv.lastChild):(se=fi(t.view[ee+1].line)-1,Pe=t.view[ee+1].node.previousSibling),!q)return!1;for(var Fe=e.doc.splitLines(tu(e,q,Pe,$,se)),_t=Ti(e.doc,cn($,0),cn(se,Cn(e.doc,se).text.length));Fe.length>1&&_t.length>1;)if(nt(Fe)==nt(_t))Fe.pop(),_t.pop(),se--;else if(Fe[0]==_t[0])Fe.shift(),_t.shift(),$++;else break;for(var ut=0,en=0,xn=Fe[0],Wn=_t[0],Vn=Math.min(xn.length,Wn.length);uti.ch&&Zn.charCodeAt(Zn.length-en-1)==Yn.charCodeAt(Yn.length-en-1);)ut--,en++;Fe[Fe.length-1]=Zn.slice(0,Zn.length-en).replace(/^\u200b+/,""),Fe[0]=Fe[0].slice(ut).replace(/\u200b+$/,"");var Ci=cn($,ut),_i=cn(se,_t.length?nt(_t).length-en:0);if(Fe.length>1||Fe[0]||ri(Ci,_i))return bo(e.doc,Fe,Ci,_i,"+input"),!0},cr.prototype.ensurePolled=function(){this.forceCompositionEnd()},cr.prototype.reset=function(){this.forceCompositionEnd()},cr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},cr.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)},cr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Kr(this.cm,function(){return Zi(e.cm)})},cr.prototype.setUneditable=function(e){e.contentEditable="false"},cr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||br(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},cr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},cr.prototype.onContextMenu=function(){},cr.prototype.resetPosition=function(){},cr.prototype.needsContentAttribute=!0;function hl(e,t){var l=$e(e,t.line);if(!l||l.hidden)return null;var i=Cn(e.doc,t.line),g=le(l,i,t.line),j=In(i,e.doc.direction),$="left";if(j){var q=tt(j,t.ch);$=q%2?"right":"left"}var ee=qt(g.map,t.ch,$);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function wo(e,t){return t&&(e.bad=!0),e}function tu(e,t,l,i,g){var j="",$=!1,q=e.doc.lineSeparator(),ee=!1;function se(ut){return function(en){return en.id==ut}}function Pe(){$&&(j+=q,ee&&(j+=q),$=ee=!1)}function Fe(ut){ut&&(Pe(),j+=ut)}function _t(ut){if(ut.nodeType==1){var en=ut.getAttribute("cm-text");if(en){Fe(en);return}var xn=ut.getAttribute("cm-marker"),Wn;if(xn){var Vn=e.findMarks(cn(i,0),cn(g+1,0),se(+xn));Vn.length&&(Wn=Vn[0].find(0))&&Fe(Ti(e.doc,Wn.from,Wn.to).join(q));return}if(ut.getAttribute("contenteditable")=="false")return;var Zn=/^(pre|div|p|li|table|br)$/i.test(ut.nodeName);if(!/^br$/i.test(ut.nodeName)&&ut.textContent.length==0)return;Zn&&Pe();for(var Yn=0;Yn=9&&t.hasSelection&&(t.hasSelection=null),l.poll()}),Ue(g,"paste",function($){if(vt(i,$)||ol($,i))return;i.state.pasteIncoming=+new Date,l.fastPoll()});function j($){if(vt(i,$))return;if(i.somethingSelected())es({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var q=ll(i);es({lineWise:!0,text:q.text}),$.type=="cut"?i.setSelections(q.ranges,null,xe):(l.prevInput="",g.value=q.text.join(` `),G(g))}else return;$.type=="cut"&&(i.state.cutIncoming=+new Date)}Ue(g,"cut",j),Ue(g,"copy",j),Ue(e.scroller,"paste",function($){if(gr(e,$)||vt(i,$))return;if(!g.dispatchEvent){i.state.pasteIncoming=+new Date,l.focus();return}var q=new Event("paste");q.clipboardData=$.clipboardData,g.dispatchEvent(q)}),Ue(e.lineSpace,"selectstart",function($){gr(e,$)||ae($)}),Ue(g,"compositionstart",function(){var $=i.getCursor("from");l.composing&&l.composing.range.clear(),l.composing={start:$,range:i.markText($,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ue(g,"compositionend",function(){l.composing&&(l.poll(),l.composing.range.clear(),l.composing=null)})},Dr.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},Dr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Dr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,l=e.doc,i=Zr(e);if(e.options.moveInputWithCursor){var g=yn(e,l.sel.primary().head,"div"),j=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,g.top+$.top-j.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,g.left+$.left-j.left))}return i},Dr.prototype.showSelection=function(e){var t=this.cm,l=t.display;h(l.cursorDiv,e.cursors),h(l.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Dr.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&&G(this.textarea),H&&P>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",H&&P>=9&&(this.hasSelection=null))},Dr.prototype.getField=function(){return this.textarea},Dr.prototype.supportsTouch=function(){return!1},Dr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},Dr.prototype.blur=function(){this.textarea.blur()},Dr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Dr.prototype.receivedFocus=function(){this.slowPoll()},Dr.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()})},Dr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function l(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,l)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,l)},Dr.prototype.poll=function(){var e=this,t=this.cm,l=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||yt(l)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var g=l.value;if(g==i&&!t.somethingSelected())return!1;if(H&&P>=9&&this.hasSelection===g||a&&/[\uf700-\uf7ff]/.test(g))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var j=g.charCodeAt(0);if(j==8203&&!i&&(i="\u200B"),j==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,q=Math.min(i.length,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},Dr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Dr.prototype.onKeyPress=function(){H&&P>=9&&(this.hasSelection=null),this.fastPoll()},Dr.prototype.onContextMenu=function(e){var t=this,l=t.cm,i=l.display,g=t.textarea;t.contextMenuPending&&t.contextMenuPending();var j=Rr(l,e),$=i.scroller.scrollTop;if(!j||m)return;var q=l.options.resetSelectionOnContextMenu;q&&l.doc.sel.contains(j)==-1&&br(l,Yr)(l.doc,Xn(j),xe);var ee=g.style.cssText,se=t.wrapper.style.cssText,Pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Pe.top-5)+"px; left: "+(e.clientX-Pe.left-5)+`px; z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Fe;k&&(Fe=window.scrollY),i.input.focus(),k&&window.scrollTo(null,Fe),i.input.reset(),l.somethingSelected()||(g.value=t.prevInput=" "),t.contextMenuPending=ut,i.selForContextMenu=l.doc.sel,clearTimeout(i.detectingSelectAll);function _t(){if(g.selectionStart!=null){var xn=l.somethingSelected(),Wn="\u200B"+(xn?g.value:"");g.value="\u21DA",g.value=Wn,t.prevInput=xn?"":"\u200B",g.selectionStart=1,g.selectionEnd=Wn.length,i.selForContextMenu=l.doc.sel}}function ut(){if(t.contextMenuPending!=ut)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=se,g.style.cssText=ee,H&&P<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=$),g.selectionStart!=null){(!H||H&&P<9)&&_t();var xn=0,Wn=function(){i.selForContextMenu==l.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&t.prevInput=="\u200B"?br(l,Ds)(l):xn++<10?i.detectingSelectAll=setTimeout(Wn,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Wn,200)}}if(H&&P>=9&&_t(),O){ve(e);var en=function(){Ct(window,"mouseup",en),setTimeout(ut,20)};Ue(window,"mouseup",en)}else setTimeout(ut,50)},Dr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Dr.prototype.setUneditable=function(){},Dr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?T(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=U();t.autofocus=l==e||e.getAttribute("autofocus")!=null&&l==document.body}function i(){e.value=q.getValue()}var g;if(e.form&&(Ue(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var j=e.form;g=j.submit;try{var $=j.submit=function(){i(),j.submit=g,j.submit(),j.submit=$}}catch(ee){}}t.finishInit=function(ee){ee.save=i,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,i(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(Ct(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=g))}},e.style.display="none";var q=xr(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return q}function ru(e){e.off=Ct,e.on=Ue,e.wheelEventPixels=Ba,e.Doc=ta,e.splitLines=gt,e.countColumn=V,e.findColumn=Ke,e.isWordChar=dt,e.Pass=Ye,e.signal=Ge,e.Line=Nn,e.changeEnd=ui,e.scrollbarModel=$a,e.Pos=cn,e.cmpPos=ri,e.modes=At,e.mimeModes=ot,e.resolveMode=_e,e.getMode=Ne,e.modeExtensions=xt,e.extendMode=Xt,e.copyState=vn,e.startState=ci,e.innerMode=Mn,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=$n,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ae,e.e_stopPropagation=re,e.e_stop=ve,e.addClass=F,e.contains=E,e.rmClass=_,e.keyNames=eo}$l(xr),ql(xr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ta.prototype)ta.prototype.hasOwnProperty(ns)&&oe(au,ns)<0&&(xr.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ta.prototype[ns]));return Ee(ta),xr.inputStyles={textarea:Dr,contenteditable:cr},xr.defineMode=function(e){!xr.defaults.mode&&e!="null"&&(xr.defaults.mode=e),Yt.apply(this,arguments)},xr.defineMIME=rn,xr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xr.defineMIME("text/plain","null"),xr.defineExtension=function(e,t){xr.prototype[e]=t},xr.defineDocExtension=function(e,t){ta.prototype[e]=t},xr.fromTextArea=iu,ru(xr),xr.version="5.58.2",xr})},WaYH:function(tn,Qe,I){"use strict";var te=I("rePB"),Y=I("Ff2n"),N=I("VTBJ"),K=I("1OyB"),A=I("vuIU"),M=I("JX7q"),H=I("Ji7U"),P=I("LK+K"),k=I("q1tI"),D=I("TSYQ"),b=I.n(D),m=I("sboe"),f=I("OZM5"),d=function(O){var C=O.prefixCls,_=O.level,y=O.isStart,h=O.isEnd;if(!_)return null;for(var c="".concat(C,"-indent-unit"),v=[],p=0;p<_;p+=1){var E;v.push(k.createElement("span",{key:p,className:b()(c,(E={},Object(te.a)(E,"".concat(c,"-start"),y[p+1]),Object(te.a)(E,"".concat(c,"-end"),h[p+1]),Object(te.a)(E,"".concat(c,"-end-first-level"),!p&&h[0]),E))}))}return k.createElement("span",{"aria-hidden":"true",className:"".concat(C,"-indent")},v)},s=d,r=I("815F"),u="open",o="close",a="---",n=function(x){Object(H.a)(C,x);var O=Object(P.a)(C);function C(){var _;return Object(K.a)(this,C),_=O.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(y){var h=_.props.context.onNodeClick;h(y,Object(r.b)(_.props)),_.isSelectable()?_.onSelect(y):_.onCheck(y)},_.onSelectorDoubleClick=function(y){var h=_.props.context.onNodeDoubleClick;h(y,Object(r.b)(_.props))},_.onSelect=function(y){if(_.isDisabled())return;var h=_.props.context.onNodeSelect;y.preventDefault(),h(y,Object(r.b)(_.props))},_.onCheck=function(y){if(_.isDisabled())return;var h=_.props,c=h.disableCheckbox,v=h.checked,p=_.props.context.onNodeCheck;if(!_.isCheckable()||c)return;y.preventDefault();var E=!v;p(y,Object(r.b)(_.props),E)},_.onMouseEnter=function(y){var h=_.props.context.onNodeMouseEnter;h(y,Object(r.b)(_.props))},_.onMouseLeave=function(y){var h=_.props.context.onNodeMouseLeave;h(y,Object(r.b)(_.props))},_.onContextMenu=function(y){var h=_.props.context.onNodeContextMenu;h(y,Object(r.b)(_.props))},_.onDragStart=function(y){var h=_.props.context.onNodeDragStart;y.stopPropagation(),_.setState({dragNodeHighlight:!0}),h(y,Object(M.a)(_));try{y.dataTransfer.setData("text/plain","")}catch(c){}},_.onDragEnter=function(y){var h=_.props.context.onNodeDragEnter;y.preventDefault(),y.stopPropagation(),h(y,Object(M.a)(_))},_.onDragOver=function(y){var h=_.props.context.onNodeDragOver;y.preventDefault(),y.stopPropagation(),h(y,Object(M.a)(_))},_.onDragLeave=function(y){var h=_.props.context.onNodeDragLeave;y.stopPropagation(),h(y,Object(M.a)(_))},_.onDragEnd=function(y){var h=_.props.context.onNodeDragEnd;y.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(y,Object(M.a)(_))},_.onDrop=function(y){var h=_.props.context.onNodeDrop;y.preventDefault(),y.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(y,Object(M.a)(_))},_.onExpand=function(y){var h=_.props.context.onNodeExpand;h(y,Object(r.b)(_.props))},_.setSelectHandle=function(y){_.selectHandle=y},_.getNodeState=function(){var y=_.props.expanded;return _.isLeaf()?null:y?u:o},_.hasChildren=function(){var y=_.props.eventKey,h=_.props.context.keyEntities,c=h[y]||{},v=c.children;return!!(v||[]).length},_.isLeaf=function(){var y=_.props,h=y.isLeaf,c=y.loaded,v=_.props.context.loadData,p=_.hasChildren();return h===!1?!1:h||!v&&!p||v&&c&&!p},_.isDisabled=function(){var y=_.props.disabled,h=_.props.context.disabled;return!!(h||y)},_.isCheckable=function(){var y=_.props.checkable,h=_.props.context.checkable;return!h||y===!1?!1:h},_.syncLoadData=function(y){var h=y.expanded,c=y.loading,v=y.loaded,p=_.props.context,E=p.loadData,U=p.onNodeLoad;if(c)return;E&&h&&!_.isLeaf()&&(!_.hasChildren()&&!v&&U(Object(r.b)(_.props)))},_.renderSwitcher=function(){var y=_.props,h=y.expanded,c=y.switcherIcon,v=_.props.context,p=v.prefixCls,E=v.switcherIcon,U=c||E;if(_.isLeaf())return k.createElement("span",{className:b()("".concat(p,"-switcher"),"".concat(p,"-switcher-noop"))},typeof U=="function"?U(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!0})):U);var F=b()("".concat(p,"-switcher"),"".concat(p,"-switcher_").concat(h?u:o));return k.createElement("span",{onClick:_.onExpand,className:F},typeof U=="function"?U(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!1})):U)},_.renderCheckbox=function(){var y=_.props,h=y.checked,c=y.halfChecked,v=y.disableCheckbox,p=_.props.context.prefixCls,E=_.isDisabled(),U=_.isCheckable();if(!U)return null;var F=typeof U!="boolean"?U:null;return k.createElement("span",{className:b()("".concat(p,"-checkbox"),h&&"".concat(p,"-checkbox-checked"),!h&&c&&"".concat(p,"-checkbox-indeterminate"),(E||v)&&"".concat(p,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var y=_.props.loading,h=_.props.context.prefixCls;return k.createElement("span",{className:b()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(_.getNodeState()||"docu"),y&&"".concat(h,"-icon_loading"))})},_.renderSelector=function(){var y=_.state.dragNodeHighlight,h=_.props,c=h.title,v=h.selected,p=h.icon,E=h.loading,U=h.data,F=_.props.context,z=F.prefixCls,G=F.showIcon,B=F.icon,T=F.draggable,V=F.loadData,Z=F.titleRender,oe=_.isDisabled(),pe="".concat(z,"-node-content-wrapper"),Ye;if(G){var xe=p||B;Ye=xe?k.createElement("span",{className:b()("".concat(z,"-iconEle"),"".concat(z,"-icon__customize"))},typeof xe=="function"?xe(_.props):xe):_.renderIcon()}else V&&E&&(Ye=_.renderIcon());var Ie;typeof c=="function"?Ie=c(U):Z?Ie=Z(U):Ie=c;var Je=k.createElement("span",{className:"".concat(z,"-title")},Ie);return k.createElement("span",{ref:_.setSelectHandle,title:typeof c=="string"?c:"",className:b()("".concat(pe),"".concat(pe,"-").concat(_.getNodeState()||"normal"),!oe&&(v||y)&&"".concat(z,"-node-selected"),!oe&&T&&"draggable"),draggable:!oe&&T||void 0,"aria-grabbed":!oe&&T||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:T?_.onDragStart:void 0},Ye,Je)},_}return Object(A.a)(C,[{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,h=this.props.context.selectable;return typeof y=="boolean"?y:h}},{key:"render",value:function(){var y,h=this.props,c=h.eventKey,v=h.className,p=h.style,E=h.dragOver,U=h.dragOverGapTop,F=h.dragOverGapBottom,z=h.isLeaf,G=h.isStart,B=h.isEnd,T=h.expanded,V=h.selected,Z=h.checked,oe=h.halfChecked,pe=h.loading,Ye=h.domRef,xe=h.active,Ie=h.onMouseMove,Je=Object(Y.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ke=this.props.context,be=Ke.prefixCls,de=Ke.filterTreeNode,nt=Ke.draggable,Kt=Ke.keyEntities,jt=this.isDisabled(),wt=Object(f.f)(Je),ze=Kt[c]||{},ft=ze.level,dt=B[B.length-1];return k.createElement("div",Object.assign({ref:Ye,className:b()(v,"".concat(be,"-treenode"),(y={},Object(te.a)(y,"".concat(be,"-treenode-disabled"),jt),Object(te.a)(y,"".concat(be,"-treenode-switcher-").concat(T?"open":"close"),!z),Object(te.a)(y,"".concat(be,"-treenode-checkbox-checked"),Z),Object(te.a)(y,"".concat(be,"-treenode-checkbox-indeterminate"),oe),Object(te.a)(y,"".concat(be,"-treenode-selected"),V),Object(te.a)(y,"".concat(be,"-treenode-loading"),pe),Object(te.a)(y,"".concat(be,"-treenode-active"),xe),Object(te.a)(y,"".concat(be,"-treenode-leaf-last"),dt),Object(te.a)(y,"drag-over",!jt&&E),Object(te.a)(y,"drag-over-gap-top",!jt&&U),Object(te.a)(y,"drag-over-gap-bottom",!jt&&F),Object(te.a)(y,"filter-node",de&&de(Object(r.b)(this.props))),y)),style:p,onDragEnter:nt?this.onDragEnter:void 0,onDragOver:nt?this.onDragOver:void 0,onDragLeave:nt?this.onDragLeave:void 0,onDrop:nt?this.onDrop:void 0,onDragEnd:nt?this.onDragEnd:void 0,onMouseMove:Ie},wt),k.createElement(s,{prefixCls:be,level:ft,isStart:G,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),C}(k.Component),R=function(O){return k.createElement(m.a.Consumer,null,function(C){return k.createElement(n,Object.assign({},O,{context:C}))})};R.displayName="TreeNode",R.defaultProps={title:a},R.isTreeNode=1;var w=Qe.a=R},XpUO:function(tn,Qe,I){"use strict";var te=I("2qtc"),Y=I("kLXV"),N=I("sRBo"),K=I("kaz8"),A=I("jCWc"),M=I("kPKH"),H=I("iQDF"),P=I("+eQT"),k=I("giR+"),D=I("fyUT"),b=I("14J3"),m=I("BMrR"),f=I("7Kak"),d=I("9yH6"),s=I("miYZ"),r=I("tsqr"),u=I("jrin"),o=I("9og8"),a=I("k1fw"),n=I("oBTY"),R=I("y8nQ"),w=I("Vl3Y"),x=I("tJVT"),O=I("PpiC"),C=I("WmNS"),_=I.n(C),y=I("q1tI"),h=I.n(y),c=I("wd/R"),v=I.n(c),p=I("ErOA"),E=I("xKgJ"),U=I("1vsH"),F=I("Ty5D"),z=I("9kvl"),G=I("4wi7"),B=I("oUNq"),T=I("eozf"),V=function(oe){var pe,Ye,xe,Ie,Je,Ke,be,de,nt,Kt,jt,wt,ze,ft,dt,Nt,Ze,Bt,Ut,Mt,An,mn,pn,tt,fn,In,He,Ue,pt,Ct,Ge,vt,Ae,ge,Ee,ae,re,he,ve,me=oe.classroomList,Be=oe.dispatch,Tt=oe.courseEndTime,Jt=Object(O.a)(oe,["classroomList","dispatch","courseEndTime"]),En=Object(F.i)(),mt=w.a.useForm(),Qt=Object(x.a)(mt,1),gt=Qt[0],yt=Object(y.useState)(1),rt=Object(x.a)(yt,2),ce=rt[0],Re=rt[1],At=Object(y.useState)([]),ot=Object(x.a)(At,2),Yt=ot[0],rn=ot[1],_e=Object(y.useState)(0),Ne=Object(x.a)(_e,2),xt=Ne[0],Xt=Ne[1],vn=Object(y.useState)(2e3),Mn=Object(x.a)(vn,2),ci=Mn[0],$n=Mn[1],Cn=Object(y.useState)(!0),Ti=Object(x.a)(Cn,2),Wi=Ti[0],hi=Ti[1],fi=Object(y.useState)(!1),ji=Object(x.a)(fi,2),er=ji[0],yr=ji[1],cn=Object(y.useState)(!1),ri=Object(x.a)(cn,2),pr=ri[0],Cr=ri[1],tr=Object(y.useState)([]),nr=Object(x.a)(tr,2),X=nr[0],S=nr[1],L=Object(y.useState)(!0),W=Object(x.a)(L,2),ne=W[0],Q=W[1],ke=Object(y.useState)(!((pe=me.actionTabs)!==null&&pe!==void 0&&(Ye=pe.selectArrsAll)!==null&&Ye!==void 0&&(xe=Ye[0])!==null&&xe!==void 0&&xe.send_type)),Vt=Object(x.a)(ke,2),kn=Vt[0],Qn=Vt[1],nn=Object(y.useState)([0,0,0]),ti=Object(x.a)(nn,2),qn=ti[0],Li=ti[1];Object(y.useEffect)(function(){if(me.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var Ai,wi,ir,Fi,Bn,gn;if((Ai=me.actionTabs)!==null&&Ai!==void 0&&(wi=Ai.selectArrsAll)!==null&&wi!==void 0&&(ir=wi[0])!==null&&ir!==void 0&&ir.can_publish){var ai,J,ue;Li(Object(n.a)((ai=me.actionTabs)===null||ai===void 0||((J=ai.selectArrsAll)===null||J===void 0||((ue=J[0])===null||ue===void 0))?void 0:ue.difficult_count))}else{var Tn,_n,si;Li(Object(n.a)((Tn=me.actionTabs)===null||Tn===void 0||((_n=Tn.selectArrsAll)===null||_n===void 0||((si=_n[0])===null||si===void 0))?void 0:si.difficult_settings))}if(Qn(!((Fi=me.actionTabs)!==null&&Fi!==void 0&&(Bn=Fi.selectArrsAll)!==null&&Bn!==void 0&&(gn=Bn[0])!==null&&gn!==void 0&&gn.send_type)),lr(),me.actionTabs.type===2){var Ce,Te=(Ce=me.actionTabs.selectArrsAll)===null||Ce===void 0?void 0:Ce[0];Q(Te.unified_setting)}}},[me.actionTabs]),Object(y.useEffect)(function(){if(er){if(pr)return;Be({type:"classroomList/setActionTabs",payload:{}}),Object(E.c)()?(Be({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},me.actionTabs.params),{},{type:1})}),Be({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},En)})):Be({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},me.actionTabs.params)})}},[er]);var lr=function(){var Ai=Object(o.a)(_.a.mark(function wi(ir){var Fi,Bn;return _.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return hi(!0),Tn.next=3,Object(B.D)(Object(a.a)(Object(a.a)({},En),{},{page:ir||ce,limit:2e4,homework_id:me.actionTabs.type===1?"":me.actionTabs.selectArrs[0]}));case 3:Fi=Tn.sent,Fi==null||Fi.course_groups.map(function(_n,si){_n.key=_n.id,_n.title=_n.name,_n.disabled=_n.is_published}),Fi&&(rn(Object(n.a)(Fi==null?void 0:Fi.course_groups)),Xt(Fi==null?void 0:Fi.course_groups_count),hi(!1),ir||gt.setFieldsValue((Bn={},Object(u.a)(Bn,"publish_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(u.a)(Bn,"end_time",v()(v()(new Date(Object(U.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),Bn)));case 6:case"end":return Tn.stop()}},wi)}));return function(ir){return Ai.apply(this,arguments)}}(),ar=function(){Object(E.c)()?me.actionTabs.detail?(Be({type:"shixunHomeworks/setActionTabs",payload:{}}),Be({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},En)}),Be({type:"shixunHomeworks/getWorkSetting",payload:Object(a.a)({},En)})):Be({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},me.actionTabs.params),{},{type:5})}):Be({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},me.actionTabs.params)})},Ki=function(){var Ai=Object(o.a)(_.a.mark(function wi(){var ir,Fi,Bn,gn;return _.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(Fi=Object(a.a)({},gt.getFieldsValue()),!(Fi.end_time<=Fi.publish_time)){_n.next=4;break}return r.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),_n.abrupt("return");case 4:if(!((X==null?void 0:X.length)<=0&&!ne&&Yt.length>0)){_n.next=7;break}return r.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),_n.abrupt("return");case 7:if(!(qn.reduce(function(si,ai){return si+ai})===0&&!kn)){_n.next=10;break}return r.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),_n.abrupt("return");case 10:return Bn={homework_ids:Object(n.a)(me.actionTabs.selectArrs),group_ids:X.length>0?X.map(function(si){return si.id}):(ir=me.detailCommonHomeworksList)===null||ir===void 0?void 0:ir.course_groups,end_time:v()(Fi.end_time).format("YYYY-MM-DD HH:mm"),publish_time:v()(Fi.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:qn==null?void 0:qn.map(function(si){return si}),send_type:kn?"0":"1",unified_setting:!X.length},_n.next=13,Object(p.a)("/api/courses/".concat(En.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(a.a)({},Bn)});case 13:gn=_n.sent,gn.status===0&&(Object(U.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),r.b.success("\u53D1\u5E03\u6210\u529F"),Be({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Jt.onCallback&&Jt.onCallback(),ar(),localStorage.getItem("Noviceguide")==="0"||Be({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:h.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 _n.stop()}},wi)}));return function(){return Ai.apply(this,arguments)}}(),Pr=function(){Re(1),rn([]),S([])},Vr=xt>ce*ci;return h.a.createElement(Y.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:me.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:Ki,onCancel:function(){Pr(),ar(),Be({type:"classroomList/setActionTabs",payload:{}})}},h.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",h.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),Yt&&h.a.createElement(w.a,{form:gt},h.a.createElement("div",{style:{paddingLeft:0}},me.actionTabs.type===2&&h.a.createElement(m.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),h.a.createElement(d.a.Group,{value:kn,disabled:!((Ie=me.actionTabs)!==null&&Ie!==void 0&&(Je=Ie.selectArrsAll)!==null&&Je!==void 0&&(Ke=Je[0])!==null&&Ke!==void 0&&Ke.can_publish),onChange:function(wi){Qn(wi.target.value)}},h.a.createElement(d.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),h.a.createElement(d.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!kn&&h.a.createElement(m.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{style:{marginRight:65}}),h.a.createElement("span",null,"\u7B80\u5355\u9898\u6570 ",h.a.createElement(D.a,{value:qn[0],onChange:function(wi){qn[0]=wi,Li(Object(n.a)(qn))},min:0,disabled:!((be=me.actionTabs)!==null&&be!==void 0&&(de=be.selectArrsAll)!==null&&de!==void 0&&(nt=de[0])!==null&&nt!==void 0&&nt.can_publish),placeholder:"\u6700\u5927".concat((Kt=me.actionTabs)===null||Kt===void 0||((jt=Kt.selectArrsAll)===null||jt===void 0||((wt=jt[0])===null||wt===void 0||((ze=wt.difficult_count)===null||ze===void 0)))?void 0:ze[0]),max:(ft=me.actionTabs)===null||ft===void 0||((dt=ft.selectArrsAll)===null||dt===void 0||((Nt=dt[0])===null||Nt===void 0||((Ze=Nt.difficult_count)===null||Ze===void 0)))?void 0:Ze[0],style:{width:60}})),h.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570 ",h.a.createElement(D.a,{value:qn[1],onChange:function(wi){qn[1]=wi,Li(Object(n.a)(qn))},min:0,disabled:!((Bt=me.actionTabs)!==null&&Bt!==void 0&&(Ut=Bt.selectArrsAll)!==null&&Ut!==void 0&&(Mt=Ut[0])!==null&&Mt!==void 0&&Mt.can_publish),max:(An=me.actionTabs)===null||An===void 0||((mn=An.selectArrsAll)===null||mn===void 0||((pn=mn[0])===null||pn===void 0||((tt=pn.difficult_count)===null||tt===void 0)))?void 0:tt[1],placeholder:"\u6700\u5927".concat((fn=me.actionTabs)===null||fn===void 0||((In=fn.selectArrsAll)===null||In===void 0||((He=In[0])===null||He===void 0||((Ue=He.difficult_count)===null||Ue===void 0)))?void 0:Ue[1]),style:{width:60}})),h.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570 ",h.a.createElement(D.a,{value:qn[2],onChange:function(wi){qn[2]=wi,Li(Object(n.a)(qn))},min:0,disabled:!((pt=me.actionTabs)!==null&&pt!==void 0&&(Ct=pt.selectArrsAll)!==null&&Ct!==void 0&&(Ge=Ct[0])!==null&&Ge!==void 0&&Ge.can_publish),placeholder:"\u6700\u5927".concat((vt=me.actionTabs)===null||vt===void 0||((Ae=vt.selectArrsAll)===null||Ae===void 0||((ge=Ae[0])===null||ge===void 0||((Ee=ge.difficult_count)===null||Ee===void 0)))?void 0:Ee[2]),max:(ae=me.actionTabs)===null||ae===void 0||((re=ae.selectArrsAll)===null||re===void 0||((he=re[0])===null||he===void 0||((ve=he.difficult_count)===null||ve===void 0)))?void 0:ve[2],style:{width:60}}))),h.a.createElement(m.a,{className:"mt30",align:"middle"},h.a.createElement(M.a,null,h.a.createElement(w.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},h.a.createElement(P.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(wi){return wi.parentNode},disabledDate:function(wi){return Object(T.b)(wi,Tt)},disabledTime:function(wi){return Object(T.c)(wi)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(U.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),h.a.createElement(M.a,{className:"ml20"},h.a.createElement(w.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},h.a.createElement(P.a,{style:{width:170},getPopupContainer:function(wi){return wi.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(U.d)(),"HH:mm")},disabledDate:function(wi){return Object(T.b)(wi,Tt,gt.getFieldValue("publish_time"))},disabledTime:function(wi){return Object(T.c)(wi,gt.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),me.actionTabs.type===2&&h.a.createElement(m.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),h.a.createElement(d.a.Group,{value:ne,onChange:function(wi){Q(wi.target.value),S([])}},h.a.createElement(d.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),h.a.createElement(d.a,{className:"ml20",disabled:Yt.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Yt.length<=0&&me.actionTabs.type===2&&h.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"')),(me.actionTabs.type===1||!ne)&&Yt.length>0&&h.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},h.a.createElement("span",{style:{flex:1}},h.a.createElement(K.a,{checked:X.length===Yt.length,onChange:function(wi){X.length===Yt.length?S([]):S(Yt.filter(function(ir){return!ir.is_published}))}},"\u5168\u9009")," "),h.a.createElement("span",{style:{width:16}}),h.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",X.length||0,"\u4E2A\u5206\u73ED")),(me.actionTabs.type===1||!ne)&&Yt.length>0&&h.a.createElement(G.a,{data:Yt,selectedRowKeys:X,setSelectedRowKeys:S})))};Qe.a=Object(z.a)(function(Z){var oe=Z.classroomList;return{classroomList:oe}})(V)},Y1PL:function(tn,Qe,I){"use strict";I.r(Qe),I.d(Qe,"ResizableTextArea",function(){return oe});var te=I("wx14"),Y=I("1OyB"),N=I("vuIU"),K=I("Ji7U"),A=I("LK+K"),M=I("q1tI"),H=I("VTBJ"),P=I("rePB"),k=I("Zm9Q"),D=I("Kwbf"),b=I("c+Xe"),m=I("m+aA"),f=I("bdgK"),d=new Map;function s(xe){xe.forEach(function(Ie){var Je,Ke=Ie.target;(Je=d.get(Ke))===null||Je===void 0||Je.forEach(function(be){return be(Ke)})})}var r=new f.default(s),u=null,o=null;function a(xe,Ie){d.has(xe)||(d.set(xe,new Set),r.observe(xe)),d.get(xe).add(Ie)}function n(xe,Ie){d.has(xe)&&(d.get(xe).delete(Ie),d.get(xe).size||(r.unobserve(xe),d.delete(xe)))}var R=function(xe){Object(K.a)(Je,xe);var Ie=Object(A.a)(Je);function Je(){return Object(Y.a)(this,Je),Ie.apply(this,arguments)}return Object(N.a)(Je,[{key:"render",value:function(){return this.props.children}}]),Je}(M.Component),w=M.createContext(null);function x(xe){var Ie=xe.children,Je=xe.onBatchResize,Ke=M.useRef(0),be=M.useRef([]),de=M.useContext(w),nt=M.useCallback(function(Kt,jt,wt){Ke.current+=1;var ze=Ke.current;be.current.push({size:Kt,element:jt,data:wt}),Promise.resolve().then(function(){ze===Ke.current&&(Je==null||Je(be.current),be.current=[])}),de==null||de(Kt,jt,wt)},[Je,de]);return M.createElement(w.Provider,{value:nt},Ie)}function O(xe){var Ie=xe.children,Je=xe.disabled,Ke=M.useRef(null),be=M.useRef(null),de=M.useContext(w),nt=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Kt=M.isValidElement(Ie)&&Object(b.c)(Ie),jt=Kt?Ie.ref:null,wt=M.useMemo(function(){return Object(b.a)(jt,Ke)},[jt,Ke]),ze=M.useRef(xe);ze.current=xe;var ft=M.useCallback(function(dt){var Nt=ze.current,Ze=Nt.onResize,Bt=Nt.data,Ut=dt.getBoundingClientRect(),Mt=Ut.width,An=Ut.height,mn=dt.offsetWidth,pn=dt.offsetHeight,tt=Math.floor(Mt),fn=Math.floor(An);if(nt.current.width!==tt||nt.current.height!==fn||nt.current.offsetWidth!==mn||nt.current.offsetHeight!==pn){var In={width:tt,height:fn,offsetWidth:mn,offsetHeight:pn};nt.current=In;var He=mn===Math.round(Mt)?Mt:mn,Ue=pn===Math.round(An)?An:pn,pt=Object(H.a)(Object(H.a)({},In),{},{offsetWidth:He,offsetHeight:Ue});de==null||de(pt,dt,Bt),Ze&&Promise.resolve().then(function(){Ze(pt,dt)})}},[]);return M.useEffect(function(){var dt=Object(m.a)(Ke.current)||Object(m.a)(be.current);return dt&&!Je&&a(dt,ft),function(){return n(dt,ft)}},[Ke.current,Je]),M.createElement(R,{ref:be},Kt?M.cloneElement(Ie,{ref:wt}):Ie)}var C="rc-observer-key";function _(xe){var Ie=xe.children,Je=Object(k.a)(Ie);return Je.map(function(Ke,be){var de=(Ke==null?void 0:Ke.key)||"".concat(C,"-").concat(be);return M.createElement(O,Object(te.a)({},xe,{key:de}),Ke)})}_.Collection=x;var y=_,h=I("bT9E"),c=I("TSYQ"),v=I.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"],U={},F;function z(xe){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Je=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ie&&U[Je])return U[Je];var Ke=window.getComputedStyle(xe),be=Ke.getPropertyValue("box-sizing")||Ke.getPropertyValue("-moz-box-sizing")||Ke.getPropertyValue("-webkit-box-sizing"),de=parseFloat(Ke.getPropertyValue("padding-bottom"))+parseFloat(Ke.getPropertyValue("padding-top")),nt=parseFloat(Ke.getPropertyValue("border-bottom-width"))+parseFloat(Ke.getPropertyValue("border-top-width")),Kt=E.map(function(wt){return"".concat(wt,":").concat(Ke.getPropertyValue(wt))}).join(";"),jt={sizingStyle:Kt,paddingSize:de,borderSize:nt,boxSizing:be};return Ie&&Je&&(U[Je]=jt),jt}function G(xe){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),xe.getAttribute("wrap")?F.setAttribute("wrap",xe.getAttribute("wrap")):F.removeAttribute("wrap");var be=z(xe,Ie),de=be.paddingSize,nt=be.borderSize,Kt=be.boxSizing,jt=be.sizingStyle;F.setAttribute("style","".concat(jt,";").concat(p)),F.value=xe.value||xe.placeholder||"";var wt=Number.MIN_SAFE_INTEGER,ze=Number.MAX_SAFE_INTEGER,ft=F.scrollHeight,dt;if(Kt==="border-box"?ft+=nt:Kt==="content-box"&&(ft-=de),Je!==null||Ke!==null){F.value=" ";var Nt=F.scrollHeight-de;Je!==null&&(wt=Nt*Je,Kt==="border-box"&&(wt=wt+de+nt),ft=Math.max(wt,ft)),Ke!==null&&(ze=Nt*Ke,Kt==="border-box"&&(ze=ze+de+nt),dt=ft>ze?"":"hidden",ft=Math.min(ze,ft))}return{height:ft,minHeight:wt,maxHeight:ze,overflowY:dt,resize:"none"}}var B=I("Gytx"),T=I.n(B),V;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(V||(V={}));var Z=function(xe){Object(K.a)(Je,xe);var Ie=Object(A.a)(Je);function Je(Ke){var be;return Object(Y.a)(this,Je),be=Ie.call(this,Ke),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(de){be.textArea=de},be.handleResize=function(de){var nt=be.state.resizeStatus,Kt=be.props,jt=Kt.autoSize,wt=Kt.onResize;if(nt!==V.NONE)return;typeof wt=="function"&&wt(de),jt&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var de=be.props.autoSize;if(!de||!be.textArea)return;var nt=de.minRows,Kt=de.maxRows,jt=G(be.textArea,!1,nt,Kt);be.setState({textareaStyles:jt,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:V.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:V.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var de=be.props,nt=de.prefixCls,Kt=nt===void 0?"rc-textarea":nt,jt=de.autoSize,wt=de.onResize,ze=de.className,ft=de.disabled,dt=be.state,Nt=dt.textareaStyles,Ze=dt.resizeStatus,Bt=Object(h.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ut=v()(Kt,ze,Object(P.a)({},"".concat(Kt,"-disabled"),ft));"value"in Bt&&(Bt.value=Bt.value||"");var Mt=Object(H.a)(Object(H.a)(Object(H.a)({},be.props.style),Nt),Ze===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(y,{onResize:be.handleResize,disabled:!(jt||wt)},M.createElement("textarea",Object(te.a)({},Bt,{className:Ut,style:Mt,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:V.NONE},be}return Object(N.a)(Je,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!T()(be.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 be=this.textArea.selectionStart,de=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,de)}}catch(nt){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Je}(M.Component),oe=Z,pe=function(xe){Object(K.a)(Je,xe);var Ie=Object(A.a)(Je);function Je(Ke){var be;Object(Y.a)(this,Je),be=Ie.call(this,Ke),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(nt){be.resizableTextArea=nt},be.handleChange=function(nt){var Kt=be.props.onChange;be.setValue(nt.target.value,function(){be.resizableTextArea.resizeTextarea()}),Kt&&Kt(nt)},be.handleKeyDown=function(nt){var Kt=be.props,jt=Kt.onPressEnter,wt=Kt.onKeyDown;nt.keyCode===13&&jt&&jt(nt),wt&&wt(nt)};var de=typeof Ke.value=="undefined"||Ke.value===null?Ke.defaultValue:Ke.value;return be.state={value:de},be}return Object(N.a)(Je,[{key:"setValue",value:function(be,de){"value"in this.props||this.setState({value:be},de)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(oe,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Je}(M.Component),Ye=Qe.default=pe},ZW9T:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return G});var te=I("k1fw"),Y=I("miYZ"),N=I("tsqr"),K=I("rAM+"),A=I("tJVT"),M=I("PpiC"),H=I("q1tI"),P=I.n(H),k=I("bdgK"),D=I("oBTY"),b=I("9og8"),m=I("WmNS"),f=I.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"]},s={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"]},r={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 ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].join(` `)},{label:"#include ",content:["#include "].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(` `)}]},o=I("5VLF"),a=I.n(o),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"]}},R=function(T,V){return V.map(function(Z){return{label:Z,kind:T.languages.CompletionItemKind.Keyword,insertText:Z}})},w=function(T){return Object.keys(n.tables).map(function(V){return{label:V,kind:T.languages.CompletionItemKind.Variable,insertText:V}})},x=function(T,V){var Z=n.tables[T];return Z?Z.map(function(oe){return{label:oe,kind:V.languages.CompletionItemKind.Field,insertText:oe}}):[]};function O(B,T,V,Z,oe){var pe=T.getWordUntilPosition(V),Ye={startLineNumber:V.lineNumber,endLineNumber:V.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},xe=Z.map(function(Ie){return{label:Ie,kind:B.languages.CompletionItemKind.Keyword,insertText:Ie,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ye}});return oe.map(function(Ie){xe.push(Object(te.a)(Object(te.a)({},Ie),{},{range:Ye}))}),xe}var C=function(B){n.languages.map(function(oe){return B.languages.registerDocumentFormattingEditProvider(oe,{provideDocumentFormattingEdits:function(Ye,xe,Ie){return Object(b.a)(f.a.mark(function Je(){var Ke;return f.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return Ke=a()(Ye.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}),de.abrupt("return",[{range:Ye.getFullModelRange(),text:Ke}]);case 2:case"end":return de.stop()}},Je)}))()}}),oe});var T=r.quickKey.map(function(oe){return{label:oe.label,kind:B.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=u.quickKey.map(function(oe){return{label:oe.label,kind:B.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=s.quickKey.map(function(oe){return{label:oe.label,kind:B.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(D.a)(r.keywords),Object(D.a)(r.quickKey.map(function(oe){return oe.label}))),provideCompletionItems:function(pe,Ye){var xe=pe.getValueInRange({startLineNumber:Ye.lineNumber,startColumn:1,endLineNumber:Ye.lineNumber,endColumn:Ye.column}),Ie=xe.match(/cu/gim);console.log("match:",Ie,Ye,xe,pe);var Je=[],Ke=Ye.lineNumber,be=Ye.column,de=pe.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:be}),nt=de.trim().split(/\s+/),Kt=nt[nt.length-1];if(Kt.endsWith(".")){var jt=Kt.slice(0,Kt.length-1);Object.keys(n.tables).includes(jt)&&(Je=Object(D.a)(x(jt,B)))}else Kt==="."?Je=[]:Je=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,r.keywords)),Object(D.a)(T));return{suggestions:Je}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(D.a)(d.keywords)),provideCompletionItems:function(pe,Ye){var xe=pe.getValueInRange({startLineNumber:Ye.lineNumber,startColumn:1,endLineNumber:Ye.lineNumber,endColumn:Ye.column}),Ie=xe.match(/cu/gim);console.log("match:",Ie,Ye,xe,pe);var Je=[],Ke=Ye.lineNumber,be=Ye.column,de=pe.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:be}),nt=de.trim().split(/\s+/),Kt=nt[nt.length-1];if(Kt.endsWith(".")){var jt=Kt.slice(0,Kt.length-1);Object.keys(n.tables).includes(jt)&&(Je=Object(D.a)(x(jt,B)))}else Kt==="."?Je=[]:Je=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,d.keywords)));return{suggestions:Je}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(D.a)(s.keywords)),provideCompletionItems:function(pe,Ye){var xe=[],Ie=Ye.lineNumber,Je=Ye.column,Ke=pe.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:Je}),be=Ke.trim().split(/\s+/),de=be[be.length-1];if(de.endsWith(".")){var nt=de.slice(0,de.length-1);Object.keys(n.tables).includes(nt)&&(xe=Object(D.a)(x(nt,B)))}else de==="."?xe=[]:xe=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,s.keywords)),Object(D.a)(Z));return{suggestions:xe}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(D.a)(u.keywords)),provideCompletionItems:function(pe,Ye){var xe=[],Ie=Ye.lineNumber,Je=Ye.column,Ke=pe.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:Je}),be=Ke.trim().split(/\s+/),de=be[be.length-1];if(de.endsWith(".")){var nt=de.slice(0,de.length-1);Object.keys(n.tables).includes(nt)&&(xe=Object(D.a)(x(nt,B)))}else de==="."?xe=[]:xe=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,u.keywords)),Object(D.a)(V));return{suggestions:xe}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",y=I("LvDl"),h=I("+ua5");function c(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}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 U(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],T=B;if(Array.isArray(B)){for(var V=0;V0||vn.target.offsetWidth>0)&&Ge.current.instance.layout()}}catch(Mn){xt.e(Mn)}finally{xt.f()}}),_e.observe(Ct.current)),_e}function me(){N.b.warn(decodeURIComponent(_))}var Be=function(){var Ne=Ge.current.instance;if(pe!=null&&Ne&&re){var xt=Ne.getModel();xt&&pe!==xt.getValue()&&(p=!0,xt.setValue(pe),Ne.layout(),p=!1)}};Object(H.useEffect)(function(){vt.current&&clearTimeout(vt.current),vt.current=setTimeout(function(){Be()},500)},[pe,re,Ge.current]),Object(H.useEffect)(function(){if(In&&Ge.current&&Ge.current.instance){var _e=Ge.current.instance;_e.changeViewZones(function(xt){var Xt=document.createElement("div");Xt.style.padding="10px 20px",Xt.style.width="calc(100% - 20px)",Xt.className="my-error-line-wrp",Xt.innerHTML=Ue,xt.addZone({afterLineNumber:In||11,heightInLines:3,domNode:Xt})});var Ne={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}};_e.addOverlayWidget(Ne),_e.revealPositionInCenter({lineNumber:20,column:1})}},[In,Ge.current,re]);function Tt(){var _e=Ge.current.instance;if(_e){var Ne=_e.getSelection(),xt=Ge.current.pastePos||{},Xt=new F.Range(xt.startLineNumber||Ne.endLineNumber,xt.startColumn||Ne.endColumn,xt.endLineNumber||Ne.endLineNumber,xt.endColumn||Ne.endColumn);setTimeout(function(){_e.executeEdits("",[{range:Xt,text:""}])},300)}}function Jt(_e){(window.navigator.platform.match("Mac")?_e.metaKey:_e.ctrlKey)&&_e.keyCode==83&&(_e.preventDefault(),ze())}var En=function(){if(dt&&Ge.current.instance){var Ne=Ge.current.instance.getContentHeight();Yt(Ne0||Mt.target.offsetWidth>0)&&dt.layout()}}catch(An){Bt.e(An)}finally{Bt.f()}}),Nt.observe(Ke.current)),Nt}Object(H.useEffect)(function(){Ke.current&&I.e(27).then(I.t.bind(null,"M/lh",7)).then(function(dt){F=dt;var Nt=F.editor.createDiffEditor(Ke.current,Object(te.a)(Object(te.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},Je),{},{wordWrap:!0}));Kt(Nt);var Ze=jt(Nt);return function(){Nt.dispose();var Bt=Nt.getModel();Bt&&Bt.dispose(),Ze.unobserve(Ke.current)}})},[]),Object(H.useEffect)(function(){nt&&nt.setModel({original:F.editor.createModel(pe,xe),modified:F.editor.createModel(Ye,xe)})},[pe,Ye,xe,nt]);var wt=c(V),ze=c(oe),ft={width:wt,height:ze};return P.a.createElement("div",{className:"my-diff-editor",ref:Ke,style:ft})}},ZpRC:function(tn,Qe,I){"use strict";function te(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function Y(b,m){return(!m||b!=="hidden")&&b!=="visible"&&b!=="clip"}function N(b,m){if(b.clientHeightm||r>b&&u=m&&o>=f?r-b-d:u>m&&of?u-m+s:0}var A=function(b,m){var f=window,d=m.scrollMode,s=m.block,r=m.inline,u=m.boundary,o=m.skipOverflowHiddenElements,a=typeof u=="function"?u:function(Nt){return Nt!==u};if(!te(b))throw new TypeError("Invalid target");for(var n=document.scrollingElement||document.documentElement,R=[],w=b;te(w)&&a(w);){if((w=w.parentElement)===n){R.push(w);break}w!=null&&w===document.body&&N(w)&&!N(document.documentElement)||w!=null&&N(w,o)&&R.push(w)}for(var x=f.visualViewport?f.visualViewport.width:innerWidth,O=f.visualViewport?f.visualViewport.height:innerHeight,C=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,y=b.getBoundingClientRect(),h=y.height,c=y.width,v=y.top,p=y.right,E=y.bottom,U=y.left,F=s==="start"||s==="nearest"?v:s==="end"?E:v+h/2,z=r==="center"?U+c/2:r==="end"?p:U,G=[],B=0;B=0&&U>=0&&E<=O&&p<=x&&v>=pe&&E<=xe&&U>=Ie&&p<=Ye)return G;var Je=getComputedStyle(T),Ke=parseInt(Je.borderLeftWidth,10),be=parseInt(Je.borderTopWidth,10),de=parseInt(Je.borderRightWidth,10),nt=parseInt(Je.borderBottomWidth,10),Kt=0,jt=0,wt="offsetWidth"in T?T.offsetWidth-T.clientWidth-Ke-de:0,ze="offsetHeight"in T?T.offsetHeight-T.clientHeight-be-nt:0;if(n===T)Kt=s==="start"?F:s==="end"?F-O:s==="nearest"?K(_,_+O,O,be,nt,_+F,_+F+h,h):F-O/2,jt=r==="start"?z:r==="center"?z-x/2:r==="end"?z-x:K(C,C+x,x,Ke,de,C+z,C+z+c,c),Kt=Math.max(0,Kt+_),jt=Math.max(0,jt+C);else{Kt=s==="start"?F-pe-be:s==="end"?F-xe+nt+ze:s==="nearest"?K(pe,xe,Z,be,nt+ze,F,F+h,h):F-(pe+Z/2)+ze/2,jt=r==="start"?z-Ie-Ke:r==="center"?z-(Ie+oe/2)+wt/2:r==="end"?z-Ye+de+wt:K(Ie,Ye,oe,Ke,de+wt,z,z+c,c);var ft=T.scrollLeft,dt=T.scrollTop;F+=dt-(Kt=Math.max(0,Math.min(dt+Kt,T.scrollHeight-Z+ze))),z+=ft-(jt=Math.max(0,Math.min(ft+jt,T.scrollWidth-oe+wt)))}G.push({el:T,top:Kt,left:jt})}return G};function M(b){return b===Object(b)&&Object.keys(b).length!==0}function H(b,m){m===void 0&&(m="auto");var f="scrollBehavior"in document.body.style;b.forEach(function(d){var s=d.el,r=d.top,u=d.left;s.scroll&&f?s.scroll({top:r,left:u,behavior:m}):(s.scrollTop=r,s.scrollLeft=u)})}function P(b){return b===!1?{block:"end",inline:"nearest"}:M(b)?b:{block:"start",inline:"nearest"}}function k(b,m){var f=!b.ownerDocument.documentElement.contains(b);if(M(m)&&typeof m.behavior=="function")return m.behavior(f?[]:A(b,m));if(f)return;var d=P(m);return H(A(b,d),d.behavior)}var D=Qe.a=k},bT9E:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return Y});var te=I("VTBJ");function Y(N,K){var A=Object(te.a)({},N);return Array.isArray(K)&&K.forEach(function(M){delete A[M]}),A}},bTeP:function(tn,Qe,I){tn.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(tn,Qe,I){"use strict";var te=I("q1tI"),Y=I.n(te),N=te.createContext(null);Qe.a=N},c5Ni:function(tn,Qe,I){},deN7:function(tn,Qe,I){"use strict";var te=I("/zsF"),Y=I("PArb"),N=I("14J3"),K=I("BMrR"),A=I("jCWc"),M=I("kPKH"),H=I("+L6B"),P=I("2/Rp"),k=I("miYZ"),D=I("tsqr"),b=I("9og8"),m=I("giR+"),f=I("fyUT"),d=I("2qtc"),s=I("kLXV"),r=I("7Kak"),u=I("9yH6"),o=I("tJVT"),a=I("k1fw"),n=I("OaEy"),R=I("2fM7"),w=I("WmNS"),x=I.n(w),O=I("q1tI"),C=I.n(O),_=I("ZW9T"),y=I("F0VM"),h=I.n(y),c=I("xKgJ"),v=I("J66h"),p=I.n(v),E=I("ErOA"),U=I("Ty5D"),F=I("9Bee"),z=I("XYT7"),G=I("RCxd"),B=I("/MfK"),T=R.a.Option,V={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},Z;(function(pe){pe[pe.SET_PATH=0]="SET_PATH",pe[pe.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(Z||(Z={}));function oe(pe,Ye){switch(Ye.type){case Z.SET_PATH:return Object(a.a)(Object(a.a)({},pe),{},{selectedPath:Ye.payload});case Z.GET_PASSED_CONTENT:return Object(a.a)(Object(a.a)({},pe),{},{passedContent:Ye.payload});default:throw new Error}}Qe.a=function(pe){var Ye=pe.language,xe=pe.dispatch,Ie=pe.shixunWorkReport,Je=pe.v,Ke=pe.languages,be=pe.onPathChange,de=pe.autoHeight,nt=pe.diff_code_count,Kt=pe.data,jt=Object(O.useState)(Ke==null?void 0:Ke[0]),wt=Object(o.a)(jt,2),ze=wt[0],ft=wt[1],dt=Ie!="shixunWorkReport"&&Object(U.i)();return Object(O.useEffect)(function(){ft(Ke==null?void 0:Ke[0])},[]),Object(O.useEffect)(function(){var Nt;ft(Ke==null||((Nt=Ke.filter(function(Ze){return Ze.language===(ze==null?void 0:ze.language)}))===null||Nt===void 0)?void 0:Nt[0])},[Ke]),C.a.createElement(C.a.Fragment,null,C.a.createElement("h2",null," ",C.a.createElement("span",null,C.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Ke==null?void 0:Ke.length)>1&&C.a.createElement(u.a.Group,{defaultValue:Ye,style:{marginLeft:10},onChange:function(Ze){var Bt;ft(Ke==null||((Bt=Ke.filter(function(Ut){return Ut.language===Ze.target.value}))===null||Bt===void 0)?void 0:Bt[0])}},Ke==null?void 0:Ke.map(function(Nt){return C.a.createElement(u.a,{value:Nt==null?void 0:Nt.language},Nt==null?void 0:Nt.language)}))),Object(c.c)()&&Ie!="shixunWorkReport"&&C.a.createElement("span",null,C.a.createElement("span",null,"\u5F97\u5206 ",ze==null?void 0:ze.score,"/",ze==null?void 0:ze.total_score),C.a.createElement(P.a,{style:{margin:"0px 10px"},onClick:function(){var Ze=ze==null?void 0:ze.score;s.a.confirm({title:"\u8C03\u5206",content:C.a.createElement("div",null,C.a.createElement("p",null,"\u5F97\u5206\uFF1A",ze==null?void 0:ze.score,"/",ze==null?void 0:ze.total_score),C.a.createElement("p",null,"\u8C03\u5206\uFF1A",C.a.createElement(f.a,{min:0,max:ze==null?void 0:ze.total_score,defaultValue:ze==null?void 0:ze.score,onChange:function(Ut){Ze=Ut}}))),okText:"\u786E\u8BA4",onOk:function(){var Bt=Object(b.a)(x.a.mark(function Mt(){var An;return x.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(E.a)("/api/courses/".concat(dt==null?void 0:dt.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:dt==null?void 0:dt.coursesId,hack_user_code_id:ze==null?void 0:ze.hack_user_id,score:Ze}});case 2:An=pn.sent,An.status===0&&(D.b.success("\u8C03\u5206\u6210\u529F"),xe({type:"shixunHomeworks/setActionTabs",payload:{}}),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(a.a)({},dt)}));case 4:case"end":return pn.stop()}},Mt)}));function Ut(){return Bt.apply(this,arguments)}return Ut}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(c.c)()&&Ie!="shixunWorkReport"&&C.a.createElement(P.a,{onClick:function(){xe({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:Ie.user_id,type:"1",language:ze==null?void 0:ze.language,v:Je,data:Object(a.a)({},Ie)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),C.a.createElement(_.b,{height:300,language:ze==null?void 0:ze.language,value:v.Base64.decode(ze==null?void 0:ze.code),autoHeight:de,theme:"default",options:V}),((ze==null?void 0:ze.comment)||(ze==null?void 0:ze.hidden_comment))&&C.a.createElement("div",null,C.a.createElement(K.a,{align:"middle",style:{borderTop:"1px solid #eee"}},C.a.createElement(M.a,{flex:1},C.a.createElement("h1",{className:h.a.title},"\u70B9\u8BC4\u5185\u5BB9")),C.a.createElement(M.a,{className:"pr30"},Object(c.c)()&&C.a.createElement(P.a,{onClick:Object(b.a)(x.a.mark(function Nt(){return x.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:s.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:C.a.createElement(G.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(b.a)(x.a.mark(function Mt(){var An;return x.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(z.m)({comment_id:ze==null?void 0:ze.comment_id,homeworkId:dt.homeworkId,type:"hack"});case 2:An=pn.sent,An.status===0&&(D.b.success("\u5220\u9664\u6210\u529F"),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(a.a)({},dt)}));case 4:case"end":return pn.stop()}},Mt)}))()}});case 1:case"end":return Bt.stop()}},Nt)}))},C.a.createElement(B.a,null),"\u5220\u9664"))),C.a.createElement(Y.a,{style:{margin:0}}),(ze==null?void 0:ze.comment)&&C.a.createElement("aside",{className:"pl30 pr30 mt20"},C.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),C.a.createElement("br",null),C.a.createElement(F.a,{value:ze==null?void 0:ze.comment})),(ze==null?void 0:ze.hidden_comment)&&C.a.createElement("aside",{className:"pl30 pr30 mt20"},C.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),C.a.createElement("br",null),C.a.createElement(F.a,{value:ze==null?void 0:ze.hidden_comment}))))}},dejd:function(tn,Qe,I){},dmUQ:function(tn,Qe,I){"use strict";var te=I("Ff2n"),Y=I("rePB"),N=I("1OyB"),K=I("vuIU"),A=I("Ji7U"),M=I("md7G"),H=I("foSv"),P=I("q1tI"),k=I.n(P),D=I("TSYQ"),b=I.n(D),m=I("4IlW");function f(h,c){var v=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);c&&(p=p.filter(function(E){return Object.getOwnPropertyDescriptor(h,E).enumerable})),v.push.apply(v,p)}return v}function d(h){for(var c=1;c1?oe-1:0),Ye=1;Ye1?B-1:0),V=1;V=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var B=0;return G.indexOf(".")>=0&&(B=G.length-G.indexOf(".")-1),B},E.getInputDisplayValue=function(z){var G=z||E.state,B=G.focused,T=G.inputValue,V=G.value,Z;B?Z=T:Z=E.toPrecisionAsStep(V),Z==null&&(Z="");var oe=E.formatWrapper(Z);return x(E.props.decimalSeparator)&&(oe=oe.toString().replace(".",E.props.decimalSeparator)),oe},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(z){}},E.restoreByAfter=function(z){if(z===void 0)return!1;var G=E.input.value,B=G.lastIndexOf(z);if(B===-1)return!1;var T=E.cursorBefore.length;return E.lastKeyCode===m.a.DELETE&&E.cursorBefore.charAt(T-1)===z[0]?(E.fixCaret(T,T),!0):B+z.length===G.length?(E.fixCaret(B,B),!0):!1},E.partRestoreByAfter=function(z){return z===void 0?!1:Array.prototype.some.call(z,function(G,B){var T=z.substring(B);return E.restoreByAfter(T)})},E.isNotCompleteNumber=function(z){return isNaN(z)||z===""||z===null||z&&z.toString().indexOf(".")===z.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(z,G,B){E.pressingUpOrDown=!0,E.step("down",z,G,B)},E.up=function(z,G,B){E.pressingUpOrDown=!0,E.step("up",z,G,B)},E.saveInput=function(z){E.input=z};var U=p.value;U===void 0&&(U=p.defaultValue),E.state={focused:p.autoFocus};var F=E.getValidValue(E.toNumber(U));return E.state=d(d({},E.state),{},{inputValue:E.toPrecisionAsStep(F),value:F}),E}return Object(K.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var U=this.props,F=U.value,z=U.onChange,G=U.max,B=U.min,T=this.state.focused;if(E){if(!O(E.value,F)||!O(E.max,G)||!O(E.min,B)){var V=T?F:this.getValidValue(F),Z;this.pressingUpOrDown?Z=V:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:Z})}var oe="value"in this.props?F:this.state.value;"max"in this.props&&E.max!==G&&typeof oe=="number"&&oe>G&&z&&z(G),"min"in this.props&&E.min!==B&&typeof oe=="number"&&oe1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,z=parseFloat(E);return isNaN(z)?E:(zF&&(z=F),z)}},{key:"setValue",value:function(E,U){var F=this.props.precision,z=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),G=this.state.value,B=G===void 0?null:G,T=this.state.inputValue,V=T===void 0?null:T,Z=typeof z=="number"?z.toFixed(F):"".concat(z),oe=z!==B||Z!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},U)):this.setState({value:z,inputValue:this.toPrecisionAsStep(E)},U),oe&&this.props.onChange(z),z}},{key:"getMaxPrecision",value:function(E){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,z=F.precision,G=F.step;if(x(z))return z;var B=this.getPrecision(U),T=this.getPrecision(G),V=this.getPrecision(E);return E?Math.max(V,B+T):B+T}},{key:"getPrecisionFactor",value:function(E){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(E,U);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var U=Math.abs(this.getMaxPrecision(E));return isNaN(U)?E.toString():Number(E).toFixed(U)}},{key:"toNumber",value:function(E){var U=this.props.precision,F=this.state.focused,z=E&&E.length>16&&F;return this.isNotCompleteNumber(E)||z?E:x(U)?Math.round(E*Math.pow(10,U))/Math.pow(10,U):Number(E)}},{key:"upStep",value:function(E,U){var F=this.props.step,z=this.getPrecisionFactor(E,U),G=Math.abs(this.getMaxPrecision(E,U)),B=((z*E+z*F*U)/z).toFixed(G);return this.toNumber(B)}},{key:"downStep",value:function(E,U){var F=this.props.step,z=this.getPrecisionFactor(E,U),G=Math.abs(this.getMaxPrecision(E,U)),B=((z*E-z*F*U)/z).toFixed(G);return this.toNumber(B)}},{key:"step",value:function(E,U){var F=this,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var B=this.props;if(B.disabled)return;var T=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(T))return;var V=this["".concat(E,"Step")](T,z),Z=V>B.max||VB.max?V=B.max:V=pe),vt=(fn||fn===0)&&(isNaN(fn)||Number(fn)<=Ye),Ae=Ge||z||G,ge=vt||z||G,Ee=b()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(Y.a)({},"".concat(F,"-handler-up-disabled"),Ae)),ae=b()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(Y.a)({},"".concat(F,"-handler-down-disabled"),ge)),re=B?{onTouchStart:Ae?u:this.up,onTouchEnd:this.stop}:{onMouseDown:Ae?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=B?{onTouchStart:ge?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ge?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:He,style:xe,title:Ie,onMouseEnter:Je,onMouseLeave:Ke,onMouseOver:be,onMouseOut:de,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(F,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":Ae,className:Ee}),V||k.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:o})),k.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":ge,className:ae}),Z||k.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:o}))),k.a.createElement("div",{className:"".concat(F,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ye,"aria-valuemax":pe,"aria-valuenow":fn,required:nt,type:wt,placeholder:ze,onPaste:An,onClick:Kt,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:jt,autoComplete:T,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:pt?this.onKeyDown:u,onKeyUp:pt?this.onKeyUp:u,autoFocus:Ut,maxLength:Bt,readOnly:G,disabled:z,max:pe,min:Ye,step:Ze,name:Mt,title:Ie,id:ft,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ct),pattern:Nt,inputMode:dt,onInput:mn},Ue))))}}]),v}(k.a.Component);C.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:a,required:!1,autoComplete:"off"};var _=C,y=Qe.a=_},eozf:function(tn,Qe,I){"use strict";I.d(Qe,"b",function(){return Ke}),I.d(Qe,"c",function(){return be});var te=I("sRBo"),Y=I("kaz8"),N=I("5Dmo"),K=I("3S7+"),A=I("/zsF"),M=I("PArb"),H=I("7Kak"),P=I("9yH6"),k=I("14J3"),D=I("BMrR"),b=I("+L6B"),m=I("2/Rp"),f=I("jCWc"),d=I("kPKH"),s=I("2qtc"),r=I("kLXV"),u=I("9og8"),o=I("miYZ"),a=I("tsqr"),n=I("oBTY"),R=I("k1fw"),w=I("tJVT"),x=I("OaEy"),O=I("2fM7"),C=I("iQDF"),_=I("+eQT"),y=I("WmNS"),h=I.n(y),c=I("q1tI"),v=I.n(c),p=I("/MfK"),E=I("w5pM"),U=I("Lyp1"),F=I("wd/R"),z=I.n(F),G=I("xKgJ"),B=I("ErOA"),T=I("LvDl"),V=I.n(T),Z=I("1vsH"),oe=I("zetH"),pe=I.n(oe),Ye=I("Ty5D"),xe=I("9kvl"),Ie=I("AHFd");function Je(jt,wt){for(var ze=[],ft=jt;ftz()(ze).endOf("day"),Ze=wt100)throw a.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(!mt.late_time)throw a.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 vn;Be=(vn=Be)===null||vn===void 0?void 0:vn.map(function(Mn){var ci,$n;if(Mn.late_penalty===null||Mn.late_penalty===void 0||Mn.late_penalty<0||Mn.late_penalty>100)throw a.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(!Mn.late_time)throw a.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(!Mn.group_name)throw a.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Mn.group_name=typeof(Mn==null?void 0:Mn.group_name)=="string"?[Mn==null?void 0:Mn.group_name]:Mn==null?void 0:Mn.group_name,Mn.group_id=Mn==null||((ci=Mn.group_name)===null||ci===void 0||(($n=ci.map(function(Cn){var Ti,Wi,hi=(Ti=tt.group_settings)===null||Ti===void 0||((Wi=Ti.filter(function(fi){return(fi==null?void 0:fi.group_name)===Cn}))===null||Wi===void 0)?void 0:Wi[0];return hi==null?void 0:hi.group_id}))===null||$n===void 0))?void 0:$n.toString().split(","),Mn}),Xt.allow_late_settings=Be}rt(Xt)},rt=function(Ne){var xt,Xt;if(Ne.total_score===null){a.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ne!=null&&Ne.work_efficiency&&Ne.eff_score===null){a.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var vn=Ne.challenge_settings.reduce(function($n,Cn){return $n+Number(Cn.challenge_score)},0);if((vn==null?void 0:vn.toFixed(10))!==((xt=Ne.total_score-Ne.eff_score)===null||xt===void 0?void 0:xt.toFixed(10))){a.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(Ne.total_score,"\u5206"));return}var Mn={shixun_evaluation:Ne.shixun_evaluation,challenge_settings:Ne.challenge_settings},ci=function(){var $n=Object(u.a)(h.a.mark(function Cn(){var Ti;return h.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:return ge(!0),hi.next=3,Object(B.a)("/api/homework_commons/".concat(pn.categoryId,"/publish_setting.json"),{method:"post",body:Object(R.a)({},Ne)});case 3:Ti=hi.sent,Ti.status===0&&(a.b.success("\u66F4\u65B0\u6210\u529F"),Ct(!0),gt(),mn({type:"shixunHomeworks/getWorkList",payload:Object(R.a)({},pn)})),ge(!1);case 6:case"end":return hi.stop()}},Cn)}));return function(){return $n.apply(this,arguments)}}();!Object(T.isEqual)(In,Mn)&&!(fn!=null&&(Xt=fn.homework_status)!==null&&Xt!==void 0&&Xt.includes("\u672A\u53D1\u5E03"))?r.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:ci}):ci()},ce=function(Ne,xt){var Xt,vn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return xt?xt.find(function(Mn){return Mn[vn]===Ne}):tt==null||((Xt=tt.group_settings)===null||Xt===void 0)?void 0:Xt.find(function(Mn){return Mn.group_id[0]===Ne})},Re=(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment),At=function(Ne){var xt=ce(Ne,tt==null?void 0:tt.allow_late_settings,"id"),Xt=ce(Ne,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.allow_late)&&xt&&(xt==null?void 0:xt.late_time)!==null||(tt==null?void 0:tt.anonymous_comment)&&Xt&&(Xt==null?void 0:Xt.evaluation_start)!==null},ot=Object(c.useMemo)(function(){var _e;if(tt!=null&&tt.unified_setting){var Ne;return!(fn!=null&&(Ne=fn.homework_status)!==null&&Ne!==void 0&&Ne.includes("\u5DF2\u622A\u6B62"))||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment)}var xt=tt==null||((_e=tt.group_settings)===null||_e===void 0)?void 0:_e.some(function(Xt){return z()(Xt.end_time)<=z()()});return!xt||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.all_group_late)},[tt,fn]),Yt=tt==null?void 0:tt.anonymous_comment,rn=function(Ne){if(!Ne)return!1;var xt=ce(Ne,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.anonymous_comment)&&xt&&(xt==null?void 0:xt.evaluation_start)!==null};return v.a.createElement("section",{className:[pe.a.form," bg-white pl30 pr30 pt10"].join(" ")},v.a.createElement(D.a,null,v.a.createElement(d.a,{span:24},v.a.createElement(D.a,{align:"middle"},v.a.createElement(d.a,{flex:"1"}),v.a.createElement(d.a,null,Object(G.c)()&&pt&&v.a.createElement(m.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Ct(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),v.a.createElement("div",null,v.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",v.a.createElement(P.a.Group,{disabled:pt||!(fn!=null&&(ze=fn.homework_status)!==null&&ze!==void 0&&ze.includes("\u672A\u53D1\u5E03")),value:mt.unified_setting,onChange:function(Ne){var xt;if(!(fn!=null&&(xt=fn.homework_status)!==null&&xt!==void 0&&xt.includes("\u672A\u53D1\u5E03"))){a.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(mt.unified_setting=!mt.unified_setting,mt.unified_setting||(mt.unified_late=!1),Qt(Object.assign({},mt)),mt.unified_setting===!1&&re==""){he(re.concat({}));return}mt.unified_setting&&(he([]),Tt([{late_penalty:5}]))}},v.a.createElement(P.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),v.a.createElement(P.a,{disabled:(tt==null||((ft=tt.group_settings)===null||ft===void 0)?void 0:ft.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(tt==null||((dt=tt.group_settings)===null||dt===void 0)?void 0:dt.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"))),mt.unified_setting&&v.a.createElement("div",null,v.a.createElement(D.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:pt||!(fn!=null&&(Nt=fn.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03")||fn!=null&&(Ze=fn.homework_status)!==null&&Ze!==void 0&&Ze.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(Ne){return Ke(Ne,tt==null?void 0:tt.course_end_date)},disabledTime:function(Ne){return be(Ne)},value:mt.publish_time?z()(mt.publish_time):"",onChange:function(Ne,xt){mt.publish_time=xt,(mt.end_time==""||!mt.end_time)&&mt.unified_setting&&(mt.end_time=z()(Ne).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Qt(Object.assign({},mt))}})),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(D.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:z()(Object(Z.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:pt||Re,disabledDate:function(Ne){return Ke(Ne,tt==null?void 0:tt.course_end_date,mt.publish_time)},disabledTime:function(Ne){return be(Ne,mt.publish_time)},value:mt.end_time?z()(mt.end_time):"",onChange:function(Ne,xt){mt.end_time=xt,Qt(Object.assign({},mt))}})),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)")))),!mt.unified_setting&&((Bt=re)===null||Bt===void 0?void 0:Bt.length)>0&&v.a.createElement(D.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},v.a.createElement(d.a,{span:24},v.a.createElement(D.a,null,v.a.createElement(d.a,{span:10}),v.a.createElement(d.a,{span:10},v.a.createElement(D.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}))),re&&re.map(function(_e,Ne){var xt,Xt,vn,Mn,ci;return v.a.createElement(d.a,{span:24,key:Ne},v.a.createElement(D.a,{gutter:[8,16]},v.a.createElement(d.a,{span:10},v.a.createElement(D.a,{gutter:[8,16]},v.a.createElement(d.a,null,"\u53D1\u5E03\u89C4\u5219 ",Ne+1),v.a.createElement(d.a,{flex:"1",style:{maxWidth:300}},v.a.createElement(O.a,{disabled:pt||!(fn!=null&&(xt=fn.homework_status)!==null&&xt!==void 0&&xt.includes("\u672A\u53D1\u5E03"))&&_e.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:_e.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Cn){re[Ne].group_name=Cn,re[Ne].group_id=_e.group_id;var Ti=Object(T.flattenDeep)(re.map(function(hi){return hi.group_name})),Wi=Be.map(function(hi){var fi=(hi==null?void 0:hi.group_name)||[];return Object(R.a)(Object(R.a)({},hi),{},{group_name:Object(T.remove)(fi,function(ji){return Ti.includes(ji)})})});Tt(Wi),he(re.slice())}},tt.group_settings&&tt.group_settings.map(function($n){var Cn=re.map(function(Ti){return Ti.group_name}).flat();if(!Cn.includes($n.group_name))return v.a.createElement(nt,{value:$n.group_name,key:$n.id},$n.group_name)}))))),v.a.createElement(d.a,{span:10},v.a.createElement("div",{className:"ml30"},v.a.createElement(de,{ranges:{\u6B64\u523B:[_e.publish_time?z()(_e.publish_time):z()(),z()()]},allowClear:!1,disabled:pt||(z()()<=z()((Xt=ce((vn=_e.group_id)===null||vn===void 0?void 0:vn[0]))===null||Xt===void 0?void 0:Xt.publish_time)?!1:[!0,At((Mn=_e.group_id)===null||Mn===void 0?void 0:Mn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(Cn){return Ke(Cn,tt==null?void 0:tt.course_end_date)},disabledTime:function(Cn){return be(Cn)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[z()(Object(Z.d)(),"HH:mm"),z()(Object(Z.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:_e.publish_time&&[z()(_e.publish_time),_e.end_time?z()(_e.end_time):void 0],onChange:function(Cn,Ti){re[Ne].publish_time=Ti[0],re[Ne].end_time=Ti[1],he(Object(n.a)(re))}}))),!pt&&v.a.createElement(d.a,{span:4},Ne>0&&!_e.id&&v.a.createElement(p.a,{onClick:function(){re=re.filter(function(Cn,Ti){return Ne!==Ti}),he(re.slice()),setTimeout(function(){return he(re.slice())},10)}}),re.length<(tt==null||((ci=tt.group_settings)===null||ci===void 0)?void 0:ci.length)&&v.a.createElement(E.a,{className:"c-green ml20",onClick:function(){he(re.concat({}))}}))))})),v.a.createElement(M.a,null),v.a.createElement(D.a,null,v.a.createElement(d.a,null,v.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),v.a.createElement(K.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},v.a.createElement(U.a,{style:{marginLeft:4,cursor:"pointer"}}))),v.a.createElement(d.a,{span:24,className:"mt15 pl30"},v.a.createElement(Y.a,{checked:mt.allow_late,disabled:pt||ot,onChange:function(){mt.allow_late=!mt.allow_late,Be==""&&Tt([{late_penalty:5}]),Qt(Object.assign({},mt))}},v.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),v.a.createElement(K.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(U.a,null)))),(mt==null?void 0:mt.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(P.a.Group,{disabled:pt||(tt==null?void 0:tt.anonymous_comment)||(tt==null?void 0:tt.allow_late),value:mt.unified_late,onChange:function(Ne){mt.unified_late=Ne.target.value,Be==""&&!Ne.target.value&&Tt([{penalty_type:Ie.a.Percent,late_penalty:20}]),Qt(Object(R.a)({},mt))}},(mt==null?void 0:mt.unified_setting)&&v.a.createElement(P.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(tt==null||((Ut=tt.group_settings)===null||Ut===void 0)?void 0:Ut.length)>0&&v.a.createElement(P.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),mt!=null&&mt.unified_late?v.a.createElement(v.a.Fragment,null,v.a.createElement(D.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(Ie.b,{disabled:pt||Yt,value:{type:mt.penalty_type,inputValue:mt.late_penalty},onChange:function(Ne){Qt(Object(R.a)(Object(R.a)({},mt),{},{late_penalty:Ne.inputValue,penalty_type:Ne.type}))}})),v.a.createElement(d.a,{flex:"1",className:"ml5"},v.a.createElement("span",{className:"c-grey-c ml10"},mt.penalty_type===Ie.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),v.a.createElement(D.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:z()(Object(Z.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:pt||Yt,value:mt.late_time?z()(mt.late_time):"",disabledDate:function(Ne){return Ke(Ne,tt==null?void 0:tt.course_end_date)},onChange:function(Ne,xt){mt.late_time=xt,Qt(Object.assign({},mt))}})),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)")))):Be.map(function(_e,Ne){var xt;return v.a.createElement(d.a,{span:24,key:Ne},v.a.createElement(D.a,{className:"mt25"},v.a.createElement(d.a,{style:{marginLeft:30}},v.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Ne+1,"\uFF1A"),v.a.createElement(O.a,{disabled:pt||!(fn!=null&&(xt=fn.homework_status)!==null&&xt!==void 0&&xt.includes("\u672A\u53D1\u5E03"))&&_e.id||(tt==null?void 0:tt.anonymous_comment),mode:"multiple",style:{width:306},value:typeof _e.group_name=="string"?[_e.group_name]:_e.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(vn){Be[Ne].group_name=vn,Be[Ne].group_id=_e.group_id,Tt(Be.slice())}},tt.group_settings&&tt.group_settings.map(function(Xt){var vn=Be.map(function(ci){return ci.group_name}).flat(),Mn=re.map(function(ci){return ci.group_name}).flat();if(mt!=null&&mt.unified_setting){if(!vn.includes(Xt.group_name))return v.a.createElement(nt,{value:Xt.group_name,key:Xt.id},Xt.group_name)}else if(Mn.includes(Xt.group_name)&&(!vn.includes(Xt.group_name)&&z()(Xt.end_time)<=z()()))return v.a.createElement(nt,{value:Xt.group_name,key:Xt.id},Xt.group_name)}))),v.a.createElement(d.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),v.a.createElement(Ie.b,{disabled:pt||rn(_e.id),value:{type:_e.penalty_type,inputValue:_e.late_penalty},onChange:function(vn){Be[Ne].late_penalty=vn.inputValue,Be[Ne].penalty_type=vn.type,Tt(Object(n.a)(Be))}})),v.a.createElement(d.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),v.a.createElement(_.a,{disabled:pt||rn(_e.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:z()(Object(Z.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(vn){return Ke(vn,tt==null?void 0:tt.course_end_date)},format:"YYYY-MM-DD HH:mm",value:_e!=null&&_e.late_time?z()(_e.late_time):void 0,onChange:function(vn,Mn){Be[Ne].late_time=Mn,Tt(Object(n.a)(Be))}})),!pt&&v.a.createElement(d.a,{className:"ml20"},Ne>0&&!_e.id&&v.a.createElement(p.a,{onClick:function(){Be=Be.filter(function(vn,Mn){return Ne!==Mn}),Tt(Be.slice()),setTimeout(function(){return Tt(Be.slice())},10)}}),v.a.createElement(E.a,{className:"c-green ml20",onClick:function(){Tt(Be.concat({penalty_type:Ie.a.Percent,late_minus_score:20}))}}))))})),v.a.createElement(M.a,null),!pt&&v.a.createElement(d.a,{className:"mb50"},v.a.createElement(m.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:Ae,onClick:function(){return yt()}},"\u63D0\u4EA4"),v.a.createElement(m.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Ct(!0),gt()}},"\u53D6\u6D88")))};Qe.a=Object(xe.a)(function(jt){var wt=jt.shixunHomeworks,ze=jt.loading;return{shixunHomeworks:wt,loading:ze.effects}})(Kt)},fyJ8:function(tn,Qe,I){"use strict";var te=I("rePB"),Y=I("VTBJ"),N=I("Ff2n"),K=I("U8pU"),A=I("q1tI"),M=I.n(A),H=I("TSYQ"),P=I.n(H),k=I("c+Xe"),D=I("sR1s");function b(r){return r&&Object(K.a)(r)==="object"&&!Array.isArray(r)&&!A.isValidElement(r)}function m(r){return typeof r=="string"?!0:Object(k.c)(r)}function f(r,u){var o,a=r.prefixCls,n=r.className,R=r.record,w=r.index,x=r.dataIndex,O=r.render,C=r.children,_=r.component,y=_===void 0?"td":_,h=r.colSpan,c=r.rowSpan,v=r.fixLeft,p=r.fixRight,E=r.firstFixLeft,U=r.lastFixLeft,F=r.firstFixRight,z=r.lastFixRight,G=r.appendNode,B=r.additionalProps,T=B===void 0?{}:B,V=r.ellipsis,Z=r.align,oe=r.rowType,pe=r.isSticky,Ye="".concat(a,"-cell"),xe,Ie;if(C)Ie=C;else{var Je=Object(D.b)(R,x);if(Ie=Je,O){var Ke=O(Je,R,w);b(Ke)?(Ie=Ke.children,xe=Ke.props):Ie=Ke}}Object(K.a)(Ie)==="object"&&!Array.isArray(Ie)&&!A.isValidElement(Ie)&&(Ie=null),V&&(U||F)&&(Ie=A.createElement("span",{className:"".concat(Ye,"-content")},Ie));var be=xe||{},de=be.colSpan,nt=be.rowSpan,Kt=be.style,jt=be.className,wt=Object(N.a)(be,["colSpan","rowSpan","style","className"]),ze=de!==void 0?de:h,ft=nt!==void 0?nt:c;if(ze===0||ft===0)return null;var dt={},Nt=typeof v=="number",Ze=typeof p=="number";Nt&&(dt.position="sticky",dt.left=v),Ze&&(dt.position="sticky",dt.right=p);var Bt={};Z&&(Bt.textAlign=Z);var Ut,Mt=V===!0?{showTitle:!0}:V;Mt&&(Mt.showTitle||oe==="header")&&(typeof Ie=="string"||typeof Ie=="number"?Ut=Ie.toString():A.isValidElement(Ie)&&typeof Ie.props.children=="string"&&(Ut=Ie.props.children));var An=Object(Y.a)(Object(Y.a)(Object(Y.a)({title:Ut},wt),T),{},{colSpan:ze&&ze!==1?ze:null,rowSpan:ft&&ft!==1?ft:null,className:P()(Ye,n,(o={},Object(te.a)(o,"".concat(Ye,"-fix-left"),Nt),Object(te.a)(o,"".concat(Ye,"-fix-left-first"),E),Object(te.a)(o,"".concat(Ye,"-fix-left-last"),U),Object(te.a)(o,"".concat(Ye,"-fix-right"),Ze),Object(te.a)(o,"".concat(Ye,"-fix-right-first"),F),Object(te.a)(o,"".concat(Ye,"-fix-right-last"),z),Object(te.a)(o,"".concat(Ye,"-ellipsis"),V),Object(te.a)(o,"".concat(Ye,"-with-append"),G),Object(te.a)(o,"".concat(Ye,"-fix-sticky"),(Nt||Ze)&&pe),o),T.className,jt),style:Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},T.style),Bt),dt),Kt),ref:m(y)?u:null});return A.createElement(y,Object.assign({},An),G,Ie)}var d=A.forwardRef(f);d.displayName="Cell";var s=A.memo(d,function(r,u){return u.shouldCellUpdate?!u.shouldCellUpdate(u.record,r.record):!1});Qe.a=s},hW8S:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return K}),I.d(Qe,"c",function(){return A}),I.d(Qe,"b",function(){return M});var te=I("VTBJ"),Y=I("Ff2n"),N=I("Kwbf"),K="RC_TABLE_INTERNAL_COL_DEFINE";function A(H){var P=H.expandable,k=Object(Y.a)(H,["expandable"]);return"expandable"in H?Object(te.a)(Object(te.a)({},k),P):k}function M(H){return Object.keys(H).reduce(function(P,k){return(k.substr(0,5)==="data-"||k.substr(0,5)==="aria-")&&(P[k]=H[k]),P},{})}},iF7n:function(tn,Qe,I){tn.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(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return mi});var te=I("rePB"),Y=I("ODXe"),N=I("Ff2n"),K=I("VTBJ"),A=I("q1tI"),M=I("TSYQ"),H=I.n(M),P=I("Zm9Q"),k=I("6cGi"),D=I("KQm4"),b=I("xEkU"),m=I.n(b),f=I("t23M");function d(ye){var Me=Object(A.useRef)(),We=Object(A.useRef)(!1);function we(){for(var ie=arguments.length,fe=new Array(ie),le=0;leat&&(un=at-qt),Object(A.useMemo)(function(){if(!fe.length)return[0,0];for(var Hn=fe.length,Gn=Hn,di=0;diLe+un){Gn=di-1;break}}for(var Ei=0,Ri=Hn-1;Ri>=0;Ri-=1){var gi=ye.get(fe[Ri].key)||R;if(gi[$e]1&&arguments[1]!==void 0?arguments[1]:!1,we=Me&&typeof Me.getBoundingClientRect=="function"&&Me.getBoundingClientRect().width;if(we){if(We){var ie=getComputedStyle(Me),fe=ie.marginLeft,le=ie.marginRight;we+=+fe.replace("px","")+ +le.replace("px","")}we=+we.toFixed(6)}return we||0},Ut=function(Me,We,we){Me&&Object(F.a)(Me.style)==="object"&&(Me.style[We]=we)},Mt=function(){return jt.any},An=I("bdgK"),mn=I("i8i4"),pn=I.n(mn),tt=I("wgJM"),fn=I("l4aY"),In=I("m+aA"),He=I("c+Xe"),Ue=I("zT1h"),pt=I("QC+M");function Ct(ye,Me,We){return We?ye[0]===Me[0]:ye[0]===Me[0]&&ye[1]===Me[1]}function Ge(ye,Me,We){var we=ye[Me]||{};return Object(K.a)(Object(K.a)({},we),We)}function vt(ye,Me,We,we){for(var ie=We.points,fe=Object.keys(ye),le=0;le1&&arguments[1]!==void 0?arguments[1]:2;Me();var fe=Object(tt.a)(function(){ie<=1?we({isCanceled:function(){return fe!==ye.current}}):We(we,ie-1)});ye.current=fe}return A.useEffect(function(){return function(){Me()}},[]),[We,Me]},Mn=[ot,Yt,rn,_e],ci=!1,$n=!0;function Cn(ye){return ye===rn||ye===_e}var Ti=function(ye,Me){var We=A.useState(At),we=Object(Y.a)(We,2),ie=we[0],fe=we[1],le=vn(),Se=Object(Y.a)(le,2),De=Se[0],$e=Se[1];function Le(){fe(ot)}return Xt(function(){if(ie!==At&&ie!==_e){var at=Mn.indexOf(ie),It=Mn[at+1],qt=Me(ie);qt===ci?fe(It):De(function(un){function Hn(){if(un.isCanceled())return;fe(It)}qt===!0?Hn():Promise.resolve(qt).then(Hn)})}},[ye,ie]),A.useEffect(function(){return function(){$e()}},[]),[Le,ie]},Wi=function(ye){var Me=Object(A.useRef)(),We=Object(A.useRef)(ye);We.current=ye;var we=A.useCallback(function(le){We.current(le)},[]);function ie(le){le&&(le.removeEventListener(Qt,we),le.removeEventListener(mt,we))}function fe(le){Me.current&&Me.current!==le&&ie(Me.current),le&&le!==Me.current&&(le.addEventListener(Qt,we),le.addEventListener(mt,we),Me.current=le)}return A.useEffect(function(){return function(){ie(Me.current)}},[]),[fe,ie]};function hi(ye,Me,We,we){var ie=we.motionEnter,fe=ie===void 0?!0:ie,le=we.motionAppear,Se=le===void 0?!0:le,De=we.motionLeave,$e=De===void 0?!0:De,Le=we.motionDeadline,at=we.motionLeaveImmediately,It=we.onAppearPrepare,qt=we.onEnterPrepare,un=we.onLeavePrepare,Hn=we.onAppearStart,Gn=we.onEnterStart,di=we.onLeaveStart,li=we.onAppearActive,Ei=we.onEnterActive,Ri=we.onLeaveActive,gi=we.onAppearEnd,xi=we.onEnterEnd,Di=we.onLeaveEnd,dn=we.onVisibleChanged,Zt=Ne(),yn=Object(Y.a)(Zt,2),Ht=yn[0],Wt=yn[1],pi=Ne(yt),Pi=Object(Y.a)(pi,2),ni=Pi[0],Ii=Pi[1],or=Ne(null),Ni=Object(Y.a)(or,2),Yi=Ni[0],zi=Ni[1],Hi=Object(A.useRef)(!1),Bi=Object(A.useRef)(null),vi=Object(A.useRef)(!1),_r=Object(A.useRef)(null);function Jr(){var sr=We();return sr||_r.current}var jr=Object(A.useRef)(!1);function Rr(sr){var Qi=Jr();if(sr&&!sr.deadline&&sr.target!==Qi)return;var wr;ni===rt&&jr.current?wr=gi==null?void 0:gi(Qi,sr):ni===ce&&jr.current?wr=xi==null?void 0:xi(Qi,sr):ni===Re&&jr.current&&(wr=Di==null?void 0:Di(Qi,sr)),wr!==!1&&!vi.current&&(Ii(yt),zi(null))}var ur=Wi(Rr),Zi=Object(Y.a)(ur,1),rr=Zi[0],dr=A.useMemo(function(){var sr,Qi,wr;switch(ni){case"appear":return sr={},Object(te.a)(sr,ot,It),Object(te.a)(sr,Yt,Hn),Object(te.a)(sr,rn,li),sr;case"enter":return Qi={},Object(te.a)(Qi,ot,qt),Object(te.a)(Qi,Yt,Gn),Object(te.a)(Qi,rn,Ei),Qi;case"leave":return wr={},Object(te.a)(wr,ot,un),Object(te.a)(wr,Yt,di),Object(te.a)(wr,rn,Ri),wr;default:return{}}},[ni]),Fr=Ti(ni,function(sr){if(sr===ot){var Qi=dr[ot];return Qi?Qi(Jr()):ci}if(qi in dr){var wr;zi(((wr=dr[qi])===null||wr===void 0?void 0:wr.call(dr,Jr(),null))||null)}return qi===rn&&(rr(Jr()),Le>0&&(clearTimeout(Bi.current),Bi.current=setTimeout(function(){Rr({deadline:!0})},Le))),$n}),ha=Object(Y.a)(Fr,2),sa=ha[0],qi=ha[1],Zr=Cn(qi);jr.current=Zr,Xt(function(){Wt(Me);var sr=Hi.current;if(Hi.current=!0,!ye)return;var Qi;!sr&&Me&&Se&&(Qi=rt),sr&&Me&&fe&&(Qi=ce),(sr&&!Me&&$e||!sr&&at&&!Me&&$e)&&(Qi=Re),Qi&&(Ii(Qi),sa())},[Me]),Object(A.useEffect)(function(){(ni===rt&&!Se||ni===ce&&!fe||ni===Re&&!$e)&&Ii(yt)},[Se,fe,$e]),Object(A.useEffect)(function(){return function(){clearTimeout(Bi.current),vi.current=!0}},[]),Object(A.useEffect)(function(){Ht!==void 0&&ni===yt&&(dn==null||dn(Ht))},[Ht,ni]);var qr=Yi;return dr[ot]&&qi===Yt&&(qr=Object(K.a)({transition:"none"},qr)),[ni,qi,qr,Ht!=null?Ht:Me]}var fi=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){return Object(O.a)(this,We),Me.apply(this,arguments)}return Object(C.a)(We,[{key:"render",value:function(){return this.props.children}}]),We}(A.Component),ji=fi;function er(ye){var Me=ye;Object(F.a)(ye)==="object"&&(Me=ye.transitionSupport);function We(ie){return!!(ie.motionName&&Me)}var we=A.forwardRef(function(ie,fe){var le=ie.visible,Se=le===void 0?!0:le,De=ie.removeOnLeave,$e=De===void 0?!0:De,Le=ie.forceRender,at=ie.children,It=ie.motionName,qt=ie.leavedClassName,un=ie.eventProps,Hn=We(ie),Gn=Object(A.useRef)(),di=Object(A.useRef)();function li(){try{return Object(In.a)(Gn.current||di.current)}catch(Ii){return null}}var Ei=hi(Hn,Se,li,ie),Ri=Object(Y.a)(Ei,4),gi=Ri[0],xi=Ri[1],Di=Ri[2],dn=Ri[3],Zt=A.useRef(dn);dn&&(Zt.current=!0);var yn=Object(A.useRef)(fe);yn.current=fe;var Ht=A.useCallback(function(Ii){Gn.current=Ii,Object(He.b)(yn.current,Ii)},[]),Wt,pi=Object(K.a)(Object(K.a)({},un),{},{visible:Se});if(!at)Wt=null;else if(gi===yt||!We(ie))dn?Wt=at(Object(K.a)({},pi),Ht):!$e&&Zt.current?Wt=at(Object(K.a)(Object(K.a)({},pi),{},{className:qt}),Ht):Le?Wt=at(Object(K.a)(Object(K.a)({},pi),{},{style:{display:"none"}}),Ht):Wt=null;else{var Pi,ni;xi===ot?ni="prepare":Cn(xi)?ni="active":xi===Yt&&(ni="start"),Wt=at(Object(K.a)(Object(K.a)({},pi),{},{className:H()(gt(It,gi),(Pi={},Object(te.a)(Pi,gt(It,"".concat(gi,"-").concat(ni)),ni),Object(te.a)(Pi,It,typeof It=="string"),Pi)),style:Di}),Ht)}return A.createElement(ji,{ref:di},Wt)});return we.displayName="CSSMotion",we}var yr=er(En),cn="add",ri="keep",pr="remove",Cr="removed";function tr(ye){var Me;return ye&&Object(F.a)(ye)==="object"&&"key"in ye?Me=ye:Me={key:ye},Object(K.a)(Object(K.a)({},Me),{},{key:String(Me.key)})}function nr(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ye.map(tr)}function X(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],We=[],we=0,ie=Me.length,fe=nr(ye),le=nr(Me);fe.forEach(function($e){for(var Le=!1,at=we;at1});return De.forEach(function($e){We=We.filter(function(Le){var at=Le.key,It=Le.status;return at!==$e||It!==pr}),We.forEach(function(Le){Le.key===$e&&(Le.status=ri)})}),We}var S=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function L(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yr,We=function(we){Object(y.a)(fe,we);var ie=Object(h.a)(fe);function fe(){var le;return Object(O.a)(this,fe),le=ie.apply(this,arguments),le.state={keyEntities:[]},le.removeKey=function(Se){le.setState(function(De){var $e=De.keyEntities;return{keyEntities:$e.map(function(Le){return Le.key!==Se?Le:Object(K.a)(Object(K.a)({},Le),{},{status:Cr})})}})},le}return Object(C.a)(fe,[{key:"render",value:function(){var Se=this,De=this.state.keyEntities,$e=this.props,Le=$e.component,at=$e.children,It=$e.onVisibleChanged,qt=Object(N.a)($e,["component","children","onVisibleChanged"]),un=Le||A.Fragment,Hn={};return S.forEach(function(Gn){Hn[Gn]=qt[Gn],delete qt[Gn]}),delete qt.keys,A.createElement(un,qt,De.map(function(Gn){var di=Gn.status,li=Object(N.a)(Gn,["status"]),Ei=di===cn||di===ri;return A.createElement(Me,Object(x.a)({},Hn,{key:li.key,visible:Ei,eventProps:li,onVisibleChanged:function(gi){It==null||It(gi,{key:li.key}),gi||Se.removeKey(li.key)}}),at)}))}}],[{key:"getDerivedStateFromProps",value:function(Se,De){var $e=Se.keys,Le=De.keyEntities,at=nr($e),It=X(Le,at);return{keyEntities:It.filter(function(qt){var un=Le.find(function(Hn){var Gn=Hn.key;return qt.key===Gn});return!(un&&un.status===Cr&&qt.status===pr)})}}}]),fe}(A.Component);return We.defaultProps={component:"div"},We}var W=L(En),ne=yr;function Q(ye){var Me=ye.prefixCls,We=ye.motion,we=ye.animation,ie=ye.transitionName;return We||(we?{motionName:"".concat(Me,"-").concat(we)}:ie?{motionName:ie}:null)}function ke(ye){var Me=ye.prefixCls,We=ye.visible,we=ye.zIndex,ie=ye.mask,fe=ye.maskMotion,le=ye.maskAnimation,Se=ye.maskTransitionName;if(!ie)return null;var De={};return(fe||Se||le)&&(De=Object(K.a)({motionAppear:!0},Q({motion:fe,prefixCls:Me,transitionName:Se,animation:le}))),A.createElement(ne,Object(x.a)({},De,{visible:We,removeOnLeave:!0}),function($e){var Le=$e.className;return A.createElement("div",{style:{zIndex:we},className:H()("".concat(Me,"-mask"),Le)})})}var Vt=I("9mu1"),kn=I("o0o1"),Qn=I.n(kn),nn=I("HaE+"),ti=["measure","align",null,"motion"],qn=function(ye,Me){var We=Object(A.useState)(null),we=Object(Y.a)(We,2),ie=we[0],fe=we[1],le=Object(A.useRef)(),Se=Object(A.useRef)(!1);function De(at){Se.current||fe(at)}function $e(){tt.a.cancel(le.current)}function Le(at){$e(),le.current=Object(tt.a)(function(){De(function(It){switch(ie){case"align":return"motion";case"motion":return"stable";default:}return It}),at==null||at()})}return Object(A.useEffect)(function(){De("measure")},[ye]),Object(A.useEffect)(function(){switch(ie){case"measure":Me();break;default:}ie&&(le.current=Object(tt.a)(Object(nn.a)(Qn.a.mark(function at(){var It,qt;return Qn.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:It=ti.indexOf(ie),qt=ti[It+1],qt&&It!==-1&&De(qt);case 3:case"end":return Hn.stop()}},at)}))))},[ie]),Object(A.useEffect)(function(){return function(){Se.current=!0,$e()}},[]),[ie,Le]},Li=function(ye){var Me=A.useState({width:0,height:0}),We=Object(Y.a)(Me,2),we=We[0],ie=We[1];function fe(Se){ie({width:Se.offsetWidth,height:Se.offsetHeight})}var le=A.useMemo(function(){var Se={};if(ye){var De=we.width,$e=we.height;ye.indexOf("height")!==-1&&$e?Se.height=$e:ye.indexOf("minHeight")!==-1&&$e&&(Se.minHeight=$e),ye.indexOf("width")!==-1&&De?Se.width=De:ye.indexOf("minWidth")!==-1&&De&&(Se.minWidth=De)}return Se},[ye,we]);return[le,fe]},lr=A.forwardRef(function(ye,Me){var We=ye.visible,we=ye.prefixCls,ie=ye.className,fe=ye.style,le=ye.children,Se=ye.zIndex,De=ye.stretch,$e=ye.destroyPopupOnHide,Le=ye.forceRender,at=ye.align,It=ye.point,qt=ye.getRootDomNode,un=ye.getClassNameFromAlign,Hn=ye.onAlign,Gn=ye.onMouseEnter,di=ye.onMouseLeave,li=ye.onMouseDown,Ei=ye.onTouchStart,Ri=Object(A.useRef)(),gi=Object(A.useRef)(),xi=Object(A.useState)(),Di=Object(Y.a)(xi,2),dn=Di[0],Zt=Di[1],yn=Li(De),Ht=Object(Y.a)(yn,2),Wt=Ht[0],pi=Ht[1];function Pi(){De&&pi(qt())}var ni=qn(We,Pi),Ii=Object(Y.a)(ni,2),or=Ii[0],Ni=Ii[1],Yi=Object(A.useRef)();function zi(){return It||qt}function Hi(){var ur;(ur=Ri.current)===null||ur===void 0||ur.forceAlign()}function Bi(ur,Zi){var rr=un(Zi);dn!==rr&&Zt(rr),or==="align"&&(dn!==rr?Promise.resolve().then(function(){Hi()}):Ni(function(){var dr;(dr=Yi.current)===null||dr===void 0||dr.call(Yi)}),Hn==null||Hn(ur,Zi))}var vi=Object(K.a)({},Q(ye));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ur){var Zi=vi[ur];vi[ur]=function(rr,dr){return Ni(),Zi==null?void 0:Zi(rr,dr)}});function _r(){return new Promise(function(ur){Yi.current=ur})}A.useEffect(function(){!vi.motionName&&or==="motion"&&Ni()},[vi.motionName,or]),A.useImperativeHandle(Me,function(){return{forceAlign:Hi,getElement:function(){return gi.current}}});var Jr=Object(K.a)(Object(K.a)({},Wt),{},{zIndex:Se,opacity:or==="motion"||or==="stable"||!We?void 0:0,pointerEvents:or==="stable"?void 0:"none"},fe),jr=!0;(at==null?void 0:at.points)&&(or==="align"||or==="stable")&&(jr=!1);var Rr=le;return A.Children.count(le)>1&&(Rr=A.createElement("div",{className:"".concat(we,"-content")},le)),A.createElement(ne,Object(x.a)({visible:We,ref:gi,leavedClassName:"".concat(we,"-hidden")},vi,{onAppearPrepare:_r,onEnterPrepare:_r,removeOnLeave:$e,forceRender:Le}),function(ur,Zi){var rr=ur.className,dr=ur.style,Fr=H()(we,ie,dn,rr);return A.createElement(Vt.a,{target:zi(),key:"popup",ref:Ri,monitorWindowResize:!0,disabled:jr,align:at,onAlign:Bi},A.createElement("div",{ref:Zi,className:Fr,onMouseEnter:Gn,onMouseLeave:di,onMouseDownCapture:li,onTouchStartCapture:Ei,style:Object(K.a)(Object(K.a)({},dr),Jr)},Rr))})});lr.displayName="PopupInner";var ar=lr,Ki=A.forwardRef(function(ye,Me){var We=ye.prefixCls,we=ye.visible,ie=ye.zIndex,fe=ye.children,le=ye.mobile;le=le===void 0?{}:le;var Se=le.popupClassName,De=le.popupStyle,$e=le.popupMotion,Le=$e===void 0?{}:$e,at=le.popupRender,It=A.useRef();A.useImperativeHandle(Me,function(){return{forceAlign:function(){},getElement:function(){return It.current}}});var qt=Object(K.a)({zIndex:ie},De),un=fe;return A.Children.count(fe)>1&&(un=A.createElement("div",{className:"".concat(We,"-content")},fe)),at&&(un=at(un)),A.createElement(ne,Object(x.a)({visible:we,ref:It,removeOnLeave:!0},Le),function(Hn,Gn){var di=Hn.className,li=Hn.style,Ei=H()(We,Se,di);return A.createElement("div",{ref:Gn,className:Ei,style:Object(K.a)(Object(K.a)({},li),qt)},un)})});Ki.displayName="MobilePopupInner";var Pr=Ki,Vr=["visible","mobile"],Ai=A.forwardRef(function(ye,Me){var We=ye.visible,we=ye.mobile,ie=Object(N.a)(ye,Vr),fe=Object(A.useState)(We),le=Object(Y.a)(fe,2),Se=le[0],De=le[1],$e=Object(A.useState)(!1),Le=Object(Y.a)($e,2),at=Le[0],It=Le[1],qt=Object(K.a)(Object(K.a)({},ie),{},{visible:Se});Object(A.useEffect)(function(){De(We),We&&we&&It(Ae())},[We,we]);var un=at?A.createElement(Pr,Object(x.a)({},qt,{mobile:we,ref:Me})):A.createElement(ar,Object(x.a)({},qt,{ref:Me}));return A.createElement("div",null,A.createElement(ke,qt),un)});Ai.displayName="Popup";var wi=Ai,ir=A.createContext(null),Fi=ir;function Bn(){}function gn(){return""}function Tn(ye){return ye?ye.ownerDocument:window.document}var _n=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function si(ye){var Me=function(We){Object(y.a)(ie,We);var we=Object(h.a)(ie);function ie(fe){var le;Object(O.a)(this,ie),le=we.call(this,fe),le.popupRef=A.createRef(),le.triggerRef=A.createRef(),le.attachId=void 0,le.clickOutsideHandler=void 0,le.touchOutsideHandler=void 0,le.contextMenuOutsideHandler1=void 0,le.contextMenuOutsideHandler2=void 0,le.mouseDownTimeout=void 0,le.focusTime=void 0,le.preClickTime=void 0,le.preTouchTime=void 0,le.delayTimer=void 0,le.hasPopupMouseDown=void 0,le.onMouseEnter=function(De){var $e=le.props.mouseEnterDelay;le.fireEvents("onMouseEnter",De),le.delaySetPopupVisible(!0,$e,$e?null:De)},le.onMouseMove=function(De){le.fireEvents("onMouseMove",De),le.setPoint(De)},le.onMouseLeave=function(De){le.fireEvents("onMouseLeave",De),le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onPopupMouseEnter=function(){le.clearDelayTimer()},le.onPopupMouseLeave=function(De){var $e;if(De.relatedTarget&&!De.relatedTarget.setTimeout&&Object(fn.a)(($e=le.popupRef.current)===null||$e===void 0?void 0:$e.getElement(),De.relatedTarget))return;le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onFocus=function(De){le.fireEvents("onFocus",De),le.clearDelayTimer(),le.isFocusToShow()&&(le.focusTime=Date.now(),le.delaySetPopupVisible(!0,le.props.focusDelay))},le.onMouseDown=function(De){le.fireEvents("onMouseDown",De),le.preClickTime=Date.now()},le.onTouchStart=function(De){le.fireEvents("onTouchStart",De),le.preTouchTime=Date.now()},le.onBlur=function(De){le.fireEvents("onBlur",De),le.clearDelayTimer(),le.isBlurToHide()&&le.delaySetPopupVisible(!1,le.props.blurDelay)},le.onContextMenu=function(De){De.preventDefault(),le.fireEvents("onContextMenu",De),le.setPopupVisible(!0,De)},le.onContextMenuClose=function(){le.isContextMenuToShow()&&le.close()},le.onClick=function(De){if(le.fireEvents("onClick",De),le.focusTime){var $e;if(le.preClickTime&&le.preTouchTime?$e=Math.min(le.preClickTime,le.preTouchTime):le.preClickTime?$e=le.preClickTime:le.preTouchTime&&($e=le.preTouchTime),Math.abs($e-le.focusTime)<20)return;le.focusTime=0}le.preClickTime=0,le.preTouchTime=0,le.isClickToShow()&&(le.isClickToHide()||le.isBlurToHide())&&De&&De.preventDefault&&De.preventDefault();var Le=!le.state.popupVisible;(le.isClickToHide()&&!Le||Le&&le.isClickToShow())&&le.setPopupVisible(!le.state.popupVisible,De)},le.onPopupMouseDown=function(){if(le.hasPopupMouseDown=!0,clearTimeout(le.mouseDownTimeout),le.mouseDownTimeout=window.setTimeout(function(){le.hasPopupMouseDown=!1},0),le.context){var De;(De=le.context).onPopupMouseDown.apply(De,arguments)}},le.onDocumentClick=function(De){if(le.props.mask&&!le.props.maskClosable)return;var $e=De.target,Le=le.getRootDomNode(),at=le.getPopupDomNode();(!Object(fn.a)(Le,$e)||le.isContextMenuOnly())&&!Object(fn.a)(at,$e)&&!le.hasPopupMouseDown&&le.close()},le.getRootDomNode=function(){var De=le.props.getTriggerDOMNode;if(De)return De(le.triggerRef.current);try{var $e=Object(In.a)(le.triggerRef.current);if($e)return $e}catch(Le){}return pn.a.findDOMNode(Object(_.a)(le))},le.getPopupClassNameFromAlign=function(De){var $e=[],Le=le.props,at=Le.popupPlacement,It=Le.builtinPlacements,qt=Le.prefixCls,un=Le.alignPoint,Hn=Le.getPopupClassNameFromAlign;return at&&It&&$e.push(vt(It,qt,De,un)),Hn&&$e.push(Hn(De)),$e.join(" ")},le.getComponent=function(){var De=le.props,$e=De.prefixCls,Le=De.destroyPopupOnHide,at=De.popupClassName,It=De.onPopupAlign,qt=De.popupMotion,un=De.popupAnimation,Hn=De.popupTransitionName,Gn=De.popupStyle,di=De.mask,li=De.maskAnimation,Ei=De.maskTransitionName,Ri=De.maskMotion,gi=De.zIndex,xi=De.popup,Di=De.stretch,dn=De.alignPoint,Zt=De.mobile,yn=De.forceRender,Ht=le.state,Wt=Ht.popupVisible,pi=Ht.point,Pi=le.getPopupAlign(),ni={};return le.isMouseEnterToShow()&&(ni.onMouseEnter=le.onPopupMouseEnter),le.isMouseLeaveToHide()&&(ni.onMouseLeave=le.onPopupMouseLeave),ni.onMouseDown=le.onPopupMouseDown,ni.onTouchStart=le.onPopupMouseDown,A.createElement(wi,Object(x.a)({prefixCls:$e,destroyPopupOnHide:Le,visible:Wt,point:dn&&pi,className:at,align:Pi,onAlign:It,animation:un,getClassNameFromAlign:le.getPopupClassNameFromAlign},ni,{stretch:Di,getRootDomNode:le.getRootDomNode,style:Gn,mask:di,zIndex:gi,transitionName:Hn,maskAnimation:li,maskTransitionName:Ei,maskMotion:Ri,ref:le.popupRef,motion:qt,mobile:Zt,forceRender:yn}),typeof xi=="function"?xi():xi)},le.attachParent=function(De){tt.a.cancel(le.attachId);var $e=le.props,Le=$e.getPopupContainer,at=$e.getDocument,It=le.getRootDomNode(),qt;Le?(It||Le.length===0)&&(qt=Le(It)):qt=at(le.getRootDomNode()).body,qt?qt.appendChild(De):le.attachId=Object(tt.a)(function(){le.attachParent(De)})},le.getContainer=function(){var De=le.props.getDocument,$e=De(le.getRootDomNode()).createElement("div");return $e.style.position="absolute",$e.style.top="0",$e.style.left="0",$e.style.width="100%",le.attachParent($e),$e},le.setPoint=function(De){var $e=le.props.alignPoint;if(!$e||!De)return;le.setState({point:{pageX:De.pageX,pageY:De.pageY}})},le.handlePortalUpdate=function(){le.state.prevPopupVisible!==le.state.popupVisible&&le.props.afterPopupVisibleChange(le.state.popupVisible)},le.triggerContextValue={onPopupMouseDown:le.onPopupMouseDown};var Se;return"popupVisible"in fe?Se=!!fe.popupVisible:Se=!!fe.defaultPopupVisible,le.state={prevPopupVisible:Se,popupVisible:Se},_n.forEach(function(De){le["fire".concat(De)]=function($e){le.fireEvents(De,$e)}}),le}return Object(C.a)(ie,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this.props,Se=this.state;if(Se.popupVisible){var De;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(De=le.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ue.a)(De,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(De=De||le.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ue.a)(De,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(De=De||le.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ue.a)(De,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ue.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var le;return((le=this.popupRef.current)===null||le===void 0?void 0:le.getElement())||null}},{key:"getPopupAlign",value:function(){var le=this.props,Se=le.popupPlacement,De=le.popupAlign,$e=le.builtinPlacements;return Se&&$e?Ge($e,Se,De):De}},{key:"setPopupVisible",value:function(le,Se){var De=this.props.alignPoint,$e=this.state.popupVisible;this.clearDelayTimer(),$e!==le&&("popupVisible"in this.props||this.setState({popupVisible:le,prevPopupVisible:$e}),this.props.onPopupVisibleChange(le)),De&&Se&&le&&this.setPoint(Se)}},{key:"delaySetPopupVisible",value:function(le,Se,De){var $e=this,Le=Se*1e3;if(this.clearDelayTimer(),Le){var at=De?{pageX:De.pageX,pageY:De.pageY}:null;this.delayTimer=window.setTimeout(function(){$e.setPopupVisible(le,at),$e.clearDelayTimer()},Le)}else this.setPopupVisible(le,De)}},{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(le){var Se=this.props.children.props,De=this.props;return Se[le]&&De[le]?this["fire".concat(le)]:Se[le]||De[le]}},{key:"isClickToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("click")!==-1||De.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var le=this.props.action;return le==="contextMenu"||le.length===1&&le[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("contextMenu")!==-1||De.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var le=this.props,Se=le.action,De=le.hideAction;return Se.indexOf("click")!==-1||De.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("hover")!==-1||De.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var le=this.props,Se=le.action,De=le.hideAction;return Se.indexOf("hover")!==-1||De.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("focus")!==-1||De.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var le=this.props,Se=le.action,De=le.hideAction;return Se.indexOf("focus")!==-1||De.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var le;(le=this.popupRef.current)===null||le===void 0||le.forceAlign()}}},{key:"fireEvents",value:function(le,Se){var De=this.props.children.props[le];De&&De(Se);var $e=this.props[le];$e&&$e(Se)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var le=this.state.popupVisible,Se=this.props,De=Se.children,$e=Se.forceRender,Le=Se.alignPoint,at=Se.className,It=Se.autoDestroy,qt=A.Children.only(De),un={key:"trigger"};this.isContextMenuToShow()?un.onContextMenu=this.onContextMenu:un.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(un.onClick=this.onClick,un.onMouseDown=this.onMouseDown,un.onTouchStart=this.onTouchStart):(un.onClick=this.createTwoChains("onClick"),un.onMouseDown=this.createTwoChains("onMouseDown"),un.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(un.onMouseEnter=this.onMouseEnter,Le&&(un.onMouseMove=this.onMouseMove)):un.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?un.onMouseLeave=this.onMouseLeave:un.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(un.onFocus=this.onFocus,un.onBlur=this.onBlur):(un.onFocus=this.createTwoChains("onFocus"),un.onBlur=this.createTwoChains("onBlur"));var Hn=H()(qt&&qt.props&&qt.props.className,at);Hn&&(un.className=Hn);var Gn=Object(K.a)({},un);Object(He.c)(qt)&&(Gn.ref=Object(He.a)(this.triggerRef,qt.ref));var di=A.cloneElement(qt,Gn),li;return(le||this.popupRef.current||$e)&&(li=A.createElement(ye,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!le&&It&&(li=null),A.createElement(Fi.Provider,{value:this.triggerContextValue},di,li)}}],[{key:"getDerivedStateFromProps",value:function(le,Se){var De=le.popupVisible,$e={};return De!==void 0&&Se.popupVisible!==De&&($e.popupVisible=De,$e.prevPopupVisible=Se.popupVisible),$e}}]),ie}(A.Component);return Me.contextType=Fi,Me.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:gn,getDocument:Tn,onPopupVisibleChange:Bn,afterPopupVisibleChange:Bn,onPopupAlign:Bn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Me}var ai=si(pt.a),J={adjustX:1,adjustY:1},ue={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Ce={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Te=ue,qe=0,Oe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ve=function(Me,We,we){var ie=ft(We),fe=Me.getState();Me.setState({defaultActiveFirst:Object(K.a)(Object(K.a)({},fe.defaultActiveFirst),{},Object(te.a)({},ie,we))})},et=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(we){var ie;Object(O.a)(this,We),ie=Me.call(this,we),ie.onDestroy=function(Le){ie.props.onDestroy(Le)},ie.onKeyDown=function(Le){var at=Le.keyCode,It=ie.menuInstance,qt=ie.props.store,un=ie.getVisible();if(at===r.a.ENTER)return ie.onTitleClick(Le),Ve(qt,ie.props.eventKey,!0),!0;if(at===r.a.RIGHT)return un?It.onKeyDown(Le):(ie.triggerOpenChange(!0),Ve(qt,ie.props.eventKey,!0)),!0;if(at===r.a.LEFT){var Hn;if(un)Hn=It.onKeyDown(Le);else return;return Hn||(ie.triggerOpenChange(!1),Hn=!0),Hn}return un&&(at===r.a.UP||at===r.a.DOWN)?It.onKeyDown(Le):void 0},ie.onOpenChange=function(Le){ie.props.onOpenChange(Le)},ie.onPopupVisibleChange=function(Le){ie.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},ie.onMouseEnter=function(Le){var at=ie.props,It=at.eventKey,qt=at.onMouseEnter,un=at.store;Ve(un,ie.props.eventKey,!1),qt({key:It,domEvent:Le})},ie.onMouseLeave=function(Le){var at=ie.props,It=at.parentMenu,qt=at.eventKey,un=at.onMouseLeave;It.subMenuInstance=Object(_.a)(ie),un({key:qt,domEvent:Le})},ie.onTitleMouseEnter=function(Le){var at=ie.props,It=at.eventKey,qt=at.onItemHover,un=at.onTitleMouseEnter;qt({key:It,hover:!0}),un({key:It,domEvent:Le})},ie.onTitleMouseLeave=function(Le){var at=ie.props,It=at.parentMenu,qt=at.eventKey,un=at.onItemHover,Hn=at.onTitleMouseLeave;It.subMenuInstance=Object(_.a)(ie),un({key:qt,hover:!1}),Hn({key:qt,domEvent:Le})},ie.onTitleClick=function(Le){var at=Object(_.a)(ie),It=at.props;if(It.onTitleClick({key:It.eventKey,domEvent:Le}),It.triggerSubMenuAction==="hover")return;ie.triggerOpenChange(!ie.getVisible(),"click"),Ve(It.store,ie.props.eventKey,!1)},ie.onSubMenuClick=function(Le){typeof ie.props.onClick=="function"&&ie.props.onClick(ie.addKeyPath(Le))},ie.onSelect=function(Le){ie.props.onSelect(Le)},ie.onDeselect=function(Le){ie.props.onDeselect(Le)},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.getVisible=function(){return ie.state.isOpen},ie.getMode=function(){return ie.state.mode},ie.saveMenuInstance=function(Le){ie.menuInstance=Le},ie.addKeyPath=function(Le){return Object(K.a)(Object(K.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(ie.props.eventKey)})},ie.triggerOpenChange=function(Le,at){var It=ie.props.eventKey,qt=function(){ie.onOpenChange({key:It,item:Object(_.a)(ie),trigger:at,open:Le})};at==="mouseenter"?ie.mouseenterTimeout=setTimeout(function(){qt()},0):qt()},ie.isChildrenSelected=function(){var Le={find:!1};return Nt(ie.props.children,ie.props.selectedKeys,Le),Le.find},ie.isInlineMode=function(){return ie.getMode()==="inline"},ie.adjustWidth=function(){if(!ie.subMenuTitle||!ie.menuInstance)return;var Le=mn.findDOMNode(ie.menuInstance);if(Le.offsetWidth>=ie.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(ie.subMenuTitle.offsetWidth,"px")},ie.saveSubMenuTitle=function(Le){ie.subMenuTitle=Le},ie.getBaseProps=function(){var Le=Object(_.a)(ie),at=Le.props,It=ie.getMode();return{mode:It==="horizontal"?"vertical":It,visible:ie.getVisible(),level:at.level+1,inlineIndent:at.inlineIndent,focusable:!1,onClick:ie.onSubMenuClick,onSelect:ie.onSelect,onDeselect:ie.onDeselect,onDestroy:ie.onDestroy,selectedKeys:at.selectedKeys,eventKey:"".concat(at.eventKey,"-menu-"),openKeys:at.openKeys,motion:at.motion,onOpenChange:ie.onOpenChange,subMenuOpenDelay:at.subMenuOpenDelay,parentMenu:Object(_.a)(ie),subMenuCloseDelay:at.subMenuCloseDelay,forceSubMenuRender:at.forceSubMenuRender,triggerSubMenuAction:at.triggerSubMenuAction,builtinPlacements:at.builtinPlacements,defaultActiveFirst:at.store.getState().defaultActiveFirst[ft(at.eventKey)],multiple:at.multiple,prefixCls:at.rootPrefixCls,id:ie.internalMenuId,manualRef:ie.saveMenuInstance,itemIcon:at.itemIcon,expandIcon:at.expandIcon,direction:at.direction}},ie.getMotion=function(Le,at){var It=Object(_.a)(ie),qt=It.haveRendered,un=ie.props,Hn=un.motion,Gn=un.rootPrefixCls,di=Object(K.a)(Object(K.a)({},Hn),{},{leavedClassName:"".concat(Gn,"-hidden"),removeOnLeave:!1,motionAppear:qt||!at||Le!=="inline"});return di};var fe=we.store,le=we.eventKey,Se=fe.getState(),De=Se.defaultActiveFirst;ie.isRootMenu=!1;var $e=!1;return De&&($e=De[le]),Ve(fe,le,$e),ie.state={mode:we.mode,isOpen:we.isOpen},ie}return Object(C.a)(We,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ie=this,fe=this.props,le=fe.mode,Se=fe.parentMenu,De=fe.manualRef,$e=fe.isOpen,Le=function(){ie.setState({mode:le,isOpen:$e})},at=$e!==this.state.isOpen,It=le!==this.state.mode;if((It||at)&&(tt.a.cancel(this.updateStateRaf),It?this.updateStateRaf=Object(tt.a)(Le):Le()),De&&De(this),le!=="horizontal"||!(Se==null?void 0:Se.isRootMenu)||!$e)return;this.minWidthTimeout=setTimeout(function(){return ie.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ie=this.props,fe=ie.onDestroy,le=ie.eventKey;fe&&fe(le),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ie,fe){var le=this.getBaseProps();return A.createElement(wn,Object(x.a)({},le,{id:this.internalMenuId,className:ie,style:fe}),this.props.children)}},{key:"renderChildren",value:function(){var ie=this,fe=this.getBaseProps(),le=fe.mode,Se=fe.visible,De=fe.forceSubMenuRender,$e=fe.direction,Le=this.getMotion(le,Se);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Se||De,!this.haveOpened)return A.createElement("div",null);var at=H()("".concat(fe.prefixCls,"-sub"),Object(te.a)({},"".concat(fe.prefixCls,"-rtl"),$e==="rtl"));return this.isInlineMode()?A.createElement(ne,Object(x.a)({visible:fe.visible,forceRender:De},Le),function(It){var qt=It.className,un=It.style,Hn=H()(at,qt);return ie.renderPopupMenu(Hn,un)}):this.renderPopupMenu(at)}},{key:"render",value:function(){var ie,fe,le,Se=Object(K.a)({},this.props),De=this.getVisible(),$e=this.getPrefixCls(),Le=this.isInlineMode(),at=this.getMode(),It=H()($e,"".concat($e,"-").concat(at),(ie={},Object(te.a)(ie,Se.className,!!Se.className),Object(te.a)(ie,this.getOpenClassName(),De),Object(te.a)(ie,this.getActiveClassName(),Se.active||De&&!Le),Object(te.a)(ie,this.getDisabledClassName(),Se.disabled),Object(te.a)(ie,this.getSelectedClassName(),this.isChildrenSelected()),ie));this.internalMenuId||(Se.eventKey?this.internalMenuId="".concat(Se.eventKey,"$Menu"):(qe+=1,this.internalMenuId="$__$".concat(qe,"$Menu")));var qt={},un={},Hn={};Se.disabled||(qt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},un={onClick:this.onTitleClick},Hn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Gn={},di=Se.direction,li=di==="rtl";Le&&(li?Gn.paddingRight=Se.inlineIndent*Se.level:Gn.paddingLeft=Se.inlineIndent*Se.level);var Ei={};this.getVisible()&&(Ei={"aria-owns":this.internalMenuId});var Ri=null;at!=="horizontal"&&(Ri=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Ri=A.createElement(this.props.expandIcon,Object(K.a)({},this.props))));var gi=A.createElement("div",Object(x.a)({ref:this.saveSubMenuTitle,style:Gn,className:"".concat($e,"-title"),role:"button"},Hn,un,{"aria-expanded":De},Ei,{"aria-haspopup":"true",title:typeof Se.title=="string"?Se.title:void 0}),Se.title,Ri||A.createElement("i",{className:"".concat($e,"-arrow")})),xi=this.renderChildren(),Di=((fe=Se.parentMenu)===null||fe===void 0?void 0:fe.isRootMenu)?Se.parentMenu.props.getPopupContainer:function(zi){return zi.parentNode},dn=Oe[at],Zt=Se.popupOffset?{offset:Se.popupOffset}:{},yn=H()((le={},Object(te.a)(le,Se.popupClassName,Se.popupClassName&&!Le),Object(te.a)(le,"".concat($e,"-rtl"),li),le)),Ht=Se.disabled,Wt=Se.triggerSubMenuAction,pi=Se.subMenuOpenDelay,Pi=Se.forceSubMenuRender,ni=Se.subMenuCloseDelay,Ii=Se.builtinPlacements;Ze.forEach(function(zi){return delete Se[zi]}),delete Se.onClick;var or=li?Object(K.a)(Object(K.a)({},Ce),Ii):Object(K.a)(Object(K.a)({},ue),Ii);delete Se.direction;var Ni=this.getBaseProps(),Yi=Le?null:this.getMotion(Ni.mode,Ni.visible);return A.createElement("li",Object(x.a)({},Se,qt,{className:It,role:"menuitem"}),A.createElement(ai,{prefixCls:$e,popupClassName:H()("".concat($e,"-popup"),yn),getPopupContainer:Di,builtinPlacements:or,popupPlacement:dn,popupVisible:Le?!1:De,popupAlign:Zt,popup:Le?null:xi,action:Ht||Le?[]:[Wt],mouseEnterDelay:pi,mouseLeaveDelay:ni,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Pi,popupMotion:Yi},gi),Le?xi:null)}}]),We}(A.Component);et.defaultProps={onMouseEnter:wt,onMouseLeave:wt,onTitleMouseEnter:wt,onTitleMouseLeave:wt,onTitleClick:wt,manualRef:wt,mode:"vertical",title:""};var Ot=Object(c.b)(function(ye,Me){var We=ye.openKeys,we=ye.activeKey,ie=ye.selectedKeys,fe=Me.eventKey,le=Me.subMenuKey;return{isOpen:We.indexOf(fe)>-1,active:we[le]===fe,selectedKeys:ie}})(et);Ot.isSubMenu=!0;var Et=Ot,je="menuitem-overflowed",ht=.5,it=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){var we;return Object(O.a)(this,We),we=Me.apply(this,arguments),we.resizeObserver=null,we.mutationObserver=null,we.originalTotalWidth=0,we.overflowedItems=[],we.menuItemSizes=[],we.cancelFrameId=null,we.state={lastVisibleIndex:void 0},we.childRef=A.createRef(),we.getMenuItemNodes=function(){var ie=we.props.prefixCls,fe=we.childRef.current;return fe?[].slice.call(fe.children).filter(function(le){return le.className.split(" ").indexOf("".concat(ie,"-overflowed-submenu"))<0}):[]},we.getOverflowedSubMenuItem=function(ie,fe,le){var Se=we.props,De=Se.overflowedIndicator,$e=Se.level,Le=Se.mode,at=Se.prefixCls,It=Se.theme;if($e!==1||Le!=="horizontal")return null;var qt=we.props.children[0],un=qt.props,Hn=un.children,Gn=un.title,di=un.style,li=Object(N.a)(un,["children","title","style"]),Ei=Object(K.a)({},di),Ri="".concat(ie,"-overflowed-indicator"),gi="".concat(ie,"-overflowed-indicator");fe.length===0&&le!==!0?Ei=Object(K.a)(Object(K.a)({},Ei),{},{display:"none"}):le&&(Ei=Object(K.a)(Object(K.a)({},Ei),{},{visibility:"hidden",position:"absolute"}),Ri="".concat(Ri,"-placeholder"),gi="".concat(gi,"-placeholder"));var xi=It?"".concat(at,"-").concat(It):"",Di={};return Ze.forEach(function(dn){li[dn]!==void 0&&(Di[dn]=li[dn])}),A.createElement(Et,Object(x.a)({title:De,className:"".concat(at,"-overflowed-submenu"),popupClassName:xi},Di,{key:Ri,eventKey:gi,disabled:!1,style:Ei}),fe)},we.setChildrenWidthAndResize=function(){if(we.props.mode!=="horizontal")return;var ie=we.childRef.current;if(!ie)return;var fe=ie.children;if(!fe||fe.length===0)return;var le=ie.children[fe.length-1];Ut(le,"display","inline-block");var Se=we.getMenuItemNodes(),De=Se.filter(function($e){return $e.className.split(" ").indexOf(je)>=0});De.forEach(function($e){Ut($e,"display","inline-block")}),we.menuItemSizes=Se.map(function($e){return Bt($e,!0)}),De.forEach(function($e){Ut($e,"display","none")}),we.overflowedIndicatorWidth=Bt(ie.children[ie.children.length-1],!0),we.originalTotalWidth=we.menuItemSizes.reduce(function($e,Le){return $e+Le},0),we.handleResize(),Ut(le,"display","none")},we.handleResize=function(){if(we.props.mode!=="horizontal")return;var ie=we.childRef.current;if(!ie)return;var fe=Bt(ie);we.overflowedItems=[];var le=0,Se;we.originalTotalWidth>fe+ht&&(Se=-1,we.menuItemSizes.forEach(function(De){le+=De,le+we.overflowedIndicatorWidth<=fe&&(Se+=1)})),we.setState({lastVisibleIndex:Se})},we}return Object(C.a)(We,[{key:"componentDidMount",value:function(){var ie=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var fe=this.childRef.current;if(!fe)return;this.resizeObserver=new An.default(function(le){le.forEach(function(){var Se=ie.cancelFrameId;cancelAnimationFrame(Se),ie.cancelFrameId=requestAnimationFrame(ie.setChildrenWidthAndResize)})}),[].slice.call(fe.children).concat(fe).forEach(function(le){ie.resizeObserver.observe(le)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ie.resizeObserver.disconnect(),[].slice.call(fe.children).concat(fe).forEach(function(le){ie.resizeObserver.observe(le)}),ie.setChildrenWidthAndResize()}),this.mutationObserver.observe(fe,{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 fe=this,le=this.state.lastVisibleIndex;return(ie||[]).reduce(function(Se,De,$e){var Le=De;if(fe.props.mode==="horizontal"){var at=fe.getOverflowedSubMenuItem(De.props.eventKey,[]);le!==void 0&&fe.props.className.indexOf("".concat(fe.props.prefixCls,"-root"))!==-1&&($e>le&&(Le=A.cloneElement(De,{style:{display:"none"},eventKey:"".concat(De.props.eventKey,"-hidden"),className:"".concat(je)})),$e===le+1&&(fe.overflowedItems=ie.slice(le+1).map(function(qt){return A.cloneElement(qt,{key:qt.props.eventKey,mode:"vertical-left"})}),at=fe.getOverflowedSubMenuItem(De.props.eventKey,fe.overflowedItems)));var It=[].concat(Object(D.a)(Se),[at,Le]);return $e===ie.length-1&&It.push(fe.getOverflowedSubMenuItem(De.props.eventKey,[],!0)),It}return[].concat(Object(D.a)(Se),[Le])},[])}},{key:"render",value:function(){var ie=this.props,fe=ie.visible,le=ie.prefixCls,Se=ie.overflowedIndicator,De=ie.mode,$e=ie.level,Le=ie.tag,at=ie.children,It=ie.theme,qt=Object(N.a)(ie,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),un=Le;return A.createElement(un,Object(x.a)({ref:this.childRef},qt),this.renderChildren(at))}}]),We}(A.Component);it.defaultProps={tag:"div",className:""};var st=it;function bt(ye){return ye.length?ye.every(function(Me){return!!Me.props.disabled}):!0}function Lt(ye,Me,We){var we=ye.getState();ye.setState({activeKey:Object(K.a)(Object(K.a)({},we.activeKey),{},Object(te.a)({},Me,We))})}function ct(ye){return ye.eventKey||"0-menu-"}function Gt(ye,Me){var We=Me,we=ye.children,ie=ye.eventKey;if(We){var fe;if(dt(we,function(le,Se){le&&le.props&&!le.props.disabled&&We===ze(le,ie,Se)&&(fe=!0)}),fe)return We}return We=null,ye.defaultActiveFirst&&dt(we,function(le,Se){!We&&le&&!le.props.disabled&&(We=ze(le,ie,Se))}),We}function on(ye){if(!ye)return;var Me=this.instanceArray.indexOf(ye);Me!==-1?this.instanceArray[Me]=ye:this.instanceArray.push(ye)}var Dn=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(we){var ie;return Object(O.a)(this,We),ie=Me.call(this,we),ie.onKeyDown=function(fe,le){var Se=fe.keyCode,De;if(ie.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(De=Le.onKeyDown(fe))}),De)return 1;var $e=null;return(Se===r.a.UP||Se===r.a.DOWN)&&($e=ie.step(Se===r.a.UP?-1:1)),$e?(fe.preventDefault(),Lt(ie.props.store,ct(ie.props),$e.props.eventKey),typeof le=="function"&&le($e),1):void 0},ie.onItemHover=function(fe){var le=fe.key,Se=fe.hover;Lt(ie.props.store,ct(ie.props),Se?le:null)},ie.onDeselect=function(fe){ie.props.onDeselect(fe)},ie.onSelect=function(fe){ie.props.onSelect(fe)},ie.onClick=function(fe){ie.props.onClick(fe)},ie.onOpenChange=function(fe){ie.props.onOpenChange(fe)},ie.onDestroy=function(fe){ie.props.onDestroy(fe)},ie.getFlatInstanceArray=function(){return ie.instanceArray},ie.step=function(fe){var le=ie.getFlatInstanceArray(),Se=ie.props.store.getState().activeKey[ct(ie.props)],De=le.length;if(!De)return null;fe<0&&(le=le.concat().reverse());var $e=-1;if(le.every(function(qt,un){return qt&&qt.props.eventKey===Se?($e=un,!1):!0}),!ie.props.defaultActiveFirst&&$e!==-1&&bt(le.slice($e,De-1)))return;var Le=($e+1)%De,at=Le;do{var It=le[at];if(!It||It.props.disabled)at=(at+1)%De;else return It}while(at!==Le);return null},ie.renderCommonMenuItem=function(fe,le,Se){var De=ie.props.store.getState(),$e=Object(_.a)(ie),Le=$e.props,at=ze(fe,Le.eventKey,le),It=fe.props;if(!It||typeof fe.type=="string")return fe;var qt=at===De.activeKey,un=Object(K.a)(Object(K.a)({mode:It.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:ie.renderMenuItem,rootPrefixCls:Le.prefixCls,index:le,parentMenu:Le.parentMenu,manualRef:It.disabled?void 0:Object(p.a)(fe.ref,on.bind(Object(_.a)(ie))),eventKey:at,active:!It.disabled&&qt,multiple:Le.multiple,onClick:function(Gn){(It.onClick||wt)(Gn),ie.onClick(Gn)},onItemHover:ie.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:ie.onOpenChange,onDeselect:ie.onDeselect,onSelect:ie.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:It.itemIcon||ie.props.itemIcon,expandIcon:It.expandIcon||ie.props.expandIcon},Se),{},{direction:Le.direction});return(Le.mode==="inline"||Mt())&&(un.triggerSubMenuAction="click"),A.cloneElement(fe,Object(K.a)(Object(K.a)({},un),{},{key:at||le}))},ie.renderMenuItem=function(fe,le,Se){if(!fe)return null;var De=ie.props.store.getState(),$e={openKeys:De.openKeys,selectedKeys:De.selectedKeys,triggerSubMenuAction:ie.props.triggerSubMenuAction,subMenuKey:Se};return ie.renderCommonMenuItem(fe,le,$e)},we.store.setState({activeKey:Object(K.a)(Object(K.a)({},we.store.getState().activeKey),{},Object(te.a)({},we.eventKey,Gt(we,we.activeKey)))}),ie.instanceArray=[],ie}return Object(C.a)(We,[{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||!U()(this.props.style,ie.style)}},{key:"componentDidUpdate",value:function(ie){var fe=this.props,le="activeKey"in fe?fe.activeKey:fe.store.getState().activeKey[ct(fe)],Se=Gt(fe,le);if(Se!==le)Lt(fe.store,ct(fe),Se);else if("activeKey"in ie){var De=Gt(ie,ie.activeKey);Se!==De&&Lt(fe.store,ct(fe),Se)}}},{key:"render",value:function(){var ie=this,fe=Object(x.a)({},this.props);this.instanceArray=[];var le=H()(fe.prefixCls,fe.className,"".concat(fe.prefixCls,"-").concat(fe.mode)),Se={className:le,role:fe.role||"menu"};fe.id&&(Se.id=fe.id),fe.focusable&&(Se.tabIndex=0,Se.onKeyDown=this.onKeyDown);var De=fe.prefixCls,$e=fe.eventKey,Le=fe.visible,at=fe.level,It=fe.mode,qt=fe.overflowedIndicator,un=fe.theme;return Ze.forEach(function(Hn){return delete fe[Hn]}),delete fe.onClick,A.createElement(st,Object(x.a)({},fe,{prefixCls:De,mode:It,tag:"ul",level:at,theme:un,visible:Le,overflowedIndicator:qt},Se),Object(P.a)(fe.children).map(function(Hn,Gn){return ie.renderMenuItem(Hn,Gn,$e||"0-menu-")}))}}]),We}(A.Component);Dn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:wt};var Kn=Object(c.b)()(Dn),wn=Kn,Nn=I("Kwbf");function Pn(ye,Me,We){var we=ye.prefixCls,ie=ye.motion,fe=ye.defaultMotions,le=fe===void 0?{}:fe,Se=ye.openAnimation,De=ye.openTransitionName,$e=Me.switchingModeFromInline;if(ie)return ie;if(Object(F.a)(Se)==="object"&&Se)Object(Nn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Se=="string")return{motionName:"".concat(we,"-open-").concat(Se)};if(De)return{motionName:De};var Le=le[We];return Le||($e?null:le.other)}var Dt=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(we){var ie;Object(O.a)(this,We),ie=Me.call(this,we),ie.onSelect=function(Se){var De=Object(_.a)(ie),$e=De.props;if($e.selectable){var Le=ie.store.getState(),at=Le.selectedKeys,It=Se.key;$e.multiple?at=at.concat([It]):at=[It],"selectedKeys"in $e||ie.store.setState({selectedKeys:at}),$e.onSelect(Object(K.a)(Object(K.a)({},Se),{},{selectedKeys:at}))}},ie.onClick=function(Se){var De=ie.getRealMenuMode(),$e=Object(_.a)(ie),Le=$e.store,at=$e.props.onOpenChange;De!=="inline"&&!("openKeys"in ie.props)&&(Le.setState({openKeys:[]}),at([])),ie.props.onClick(Se)},ie.onKeyDown=function(Se,De){ie.innerMenu.getWrappedInstance().onKeyDown(Se,De)},ie.onOpenChange=function(Se){var De=Object(_.a)(ie),$e=De.props,Le=ie.store.getState().openKeys.concat(),at=!1,It=function(un){var Hn=!1;if(un.open)Hn=Le.indexOf(un.key)===-1,Hn&&Le.push(un.key);else{var Gn=Le.indexOf(un.key);Hn=Gn!==-1,Hn&&Le.splice(Gn,1)}at=at||Hn};Array.isArray(Se)?Se.forEach(It):It(Se),at&&("openKeys"in ie.props||ie.store.setState({openKeys:Le}),$e.onOpenChange(Le))},ie.onDeselect=function(Se){var De=Object(_.a)(ie),$e=De.props;if($e.selectable){var Le=ie.store.getState().selectedKeys.concat(),at=Se.key,It=Le.indexOf(at);It!==-1&&Le.splice(It,1),"selectedKeys"in $e||ie.store.setState({selectedKeys:Le}),$e.onDeselect(Object(K.a)(Object(K.a)({},Se),{},{selectedKeys:Le}))}},ie.onMouseEnter=function(Se){ie.restoreModeVerticalFromInline();var De=ie.props.onMouseEnter;De&&De(Se)},ie.onTransitionEnd=function(Se){var De=Se.propertyName==="width"&&Se.target===Se.currentTarget,$e=Se.target.className,Le=Object.prototype.toString.call($e)==="[object SVGAnimatedString]"?$e.animVal:$e,at=Se.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(De||at)&&ie.restoreModeVerticalFromInline()},ie.setInnerMenu=function(Se){ie.innerMenu=Se},ie.isRootMenu=!0;var fe=we.defaultSelectedKeys,le=we.defaultOpenKeys;return"selectedKeys"in we&&(fe=we.selectedKeys||[]),"openKeys"in we&&(le=we.openKeys||[]),ie.store=Object(c.c)({selectedKeys:fe,openKeys:le,activeKey:{"0-menu-":Gt(we,we.activeKey)}}),ie.state={switchingModeFromInline:!1,prevProps:we,inlineOpenKeys:[],store:ie.store},ie}return Object(C.a)(We,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ie){var fe=this.props,le=fe.siderCollapsed,Se=fe.inlineCollapsed,De=fe.onOpenChange;(!ie.inlineCollapsed&&Se||!ie.siderCollapsed&&le)&&De([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ie=this.props.collapsedWidth,fe=this.store,le=this.prevOpenKeys,Se=this.getInlineCollapsed()&&(ie===0||ie==="0"||ie==="0px");Se?(this.prevOpenKeys=fe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):le&&(this.store.setState({openKeys:le}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ie=this.props.mode,fe=this.state.switchingModeFromInline,le=this.getInlineCollapsed();return fe&&le?"inline":le?"vertical":ie}},{key:"getInlineCollapsed",value:function(){var ie=this.props,fe=ie.inlineCollapsed,le=ie.siderCollapsed;return le!==void 0?le:fe}},{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(K.a)({},Object(v.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),fe=this.getRealMenuMode();return ie.className+=" ".concat(ie.prefixCls,"-root"),ie.direction==="rtl"&&(ie.className+=" ".concat(ie.prefixCls,"-rtl")),ie=Object(K.a)(Object(K.a)({},ie),{},{mode:fe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Pn(this.props,this.state,fe)}),delete ie.openAnimation,delete ie.openTransitionName,A.createElement(c.a,{store:this.store},A.createElement(wn,Object(x.a)({},ie,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ie,fe){var le=fe.prevProps,Se=fe.store,De=Se.getState(),$e={},Le={prevProps:ie};return le.mode==="inline"&&ie.mode!=="inline"&&(Le.switchingModeFromInline=!0),"openKeys"in ie?$e.openKeys=ie.openKeys||[]:((ie.inlineCollapsed&&!le.inlineCollapsed||ie.siderCollapsed&&!le.siderCollapsed)&&(Le.switchingModeFromInline=!0,Le.inlineOpenKeys=De.openKeys,$e.openKeys=[]),(!ie.inlineCollapsed&&le.inlineCollapsed||!ie.siderCollapsed&&le.siderCollapsed)&&($e.openKeys=fe.inlineOpenKeys,Le.inlineOpenKeys=[])),Object.keys($e).length&&Se.setState($e),Le}}]),We}(A.Component);Dt.defaultProps={selectable:!0,onClick:wt,onSelect:wt,onOpenChange:wt,onDeselect:wt,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:A.createElement("span",null,"\xB7\xB7\xB7")};var sn=Dt,Ft=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){var we;return Object(O.a)(this,We),we=Me.apply(this,arguments),we.onKeyDown=function(ie){var fe=ie.keyCode;return fe===r.a.ENTER?(we.onClick(ie),!0):void 0},we.onMouseLeave=function(ie){var fe=we.props,le=fe.eventKey,Se=fe.onItemHover,De=fe.onMouseLeave;Se({key:le,hover:!1}),De({key:le,domEvent:ie})},we.onMouseEnter=function(ie){var fe=we.props,le=fe.eventKey,Se=fe.onItemHover,De=fe.onMouseEnter;Se({key:le,hover:!0}),De({key:le,domEvent:ie})},we.onClick=function(ie){var fe=we.props,le=fe.eventKey,Se=fe.multiple,De=fe.onClick,$e=fe.onSelect,Le=fe.onDeselect,at=fe.isSelected,It={key:le,keyPath:[le],item:Object(_.a)(we),domEvent:ie};De(It),Se?at?Le(It):$e(It):at||$e(It)},we.saveNode=function(ie){we.node=ie},we}return Object(C.a)(We,[{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,fe=Object(K.a)({},this.props),le=H()(this.getPrefixCls(),fe.className,(ie={},Object(te.a)(ie,this.getActiveClassName(),!fe.disabled&&fe.active),Object(te.a)(ie,this.getSelectedClassName(),fe.isSelected),Object(te.a)(ie,this.getDisabledClassName(),fe.disabled),ie)),Se=Object(K.a)(Object(K.a)({},fe.attribute),{},{title:typeof fe.title=="string"?fe.title:void 0,className:le,role:fe.role||"menuitem","aria-disabled":fe.disabled});fe.role==="option"?Se=Object(K.a)(Object(K.a)({},Se),{},{role:"option","aria-selected":fe.isSelected}):(fe.role===null||fe.role==="none")&&(Se.role="none");var De={onClick:fe.disabled?null:this.onClick,onMouseLeave:fe.disabled?null:this.onMouseLeave,onMouseEnter:fe.disabled?null:this.onMouseEnter},$e=Object(K.a)({},fe.style);fe.mode==="inline"&&(fe.direction==="rtl"?$e.paddingRight=fe.inlineIndent*fe.level:$e.paddingLeft=fe.inlineIndent*fe.level),Ze.forEach(function(at){return delete fe[at]}),delete fe.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=A.createElement(this.props.itemIcon,this.props)),A.createElement("li",Object(x.a)({},Object(v.a)(fe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Se,De,{style:$e,ref:this.saveNode}),fe.children,Le)}}]),We}(A.Component);Ft.isMenuItem=!0,Ft.defaultProps={onSelect:wt,onMouseEnter:wt,onMouseLeave:wt,manualRef:wt};var St=Object(c.b)(function(ye,Me){var We=ye.activeKey,we=ye.selectedKeys,ie=Me.eventKey,fe=Me.subMenuKey;return{active:We[fe]===ie,isSelected:Array.isArray(we)?we.indexOf(ie)!==-1:we===ie}})(Ft),Un=St,Sn=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){var we;return Object(O.a)(this,We),we=Me.apply(this,arguments),we.renderInnerMenuItem=function(ie){var fe=we.props,le=fe.renderMenuItem,Se=fe.index;return le(ie,Se,we.props.subMenuKey)},we}return Object(C.a)(We,[{key:"render",value:function(){var ie=Object(x.a)({},this.props),fe=ie.className,le=fe===void 0?"":fe,Se=ie.rootPrefixCls,De="".concat(Se,"-item-group-title"),$e="".concat(Se,"-item-group-list"),Le=ie.title,at=ie.children;return Ze.forEach(function(It){return delete ie[It]}),delete ie.direction,A.createElement("li",Object(x.a)({},ie,{onClick:function(qt){return qt.stopPropagation()},className:"".concat(le," ").concat(Se,"-item-group")}),A.createElement("div",{className:De,title:typeof Le=="string"?Le:void 0},Le),A.createElement("ul",{className:$e},A.Children.map(at,this.renderInnerMenuItem)))}}]),We}(A.Component);Sn.isMenuItemGroup=!0,Sn.defaultProps={disabled:!0};var zt=Sn,lt=function(Me){var We=Me.className,we=Me.rootPrefixCls,ie=Me.style;return A.createElement("li",{className:"".concat(We," ").concat(we,"-item-divider"),style:ie})};lt.defaultProps={disabled:!0,className:"",style:{}};var jn=lt,ln=sn,Jn=I("eDIo");function $t(ye,Me){var We=ye.prefixCls,we=ye.editable,ie=ye.locale,fe=ye.style;return!we||we.showAdd===!1?null:A.createElement("button",{ref:Me,type:"button",className:"".concat(We,"-nav-add"),style:fe,"aria-label":(ie==null?void 0:ie.addAriaLabel)||"Add tab",onClick:function(Se){we.onEdit("add",{event:Se})}},we.addIcon||"+")}var On=A.forwardRef($t);function Fn(ye,Me){var We=ye.prefixCls,we=ye.id,ie=ye.tabs,fe=ye.locale,le=ye.mobile,Se=ye.moreIcon,De=Se===void 0?"More":Se,$e=ye.moreTransitionName,Le=ye.style,at=ye.className,It=ye.editable,qt=ye.tabBarGutter,un=ye.rtl,Hn=ye.onTabClick,Gn=Object(A.useState)(!1),di=Object(Y.a)(Gn,2),li=di[0],Ei=di[1],Ri=Object(A.useState)(null),gi=Object(Y.a)(Ri,2),xi=gi[0],Di=gi[1],dn="".concat(we,"-more-popup"),Zt="".concat(We,"-dropdown"),yn=xi!==null?"".concat(dn,"-").concat(xi):null,Ht=fe==null?void 0:fe.dropdownAriaLabel,Wt=A.createElement(ln,{onClick:function(Yi){var zi=Yi.key,Hi=Yi.domEvent;Hn(zi,Hi),Ei(!1)},id:dn,tabIndex:-1,role:"listbox","aria-activedescendant":yn,selectedKeys:[xi],"aria-label":Ht!==void 0?Ht:"expanded dropdown"},ie.map(function(Ni){return A.createElement(Un,{key:Ni.key,id:"".concat(dn,"-").concat(Ni.key),role:"option","aria-controls":we&&"".concat(we,"-panel-").concat(Ni.key),disabled:Ni.disabled},Ni.tab)}));function pi(Ni){for(var Yi=ie.filter(function(_r){return!_r.disabled}),zi=Yi.findIndex(function(_r){return _r.key===xi})||0,Hi=Yi.length,Bi=0;BiIi?(Pi=Wt,dn.current="x"):(Pi=pi,dn.current="y");var or=Date.now();or-xi.current>100&&(Di.current=!1),(Me(-Pi,-Pi)||Di.current)&&(Ht.preventDefault(),Di.current=!0),xi.current=or}var yn=Object(A.useRef)(null);yn.current={onTouchStart:Ei,onTouchMove:Ri,onTouchEnd:gi,onWheel:Zt},A.useEffect(function(){function Ht(ni){yn.current.onTouchStart(ni)}function Wt(ni){yn.current.onTouchMove(ni)}function pi(ni){yn.current.onTouchEnd(ni)}function Pi(ni){yn.current.onWheel(ni)}return document.addEventListener("touchmove",Wt,{passive:!1}),document.addEventListener("touchend",pi,{passive:!1}),ye.current.addEventListener("touchstart",Ht,{passive:!1}),ye.current.addEventListener("wheel",Pi),function(){document.removeEventListener("touchmove",Wt),document.removeEventListener("touchend",pi)}},[])}function an(){var ye=Object(A.useRef)(new Map);function Me(we){return ye.current.has(we)||ye.current.set(we,A.createRef()),ye.current.get(we)}function We(we){ye.current.delete(we)}return[Me,We]}function zn(ye,Me){var We=A.useRef(ye),we=A.useState({}),ie=Object(Y.a)(we,2),fe=ie[1];function le(Se){var De=typeof Se=="function"?Se(We.current):Se;De!==We.current&&Me(De,We.current),We.current=De,fe({})}return[We.current,le]}var Ln=function(Me){var We=Me.position,we=Me.prefixCls,ie=Me.extra;if(!ie)return null;var fe,le=ie;return We==="right"&&(fe=le.right||!le.left&&le||null),We==="left"&&(fe=le.left||null),fe?A.createElement("div",{className:"".concat(we,"-extra-content")},fe):null};function oi(ye,Me){var We,we=A.useContext(yi),ie=we.prefixCls,fe=we.tabs,le=ye.className,Se=ye.style,De=ye.id,$e=ye.animated,Le=ye.activeKey,at=ye.rtl,It=ye.extra,qt=ye.editable,un=ye.locale,Hn=ye.tabPosition,Gn=ye.tabBarGutter,di=ye.children,li=ye.onTabClick,Ei=ye.onTabScroll,Ri=Object(A.useRef)(),gi=Object(A.useRef)(),xi=Object(A.useRef)(),Di=Object(A.useRef)(),dn=an(),Zt=Object(Y.a)(dn,2),yn=Zt[0],Ht=Zt[1],Wt=Hn==="top"||Hn==="bottom",pi=zn(0,function(Xi,ki){Wt&&Ei&&Ei({direction:Xi>ki?"left":"right"})}),Pi=Object(Y.a)(pi,2),ni=Pi[0],Ii=Pi[1],or=zn(0,function(Xi,ki){!Wt&&Ei&&Ei({direction:Xi>ki?"top":"bottom"})}),Ni=Object(Y.a)(or,2),Yi=Ni[0],zi=Ni[1],Hi=Object(A.useState)(0),Bi=Object(Y.a)(Hi,2),vi=Bi[0],_r=Bi[1],Jr=Object(A.useState)(0),jr=Object(Y.a)(Jr,2),Rr=jr[0],ur=jr[1],Zi=Object(A.useState)(0),rr=Object(Y.a)(Zi,2),dr=rr[0],Fr=rr[1],ha=Object(A.useState)(0),sa=Object(Y.a)(ha,2),qi=sa[0],Zr=sa[1],qr=Object(A.useState)(null),sr=Object(Y.a)(qr,2),Qi=sr[0],wr=sr[1],Ma=Object(A.useState)(null),no=Object(Y.a)(Ma,2),la=no[0],Ta=no[1],wa=Object(A.useState)(0),Sa=Object(Y.a)(wa,2),ka=Sa[0],co=Sa[1],Ro=Object(A.useState)(0),Ga=Object(Y.a)(Ro,2),Oa=Ga[0],Va=Ga[1],_a=s(new Map),Ra=Object(Y.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=n(fe,ho,vi),Da="".concat(ie,"-nav-operations-hidden"),ya=0,Nr=0;Wt?at?(ya=0,Nr=Math.max(0,vi-Qi)):(ya=Math.min(0,Qi-vi),Nr=0):(ya=Math.min(0,la-Rr),Nr=0);function fa(Xi){return XiNr?[Nr,!1]:[Xi,!0]}var pa=Object(A.useRef)(),ba=Object(A.useState)(),ma=Object(Y.a)(ba,2),Xa=ma[0],$a=ma[1];function Qa(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}Pt(Ri,function(Xi,ki){var mr=!1;function Br(Pa,da){Pa(function(ja){var ca=fa(ja+da),Sr=Object(Y.a)(ca,2),Fa=Sr[0],Ba=Sr[1];return mr=Ba,Fa})}if(Wt){if(Qi>=vi)return mr;Br(Ii,Xi)}else{if(la>=Rr)return mr;Br(zi,ki)}return Ia(),Qa(),mr}),Object(A.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ua(){var Xi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le,ki=Aa.get(Xi);if(!ki)return;if(Wt){var mr=ni;at?ki.rightni+Qi&&(mr=ki.right+ki.width-Qi):ki.left<-ni?mr=-ki.left:ki.left+ki.width>-ni+Qi&&(mr=-(ki.left+ki.width-Qi)),zi(0),Ii(fa(mr)[0])}else{var Br=Yi;ki.top<-Yi?Br=-ki.top:ki.top+ki.height>-Yi+la&&(Br=-(ki.top+ki.height-la)),Ii(0),zi(fa(Br)[0])}}var Ea=w(Aa,{width:Qi,height:la,left:ni,top:Yi},{width:dr,height:qi},{width:ka,height:Oa},Object(K.a)(Object(K.a)({},ye),{},{tabs:fe})),io=Object(Y.a)(Ea,2),Ao=io[0],Do=io[1],fo=fe.map(function(Xi){var ki=Xi.key;return A.createElement(o,{id:De,prefixCls:ie,key:ki,rtl:at,tab:Xi,closable:Xi.closable,editable:qt,active:ki===Le,tabPosition:Hn,tabBarGutter:Gn,renderWrapper:di,removeAriaLabel:un==null?void 0:un.removeAriaLabel,ref:yn(ki),onClick:function(Br){li(ki,Br)},onRemove:function(){Ht(ki)},onFocus:function(){ua(ki),Qa(),at||(Ri.current.scrollLeft=0),Ri.current.scrollTop=0}})}),ro=d(function(){var Xi,ki,mr,Br,Pa,da,ja,ca,Sr,Fa=((Xi=Ri.current)===null||Xi===void 0?void 0:Xi.offsetWidth)||0,Ba=((ki=Ri.current)===null||ki===void 0?void 0:ki.offsetHeight)||0,Ha=((mr=Di.current)===null||mr===void 0?void 0:mr.offsetWidth)||0,zr=((Br=Di.current)===null||Br===void 0?void 0:Br.offsetHeight)||0,Gi=((Pa=xi.current)===null||Pa===void 0?void 0:Pa.offsetWidth)||0,Si=((da=xi.current)===null||da===void 0?void 0:da.offsetHeight)||0;wr(Fa),Ta(Ba),co(Ha),Va(zr);var Xn=(((ja=gi.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,ui=(((ca=gi.current)===null||ca===void 0?void 0:ca.offsetHeight)||0)-zr;_r(Xn),ur(ui);var Mi=(Sr=xi.current)===null||Sr===void 0?void 0:Sr.className.includes(Da);Fr(Xn-(Mi?0:Gi)),Zr(ui-(Mi?0:Si)),Ya(function(){var hr=new Map;return fe.forEach(function(ga){var aa=ga.key,Mr=yn(aa).current;Mr&&hr.set(aa,{width:Mr.offsetWidth,height:Mr.offsetHeight,left:Mr.offsetLeft,top:Mr.offsetTop})}),hr})}),po=fe.slice(0,Ao),Kr=fe.slice(Do+1),br=[].concat(Object(D.a)(po),Object(D.a)(Kr)),Lr=Object(A.useState)(),Er=Object(Y.a)(Lr,2),Na=Er[0],mo=Er[1],ea=Aa.get(Le),ao=Object(A.useRef)();function oo(){m.a.cancel(ao.current)}Object(A.useEffect)(function(){var Xi={};return ea&&(Wt?(at?Xi.right=ea.right:Xi.left=ea.left,Xi.width=ea.width):(Xi.top=ea.top,Xi.height=ea.height)),oo(),ao.current=m()(function(){mo(Xi)}),oo},[ea,Wt,at]),Object(A.useEffect)(function(){ua()},[Le,ea,Aa,Wt]),Object(A.useEffect)(function(){ro()},[at,Gn,Le,fe.map(function(Xi){return Xi.key}).join("_")]);var so=!!br.length,xa="".concat(ie,"-nav-wrap"),Ja,Ua,go,Za;return Wt?at?(Ua=ni>0,Ja=ni+Qi` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,r=/^\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]/,o=" ";function a(B,T,V){return T.f=T.inline=V,V(B,T)}function n(B,T,V){return T.f=T.block=V,V(B,T)}function R(B){return!B||!/\S/.test(B.string)}function w(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==O){var T=A;if(!T){var V=te.innerMode(K,B.htmlState);T=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}T&&(B.f=h,B.block=x,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function x(B,T){var V=B.column()===T.indentation,Z=R(T.prevLine.stream),oe=T.indentedCode,pe=T.prevLine.hr,Ye=T.list!==!1,xe=(T.listStack[T.listStack.length-1]||0)+3;T.indentedCode=!1;var Ie=T.indentation;if(T.indentationDiff===null&&(T.indentationDiff=T.indentation,Ye)){for(T.list=null;Ie=4&&(oe||T.prevLine.fencedCodeEnd||T.prevLine.header||Z))return B.skipToEnd(),T.indentedCode=!0,H.code;if(B.eatSpace())return null;if(V&&T.indentation<=xe&&(be=B.match(m))&&be[1].length<=6)return T.quote=0,T.header=be[1].length,T.thisLine.header=!0,N.highlightFormatting&&(T.formatting="header"),T.f=T.inline,_(T);if(T.indentation<=xe&&B.eat(">"))return T.quote=V?1:T.quote+1,N.highlightFormatting&&(T.formatting="quote"),B.eatSpace(),_(T);if(!Ke&&!T.setext&&V&&T.indentation<=xe&&(be=B.match(D))){var de=be[1]?"ol":"ul";return T.indentation=Ie+B.current().length,T.list=!0,T.quote=0,T.listStack.push(T.indentation),T.em=!1,T.strong=!1,T.code=!1,T.strikethrough=!1,N.taskLists&&B.match(b,!1)&&(T.taskList=!0),T.f=T.inline,N.highlightFormatting&&(T.formatting=["list","list-"+de]),_(T)}else{if(V&&T.indentation<=xe&&(be=B.match(s,!0)))return T.quote=0,T.fencedEndRE=new RegExp(be[1]+"+ *$"),T.localMode=N.fencedCodeBlockHighlighting&&M(be[2]||N.fencedCodeBlockDefaultMode),T.localMode&&(T.localState=te.startState(T.localMode)),T.f=T.block=C,N.highlightFormatting&&(T.formatting="code-block"),T.code=-1,_(T);if(T.setext||(!Je||!Ye)&&!T.quote&&T.list===!1&&!T.code&&!Ke&&!r.test(B.string)&&(be=B.lookAhead(1))&&(be=be.match(f)))return T.setext?(T.header=T.setext,T.setext=0,B.skipToEnd(),N.highlightFormatting&&(T.formatting="header")):(T.header=be[0].charAt(0)=="="?1:2,T.setext=T.header),T.thisLine.header=!0,T.f=T.inline,_(T);if(Ke)return B.skipToEnd(),T.hr=!0,T.thisLine.hr=!0,H.hr;if(B.peek()==="[")return a(B,T,U)}return a(B,T,T.inline)}function O(B,T){var V=K.token(B,T.htmlState);if(!A){var Z=te.innerMode(K,T.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||T.md_inside&&B.current().indexOf(">")>-1)&&(T.f=h,T.block=x,T.htmlState=null)}return V}function C(B,T){var V=T.listStack[T.listStack.length-1]||0,Z=T.indentation=B.quote?T.push(H.formatting+"-"+B.formatting[V]+"-"+B.quote):T.push("error"))}if(B.taskOpen)return T.push("meta"),T.length?T.join(" "):null;if(B.taskClosed)return T.push("property"),T.length?T.join(" "):null;if(B.linkHref?T.push(H.linkHref,"url"):(B.strong&&T.push(H.strong),B.em&&T.push(H.em),B.strikethrough&&T.push(H.strikethrough),B.emoji&&T.push(H.emoji),B.linkText&&T.push(H.linkText),B.code&&T.push(H.code),B.image&&T.push(H.image),B.imageAltText&&T.push(H.imageAltText,"link"),B.imageMarker&&T.push(H.imageMarker)),B.header&&T.push(H.header,H.header+"-"+B.header),B.quote&&(T.push(H.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=B.quote?T.push(H.quote+"-"+B.quote):T.push(H.quote+"-"+N.maxBlockquoteDepth)),B.list!==!1){var Z=(B.listStack.length-1)%3;Z?Z===1?T.push(H.list2):T.push(H.list3):T.push(H.list1)}return B.trailingSpaceNewLine?T.push("trailing-space-new-line"):B.trailingSpace&&T.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),T.length?T.join(" "):null}function y(B,T){return B.match(d,!0)?_(T):void 0}function h(B,T){var V=T.text(B,T);if(typeof V!="undefined")return V;if(T.list)return T.list=null,_(T);if(T.taskList){var Z=B.match(b,!0)[1]===" ";return Z?T.taskOpen=!0:T.taskClosed=!0,N.highlightFormatting&&(T.formatting="task"),T.taskList=!1,_(T)}if(T.taskOpen=!1,T.taskClosed=!1,T.header&&B.match(/^#+$/,!0))return N.highlightFormatting&&(T.formatting="header"),_(T);var oe=B.next();if(T.linkTitle){T.linkTitle=!1;var pe=oe;oe==="("&&(pe=")"),pe=(pe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ye="^\\s*(?:[^"+pe+"\\\\]+|\\\\\\\\|\\\\.)"+pe;if(B.match(new RegExp(Ye),!0))return H.linkHref}if(oe==="`"){var xe=T.formatting;N.highlightFormatting&&(T.formatting="code"),B.eatWhile("`");var Ie=B.current().length;if(T.code==0&&(!T.quote||Ie==1))return T.code=Ie,_(T);if(Ie==T.code){var Je=_(T);return T.code=0,Je}else return T.formatting=xe,_(T)}else if(T.code)return _(T);if(oe==="\\"&&(B.next(),N.highlightFormatting)){var Ke=_(T),be=H.formatting+"-escape";return Ke?Ke+" "+be:be}if(oe==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return T.imageMarker=!0,T.image=!0,N.highlightFormatting&&(T.formatting="image"),_(T);if(oe==="["&&T.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return T.imageMarker=!1,T.imageAltText=!0,N.highlightFormatting&&(T.formatting="image"),_(T);if(oe==="]"&&T.imageAltText){N.highlightFormatting&&(T.formatting="image");var Ke=_(T);return T.imageAltText=!1,T.image=!1,T.inline=T.f=v,Ke}if(oe==="["&&!T.image)return T.linkText&&B.match(/^.*?\]/)||(T.linkText=!0,N.highlightFormatting&&(T.formatting="link")),_(T);if(oe==="]"&&T.linkText){N.highlightFormatting&&(T.formatting="link");var Ke=_(T);return T.linkText=!1,T.inline=T.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?v:h,Ke}if(oe==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=c,N.highlightFormatting&&(T.formatting="link");var Ke=_(T);return Ke?Ke+=" ":Ke="",Ke+H.linkInline}if(oe==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=c,N.highlightFormatting&&(T.formatting="link");var Ke=_(T);return Ke?Ke+=" ":Ke="",Ke+H.linkEmail}if(N.xml&&oe==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var de=B.string.indexOf(">",B.pos);if(de!=-1){var nt=B.string.substring(B.start,de);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(nt)&&(T.md_inside=!0)}return B.backUp(1),T.htmlState=te.startState(K),n(B,T,O)}if(N.xml&&oe==="<"&&B.match(/^\/\w*?>/))return T.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var Kt=1,jt=B.pos==1?" ":B.string.charAt(B.pos-2);Kt<3&&B.eat(oe);)Kt++;var wt=B.peek()||" ",ze=!/\s/.test(wt)&&(!u.test(wt)||/\s/.test(jt)||u.test(jt)),ft=!/\s/.test(jt)&&(!u.test(jt)||/\s/.test(wt)||u.test(wt)),dt=null,Nt=null;if(Kt%2&&(!T.em&&ze&&(oe==="*"||!ft||u.test(jt))?dt=!0:T.em==oe&&ft&&(oe==="*"||!ze||u.test(wt))&&(dt=!1)),Kt>1&&(!T.strong&&ze&&(oe==="*"||!ft||u.test(jt))?Nt=!0:T.strong==oe&&ft&&(oe==="*"||!ze||u.test(wt))&&(Nt=!1)),Nt!=null||dt!=null){N.highlightFormatting&&(T.formatting=dt==null?"strong":Nt==null?"em":"strong em"),dt===!0&&(T.em=oe),Nt===!0&&(T.strong=oe);var Je=_(T);return dt===!1&&(T.em=!1),Nt===!1&&(T.strong=!1),Je}}else if(oe===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return _(T);B.backUp(1)}if(N.strikethrough){if(oe==="~"&&B.eatWhile(oe)){if(T.strikethrough){N.highlightFormatting&&(T.formatting="strikethrough");var Je=_(T);return T.strikethrough=!1,Je}else if(B.match(/^[^\s]/,!1))return T.strikethrough=!0,N.highlightFormatting&&(T.formatting="strikethrough"),_(T)}else if(oe===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return _(T);B.backUp(2)}}if(N.emoji&&oe===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){T.emoji=!0,N.highlightFormatting&&(T.formatting="emoji");var Ze=_(T);return T.emoji=!1,Ze}return oe===" "&&(B.match(/^ +$/,!1)?T.trailingSpace++:T.trailingSpace&&(T.trailingSpaceNewLine=!0)),_(T)}function c(B,T){var V=B.next();if(V===">"){T.f=T.inline=h,N.highlightFormatting&&(T.formatting="link");var Z=_(T);return Z?Z+=" ":Z="",Z+H.linkInline}return B.match(/^[^>]+/,!0),H.linkInline}function v(B,T){if(B.eatSpace())return null;var V=B.next();return V==="("||V==="["?(T.f=T.inline=E(V==="("?")":"]"),N.highlightFormatting&&(T.formatting="link-string"),T.linkHref=!0,_(T)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(B){return function(T,V){var Z=T.next();if(Z===B){V.f=V.inline=h,N.highlightFormatting&&(V.formatting="link-string");var oe=_(V);return V.linkHref=!1,oe}return T.match(p[B]),V.linkHref=!0,_(V)}}function U(B,T){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(T.f=F,B.next(),N.highlightFormatting&&(T.formatting="link"),T.linkText=!0,_(T)):a(B,T,h)}function F(B,T){if(B.match(/^\]:/,!0)){T.f=T.inline=z,N.highlightFormatting&&(T.formatting="link");var V=_(T);return T.linkText=!1,V}return B.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function z(B,T){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?T.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),T.f=T.inline=h,H.linkHref+" url")}var G={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:h,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&te.copyState(K,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?te.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,T){if(T.formatting=!1,B!=T.thisLine.stream){if(T.header=0,T.hr=!1,B.match(/^\s*$/,!0))return w(T),null;if(T.prevLine=T.thisLine,T.thisLine={stream:B},T.taskList=!1,T.trailingSpace=0,T.trailingSpaceNewLine=!1,!T.localState&&(T.f=T.block,T.f!=O)){var V=B.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(T.indentation=V,T.indentationDiff=null,V>0)return null}}return T.f(B,T)},innerMode:function(B){return B.block==O?{state:B.htmlState,mode:K}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:G}},indent:function(B,T,V){return B.block==O&&K.indent?K.indent(B.htmlState,T,V):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,T,V):te.Pass},blankLine:w,getType:_,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),te.defineMIME("text/markdown","markdown"),te.defineMIME("text/x-markdown","markdown")})},mgmH:function(tn,Qe,I){"use strict";I.d(Qe,"d",function(){return f}),I.d(Qe,"b",function(){return d}),I.d(Qe,"e",function(){return s}),I.d(Qe,"c",function(){return r}),I.d(Qe,"n",function(){return u}),I.d(Qe,"g",function(){return o}),I.d(Qe,"h",function(){return a}),I.d(Qe,"j",function(){return R}),I.d(Qe,"a",function(){return w}),I.d(Qe,"l",function(){return x}),I.d(Qe,"f",function(){return O}),I.d(Qe,"k",function(){return C}),I.d(Qe,"m",function(){return _}),I.d(Qe,"i",function(){return y}),I.d(Qe,"o",function(){return h}),I.d(Qe,"t",function(){return c}),I.d(Qe,"s",function(){return v}),I.d(Qe,"p",function(){return p}),I.d(Qe,"q",function(){return E}),I.d(Qe,"r",function(){return U}),I.d(Qe,"v",function(){return F}),I.d(Qe,"u",function(){return z});var te=I("miYZ"),Y=I("tsqr"),N=I("k1fw"),K=I("9og8"),A=I("WmNS"),M=I.n(A),H=I("oUNq"),P=I("9kvl"),k=I("1vsH"),D=I("m3rI"),b=function(){Object(P.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},m=function(){Object(P.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},f=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return b(),oe.next=3,Object(H.t)(Object(N.a)({},T));case 3:if(V=oe.sent,!(V.status===0)){oe.next=7;break}return oe.next=7,Object(k.w)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/export_couser_info.json"),query:T}));case 7:m();case 8:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),d=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.r)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_member_act_score")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),s=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.u)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_score")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_score")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),r=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.s)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),u=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.z)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),o=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.v)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_homework")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),a=function(){var G=Object(K.a)(M.a.mark(function B(T,V){var Z;return M.a.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return pe.next=2,Object(H.x)(Object(N.a)({},T));case 2:Z=pe.sent,Z.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/").concat(V))):Z.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/").concat(V)));case 4:case"end":return pe.stop()}},B)}));return function(T,V){return G.apply(this,arguments)}}(),n=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return b(),oe.next=3,Object(H.w)(Object(N.a)({},T));case 3:if(V=oe.sent,!(V.status===0)){oe.next=7;break}return oe.next=7,Object(k.w)("",Object(k.Y)({url:D.a.API_SERVER+"/api/homework_commons/".concat(T.categoryId,"/works_list.zip"),query:T}));case 7:m();case 8:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),R=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return b(),oe.next=3,Object(H.A)(Object(N.a)({},T));case 3:if(V=oe.sent,!(V.status===0)){oe.next=7;break}return oe.next=7,Object(k.w)("",Object(k.Y)({url:D.a.API_SERVER+"/api/polls/".concat(T.categoryId,"/commit_result.xlsx"),query:T}));case 7:m();case 8:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),w=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/attendances/export_xlsx_data.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),x=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/video_study_statics.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),O=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/export_course_students_info.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),C=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/item_banks/export.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),_=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),y=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.y)(Object(N.a)({},T));case 2:V=oe.sent,V.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/exercise_score"))):V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/exercise_score")));case 4:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),h=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Z.next=3,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/export_records/".concat(T.id,".xlsx"),query:T}));case 3:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),c=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),v=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_years/".concat(T==null?void 0:T.ec_year_id,"/ec_training_objectives.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),p=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)(T==null?void 0:T.name,Object(k.Y)({url:D.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),E=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_years/".concat(T==null?void 0:T.ec_year_id,"/ec_courses.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),U=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_years/".concat(T==null?void 0:T.ec_year_id,"/ec_graduation_requirements.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),F=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/rank_list.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),z=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}()},n6Qo:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return P});var te=I("q1tI"),Y=I("biw7"),N=I("fyJ8");function K(k){var D=k.className,b=k.index,m=k.children,f=k.colSpan,d=k.rowSpan,s=te.useContext(Y.a),r=s.prefixCls,u=s.fixedInfoList,o=u[b];return te.createElement(N.a,Object.assign({className:D,index:b,component:"td",prefixCls:r,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:f,rowSpan:d}}}},o))}function A(k){return te.createElement("tr",Object.assign({},k))}function M(k){var D=k.children,b=te.useContext(Y.a),m=b.prefixCls;return te.createElement("tfoot",{className:"".concat(m,"-summary")},D)}var H=Qe.b=M,P={Cell:K,Row:A}},nPLb:function(tn,Qe,I){"use strict";var te=I("2qtc"),Y=I("kLXV"),N=I("g9YV"),K=I("wCAj"),A=I("5NDa"),M=I("5rEg"),H=I("14J3"),P=I("BMrR"),k=I("iQDF"),D=I("+eQT"),b=I("miYZ"),m=I("tsqr"),f=I("jrin"),d=I("oBTY"),s=I("k1fw"),r=I("9og8"),u=I("y8nQ"),o=I("Vl3Y"),a=I("tJVT"),n=I("PpiC"),R=I("WmNS"),w=I.n(R),x=I("q1tI"),O=I.n(x),C=I("wd/R"),_=I.n(C),y=I("ErOA"),h=I("1vsH"),c=I("Ty5D"),v=I("9kvl"),p=I("oUNq"),E=I("xKgJ"),U=I("eozf"),F=function(G){var B=G.classroomList,T=G.dispatch,V=G.courseEndTime,Z=Object(n.a)(G,["classroomList","dispatch","courseEndTime"]),oe=Object(c.i)(),pe=o.a.useForm(),Ye=Object(a.a)(pe,1),xe=Ye[0],Ie=Object(x.useState)(1),Je=Object(a.a)(Ie,2),Ke=Je[0],be=Je[1],de=Object(x.useState)([]),nt=Object(a.a)(de,2),Kt=nt[0],jt=nt[1],wt=Object(x.useState)(0),ze=Object(a.a)(wt,2),ft=ze[0],dt=ze[1],Nt=Object(x.useState)(2e4),Ze=Object(a.a)(Nt,2),Bt=Ze[0],Ut=Ze[1],Mt=Object(x.useState)(!0),An=Object(a.a)(Mt,2),mn=An[0],pn=An[1],tt=Object(x.useState)(),fn=Object(a.a)(tt,2),In=fn[0],He=fn[1],Ue=Object(x.useState)([]),pt=Object(a.a)(Ue,2),Ct=pt[0],Ge=pt[1];oe.id=oe.coursesId,Object(x.useEffect)(function(){B.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?vt():(Ge([]),jt([]))},[B.actionTabs.key]);var vt=function(){var ae=Object(r.a)(w.a.mark(function re(he){var ve,me,Be;return w.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return pn(!0),Jt.next=3,Object(p.D)(Object(s.a)(Object(s.a)({},oe),{},{page:he||Ke,limit:Bt,homework_id:B.actionTabs.type===1?"":B.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:ve=Jt.sent,ve==null||ve.course_groups.map(function(En){En.key=En.id}),ve&&(jt([].concat(Object(d.a)(Kt),Object(d.a)(ve==null?void 0:ve.course_groups))),dt(ve==null?void 0:ve.group_count),He(ve==null?void 0:ve.course_groups),pn(!1),he||xe.setFieldsValue((Be={},Object(f.a)(Be,"group_ids",ve==null||((me=ve.course_groups)===null||me===void 0)?void 0:me.map(function(En){return String(En.id)})),Object(f.a)(Be,"end_time",_()(_()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Be)));case 6:case"end":return Jt.stop()}},re)}));return function(he){return ae.apply(this,arguments)}}(),Ae=function(){var ae=Object(r.a)(w.a.mark(function re(){var he,ve,me,Be;return w.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:if(he=Object(s.a)({},xe.getFieldsValue()),console.log("----",he.group_ids),!(In!=null&&In.length&&!(Ct!=null&&Ct.length))){Jt.next=5;break}return m.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),Jt.abrupt("return");case 5:return Jt.next=7,Object(y.a)("/api/courses/".concat(oe.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(d.a)(B.actionTabs.selectArrs),group_ids:(Ct==null?void 0:Ct.length)>0?Ct:[],unified_setting:!(Kt!=null&&Kt.length),end_time:_()(he.end_time).format("YYYY-MM-DD HH:mm")}});case 7:ve=Jt.sent,ve.status===0&&(ge(),Object(h.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),m.b.success("\u64CD\u4F5C\u6210\u529F"),T({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Z.onCallback&&Z.onCallback(),Object(E.c)()?(T({type:"classroomList/setActionTabs",payload:{}}),(B==null||((me=B.actionTabs)===null||me===void 0||((Be=me.selectArrsAll)===null||Be===void 0))?void 0:Be.length)>0?T({type:"classroomList/getClassroomTeacherCommonList",payload:Object(s.a)(Object(s.a)({},B.actionTabs.params),{},{type:5})}):T({type:"shixunHomeworks/getWorkList",payload:Object(s.a)({},oe)})):T({type:"classroomList/getClassroomCommonList",payload:Object(s.a)({},B.actionTabs.params)}));case 9:case"end":return Jt.stop()}},re)}));return function(){return ae.apply(this,arguments)}}(),ge=function(){be(1),jt([])},Ee=B.detailCommonHomeworksList;return O.a.createElement(Y.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:B.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:Ae,onCancel:function(){ge(),T({type:"classroomList/setActionTabs",payload:{}})}},O.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",O.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),Kt&&O.a.createElement(o.a,{form:xe},O.a.createElement(P.a,null,O.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),O.a.createElement(o.a.Item,{name:"end_time"},O.a.createElement(D.a,{style:{width:170},getPopupContainer:function(re){return re.parentNode},disabledDate:function(re){return Object(U.b)(re,V)},disabledTime:function(re){return Object(U.c)(re)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(h.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(In==null?void 0:In.length)>0&&O.a.createElement(P.a,null,O.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),O.a.createElement(M.a.Search,{style:{width:"300px"},onChange:function(re){jt(In.filter(function(he){return he.name.indexOf(re.target.value)>-1}))}})),(Kt==null?void 0:Kt.length)>0&&B.actionTabs.type===1&&O.a.createElement(K.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(re,he){Ge(re)}},rowKey:"id",pagination:!1,dataSource:Kt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(Kt==null?void 0:Kt.length)>0&&B.actionTabs.type===2&&O.a.createElement(K.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(re,he){Ge(re)}},rowKey:"id",pagination:!1,dataSource:Kt,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"}]})))};Qe.a=Object(v.a)(function(z){var G=z.classroomList;return{classroomList:G}})(F)},oOBs:function(tn,Qe,I){tn.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return si});var te=I("1OyB"),Y=I("vuIU"),N=I("Ji7U"),K=I("LK+K"),A=I("rePB"),M=I("VTBJ"),H=I("ODXe"),P=I("q1tI"),k=I("TSYQ"),D=I.n(k),b=I("Kwbf"),m=I("6cGi"),f=I("U8pU"),d=I("4IlW"),s=P.createContext({}),r=s,u={visibility:"hidden"};function o(J){var ue=J.prefixCls,Ce=J.prevIcon,Te=Ce===void 0?"\u2039":Ce,qe=J.nextIcon,Oe=qe===void 0?"\u203A":qe,Ve=J.superPrevIcon,et=Ve===void 0?"\xAB":Ve,Ot=J.superNextIcon,Et=Ot===void 0?"\xBB":Ot,je=J.onSuperPrev,ht=J.onSuperNext,it=J.onPrev,st=J.onNext,bt=J.children,Lt=P.useContext(r),ct=Lt.hideNextBtn,Gt=Lt.hidePrevBtn;return P.createElement("div",{className:ue},je&&P.createElement("button",{type:"button",onClick:je,tabIndex:-1,className:"".concat(ue,"-super-prev-btn"),style:Gt?u:{}},et),it&&P.createElement("button",{type:"button",onClick:it,tabIndex:-1,className:"".concat(ue,"-prev-btn"),style:Gt?u:{}},Te),P.createElement("div",{className:"".concat(ue,"-view")},bt),st&&P.createElement("button",{type:"button",onClick:st,tabIndex:-1,className:"".concat(ue,"-next-btn"),style:ct?u:{}},Oe),ht&&P.createElement("button",{type:"button",onClick:ht,tabIndex:-1,className:"".concat(ue,"-super-next-btn"),style:ct?u:{}},Et))}var a=o;function n(J){var ue=P.useContext(r),Ce=ue.hideHeader;if(Ce)return null;var Te=J.prefixCls,qe=J.generateConfig,Oe=J.locale,Ve=J.value,et=J.format,Ot="".concat(Te,"-header");return P.createElement(a,{prefixCls:Ot},Ve?qe.locale.format(Oe.locale,Ve,et):"\xA0")}var R=n,w=I("YrtM"),x=I("KQm4"),O=new Map;function C(J,ue,Ce){if(O.get(J)&&cancelAnimationFrame(O.get(J)),Ce<=0){O.set(J,requestAnimationFrame(function(){J.scrollTop=ue}));return}var Te=ue-J.scrollTop,qe=Te/Ce*10;O.set(J,requestAnimationFrame(function(){J.scrollTop+=qe,J.scrollTop!==ue&&C(J,ue,Ce-10)}))}function _(J,ue){var Ce=ue.onLeftRight,Te=ue.onCtrlLeftRight,qe=ue.onUpDown,Oe=ue.onPageUpDown,Ve=ue.onEnter,et=J.which,Ot=J.ctrlKey,Et=J.metaKey;switch(et){case d.a.LEFT:if(Ot||Et){if(Te)return Te(-1),!0}else if(Ce)return Ce(-1),!0;break;case d.a.RIGHT:if(Ot||Et){if(Te)return Te(1),!0}else if(Ce)return Ce(1),!0;break;case d.a.UP:if(qe)return qe(-1),!0;break;case d.a.DOWN:if(qe)return qe(1),!0;break;case d.a.PAGE_UP:if(Oe)return Oe(-1),!0;break;case d.a.PAGE_DOWN:if(Oe)return Oe(1),!0;break;case d.a.ENTER:if(Ve)return Ve(),!0;break}return!1}function y(J,ue,Ce,Te){var qe=J;if(!qe)switch(ue){case"time":qe=Te?"hh:mm:ss a":"HH:mm:ss";break;case"week":qe="gggg-wo";break;case"month":qe="YYYY-MM";break;case"quarter":qe="YYYY-[Q]Q";break;case"year":qe="YYYY";break;default:qe=Ce?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return qe}function h(J,ue){var Ce=J==="time"?8:10;return Math.max(Ce,ue.length)+2}var c=null,v=new Set;function p(J){return!c&&typeof window!="undefined"&&window.addEventListener&&(c=function(Ce){Object(x.a)(v).forEach(function(Te){Te(Ce)})},window.addEventListener("mousedown",c)),v.add(J),function(){v.delete(J),v.size===0&&(window.removeEventListener("mousedown",c),c=null)}}var E=function(ue){return ue==="month"||ue==="date"?"year":ue},U=function(ue){return ue==="date"?"month":ue},F=function(ue){return ue==="month"||ue==="date"?"quarter":ue},z=function(ue){return ue==="date"?"week":ue},G={year:E,month:U,quarter:F,week:z,time:null,date:null};function B(J,ue){return J.some(function(Ce){return Ce&&Ce.contains(ue)})}function T(J){var ue=J.prefixCls,Ce=J.units,Te=J.onSelect,qe=J.value,Oe=J.active,Ve=J.hideDisabledOptions,et="".concat(ue,"-cell"),Ot=P.useContext(r),Et=Ot.open,je=P.useRef(null),ht=P.useRef(new Map);return P.useLayoutEffect(function(){var it=ht.current.get(qe);it&&Et!==!1&&C(je.current,it.offsetTop,120)},[qe]),P.useLayoutEffect(function(){if(Et){var it=ht.current.get(qe);it&&C(je.current,it.offsetTop,0)}},[Et]),P.createElement("ul",{className:D()("".concat(ue,"-column"),Object(A.a)({},"".concat(ue,"-column-active"),Oe)),ref:je,style:{position:"relative"}},Ce.map(function(it){var st;return Ve&&it.disabled?null:P.createElement("li",{key:it.value,ref:function(Lt){ht.current.set(it.value,Lt)},className:D()(et,(st={},Object(A.a)(st,"".concat(et,"-disabled"),it.disabled),Object(A.a)(st,"".concat(et,"-selected"),qe===it.value),st)),onClick:function(){if(it.disabled)return;Te(it.value)}},P.createElement("div",{className:"".concat(et,"-inner")},it.label))}))}var V=T;function Z(J,ue){for(var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Te=String(J);Te.length=12,sn%=12);var lt=P.useMemo(function(){if(!Et)return[!1,!1];var Rn=[!0,!0];return zt.forEach(function(bn){var Rt=bn.disabled,Xe=bn.value;if(Rt)return;Xe>=12?Rn[1]=!1:Rn[0]=!1}),Rn},[Et,zt]),jn=Object(H.a)(lt,2),ln=jn[0],Jn=jn[1],$t=P.useMemo(function(){return Et?zt.filter(Dt?function(Rn){return Rn.value>=12}:function(Rn){return Rn.value<12}).map(function(Rn){var bn=Rn.value%12,Rt=bn===0?"12":Z(bn,2);return Object(M.a)(Object(M.a)({},Rn),{},{label:Rt,value:bn})}):zt},[Et,zt]),On=de(0,59,st,Gt&&Gt(sn)),Fn=de(0,59,Lt,on&&on(sn,Ft));Te.current={onUpDown:function(bn){var Rt=wn[qe];if(Rt)for(var Xe=Rt.units.findIndex(function(zn){return zn.value===Rt.value}),kt=Rt.units.length,Pt=1;Pt1&&(Ve=ue.addDate(Ve,-7)),Ve}function He(J,ue,Ce){var Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ue){case"year":return Ce.addYear(J,Te*10);case"quarter":case"month":return Ce.addYear(J,Te);default:return Ce.addMonth(J,Te)}}var Ue=P.createContext({}),pt=Ue;function Ct(J){var ue=J.cellPrefixCls,Ce=J.generateConfig,Te=J.rangedValue,qe=J.hoverRangedValue,Oe=J.isInView,Ve=J.isSameCell,et=J.offsetCell,Ot=J.today,Et=J.value;function je(ht){var it,st=et(ht,-1),bt=et(ht,1),Lt=xe(Te,0),ct=xe(Te,1),Gt=xe(qe,0),on=xe(qe,1),Dn=fn(Ce,Gt,on,ht);function Kn(Ft){return Ve(Lt,Ft)}function wn(Ft){return Ve(ct,Ft)}var Nn=Ve(Gt,ht),Pn=Ve(on,ht),Dt=(Dn||Pn)&&(!Oe(st)||wn(st)),sn=(Dn||Nn)&&(!Oe(bt)||Kn(bt));return it={},Object(A.a)(it,"".concat(ue,"-in-view"),Oe(ht)),Object(A.a)(it,"".concat(ue,"-in-range"),fn(Ce,Lt,ct,ht)),Object(A.a)(it,"".concat(ue,"-range-start"),Kn(ht)),Object(A.a)(it,"".concat(ue,"-range-end"),wn(ht)),Object(A.a)(it,"".concat(ue,"-range-start-single"),Kn(ht)&&!ct),Object(A.a)(it,"".concat(ue,"-range-end-single"),wn(ht)&&!Lt),Object(A.a)(it,"".concat(ue,"-range-start-near-hover"),Kn(ht)&&(Ve(st,Gt)||fn(Ce,Gt,on,st))),Object(A.a)(it,"".concat(ue,"-range-end-near-hover"),wn(ht)&&(Ve(bt,on)||fn(Ce,Gt,on,bt))),Object(A.a)(it,"".concat(ue,"-range-hover"),Dn),Object(A.a)(it,"".concat(ue,"-range-hover-start"),Nn),Object(A.a)(it,"".concat(ue,"-range-hover-end"),Pn),Object(A.a)(it,"".concat(ue,"-range-hover-edge-start"),Dt),Object(A.a)(it,"".concat(ue,"-range-hover-edge-end"),sn),Object(A.a)(it,"".concat(ue,"-range-hover-edge-start-near-range"),Dt&&Ve(st,ct)),Object(A.a)(it,"".concat(ue,"-range-hover-edge-end-near-range"),sn&&Ve(bt,Lt)),Object(A.a)(it,"".concat(ue,"-today"),Ve(Ot,ht)),Object(A.a)(it,"".concat(ue,"-selected"),Ve(Et,ht)),it}return je}function Ge(J){for(var ue=J.prefixCls,Ce=J.disabledDate,Te=J.onSelect,qe=J.rowNum,Oe=J.colNum,Ve=J.prefixColumn,et=J.rowClassName,Ot=J.baseDate,Et=J.getCellClassName,je=J.getCellText,ht=J.getCellNode,it=J.getCellDate,st=J.titleCell,bt=J.headerCells,Lt=P.useContext(r),ct=Lt.onDateMouseEnter,Gt=Lt.onDateMouseLeave,on="".concat(ue,"-cell"),Dn=[],Kn=0;Kn2&&arguments[2]!==void 0?arguments[2]:!1;(Se===Lt||pi)&&(gr(Ht),Pn&&Pn(Ht),kt&&kt(Ht,Wt),Dt&&!tt(et,Ht,$i)&&Dt(Ht))},Hn=function(Ht){return mi.current&&mi.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(Ht.which)&&Ht.preventDefault(),mi.current.onKeyDown(Ht)):(Object(b.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Gn=function(Ht){mi.current&&mi.current.onBlur&&mi.current.onBlur(Ht)};Rt&&oi!=="right"&&(Rt.current={onKeyDown:Hn,onClose:function(){mi.current&&mi.current.onClose&&mi.current.onClose()}}),P.useEffect(function(){Ot&&!bi.current&&We(Ot)},[Ot]),P.useEffect(function(){bi.current=!1},[]);var di,li=Object(M.a)(Object(M.a)({},J),{},{operationRef:mi,prefixCls:Te,viewDate:Me,value:$i,onViewDateChange:we,sourceMode:at,onPanelChange:qt,disabledDate:Se!=="decade"?it:void 0});delete li.onChange,delete li.onSelect;switch(Se){case"decade":di=P.createElement(S,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"year":di=P.createElement(ji,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"month":di=P.createElement(At,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"quarter":di=P.createElement(vn,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"week":di=P.createElement(En,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"time":delete li.showTime,di=P.createElement(ze,Object.assign({},li,Object(f.a)(Dn)==="object"?Dn:null,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;default:Dn?di=P.createElement(Tt,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}})):di=P.createElement(he,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}))}var Ei,Ri,gi=function(){var Ht=et.getNow(),Wt=Ke(et.getHour(Ht),et.getMinute(Ht),et.getSecond(Ht),hn?jn:1,yi?Jn:1,Rn?On:1),pi=Je(et,Ht,Wt[0],Wt[1],Wt[2]);un(pi,"submit")};Pt||(Ei=L(Te,Se,wn),Ri=W({prefixCls:Te,components:Sn,needConfirmButton:Fn,okDisabled:!$i||it&&it($i),locale:Ve,showNow:on,onNow:Fn&&gi,onOk:function(){$i&&(un($i,"submit",!0),Un&&Un($i))}}));var xi;if(Kn&&Se==="date"&&Lt==="date"&&!Dn){var Di=et.getNow(),dn="".concat(Te,"-today-btn"),Zt=it&&it(Di);xi=P.createElement("a",{className:D()(dn,Zt&&"".concat(dn,"-disabled")),"aria-disabled":Zt,onClick:function(){Zt||un(Di,"mouse",!0)}},Ve.today)}return P.createElement(r.Provider,{value:Object(M.a)(Object(M.a)({},bn),{},{hideHeader:"hideHeader"in J?Nn:bn.hideHeader,hidePrevBtn:Ln&&oi==="right",hideNextBtn:Ln&&oi==="left"})},P.createElement("div",{tabIndex:Gt,className:D()("".concat(Te,"-panel"),qe,(ue={},Object(A.a)(ue,"".concat(Te,"-panel-has-range"),ei&&ei[0]&&ei[1]),Object(A.a)(ue,"".concat(Te,"-panel-has-range-hover"),Oi&&Oi[0]&&Oi[1]),Object(A.a)(ue,"".concat(Te,"-panel-rtl"),zt==="rtl"),ue)),style:Oe,onKeyDown:Hn,onBlur:Gn,onMouseDown:Ft,ref:Xe},di,Ei||Ri||xi?P.createElement("div",{className:"".concat(Te,"-footer")},Ei,Ri,xi):null))}var Q=ne,ke=I("uciX"),Vt={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 kn(J){var ue,Ce=J.prefixCls,Te=J.popupElement,qe=J.popupStyle,Oe=J.visible,Ve=J.dropdownClassName,et=J.dropdownAlign,Ot=J.transitionName,Et=J.getPopupContainer,je=J.children,ht=J.range,it=J.popupPlacement,st=J.direction,bt="".concat(Ce,"-dropdown"),Lt=function(){return it!==void 0?it:st==="rtl"?"bottomRight":"bottomLeft"};return P.createElement(ke.a,{showAction:[],hideAction:[],popupPlacement:Lt(),builtinPlacements:Vt,prefixCls:bt,popupTransitionName:Ot,popup:Te,popupAlign:et,popupVisible:Oe,popupClassName:D()(Ve,(ue={},Object(A.a)(ue,"".concat(bt,"-range"),ht),Object(A.a)(ue,"".concat(bt,"-rtl"),st==="rtl"),ue)),popupStyle:qe,getPopupContainer:Et},je)}var Qn=kn;function nn(J){var ue=J.open,Ce=J.value,Te=J.isClickOutside,qe=J.triggerOpen,Oe=J.forwardKeyDown,Ve=J.blurToCancel,et=J.onSubmit,Ot=J.onCancel,Et=J.onFocus,je=J.onBlur,ht=Object(P.useState)(!1),it=Object(H.a)(ht,2),st=it[0],bt=it[1],Lt=Object(P.useState)(!1),ct=Object(H.a)(Lt,2),Gt=ct[0],on=ct[1],Dn=Object(P.useRef)(!1),Kn=Object(P.useRef)(!1),wn={onMouseDown:function(){bt(!0),qe(!0)},onKeyDown:function(Pn){switch(Pn.which){case d.a.ENTER:{ue?et()!==!1&&bt(!0):qe(!0),Pn.preventDefault();return}case d.a.TAB:{st&&ue&&!Pn.shiftKey?(bt(!1),Pn.preventDefault()):!st&&ue&&(!Oe(Pn)&&Pn.shiftKey&&(bt(!0),Pn.preventDefault()));return}case d.a.ESC:{bt(!0),Ot();return}}!ue&&![d.a.SHIFT].includes(Pn.which)?qe(!0):st||Oe(Pn)},onFocus:function(Pn){bt(!0),on(!0),Et&&Et(Pn)},onBlur:function(Pn){if(Dn.current||!Te(document.activeElement)){Dn.current=!1;return}Ve?setTimeout(function(){Te(document.activeElement)&&Ot()},0):ue&&(qe(!1),Kn.current&&et()),on(!1),je&&je(Pn)}};return Object(P.useEffect)(function(){Kn.current=!1},[ue]),Object(P.useEffect)(function(){Kn.current=!0},[Ce]),Object(P.useEffect)(function(){return p(function(Nn){var Pn=Nn.target;ue&&(Te(Pn)?Gt||qe(!1):(Dn.current=!0,requestAnimationFrame(function(){Dn.current=!1})))})}),[wn,{focused:Gt,typing:st}]}function ti(J){var ue=J.valueTexts,Ce=J.onTextChange,Te=P.useState(""),qe=Object(H.a)(Te,2),Oe=qe[0],Ve=qe[1],et=P.useRef([]);et.current=ue;function Ot(je){Ve(je),Ce(je)}function Et(){Ve(et.current[0])}return P.useEffect(function(){ue.every(function(je){return je!==Oe})&&Et()},[ue.join("||")]),[Oe,Ot,Et]}var qn=I("Gytx"),Li=I.n(qn);function lr(J,ue){var Ce=ue.formatList,Te=ue.generateConfig,qe=ue.locale;return Object(w.a)(function(){if(!J)return[[""],""];for(var Oe="",Ve=[],et=0;et1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Et.current),Gt){Ot(ct);return}Et.current=requestAnimationFrame(function(){Ot(ct)})}var ht=lr(et,{formatList:Ce,generateConfig:Te,locale:qe}),it=Object(H.a)(ht,2),st=it[1];function bt(ct){je(ct)}function Lt(){var ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;je(null,ct)}return Object(P.useEffect)(function(){Lt(!0)},[J]),Object(P.useEffect)(function(){return function(){return cancelAnimationFrame(Et.current)}},[]),[st,bt,Lt]}function Ki(J){var ue,Ce=J.prefixCls,Te=Ce===void 0?"rc-picker":Ce,qe=J.id,Oe=J.tabIndex,Ve=J.style,et=J.className,Ot=J.dropdownClassName,Et=J.dropdownAlign,je=J.popupStyle,ht=J.transitionName,it=J.generateConfig,st=J.locale,bt=J.inputReadOnly,Lt=J.allowClear,ct=J.autoFocus,Gt=J.showTime,on=J.picker,Dn=on===void 0?"date":on,Kn=J.format,wn=J.use12Hours,Nn=J.value,Pn=J.defaultValue,Dt=J.open,sn=J.defaultOpen,Ft=J.defaultOpenValue,St=J.suffixIcon,Un=J.clearIcon,Sn=J.disabled,zt=J.disabledDate,lt=J.placeholder,jn=J.getPopupContainer,ln=J.pickerRef,Jn=J.panelRender,$t=J.onChange,On=J.onOpenChange,Fn=J.onFocus,hn=J.onBlur,yi=J.onMouseDown,Rn=J.onMouseUp,bn=J.onMouseEnter,Rt=J.onMouseLeave,Xe=J.onContextMenu,kt=J.onClick,Pt=J.direction,an=J.autoComplete,zn=an===void 0?"off":an,Ln=P.useRef(null),oi=Dn==="date"&&!!Gt||Dn==="time",ei=pe(y(Kn,Dn,Gt,wn)),Oi=P.useRef(null),mi=P.useRef(null),bi=Object(m.a)(null,{value:Nn,defaultValue:Pn}),Ji=Object(H.a)(bi,2),Vi=Ji[0],$i=Ji[1],gr=P.useState(Vi),vr=Object(H.a)(gr,2),ye=vr[0],Me=vr[1],We=P.useRef(null),we=Object(m.a)(!1,{value:Dt,defaultValue:sn,postState:function(vi){return Sn?!1:vi},onChange:function(vi){On&&On(vi),!vi&&We.current&&We.current.onClose&&We.current.onClose()}}),ie=Object(H.a)(we,2),fe=ie[0],le=ie[1],Se=lr(ye,{formatList:ei,generateConfig:it,locale:st}),De=Object(H.a)(Se,2),$e=De[0],Le=De[1],at=ti({valueTexts:$e,onTextChange:function(vi){var _r=it.locale.parse(st.locale,vi,ei);_r&&(!zt||!zt(_r))&&Me(_r)}}),It=Object(H.a)(at,3),qt=It[0],un=It[1],Hn=It[2],Gn=function(vi){Me(vi),$i(vi),$t&&!tt(it,Vi,vi)&&$t(vi,vi?it.locale.format(st.locale,vi,ei[0]):"")},di=function(vi){if(Sn&&vi)return;le(vi)},li=function(vi){return fe&&We.current&&We.current.onKeyDown?We.current.onKeyDown(vi):(Object(b.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},Ei=function(){Rn&&Rn.apply(void 0,arguments),Ln.current&&(Ln.current.focus(),di(!0))},Ri=nn({blurToCancel:oi,open:fe,value:qt,triggerOpen:di,forwardKeyDown:li,isClickOutside:function(vi){return!B([Oi.current,mi.current],vi)},onSubmit:function(){return zt&&zt(ye)?!1:(Gn(ye),di(!1),Hn(),!0)},onCancel:function(){di(!1),Me(Vi),Hn()},onFocus:Fn,onBlur:hn}),gi=Object(H.a)(Ri,2),xi=gi[0],Di=gi[1],dn=Di.focused,Zt=Di.typing;P.useEffect(function(){fe||(Me(Vi),!$e.length||$e[0]===""?un(""):Le!==qt&&Hn())},[fe,$e]),P.useEffect(function(){fe||Hn()},[Dn]),P.useEffect(function(){Me(Vi)},[Vi]),ln&&(ln.current={focus:function(){Ln.current&&Ln.current.focus()},blur:function(){Ln.current&&Ln.current.blur()}});var yn=Object(M.a)(Object(M.a)({},J),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),Ht=P.createElement(Q,Object.assign({},yn,{generateConfig:it,className:D()(Object(A.a)({},"".concat(Te,"-panel-focused"),!Zt)),value:ye,locale:st,tabIndex:-1,onChange:Me,direction:Pt}));Jn&&(Ht=Jn(Ht));var Wt=P.createElement("div",{className:"".concat(Te,"-panel-container"),onMouseDown:function(vi){vi.preventDefault()}},Ht),pi;St&&(pi=P.createElement("span",{className:"".concat(Te,"-suffix")},St));var Pi;Lt&&Vi&&!Sn&&(Pi=P.createElement("span",{onMouseDown:function(vi){vi.preventDefault(),vi.stopPropagation()},onMouseUp:function(vi){vi.preventDefault(),vi.stopPropagation(),Gn(null),di(!1)},className:"".concat(Te,"-clear")},Un||P.createElement("span",{className:"".concat(Te,"-clear-btn")})));var ni=function(vi,_r){(_r==="submit"||_r!=="key"&&!oi)&&(Gn(vi),di(!1))},Ii=Pt==="rtl"?"bottomRight":"bottomLeft",or=ar(qt,{formatList:ei,generateConfig:it,locale:st}),Ni=Object(H.a)(or,3),Yi=Ni[0],zi=Ni[1],Hi=Ni[2];return P.createElement(r.Provider,{value:{operationRef:We,hideHeader:Dn==="time",panelRef:Oi,onSelect:ni,open:fe,defaultOpenValue:Ft,onDateMouseEnter:zi,onDateMouseLeave:Hi}},P.createElement(Qn,{visible:fe,popupElement:Wt,popupStyle:je,prefixCls:Te,dropdownClassName:Ot,dropdownAlign:Et,getPopupContainer:jn,transitionName:ht,popupPlacement:Ii,direction:Pt},P.createElement("div",{className:D()(Te,et,(ue={},Object(A.a)(ue,"".concat(Te,"-disabled"),Sn),Object(A.a)(ue,"".concat(Te,"-focused"),dn),Object(A.a)(ue,"".concat(Te,"-rtl"),Pt==="rtl"),ue)),style:Ve,onMouseDown:yi,onMouseUp:Ei,onMouseEnter:bn,onMouseLeave:Rt,onContextMenu:Xe,onClick:kt},P.createElement("div",{className:D()("".concat(Te,"-input"),Object(A.a)({},"".concat(Te,"-input-placeholder"),!!Yi)),ref:mi},P.createElement("input",Object.assign({id:qe,tabIndex:Oe,disabled:Sn,readOnly:bt||!Zt,value:Yi||qt,onChange:function(vi){un(vi.target.value)},autoFocus:ct,placeholder:lt,ref:Ln,title:qt},xi,{size:h(Dn,ei[0])},Ye(J),{autoComplete:zn})),pi,Pi))))}var Pr=function(J){Object(N.a)(Ce,J);var ue=Object(K.a)(Ce);function Ce(){var Te;return Object(te.a)(this,Ce),Te=ue.apply(this,arguments),Te.pickerRef=P.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(Y.a)(Ce,[{key:"render",value:function(){return P.createElement(Ki,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(P.Component),Vr=Pr;function Ai(J,ue,Ce){var Te=J.picker,qe=J.locale,Oe=J.selectedValue,Ve=J.disabledDate,et=J.disabled,Ot=J.generateConfig,Et=xe(Oe,0),je=xe(Oe,1);function ht(ct){var Gt=Ot.getYear(ct),on=Ot.locale.getWeek(qe.locale,ct);return Gt*100+on}function it(ct){var Gt=Ot.getYear(ct),on=Ot.getMonth(ct);return Gt*100+on}function st(ct){var Gt=Ot.getYear(ct),on=Bt(Ot,ct);return Gt*10+on}var bt=P.useCallback(function(ct){if(Ve&&Ve(ct))return!0;if(et[1]&&je)return!An(Ot,ct,je)&&Ot.isAfter(ct,je);if(ue&&je)switch(Te){case"quarter":return st(ct)>st(je);case"month":return it(ct)>it(je);case"week":return ht(ct)>ht(je);default:return!An(Ot,ct,je)&&Ot.isAfter(ct,je)}return!1},[Ve,et[1],je,ue]),Lt=P.useCallback(function(ct){if(Ve&&Ve(ct))return!0;if(et[0]&&Et)return!An(Ot,ct,je)&&Ot.isAfter(Et,ct);if(Ce&&Et)switch(Te){case"quarter":return st(ct)0&&arguments[0]!==void 0?arguments[0]:!1,Xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ui=null;Hi&&Nr&&Nr[0]&&Nr[1]&&bt.isAfter(Nr[1],Nr[0])&&(ui=Nr);var Mi=Nn;if(Nn&&Object(f.a)(Nn)==="object"&&Nn.defaultValue){var hr=Nn.defaultValue;Mi=Object(M.a)(Object(M.a)({},Nn),{},{defaultValue:xe(hr,Le)||void 0})}var ga=null;return ln&&(ga=function(Mr,$r){return ln(Mr,$r,{range:Le?"end":"start"})}),P.createElement(pt.Provider,{value:{inRange:!0,panelPosition:Si,rangedValue:Ya||dn,hoverRangedValue:ui}},P.createElement(Q,Object.assign({},J,Xn,{dateRender:ga,showTime:Mi,mode:Wt[Le],generateConfig:bt,style:void 0,direction:bi,disabledDate:Le===0?or:Ni,disabledTime:function(Mr){return jn?jn(Mr,Le===0?"start":"end"):!1},className:D()(Object(A.a)({},"".concat(Oe,"-panel-focused"),Le===0?!Er:!so)),value:xe(dn,Le),locale:Lt,tabIndex:-1,onPanelChange:function(Mr,$r){Pi(Ie(Wt,$r,Le),Ie(dn,Mr,Le));var va=Mr;Si==="right"&&Wt[Le]===$r&&(va=He(va,$r,bt,-1)),gi(va,Le)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var mr=0,Br=0;Le&&We.current&&ie.current&&Me.current&&(mr=We.current.offsetWidth+ie.current.offsetWidth,Me.current.offsetWidth&&mr>Me.current.offsetWidth&&(Br=mr));var Pa=bi==="rtl"?{right:mr}:{left:mr};function da(){var Si,Xn=L(Oe,Wt[Le],Xe),ui=W({prefixCls:Oe,components:Oi,needConfirmButton:gr,okDisabled:!xe(dn,Le)||lt&<(dn[Le]),locale:Lt,rangeList:Xi,onOk:function(){xe(dn,Le)&&(Fr(dn,Le),ei&&ei(dn))}});if(wn!=="time"&&!Nn){var Mi=Ri(Le),hr=He(Mi,wn,bt),ga=Wt[Le],aa=ga===wn,Mr=ki(aa?"left":!1,{pickerValue:Mi,onPickerValueChange:function(Ar){gi(Ar,Le)}}),$r=ki("right",{pickerValue:hr,onPickerValueChange:function(Ar){gi(He(Ar,wn,bt,-1),Le)}});bi==="rtl"?Si=P.createElement(P.Fragment,null,$r,aa&&Mr):Si=P.createElement(P.Fragment,null,Mr,aa&&$r)}else Si=ki();var va=P.createElement(P.Fragment,null,P.createElement("div",{className:"".concat(Oe,"-panels")},Si),(Xn||ui)&&P.createElement("div",{className:"".concat(Oe,"-footer")},Xn,ui));return Jn&&(va=Jn(va)),P.createElement("div",{className:"".concat(Oe,"-panel-container"),style:{marginLeft:Br},ref:Me,onMouseDown:function(Ar){Ar.preventDefault()}},va)}var ja=P.createElement("div",{className:D()("".concat(Oe,"-range-wrapper"),"".concat(Oe,"-").concat(wn,"-range-wrapper")),style:{minWidth:Rr}},P.createElement("div",{className:"".concat(Oe,"-range-arrow"),style:Pa}),da()),ca;hn&&(ca=P.createElement("span",{className:"".concat(Oe,"-suffix")},hn));var Sr;Fn&&(xe(Gn,0)&&!qt[0]||xe(Gn,1)&&!qt[1])&&(Sr=P.createElement("span",{onMouseDown:function(Xn){Xn.preventDefault(),Xn.stopPropagation()},onMouseUp:function(Xn){Xn.preventDefault(),Xn.stopPropagation();var ui=Gn;qt[0]||(ui=Ie(ui,null,0)),qt[1]||(ui=Ie(ui,null,1)),Fr(ui,null),rr(!1,Le)},className:"".concat(Oe,"-clear")},yi||P.createElement("span",{className:"".concat(Oe,"-clear-btn")})));var Fa={size:h(wn,Se[0])},Ba=0,Ha=0;We.current&&we.current&&ie.current&&(Le===0?Ha=We.current.offsetWidth:(Ba=mr,Ha=we.current.offsetWidth));var zr=bi==="rtl"?{right:Ba}:{left:Ba},Gi=function(Xn,ui){var Mi=Ie(dn,Xn,Le);ui==="submit"||ui!=="key"&&!gr?(Fr(Mi,Le),Le===0?$a():io()):Zt(Mi)};return P.createElement(r.Provider,{value:{operationRef:It,hideHeader:wn==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Gi,open:Hi}},P.createElement(Qn,{visible:Hi,popupElement:ja,popupStyle:Et,prefixCls:Oe,dropdownClassName:je,dropdownAlign:it,getPopupContainer:st,transitionName:ht,range:!0,direction:bi},P.createElement("div",Object.assign({ref:ye,className:D()(Oe,"".concat(Oe,"-range"),Ot,(ue={},Object(A.a)(ue,"".concat(Oe,"-disabled"),qt[0]&&qt[1]),Object(A.a)(ue,"".concat(Oe,"-focused"),Le===0?Lr:oo),Object(A.a)(ue,"".concat(Oe,"-rtl"),bi==="rtl"),ue)),style:et,onClick:xa,onMouseDown:Ja},Ye(J)),P.createElement("div",{className:D()("".concat(Oe,"-input"),(Ce={},Object(A.a)(Ce,"".concat(Oe,"-input-active"),Le===0),Object(A.a)(Ce,"".concat(Oe,"-input-placeholder"),!!ma),Ce)),ref:We},P.createElement("input",Object.assign({id:Ve,disabled:qt[0],readOnly:bn||!Er,value:ma||Sa,onChange:function(Xn){ka(Xn.target.value)},autoFocus:Gt,placeholder:xe(ct,0)||"",ref:fe},Kr,Fa,{autoComplete:$i}))),P.createElement("div",{className:"".concat(Oe,"-range-separator"),ref:ie},sn),P.createElement("div",{className:D()("".concat(Oe,"-input"),(Te={},Object(A.a)(Te,"".concat(Oe,"-input-active"),Le===1),Object(A.a)(Te,"".concat(Oe,"-input-placeholder"),!!ua),Te)),ref:we},P.createElement("input",Object.assign({disabled:qt[1],readOnly:bn||!so,value:ua||Oa,onChange:function(Xn){Va(Xn.target.value)},placeholder:xe(ct,1)||"",ref:le},ea,Fa,{autoComplete:$i}))),P.createElement("div",{className:"".concat(Oe,"-active-bar"),style:Object(M.a)(Object(M.a)({},zr),{},{width:Ha,position:"absolute"})}),ca,Sr)))}var _n=function(J){Object(N.a)(Ce,J);var ue=Object(K.a)(Ce);function Ce(){var Te;return Object(te.a)(this,Ce),Te=ue.apply(this,arguments),Te.pickerRef=P.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(Y.a)(Ce,[{key:"render",value:function(){return P.createElement(Tn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(P.Component),si=_n,ai=Qe.b=Vr},osHv:function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"use strict";var Y=te.Pos;function N(u,o){return u.line-o.line||u.ch-o.ch}var K="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",A=K+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+K+"]["+A+"]*)","g");function H(u,o,a,n){this.line=o,this.ch=a,this.cm=u,this.text=u.getLine(o),this.min=n?Math.max(n.from,u.firstLine()):u.firstLine(),this.max=n?Math.min(n.to-1,u.lastLine()):u.lastLine()}function P(u,o){var a=u.cm.getTokenTypeAt(Y(u.line,o));return a&&/\btag\b/.test(a)}function k(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function D(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 o=u.text.indexOf(">",u.ch);if(o==-1){if(k(u))continue;return}if(!P(u,o+1)){u.ch=o+1;continue}var a=u.text.lastIndexOf("/",o),n=a>-1&&!/\S/.test(u.text.slice(a+1,o));return u.ch=o+1,n?"selfClose":"regular"}}function m(u){for(;;){var o=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(o==-1){if(D(u))continue;return}if(!P(u,o+1)){u.ch=o;continue}M.lastIndex=o,u.ch=o;var a=M.exec(u.text);if(a&&a.index==o)return a}}function f(u){for(;;){M.lastIndex=u.ch;var o=M.exec(u.text);if(!o){if(k(u))continue;return}if(!P(u,o.index+1)){u.ch=o.index+1;continue}return u.ch=o.index+o[0].length,o}}function d(u){for(;;){var o=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(o==-1){if(D(u))continue;return}if(!P(u,o+1)){u.ch=o;continue}var a=u.text.lastIndexOf("/",o),n=a>-1&&!/\S/.test(u.text.slice(a+1,o));return u.ch=o+1,n?"selfClose":"regular"}}function s(u,o){for(var a=[];;){var n=f(u),R,w=u.line,x=u.ch-(n?n[0].length:0);if(!n||!(R=b(u)))return;if(R=="selfClose")continue;if(n[1]){for(var O=a.length-1;O>=0;--O)if(a[O]==n[2]){a.length=O;break}if(O<0&&(!o||o==n[2]))return{tag:n[2],from:Y(w,x),to:Y(u.line,u.ch)}}else a.push(n[2])}}function r(u,o){for(var a=[];;){var n=d(u);if(!n)return;if(n=="selfClose"){m(u);continue}var R=u.line,w=u.ch,x=m(u);if(!x)return;if(x[1])a.push(x[2]);else{for(var O=a.length-1;O>=0;--O)if(a[O]==x[2]){a.length=O;break}if(O<0&&(!o||o==x[2]))return{tag:x[2],from:Y(u.line,u.ch),to:Y(R,w)}}}}te.registerHelper("fold","xml",function(u,o){for(var a=new H(u,o.line,0);;){var n=f(a);if(!n||a.line!=o.line)return;var R=b(a);if(!R)return;if(!n[1]&&R!="selfClose"){var w=Y(a.line,a.ch),x=s(a,n[2]);return x&&N(x.from,w)>0?{from:w,to:x.from}:null}}}),te.findMatchingTag=function(u,o,a){var n=new H(u,o.line,o.ch,a);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var R=b(n),w=R&&Y(n.line,n.ch),x=R&&m(n);if(!R||!x||N(n,o)>0)return;var O={from:Y(n.line,n.ch),to:w,tag:x[2]};return R=="selfClose"?{open:O,close:null,at:"open"}:x[1]?{open:r(n,x[2]),close:O,at:"close"}:(n=new H(u,w.line,w.ch,a),{open:O,close:s(n,x[2]),at:"open"})},te.findEnclosingTag=function(u,o,a,n){for(var R=new H(u,o.line,o.ch,a);;){var w=r(R,n);if(!w)break;var x=new H(u,o.line,o.ch,a),O=s(x,w.tag);if(O)return{open:w,close:O}}},te.scanForClosingTag=function(u,o,a,n){var R=new H(u,o.line,o.ch,n?{from:0,to:n}:null);return s(R,a)}})},p5ED:function(tn,Qe,I){"use strict";var te=I("+L6B"),Y=I("2/Rp"),N=I("5Dmo"),K=I("3S7+"),A=I("k1fw"),M=I("tJVT"),H=I("q1tI"),P=I.n(H),k=I("vHTk"),D=I.n(k),b=I("yEEn"),m=I("ZW9T"),f=I("1vsH");Qe.a=function(d){var s=d.name,r=d.data,u=d.theme,o=d.type,a=d.filename,n=d.monacoEditor,R=d.className,w=d.style,x=d.close,O=d.onClose,C=d.hasMask,_=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),y=Object(M.a)(_,2),h=y[0],c=y[1],v=Object(H.useState)(""),p=Object(M.a)(v,2),E=p[0],U=p[1],F,z=1024*1024,G=10*z,B=Object(H.useRef)();o==="office"&&(F=Object(f.T)(r).filesize,F>G&&(o="other")),a&&(n.filename=a),Object(H.useEffect)(function(){var Z,oe,pe=(Z=document.cookie)===null||Z===void 0||((oe=Z.replace(/\s/g,""))===null||oe===void 0)?void 0:oe.split(";");pe==null||pe.map(function(Ye){var xe=Ye.split("=");xe[0]==="_educoder_session"&&U(xe[1])})},[]);var T=function(){if(r.startsWith("http")||r.startsWith("/")){V();return}Object(f.z)(a||"educoder",r,a)},V=function(){Object(f.x)(a||s,r)};return console.log("data:",r,"fileanme:",a," name:",s),P.a.createElement("div",{style:Object(A.a)({},w||{}),className:"".concat(C&&D.a.bgBlack," ").concat(o?D.a.wrp:"hide")},x&&P.a.createElement("div",{className:D.a.close,ref:B},P.a.createElement(K.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},P.a.createElement("span",{onClick:V},P.a.createElement("i",{className:"icon-quxiaozhiding"}))),P.a.createElement(K.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},P.a.createElement("span",{className:"",onClick:O},P.a.createElement("i",{className:"icon-guanbi1"})))),P.a.createElement("div",{className:"".concat(D.a[R]," ").concat(R," ").concat(D.a.monaco," ").concat(o==="txt"?"show":"hide")},o==="txt"&&P.a.createElement(m.b,n)),o==="audio"&&P.a.createElement("audio",{src:"".concat(r!=null&&r.startsWith("/")||(r==null?void 0:r.indexOf("https://"))>-1?r:"data:audio/mp3;base64,").concat(r),autoPlay:!0}),o==="video"&&P.a.createElement(P.a.Fragment,null,r!=null&&r.startsWith("/")?P.a.createElement("video",{controls:!0,src:"".concat(r),autoPlay:!0}):P.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(r),autoPlay:!0})),o==="html"&&P.a.createElement("iframe",{src:r+"&disposition=inline"}),o==="pdf"&&P.a.createElement("embed",{className:D.a.embed,src:r}),o==="image"&&P.a.createElement(P.a.Fragment,null,P.a.createElement("img",{src:"".concat(r!=null&&r.startsWith("/")||(r==null?void 0:r.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(r)})),o==="other"&&P.a.createElement("div",null,P.a.createElement(Y.a,{type:"primary",size:"large",onClick:T},P.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(o==="download"||o==="office")&&P.a.createElement(Y.a,{type:"primary",size:"large",onClick:T},P.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(tn,Qe,I){},psGv:function(tn,Qe,I){var te,Y;(function(){var N;(function(){"use strict";var H=[,,function(b){function m(s){this.__parent=s,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 s=new m(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},m.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},m.prototype.has_match=function(s){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(s))return!0;return!1},m.prototype.set_indent=function(s,r){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=r||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 s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__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(s){this.__items.push(s);var r=s.lastIndexOf(` `);r!==-1?this.__character_count=s.length-r:this.__character_count+=s.length},m.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},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 s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function f(s,r){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),r=r||"",s.indent_level>0&&(r=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}f.prototype.get_indent_size=function(s,r){var u=this.__base_string_length;return r=r||0,s<0&&(u=0),u+=s*this.__indent_size,u+=r,u},f.prototype.get_indent_string=function(s,r){var u=this.__base_string;return r=r||0,s<0&&(s=0,u=""),r+=s*this.__indent_size,this.__ensure_cache(r),u+=this.__cache[r],u},f.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var s=this.__cache.length,r=0,u="";this.__indent_size&&s>=this.__indent_size&&(r=Math.floor(s/this.__indent_size),s-=r*this.__indent_size,u=new Array(r+1).join(this.__indent_string)),s&&(u+=new Array(s+1).join(" ")),this.__cache.push(u)};function d(s,r){this.__indent_cache=new f(s,r),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.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(s,r){return this.__indent_cache.get_indent_string(s,r)},d.prototype.get_indent_size=function(s,r){return this.__indent_cache.get_indent_size(s,r)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(s){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===` `&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(` `);return s!==` `&&(u=u.replace(/[\n]/g,s)),u},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(s,r){return s=s||0,r=r||0,this.next_line.set_indent(s,r),this.__lines.length>1?(this.current_line.set_indent(s,r),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(s){for(var r=0;r1&&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(s,r){for(var u=this.__lines.length-2;u>=0;){var o=this.__lines[u];if(o.is_empty())break;if(o.item(0).indexOf(s)!==0&&o.item(-1)!==r){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(f,d,s,r){this.type=f,this.text=d,this.comments_before=null,this.newlines=s||0,this.whitespace_before=r||"",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(s,r){this.raw_options=f(s,r),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(s,r){var u=this.raw_options[s],o=r||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(o=u.concat()):typeof u=="string"&&(o=u.split(/[^a-zA-Z0-9_\/\-]+/)),o},m.prototype._get_boolean=function(s,r){var u=this.raw_options[s],o=u===void 0?!!r:!!u;return o},m.prototype._get_characters=function(s,r){var u=this.raw_options[s],o=r||"";return typeof u=="string"&&(o=u.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),o},m.prototype._get_number=function(s,r){var u=this.raw_options[s];r=parseInt(r,10),isNaN(r)&&(r=0);var o=parseInt(u,10);return isNaN(o)&&(o=r),o},m.prototype._get_selection=function(s,r,u){var o=this._get_selection_list(s,r,u);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values: `+r+` You passed in: '`+this.raw_options[s]+"'");return o[0]},m.prototype._get_selection_list=function(s,r,u){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[r[0]],!this._is_valid_selection(u,r))throw new Error("Invalid Default Value!");var o=this._get_array(s,u);if(!this._is_valid_selection(o,r))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values: `+r+` You passed in: '`+this.raw_options[s]+"'");return o},m.prototype._is_valid_selection=function(s,r){return s.length&&r.length&&!s.some(function(u){return r.indexOf(u)===-1})};function f(s,r){var u={};s=d(s);var o;for(o in s)o!==r&&(u[o]=s[o]);if(r&&s[r])for(o in s[r])u[o]=s[r][o];return u}function d(s){var r={},u;for(u in s){var o=u.replace(/-/g,"_");r[o]=s[u]}return r}b.exports.Options=m,b.exports.normalizeOpts=d,b.exports.mergeOpts=f},,function(b){var m=RegExp.prototype.hasOwnProperty("sticky");function f(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position=0&&d=0&&s=d.length&&this.__input.substring(s-d.length,s).toLowerCase()===d},b.exports.InputScanner=f},function(b,m,f){var d=f(8).InputScanner,s=f(3).Token,r=f(10).TokenStream,u=f(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(n,R){this._input=new d(n),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var n,R=new s(o.START,""),w=null,x=[],O=new r;R.type!==o.EOF;){for(n=this._get_next_token(R,w);this._is_comment(n);)O.add(n),n=this._get_next_token(R,w);O.isEmpty()||(n.comments_before=O,O=new r),n.parent=w,this._is_opening(n)?(x.push(w),w=n):w&&this._is_closing(n,w)&&(n.opened=w,w.closed=n,w=x.pop(),n.parent=w),n.previous=R,R.next=n,this.__tokens.add(n),R=n}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(n,R){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(o.RAW,w):this._create_token(o.EOF,"")},a.prototype._is_comment=function(n){return!1},a.prototype._is_opening=function(n){return!1},a.prototype._is_closing=function(n,R){return!1},a.prototype._create_token=function(n,R){var w=new s(n,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=a,b.exports.TOKEN=o},function(b){function m(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position=0&&f/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}r.prototype=new d,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(u){var o=this._create();return o._disabled[u]=!0,o._update(),o},r.prototype.read_options=function(u){var o=this._create();for(var a in s)o._disabled[a]=u.templating.indexOf(a)===-1;return o._update(),o},r.prototype.exclude=function(u){var o=this._create();return o._excluded[u]=!0,o._update(),o},r.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 o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),u+=o,o=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},r.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("|")+")")},r.prototype._read_template=function(){var u="",o=this._input.peek();if(o==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(u=u||this.__patterns.erb.read())}else o==="{"&&(!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=r},,,,function(b,m,f){var d=f(19).Beautifier,s=f(20).Options;function r(u,o,a,n){var R=new d(u,o,a,n);return R.beautify()}b.exports=r,b.exports.defaultOptions=function(){return new s}},function(b,m,f){var d=f(20).Options,s=f(2).Output,r=f(21).Tokenizer,u=f(21).TOKEN,o=/\r\n|[\r\n]/,a=/\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 s(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.newlines0);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 R=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},w=function(v,p){var E=null,U=null;return p.closed?(v==="script"?E="text/javascript":v==="style"&&(E="text/css"),E=R(p)||E,E.search("text/css")>-1?U="css":E.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":E.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":E.search(/test\/null/)>-1&&(U="null"),U):null};function x(v,p){return p.indexOf(v)!==-1}function O(v,p,E){this.parent=v||null,this.tag=p?p.tag_name:"",this.indent_level=E||0,this.parser_token=p||null}function C(v){this._printer=v,this._current_frame=null}C.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},C.prototype.record_tag=function(v){var p=new O(this._current_frame,v,this._printer.indent_level);this._current_frame=p},C.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},C.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},C.prototype.try_pop=function(v,p){var E=this._get_frame([v],p);return this._try_pop_frame(E)},C.prototype.indent_to_tag=function(v){var p=this._get_frame(v);p&&(this._printer.indent_level=p.indent_level)};function _(v,p,E,U){this._source_text=v||"",p=p||{},this._js_beautify=E,this._css_beautify=U,this._tag_stack=null;var F=new d(p,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}_.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&&o.test(v)&&(p=v.match(o)[0])),v=v.replace(a,` `);var E=v.match(/^[\t ]*/)[0],U={text:"",type:""},F=new y,z=new n(this._options,E),G=new r(v,this._options).tokenize();this._tag_stack=new C(z);for(var B=null,T=G.next();T.type!==u.EOF;)T.type===u.TAG_OPEN||T.type===u.COMMENT?(B=this._handle_tag_open(z,T,F,U),F=B):T.type===u.ATTRIBUTE||T.type===u.EQUALS||T.type===u.VALUE||T.type===u.TEXT&&!F.tag_complete?B=this._handle_inside_tag(z,T,F,G):T.type===u.TAG_CLOSE?B=this._handle_tag_close(z,T,F):T.type===u.TEXT?B=this._handle_text(z,T,F):z.add_raw_token(T),U=B,T=G.next();var V=z._output.get_code(p);return V},_.prototype._handle_tag_close=function(v,p,E){var U={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(),U},_.prototype._handle_inside_tag=function(v,p,E,U){var F=E.has_wrapped_attrs,z={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),F=F||p.newlines!==0),this._is_wrap_attributes_force)){var G=E.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&E.attr_count===1){var B=!0,T=0,V;do{if(V=U.peek(T),V.type===u.ATTRIBUTE){B=!1;break}T+=1}while(T<4&&V.type!==u.EOF&&V.type!==u.TAG_CLOSE);G=!B}G&&(v.print_newline(!1),F=!0)}v.print_token(p),F=F||v.previous_token_wrapped(),E.has_wrapped_attrs=F}return z},_.prototype._handle_text=function(v,p,E){var U={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)),U},_.prototype._print_custom_beatifier_text=function(v,p,E){var U=this;if(p.text!==""){var F=p.text,z,G=1,B="",T="";E.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?z=this._js_beautify:E.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?z=this._css_beautify:E.custom_beautifier_name==="html"&&(z=function(xe,Ie){var Je=new _(xe,Ie,U._js_beautify,U._css_beautify);return Je.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-v.indent_level);var V=v.get_full_indent(G);if(F=F.replace(/\n[ \t]*$/,""),E.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(|]]>)$/.exec(F);if(!Z){v.add_raw_token(p);return}B=V+Z[1]+` `,F=Z[4],Z[5]&&(T=V+Z[5]),F=F.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(` `)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(p.whitespace_before=Z[0]))}if(F)if(z){var oe=function(){this.eol=` `};oe.prototype=this._options.raw_options;var pe=new oe;F=z(V+F,pe)}else{var Ye=p.whitespace_before;Ye&&(F=F.replace(new RegExp(` (`+Ye+")?","g"),` `)),F=V+F.replace(/\n/g,` `+V)}B&&(F?F=B+F+` `+T:F=B+T),v.print_newline(!1),F&&(p.text=F,p.whitespace_before="",p.newlines=0,v.add_raw_token(p),v.print_newline(!0))}},_.prototype._handle_tag_open=function(v,p,E,U){var F=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("]*)/),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 U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};_.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,U,F){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=w(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 z=v.current_line_has_match(/{{#if/);z||v.print_newline(!1)}E.tag_name==="!--"&&F.type===u.TAG_CLOSE&&U.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 G=!1;G=E.start_tag_token&&E.start_tag_token.multiline_content,G=G||!E.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(F.type===u.TAG_CLOSE&&E.start_tag_token===U)&&F.type!=="TK_CONTENT",(E.is_content_unformatted||E.is_unformatted)&&(G=!1),G&&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)&&(F.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 h=["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"&&h.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,f){var d=f(6).Options;function s(r){d.call(this,r,"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"])}s.prototype=new d,b.exports.Options=s},function(b,m,f){var d=f(9).Tokenizer,s=f(9).TOKEN,r=f(13).Directives,u=f(14).TemplatablePattern,o=f(12).Pattern,a={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:s.START,RAW:s.RAW,EOF:s.EOF},n=new r(/<\!--/,/-->/),R=function(w,x){d.call(this,w,x),this._current_tag_name="";var O=new u(this._input).read_options(this._options),C=new o(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:C.starting_with(/{{!--/).until_after(/--}}/),handlebars:C.starting_with(/{{/).until_after(/}}/),handlebars_open:C.until(/[\n\r\t }]/),handlebars_raw_close:C.until(/}}/),comment:C.starting_with(//),cdata:C.starting_with(//),conditional_comment:C.starting_with(//),processing:C.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=C.matching(_).until_after(_)}};R.prototype=new d,R.prototype._is_comment=function(w){return!1},R.prototype._is_opening=function(w){return w.type===a.TAG_OPEN},R.prototype._is_closing=function(w,x){return w.type===a.TAG_CLOSE&&x&&((w.text===">"||w.text==="/>")&&x.text[0]==="<"||w.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(w,x){var O=null;this._readWhitespace();var C=this._input.peek();return C===null?this._create_token(a.EOF,""):(O=O||this._read_open_handlebars(C,x),O=O||this._read_attribute(C,w,x),O=O||this._read_close(C,x),O=O||this._read_raw_content(C,w,x),O=O||this._read_content_word(C),O=O||this._read_comment_or_cdata(C),O=O||this._read_processing(C),O=O||this._read_open(C,x),O=O||this._create_token(a.UNKNOWN,this._input.next()),O)},R.prototype._read_comment_or_cdata=function(w){var x=null,O=null,C=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(O=this.__patterns.comment.read(),O?(C=n.get_directives(O),C&&C.ignore==="start"&&(O+=n.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(x=this._create_token(a.COMMENT,O),x.directives=C)}return x},R.prototype._read_processing=function(w){var x=null,O=null,C=null;if(w==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(x=this._create_token(a.COMMENT,O),x.directives=C)}return x},R.prototype._read_open=function(w,x){var O=null,C=null;return x||w==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),C=this._create_token(a.TAG_OPEN,O)),C},R.prototype._read_open_handlebars=function(w,x){var O=null,C=null;return x||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),C=this._create_token(a.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),C=this._create_token(a.TAG_OPEN,O))),C},R.prototype._read_close=function(w,x){var O=null,C=null;return x&&(x.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(O=this._input.next(),w==="/"&&(O+=this._input.next()),C=this._create_token(a.TAG_CLOSE,O)):x.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),C=this._create_token(a.TAG_CLOSE,"}}"))),C},R.prototype._read_attribute=function(w,x,O){var C=null,_="";if(O&&O.text[0]==="<")if(w==="=")C=this._create_token(a.EQUALS,this._input.next());else if(w==='"'||w==="'"){var y=this._input.next();w==='"'?y+=this.__patterns.double_quote.read():y+=this.__patterns.single_quote.read(),C=this._create_token(a.VALUE,y)}else _=this.__patterns.attribute.read(),_&&(x.type===a.EQUALS?C=this._create_token(a.VALUE,_):C=this._create_token(a.ATTRIBUTE,_));return C},R.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},R.prototype._read_raw_content=function(w,x,O){var C="";if(O&&O.text[0]==="{")C=this.__patterns.handlebars_raw_close.read();else if(x.type===a.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(w);if(y)return y.type=a.TEXT,y;C=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(_)&&(C=this._input.readUntil(new RegExp("","ig")))}return C?this._create_token(a.TEXT,C):null},R.prototype._read_content_word=function(w){var x="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(a.TEXT,x)},b.exports.Tokenizer=R,b.exports.TOKEN=a}],P={};function k(b){var m=P[b];if(m!==void 0)return m.exports;var f=P[b]={exports:{}};return H[b](f,f.exports,k),f.exports}var D=k(18);N=D})();var K=N;if(!0)!(te=[I,I("6UM0"),I("TXwP")],Y=function(H){var P=I("6UM0"),k=I("TXwP");return{html_beautify:function(D,b){return K(D,b,P.js_beautify,k.css_beautify)}}}.apply(Qe,te),Y!==void 0&&(tn.exports=Y));else var A,M})()},"rAM+":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return Y});var te=I("Qw5x");function Y(N,K){var A;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(A=Object(te.a)(N))||K&&N&&typeof N.length=="number"){A&&(N=A);var M=0,H=function(){};return{s:H,n:function(){return M>=N.length?{done:!0}:{done:!1,value:N[M++]}},e:function(m){throw m},f:H}}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 P=!0,k=!1,D;return{s:function(){A=N[Symbol.iterator]()},n:function(){var m=A.next();return P=m.done,m},e:function(m){k=!0,D=m},f:function(){try{!P&&A.return!=null&&A.return()}finally{if(k)throw D}}}}},rUJ1:function(tn,Qe){const I=/[&<>"']/,te=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},A=C=>K[C];function M(C,_){if(_){if(I.test(C))return C.replace(te,A)}else if(Y.test(C))return C.replace(N,A);return C}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function P(C){return C.replace(H,(_,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 k=/(^|[^\[])\^/g;function D(C,_){C=C.source||C,_=_||"";const y={replace:(h,c)=>(c=c.source||c,c=c.replace(k,"$1"),C=C.replace(h,c),y),getRegex:()=>new RegExp(C,_)};return y}const b=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(C,_,y){if(C){let h;try{h=decodeURIComponent(P(y)).replace(b,"").toLowerCase()}catch(c){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}_&&!m.test(y)&&(y=o(_,y));try{y=encodeURI(y).replace(/%25/g,"%")}catch(h){return null}return y}const d={},s=/^[^:]+:\/*[^/]*$/,r=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(C,_){d[" "+C]||(s.test(C)?d[" "+C]=C+"/":d[" "+C]=w(C,"/",!0)),C=d[" "+C];const y=C.indexOf(":")===-1;return _.substring(0,2)==="//"?y?_:C.replace(r,"$1")+_:_.charAt(0)==="/"?y?_:C.replace(u,"$1")+_:C+_}const a={exec:function(){}};function n(C){let _=1,y,h;for(;_{let U=!1,F=p;for(;--F>=0&&E[F]==="\\";)U=!U;return U?"|":" |"}),h=y.split(/ \|/);let c=0;if(h.length>_)h.splice(_);else for(;h.length<_;)h.push("");for(;c1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(n.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=n[0];if(M.isValidElement(R)&&Object(b.c)(R)){var w=R.ref;n[0]=M.cloneElement(R,{ref:Object(b.a)(w,this.setChildNode)})}return n.length===1?n[0]:n.map(function(x,O){return!M.isValidElement(x)||"key"in x&&x.key!==null?x:M.cloneElement(x,{key:"".concat(f,"-").concat(O)})})}}]),u}(M.Component);d.displayName="ResizeObserver",Qe.a=d},ulZh:function(tn,Qe,I){typeof window!="undefined"&&function(Y,N){tn.exports=N()}(this,function(){return function(te){var Y={};function N(K){if(Y[K])return Y[K].exports;var A=Y[K]={i:K,l:!1,exports:{}};return te[K].call(A.exports,A,A.exports,N),A.l=!0,A.exports}return N.m=te,N.c=Y,N.d=function(K,A,M){N.o(K,A)||Object.defineProperty(K,A,{enumerable:!0,get:M})},N.r=function(K){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})},N.t=function(K,A){if(A&1&&(K=N(K)),A&8)return K;if(A&4&&typeof K=="object"&&K&&K.__esModule)return K;var M=Object.create(null);if(N.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:K}),A&2&&typeof K!="string")for(var H in K)N.d(M,H,function(P){return K[P]}.bind(null,H));return M},N.n=function(K){var A=K&&K.__esModule?function(){return K.default}:function(){return K};return N.d(A,"a",A),A},N.o=function(K,A){return Object.prototype.hasOwnProperty.call(K,A)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,Y,N){"use strict";var K=Object.prototype.hasOwnProperty,A="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(A=!1));function H(b,m,f){this.fn=b,this.context=m,this.once=f||!1}function P(b,m,f,d,s){if(typeof f!="function")throw new TypeError("The listener must be a function");var r=new H(f,d||b,s),u=A?A+m:m;return b._events[u]?b._events[u].fn?b._events[u]=[b._events[u],r]:b._events[u].push(r):(b._events[u]=r,b._eventsCount++),b}function k(b,m){--b._eventsCount===0?b._events=new M:delete b._events[m]}function D(){this._events=new M,this._eventsCount=0}D.prototype.eventNames=function(){var m=[],f,d;if(this._eventsCount===0)return m;for(d in f=this._events)K.call(f,d)&&m.push(A?d.slice(1):d);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(f)):m},D.prototype.listeners=function(m){var f=A?A+m:m,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var s=0,r=d.length,u=new Array(r);s0},!1)}function b(m,f){for(var d={main:[f]},s={main:[]},r={main:{}};D(d);)for(var u=Object.keys(d),o=0;o=2*O/_||E<=F)return;var z=Number.POSITIVE_INFINITY,G;for(G=u.level-1;G>h;G--){var B=y[G].maxBitrate;if(z=O*B/(8*.8*p),z=E)return;var T=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+u.sn+(o?" part "+o.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+` Current BW estimate: `+(Object(K.isFiniteNumber)(T)?(T/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+E.toFixed(3)+` s Estimated load time for the next fragment: `+z.toFixed(3)+` s Time to underbuffer: `+F.toFixed(3)+" s"),a.nextLoadLevel=G,this.bwEstimator.sample(C,x.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),a.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:o,stats:x})},s.onFragLoaded=function(u,o){var a=o.frag,n=o.part;if(a.type===k.PlaylistLevelType.MAIN&&Object(K.isFiniteNumber)(a.sn)){var R=n?n.stats:a.stats,w=n?n.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[a.level],O=(x.loaded?x.loaded.bytes:0)+R.loaded,C=(x.loaded?x.loaded.duration:0)+w;x.loaded={bytes:O,duration:C},x.realBitrate=Math.round(8*O/C)}if(a.bitrateTest){var _={stats:R,frag:a,part:n,id:a.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,_),a.bitrateTest=!1}}},s.onFragBuffered=function(u,o){var a=o.frag,n=o.part,R=n?n.stats:a.stats;if(R.aborted)return;if(a.type!==k.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var w=R.parsing.end-R.loading.start;this.bwEstimator.sample(w,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},s.onError=function(u,o){switch(o.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var u=this.fragCurrent,o=this.partCurrent,a=this.hls,n=a.maxAutoLevel,R=a.config,w=a.minAutoLevel,x=a.media,O=o?o.duration:u?u.duration:0,C=x?x.currentTime:0,_=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,y=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,h=(H.BufferHelper.bufferInfo(x,C,R.maxBufferHole).end-C)/_,c=this.findBestLevel(y,w,n,h,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(c>=0)return c;D.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=O?Math.min(O,R.maxStarvationDelay):R.maxStarvationDelay,p=R.abrBandWidthFactor,E=R.abrBandWidthUpFactor;if(!h){var U=this.bitrateTestDelay;if(U){var F=O?Math.min(O,R.maxLoadingDelay):R.maxLoadingDelay;v=F-U,D.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),p=E=1}}return c=this.findBestLevel(y,w,n,h+v,p,E),Math.max(c,0)},s.findBestLevel=function(u,o,a,n,R,w){for(var x,O=this.fragCurrent,C=this.partCurrent,_=this.lastLoadedFragLevel,y=this.hls.levels,h=y[_],c=!!(h!=null&&(x=h.details)!==null&&x!==void 0&&x.live),v=h==null?void 0:h.codecSet,p=C?C.duration:O?O.duration:0,E=a;E>=o;E--){var U=y[E];if(!U||v&&U.codecSet!==v)continue;var F=U.details,z=(C?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||p,G=void 0;E<=_?G=R*u:G=w*u;var B=y[E].maxBitrate,T=B*z/G;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round(G)+"/"+B+"/"+z+"/"+n+"/"+T),G>B&&(!T||c&&!this.bitrateTestDelay||T0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=A.State.IDLE):(this.loadedmetadata=!1,this.state=A.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},_.doTick=function(){switch(this.state){case A.State.IDLE:this.doTickIdle();break;case A.State.WAITING_TRACK:{var h,c=this.levels,v=this.trackId,p=c==null||((h=c[v])===null||h===void 0)?void 0:h.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=A.State.WAITING_INIT_PTS}break}case A.State.FRAG_LOADING_WAITING_RETRY:{var E,U=performance.now(),F=this.retryDate;(!F||U>=F||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=A.State.IDLE);break}case A.State.WAITING_INIT_PTS:{var z=this.waitingData;if(z){var G=z.frag,B=z.part,T=z.cache,V=z.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=A.State.FRAG_LOADING;var Z=T.flush(),oe={frag:G,part:B,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(oe),V&&O.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var pe=this.getLoadPosition(),Ye=H.BufferHelper.bufferInfo(this.mediaBuffer,pe,this.config.maxBufferHole),xe=Object(s.fragmentWithinToleranceTest)(Ye.end,this.config.maxFragLookUpTolerance,G);xe<0&&(o.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+Ye.end+" is needed"),this.clearWaitingFragment())}}else this.state=A.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=A.State.IDLE)},_.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:h,v=c.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},_.doTickIdle=function(){var h,c,v=this.hls,p=this.levels,E=this.media,U=this.trackId,F=v.config;if(!p||!p[U])return;if(!E&&(this.startFragRequested||!F.startFragPrefetch))return;var z=p[U],G=z.details;if(!G||G.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(G)){this.state=A.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(B===null)return;var T=B.len,V=this.getMaxBufferLength(),Z=this.audioSwitch;if(T>=V&&!Z)return;if(!Z&&this._streamEnded(B,G)){v.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=A.State.ENDED;return}var oe=G.fragments,pe=oe[0].start,Ye=B.end;if(Z){var xe=this.getLoadPosition();Ye=xe,G.PTSKnown&&xepe||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),E.currentTime=pe+.05))}var Ie=this.getNextFragment(Ye,G);if(!Ie){this.bufferFlushed=!0;return}((h=Ie.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((c=Ie.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Ie,G):this.loadFragment(Ie,G,Ye)},_.getMaxBufferLength=function(){var h=O.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return c===null?h:Math.max(h,c.len)},_.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(h,c){var v=c.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(p){return new k.Level(p)})},_.onAudioTrackSwitching=function(h,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(w):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=A.State.IDLE):this.state=A.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(h,c){this.mainDetails=c.details},_.onAudioTrackLoaded=function(h,c){var v,p=this.levels,E=c.details,U=c.id;if(!p){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var F=p[U],z=0;if(E.live||(v=F.details)!==null&&v!==void 0&&v.live){var G=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!G)return;!F.details&&E.hasProgramDateTime&&G.hasProgramDateTime?(Object(r.alignMediaPlaylistByPDT)(E,G),z=E.fragments[0].start):z=this.alignPlaylists(E,F.details)}F.details=E,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(F.details,z),this.state===A.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=A.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(h){var c,v=h.frag,p=h.part,E=h.payload,U=this.config,F=this.trackId,z=this.levels;if(!z){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 G=z[F];console.assert(G,"Audio track is defined on fragment load progress");var B=G.details;console.assert(B,"Audio track details are defined on fragment load progress");var T=U.defaultAudioCodec||G.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new f.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[v.cc],oe=(c=v.initSegment)===null||c===void 0?void 0:c.data;if(Z!==void 0){var pe=!1,Ye=p?p.index:-1,xe=Ye!==-1,Ie=new d.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,E.byteLength,Ye,xe);V.push(E,oe,T,"",v,p,B.totalduration,pe,Ie,Z)}else{o.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+F);var Je=this.waitingData=this.waitingData||{frag:v,part:p,cache:new m.default,complete:!1},Ke=Je.cache;Ke.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=A.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,h)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(h,c){var v=c.tracks.audio;v&&(this.mediaBuffer=v.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},_.onFragBuffered=function(h,c){var v=c.frag,p=c.part;if(v.type!==D.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(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,p)},_.onError=function(h,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(D.PlaylistLevelType.AUDIO,c);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==A.State.ERROR&&this.state!==A.State.STOPPED&&(this.state=c.fatal?A.State.ERROR:A.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===A.State.PARSING||this.state===A.State.PARSED)){var v=!0,p=this.getFwdBufferInfo(this.mediaBuffer,D.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,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(h,c){var v=c.type;v===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(h){var c,v="audio",p=this.hls,E=h.remuxResult,U=h.chunkMeta,F=this.getCurrentContext(U);if(!F){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var z=F.frag,G=F.part,B=E.audio,T=E.text,V=E.id3,Z=E.initSegment;if(this.fragContextChanged(z))return;if(this.state=A.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,z,U),p.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:v,tracks:Z.tracks})),B){var oe=B.startPTS,pe=B.endPTS,Ye=B.startDTS,xe=B.endDTS;G&&(G.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:pe,startDTS:Ye,endDTS:xe}),z.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,oe,pe,Ye,xe),this.bufferFragmentData(B,z,G,U)}if(V!=null&&(c=V.samples)!==null&&c!==void 0&&c.length){var Ie=a({frag:z,id:v},V);p.trigger(M.Events.FRAG_PARSING_METADATA,Ie)}if(T){var Je=a({frag:z,id:v},T);p.trigger(M.Events.FRAG_PARSING_USERDATA,Je)}},_._bufferInitSegment=function(h,c,v){if(this.state!==A.State.PARSING)return;h.video&&delete h.video;var p=h.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(M.Events.BUFFER_CODECS,h);var E=p.initSegment;if(E!=null&&E.byteLength){var U={type:"audio",frag:c,part:null,chunkMeta:v,parent:c.type,data:E};this.hls.trigger(M.Events.BUFFER_APPENDING,U)}this.tick()},_.loadFragment=function(h,c,v){var p=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||p===P.FragmentState.NOT_LOADED||p===P.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):c.live&&!Object(K.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=A.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,h,c,v)))},_.completeAudioSwitch=function(){var h=this.hls,c=this.media,v=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:v})},C}(A.default);Y.default=x},"./src/controller/audio-track-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts"),A=N("./src/errors.ts"),M=N("./src/controller/base-playlist-controller.ts"),H=N("./src/types/loader.ts");function P(f,d){for(var s=0;s=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=o[this.trackId];this.log("Now switching to audio-track index "+u);var n=o[u],R=n.id,w=n.groupId,x=w===void 0?"":w,O=n.name,C=n.type,_=n.url;if(this.trackId=u,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(K.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:x,name:O,type:C,url:_}),n.details&&!n.details.live)return;var y=this.switchParams(n.url,a==null?void 0:a.details);this.loadPlaylist(y)},s.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,a=this.findTrackId(o)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(u){for(var o=this.tracksInGroup,a=0;ad.partTarget&&(n+=1)}if(Object(K.isFiniteNumber)(a))return new A.HlsUrlParameters(a,Object(K.isFiniteNumber)(n)?n:void 0,A.HlsSkip.No)}}},b.loadPlaylist=function(f){},b.shouldLoadTrack=function(f){return this.canLoad&&f&&!!f.url&&(!f.details||f.details.live)},b.playlistLoaded=function(f,d,s){var r=this,u=d.details,o=d.stats,a=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(u.advancedDateTime=Date.now()-a,u.live||s!=null&&s.live){if(u.reloaded(s),s&&this.log("live playlist "+f+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),s&&u.fragments.length>0&&Object(M.mergeDetails)(s,u),!this.canLoad||!u.live)return;var n,R=void 0,w=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var x=this.hls.config.lowLatencyMode,O=u.lastPartSn,C=u.endSN,_=u.lastPartIndex,y=_!==-1,h=O===C,c=x?0:_;y?(R=h?C+1:O,w=h?c:_+1):R=C+1;var v=u.age,p=v+u.ageHeader,E=Math.min(p-u.partTarget,u.targetduration*1.5);if(E>0){if(s&&E>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+E+" with playlist age: "+u.age),E=0;else{var U=Math.floor(E/u.targetduration);if(R+=U,w!==void 0){var F=Math.round(E%u.targetduration/u.partTarget);w+=F}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+E+" skip sn "+U+" to part "+w)}u.tuneInGoal=E}if(n=this.getDeliveryDirectives(u,d.deliveryDirectives,R,w),x||!h){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(u,d.deliveryDirectives,R,w);var z=Object(M.computeReloadInterval)(u,o);R!==void 0&&u.canBlockReload&&(z-=u.partTarget||1),this.log("reload live playlist "+f+" in "+Math.round(z)+" ms"),this.timer=self.setTimeout(function(){return r.loadPlaylist(n)},z)}else this.clearTimer()},b.getDeliveryDirectives=function(f,d,s,r){var u=Object(A.getSkipValue)(f,s);return d!=null&&d.skip&&f.deltaUpdateFailed&&(s=d.msn,r=d.part,u=A.HlsSkip.No),new A.HlsUrlParameters(s,r,u)},b.retryLoadingOrFail=function(f){var d=this,s=this.hls.config,r=this.retryCount-1&&(u=f.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+f.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+f.details+'"')}}else this.warn('cannot recover from error "'+f.details+'"'),this.clearTimer(),f.fatal=!0;return r},D}()},"./src/controller/base-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return C}),N.d(Y,"default",function(){return _});var K=N("./src/polyfills/number.ts"),A=N("./src/task-loop.ts"),M=N("./src/controller/fragment-tracker.ts"),H=N("./src/utils/buffer-helper.ts"),P=N("./src/utils/logger.ts"),k=N("./src/events.ts"),D=N("./src/errors.ts"),b=N("./src/types/transmuxer.ts"),m=N("./src/utils/mp4-tools.ts"),f=N("./src/utils/discontinuities.ts"),d=N("./src/controller/fragment-finders.ts"),s=N("./src/controller/level-helper.ts"),r=N("./src/loader/fragment-loader.ts"),u=N("./src/crypt/decrypter.ts"),o=N("./src/utils/time-ranges.ts"),a=N("./src/types/loader.ts");function n(y,h){for(var c=0;cZ;(G0&&G&&G.key&&G.iv&&G.method==="AES-128"){var B=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(z),G.key.buffer,G.iv.buffer).then(function(T){var V=self.performance.now();return F.trigger(k.Events.FRAG_DECRYPTED,{frag:p,payload:T,stats:{tstart:B,tdecrypt:V}}),U.payload=T,U})}return U}).then(function(U){var F=E.fragCurrent,z=E.hls,G=E.levels;if(!G)throw new Error("init load aborted, missing levels");var B=G[p.level].details;console.assert(B,"Level details are defined when init segment is loaded");var T=p.stats;E.state=C.IDLE,E.fragLoadError=0,p.data=new Uint8Array(U.payload),T.parsing.start=T.buffering.start=self.performance.now(),T.parsing.end=T.buffering.end=self.performance.now(),U.frag===F&&z.trigger(k.Events.FRAG_BUFFERED,{stats:T,frag:F,part:null,id:p.type}),E.tick()}).catch(function(U){E.warn(U),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 U=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+" "+o.default.toString(H.BufferHelper.getBuffered(U))),this.state=C.IDLE,this.tick()},c._handleFragmentLoadComplete=function(p){var E=this.transmuxer;if(!E)return;var U=p.frag,F=p.part,z=p.partsLoaded,G=!z||z.length===0||z.some(function(T){return!T}),B=new b.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,F?F.index:-1,!G);E.flush(B)},c._handleFragmentLoadProgress=function(p){},c._doFragLoad=function(p,E,U,F){var z=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(p.start,U||0),this.config.lowLatencyMode&&E){var G=E.partList;if(G&&F){U>p.end&&E.fragmentHint&&(p=E.fragmentHint);var B=this.getNextPart(G,p,U);if(B>-1){var T=G[B];return this.log("Loading part sn: "+p.sn+" p: "+T.index+" cc: "+p.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+B+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=T.start+T.duration,this.state=C.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:p,part:G[B],targetBufferTime:U}),this.doFragPartsLoad(p,G,B,F).catch(function(V){return z.handleFragLoadError(V)})}else if(!p.url||this.loadedEndOfParts(G,U))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(U.toFixed(3))),Object(K.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=C.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:p,targetBufferTime:U}),this.fragmentLoader.load(p,F).catch(function(V){return z.handleFragLoadError(V)})},c.doFragPartsLoad=function(p,E,U,F){var z=this;return new Promise(function(G,B){var T=[],V=function Z(oe){var pe=E[oe];z.fragmentLoader.loadPart(p,pe,F).then(function(Ye){T[pe.index]=Ye;var xe=Ye.part;z.hls.trigger(k.Events.FRAG_LOADED,Ye);var Ie=E[oe+1];if(Ie&&Ie.fragment===p)Z(oe+1);else return G({frag:p,part:xe,partsLoaded:T})}).catch(B)};V(U)})},c.handleFragLoadError=function(p){var E=p.data;return E&&E.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(k.Events.ERROR,E),null},c._handleTransmuxerFlush=function(p){var E=this.getCurrentContext(p);if(!E||this.state!==C.PARSING){this.fragCurrent||(this.state=C.IDLE);return}var U=E.frag,F=E.part,z=E.level,G=self.performance.now();U.stats.parsing.end=G,F&&(F.stats.parsing.end=G),this.updateLevelTiming(U,F,z,p.partial)},c.getCurrentContext=function(p){var E=this.levels,U=p.level,F=p.sn,z=p.part;if(!E||!E[U])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+U+". The current chunk will not be buffered."),null;var G=E[U],B=z>-1?Object(s.getPartWith)(G,F,z):null,T=B?B.fragment:Object(s.getFragmentWithSN)(G,F,this.fragCurrent);return T?{frag:T,part:B,level:G}:null},c.bufferFragmentData=function(p,E,U,F){if(!p||this.state!==C.PARSING)return;var z=p.data1,G=p.data2,B=z;if(z&&G&&(B=Object(m.appendUint8Array)(z,G)),!B||!B.length)return;var T={type:p.type,frag:E,part:U,chunkMeta:F,parent:E.type,data:B};this.hls.trigger(k.Events.BUFFER_APPENDING,T),p.dropped&&p.independent&&!U&&this.flushBufferGap(E)},c.flushBufferGap=function(p){var E=this.media;if(!E)return;if(!H.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,p.start);return}var U=E.currentTime,F=H.BufferHelper.bufferInfo(E,U,0),z=p.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,z*.25),B=Math.max(Math.min(p.start-G,F.end-G),U+G);p.start-B>G&&this.flushMainBuffer(B,p.start)},c.getFwdBufferInfo=function(p,E){var U=this.config,F=this.getLoadPosition();if(!Object(K.isFiniteNumber)(F))return null;var z=H.BufferHelper.bufferInfo(p,F,U.maxBufferHole);if(z.len===0&&z.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(F,E);if(G&&z.nextStart=U?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(p,E){var U,F,z=E.fragments,G=z.length;if(!G)return null;var B=this.config,T=z[0].start,V;if(E.live){var Z=B.initialLiveManifestSize;if(G-1&&UU.start&&U.loaded},c.getInitialLiveFragment=function(p,E){var U=this.fragPrevious,F=null;if(U){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),F=Object(d.findFragmentByPDT)(E,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var z=U.sn+1;if(z>=p.startSN&&z<=p.endSN){var G=E[z-p.startSN];U.cc===G.cc&&(F=G,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(d.findFragWithCC)(E,U.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(F=this.getFragmentAtPosition(B,this.bitrateTest?p.fragmentEnd:p.edge,p))}return F},c.getFragmentAtPosition=function(p,E,U){var F=this.config,z=this.fragPrevious,G=U.fragments,B=U.endSN,T=U.fragmentHint,V=F.maxFragLookUpTolerance,Z=!!(F.lowLatencyMode&&U.partList&&T);Z&&T&&!this.bitrateTest&&(G=G.concat(T),B=T.sn);var oe;if(pE-V?0:V;oe=Object(d.findFragmentByPTS)(z,G,p,pe)}else oe=G[G.length-1];if(oe){var Ye=oe.sn-U.startSN,xe=z&&oe.level===z.level,Ie=G[Ye+1],Je=this.fragmentTracker.getState(oe);if(Je===M.FragmentState.BACKTRACKED){oe=null;for(var Ke=Ye;G[Ke]&&this.fragmentTracker.getState(G[Ke])===M.FragmentState.BACKTRACKED;)z?oe=G[Ke--]:oe=G[--Ke];oe||(oe=Ie)}else z&&oe.sn===z.sn&&!Z&&(xe&&(oe.sn=G-E.maxFragLookUpTolerance&&z<=B;if(F!==null&&U.duration>F&&(z"+p.startSN+" prev-sn: "+(z?z.sn:"na")+" fragments: "+B),oe}return T},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 U=this.startPosition;if(U"+p))}}]),h}(A.default)},"./src/controller/buffer-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d});var K=N("./src/polyfills/number.ts"),A=N("./src/events.ts"),M=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),P=N("./src/utils/buffer-helper.ts"),k=N("./src/utils/mediasource-helper.ts"),D=N("./src/loader/fragment.ts"),b=N("./src/controller/buffer-operation-queue.ts"),m=Object(k.getMediaSource)(),f=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function s(u){var o=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var a=o.hls,n=o.media,R=o.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),n&&(o.updateMediaElementDuration(),a.trigger(A.Events.MEDIA_ATTACHED,{media:n})),R&&R.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var r=s.prototype;return r.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},r.destroy=function(){this.unregisterListeners(),this.details=null},r.registerListeners=function(){var o=this.hls;o.on(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(A.Events.BUFFER_RESET,this.onBufferReset,this),o.on(A.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(A.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(A.Events.BUFFER_EOS,this.onBufferEos,this),o.on(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(A.Events.FRAG_PARSED,this.onFragParsed,this),o.on(A.Events.FRAG_CHANGED,this.onFragChanged,this)},r.unregisterListeners=function(){var o=this.hls;o.off(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(A.Events.BUFFER_RESET,this.onBufferReset,this),o.off(A.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(A.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(A.Events.BUFFER_EOS,this.onBufferEos,this),o.off(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(A.Events.FRAG_PARSED,this.onFragParsed,this),o.off(A.Events.FRAG_CHANGED,this.onFragChanged,this)},r._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},r.onManifestParsed=function(o,a){var n=2;(a.audio&&!a.video||!a.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.onMediaAttaching=function(o,a){var n=this.media=a.media;if(n&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(R),this._objectUrl=n.src}},r.onMediaDetaching=function(){var o=this.media,a=this.mediaSource,n=this._objectUrl;if(a){if(M.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(R){M.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(n&&self.URL.revokeObjectURL(n),o.src===n?(o.removeAttribute("src"),o.load()):M.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(A.Events.MEDIA_DETACHED,void 0)},r.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(a){var n=o.sourceBuffer[a];try{n&&(o.removeBufferListeners(a),o.mediaSource&&o.mediaSource.removeSourceBuffer(n),o.sourceBuffer[a]=void 0)}catch(R){M.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",R)}}),this._initSourceBuffer()},r.onBufferCodecs=function(o,a){var n=this,R=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(w){if(R){var x=n.tracks[w];if(x&&typeof x.buffer.changeType=="function"){var O=a[w],C=O.codec,_=O.levelCodec,y=O.container,h=(x.levelCodec||x.codec).replace(f,"$1"),c=(_||C).replace(f,"$1");if(h!==c){var v=y+";codecs="+(_||C);n.appendChangeType(w,v)}}}else n.pendingTracks[w]=a[w]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},r.appendChangeType=function(o,a){var n=this,R=this.operationQueue,w={execute:function(){var O=n.sourceBuffer[o];O&&(M.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+a),O.changeType(a)),R.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(O){M.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",O)}};R.append(w,o)},r.onBufferAppending=function(o,a){var n=this,R=this.hls,w=this.operationQueue,x=this.tracks,O=a.data,C=a.type,_=a.frag,y=a.part,h=a.chunkMeta,c=h.buffering[C],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 U=x.audio,F=C==="audio"&&h.id===1&&(U==null?void 0:U.container)==="audio/mpeg",z={execute:function(){if(c.executeStart=self.performance.now(),F){var B=n.sourceBuffer[C];if(B){var T=_.start-B.timestampOffset;Math.abs(T)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+T+") sn: "+_.sn+")"),B.timestampOffset=_.start)}}n.appendExecutor(O,C)},onStart:function(){},onComplete:function(){var B=self.performance.now();c.executeEnd=c.end=B,p.first===0&&(p.first=B),E&&E.first===0&&(E.first=B);var T=n.sourceBuffer,V={};for(var Z in T)V[Z]=P.BufferHelper.getBuffered(T[Z]);n.appendError=0,n.hls.trigger(A.Events.BUFFER_APPENDED,{type:C,frag:_,part:y,chunkMeta:h,parent:_.type,timeRanges:V})},onError:function(B){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+C+" SourceBuffer",B);var T={type:H.ErrorTypes.MEDIA_ERROR,parent:_.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?T.details=H.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,T.details=H.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>R.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),T.fatal=!0)),R.trigger(A.Events.ERROR,T)}};w.append(z,C)},r.onBufferFlushing=function(o,a){var n=this,R=this.operationQueue,w=function(O){return{execute:n.removeExecutor.bind(n,O,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(A.Events.BUFFER_FLUSHED,{type:O})},onError:function(_){M.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",_)}}};a.type?R.append(w(a.type),a.type):this.getSourceBufferTypes().forEach(function(x){R.append(w(x),x)})},r.onFragParsed=function(o,a){var n=this,R=a.frag,w=a.part,x=[],O=w?w.elementaryStreams:R.elementaryStreams;O[D.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(O[D.ElementaryStreamTypes.AUDIO]&&x.push("audio"),O[D.ElementaryStreamTypes.VIDEO]&&x.push("video"));var C=function(){var y=self.performance.now();R.stats.buffering.end=y,w&&(w.stats.buffering.end=y);var h=w?w.stats:R.stats;n.hls.trigger(A.Events.FRAG_BUFFERED,{frag:R,part:w,stats:h,id:R.type})};x.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(C,x)},r.onFragChanged=function(o,a){this.flushBackBuffer()},r.onBufferEos=function(o,a){var n=this,R=this.getSourceBufferTypes().reduce(function(w,x){var O=n.sourceBuffer[x];return(!a.type||a.type===x)&&(O&&!O.ended&&(O.ended=!0,M.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),w&&!!(!O||O.ended)},!0);R&&this.blockBuffers(function(){var w=n.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},r.onLevelUpdated=function(o,a){var n=a.details;if(!n.fragments.length)return;this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},r.flushBackBuffer=function(){var o=this.hls,a=this.details,n=this.media,R=this.sourceBuffer;if(!n||a===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var x=a.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(K.isFiniteNumber)(x)||x<0)return;var O=n.currentTime,C=a.levelTargetDuration,_=Math.max(x,C),y=Math.floor(O/C)*C-_;w.forEach(function(h){var c=R[h];if(c){var v=P.BufferHelper.getBuffered(c);v.length>0&&y>v.start(0)&&(o.trigger(A.Events.BACK_BUFFER_REACHED,{bufferEnd:y}),a.live&&o.trigger(A.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:y}),o.trigger(A.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:y,type:h}))}})},r.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,a=this.hls,n=this.media,R=this.mediaSource,w=o.fragments[0].start+o.totalduration,x=n.duration,O=Object(K.isFiniteNumber)(R.duration)?R.duration:0;o.live&&a.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(o)):(w>O&&w>x||!Object(K.isFiniteNumber)(x))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),R.duration=w)},r.updateSeekableRange=function(o){var a=this.mediaSource,n=o.fragments,R=n.length;if(R&&o.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var w=Math.max(0,n[0].start),x=Math.max(w,w+o.totalduration);a.setLiveSeekableRange(w,x)}},r.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,a=this.operationQueue,n=this.pendingTracks,R=Object.keys(n).length;if(R&&!o||R===2){this.createSourceBuffers(n),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(A.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(x){a.executeNext(x)})}},r.createSourceBuffers=function(o){var a=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var w in o)if(!a[w]){var x=o[w];if(!x)throw Error("source buffer exists for track "+w+", however track does not");var O=x.levelCodec||x.codec,C=x.container+";codecs="+O;M.logger.log("[buffer-controller]: creating sourceBuffer("+C+")");try{var _=a[w]=n.addSourceBuffer(C),y=w;this.addBufferListener(y,"updatestart",this._onSBUpdateStart),this.addBufferListener(y,"updateend",this._onSBUpdateEnd),this.addBufferListener(y,"error",this._onSBUpdateError),this.tracks[w]={buffer:_,codec:O,container:x.container,levelCodec:x.levelCodec,id:x.id},R++}catch(h){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(A.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:C})}}R&&this.hls.trigger(A.Events.BUFFER_CREATED,{tracks:this.tracks})},r._onSBUpdateStart=function(o){var a=this.operationQueue,n=a.current(o);n.onStart()},r._onSBUpdateEnd=function(o){var a=this.operationQueue,n=a.current(o);n.onComplete(),a.shiftAndExecuteNext(o)},r._onSBUpdateError=function(o,a){M.logger.error("[buffer-controller]: "+o+" SourceBuffer error",a),this.hls.trigger(A.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(o);n&&n.onError(a)},r.removeExecutor=function(o,a,n){var R=this.media,w=this.mediaSource,x=this.operationQueue,O=this.sourceBuffer,C=O[o];if(!R||!w||!C){M.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(o);return}var _=Object(K.isFiniteNumber)(R.duration)?R.duration:Infinity,y=Object(K.isFiniteNumber)(w.duration)?w.duration:Infinity,h=Math.max(0,a),c=Math.min(n,_,y);c>h?(M.logger.log("[buffer-controller]: Removing ["+h+","+c+"] from the "+o+" SourceBuffer"),console.assert(!C.updating,o+" sourceBuffer must not be updating"),C.remove(h,c)):x.shiftAndExecuteNext(o)},r.appendExecutor=function(o,a){var n=this.operationQueue,R=this.sourceBuffer,w=R[a];if(!w){M.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(a);return}w.ended=!1,console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.appendBuffer(o)},r.blockBuffers=function(o,a){var n=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var R=this.operationQueue,w=a.map(function(x){return R.appendBlocker(x)});Promise.all(w).then(function(){o(),a.forEach(function(x){var O=n.sourceBuffer[x];(!O||!O.updating)&&R.shiftAndExecuteNext(x)})})},r.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},r.addBufferListener=function(o,a,n){var R=this.sourceBuffer[o];if(!R)return;var w=n.bind(this,o);this.listeners[o].push({event:a,listener:w}),R.addEventListener(a,w)},r.removeBufferListeners=function(o){var a=this.sourceBuffer[o];if(!a)return;this.listeners[o].forEach(function(n){a.removeEventListener(n.event,n.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return A});var K=N("./src/utils/logger.ts"),A=function(){function M(P){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=P}var H=M.prototype;return H.append=function(k,D){var b=this.queues[D];b.push(k),b.length===1&&this.buffers[D]&&this.executeNext(D)},H.insertAbort=function(k,D){var b=this.queues[D];b.unshift(k),this.executeNext(D)},H.appendBlocker=function(k){var D,b=new Promise(function(f){D=f}),m={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,k),b},H.executeNext=function(k){var D=this.buffers,b=this.queues,m=D[k],f=b[k];if(f.length){var d=f[0];try{d.execute()}catch(s){K.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(s),(!m||!m.updating)&&(f.shift(),this.executeNext(k))}}},H.shiftAndExecuteNext=function(k){this.queues[k].shift(),this.executeNext(k)},H.current=function(k){return this.queues[k][0]},M}()},"./src/controller/cap-level-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts");function A(P,k){for(var D=0;D0&&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}}},k.getMaxLevel=function(b){var m=this,f=this.hls.levels;if(!f.length)return-1;var d=f.filter(function(s,r){return P.isLevelAllowed(r,m.restrictedLevels)&&r<=b});return this.clientRect=null,P.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},k.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()},k.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},k.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,m={width:0,height:0};if(b){var f=b.getBoundingClientRect();m.width=f.width,m.height=f.height,!m.width&&!m.height&&(m.width=f.right-f.left||b.width||0,m.height=f.bottom-f.top||b.height||0)}return this.clientRect=m,m},P.isLevelAllowed=function(b,m){return m===void 0&&(m=[]),m.indexOf(b)===-1},P.getMaxLevelByMediaSize=function(b,m,f){if(!b||!b.length)return-1;for(var d=function(a,n){return n?a.width!==n.width||a.height!==n.height:!0},s=b.length-1,r=0;r=m||u.height>=f)&&d(u,b[r+1])){s=r;break}}return s},M(P,[{key:"mediaWidth",get:function(){return this.getDimensions().width*P.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*P.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(m){}return b}}]),P}();Y.default=H},"./src/controller/cmcd-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d});var K=N("./src/events.ts"),A=N("./src/types/cmcd.ts"),M=N("./src/utils/buffer-helper.ts"),H=N("./src/utils/logger.ts");function P(s,r){for(var u=0;u=s.length?{done:!0}:{done:!1,value:s[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b(s,r){if(!s)return;if(typeof s=="string")return m(s,r);var u=Object.prototype.toString.call(s).slice(8,-1);if(u==="Object"&&s.constructor&&(u=s.constructor.name),u==="Map"||u==="Set")return Array.from(s);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return m(s,r)}function m(s,r){(r==null||r>s.length)&&(r=s.length);for(var u=0,o=new Array(r);ua&&(a=x.bitrate)}return a>0?a:NaN},r.getBufferLength=function(o){var a=this.hls.media,n=o===A.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!a)return NaN;var R=M.BufferHelper.bufferInfo(n,a.currentTime,this.config.maxBufferHole);return R.len*1e3},r.createPlaylistLoader=function(){var o=this.config.pLoader,a=this.applyPlaylistData,n=o||this.config.loader;return function(){function R(x){this.loader=void 0,this.loader=new n(x)}var w=R.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(O,C,_){a(O),this.loader.load(O,C,_)},k(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},r.createFragmentLoader=function(){var o=this.config.fLoader,a=this.applyFragmentData,n=o||this.config.loader;return function(){function R(x){this.loader=void 0,this.loader=new n(x)}var w=R.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(O,C,_){a(O),this.loader.load(O,C,_)},k(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},s.uuid=function(){var o=URL.createObjectURL(new Blob),a=o.toString();return URL.revokeObjectURL(o),a.substr(a.lastIndexOf("/")+1)},s.serialize=function(o){for(var a=[],n=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},R=function(F){return Math.round(F)},w=function(F){return R(F/100)*100},x=function(F){return encodeURIComponent(F)},O={br:R,d:R,bl:w,dl:w,mtp:w,nor:x,rtp:w,tb:R},C=Object.keys(o||{}).sort(),_=D(C),y;!(y=_()).done;){var h=y.value,c=o[h];if(!n(c))continue;if(h==="v"&&c===1)continue;if(h=="pr"&&c===1)continue;var v=O[h];v&&(c=v(c));var p=typeof c,E=void 0;h==="ot"||h==="sf"||h==="st"?E=h+"="+c:p==="boolean"?E=h:p==="number"?E=h+"="+c:E=h+"="+JSON.stringify(c),a.push(E)}return a.join(",")},s.toHeaders=function(o){for(var a=Object.keys(o),n={},R=["Object","Request","Session","Status"],w=[{},{},{},{}],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},O=0,C=a;OD){this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=D-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(a,n)}break}},s._generateLicenseRequestChallenge=function(u,o){switch(u.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},s._requestLicense=function(u,o){M.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(a.mediaKeySystemDomain),R=this._createLicenseXhr(n,u,o);M.logger.log("Sending license request to URL: "+n);var w=this._generateLicenseRequestChallenge(a,u);R.send(w)}catch(x){M.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(u,o){if(!this._emeEnabled)return;var a=o.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var u=this._media,o=this._mediaKeysList;if(!u)return;u.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return u.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(u,o){if(!this._emeEnabled)return;var a=o.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),n=o.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,a,n)},k(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();Y.default=f},"./src/controller/fps-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts"),A=N("./src/utils/logger.ts"),M=function(){function H(k){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=k,this.registerListeners()}var P=H.prototype;return P.setStreamController=function(D){this.streamController=D},P.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},P.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching)},P.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},P.onMediaAttaching=function(D,b){var m=this.hls.config;if(m.capLevelOnFPSDrop){var f=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=f,f&&typeof f.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},P.checkFPS=function(D,b,m){var f=performance.now();if(b){if(this.lastTime){var d=f-this.lastTime,s=m-this.lastDroppedFrames,r=b-this.lastDecodedFrames,u=1e3*s/d,o=this.hls;if(o.trigger(K.Events.FPS_DROP,{currentDropped:s,currentDecoded:r,totalDroppedFrames:m}),u>0&&s>o.config.fpsDroppedMonitoringThreshold*r){var a=o.currentLevel;A.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=a)&&(a=a-1,o.trigger(K.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:o.currentLevel}),o.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=f,this.lastDroppedFrames=m,this.lastDecodedFrames=b}},P.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var b=D.getVideoPlaybackQuality();this.checkFPS(D,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},H}();Y.default=M},"./src/controller/fragment-finders.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"findFragmentByPDT",function(){return M}),N.d(Y,"findFragmentByPTS",function(){return H}),N.d(Y,"fragmentWithinToleranceTest",function(){return P}),N.d(Y,"pdtWithinToleranceTest",function(){return k}),N.d(Y,"findFragWithCC",function(){return D});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/binary-search.ts");function M(b,m,f){if(m===null||!Array.isArray(b)||!b.length||!Object(K.isFiniteNumber)(m))return null;var d=b[0].programDateTime;if(m<(d||0))return null;var s=b[b.length-1].endProgramDateTime;if(m>=(s||0))return null;f=f||0;for(var r=0;rb&&f.start?-1:0}function k(b,m,f){var d=Math.min(m,f.duration+(f.deltaPTS?f.deltaPTS:0))*1e3,s=f.endProgramDateTime||0;return s-d>b}function D(b,m){return A.default.search(b,function(f){return f.ccm?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"FragmentState",function(){return M}),N.d(Y,"FragmentTracker",function(){return H});var K=N("./src/events.ts"),A=N("./src/types/loader.ts"),M;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(M||(M={}));var H=function(){function D(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=D.prototype;return b._registerListeners=function(){var f=this.hls;f.on(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.on(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var f=this.hls;f.off(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.off(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(f,d){if(d===A.PlaylistLevelType.MAIN){var s=this.activeFragment,r=this.activeParts;if(!s)return null;if(r)for(var u=r.length;u--;){var o=r[u],a=o?o.end:s.appendedPTS;if(o.start<=f&&a!==void 0&&f<=a)return u>9&&(this.activeParts=r.slice(u-9)),o}else if(s.start<=f&&s.appendedPTS!==void 0&&f<=s.appendedPTS)return s}return this.getBufferedFrag(f,d)},b.getBufferedFrag=function(f,d){for(var s=this.fragments,r=Object.keys(s),u=r.length;u--;){var o=s[r[u]];if((o==null?void 0:o.body.type)===d&&o.buffered){var a=o.body;if(a.start<=f&&f<=a.end)return a}}return null},b.detectEvictedFragments=function(f,d,s){var r=this;Object.keys(this.fragments).forEach(function(u){var o=r.fragments[u];if(!o)return;if(!o.buffered){o.body.type===s&&r.removeFragment(o.body);return}var a=o.range[f];if(!a)return;a.time.some(function(n){var R=!r.isTimeBuffered(n.startPTS,n.endPTS,d);return R&&r.removeFragment(o.body),R})})},b.detectPartialFragments=function(f){var d=this,s=this.timeRanges,r=f.frag,u=f.part;if(!s||r.sn==="initSegment")return;var o=k(r),a=this.fragments[o];if(!a)return;Object.keys(s).forEach(function(n){var R=r.elementaryStreams[n];if(!R)return;var w=s[n],x=u!==null||R.partial===!0;a.range[n]=d.getBufferedTimes(r,u,x,w)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},b.fragBuffered=function(f){var d=k(f),s=this.fragments[d];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},b.getBufferedTimes=function(f,d,s,r){for(var u={time:[],partial:s},o=d?d.start:f.start,a=d?d.end:f.end,n=f.minEndPTS||a,R=f.maxStartPTS||o,w=0;w=x&&n<=O){u.time.push({startPTS:Math.max(o,r.start(w)),endPTS:Math.min(a,r.end(w))});break}else if(ox)u.partial=!0,u.time.push({startPTS:Math.max(o,r.start(w)),endPTS:Math.min(a,r.end(w))});else if(a<=x)break}return u},b.getPartialFragment=function(f){var d=null,s,r,u,o=0,a=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(R){var w=n[R];if(!w)return;P(w)&&(r=w.body.start-a,u=w.body.end+a,f>=r&&f<=u&&(s=Math.min(f-r,u-f),o<=s&&(d=w.body,o=s)))}),d},b.getState=function(f){var d=k(f),s=this.fragments[d];return s?s.buffered?P(s)?M.PARTIAL:M.OK:s.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},b.backtrack=function(f,d){var s=k(f),r=this.fragments[s];if(!r||r.backtrack)return null;var u=r.backtrack=d||r.loaded;return r.loaded=null,u},b.getBacktrackData=function(f){var d=k(f),s=this.fragments[d];if(s){var r,u=s.backtrack;if(u!=null&&(r=u.payload)!==null&&r!==void 0&&r.byteLength)return u;this.removeFragment(f)}return null},b.isTimeBuffered=function(f,d,s){for(var r,u,o=0;o=r&&d<=u)return!0;if(d<=r)return!1}return!1},b.onFragLoaded=function(f,d){var s=d.frag,r=d.part;if(s.sn==="initSegment"||s.bitrateTest||r)return;var u=k(s);this.fragments[u]={body:s,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(f,d){var s=this,r=d.frag,u=d.part,o=d.timeRanges;if(r.type===A.PlaylistLevelType.MAIN)if(this.activeFragment=r,u){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(u)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(n){var R=o[n];if(s.detectEvictedFragments(n,R),!u)for(var w=0;wf&&r.removeFragment(a)}})},b.removeFragment=function(f){var d=k(f);f.stats.loaded=0,f.clearElementaryStreamInfo(),delete this.fragments[d]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function P(D){var b,m;return D.buffered&&(((b=D.range.video)===null||b===void 0?void 0:b.partial)||((m=D.range.audio)===null||m===void 0?void 0:m.partial))}function k(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return P}),N.d(Y,"MAX_START_GAP_JUMP",function(){return k}),N.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),N.d(Y,"SKIP_BUFFER_RANGE_START",function(){return b}),N.d(Y,"default",function(){return m});var K=N("./src/utils/buffer-helper.ts"),A=N("./src/errors.ts"),M=N("./src/events.ts"),H=N("./src/utils/logger.ts"),P=250,k=2,D=.1,b=.05,m=function(){function f(s,r,u,o){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=r,this.fragmentTracker=u,this.hls=o}var d=f.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(r){var u=this.config,o=this.media,a=this.stalled,n=o.currentTime,R=o.seeking,w=this.seeking&&!R,x=!this.seeking&&R;if(this.seeking=R,n!==r){if(this.moved=!0,a!==null){if(this.stallReported){var O=self.performance.now()-a;H.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||w)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!K.BufferHelper.getBuffered(o).length)return;var C=K.BufferHelper.bufferInfo(o,n,0),_=C.len>0,y=C.nextStart||0;if(!_&&!y)return;if(R){var h=C.len>k,c=!y||y-n>k&&!this.fragmentTracker.getPartialFragment(n);if(h||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,p=Math.max(y,C.start||0)-n,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=E==null||((v=E.details)===null||v===void 0)?void 0:v.live,F=U?E.details.targetduration*2:k;if(p>0&&p<=F){this._trySkipBufferHole(null);return}}var z=self.performance.now();if(a===null){this.stalled=z;return}var G=z-a;!R&&G>=P&&this._reportStall(C.len);var B=K.BufferHelper.bufferInfo(o,n,u.maxBufferHole);this._tryFixBufferStall(B,G)},d._tryFixBufferStall=function(r,u){var o=this.config,a=this.fragmentTracker,n=this.media,R=n.currentTime,w=a.getPartialFragment(R);if(w){var x=this._trySkipBufferHole(w);if(x)return}r.len>o.maxBufferHole&&u>o.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(r){var u=this.hls,o=this.media,a=this.stallReported;a||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+r+")"),u.trigger(M.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:r}))},d._trySkipBufferHole=function(r){for(var u=this.config,o=this.hls,a=this.media,n=a.currentTime,R=0,w=K.BufferHelper.getBuffered(a),x=0;x=R&&n.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,o)),O=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;f.playbackRate=Math.min(x,Math.max(1,O))}else f.playbackRate!==1&&f.playbackRate!==0&&(f.playbackRate=1)},b.estimateLiveEdge=function(){var f=this.levelDetails;return f===null?null:f.edge+f.age},b.computeLatency=function(){var f=this.estimateLiveEdge();return f===null?null:f-this.currentTime},P(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var f=this.config,d=this.levelDetails;return f.liveMaxLatencyDuration!==void 0?f.liveMaxLatencyDuration:d?f.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var f=this.levelDetails;if(f===null)return null;var d=f.holdBack,s=f.partHoldBack,r=f.targetduration,u=this.config,o=u.liveSyncDuration,a=u.liveSyncDurationCount,n=u.lowLatencyMode,R=this.hls.userConfig,w=n&&s||d;(R.liveSyncDuration||R.liveSyncDurationCount||w===0)&&(w=o!==void 0?o:a*r);var x=r,O=1;return w+Math.min(this.stallCount*O,x)}},{key:"liveSyncPosition",get:function(){var f=this.estimateLiveEdge(),d=this.targetLatency,s=this.levelDetails;if(f===null||d===null||s===null)return null;var r=s.edge,u=f-d-this.edgeStalled,o=r-s.totalduration,a=r-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(o,u),a)}},{key:"drift",get:function(){var f=this.levelDetails;return f===null?1:f.drift}},{key:"edgeStalled",get:function(){var f=this.levelDetails;if(f===null)return 0;var d=(this.config.lowLatencyMode&&f.partTarget||f.targetduration)*3;return Math.max(f.age-d,0)}},{key:"forwardBufferLength",get:function(){var f=this.media,d=this.levelDetails;if(!f||!d)return 0;var s=f.buffered.length;return s?f.buffered.end(s-1):d.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return u});var K=N("./src/types/level.ts"),A=N("./src/events.ts"),M=N("./src/errors.ts"),H=N("./src/utils/codecs.ts"),P=N("./src/controller/level-helper.ts"),k=N("./src/controller/base-playlist-controller.ts"),D=N("./src/types/loader.ts");function b(){return b=Object.assign||function(o){for(var a=1;a0){y=O[0].bitrate,O.sort(function(G,B){return G.bitrate-B.bitrate}),this._levels=O;for(var U=0;Uthis.hls.config.fragLoadingMaxRetry&&(h=x.frag.level)):h=x.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(y=!1),h=O.level),_=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:h=x.level,_=!0;break}h!==void 0&&this.recoverLevel(x,h,_,y)},n.recoverLevel=function(w,x,O,C){var _=w.details,y=this._levels[x];if(y.loadError++,O){var h=this.retryLoadingOrFail(w);if(h)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(C){var c=y.url.length;if(c>1&&y.loadError1){var C=(x.urlId+1)%O;this.warn("Switching to redundant URL-id "+C),this._levels.forEach(function(_){_.urlId=C}),this.level=w}},n.onFragLoaded=function(w,x){var O=x.frag;if(O!==void 0&&O.type===D.PlaylistLevelType.MAIN){var C=this._levels[O.level];C!==void 0&&(C.fragmentError=0,C.loadError=0)}},n.onLevelLoaded=function(w,x){var O,C=x.level,_=x.details,y=this._levels[C];if(!y){var h;this.warn("Invalid level index "+C),(h=x.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(_.deltaUpdateFailed=!0);return}C===this.currentLevelIndex?(y.fragmentError===0&&(y.loadError=0,this.retryCount=0),this.playlistLoaded(C,x,y.details)):(O=x.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(_.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(w,x){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var C=-1,_=this.hls.audioTracks[x.id].groupId,y=0;y0){var C=O.urlId,_=O.url[C];if(w)try{_=w.addDirectives(_)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("Attempt loading level index "+x+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+C+" "+_),this.clearTimer(),this.hls.trigger(A.Events.LEVEL_LOADING,{url:_,level:x,id:C,deliveryDirectives:w||null})}},n.removeLevel=function(w,x){var O=function(y,h){return h!==x},C=this._levels.filter(function(_,y){return y!==w?!0:_.url.length>1&&x!==void 0?(_.url=_.url.filter(O),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(O)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(O)),_.urlId=0,!0):!1}).map(function(_,y){var h=_.details;return h!=null&&h.fragments&&h.fragments.forEach(function(c){c.level=y}),_});this._levels=C,this.hls.trigger(A.Events.LEVELS_UPDATED,{levels:C})},f(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var x,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===w&&(x=O[w])!==null&&x!==void 0&&x.details)return;if(w<0||w>=O.length){var C=w<0;if(this.hls.trigger(A.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:C,reason:"invalid level idx"}),C)return;w=Math.min(w,O.length-1)}this.clearTimer();var _=this.currentLevelIndex,y=O[_],h=O[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var c=b({},h,{level:w,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete c._urlId,this.hls.trigger(A.Events.LEVEL_SWITCHING,c);var v=h.details;if(!v||v.live){var p=this.switchParams(h.uri,y==null?void 0:y.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),a}(k.default)},"./src/controller/level-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"addGroupId",function(){return M}),N.d(Y,"assignTrackIdsByGroup",function(){return H}),N.d(Y,"updatePTS",function(){return P}),N.d(Y,"updateFragPTSDTS",function(){return D}),N.d(Y,"mergeDetails",function(){return b}),N.d(Y,"mapPartIntersection",function(){return m}),N.d(Y,"mapFragmentIntersection",function(){return f}),N.d(Y,"adjustSliding",function(){return d}),N.d(Y,"addSliding",function(){return s}),N.d(Y,"computeReloadInterval",function(){return r}),N.d(Y,"getFragmentWithSN",function(){return u}),N.d(Y,"getPartWith",function(){return o});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/logger.ts");function M(a,n,R){switch(n){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(R);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(R);break}}function H(a){var n={};a.forEach(function(R){var w=R.groupId||"";R.id=n[w]=n[w]||0,n[w]++})}function P(a,n,R){var w=a[n],x=a[R];k(w,x)}function k(a,n){var R=n.startPTS;if(Object(K.isFiniteNumber)(R)){var w=0,x;n.sn>a.sn?(w=R-a.start,x=a):(w=a.start-R,x=n),x.duration!==w&&(x.duration=w)}else if(n.sn>a.sn){var O=a.cc===n.cc;O&&a.minEndPTS?n.start=a.start+(a.minEndPTS-a.start):n.start=a.start+a.duration}else n.start=Math.max(a.start-n.duration,0)}function D(a,n,R,w,x,O){var C=w-R;C<=0&&(A.logger.warn("Fragment should have a positive duration",n),w=R+n.duration,O=x+n.duration);var _=R,y=w,h=n.startPTS,c=n.endPTS;if(Object(K.isFiniteNumber)(h)){var v=Math.abs(h-R);Object(K.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(v,n.deltaPTS):n.deltaPTS=v,_=Math.max(R,h),R=Math.min(R,h),x=Math.min(x,n.startDTS),y=Math.min(w,c),w=Math.max(w,c),O=Math.max(O,n.endDTS)}n.duration=w-R;var p=R-n.start;n.appendedPTS=w,n.start=n.startPTS=R,n.maxStartPTS=_,n.startDTS=x,n.endPTS=w,n.minEndPTS=y,n.endDTS=O;var E=n.sn;if(!a||Ea.endSN)return 0;var U,F=E-a.startSN,z=a.fragments;for(z[F]=n,U=F;U>0;U--)k(z[U],z[U-1]);for(U=F;U=0;x--){var O=w[x].initSegment;if(O){R=O;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var C=0,_;if(f(a,n,function(U,F){U.relurl&&(C=U.cc-F.cc),Object(K.isFiniteNumber)(U.startPTS)&&Object(K.isFiniteNumber)(U.endPTS)&&(F.start=F.startPTS=U.startPTS,F.startDTS=U.startDTS,F.appendedPTS=U.appendedPTS,F.maxStartPTS=U.maxStartPTS,F.endPTS=U.endPTS,F.endDTS=U.endDTS,F.minEndPTS=U.minEndPTS,F.duration=U.endPTS-U.startPTS,F.duration&&(_=F),n.PTSKnown=n.alignedSliding=!0),F.elementaryStreams=U.elementaryStreams,F.loader=U.loader,F.stats=U.stats,F.urlId=U.urlId,U.initSegment&&(F.initSegment=U.initSegment,R=U.initSegment)}),R){var y=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;y.forEach(function(U){var F;(!U.initSegment||U.initSegment.relurl===((F=R)===null||F===void 0?void 0:F.relurl))&&(U.initSegment=R)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(U){return!U}),n.deltaUpdateFailed)){A.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=n.skippedSegments;h--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var c=n.fragments;if(C){A.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v=w.length)return;s(n,w[R].start)}function s(a,n){if(n){for(var R=a.fragments,w=a.skippedSegments;w0&&x0&&y===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),y=h),this.state=A.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=y,this.tick()}else this._forceStartLoad=!0,this.state=A.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case A.State.IDLE:this.doTickIdle();break;case A.State.WAITING_LEVEL:{var y,h=this.levels,c=this.level,v=h==null||((y=h[c])===null||y===void 0)?void 0:y.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=A.State.IDLE;break}break}case A.State.FRAG_LOADING_WAITING_RETRY:{var p,E=self.performance.now(),U=this.retryDate;(!U||E>=U||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=A.State.IDLE)}break;default:break}this.onTickEnd()},C.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var y,h,c=this.hls,v=this.levelLastLoaded,p=this.levels,E=this.media,U=c.config,F=c.nextLoadLevel;if(v===null||!E&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[F])return;var z=p[F];this.level=c.nextLoadLevel=F;var G=z.details;if(!G||this.state===A.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==F){this.state=A.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,D.PlaylistLevelType.MAIN);if(B===null)return;var T=B.len,V=this.getMaxBufferLength(z.maxBitrate);if(T>=V)return;if(this._streamEnded(B,G)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,Z),this.state=A.State.ENDED;return}var oe=B.end,pe=this.getNextFragment(oe,G);if(this.couldBacktrack&&!this.fragPrevious&&pe&&pe.sn!=="initSegment"){var Ye=pe.sn-G.startSN;Ye>1&&(pe=G.fragments[Ye-1],this.fragmentTracker.removeFragment(pe))}if(pe&&this.fragmentTracker.getState(pe)===k.FragmentState.OK&&this.nextLoadPosition>oe){var xe=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,xe,D.PlaylistLevelType.MAIN),pe=this.getNextFragment(this.nextLoadPosition,G)}if(!pe)return;pe.initSegment&&!pe.initSegment.data&&!this.bitrateTest&&(pe=pe.initSegment),((y=pe.decryptdata)===null||y===void 0?void 0:y.keyFormat)==="identity"&&!((h=pe.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(pe,G):this.loadFragment(pe,G,oe)},C.loadFragment=function(y,h,c){var v,p=this.fragmentTracker.getState(y);if(this.fragCurrent=y,p===k.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(y);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else p=k.FragmentState.NOT_LOADED}p===k.FragmentState.NOT_LOADED||p===k.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,h,c)):p===k.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()},C.getAppendedFrag=function(y){var h=this.fragmentTracker.getAppendedFrag(y,D.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},C.getBufferedFrag=function(y){return this.fragmentTracker.getBufferedFrag(y,D.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(y){return y?this.getBufferedFrag(y.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var y=this.levels,h=this.media;if(h!=null&&h.readyState){var c,v=this.getAppendedFrag(h.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!h.paused&&y){var p=this.hls.nextLoadLevel,E=y[p],U=this.fragLastKbps;U&&this.fragCurrent?c=this.fragCurrent.duration*E.maxBitrate/(1e3*U)+1:c=0}else c=0;var F=this.getBufferedFrag(h.currentTime+c);if(F){var z=this.followingBufferedFrag(F);if(z){this.abortCurrentFrag();var G=z.maxStartPTS?z.maxStartPTS:z.start,B=z.duration,T=Math.max(F.end,G+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(T,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var y=this.fragCurrent;this.fragCurrent=null,y!=null&&y.loader&&y.loader.abort(),this.state===A.State.KEY_LOADING&&(this.state=A.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(y,h){x.prototype.flushMainBuffer.call(this,y,h,this.altAudio?"video":null)},C.onMediaAttached=function(y,h){x.prototype.onMediaAttached.call(this,y,h);var c=h.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)},C.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)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var y=this.media,h=y?y.currentTime:null;Object(K.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},C.onManifestParsed=function(y,h){var c=!1,v=!1,p;h.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(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},C.onLevelLoading=function(y,h){var c=this.levels;if(!c||this.state!==A.State.IDLE)return;var v=c[h.level];(!v.details||v.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(v.details))&&(this.state=A.State.WAITING_LEVEL)},C.onLevelLoaded=function(y,h){var c,v=this.levels,p=h.level,E=h.details,U=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:"+U);var F=this.fragCurrent;F&&(this.state===A.State.FRAG_LOADING||this.state===A.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==h.level&&F.loader&&(this.state=A.State.IDLE,F.loader.abort()));var z=v[p],G=0;if(E.live||(c=z.details)!==null&&c!==void 0&&c.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;G=this.alignPlaylists(E,z.details)}if(z.details=E,this.levelLastLoaded=p,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:E,level:p}),this.state===A.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=A.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,G),this.tick()},C._handleFragmentLoadProgress=function(y){var h,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 U=E[c.level],F=U.details;if(!F){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var z=U.videoCodec,G=F.PTSKnown||!F.live,B=(h=c.initSegment)===null||h===void 0?void 0:h.data,T=this._getAudioCodec(U),V=this.transmuxer=this.transmuxer||new m.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=v?v.index:-1,oe=Z!==-1,pe=new f.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,p.byteLength,Z,oe),Ye=this.initPTS[c.cc];V.push(p,B,T,z,c,v,F.totalduration,G,pe,Ye)},C.onAudioTrackSwitching=function(y,h){var c=this.altAudio,v=!!h.url,p=h.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 U=this.hls;c&&U.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:p})}},C.onAudioTrackSwitched=function(y,h){var c=h.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()},C.onBufferCreated=function(y,h){var c=h.tracks,v,p,E=!1;for(var U in c){var F=c[U];if(F.id==="main"){if(p=U,v=F,U==="video"){var z=c[U];z&&(this.videoBuffer=z.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},C.onFragBuffered=function(y,h){var c=h.frag,v=h.part;if(c&&c.type!==D.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===A.State.PARSED&&(this.state=A.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)},C.onError=function(y,h){switch(h.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,h);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==A.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=A.State.ERROR):!h.levelRetry&&this.state===A.State.WAITING_LEVEL&&(this.state=A.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===A.State.PARSING||this.state===A.State.PARSED)){var c=!0,v=this.getFwdBufferInfo(this.media,D.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}},C.checkBuffer=function(){var y=this.media,h=this.gapController;if(!y||!h||!y.readyState)return;var c=P.BufferHelper.getBuffered(y);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=y.currentTime},C.onFragLoadEmergencyAborted=function(){this.state=A.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(y,h){var c=h.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,D.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(y,h){this.levels=h.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var y=this.media,h=y.currentTime,c=this.startPosition;if(c>=0&&h0&&(E1&&y.seeking===!1){var c=y.currentTime;if(P.BufferHelper.isBuffered(y,c)?h=this.getAppendedFrag(c):P.BufferHelper.isBuffered(y,c+.1)&&(h=this.getAppendedFrag(c+.1)),h){var v=this.fragPlaying,p=h.level;(!v||h.sn!==v.sn||v.level!==p||h.urlId!==v.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:h}),(!v||v.level!==p)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=h)}}},o(O,[{key:"nextLevel",get:function(){var y=this.nextBufferedFrag;return y?y.level:-1}},{key:"currentLevel",get:function(){var y=this.media;if(y){var h=this.getAppendedFrag(y.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var y=this.media;if(y){var h=this.getAppendedFrag(y.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(A.default)},"./src/controller/subtitle-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"SubtitleStreamController",function(){return a});var K=N("./src/events.ts"),A=N("./src/utils/logger.ts"),M=N("./src/utils/buffer-helper.ts"),H=N("./src/controller/fragment-finders.ts"),P=N("./src/utils/discontinuities.ts"),k=N("./src/controller/level-helper.ts"),D=N("./src/controller/fragment-tracker.ts"),b=N("./src/controller/base-stream-controller.ts"),m=N("./src/types/loader.ts"),f=N("./src/types/level.ts");function d(n,R){for(var w=0;w=h[p].start&&v<=h[p].end){c=h[p];break}var E=_.start+_.duration;c?c.end=E:(c={start:v,end:E},h.push(c)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(O,C){var _=C.startOffset,y=C.endOffset;if(_===0&&y!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,c=this.levels;if(!c.length||!c[h]||!c[h].details)return;var v=c[h].details,p=v.targetduration,E=y-p;if(E<=0)return;C.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(U){for(var F=0;F=v.length||h!==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 U=E.fragments[0];if(!p.details)y.hasProgramDateTime&&E.hasProgramDateTime?Object(P.alignMediaPlaylistByPDT)(y,E):U&&Object(k.addSliding)(y,U.start);else{var F=this.alignPlaylists(y,p.details);F===0&&U&&Object(k.addSliding)(y,U.start)}}if(p.details=y,this.levelLastLoaded=h,this.tick(),y.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var z=Object(H.findFragmentByPTS)(null,y.fragments,this.media.currentTime,0);z||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},w._handleFragmentLoadComplete=function(O){var C=O.frag,_=O.payload,y=C.decryptdata,h=this.hls;if(this.fragContextChanged(C))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();h.trigger(K.Events.FRAG_DECRYPTED,{frag:C,payload:v,stats:{tstart:c,tdecrypt:p}})})}},w.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var O,C=this.currentTrackId,_=this.levels;if(!_.length||!_[C]||!_[C].details)return;var y=_[C].details,h=y.targetduration,c=this.config,v=this.media,p=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-h,c.maxBufferHole),E=p.end,U=p.len,F=this.getMaxBufferLength()+h;if(U>F)return;console.assert(y,"Subtitle track details are defined on idle subtitle stream controller tick");var z=y.fragments,G=z.length,B=y.edge,T,V=this.fragPrevious;if(E-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)},r.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},r.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var o=f(this.media.textTracks);o.forEach(function(a){Object(A.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},r.onManifestParsed=function(o,a){this.tracks=a.subtitleTracks},r.onSubtitleTrackLoaded=function(o,a){var n=a.id,R=a.details,w=this.trackId,x=this.tracksInGroup[w];if(!x){this.warn("Invalid subtitle track id "+n);return}var O=x.details;x.details=a.details,this.log("subtitle track "+n+" loaded ["+R.startSN+"-"+R.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,a,O))},r.onLevelLoading=function(o,a){this.switchLevel(a.level)},r.onLevelSwitching=function(o,a){this.switchLevel(a.level)},r.switchLevel=function(o){var a=this.hls.levels[o];if(!(a!=null&&a.textGroupIds))return;var n=a.textGroupIds[a.urlId];if(this.groupId!==n){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(C){return!n||C.groupId===n});this.tracksInGroup=w;var x=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=n;var O={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(K.Events.SUBTITLE_TRACKS_UPDATED,O),x!==-1&&this.setSubtitleTrack(x,R)}},r.findTrackId=function(o){for(var a=this.tracksInGroup,n=0;n=R.length)return;this.clearTimer();var w=R[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,w){var x=w.id,O=w.groupId,C=O===void 0?"":O,_=w.name,y=w.type,h=w.url;this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:C,name:_,type:y,url:h});var c=this.switchParams(w.url,a==null?void 0:a.details);this.loadPlaylist(c)}else this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:o})},r.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,a=f(this.media.textTracks),n=0;n=0&&(y[0]=Math.min(y[0],R),y[1]=Math.max(y[1],w),C=!0,h/(w-R)>.5))return}if(C||O.push([R,w]),this.config.renderTextTracksNatively){var c=this.captionsTracks[n];this.Cues.newCue(c,R,w,x)}else{var v=this.Cues.newCue(null,R,w,x);this.hls.trigger(A.Events.CUES_PARSED,{type:"captions",cues:v,track:n})}},o.onInitPtsFound=function(n,R){var w=this,x=R.frag,O=R.id,C=R.initPTS,_=R.timescale,y=this.unparsedVttFrags;O==="main"&&(this.initPTS[x.cc]=C,this.timescale[x.cc]=_),y.length&&(this.unparsedVttFrags=[],y.forEach(function(h){w.onFragLoaded(A.Events.FRAG_LOADED,h)}))},o.getExistingTrack=function(n){var R=this.media;if(R)for(var w=0;w>>8^_&255^99,D[x]=_,b[_]=x;var y=w[x],h=w[y],c=w[h],v=w[_]*257^_*16843008;f[x]=v<<24|v>>>8,d[x]=v<<16|v>>>16,s[x]=v<<8|v>>>24,r[x]=v,v=c*16843009^h*65537^y*257^x*16843008,o[_]=v<<24|v>>>8,a[_]=v<<16|v>>>16,n[_]=v<<8|v>>>24,R[_]=v,x?(x=y^w[w[w[c^y]]],O^=w[w[O]]):x=O=1}},P.expandKey=function(D){for(var b=this.uint8ArrayToUint32Array_(D),m=!0,f=0;f>>6)+1;var v=(n[R+2]&60)>>>2;if(v>c.length-1){a.trigger(M.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return C=(n[R+2]&1)<<2,C|=(n[R+3]&192)>>>6,K.logger.log("manifest codec:"+w+", ADTS type:"+x+", samplingIndex:"+v),/firefox/i.test(y)?v>=6?(x=5,_=new Array(4),O=v-3):(x=2,_=new Array(2),O=v):y.indexOf("android")!==-1?(x=2,_=new Array(2),O=v):(x=5,_=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&v>=6?O=v-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(v>=6&&C===1||/vivaldi/i.test(y))||!w&&C===1)&&(x=2,_=new Array(2)),O=v)),_[0]=x<<3,_[0]|=(v&14)>>1,_[1]|=(v&1)<<7,_[1]|=C<<3,x===5&&(_[1]|=(O&14)>>1,_[2]=(O&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:c[v],channelCount:C,codec:"mp4a.40."+x,manifestCodec:h}}function P(a,n){return a[n]===255&&(a[n+1]&246)===240}function k(a,n){return a[n+1]&1?7:9}function D(a,n){return(a[n+3]&3)<<11|a[n+4]<<3|(a[n+5]&224)>>>5}function b(a,n){return n+5=a.length)return!1;var w=D(a,n);if(w<=R)return!1;var x=n+w;return x===a.length||m(a,x)}return!1}function s(a,n,R,w,x){if(!a.samplerate){var O=H(n,R,w,x);if(!O)return;a.config=O.config,a.samplerate=O.samplerate,a.channelCount=O.channelCount,a.codec=O.codec,a.manifestCodec=O.manifestCodec,K.logger.log("parsed codec:"+a.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function r(a){return 1024*9e4/a}function u(a,n,R,w,x){var O=k(a,n),C=D(a,n);if(C-=O,C>0){var _=R+w*x;return{headerLength:O,frameLength:C,stamp:_}}}function o(a,n,R,w,x){var O=r(a.samplerate),C=u(n,R,w,x,O);if(C){var _=C.frameLength,y=C.headerLength,h=C.stamp,c=y+_,v=Math.max(0,R+c-n.length),p;v?(p=new Uint8Array(c-y),p.set(n.subarray(R+y,n.length),0)):p=n.subarray(R+y,R+c);var E={unit:p,pts:h};return v||a.samples.push(E),{sample:E,length:c,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"initPTSFn",function(){return D});var K=N("./src/polyfills/number.ts"),A=N("./src/demux/id3.ts"),M=N("./src/demux/dummy-demuxed-track.ts"),H=N("./src/utils/mp4-tools.ts"),P=N("./src/utils/typed-array.ts"),k=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,s,r){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,s){return!1},m.appendFrame=function(d,s,r){},m.demux=function(d,s){this.cachedData&&(d=Object(H.appendUint8Array)(this.cachedData,d),this.cachedData=null);var r=A.getID3Data(d,0),u=r?r.length:0,o,a,n=this._audioTrack,R=this._id3Track,w=r?A.getTimeStamp(r):void 0,x=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(w,s)),r&&r.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:r}),a=this.initPTS;uk?(this.word<<=k,this.bitsAvailable-=k):(k-=this.bitsAvailable,D=k>>3,k-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=k,this.bitsAvailable-=k)},H.readBits=function(k){var D=Math.min(this.bitsAvailable,k),b=this.word>>>32-D;return k>32&&K.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=k-D,D>0&&this.bitsAvailable?b<>>k)!==0)return this.word<<=k,this.bitsAvailable-=k,k;return this.loadWord(),k+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var k=this.skipLZ();return this.readBits(k+1)-1},H.readEG=function(){var k=this.readUEG();return 1&k?1+k>>>1:-1*(k>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(k){for(var D=8,b=8,m,f=0;f0?x.subarray(C,C+_):void 0},H=function(x,O){var C=0;return C=(x[O]&127)<<21,C|=(x[O+1]&127)<<14,C|=(x[O+2]&127)<<7,C|=x[O+3]&127,C},P=function(x,O){return K(x,O)&&H(x,O+6)+10<=x.length-O},k=function(x){for(var O=m(x),C=0;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[U++],E+=String.fromCharCode((c&31)<<6|v&63);break;case 14:v=x[U++],p=x[U++],E+=String.fromCharCode((c&15)<<12|(v&63)<<6|(p&63)<<0);break;default:}}return E},a={decodeTextFrame:s},n;function R(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/demux/base-audio-demuxer.ts"),A=N("./src/demux/id3.ts"),M=N("./src/utils/logger.ts"),H=N("./src/demux/mpegaudio.ts");function P(b,m){b.prototype=Object.create(m.prototype),b.prototype.constructor=b,k(b,m)}function k(b,m){return k=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},k(b,m)}var D=function(b){P(m,b);function m(){return b.apply(this,arguments)||this}var f=m.prototype;return f.resetInitSegment=function(s,r,u){b.prototype.resetInitSegment.call(this,s,r,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:u,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var r=A.getID3Data(s,0)||[],u=r.length,o=s.length;u0},P.demux=function(D){var b=D,m=Object(A.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(K.appendUint8Array)(this.remainderData,D));var f=Object(K.segmentValidRange)(b);this.remainderData=f.remainder,m.samples=f.valid||new Uint8Array}else m.samples=b;return{audioTrack:Object(A.dummyTrack)(),avcTrack:m,id3Track:Object(A.dummyTrack)(),textTrack:Object(A.dummyTrack)()}},P.flush=function(){var D=Object(A.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(A.dummyTrack)(),avcTrack:D,id3Track:Object(A.dummyTrack)(),textTrack:Object(A.dummyTrack)()}},P.demuxSampleAes=function(D,b,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},P.destroy=function(){},H}();M.minProbeByteLength=1024,Y.default=M},"./src/demux/mpegaudio.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"appendFrame",function(){return k}),N.d(Y,"parseHeader",function(){return D}),N.d(Y,"isHeaderPattern",function(){return b}),N.d(Y,"isHeader",function(){return m}),N.d(Y,"canParse",function(){return f}),N.d(Y,"probe",function(){return d});var K=null,A=[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],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],P=[0,1,1,4];function k(s,r,u,o,a){if(u+24>r.length)return;var n=D(r,u);if(n&&u+n.frameLength<=r.length){var R=n.samplesPerFrame*9e4/n.sampleRate,w=o+a*R,x={unit:r.subarray(u,u+n.frameLength),pts:w,dts:w};return s.config=[],s.channelCount=n.channelCount,s.samplerate=n.sampleRate,s.samples.push(x),{sample:x,length:n.frameLength,missing:0}}}function D(s,r){var u=s[r+1]>>3&3,o=s[r+1]>>1&3,a=s[r+2]>>4&15,n=s[r+2]>>2&3;if(u!==1&&a!==0&&a!==15&&n!==3){var R=s[r+2]>>1&1,w=s[r+3]>>6,x=u===3?3-o:o===3?3:4,O=A[x*14+a-1]*1e3,C=u===3?0:u===2?1:2,_=M[C*3+n],y=w===3?1:2,h=H[u][o],c=P[o],v=h*8*c,p=Math.floor(h*O/_+R)*c;if(K===null){var E=navigator.userAgent||"",U=E.match(/Chrome\/(\d+)/i);K=U?parseInt(U[1]):0}var F=!!K&&K<=87;return F&&o===2&&O>=224e3&&w===0&&(s[r+3]=s[r+3]|128),{sampleRate:_,channelCount:y,frameLength:p,samplesPerFrame:v}}}function b(s,r){return s[r]===255&&(s[r+1]&224)===224&&(s[r+1]&6)!==0}function m(s,r){return r+1=D.length){m();return}if(D[b].unit.length<32)continue;var f=this.decrypter.isSync();if(this.decryptAacSample(D,b,m,f),!f)return}},P.getAvcEncryptedData=function(D){for(var b=Math.floor((D.length-48)/160)*16+16,m=new Int8Array(b),f=0,d=32;d<=D.length-16;d+=160,f+=16)m.set(D.subarray(d,d+16),f);return m},P.getAvcDecryptedUnit=function(D,b){for(var m=new Uint8Array(b),f=0,d=32;d<=D.length-16;d+=160,f+=16)D.set(m.subarray(f,f+16),d);return D},P.decryptAvcSample=function(D,b,m,f,d,s){var r=Object(A.discardEPB)(d.data),u=this.getAvcEncryptedData(r),o=this;this.decryptBuffer(u.buffer,function(a){d.data=o.getAvcDecryptedUnit(r,a),s||o.decryptAvcSamples(D,b,m+1,f)})},P.decryptAvcSamples=function(D,b,m,f){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,m=0){if(b>=D.length){f();return}for(var d=D[b].units;!(m>=d.length);m++){var s=d[m];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var r=this.decrypter.isSync();if(this.decryptAvcSample(D,b,m,f,s,r),!r)return}}},H}();Y.default=M},"./src/demux/transmuxer-interface.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d});var K=N("./node_modules/webworkify-webpack/index.js"),A=N.n(K),M=N("./src/events.ts"),H=N("./src/demux/transmuxer.ts"),P=N("./src/utils/logger.ts"),k=N("./src/errors.ts"),D=N("./src/utils/mediasource-helper.ts"),b=N("./node_modules/eventemitter3/index.js"),m=N.n(b),f=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function s(u,o,a,n){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=u,this.id=o,this.onTransmuxComplete=a,this.onFlush=n;var w=u.config,x=function(h,c){c=c||{},c.frag=R.frag,c.id=R.id,u.trigger(h,c)};this.observer=new b.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,x),this.observer.on(M.Events.ERROR,x);var O={mp4:f.isTypeSupported("video/mp4"),mpeg:f.isTypeSupported("audio/mpeg"),mp3:f.isTypeSupported('audio/mp4; codecs="mp3"')},C=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){P.logger.log("demuxing in webworker");var _;try{_=this.worker=K("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(y){u.trigger(M.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(y.message+" ("+y.filename+":"+y.lineno+")")})},_.postMessage({cmd:"init",typeSupported:O,vendor:C,id:o,config:JSON.stringify(w)})}catch(y){P.logger.warn("Error in worker:",y),P.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new H.default(this.observer,O,w,C,o),this.worker=null}}else this.transmuxer=new H.default(this.observer,O,w,C,o)}var r=s.prototype;return r.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},r.push=function(o,a,n,R,w,x,O,C,_,y){var h=this;_.transmuxing.start=self.performance.now();var c=this.transmuxer,v=this.worker,p=x?x.start:w.start,E=w.decryptdata,U=this.frag,F=!(U&&w.cc===U.cc),z=!(U&&_.level===U.level),G=U?_.sn-U.sn:-1,B=this.part?_.part-this.part.index:1,T=!z&&(G===1||G===0&&B===1),V=self.performance.now();(z||G||w.stats.parsing.start===0)&&(w.stats.parsing.start=V),x&&(B||!T)&&(x.stats.parsing.start=V);var Z=new H.TransmuxState(F,T,C,z,p);if(!T||F){P.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+` discontinuity: `+F+` trackSwitch: `+z+` contiguous: `+T+` accurateTimeOffset: `+C+` timeOffset: `+p);var oe=new H.TransmuxConfig(n,R,a,O,y);this.configureTransmuxer(oe)}if(this.frag=w,this.part=x,v)v.postMessage({cmd:"demux",data:o,decryptdata:E,chunkMeta:_,state:Z},o instanceof ArrayBuffer?[o]:[]);else if(c){var pe=c.push(o,E,_,Z);Object(H.isPromise)(pe)?pe.then(function(Ye){h.handleTransmuxComplete(Ye)}):this.handleTransmuxComplete(pe)}},r.flush=function(o){var a=this;o.transmuxing.start=self.performance.now();var n=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:o});else if(n){var w=n.flush(o);Object(H.isPromise)(w)?w.then(function(x){a.handleFlushResult(x,o)}):this.handleFlushResult(w,o)}},r.handleFlushResult=function(o,a){var n=this;o.forEach(function(R){n.handleTransmuxComplete(R)}),this.onFlush(a)},r.onWorkerMessage=function(o){var a=o.data,n=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,n.trigger(a.event,a.data);break}}},r.configureTransmuxer=function(o){var a=this.worker,n=this.transmuxer;a?a.postMessage({cmd:"configure",config:o}):n&&n.configure(o)},r.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},s}()},"./src/demux/transmuxer-worker.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return k});var K=N("./src/demux/transmuxer.ts"),A=N("./src/events.ts"),M=N("./src/utils/logger.ts"),H=N("./node_modules/eventemitter3/index.js"),P=N.n(H);function k(d){var s=new H.EventEmitter,r=function(o,a){d.postMessage({event:o,data:a})};s.on(A.Events.FRAG_DECRYPTED,r),s.on(A.Events.ERROR,r),d.addEventListener("message",function(u){var o=u.data;switch(o.cmd){case"init":{var a=JSON.parse(o.config);d.transmuxer=new K.default(s,o.typeSupported,a,o.vendor,o.id),Object(M.enableLogs)(a.debug),r("init",null);break}case"configure":{d.transmuxer.configure(o.config);break}case"demux":{var n=d.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(K.isPromise)(n)?n.then(function(x){D(d,x)}):D(d,n);break}case"flush":{var R=o.chunkMeta,w=d.transmuxer.flush(R);Object(K.isPromise)(w)?w.then(function(x){m(d,x,R)}):m(d,w,R);break}default:break}})}function D(d,s){if(f(s.remuxResult))return;var r=[],u=s.remuxResult,o=u.audio,a=u.video;o&&b(r,o),a&&b(r,a),d.postMessage({event:"transmuxComplete",data:s},r)}function b(d,s){s.data1&&d.push(s.data1.buffer),s.data2&&d.push(s.data2.buffer)}function m(d,s,r){s.forEach(function(u){D(d,u)}),d.postMessage({event:"flush",data:r})}function f(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return a}),N.d(Y,"isPromise",function(){return w}),N.d(Y,"TransmuxConfig",function(){return x}),N.d(Y,"TransmuxState",function(){return O});var K=N("./src/events.ts"),A=N("./src/errors.ts"),M=N("./src/crypt/decrypter.ts"),H=N("./src/demux/aacdemuxer.ts"),P=N("./src/demux/mp4demuxer.ts"),k=N("./src/demux/tsdemuxer.ts"),D=N("./src/demux/mp3demuxer.ts"),b=N("./src/remux/mp4-remuxer.ts"),m=N("./src/remux/passthrough-remuxer.ts"),f=N("./src/demux/chunk-cache.ts"),d=N("./src/utils/mp4-tools.ts"),s=N("./src/utils/logger.ts"),r;try{r=self.performance.now.bind(self.performance)}catch(C){s.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var u=[{demux:k.default,remux:b.default},{demux:P.default,remux:m.default},{demux:H.default,remux:b.default},{demux:D.default,remux:b.default}],o=1024;u.forEach(function(C){var _=C.demux;o=Math.max(o,_.minProbeByteLength)});var a=function(){function C(y,h,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 f.default,this.observer=y,this.typeSupported=h,this.config=c,this.vendor=v,this.id=p}var _=C.prototype;return _.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},_.push=function(h,c,v,p){var E=this,U=v.transmuxing;U.executeStart=r();var F=new Uint8Array(h),z=this.cache,G=this.config,B=this.currentTransmuxState,T=this.transmuxConfig;p&&(this.currentTransmuxState=p);var V=n(F,c);if(V&&V.method==="AES-128"){var Z=this.getDecrypter();if(G.enableSoftwareAES){var oe=Z.softwareDecrypt(F,V.key.buffer,V.iv.buffer);if(!oe)return U.executeEnd=r(),R(v);F=new Uint8Array(oe)}else return this.decryptionPromise=Z.webCryptoDecrypt(F,V.key.buffer,V.iv.buffer).then(function(dt){var Nt=E.push(dt,null,v);return E.decryptionPromise=null,Nt}),this.decryptionPromise}var pe=p||B,Ye=pe.contiguous,xe=pe.discontinuity,Ie=pe.trackSwitch,Je=pe.accurateTimeOffset,Ke=pe.timeOffset,be=T.audioCodec,de=T.videoCodec,nt=T.defaultInitPts,Kt=T.duration,jt=T.initSegmentData;if((xe||Ie)&&this.resetInitSegment(jt,be,de,Kt),xe&&this.resetInitialTimestamp(nt),Ye||this.resetContiguity(),this.needsProbing(F,xe,Ie)){if(z.dataLength){var wt=z.flush();F=Object(d.appendUint8Array)(wt,F)}this.configureTransmuxer(F,T)}var ze=this.transmux(F,V,Ke,Je,v),ft=this.currentTransmuxState;return ft.contiguous=!0,ft.discontinuity=!1,ft.trackSwitch=!1,U.executeEnd=r(),ze},_.flush=function(h){var c=this,v=h.transmuxing;v.executeStart=r();var p=this.decrypter,E=this.cache,U=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return c.flush(h)});var z=[],G=U.timeOffset;if(p){var B=p.flush();B&&z.push(this.push(B,null,h))}var T=E.dataLength;E.reset();var V=this.demuxer,Z=this.remuxer;if(!V||!Z)return T>=o&&this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=r(),[R(h)];var oe=V.flush(G);return w(oe)?oe.then(function(pe){return c.flushRemux(z,pe,h),z}):(this.flushRemux(z,oe,h),z)},_.flushRemux=function(h,c,v){var p=c.audioTrack,E=c.avcTrack,U=c.id3Track,F=c.textTrack,z=this.currentTransmuxState,G=z.accurateTimeOffset,B=z.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var T=this.remuxer.remux(p,E,U,F,B,G,!0,this.id);h.push({remuxResult:T,chunkMeta:v}),v.transmuxing.executeEnd=r()},_.resetInitialTimestamp=function(h){var c=this.demuxer,v=this.remuxer;if(!c||!v)return;c.resetTimeStamp(h),v.resetTimeStamp(h)},_.resetContiguity=function(){var h=this.demuxer,c=this.remuxer;if(!h||!c)return;h.resetContiguity(),c.resetNextTimestamp()},_.resetInitSegment=function(h,c,v,p){var E=this.demuxer,U=this.remuxer;if(!E||!U)return;E.resetInitSegment(c,v,p),U.resetInitSegment(h,c,v)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(h,c,v,p,E){var U;return c&&c.method==="SAMPLE-AES"?U=this.transmuxSampleAes(h,c,v,p,E):U=this.transmuxUnencrypted(h,v,p,E),U},_.transmuxUnencrypted=function(h,c,v,p){var E=this.demuxer.demux(h,c,!1,!this.config.progressive),U=E.audioTrack,F=E.avcTrack,z=E.id3Track,G=E.textTrack,B=this.remuxer.remux(U,F,z,G,c,v,!1,this.id);return{remuxResult:B,chunkMeta:p}},_.transmuxSampleAes=function(h,c,v,p,E){var U=this;return this.demuxer.demuxSampleAes(h,c,v).then(function(F){var z=U.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,v,p,!1,U.id);return{remuxResult:z,chunkMeta:E}})},_.configureTransmuxer=function(h,c){for(var v=this.config,p=this.observer,E=this.typeSupported,U=this.vendor,F=c.audioCodec,z=c.defaultInitPts,G=c.duration,B=c.initSegmentData,T=c.videoCodec,V,Z=0,oe=u.length;Z0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(y=_),y}var R=function(_){return{remuxResult:{},chunkMeta:_}};function w(C){return"then"in C&&C.then instanceof Function}var x=function(_,y,h,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=h,this.duration=c,this.defaultInitPts=v},O=function(_,y,h,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=h,this.trackSwitch=c,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"discardEPB",function(){return R});var K=N("./src/demux/adts.ts"),A=N("./src/demux/mpegaudio.ts"),M=N("./src/demux/exp-golomb.ts"),H=N("./src/demux/id3.ts"),P=N("./src/demux/sample-aes.ts"),k=N("./src/events.ts"),D=N("./src/utils/mp4-tools.ts"),b=N("./src/utils/logger.ts"),m=N("./src/errors.ts"),f={video:1,audio:2,id3:3,text:4},d=function(){function w(O,C,_){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=O,this.config=C,this.typeSupported=_}w.probe=function(C){var _=w.syncOffset(C);return _<0?!1:(_&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(C){for(var _=Math.min(1e3,C.length-3*188),y=0;y<_;){if(C[y]===71&&C[y+188]===71&&C[y+2*188]===71)return y;y++}return-1},w.createTrack=function(C,_){return{container:C==="video"||C==="audio"?"video/mp2t":void 0,type:C,id:f[C],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:C==="audio"?_:void 0}};var x=w.prototype;return x.resetInitSegment=function(C,_,y){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",y),this._audioTrack=w.createTrack("audio",y),this._id3Track=w.createTrack("id3",y),this._txtTrack=w.createTrack("text",y),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=C,this.videoCodec=_,this._duration=y},x.resetTimeStamp=function(){},x.resetContiguity=function(){var C=this._audioTrack,_=this._avcTrack,y=this._id3Track;C&&(C.pesData=null),_&&(_.pesData=null),y&&(y.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(C,_,y,h){y===void 0&&(y=!1),h===void 0&&(h=!1),y||(this.sampleAes=null);var c,v=this._avcTrack,p=this._audioTrack,E=this._id3Track,U=v.pid,F=v.pesData,z=p.pid,G=E.pid,B=p.pesData,T=E.pesData,V=!1,Z=this.pmtParsed,oe=this._pmtId,pe=C.length;if(this.remainderData&&(C=Object(D.appendUint8Array)(this.remainderData,C),pe=C.length,this.remainderData=null),pe<188&&!h)return this.remainderData=C,{audioTrack:p,avcTrack:v,id3Track:E,textTrack:this._txtTrack};var Ye=Math.max(0,w.syncOffset(C));pe-=(pe+Ye)%188,pe>4,be=void 0;if(Ke>1){if(be=xe+5+C[xe+4],be===xe+188)continue}else be=xe+4;switch(Je){case U:Ie&&(F&&(c=o(F))&&this.parseAVCPES(c,!1),F={data:[],size:0}),F&&(F.data.push(C.subarray(be,xe+188)),F.size+=xe+188-be);break;case z:Ie&&(B&&(c=o(B))&&(p.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),B={data:[],size:0}),B&&(B.data.push(C.subarray(be,xe+188)),B.size+=xe+188-be);break;case G:Ie&&(T&&(c=o(T))&&this.parseID3PES(c),T={data:[],size:0}),T&&(T.data.push(C.subarray(be,xe+188)),T.size+=xe+188-be);break;case 0:Ie&&(be+=C[be]+1),oe=this._pmtId=r(C,be);break;case oe:{Ie&&(be+=C[be]+1);var de=u(C,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,y);U=de.avc,U>0&&(v.pid=U),z=de.audio,z>0&&(p.pid=z,p.isAAC=de.isAAC),G=de.id3,G>0&&(E.pid=G),V&&!Z&&(b.logger.log("reparse from beginning"),V=!1,xe=Ye-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(k.Events.ERROR,k.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=F,p.pesData=B,E.pesData=T;var nt={audioTrack:p,avcTrack:v,id3Track:E,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(nt),nt},x.flush=function(){var C=this.remainderData;this.remainderData=null;var _;return C?_=this.demux(C,-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(C){var _=C.audioTrack,y=C.avcTrack,h=C.id3Track,c=y.pesData,v=_.pesData,p=h.pesData,E;c&&(E=o(c))?(this.parseAVCPES(E,!0),y.pesData=null):y.pesData=c,v&&(E=o(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=o(p))?(this.parseID3PES(E),h.pesData=null):h.pesData=p},x.demuxSampleAes=function(C,_,y){var h=this.demux(C,y,!0,!this.config.progressive),c=this.sampleAes=new P.default(this.observer,this.config,_);return this.decrypt(h,c)},x.decrypt=function(C,_){return new Promise(function(y){var h=C.audioTrack,c=C.avcTrack;h.samples&&h.isAAC?_.decryptAacSamples(h.samples,0,function(){c.samples?_.decryptAvcSamples(c.samples,0,0,function(){y(C)}):y(C)}):c.samples&&_.decryptAvcSamples(c.samples,0,0,function(){y(C)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(C,_){var y=this,h=this._avcTrack,c=this.parseAVCNALu(C.data),v=!1,p=this.avcSample,E,U=!1;C.data=null,p&&c.length&&!h.audFound&&(a(p,h),p=this.avcSample=s(!1,C.pts,C.dts,"")),c.forEach(function(F){switch(F.type){case 1:{E=!0,p||(p=y.avcSample=s(!0,C.pts,C.dts,"")),v&&(p.debug+="NDR "),p.frame=!0;var z=F.data;if(U&&z.length>4){var G=new M.default(z).readSliceType();(G===2||G===4||G===7||G===9)&&(p.key=!0)}break}case 5:E=!0,p||(p=y.avcSample=s(!0,C.pts,C.dts,"")),v&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{E=!0,v&&p&&(p.debug+="SEI ");var B=new M.default(R(F.data));B.readUByte();for(var T=0,V=0,Z=!1,oe=0;!Z&&B.bytesAvailable>1;){T=0;do oe=B.readUByte(),T+=oe;while(oe===255);V=0;do oe=B.readUByte(),V+=oe;while(oe===255);if(T===4&&B.bytesAvailable!==0){Z=!0;var pe=B.readUByte();if(pe===181){var Ye=B.readUShort();if(Ye===49){var xe=B.readUInt();if(xe===1195456820){var Ie=B.readUByte();if(Ie===3){for(var Je=B.readUByte(),Ke=B.readUByte(),be=31&Je,de=[Je,Ke],nt=0;nt16){for(var Kt=[],jt=0;jt<16;jt++)Kt.push(B.readUByte().toString(16)),(jt===3||jt===5||jt===7||jt===9)&&Kt.push("-");for(var wt=V-16,ze=new Uint8Array(wt),ft=0;ft=0){var B={data:C.subarray(z,p-h-1),type:G};v.push(B)}else{var T=this.getLastNalUnit();if(T&&(c&&p<=4-c&&(T.state&&(T.data=T.data.subarray(0,T.data.byteLength-c))),U=p-h-1,U>0)){var V=new Uint8Array(T.data.byteLength+U);V.set(T.data,0),V.set(C.subarray(0,U),T.data.byteLength),T.data=V,T.state=0}}p<_?(F=C[p]&31,z=p,G=F,h=0):h=-1}else h=0}if(z>=0&&h>=0){var Z={data:C.subarray(z,_),type:G,state:h};v.push(Z)}if(v.length===0){var oe=this.getLastNalUnit();if(oe){var pe=new Uint8Array(oe.data.byteLength+C.byteLength);pe.set(oe.data,0),pe.set(C,oe.data.byteLength),oe.data=pe}}return y.naluState=h,v},x.parseAACPES=function(C){var _=0,y=this._audioTrack,h=this.aacOverFlow,c=C.data;if(h){this.aacOverFlow=null;var v=h.sample.unit.byteLength,p=Math.min(h.missing,v),E=v-p;h.sample.unit.set(c.subarray(0,p),E),y.samples.push(h.sample),_=h.missing}var U,F;for(U=_,F=c.length;U1;){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)}O=c[0];var p=(O[0]<<16)+(O[1]<<8)+O[2];if(p===1){if(C=(O[4]<<8)+O[5],C&&C>w.size-6)return null;var E=O[7];E&192&&(y=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,E&64?(h=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,y-h>60*9e4&&(b.logger.warn(Math.round((y-h)/9e4)+"s delta between PTS and DTS, align them"),y=h)):h=y),_=O[8];var U=_+9;if(w.size<=U)return null;w.size-=U;for(var F=new Uint8Array(w.size),z=0,G=c.length;zB){U-=B;continue}else O=O.subarray(U),B-=U,U=0;F.set(O,x),x+=B}return C&&(C-=_+3),{data:F,pts:y,dts:h,len:C}}return null}function a(w,x){if(w.units.length&&w.frame){if(w.pts===void 0){var O=x.samples,C=O.length;if(C){var _=O[C-1];w.pts=_.pts,w.dts=_.dts}else{x.dropped++;return}}x.samples.push(w)}w.debug.length&&b.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function n(w,x){var O=w.length;if(O>0){if(x.pts>=w[O-1].pts)w.push(x);else for(var C=O-1;C>=0;C--)if(x.ptsy)return c;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,y=this.autoLevelCapping,h;return y===-1&&_&&_.length?h=_.length-1:h=y,h}},{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 o.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(_){x.defaultConfig=_}}]),x}();w.defaultConfig=void 0},"./src/is-supported.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isSupported",function(){return M}),N.d(Y,"changeTypeSupported",function(){return H});var K=N("./src/utils/mediasource-helper.ts");function A(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var P=Object(K.getMediaSource)();if(!P)return!1;var k=A(),D=P&&typeof P.isTypeSupported=="function"&&P.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!k||k.prototype&&typeof k.prototype.appendBuffer=="function"&&typeof k.prototype.remove=="function";return!!D&&!!b}function H(){var P,k=A();return typeof(k==null||((P=k.prototype)===null||P===void 0)?void 0:P.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d}),N.d(Y,"LoadError",function(){return r});var K=N("./src/polyfills/number.ts"),A=N("./src/errors.ts");function M(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,b(u,o)}function H(u){var o=typeof Map=="function"?new Map:void 0;return H=function(n){if(n===null||!D(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(n))return o.get(n);o.set(n,R)}function R(){return P(n,arguments,m(this).constructor)}return R.prototype=Object.create(n.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),b(R,n)},H(u)}function P(u,o,a){return k()?P=Reflect.construct:P=function(R,w,x){var O=[null];O.push.apply(O,w);var C=Function.bind.apply(R,O),_=new C;return x&&b(_,x.prototype),_},P.apply(null,arguments)}function k(){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 D(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function b(u,o){return b=Object.setPrototypeOf||function(n,R){return n.__proto__=R,n},b(u,o)}function m(u){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(u)}var f=Math.pow(2,17),d=function(){function u(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var o=u.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(n,R){var w=this,x=n.url;if(!x)return Promise.reject(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var O=this.config,C=O.fLoader,_=O.loader;return new Promise(function(y,h){w.loader&&w.loader.destroy();var c=w.loader=n.loader=C?new C(O):new _(O),v=s(n),p={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:f};n.stats=c.stats,c.load(v,p,{onSuccess:function(U,F,z,G){w.resetLoader(n,c),y({frag:n,part:null,payload:U.data,networkDetails:G})},onError:function(U,F,z){w.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:U,networkDetails:z}))},onAbort:function(U,F,z){w.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:z}))},onTimeout:function(U,F,z){w.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:z}))},onProgress:function(U,F,z,G){R&&R({frag:n,part:null,payload:z,networkDetails:G})}})})},o.loadPart=function(n,R,w){var x=this;this.abort();var O=this.config,C=O.fLoader,_=O.loader;return new Promise(function(y,h){x.loader&&x.loader.destroy();var c=x.loader=n.loader=C?new C(O):new _(O),v=s(n,R),p={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:f};R.stats=c.stats,c.load(v,p,{onSuccess:function(U,F,z,G){x.resetLoader(n,c),x.updateStatsFromPart(n,R);var B={frag:n,part:R,payload:U.data,networkDetails:G};w(B),y(B)},onError:function(U,F,z){x.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:R,response:U,networkDetails:z}))},onAbort:function(U,F,z){n.stats.aborted=R.stats.aborted,x.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:R,networkDetails:z}))},onTimeout:function(U,F,z){x.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:R,networkDetails:z}))}})})},o.updateStatsFromPart=function(n,R){var w=n.stats,x=R.stats,O=x.total;if(w.loaded+=x.loaded,O){var C=Math.round(n.duration/R.duration),_=Math.min(Math.round(w.loaded/O),C),y=C-_,h=y*Math.round(w.loaded/_);w.total=w.loaded+h}else w.total=Math.max(w.loaded,w.total);var c=w.loading,v=x.loading;c.start?c.first+=v.first-v.start:(c.start=v.start,c.first=v.first),c.end=v.end},o.resetLoader=function(n,R){n.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},u}();function s(u,o){o===void 0&&(o=null);var a=o||u,n={frag:u,part:o,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},R=a.byteRangeStartOffset,w=a.byteRangeEndOffset;return Object(K.isFiniteNumber)(R)&&Object(K.isFiniteNumber)(w)&&(n.rangeStart=R,n.rangeEnd=w),n}var r=function(u){M(o,u);function o(a){for(var n,R=arguments.length,w=new Array(R>1?R-1:0),x=1;x>8*(15-O)&255;return x},n.setDecryptDataFromLevelKey=function(w,x){var O=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(O=P.LevelKey.fromURI(w.uri),O.method=w.method,O.iv=this.createInitializationVector(x),O.keyFormat="identity"),O},n.setElementaryStreamInfo=function(w,x,O,C,_,y){y===void 0&&(y=!1);var h=this.elementaryStreams,c=h[w];if(!c){h[w]={startPTS:x,endPTS:O,startDTS:C,endDTS:_,partial:y};return}c.startPTS=Math.min(c.startPTS,x),c.endPTS=Math.max(c.endPTS,O),c.startDTS=Math.min(c.startDTS,C),c.endDTS=Math.max(c.endDTS,_)},n.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[d.AUDIO]=null,w[d.VIDEO]=null,w[d.AUDIOVIDEO]=null},f(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(K.isFiniteNumber)(this.programDateTime))return null;var w=Object(K.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),a}(s),u=function(o){D(a,o);function a(n,R,w,x,O){var C;C=o.call(this,w)||this,C.fragOffset=0,C.duration=0,C.gap=!1,C.independent=!1,C.relurl=void 0,C.fragment=void 0,C.index=void 0,C.stats=new k.LoadStats,C.duration=n.decimalFloatingPoint("DURATION"),C.gap=n.bool("GAP"),C.independent=n.bool("INDEPENDENT"),C.relurl=n.enumeratedString("URI"),C.fragment=R,C.index=x;var _=n.enumeratedString("BYTERANGE");return _&&C.setByteRange(_,O),O&&(C.fragOffset=O.fragOffset+O.duration),C}return f(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),a}(s)},"./src/loader/key-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return H});var K=N("./src/events.ts"),A=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),H=function(){function P(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var k=P.prototype;return k._registerListeners=function(){this.hls.on(K.Events.KEY_LOADING,this.onKeyLoading,this)},k._unregisterListeners=function(){this.hls.off(K.Events.KEY_LOADING,this.onKeyLoading)},k.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var m=this.loaders[b];m&&m.destroy()}this.loaders={}},k.onKeyLoading=function(b,m){var f=m.frag,d=f.type,s=this.loaders[d];if(!f.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var r=f.decryptdata.uri;if(r!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(s&&(M.logger.warn("abort previous key loader for type:"+d),s.abort()),!r){M.logger.warn("key uri is falsy");return}var o=u.loader,a=f.loader=this.loaders[d]=new o(u);this.decrypturl=r,this.decryptkey=null;var n={url:r,frag:f,responseType:"arraybuffer"},R={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(n,R,w)}else this.decryptkey&&(f.decryptdata.key=this.decryptkey,this.hls.trigger(K.Events.KEY_LOADED,{frag:f}))},k.loadsuccess=function(b,m,f){var d=f.frag;if(!d.decryptdata){M.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(K.Events.KEY_LOADED,{frag:d})},k.loaderror=function(b,m){var f=m.frag,d=f.loader;d&&d.abort(),delete this.loaders[f.type],this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:f,response:b})},k.loadtimeout=function(b,m){var f=m.frag,d=f.loader;d&&d.abort(),delete this.loaders[f.type],this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:f})},P}()},"./src/loader/level-details.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return P});var K=N("./src/polyfills/number.ts");function A(k,D){for(var b=0;bm.endSN||f>0||f===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},M(k,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(K.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var f=this.driftEnd-this.driftStart;return f*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}}]),k}()},"./src/loader/level-key.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LevelKey",function(){return P});var K=N("./node_modules/url-toolkit/src/url-toolkit.js"),A=N.n(K);function M(k,D){for(var b=0;b2){var h=y.shift()+".";return h+=parseInt(y.shift()).toString(16),h+=("000"+parseInt(y.shift()).toString(16)).substr(-4),h}return _},O.resolve=function(_,y){return A.buildAbsoluteURL(y,_,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(_,y){var h=[],c={},v=!1;f.lastIndex=0;for(var p;(p=f.exec(_))!=null;)if(p[1]){var E=new D.AttrList(p[1]),U={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:O.resolve(p[2],y)},F=E.decimalResolution("RESOLUTION");F&&(U.width=F.width,U.height=F.height),n((E.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=O.convertAVC1ToAVCOTI(U.videoCodec)),h.push(U)}else if(p[3]){var z=new D.AttrList(p[3]);z["DATA-ID"]&&(v=!0,c[z["DATA-ID"]]=z)}return{levels:h,sessionData:v?c:null}},O.parseMasterPlaylistMedia=function(_,y,h,c){c===void 0&&(c=[]);var v,p=[],E=0;for(d.lastIndex=0;(v=d.exec(_))!==null;){var U=new D.AttrList(v[1]);if(U.TYPE===h){var F={attrs:U,bitrate:0,id:E++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:h,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?O.resolve(U.URI,y):""};if(c.length){var z=O.findGroup(c,F.groupId)||c[0];R(F,z,"audioCodec"),R(F,z,"textCodec")}p.push(F)}}return p},O.parseLevelPlaylist=function(_,y,h,c,v){var p=new P.LevelDetails(y),E=p.fragments,U=null,F=0,z=0,G=0,B=0,T=null,V=new H.Fragment(c,y),Z,oe,pe,Ye=-1,xe=!1;for(s.lastIndex=0,p.m3u8=_;(Z=s.exec(_))!==null;){xe&&(xe=!1,V=new H.Fragment(c,y),V.start=G,V.sn=F,V.cc=B,V.level=h,U&&(V.initSegment=U,V.rawProgramDateTime=U.rawProgramDateTime));var Ie=Z[1];if(Ie){V.duration=parseFloat(Ie);var Je=(" "+Z[2]).slice(1);V.title=Je||null,V.tagList.push(Je?["INF",Ie,Je]:["INF",Ie])}else if(Z[3])Object(K.isFiniteNumber)(V.duration)&&(V.start=G,pe&&(V.levelkey=pe),V.sn=F,V.level=h,V.cc=B,V.urlId=v,E.push(V),V.relurl=(" "+Z[3]).slice(1),x(V,T),T=V,G+=V.duration,F++,z=0,xe=!0);else if(Z[4]){var Ke=(" "+Z[4]).slice(1);T?V.setByteRange(Ke,T):V.setByteRange(Ke)}else if(Z[5])V.rawProgramDateTime=(" "+Z[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),Ye===-1&&(Ye=E.length);else{if(Z=Z[0].match(r),!Z){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe-1){b.logger.warn("Keyformat "+An+" is not supported from the manifest");continue}else if(An!=="identity")continue;Nt&&(pe=k.LevelKey.fromURL(y,Ze),Ze&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Nt)>=0&&(pe.method=Nt,pe.keyFormat=An,Mt&&(pe.keyID=Mt),Ut&&(pe.keyFormatVersions=Ut),pe.iv=Bt));break}case"START":{var pn=new D.AttrList(de),tt=pn.decimalFloatingPoint("TIME-OFFSET");Object(K.isFiniteNumber)(tt)&&(p.startTimeOffset=tt);break}case"MAP":{var fn=new D.AttrList(de);V.relurl=fn.URI,fn.BYTERANGE&&V.setByteRange(fn.BYTERANGE),V.level=h,V.sn="initSegment",pe&&(V.levelkey=pe),V.initSegment=null,U=V,xe=!0;break}case"SERVER-CONTROL":{var In=new D.AttrList(de);p.canBlockReload=In.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=In.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&In.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=In.optionalFloat("PART-HOLD-BACK",0),p.holdBack=In.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var He=new D.AttrList(de);p.partTarget=He.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ue=p.partList;Ue||(Ue=p.partList=[]);var pt=z>0?Ue[Ue.length-1]:void 0,Ct=z++,Ge=new H.Part(new D.AttrList(de),V,y,Ct,pt);Ue.push(Ge),V.duration+=Ge.duration;break}case"PRELOAD-HINT":{var vt=new D.AttrList(de);p.preloadHint=vt;break}case"RENDITION-REPORT":{var Ae=new D.AttrList(de);p.renditionReports=p.renditionReports||[],p.renditionReports.push(Ae);break}default:b.logger.warn("line parsed but not handled: "+Z);break}}}T&&!T.relurl?(E.pop(),G-=T.duration,p.partList&&(p.fragmentHint=T)):p.partList&&(x(V,T),V.cc=B,p.fragmentHint=V);var ge=E.length,Ee=E[0],ae=E[ge-1];if(G+=p.skippedSegments*p.targetduration,G>0&&ge&&ae){p.averagetargetduration=G/ge;var re=ae.sn;p.endSN=re!=="initSegment"?re:0,Ee&&(p.startCC=Ee.cc,Ee.initSegment||p.fragments.every(function(he){return he.relurl&&o(he.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new H.Fragment(c,y),V.relurl=ae.relurl,V.level=h,V.sn="initSegment",Ee.initSegment=V,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(G+=p.fragmentHint.duration),p.totalduration=G,p.endCC=B,Ye>0&&w(E,Ye),p},O}();function n(O,C){["video","audio","text"].forEach(function(_){var y=O.filter(function(c){return Object(m.isCodecType)(c,_)});if(y.length){var h=y.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});C[_+"Codec"]=h.length>0?h[0]:y[0],O=O.filter(function(c){return y.indexOf(c)===-1})}}),C.unknownCodecs=O}function R(O,C,_){var y=C[_];y&&(O[_]=y)}function w(O,C){for(var _=O[C],y=C;y--;){var h=O[y];if(!h)return;h.programDateTime=_.programDateTime-h.duration*1e3,_=h}}function x(O,C){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):C!=null&&C.programDateTime&&(O.programDateTime=C.endProgramDateTime),Object(K.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/polyfills/number.ts"),A=N("./src/events.ts"),M=N("./src/errors.ts"),H=N("./src/utils/logger.ts"),P=N("./src/utils/mp4-tools.ts"),k=N("./src/loader/m3u8-parser.ts"),D=N("./src/types/loader.ts"),b=N("./src/utils/attr-list.ts");function m(s){var r=s.type;switch(r){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function f(s,r){var u=s.url;return(u===void 0||u.indexOf("data:")===0)&&(u=r.url),u}var d=function(){function s(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var r=s.prototype;return r.registerListeners=function(){var o=this.hls;o.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(A.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(A.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(A.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.unregisterListeners=function(){var o=this.hls;o.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(A.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(A.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(A.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.createInternalLoader=function(o){var a=this.hls.config,n=a.pLoader,R=a.loader,w=n||R,x=new w(a);return o.loader=x,this.loaders[o.type]=x,x},r.getInternalLoader=function(o){return this.loaders[o.type]},r.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},r.destroyInternalLoaders=function(){for(var o in this.loaders){var a=this.loaders[o];a&&a.destroy(),this.resetInternalLoader(o)}},r.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},r.onManifestLoading=function(o,a){var n=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},r.onLevelLoading=function(o,a){var n=a.id,R=a.level,w=a.url,x=a.deliveryDirectives;this.load({id:n,groupId:null,level:R,responseType:"text",type:D.PlaylistContextType.LEVEL,url:w,deliveryDirectives:x})},r.onAudioTrackLoading=function(o,a){var n=a.id,R=a.groupId,w=a.url,x=a.deliveryDirectives;this.load({id:n,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:x})},r.onSubtitleTrackLoading=function(o,a){var n=a.id,R=a.groupId,w=a.url,x=a.deliveryDirectives;this.load({id:n,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:x})},r.load=function(o){var a,n=this.hls.config,R=this.getInternalLoader(o);if(R){var w=R.context;if(w&&w.url===o.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),R.abort()}var x,O,C,_;switch(o.type){case D.PlaylistContextType.MANIFEST:x=n.manifestLoadingMaxRetry,O=n.manifestLoadingTimeOut,C=n.manifestLoadingRetryDelay,_=n.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:x=0,O=n.levelLoadingTimeOut;break;default:x=n.levelLoadingMaxRetry,O=n.levelLoadingTimeOut,C=n.levelLoadingRetryDelay,_=n.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(o),(a=o.deliveryDirectives)!==null&&a!==void 0&&a.part){var y;if(o.type===D.PlaylistContextType.LEVEL&&o.level!==null?y=this.hls.levels[o.level].details:o.type===D.PlaylistContextType.AUDIO_TRACK&&o.id!==null?y=this.hls.audioTracks[o.id].details:o.type===D.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(y=this.hls.subtitleTracks[o.id].details),y){var h=y.partTarget,c=y.targetduration;h&&c&&(O=Math.min(Math.max(h*3,c*.8)*1e3,O))}}var v={timeout:O,maxRetry:x,retryDelay:C,maxRetryDelay:_,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(o,v,p)},r.loadsuccess=function(o,a,n,R){if(R===void 0&&(R=null),n.isSidxRequest){this.handleSidxRequest(o,n),this.handlePlaylistLoaded(o,a,n,R);return}this.resetInternalLoader(n.type);var w=o.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,n,"no EXTM3U delimiter",R);return}a.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,a,n,R):this.handleMasterPlaylist(o,a,n,R)},r.loaderror=function(o,a,n){n===void 0&&(n=null),this.handleNetworkError(a,n,!1,o)},r.loadtimeout=function(o,a,n){n===void 0&&(n=null),this.handleNetworkError(a,n,!0)},r.handleMasterPlaylist=function(o,a,n,R){var w=this.hls,x=o.data,O=f(o,n),C=k.default.parseMasterPlaylist(x,O),_=C.levels,y=C.sessionData;if(!_.length){this.handleManifestParsingError(o,n,"no level found in manifest",R);return}var h=_.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),c=_.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),v=k.default.parseMasterPlaylistMedia(x,O,"AUDIO",h),p=k.default.parseMasterPlaylistMedia(x,O,"SUBTITLES",c),E=k.default.parseMasterPlaylistMedia(x,O,"CLOSED-CAPTIONS");if(v.length){var U=v.some(function(F){return!F.url});!U&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(H.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:""}))}w.trigger(A.Events.MANIFEST_LOADED,{levels:_,audioTracks:v,subtitles:p,captions:E,url:O,stats:a,networkDetails:R,sessionData:y})},r.handleTrackOrLevelPlaylist=function(o,a,n,R){var w=this.hls,x=n.id,O=n.level,C=n.type,_=f(o,n),y=Object(K.isFiniteNumber)(x)?x:0,h=Object(K.isFiniteNumber)(O)?O:y,c=m(n),v=k.default.parseLevelPlaylist(o.data,_,h,c,y);if(!v.fragments.length){w.trigger(A.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(C===D.PlaylistContextType.MANIFEST){var p={attrs:new b.AttrList({}),bitrate:0,details:v,name:"",url:_};w.trigger(A.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:_,stats:a,networkDetails:R,sessionData:null})}if(a.parsing.end=performance.now(),v.needSidxRanges){var E,U=(E=v.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:U,isSidxRequest:!0,type:C,level:O,levelDetails:v,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=v,this.handlePlaylistLoaded(o,a,n,R)},r.handleSidxRequest=function(o,a){var n=Object(P.parseSegmentIndex)(new Uint8Array(o.data));if(!n)return;var R=n.references,w=a.levelDetails;R.forEach(function(x,O){var C=x.info,_=w.fragments[O];_.byteRange.length===0&&_.setByteRange(String(1+C.end-C.start)+"@"+String(C.start)),_.initSegment&&_.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},r.handleManifestParsingError=function(o,a,n,R){this.hls.trigger(A.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===D.PlaylistContextType.MANIFEST,url:o.url,reason:n,response:o,context:a,networkDetails:R})},r.handleNetworkError=function(o,a,n,R){n===void 0&&(n=!1),H.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var w=M.ErrorDetails.UNKNOWN,x=!1,O=this.getInternalLoader(o);switch(o.type){case D.PlaylistContextType.MANIFEST:w=n?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case D.PlaylistContextType.LEVEL:w=n?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.AUDIO_TRACK:w=n?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:w=n?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}O&&this.resetInternalLoader(o.type);var C={type:M.ErrorTypes.NETWORK_ERROR,details:w,fatal:x,url:o.url,loader:O,context:o,networkDetails:a};R&&(C.response=R),this.hls.trigger(A.Events.ERROR,C)},r.handlePlaylistLoaded=function(o,a,n,R){var w=n.type,x=n.level,O=n.id,C=n.groupId,_=n.loader,y=n.levelDetails,h=n.deliveryDirectives;if(!(y!=null&&y.targetduration)){this.handleManifestParsingError(o,n,"invalid target duration",R);return}if(!_)return;y.live&&(_.getCacheAge&&(y.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(y.ageHeader))&&(y.ageHeader=0));switch(w){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(A.Events.LEVEL_LOADED,{details:y,level:x||0,id:O||0,stats:a,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(A.Events.AUDIO_TRACK_LOADED,{details:y,id:O||0,groupId:C||"",stats:a,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(A.Events.SUBTITLE_TRACK_LOADED,{details:y,id:O||0,groupId:C||"",stats:a,networkDetails:R,deliveryDirectives:h});break}},s}();Y.default=d},"./src/polyfills/number.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isFiniteNumber",function(){return K}),N.d(Y,"MAX_SAFE_INTEGER",function(){return A});var K=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},A=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,Y,N){"use strict";N.r(Y);var K=function(){function A(){}return A.getSilentFrame=function(H,P){switch(H){case"mp4a.40.2":if(P===1)return new Uint8Array([0,200,0,128,35,128]);if(P===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(P===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(P===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(P===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(P===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(P===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(P===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(P===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},A}();Y.default=K},"./src/remux/mp4-generator.ts":function(te,Y,N){"use strict";N.r(Y);var K=Math.pow(2,32)-1,A=function(){function M(){}return M.init=function(){M.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 P;for(P in M.types)M.types.hasOwnProperty(P)&&(M.types[P]=[P.charCodeAt(0),P.charCodeAt(1),P.charCodeAt(2),P.charCodeAt(3)]);var k=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]),D=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]);M.HDLR_TYPES={video:k,audio:D};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]);M.STTS=M.STSC=M.STCO=m,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var f=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,f,s,f,d),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,b))},M.box=function(P){for(var k=8,D=arguments.length,b=new Array(D>1?D-1:0),m=1;m>24&255,s[1]=k>>16&255,s[2]=k>>8&255,s[3]=k&255,s.set(P,4),f=0,k=8;f>24&255,P>>16&255,P>>8&255,P&255,D>>24,D>>16&255,D>>8&255,D&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},M.mdia=function(P){return M.box(M.types.mdia,M.mdhd(P.timescale,P.duration),M.hdlr(P.type),M.minf(P))},M.mfhd=function(P){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255]))},M.minf=function(P){return P.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(P)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(P))},M.moof=function(P,k,D){return M.box(M.types.moof,M.mfhd(P),M.traf(D,k))},M.moov=function(P){for(var k=P.length,D=[];k--;)D[k]=M.trak(P[k]);return M.box.apply(null,[M.types.moov,M.mvhd(P[0].timescale,P[0].duration)].concat(D).concat(M.mvex(P)))},M.mvex=function(P){for(var k=P.length,D=[];k--;)D[k]=M.trex(P[k]);return M.box.apply(null,[M.types.mvex].concat(D))},M.mvhd=function(P,k){k*=P;var D=Math.floor(k/(K+1)),b=Math.floor(k%(K+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,D>>24,D>>16&255,D>>8&255,D&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 M.box(M.types.mvhd,m)},M.sdtp=function(P){var k=P.samples||[],D=new Uint8Array(4+k.length),b,m;for(b=0;b>>8&255),k.push(f&255),k=k.concat(Array.prototype.slice.call(m));for(b=0;b>>8&255),D.push(f&255),D=D.concat(Array.prototype.slice.call(m));var d=M.box(M.types.avcC,new Uint8Array([1,k[3],k[4],k[5],252|3,224|P.sps.length].concat(k).concat([P.pps.length]).concat(D))),s=P.width,r=P.height,u=P.pixelRatio[0],o=P.pixelRatio[1];return M.box(M.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,s>>8&255,s&255,r>>8&255,r&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,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,o>>24,o>>16&255,o>>8&255,o&255])))},M.esds=function(P){var k=P.config.length;return new Uint8Array([0,0,0,0,3,23+k,0,1,0,4,15+k,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([k]).concat(P.config).concat([6,1,2]))},M.mp4a=function(P){var k=P.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]),M.box(M.types.esds,M.esds(P)))},M.mp3=function(P){var k=P.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]))},M.stsd=function(P){return P.type==="audio"?!P.isAAC&&P.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(P)):M.box(M.types.stsd,M.STSD,M.mp4a(P)):M.box(M.types.stsd,M.STSD,M.avc1(P))},M.tkhd=function(P){var k=P.id,D=P.duration*P.timescale,b=P.width,m=P.height,f=Math.floor(D/(K+1)),d=Math.floor(D%(K+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,0,0,0,0,f>>24,f>>16&255,f>>8&255,f&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]))},M.traf=function(P,k){var D=M.sdtp(P),b=P.id,m=Math.floor(k/(K+1)),f=Math.floor(k%(K+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,f>>24,f>>16&255,f>>8&255,f&255])),M.trun(P,D.length+16+20+8+16+8+8),D)},M.trak=function(P){return P.duration=P.duration||4294967295,M.box(M.types.trak,M.tkhd(P),M.mdia(P))},M.trex=function(P){var k=P.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(P,k){var D=P.samples||[],b=D.length,m=12+16*b,f=new Uint8Array(m),d,s,r,u,o,a;for(k+=8+m,f.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255],0),d=0;d>>24&255,r>>>16&255,r>>>8&255,r&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*d);return M.box(M.types.trun,f)},M.initSegment=function(P){M.types||M.init();var k=M.moov(P),D=new Uint8Array(M.FTYP.byteLength+k.byteLength);return D.set(M.FTYP),D.set(k,M.FTYP.byteLength),D},M}();A.types=void 0,A.HDLR_TYPES=void 0,A.STTS=void 0,A.STSC=void 0,A.STCO=void 0,A.STSZ=void 0,A.VMHD=void 0,A.SMHD=void 0,A.STSD=void 0,A.FTYP=void 0,A.DINF=void 0,Y.default=A},"./src/remux/mp4-remuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return a}),N.d(Y,"normalizePts",function(){return n});var K=N("./src/polyfills/number.ts"),A=N("./src/remux/aac-helper.ts"),M=N("./src/remux/mp4-generator.ts"),H=N("./src/events.ts"),P=N("./src/errors.ts"),k=N("./src/utils/logger.ts"),D=N("./src/types/loader.ts"),b=N("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(O){for(var C=1;C0?v:p.pts},y[0].pts);return h&&k.logger.debug("PTS rollover detected"),c},C.remux=function(y,h,c,v,p,E,U,F){var z,G,B,T,V,Z,oe=p,pe=p,Ye=y.pid>-1,xe=h.pid>-1,Ie=h.samples.length,Je=y.samples.length>0,Ke=Ie>1,be=(!Ye||Je)&&(!xe||Ke)||this.ISGenerated||U;if(be){this.ISGenerated||(B=this.generateIS(y,h,p));var de=this.isVideoContiguous,nt=-1;if(Ke&&(nt=R(h.samples),!de&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,nt>0){k.logger.warn("[mp4-remuxer]: Dropped "+nt+" out of "+Ie+" video samples due to a missing keyframe");var Kt=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(nt),h.dropped+=nt,pe+=(h.samples[0].pts-Kt)/(h.timescale||9e4)}else nt===-1&&(k.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ie+" video samples"),Z=!1);if(this.ISGenerated){if(Je&&Ke){var jt=this.getVideoStartPts(h.samples),wt=n(y.samples[0].pts,jt)-jt,ze=wt/h.inputTimeScale;oe+=Math.max(0,ze),pe+=Math.max(0,-ze)}if(Je){if(y.samplerate||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(y,h,p)),G=this.remuxAudio(y,oe,this.isAudioContiguous,E,xe||Ke||F===D.PlaylistLevelType.AUDIO?pe:void 0),Ke){var ft=G?G.endPTS-G.startPTS:0;h.inputTimeScale||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(y,h,p)),z=this.remuxVideo(h,pe,de,ft)}}else Ke&&(z=this.remuxVideo(h,pe,de,0));z&&(z.firstKeyFrame=nt,z.independent=nt!==-1)}}return this.ISGenerated&&(c.samples.length&&(V=this.remuxID3(c,p)),v.samples.length&&(T=this.remuxText(v,p))),{audio:G,video:z,initSegment:B,independent:Z,text:T,id3:V}},C.generateIS=function(y,h,c){var v=y.samples,p=h.samples,E=this.typeSupported,U={},F=!Object(K.isFiniteNumber)(this._initPTS),z="audio/mp4",G,B,T;if(F&&(G=B=Infinity),y.config&&v.length&&(y.timescale=y.samplerate,y.isAAC||(E.mpeg?(z="audio/mpeg",y.codec=""):E.mp3&&(y.codec="mp3")),U.audio={id:"audio",container:z,codec:y.codec,initSegment:!y.isAAC&&E.mpeg?new Uint8Array(0):M.default.initSegment([y]),metadata:{channelCount:y.channelCount}},F&&(T=y.inputTimeScale,G=B=v[0].pts-Math.round(T*c))),h.sps&&h.pps&&p.length&&(h.timescale=h.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:M.default.initSegment([h]),metadata:{width:h.width,height:h.height}},F)){T=h.inputTimeScale;var V=this.getVideoStartPts(p),Z=Math.round(T*c);B=Math.min(B,n(p[0].dts,V)-Z),G=Math.min(G,V-Z)}if(Object.keys(U).length)return this.ISGenerated=!0,F&&(this._initPTS=G,this._initDTS=B),{tracks:U,initPTS:G,timescale:T}},C.remuxVideo=function(y,h,c,v){var p=y.inputTimeScale,E=y.samples,U=[],F=E.length,z=this._initPTS,G=this.nextAvcDts,B=8,T,V,Z,oe=Number.POSITIVE_INFINITY,pe=Number.NEGATIVE_INFINITY,Ye=0,xe=!1;if(!c||G===null){var Ie=h*p,Je=E[0].pts-n(E[0].dts,E[0].pts);G=Ie-Je}for(var Ke=0;Kebe.pts){var de=9e4*.2;Ye=Math.max(Math.min(Ye,be.pts-be.dts),-1*de)}be.dts0?Ke-1:Ke].dts&&(xe=!0)}xe&&E.sort(function(Qt,gt){var yt=Qt.dts-gt.dts,rt=Qt.pts-gt.pts;return yt||rt}),V=E[0].dts,Z=E[E.length-1].dts;var nt=Math.round((Z-V)/(F-1));if(Ye<0){if(Yent,dt=ze<-1;if(ft||dt){ft?k.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(ze,!0)+" ms ("+ze+"dts) hole between fragments detected, filling it"):k.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-ze,!0)+" ms ("+ze+"dts) overlapping between fragments detected"),V=G;var Nt=E[0].pts-ze;E[0].dts=V,E[0].pts=Nt,k.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Nt,!0)+"/"+Object(b.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(ze,!0)+" ms")}}o&&(V=Math.max(0,V));for(var Ze=0,Bt=0,Ut=0;Ut0?Ue-1:Ue].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var ve=Math.floor(re.maxBufferHole*p),me=(v?oe+v*p:this.nextAudioPts)-pt.pts;me>ve?(T=me-he,T<0&&(T=he),k.logger.log("[mp4-remuxer]: It is approximately "+me/90+" ms to the next segment; using duration "+T/90+" ms for the last video frame.")):T=he}else T=he}var Be=Math.round(pt.pts-pt.dts);U.push(new w(pt.key,T,Ge,Be))}if(U.length&&r&&r<70){var Tt=U[0].flags;Tt.dependsOn=2,Tt.isNonSync=0}console.assert(T!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=Z+T,this.isVideoContiguous=!0;var Jt=M.default.moof(y.sequenceNumber++,V,m({},y,{samples:U})),En="video",mt={data1:Jt,data2:In,startPTS:oe/p,endPTS:(pe+T)/p,startDTS:V/p,endDTS:G/p,type:En,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:y.dropped};return y.samples=[],y.dropped=0,console.assert(In.length,"MDAT length must not be zero"),mt},C.remuxAudio=function(y,h,c,v,p){var E=y.inputTimeScale,U=y.samplerate?y.samplerate:E,F=E/U,z=y.isAAC?d:s,G=z*F,B=this._initPTS,T=!y.isAAC&&this.typeSupported.mpeg,V=[],Z=y.samples,oe=T?0:8,pe=this.nextAudioPts||-1,Ye=h*E;if(this.isAudioContiguous=c=c||Z.length&&pe>0&&(v&&Math.abs(Ye-pe)<9e3||Math.abs(n(Z[0].pts-B,Ye)-pe)<20*G),Z.forEach(function(Ee){Ee.pts=n(Ee.pts-B,Ye)}),!c||pe<0){if(Z=Z.filter(function(Ee){return Ee.pts>=0}),!Z.length)return;p===0?pe=0:v?pe=Math.max(0,Ye):pe=Z[0].pts}if(y.isAAC)for(var xe=p!==void 0,Ie=this.config.maxAudioFramesDrift,Je=0,Ke=pe;Je=Ie*G&&Kt0){Bt+=oe;try{Ze=new Uint8Array(Bt)}catch(Ee){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:P.ErrorTypes.MUX_ERROR,details:P.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Bt,reason:"fail allocating audio mdat "+Bt});return}if(!T){var In=new DataView(Ze.buffer);In.setUint32(0,Bt),Ze.set(M.default.types.mdat,4)}}else return;Ze.set(pn,oe);var He=pn.byteLength;oe+=He,V.push(new w(!0,z,He,0)),Nt=tt}var Ue=V.length;if(!Ue)return;var pt=V[V.length-1];this.nextAudioPts=pe=Nt+F*pt.duration;var Ct=T?new Uint8Array(0):M.default.moof(y.sequenceNumber++,dt/F,m({},y,{samples:V}));y.samples=[];var Ge=dt/E,vt=pe/E,Ae="audio",ge={data1:Ct,data2:Ze,startPTS:Ge,endPTS:vt,startDTS:Ge,endDTS:vt,type:Ae,hasAudio:!0,hasVideo:!1,nb:Ue};return this.isAudioContiguous=!0,console.assert(Ze.length,"MDAT length must not be zero"),ge},C.remuxEmptyAudio=function(y,h,c,v){var p=y.inputTimeScale,E=y.samplerate?y.samplerate:p,U=p/E,F=this.nextAudioPts,z=(F!==null?F:v.startDTS*p)+this._initDTS,G=v.endDTS*p+this._initDTS,B=U*d,T=Math.ceil((G-z)/B),V=A.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);if(k.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){k.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],oe=0;oe4294967296;)O+=_;return O}function R(O){for(var C=0;C0?this.lastEndDTS=y:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!O.audio,c=!!O.video,v="";h&&(v+="audio"),c&&(v+="video");var p={data1:w,startPTS:_,startDTS:_,endPTS:y,endDTS:y,type:v,hasAudio:h,hasVideo:c,nb:1,dropped:0};return R.audio=p.type==="audio"?p:void 0,R.video=p.type!=="audio"?p:void 0,R.text=u,R.id3=r,R.initSegment=x,R},b}(),k=function(m,f,d){return Object(A.getStartDTS)(m,f)-d};function D(b,m){var f=b==null?void 0:b.codec;return f&&f.length>4?f:f==="hvc1"?"hvc1.1.c.L120.90":f==="av01"?"av01.0.04M.08":f==="avc1"||m===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=P},"./src/task-loop.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var K=function(){function A(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=A.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(P){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,P),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},A}()},"./src/types/cmcd.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"CMCDVersion",function(){return K}),N.d(Y,"CMCDObjectType",function(){return A}),N.d(Y,"CMCDStreamingFormat",function(){return M}),N.d(Y,"CMCDStreamType",function(){return H});var K=1,A;(function(P){P.MANIFEST="m",P.AUDIO="a",P.VIDEO="v",P.MUXED="av",P.INIT="i",P.CAPTION="c",P.TIMED_TEXT="tt",P.KEY="k",P.OTHER="o"})(A||(A={}));var M;(function(P){P.DASH="d",P.HLS="h",P.SMOOTH="s",P.OTHER="o"})(M||(M={}));var H;(function(P){P.VOD="v",P.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"HlsSkip",function(){return M}),N.d(Y,"getSkipValue",function(){return H}),N.d(Y,"HlsUrlParameters",function(){return P}),N.d(Y,"Level",function(){return k});function K(D,b){for(var m=0;mNumber.MAX_SAFE_INTEGER?Infinity:b},P.hexadecimalInteger=function(D){if(this[D]){var b=(this[D]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var m=new Uint8Array(b.length/2),f=0;fNumber.MAX_SAFE_INTEGER?Infinity:b},P.decimalFloatingPoint=function(D){return parseFloat(this[D])},P.optionalFloat=function(D,b){var m=this[D];return m?parseFloat(m):b},P.enumeratedString=function(D){return this[D]},P.bool=function(D){return this[D]==="YES"},P.decimalResolution=function(D){var b=K.exec(this[D]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},H.parseAttrList=function(D){var b,m={},f='"';for(A.lastIndex=0;(b=A.exec(D))!==null;){var d=b[2];d.indexOf(f)===0&&d.lastIndexOf(f)===d.length-1&&(d=d.slice(1,-1)),m[b[1]]=d}return m},H}()},"./src/utils/binary-search.ts":function(te,Y,N){"use strict";N.r(Y);var K={search:function(M,H){for(var P=0,k=M.length-1,D=null,b=null;P<=k;){D=(P+k)/2|0,b=M[D];var m=H(b);if(m>0)P=D+1;else if(m<0)k=D-1;else return b}return null}};Y.default=K},"./src/utils/buffer-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"BufferHelper",function(){return M});var K=N("./src/utils/logger.ts"),A={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function H(){}return H.isBuffered=function(k,D){try{if(k){for(var b=H.getBuffered(k),m=0;m=b.start(m)&&D<=b.end(m))return!0}}catch(f){}return!1},H.bufferInfo=function(k,D,b){try{if(k){var m=H.getBuffered(k),f=[],d;for(d=0;ds&&(m[d-1].end=k[f].end):m.push(k[f])}else m.push(k[f])}else m=k;for(var r=0,u,o=D,a=D,n=0;n=R&&D=c&&K.logger.log(this.time+" ["+c+"] "+v)},_}(),r=function(y){for(var h=[],c=0;cP&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=P)},y.moveCursor=function(c){var v=this.pos+c;if(c>1)for(var p=this.pos+1;p=144&&this.backSpace();var v=M(c);if(this.pos>=P){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;v0&&(c?p="["+v.join(" | ")+"]":p=v.join(` `)),p},y.getTextAndFormat=function(){return this.rows},_}(),R=function(){function _(h,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=h,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[H-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[H-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=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))},_}(),w=function(){function _(h,c,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new s;this.channels=[null,new R(h,c,p),new R(h+1,v,p)],this.cmdHistory=C(),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,U,F=!1;this.logger.time=c;for(var z=0;z ("+r([E,U])+")"),p=this.parseCmd(E,U),p||(p=this.parseMidrow(E,U)),p||(p=this.parsePAC(E,U)),p||(p=this.parseBackgroundAttributes(E,U)),!p&&(F=this.parseChars(E,U),F)){var G=this.currentChannel;if(G&&G>0){var B=this.channels[G];B.insertChars(F)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!F&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+r([E,U])+" orig: "+r([v[z],v[z+1]]))}},y.parseCmd=function(c,v){var p=this.cmdHistory,E=(c===20||c===28||c===21||c===29)&&v>=32&&v<=47,U=(c===23||c===31)&&v>=33&&v<=35;if(!(E||U))return!1;if(O(c,v,p))return x(null,null,p),this.logger.log(d.DEBUG,"Repeated command ("+r([c,v])+") is dropped"),!0;var F=c===20||c===21||c===23?1:2,z=this.channels[F];return c===20||c===21||c===28||c===29?v===32?z.ccRCL():v===33?z.ccBS():v===34?z.ccAOF():v===35?z.ccAON():v===36?z.ccDER():v===37?z.ccRU(2):v===38?z.ccRU(3):v===39?z.ccRU(4):v===40?z.ccFON():v===41?z.ccRDC():v===42?z.ccTR():v===43?z.ccRTD():v===44?z.ccEDM():v===45?z.ccCR():v===46?z.ccENM():v===47&&z.ccEOC():z.ccTO(v-32),x(c,v,p),this.currentChannel=F,!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 ("+r([c,v])+")"),!0):!1}return!1},y.parsePAC=function(c,v){var p,E=this.cmdHistory,U=(c>=17&&c<=23||c>=25&&c<=31)&&v>=64&&v<=127,F=(c===16||c===24)&&v>=64&&v<=95;if(!(U||F))return!1;if(O(c,v,E))return x(null,null,E),!0;var z=c<=23?1:2;v>=64&&v<=95?p=z===1?k[c]:b[c]:p=z===1?D[c]:m[c];var G=this.channels[z];return G?(G.setPAC(this.interpretPAC(p,v)),x(c,v,E),this.currentChannel=z,!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,U=null;if(c>=25?(p=2,U=c-8):(p=1,U=c),U>=17&&U<=19){var F;U===17?F=v+80:U===18?F=v+112:F=v+144,this.logger.log(d.INFO,"Special char '"+M(F)+"' in channel "+p),E=[F]}else c>=32&&c<=127&&(E=v===0?[c]:[c,v]);if(E){var z=r(E);this.logger.log(d.DEBUG,"Char codes = "+z.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 U,F={};c===16||c===24?(U=Math.floor((v-32)/2),F.background=f[U],v%2===1&&(F.background=F.background+"_semi")):v===45?F.background="transparent":(F.foreground="black",v===47&&(F.underline=!0));var z=c<=23?1:2,G=this.channels[z];return G.setBkgData(F),x(c,v,this.cmdHistory),!0},y.reset=function(){for(var c=0;c=16?o--:o++;var x=Object(K.fixLineBreaks)(a.trim()),O=Object(A.generateCueId)(b,m,x);(!D||!D.cues||!D.cues.getCueById(O))&&(r=new n(b,m,x),r.id=O,r.line=R+1,r.align="left",r.position=10+Math.min(80,Math.floor(o*8/32)*10),d.push(r))}return D&&d.length&&(d.sort(function(C,_){return C.line==="auto"||_.line==="auto"?0:C.line>8&&_.line>8?_.line-C.line:C.line-_.line}),d.forEach(function(C){return Object(M.addCueToTrack)(D,C)})),d}};Y.default=P},"./src/utils/discontinuities.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"findFirstFragWithCC",function(){return H}),N.d(Y,"shouldAlignOnDiscontinuities",function(){return P}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return k}),N.d(Y,"adjustSlidingStart",function(){return b}),N.d(Y,"alignStream",function(){return m}),N.d(Y,"alignPDT",function(){return d}),N.d(Y,"alignFragmentByPDTDelta",function(){return s}),N.d(Y,"alignMediaPlaylistByPDT",function(){return r});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/logger.ts"),M=N("./src/controller/level-helper.ts");function H(u,o){for(var a=null,n=0,R=u.length;na.startCC||u&&u.cc=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},M}();Y.default=A},"./src/utils/ewma.ts":function(te,Y,N){"use strict";N.r(Y);var K=function(){function A(H,P,k){P===void 0&&(P=0),k===void 0&&(k=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=P,this.totalWeight_=k}var M=A.prototype;return M.sample=function(P,k){var D=Math.pow(this.alpha_,P);this.estimate_=k*(1-D)+D*this.estimate_,this.totalWeight_+=P},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var P=1-Math.pow(this.alpha_,this.totalWeight_);if(P)return this.estimate_/P}return this.estimate_},A}();Y.default=K},"./src/utils/fetch-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"fetchSupported",function(){return s});var K=N("./src/polyfills/number.ts"),A=N("./src/loader/load-stats.ts"),M=N("./src/demux/chunk-cache.ts");function H(n,R){n.prototype=Object.create(R.prototype),n.prototype.constructor=n,m(n,R)}function P(n){var R=typeof Map=="function"?new Map:void 0;return P=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 R!="undefined"){if(R.has(x))return R.get(x);R.set(x,O)}function O(){return k(x,arguments,f(this).constructor)}return O.prototype=Object.create(x.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),m(O,x)},P(n)}function k(n,R,w){return D()?k=Reflect.construct:k=function(O,C,_){var y=[null];y.push.apply(y,C);var h=Function.bind.apply(O,y),c=new h;return _&&m(c,_.prototype),c},k.apply(null,arguments)}function D(){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,R){return m=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},m(n,R)}function f(n){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},f(n)}function d(){return d=Object.assign||function(n){for(var R=1;R=_&&y(O,C,h.flush(),x)):y(O,C,U,x),p()}).catch(function(){return Promise.reject()})};return v()},n}();function u(n,R){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(d({},n.headers))};return n.rangeEnd&&w.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),w}function o(n,R){return new self.Request(n.url,R)}var a=function(n){H(R,n);function R(w,x,O){var C;return C=n.call(this,w)||this,C.code=void 0,C.details=void 0,C.code=x,C.details=O,C}return R}(P(Error));Y.default=r},"./src/utils/imsc1-ttml-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return b}),N.d(Y,"parseIMSC1",function(){return s});var K=N("./src/utils/mp4-tools.ts"),A=N("./src/utils/vttparser.ts"),M=N("./src/utils/vttcue.ts"),H=N("./src/demux/id3.ts"),P=N("./src/utils/timescale-conversion.ts"),k=N("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(_){for(var y=1;y"):K}function P(b){for(var m=arguments.length,f=new Array(m>1?m-1:0),d=1;d>24,R[w+1]=x>>16&255,R[w+2]=x>>8&255,R[w+3]=x&255}function m(R,w){var x=[];if(!w.length)return x;var O,C,_;"data"in R?(O=R.data,C=R.start,_=R.end):(O=R,C=0,_=O.byteLength);for(var y=C;y<_;){var h=D(O,y),c=P(O.subarray(y+4,y+8)),v=h>1?y+h:_;if(c===w[0])if(w.length===1)x.push({data:O,start:y+8,end:v});else{var p=m({data:O,start:y+8,end:v},w.slice(1));p.length&&H.apply(x,p)}y=v}return x}function f(R){var w=m(R,["moov"]),x=w[0],O=x?x.end:null,C=m(R,["sidx"]);if(!C||!C[0])return null;var _=[],y=C[0],h=y.data[0],c=h===0?8:16,v=D(y,c);c+=4;var p=0,E=0;h===0?c+=8:c+=16,c+=2;var U=y.end+E,F=k(y,c);c+=2;for(var z=0;z>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=D(y,G);G+=4,_.push({referenceSize:T,subsegmentDuration:Z,info:{duration:Z/v,start:U,end:U+T-1}}),U+=T,G+=4,c=G}return{earliestPresentationTime:p,timescale:v,version:h,referencesCount:F,references:_,moovEndOffset:O}}function d(R){for(var w=[],x=m(R,["moov","trak"]),O=0;OP)&&(this.startTime=P),this.endTime=k,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},A}()},"./src/utils/texttrack-utils.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"sendAddTrackEvent",function(){return A}),N.d(Y,"addCueToTrack",function(){return M}),N.d(Y,"clearCurrentCues",function(){return H}),N.d(Y,"removeCuesInRange",function(){return P}),N.d(Y,"getCuesInRange",function(){return D});var K=N("./src/utils/logger.ts");function A(b,m){var f;try{f=new Event("addtrack")}catch(d){f=document.createEvent("Event"),f.initEvent("addtrack",!1,!1)}f.track=b,m.dispatchEvent(f)}function M(b,m){var f=b.mode;if(f==="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(s){K.logger.debug("[texttrack-utils]: "+s);var d=new self.TextTrackCue(m.startTime,m.endTime,m.text);d.id=m.id,b.addCue(d)}f==="disabled"&&(b.mode=f)}function H(b){var m=b.mode;if(m==="disabled"&&(b.mode="hidden"),b.cues)for(var f=b.cues.length;f--;)b.removeCue(b.cues[f]);m==="disabled"&&(b.mode=m)}function P(b,m,f){var d=b.mode;if(d==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var s=D(b.cues,m,f),r=0;rb[f].endTime)return-1;for(var d=0,s=f;d<=s;){var r=Math.floor((s+d)/2);if(mb[r].startTime&&d-1)for(var r=s,u=b.length;r=m&&o.endTime<=f)d.push(o);else if(o.startTime>f)return d}return d}},"./src/utils/time-ranges.ts":function(te,Y,N){"use strict";N.r(Y);var K={toString:function(M){for(var H="",P=M.length,k=0;k1?m-1:0),d=1;d100)throw new Error("Position must be between 0 and 100.");_=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",k({},s,{get:function(){return y},set:function(p){var E=P(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");y=E,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",k({},s,{get:function(){return h},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");h=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",k({},s,{get:function(){return c},set:function(p){var E=P(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");c=E,this.hasBeenReset=!0}})),d.displayState=void 0}return D.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"parseTimeStamp",function(){return M}),N.d(Y,"fixLineBreaks",function(){return m}),N.d(Y,"VTTParser",function(){return f});var K=N("./src/utils/vttcue.ts"),A=function(){function d(){}var s=d.prototype;return s.decode=function(u,o){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},d}();function M(d){function s(u,o,a,n){return(u|0)*3600+(o|0)*60+(a|0)+parseFloat(n||0)}var r=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?s(r[2],r[3],0,r[4]):s(r[1],r[2],r[3],r[4]):null}var H=function(){function d(){this.values=Object.create(null)}var s=d.prototype;return s.set=function(u,o){!this.get(u)&&o!==""&&(this.values[u]=o)},s.get=function(u,o,a){return a?this.has(u)?this.values[u]:o[a]:this.has(u)?this.values[u]:o},s.has=function(u){return u in this.values},s.alt=function(u,o,a){for(var n=0;n=0&&a<=100)return this.set(u,a),!0}return!1},d}();function P(d,s,r,u){var o=u?d.split(u):[d];for(var a in o){if(typeof o[a]!="string")continue;var n=o[a].split(r);if(n.length!==2)continue;var R=n[0],w=n[1];s(R,w)}}var k=new K.default(0,0,""),D=k.align==="middle"?"middle":"center";function b(d,s,r){var u=d;function o(){var R=M(d);if(R===null)throw new Error("Malformed timestamp: "+u);return d=d.replace(/^[^\sa-zA-Z-]+/,""),R}function a(R,w){var x=new H;P(R,function(_,y){var h;switch(_){case"region":for(var c=r.length-1;c>=0;c--)if(r[c].id===y){x.set(_,r[c].region);break}break;case"vertical":x.alt(_,y,["rl","lr"]);break;case"line":h=y.split(","),x.integer(_,h[0]),x.percent(_,h[0])&&x.set("snapToLines",!1),x.alt(_,h[0],["auto"]),h.length===2&&x.alt("lineAlign",h[1],["start",D,"end"]);break;case"position":h=y.split(","),x.percent(_,h[0]),h.length===2&&x.alt("positionAlign",h[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":x.percent(_,y);break;case"align":x.alt(_,y,["start",D,"end","left","right"]);break}},/:/,/\s/),w.region=x.get("region",null),w.vertical=x.get("vertical","");var O=x.get("line","auto");O==="auto"&&k.line===-1&&(O=-1),w.line=O,w.lineAlign=x.get("lineAlign","start"),w.snapToLines=x.get("snapToLines",!0),w.size=x.get("size",100),w.align=x.get("align",D);var C=x.get("position","auto");C==="auto"&&k.position===50&&(C=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=C}function n(){d=d.replace(/^\s+/,"")}if(n(),s.startTime=o(),n(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);d=d.substr(3),n(),s.endTime=o(),n(),a(d,s)}function m(d){return d.replace(//gi,` `)}var f=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new A,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=d.prototype;return s.parse=function(u){var o=this;u&&(o.buffer+=o.decoder.decode(u,{stream:!0}));function a(){var C=o.buffer,_=0;for(C=m(C);_")===-1){o.cue.id=R;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{b(R,o.cue,o.regionList)}catch(C){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var O=R.indexOf("-->")!==-1;if(!R||O&&(x=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=` `),o.cue.text+=R}continue;case"BADCUE":R||(o.state="ID")}}}catch(C){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.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(o){u.onparsingerror&&u.onparsingerror(o)}return u.onflush&&u.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"generateCueId",function(){return f}),N.d(Y,"parseWebVTT",function(){return s});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/vttparser.ts"),M=N("./src/demux/id3.ts"),H=N("./src/utils/timescale-conversion.ts"),P=N("./src/remux/mp4-remuxer.ts"),k=/\r\n|\n\r|\n|\r/g,D=function(u,o,a){return a===void 0&&(a=0),u.substr(a,o.length)===o},b=function(u){var o=parseInt(u.substr(-3)),a=parseInt(u.substr(-6,2)),n=parseInt(u.substr(-9,2)),R=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(K.isFiniteNumber)(o)||!Object(K.isFiniteNumber)(a)||!Object(K.isFiniteNumber)(n)||!Object(K.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return o+=1e3*a,o+=60*1e3*n,o+=60*60*1e3*R,o},m=function(u){for(var o=5381,a=u.length;a;)o=o*33^u.charCodeAt(--a);return(o>>>0).toString()};function f(r,u,o){return m(r.toString())+m(u.toString())+m(o)}var d=function(u,o,a){var n=u[o],R=u[n.prevCC];if(!R||!R.new&&n.new){u.ccOffset=u.presentationOffset=n.start,n.new=!1;return}for(;(w=R)!==null&&w!==void 0&&w.new;){var w;u.ccOffset+=n.start-R.start,n.new=!1,n=R,R=u[n.prevCC]}u.presentationOffset=a};function s(r,u,o,a,n,R,w,x){var O=new A.VTTParser,C=Object(M.utf8ArrayToStr)(new Uint8Array(r)).trim().replace(k,` `).split(` `),_=[],y=Object(H.toMpegTsClockFromTimescale)(u,o),h="00:00.000",c=0,v=0,p,E=!0,U=!1;O.oncue=function(F){var z=a[n],G=a.ccOffset,B=(c-y)/9e4;if(z!=null&&z.new&&(v!==void 0?G=a.ccOffset=z.start:d(a,n,B)),B&&(G=B-a.presentationOffset),U){var T=F.endTime-F.startTime,V=Object(P.normalizePts)((F.startTime+G-v)*9e4,R*9e4)/9e4;F.startTime=V,F.endTime=V+T}var Z=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Z)),F.id||(F.id=f(F.startTime,F.endTime,Z)),F.endTime>0&&_.push(F)},O.onparsingerror=function(F){p=F},O.onflush=function(){if(p){x(p);return}w(_)},C.forEach(function(F){if(E)if(D(F,"X-TIMESTAMP-MAP=")){E=!1,U=!0,F.substr(16).split(",").forEach(function(z){D(z,"LOCAL:")?h=z.substr(6):D(z,"MPEGTS:")&&(c=parseInt(z.substr(7)))});try{v=b(h)/1e3}catch(z){U=!1,p=z}return}else F===""&&(E=!1);O.parse(F+` `)}),O.flush()}},"./src/utils/xhr-loader.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/utils/logger.ts"),A=N("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,H=function(){function P(D){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=D?D.xhrSetup:null,this.stats=new A.LoadStats,this.retryDelay=0}var k=P.prototype;return k.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},k.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()))},k.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},k.load=function(b,m,f){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=f,this.retryDelay=m.retryDelay,this.loadInternal()},k.loadInternal=function(){var b=this.config,m=this.context;if(!b)return;var f=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var s=this.xhrSetup;try{if(s)try{s(f,m.url)}catch(o){f.open("GET",m.url,!0),s(f,m.url)}f.readyState||f.open("GET",m.url,!0);var r=this.context.headers;if(r)for(var u in r)f.setRequestHeader(u,r[u])}catch(o){this.callbacks.onError({code:f.status,text:o.message},m,f);return}m.rangeEnd&&f.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),f.onreadystatechange=this.readystatechange.bind(this),f.onprogress=this.loadprogress.bind(this),f.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),f.send()},k.readystatechange=function(){var b=this.context,m=this.loader,f=this.stats;if(!b||!m)return;var d=m.readyState,s=this.config;if(f.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),f.loading.first===0&&(f.loading.first=Math.max(self.performance.now(),f.loading.start)),d===4){m.onreadystatechange=null,m.onprogress=null;var r=m.status;if(r>=200&&r<300){f.loading.end=Math.max(self.performance.now(),f.loading.first);var u,o;if(b.responseType==="arraybuffer"?(u=m.response,o=u.byteLength):(u=m.responseText,o=u.length),f.loaded=f.total=o,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(f,b,u,m),!this.callbacks)return;var n={url:m.responseURL,data:u};this.callbacks.onSuccess(n,f,b,m)}else f.retry>=s.maxRetry||r>=400&&r<499?(K.logger.error(r+" while loading "+b.url),this.callbacks.onError({code:r,text:m.statusText},b,m)):(K.logger.warn(r+" 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,s.maxRetryDelay),f.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},k.loadtimeout=function(){K.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},k.loadprogress=function(b){var m=this.stats;m.loaded=b.loaded,b.lengthComputable&&(m.total=b.total)},k.getCacheAge=function(){var b=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");b=m?parseFloat(m):null}return b},P}();Y.default=H}}).default})},vHTk:function(tn,Qe,I){tn.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return pn});var te=I("rePB"),Y=I("VTBJ"),N=I("KQm4"),K=I("U8pU"),A=I("ODXe"),M=I("q1tI"),H=I("TSYQ"),P=I.n(H),k=I("Gytx"),D=I.n(k),b=I("Kwbf"),m=I("t23M"),f=I("qx4F"),d=I("6eGT"),s=I("IBYe"),r=I("Ff2n"),u=I("c+Xe"),o=I("fyJ8"),a=I("biw7");function n(He,Ue,pt,Ct,Ge){var vt=pt[He]||{},Ae=pt[Ue]||{},ge,Ee;vt.fixed==="left"?ge=Ct.left[He]:Ae.fixed==="right"&&(Ee=Ct.right[Ue]);var ae=!1,re=!1,he=!1,ve=!1,me=pt[Ue+1],Be=pt[He-1];if(Ge==="rtl"){if(ge!==void 0){var Tt=Be&&Be.fixed==="left";ve=!Tt}else if(Ee!==void 0){var Jt=me&&me.fixed==="right";he=!Jt}}else if(ge!==void 0){var En=me&&me.fixed==="left";ae=!En}else if(Ee!==void 0){var mt=Be&&Be.fixed==="right";re=!mt}return{fixLeft:ge,fixRight:Ee,lastFixLeft:ae,firstFixRight:re,lastFixRight:he,firstFixLeft:ve,isSticky:Ct.isSticky}}var R=I("sR1s");function w(He){var Ue=He.cells,pt=He.stickyOffsets,Ct=He.flattenColumns,Ge=He.rowComponent,vt=He.cellComponent,Ae=He.onHeaderRow,ge=He.index,Ee=M.useContext(a.a),ae=Ee.prefixCls,re=Ee.direction,he;Ae&&(he=Ae(Ue.map(function(me){return me.column}),ge));var ve=Object(R.a)(Ue.map(function(me){return me.column}));return M.createElement(Ge,Object.assign({},he),Ue.map(function(me,Be){var Tt=me.column,Jt=n(me.colStart,me.colEnd,Ct,pt,re),En;return Tt&&Tt.onHeaderCell&&(En=me.column.onHeaderCell(Tt)),M.createElement(o.a,Object.assign({},me,{ellipsis:Tt.ellipsis,align:Tt.align,component:vt,prefixCls:ae,key:ve[Be]},Jt,{additionalProps:En,rowType:"header"}))}))}w.displayName="HeaderRow";var x=w;function O(He){var Ue=[];function pt(Ae,ge){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ue[Ee]=Ue[Ee]||[];var ae=ge,re=Ae.filter(Boolean).map(function(he){var ve={key:he.key,className:he.className||"",children:he.title,column:he,colStart:ae},me=1,Be=he.children;return Be&&Be.length>0&&(me=pt(Be,ae,Ee+1).reduce(function(Tt,Jt){return Tt+Jt},0),ve.hasSubColumns=!0),"colSpan"in he&&(me=he.colSpan),"rowSpan"in he&&(ve.rowSpan=he.rowSpan),ve.colSpan=me,ve.colEnd=ve.colStart+me-1,Ue[Ee].push(ve),ae+=me,me});return re}pt(He,0);for(var Ct=Ue.length,Ge=function(ge){Ue[ge].forEach(function(Ee){!("rowSpan"in Ee)&&!Ee.hasSubColumns&&(Ee.rowSpan=Ct-ge)})},vt=0;vt=0;ge-=1){var Ee=Ue[ge],ae=pt&&pt[ge],re=ae&&ae[y.a];(Ee||re||Ae)&&(Ge.unshift(M.createElement("col",Object.assign({key:ge,style:{width:Ee,minWidth:Ee}},re))),Ae=!0)}return M.createElement("colgroup",null,Ge)}var c=h;function v(He,Ue){return Object(M.useMemo)(function(){for(var pt=[],Ct=0;Ct1?W-1:0),Q=1;Q=he&&(vn=he-ve),Ae({scrollLeft:vn/he*(re+2)}),mt.current.x=_e.pageX},ot=function(){var _e=Object(Ze.b)(vt.current).top,Ne=_e+vt.current.offsetHeight,xt=document.documentElement.scrollTop+window.innerHeight;Ne-Object(f.a)()<=xt||_e>=xt-ge?En(function(Xt){return Object(Y.a)(Object(Y.a)({},Xt),{},{isHiddenScrollBar:!0})}):En(function(Xt){return Object(Y.a)(Object(Y.a)({},Xt),{},{isHiddenScrollBar:!1})})},Yt=function(_e){En(function(Ne){return Object(Y.a)(Object(Y.a)({},Ne),{},{scrollLeft:_e/re*he||0})})};return M.useImperativeHandle(pt,function(){return{setScrollLeft:Yt}}),M.useEffect(function(){var rn=Object(Nt.a)(document.body,"mouseup",ce,!1),_e=Object(Nt.a)(document.body,"mousemove",At,!1);return ot(),function(){rn.remove(),_e.remove()}},[ve,yt]),M.useEffect(function(){var rn=Object(Nt.a)(window,"scroll",ot,!1),_e=Object(Nt.a)(window,"resize",ot,!1);return function(){rn.remove(),_e.remove()}},[]),M.useEffect(function(){Jt.isHiddenScrollBar||En(function(rn){var _e,Ne;return Object(Y.a)(Object(Y.a)({},rn),{},{scrollLeft:vt.current.scrollLeft/((_e=vt.current)===null||_e===void 0?void 0:_e.scrollWidth)*((Ne=vt.current)===null||Ne===void 0?void 0:Ne.clientWidth)})})},[Jt.isHiddenScrollBar]),re<=he||!ve||Jt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(f.a)(),width:he,bottom:ge},className:"".concat(ae,"-sticky-scroll")},M.createElement("div",{onMouseDown:Re,ref:me,className:P()("".concat(ae,"-sticky-scroll-bar"),Object(te.a)({},"".concat(ae,"-sticky-scroll-bar-active"),yt)),style:{width:"".concat(ve,"px"),transform:"translate3d(".concat(Jt.scrollLeft,"px, 0, 0)")}}))},Ut=M.forwardRef(Bt);function Mt(He,Ue){return M.useMemo(function(){var pt=!!He;return{isSticky:pt,stickyClassName:pt?"".concat(Ue,"-sticky-header"):"",offsetHeader:Object(K.a)(He)==="object"&&He.offsetHeader||0,offsetScroll:Object(K.a)(He)==="object"&&He.offsetScroll||0}},[He,Ue])}var An=[],mn={},pn="rc-table-internal-hook",tt=M.memo(function(He){var Ue=He.children;return Ue},function(He,Ue){return D()(He.props,Ue.props)?He.pingLeft!==Ue.pingLeft||He.pingRight!==Ue.pingRight:!1});function fn(He){var Ue,pt=He.prefixCls,Ct=He.className,Ge=He.rowClassName,vt=He.style,Ae=He.data,ge=He.rowKey,Ee=He.scroll,ae=He.tableLayout,re=He.direction,he=He.title,ve=He.footer,me=He.summary,Be=He.id,Tt=He.showHeader,Jt=He.components,En=He.emptyText,mt=He.onRow,Qt=He.onHeaderRow,gt=He.internalHooks,yt=He.transformColumns,rt=He.internalRefs,ce=He.sticky,Re=Ae||An,At=!!Re.length,ot=M.useState(0),Yt=Object(A.a)(ot,2),rn=Yt[0],_e=Yt[1];M.useEffect(function(){_e(Object(f.a)())});var Ne=M.useMemo(function(){return Object(R.c)(Jt,{})},[Jt]),xt=M.useCallback(function(Rn,bn){return Object(R.b)(Ne,Rn)||bn},[Ne]),Xt=M.useMemo(function(){return typeof ge=="function"?ge:function(Rn){var bn=Rn&&Rn[ge];return bn}},[ge]),vn=Object(y.c)(He),Mn=vn.expandIcon,ci=vn.expandedRowKeys,$n=vn.defaultExpandedRowKeys,Cn=vn.defaultExpandAllRows,Ti=vn.expandedRowRender,Wi=vn.onExpand,hi=vn.onExpandedRowsChange,fi=vn.expandRowByClick,ji=vn.rowExpandable,er=vn.expandIconColumnIndex,yr=vn.expandedRowClassName,cn=vn.childrenColumnName,ri=vn.indentSize,pr=Mn||ft,Cr=cn||"children",tr=M.useMemo(function(){return Ti?"row":He.expandable&>===pn&&He.expandable.__PARENT_RENDER_ICON__||Re.some(function(Rn){return Rn&&Object(K.a)(Rn)==="object"&&Rn[Cr]})?"nest":!1},[!!Ti,Re]),nr=M.useState(function(){return $n||(Cn?dt(Re,Xt,Cr):[])}),X=Object(A.a)(nr,2),S=X[0],L=X[1],W=M.useMemo(function(){return new Set(ci||S||[])},[ci,S]),ne=M.useCallback(function(Rn){var bn=Xt(Rn,Re.indexOf(Rn)),Rt,Xe=W.has(bn);Xe?(W.delete(bn),Rt=Object(N.a)(W)):Rt=[].concat(Object(N.a)(W),[bn]),L(Rt),Wi&&Wi(!Xe,Rn),hi&&hi(Rt)},[Xt,W,Re,Wi,hi]),Q=M.useState(0),ke=Object(A.a)(Q,2),Vt=ke[0],kn=ke[1],Qn=Object(Ie.b)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},He),vn),{},{expandable:!!Ti,expandedKeys:W,getRowKey:Xt,onTriggerExpand:ne,expandIcon:pr,expandIconColumnIndex:er,direction:re}),gt===pn?yt:null),nn=Object(A.a)(Qn,2),ti=nn[0],qn=nn[1],Li=M.useMemo(function(){return{columns:ti,flattenColumns:qn}},[ti,qn]),lr=M.useRef(),ar=M.useRef(),Ki=M.useRef(),Pr=M.useState(!1),Vr=Object(A.a)(Pr,2),Ai=Vr[0],wi=Vr[1],ir=M.useState(!1),Fi=Object(A.a)(ir,2),Bn=Fi[0],gn=Fi[1],Tn=be(new Map),_n=Object(A.a)(Tn,2),si=_n[0],ai=_n[1],J=Object(R.a)(qn),ue=J.map(function(Rn){return si.get(Rn)}),Ce=M.useMemo(function(){return ue},[ue.join("_")]),Te=Kt(Ce,qn.length,re),qe=Ee&&Object(R.d)(Ee.y),Oe=Ee&&Object(R.d)(Ee.x),Ve=Oe&&qn.some(function(Rn){var bn=Rn.fixed;return bn}),et=M.useRef(),Ot=Mt(ce,pt),Et=Ot.isSticky,je=Ot.offsetHeader,ht=Ot.offsetScroll,it=Ot.stickyClassName,st,bt,Lt;qe&&(bt={overflowY:"scroll",maxHeight:Ee.y}),Oe&&(st={overflowX:"auto"},qe||(bt={overflowY:"hidden"}),Lt={width:Ee.x===!0?"auto":Ee.x,minWidth:"100%"});var ct=M.useCallback(function(Rn,bn){ai(function(Rt){var Xe=new Map(Rt);return Xe.set(Rn,bn),Xe})},[]),Gt=de(null),on=Object(A.a)(Gt,2),Dn=on[0],Kn=on[1];function wn(Rn,bn){if(!bn)return;typeof bn=="function"?bn(Rn):bn.scrollLeft!==Rn&&(bn.scrollLeft=Rn)}var Nn=function(bn){var Rt=bn.currentTarget,Xe=bn.scrollLeft,kt=typeof Xe=="number"?Xe:Rt.scrollLeft,Pt=Rt||mn;if(!Kn()||Kn()===Pt){var an;Dn(Pt),wn(kt,ar.current),wn(kt,Ki.current),wn(kt,(an=et.current)===null||an===void 0?void 0:an.setScrollLeft)}if(Rt){var zn=Rt.scrollWidth,Ln=Rt.clientWidth;wi(kt>0),gn(kt0?[].concat(Object(Y.a)(r),Object(Y.a)(b(n).map(function(R){return Object(N.a)({fixed:a},R)}))):[].concat(Object(Y.a)(r),[Object(N.a)(Object(N.a)({},u),{},{fixed:a})])},[])}function m(s){for(var r=!0,u=0;u=0;n-=1){var R=s[n];if(a&&R.fixed!=="right")a=!1;else if(!a&&R.fixed==="right"){Object(H.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function f(s){return s.map(function(r){var u=r.fixed,o=Object(K.a)(r,["fixed"]),a=u;return u==="left"?a="right":u==="right"&&(a="left"),Object(N.a)({fixed:a},o)})}function d(s,r){var u=s.prefixCls,o=s.columns,a=s.children,n=s.expandable,R=s.expandedKeys,w=s.getRowKey,x=s.onTriggerExpand,O=s.expandIcon,C=s.rowExpandable,_=s.expandIconColumnIndex,y=s.direction,h=s.expandRowByClick,c=A.useMemo(function(){return o||D(a)},[o,a]),v=A.useMemo(function(){if(n){var U,F=_||0,z=c[F],G=(U={},Object(te.a)(U,k.a,{className:"".concat(u,"-expand-icon-col")}),Object(te.a)(U,"title",""),Object(te.a)(U,"fixed",z?z.fixed:null),Object(te.a)(U,"className","".concat(u,"-row-expand-icon-cell")),Object(te.a)(U,"render",function(V,Z,oe){var pe=w(Z,oe),Ye=R.has(pe),xe=C?C(Z):!0,Ie=O({prefixCls:u,expanded:Ye,expandable:xe,record:Z,onExpand:x});return h?A.createElement("span",{onClick:function(Ke){return Ke.stopPropagation()}},Ie):Ie}),U),B=c.slice();return F>=0&&B.splice(F,0,G),B}return c},[n,c,w,R,O,y]),p=A.useMemo(function(){var U=v;return r&&(U=r(U)),U.length||(U=[{render:function(){return null}}]),U},[r,v,y]),E=A.useMemo(function(){return y==="rtl"?f(b(p)):b(p)},[p,y]);return[p,E]}Qe.b=d},wwSX:function(tn,Qe,I){tn.exports=I.p+"static/b2.2c844a2a.svg"},xOL1:function(tn,Qe){tn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(tn,Qe,I){tn.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(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return b}),I.d(Qe,"b",function(){return f});var te=/margin|padding|width|height|max|min|offset/,Y={left:!0,top:!0},N={cssFloat:1,styleFloat:1,float:1};function K(d){return d.nodeType===1?d.ownerDocument.defaultView.getComputedStyle(d,null):{}}function A(d,s,r){if(s=s.toLowerCase(),r==="auto"){if(s==="height")return d.offsetHeight;if(s==="width")return d.offsetWidth}return s in Y||(Y[s]=te.test(s)),Y[s]?parseFloat(r)||0:r}function M(d,s){var r=arguments.length,u=K(d);return s=N[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,r===1?u:A(d,s,u[s]||d.style[s])}function H(d,s,r){var u=arguments.length;if(s=N[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,u===3)return typeof r=="number"&&te.test(s)&&(r="".concat(r,"px")),d.style[s]=r,r;for(var o in s)s.hasOwnProperty(o)&&H(d,o,s[o]);return K(d)}function P(d){return d===document.body?document.documentElement.clientWidth:d.offsetWidth}function k(d){return d===document.body?window.innerHeight||document.documentElement.clientHeight:d.offsetHeight}function D(){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:d,height:s}}function b(){var d=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:d,height:s}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function f(d){var s=d.getBoundingClientRect(),r=document.documentElement;return{left:s.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||document.body.clientTop||0)}}},"yTi+":function(tn,Qe,I){tn.exports=I.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(tn,Qe,I){tn.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(tn,Qe,I){tn.exports=I.p+"static/b3.30079151.svg"}}]);