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

443 lines
1.6 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[106,3,5,7,8,14],{"+92d":function(Gt,he,D){Gt.exports=D.p+"static/b1.8d46544a.svg"},"+NIl":function(Gt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(V,U){"use strict";function G(u,a){u.cmdState.push(a)}function P(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function k(u){var a=u.cmdState.pop();a&&a.closeBracket()}function K(u){for(var a=u.cmdState,o=a.length-1;o>=0;o--){var c=a[o];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function I(u,a,o){return function(){this.name=u,this.bracketNo=0,this.style=a,this.styles=o,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=I("importmodule","tag",["string","builtin"]),r.documentclass=I("documentclass","tag",["","atom"]),r.usepackage=I("usepackage","tag",["atom"]),r.begin=I("begin","tag",["atom"]),r.end=I("end","tag",["atom"]),r.label=I("label","tag",["atom"]),r.ref=I("ref","tag",["atom"]),r.eqref=I("eqref","tag",["atom"]),r.cite=I("cite","tag",["atom"]),r.bibitem=I("bibitem","tag",["atom"]),r.Bibitem=I("Bibitem","tag",["atom"]),r.RBibitem=I("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function M(u,a){u.f=a}function _(u,a){var o;if(u.match(/^\\[a-zA-Z@]+/)){var c=u.current().slice(1);return o=r.hasOwnProperty(c)?r[c]:r.DEFAULT,o=new o,G(a,o),M(a,m),o.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return M(a,function(i,n){return p(i,n,"\\]")}),"keyword";if(u.match("\\("))return M(a,function(i,n){return p(i,n,"\\)")}),"keyword";if(u.match("$$"))return M(a,function(i,n){return p(i,n,"$$")}),"keyword";if(u.match("$"))return M(a,function(i,n){return p(i,n,"$")}),"keyword";var s=u.next();if(s=="%")return u.skipToEnd(),"comment";if(s=="}"||s=="]"){if(o=P(a),o)o.closeBracket(s),M(a,m);else return"error";return"bracket"}else return s=="{"||s=="["?(o=r.DEFAULT,o=new o,G(a,o),"bracket"):/\d/.test(s)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),o=K(a),o.name=="begin"&&(o.argument=u.current()),o.styleIdentifier())}function p(u,a,o){if(u.eatSpace())return null;if(o&&u.match(o))return M(a,_),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=u.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,a){var o=u.peek(),c;return o=="{"||o=="["?(c=P(a),c.openBracket(o),u.eat(o),M(a,_),"bracket"):/[ \t\r]/.test(o)?(u.eat(o),null):(M(a,_),k(a),_(u,a))}return{startState:function(){var u=U.inMathMode?function(a,o){return p(a,o)}:_;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,a){return a.f(u,a)},blankLine:function(u){u.f=_,u.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(Gt,he,D){},"/cxE":function(Gt,he,D){"use strict";D.d(he,"f",function(){return U}),D.d(he,"g",function(){return G}),D.d(he,"h",function(){return P}),D.d(he,"e",function(){return K}),D.d(he,"b",function(){return I}),D.d(he,"c",function(){return r}),D.d(he,"d",function(){return M}),D.d(he,"a",function(){return _});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
`+p.stack):p},0)}}emit(p){this.listeners.forEach(m=>{m(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const V=new Z;function U(p){K(p)||V.onUnexpectedError(p);return}function G(p){K(p)||V.onUnexpectedExternalError(p);return}function P(p){if(p instanceof Error){let{name:m,message:u}=p;const a=p.stacktrace||p.stack;return{$isError:!0,name:m,message:u,stack:a}}return p}const k="Canceled";function K(p){return p instanceof Error&&p.name===k&&p.message===k}function I(){const p=new Error(k);return p.name=p.message,p}function r(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function M(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class _ extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(Gt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(I,r,M){var _=M&&M!=Z.Init;if(r&&!_)I.on("blur",P),I.on("change",k),I.on("swapDoc",k),Z.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){G(I)}),k(I);else if(!r&&_){I.off("blur",P),I.off("change",k),I.off("swapDoc",k),Z.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),V(I);var p=I.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}r&&!I.hasFocus()&&P(I)});function V(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function U(I){V(I);var r=I.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=I.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var M=I.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),r.appendChild(M),I.display.lineSpace.insertBefore(r,I.display.lineSpace.firstChild)}function G(I){setTimeout(function(){var r=!1,M=I.getInputField();M.nodeName=="TEXTAREA"?r=!M.value:I.lineCount()==1&&(r=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),r?U(I):V(I)},20)}function P(I){K(I)&&U(I)}function k(I){var r=I.getWrapperElement(),M=K(I);r.className=r.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?U(I):V(I)}function K(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1eCo":function(Gt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},U={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(G,P){var k=G.indentUnit,K={},I=P.htmlMode?V:U;for(var r in I)K[r]=I[r];for(var r in P)K[r]=P[r];var M,_;function p(h,y){function g(B){return y.tokenize=B,B(h,y)}var x=h.next();if(x=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?g(a("atom","]]>")):null:h.match("--")?g(a("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),g(o(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),y.tokenize=a("meta","?>"),"meta"):(M=h.eat("/")?"closeTag":"openTag",y.tokenize=m,"tag bracket");if(x=="&"){var j;return h.eat("#")?h.eat("x")?j=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):j=h.eatWhile(/[\d]/)&&h.eat(";"):j=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),j?"atom":"error"}else return h.eatWhile(/[^&<]/),null}p.isInText=!0;function m(h,y){var g=h.next();if(g==">"||g=="/"&&h.eat(">"))return y.tokenize=p,M=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return M="equals",null;if(g=="<"){y.tokenize=p,y.state=n,y.tagName=y.tagStart=null;var x=y.tokenize(h,y);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(g)?(y.tokenize=u(g),y.stringStartCol=h.column(),y.tokenize(h,y)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(h){var y=function(g,x){for(;!g.eol();)if(g.next()==h){x.tokenize=m;break}return"string"};return y.isInAttribute=!0,y}function a(h,y){return function(g,x){for(;!g.eol();){if(g.match(y)){x.tokenize=p;break}g.next()}return h}}function o(h){return function(y,g){for(var x;(x=y.next())!=null;){if(x=="<")return g.tokenize=o(h+1),g.tokenize(y,g);if(x==">")if(h==1){g.tokenize=p;break}else return g.tokenize=o(h-1),g.tokenize(y,g)}return"meta"}}function c(h,y,g){this.prev=h.context,this.tagName=y,this.indent=h.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(y)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function s(h){h.context&&(h.context=h.context.prev)}function i(h,y){for(var g;;){if(!h.context)return;if(g=h.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(y))return;s(h)}}function n(h,y,g){return h=="openTag"?(g.tagStart=y.column(),O):h=="closeTag"?T:n}function O(h,y,g){return h=="word"?(g.tagName=y.current(),_="tag",S):K.allowMissingTagName&&h=="endTag"?(_="tag bracket",S(h,y,g)):(_="error",O)}function T(h,y,g){if(h=="word"){var x=y.current();return g.context&&g.context.tagName!=x&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&s(g),g.context&&g.context.tagName==x||K.matchClosing===!1?(_="tag",C):(_="tag error",R)}else return K.allowMissingTagName&&h=="endTag"?(_="tag bracket",C(h,y,g)):(_="error",R)}function C(h,y,g){return h!="endTag"?(_="error",C):(s(g),n)}function R(h,y,g){return _="error",C(h,y,g)}function S(h,y,g){if(h=="word")return _="attribute",v;if(h=="endTag"||h=="selfcloseTag"){var x=g.tagName,j=g.tagStart;return g.tagName=g.tagStart=null,h=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(x)?i(g,x):(i(g,x),g.context=new c(g,x,j==g.indented)),n}return _="error",S}function v(h,y,g){return h=="equals"?E:(K.allowMissing||(_="error"),S(h,y,g))}function E(h,y,g){return h=="string"?f:h=="word"&&K.allowUnquoted?(_="string",S):(_="error",S(h,y,g))}function f(h,y,g){return h=="string"?f:S(h,y,g)}return{startState:function(h){var y={tokenize:p,state:n,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(y.baseIndent=h),y},token:function(h,y){if(!y.tagName&&h.sol()&&(y.indented=h.indentation()),h.eatSpace())return null;M=null;var g=y.tokenize(h,y);return(g||M)&&g!="comment"&&(_=null,y.state=y.state(M||g,h,y),_&&(g=_=="error"?g+" error":_)),g},indent:function(h,y,g){var x=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+k;if(x&&x.noIndent)return Z.Pass;if(h.tokenize!=m&&h.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(h.tagName)return K.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+k*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(y))return 0;var j=y&&/^<(\/)?([\w_:\.-]*)/.exec(y);if(j&&j[1])for(;x;)if(x.tagName==j[2]){x=x.prev;break}else if(K.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(j)for(;x;){var B=K.contextGrabbers[x.tagName];if(B&&B.hasOwnProperty(j[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+k:h.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(h){h.state==E&&(h.state=S)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var y=[],g=h.context;g;g=g.prev)g.tagName&&y.push(g.tagName);return y.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Gt,he,D){"use strict";D.d(he,"d",function(){return Bt}),D.d(he,"b",function(){return be}),D.d(he,"c",function(){return Ot}),D.d(he,"a",function(){return Dn});var Z=D("VTBJ"),V=D("1OyB"),U=D("vuIU"),G=D("JX7q"),P=D("Ji7U"),k=D("LK+K"),K=D("q1tI"),I=D("I8Z2"),r=D("BGR+"),M=D("wx14"),_=D("rePB"),p=D("4IlW"),m=D("2GS6"),u=D("Gytx"),a=D.n(u),o=D("TSYQ"),c=D.n(o),s=D("U8pU"),i=D("ODXe"),n=/iPhone/i,O=/iPod/i,T=/iPad/i,C=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,S=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,E=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,h=/BlackBerry/i,y=/BB10/i,g=/Opera Mini/i,x=/\b(CriOS|Chrome)(?:.+)Mobile/i,j=/Mobile(?:.+)Firefox\b/i;function B(Qt,Et){return Qt.test(Et)}function A(Qt){var Et=Qt||(typeof navigator!="undefined"?navigator.userAgent:""),Ct=Et.split("[FBAN");if(typeof Ct[1]!="undefined"){var lt=Ct,de=Object(i.a)(lt,1);Et=de[0]}if(Ct=Et.split("Twitter"),typeof Ct[1]!="undefined"){var Ae=Ct,kt=Object(i.a)(Ae,1);Et=kt[0]}var dt={apple:{phone:B(n,Et)&&!B(E,Et),ipod:B(O,Et),tablet:!B(n,Et)&&B(T,Et)&&!B(E,Et),device:(B(n,Et)||B(O,Et)||B(T,Et))&&!B(E,Et)},amazon:{phone:B(S,Et),tablet:!B(S,Et)&&B(v,Et),device:B(S,Et)||B(v,Et)},android:{phone:!B(E,Et)&&B(S,Et)||!B(E,Et)&&B(C,Et),tablet:!B(E,Et)&&!B(S,Et)&&!B(C,Et)&&(B(v,Et)||B(R,Et)),device:!B(E,Et)&&(B(S,Et)||B(v,Et)||B(C,Et)||B(R,Et))||B(/\bokhttp\b/i,Et)},windows:{phone:B(E,Et),tablet:B(f,Et),device:B(E,Et)||B(f,Et)},other:{blackberry:B(h,Et),blackberry10:B(y,Et),opera:B(g,Et),firefox:B(j,Et),chrome:B(x,Et),device:B(h,Et)||B(y,Et)||B(g,Et)||B(j,Et)||B(x,Et)},any:null,phone:null,tablet:null};return dt.any=dt.apple.device||dt.android.device||dt.windows.device||dt.other.device,dt.phone=dt.apple.phone||dt.android.phone||dt.windows.phone,dt.tablet=dt.apple.tablet||dt.android.tablet||dt.windows.tablet,dt}var H=Object(Z.a)(Object(Z.a)({},A()),{},{isMobile:A}),F=H;function w(){}function Y(Qt,Et,Ct){var lt=Et||"";return Qt.key||"".concat(lt,"item_").concat(Ct)}function q(Qt){return"".concat(Qt,"-menu-")}function ie(Qt,Et){var Ct=-1;K.Children.forEach(Qt,function(lt){Ct+=1,lt&&lt.type&&lt.type.isMenuItemGroup?K.Children.forEach(lt.props.children,function(de){Ct+=1,Et(de,Ct)}):Et(lt,Ct)})}function ge(Qt,Et,Ct){if(!Qt||Ct.find)return;K.Children.forEach(Qt,function(lt){if(lt){var de=lt.type;if(!de||!(de.isSubMenu||de.isMenuItem||de.isMenuItemGroup))return;Et.indexOf(lt.key)!==-1?Ct.find=!0:lt.props.children&&ge(lt.props.children,Et,Ct)}})}var Je=["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(Et){var Ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,lt=Et&&typeof Et.getBoundingClientRect=="function"&&Et.getBoundingClientRect().width;if(lt){if(Ct){var de=getComputedStyle(Et),Ae=de.marginLeft,kt=de.marginRight;lt+=+Ae.replace("px","")+ +kt.replace("px","")}lt=+lt.toFixed(6)}return lt||0},ke=function(Et,Ct,lt){Et&&Object(s.a)(Et.style)==="object"&&(Et.style[Ct]=lt)},Qe=function(){return F.any},Ye=D("KQm4"),ve=D("Ff2n"),fe=D("i8i4"),at=D("bdgK"),Jt=D("uciX"),Ft=D("8XRh"),St={adjustX:1,adjustY:1},ze={topLeft:{points:["bl","tl"],overflow:St,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:St,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:St,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:St,offset:[4,0]}},gt={topLeft:{points:["bl","tl"],overflow:St,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:St,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:St,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:St,offset:[4,0]}},ct=ze,jt=0,oe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ne=function(Et,Ct,lt){var de=q(Ct),Ae=Et.getState();Et.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},Ae.defaultActiveFirst),{},Object(_.a)({},de,lt))})},Ge=function(Qt){Object(P.a)(Ct,Qt);var Et=Object(k.a)(Ct);function Ct(lt){var de;Object(V.a)(this,Ct),de=Et.call(this,lt),de.onDestroy=function(Le){de.props.onDestroy(Le)},de.onKeyDown=function(Le){var et=Le.keyCode,mt=de.menuInstance,Ht=de.props,sn=Ht.isOpen,yn=Ht.store;if(et===p.a.ENTER)return de.onTitleClick(Le),Ne(yn,de.props.eventKey,!0),!0;if(et===p.a.RIGHT)return sn?mt.onKeyDown(Le):(de.triggerOpenChange(!0),Ne(yn,de.props.eventKey,!0)),!0;if(et===p.a.LEFT){var nr;if(sn)nr=mt.onKeyDown(Le);else return;return nr||(de.triggerOpenChange(!1),nr=!0),nr}return sn&&(et===p.a.UP||et===p.a.DOWN)?mt.onKeyDown(Le):void 0},de.onOpenChange=function(Le){de.props.onOpenChange(Le)},de.onPopupVisibleChange=function(Le){de.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},de.onMouseEnter=function(Le){var et=de.props,mt=et.eventKey,Ht=et.onMouseEnter,sn=et.store;Ne(sn,de.props.eventKey,!1),Ht({key:mt,domEvent:Le})},de.onMouseLeave=function(Le){var et=de.props,mt=et.parentMenu,Ht=et.eventKey,sn=et.onMouseLeave;mt.subMenuInstance=Object(G.a)(de),sn({key:Ht,domEvent:Le})},de.onTitleMouseEnter=function(Le){var et=de.props,mt=et.eventKey,Ht=et.onItemHover,sn=et.onTitleMouseEnter;Ht({key:mt,hover:!0}),sn({key:mt,domEvent:Le})},de.onTitleMouseLeave=function(Le){var et=de.props,mt=et.parentMenu,Ht=et.eventKey,sn=et.onItemHover,yn=et.onTitleMouseLeave;mt.subMenuInstance=Object(G.a)(de),sn({key:Ht,hover:!1}),yn({key:Ht,domEvent:Le})},de.onTitleClick=function(Le){var et=Object(G.a)(de),mt=et.props;if(mt.onTitleClick({key:mt.eventKey,domEvent:Le}),mt.triggerSubMenuAction==="hover")return;de.triggerOpenChange(!mt.isOpen,"click"),Ne(mt.store,de.props.eventKey,!1)},de.onSubMenuClick=function(Le){typeof de.props.onClick=="function"&&de.props.onClick(de.addKeyPath(Le))},de.onSelect=function(Le){de.props.onSelect(Le)},de.onDeselect=function(Le){de.props.onDeselect(Le)},de.getPrefixCls=function(){return"".concat(de.props.rootPrefixCls,"-submenu")},de.getActiveClassName=function(){return"".concat(de.getPrefixCls(),"-active")},de.getDisabledClassName=function(){return"".concat(de.getPrefixCls(),"-disabled")},de.getSelectedClassName=function(){return"".concat(de.getPrefixCls(),"-selected")},de.getOpenClassName=function(){return"".concat(de.props.rootPrefixCls,"-submenu-open")},de.saveMenuInstance=function(Le){de.menuInstance=Le},de.addKeyPath=function(Le){return Object(Z.a)(Object(Z.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(de.props.eventKey)})},de.triggerOpenChange=function(Le,et){var mt=de.props.eventKey,Ht=function(){de.onOpenChange({key:mt,item:Object(G.a)(de),trigger:et,open:Le})};et==="mouseenter"?de.mouseenterTimeout=setTimeout(function(){Ht()},0):Ht()},de.isChildrenSelected=function(){var Le={find:!1};return ge(de.props.children,de.props.selectedKeys,Le),Le.find},de.isOpen=function(){return de.props.openKeys.indexOf(de.props.eventKey)!==-1},de.adjustWidth=function(){if(!de.subMenuTitle||!de.menuInstance)return;var Le=fe.findDOMNode(de.menuInstance);if(Le.offsetWidth>=de.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(de.subMenuTitle.offsetWidth,"px")},de.saveSubMenuTitle=function(Le){de.subMenuTitle=Le},de.getBaseProps=function(){var Le=Object(G.a)(de),et=Le.props;return{mode:et.mode==="horizontal"?"vertical":et.mode,visible:de.props.isOpen,level:et.level+1,inlineIndent:et.inlineIndent,focusable:!1,onClick:de.onSubMenuClick,onSelect:de.onSelect,onDeselect:de.onDeselect,onDestroy:de.onDestroy,selectedKeys:et.selectedKeys,eventKey:"".concat(et.eventKey,"-menu-"),openKeys:et.openKeys,motion:et.motion,onOpenChange:de.onOpenChange,subMenuOpenDelay:et.subMenuOpenDelay,parentMenu:Object(G.a)(de),subMenuCloseDelay:et.subMenuCloseDelay,forceSubMenuRender:et.forceSubMenuRender,triggerSubMenuAction:et.triggerSubMenuAction,builtinPlacements:et.builtinPlacements,defaultActiveFirst:et.store.getState().defaultActiveFirst[q(et.eventKey)],multiple:et.multiple,prefixCls:et.rootPrefixCls,id:de.internalMenuId,manualRef:de.saveMenuInstance,itemIcon:et.itemIcon,expandIcon:et.expandIcon,direction:et.direction}},de.getMotion=function(Le,et){var mt=Object(G.a)(de),Ht=mt.haveRendered,sn=de.props,yn=sn.motion,nr=sn.rootPrefixCls,Kn=Object(Z.a)(Object(Z.a)({},yn),{},{leavedClassName:"".concat(nr,"-hidden"),removeOnLeave:!1,motionAppear:Ht||!et||Le!=="inline"});return Kn};var Ae=lt.store,kt=lt.eventKey,dt=Ae.getState(),Zt=dt.defaultActiveFirst;de.isRootMenu=!1;var un=!1;return Zt&&(un=Zt[kt]),Ne(Ae,kt,un),de}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var de=this,Ae=this.props,kt=Ae.mode,dt=Ae.parentMenu,Zt=Ae.manualRef;if(Zt&&Zt(this),kt!=="horizontal"||!dt.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return de.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var de=this.props,Ae=de.onDestroy,kt=de.eventKey;Ae&&Ae(kt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(de){var Ae=this,kt=this.getBaseProps(),dt=this.getMotion(kt.mode,kt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||kt.visible||kt.forceSubMenuRender,!this.haveOpened)return K.createElement("div",null);var Zt=kt.direction;return K.createElement(Ft.default,Object.assign({visible:kt.visible},dt),function(un){var Le=un.className,et=un.style,mt=c()("".concat(kt.prefixCls,"-sub"),Le,Object(_.a)({},"".concat(kt.prefixCls,"-rtl"),Zt==="rtl"));return K.createElement(De,Object.assign({},kt,{id:Ae.internalMenuId,className:mt,style:et}),de)})}},{key:"render",value:function(){var de,Ae=Object(Z.a)({},this.props),kt=Ae.isOpen,dt=this.getPrefixCls(),Zt=Ae.mode==="inline",un=c()(dt,"".concat(dt,"-").concat(Ae.mode),(de={},Object(_.a)(de,Ae.className,!!Ae.className),Object(_.a)(de,this.getOpenClassName(),kt),Object(_.a)(de,this.getActiveClassName(),Ae.active||kt&&!Zt),Object(_.a)(de,this.getDisabledClassName(),Ae.disabled),Object(_.a)(de,this.getSelectedClassName(),this.isChildrenSelected()),de));this.internalMenuId||(Ae.eventKey?this.internalMenuId="".concat(Ae.eventKey,"$Menu"):(jt+=1,this.internalMenuId="$__$".concat(jt,"$Menu")));var Le={},et={},mt={};Ae.disabled||(Le={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},et={onClick:this.onTitleClick},mt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ht={},sn=Ae.direction;Zt&&(sn==="rtl"?Ht.paddingRight=Ae.inlineIndent*Ae.level:Ht.paddingLeft=Ae.inlineIndent*Ae.level);var yn={};this.props.isOpen&&(yn={"aria-owns":this.internalMenuId});var nr=null;Ae.mode!=="horizontal"&&(nr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(nr=K.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Kn=K.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Ht,className:"".concat(dt,"-title"),role:"button"},mt,et,{"aria-expanded":kt},yn,{"aria-haspopup":"true",title:typeof Ae.title=="string"?Ae.title:void 0}),Ae.title,nr||K.createElement("i",{className:"".concat(dt,"-arrow")})),Cn=this.renderChildren(Ae.children),br=Ae.parentMenu.isRootMenu?Ae.parentMenu.props.getPopupContainer:function(ti){return ti.parentNode},Er=oe[Ae.mode],rr=Ae.popupOffset?{offset:Ae.popupOffset}:{},cr=Ae.mode==="inline"?"":Ae.popupClassName;cr+=sn==="rtl"?" ".concat(dt,"-rtl"):"";var Pr=Ae.disabled,Kr=Ae.triggerSubMenuAction,hi=Ae.subMenuOpenDelay,pn=Ae.forceSubMenuRender,or=Ae.subMenuCloseDelay,mi=Ae.builtinPlacements;Je.forEach(function(ti){return delete Ae[ti]}),delete Ae.onClick;var wi=sn==="rtl"?Object.assign({},gt,mi):Object.assign({},ze,mi);return delete Ae.direction,K.createElement("li",Object.assign({},Ae,Le,{className:un,role:"menuitem"}),Zt&&Kn,Zt&&Cn,!Zt&&K.createElement(Jt.a,{prefixCls:dt,popupClassName:c()("".concat(dt,"-popup"),cr),getPopupContainer:br,builtinPlacements:wi,popupPlacement:Er,popupVisible:kt,popupAlign:rr,popup:Cn,action:Pr?[]:[Kr],mouseEnterDelay:hi,mouseLeaveDelay:or,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:pn},Kn))}}]),Ct}(K.Component);Ge.defaultProps={onMouseEnter:w,onMouseLeave:w,onTitleMouseEnter:w,onTitleMouseLeave:w,onTitleClick:w,manualRef:w,mode:"vertical",title:""};var Xe=Object(I.b)(function(Qt,Et){var Ct=Qt.openKeys,lt=Qt.activeKey,de=Qt.selectedKeys,Ae=Et.eventKey,kt=Et.subMenuKey;return{isOpen:Ct.indexOf(Ae)>-1,active:lt[kt]===Ae,selectedKeys:de}})(Ge);Xe.isSubMenu=!0;var Bt=Xe,Wt="menuitem-overflowed",en=.5,tt=function(Qt){Object(P.a)(Ct,Qt);var Et=Object(k.a)(Ct);function Ct(){var lt;return Object(V.a)(this,Ct),lt=Et.apply(this,arguments),lt.resizeObserver=null,lt.mutationObserver=null,lt.originalTotalWidth=0,lt.overflowedItems=[],lt.menuItemSizes=[],lt.cancelFrameId=null,lt.state={lastVisibleIndex:void 0},lt.getMenuItemNodes=function(){var de=lt.props.prefixCls,Ae=fe.findDOMNode(Object(G.a)(lt));return Ae?[].slice.call(Ae.children).filter(function(kt){return kt.className.split(" ").indexOf("".concat(de,"-overflowed-submenu"))<0}):[]},lt.getOverflowedSubMenuItem=function(de,Ae,kt){var dt=lt.props,Zt=dt.overflowedIndicator,un=dt.level,Le=dt.mode,et=dt.prefixCls,mt=dt.theme;if(un!==1||Le!=="horizontal")return null;var Ht=lt.props.children[0],sn=Ht.props,yn=sn.children,nr=sn.title,Kn=sn.style,Cn=Object(ve.a)(sn,["children","title","style"]),br=Object(Z.a)({},Kn),Er="".concat(de,"-overflowed-indicator"),rr="".concat(de,"-overflowed-indicator");Ae.length===0&&kt!==!0?br=Object(Z.a)(Object(Z.a)({},br),{},{display:"none"}):kt&&(br=Object(Z.a)(Object(Z.a)({},br),{},{visibility:"hidden",position:"absolute"}),Er="".concat(Er,"-placeholder"),rr="".concat(rr,"-placeholder"));var cr=mt?"".concat(et,"-").concat(mt):"",Pr={};return Je.forEach(function(Kr){Cn[Kr]!==void 0&&(Pr[Kr]=Cn[Kr])}),K.createElement(Bt,Object.assign({title:Zt,className:"".concat(et,"-overflowed-submenu"),popupClassName:cr},Pr,{key:Er,eventKey:rr,disabled:!1,style:br}),Ae)},lt.setChildrenWidthAndResize=function(){if(lt.props.mode!=="horizontal")return;var de=fe.findDOMNode(Object(G.a)(lt));if(!de)return;var Ae=de.children;if(!Ae||Ae.length===0)return;var kt=de.children[Ae.length-1];ke(kt,"display","inline-block");var dt=lt.getMenuItemNodes(),Zt=dt.filter(function(un){return un.className.split(" ").indexOf(Wt)>=0});Zt.forEach(function(un){ke(un,"display","inline-block")}),lt.menuItemSizes=dt.map(function(un){return xe(un,!0)}),Zt.forEach(function(un){ke(un,"display","none")}),lt.overflowedIndicatorWidth=xe(de.children[de.children.length-1],!0),lt.originalTotalWidth=lt.menuItemSizes.reduce(function(un,Le){return un+Le},0),lt.handleResize(),ke(kt,"display","none")},lt.handleResize=function(){if(lt.props.mode!=="horizontal")return;var de=fe.findDOMNode(Object(G.a)(lt));if(!de)return;var Ae=xe(de);lt.overflowedItems=[];var kt=0,dt;lt.originalTotalWidth>Ae+en&&(dt=-1,lt.menuItemSizes.forEach(function(Zt){kt+=Zt,kt+lt.overflowedIndicatorWidth<=Ae&&(dt+=1)})),lt.setState({lastVisibleIndex:dt})},lt}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){var de=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ae=fe.findDOMNode(this);if(!Ae)return;this.resizeObserver=new at.default(function(kt){kt.forEach(function(){var dt=de.cancelFrameId;cancelAnimationFrame(dt),de.cancelFrameId=requestAnimationFrame(de.setChildrenWidthAndResize)})}),[].slice.call(Ae.children).concat(Ae).forEach(function(kt){de.resizeObserver.observe(kt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){de.resizeObserver.disconnect(),[].slice.call(Ae.children).concat(Ae).forEach(function(kt){de.resizeObserver.observe(kt)}),de.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ae,{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(de){var Ae=this,kt=this.state.lastVisibleIndex;return(de||[]).reduce(function(dt,Zt,un){var Le=Zt;if(Ae.props.mode==="horizontal"){var et=Ae.getOverflowedSubMenuItem(Zt.props.eventKey,[]);kt!==void 0&&Ae.props.className.indexOf("".concat(Ae.props.prefixCls,"-root"))!==-1&&(un>kt&&(Le=K.cloneElement(Zt,{style:{display:"none"},eventKey:"".concat(Zt.props.eventKey,"-hidden"),className:"".concat(Wt)})),un===kt+1&&(Ae.overflowedItems=de.slice(kt+1).map(function(Ht){return K.cloneElement(Ht,{key:Ht.props.eventKey,mode:"vertical-left"})}),et=Ae.getOverflowedSubMenuItem(Zt.props.eventKey,Ae.overflowedItems)));var mt=[].concat(Object(Ye.a)(dt),[et,Le]);return un===de.length-1&&mt.push(Ae.getOverflowedSubMenuItem(Zt.props.eventKey,[],!0)),mt}return[].concat(Object(Ye.a)(dt),[Le])},[])}},{key:"render",value:function(){var de=this.props,Ae=de.visible,kt=de.prefixCls,dt=de.overflowedIndicator,Zt=de.mode,un=de.level,Le=de.tag,et=de.children,mt=de.theme,Ht=Object(ve.a)(de,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),sn=Le;return K.createElement(sn,Object.assign({},Ht),this.renderChildren(et))}}]),Ct}(K.Component);tt.defaultProps={tag:"div",className:""};var tn=tt;function En(Qt){return Qt.length?Qt.every(function(Et){return!!Et.props.disabled}):!0}function We(Qt,Et,Ct){var lt=Qt.getState();Qt.setState({activeKey:Object(Z.a)(Object(Z.a)({},lt.activeKey),{},Object(_.a)({},Et,Ct))})}function Fe(Qt){return Qt.eventKey||"0-menu-"}function yt(Qt,Et){var Ct=Et,lt=Qt.children,de=Qt.eventKey;if(Ct){var Ae;if(ie(lt,function(kt,dt){kt&&kt.props&&!kt.props.disabled&&Ct===Y(kt,de,dt)&&(Ae=!0)}),Ae)return Ct}return Ct=null,Qt.defaultActiveFirst&&ie(lt,function(kt,dt){!Ct&&kt&&!kt.props.disabled&&(Ct=Y(kt,de,dt))}),Ct}function At(Qt){if(Qt){var Et=this.instanceArray.indexOf(Qt);Et!==-1?this.instanceArray[Et]=Qt:this.instanceArray.push(Qt)}}var nt=function(Qt){Object(P.a)(Ct,Qt);var Et=Object(k.a)(Ct);function Ct(lt){var de;return Object(V.a)(this,Ct),de=Et.call(this,lt),de.onKeyDown=function(Ae,kt){var dt=Ae.keyCode,Zt;if(de.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(Zt=Le.onKeyDown(Ae))}),Zt)return 1;var un=null;return(dt===p.a.UP||dt===p.a.DOWN)&&(un=de.step(dt===p.a.UP?-1:1)),un?(Ae.preventDefault(),We(de.props.store,Fe(de.props),un.props.eventKey),typeof kt=="function"&&kt(un),1):void 0},de.onItemHover=function(Ae){var kt=Ae.key,dt=Ae.hover;We(de.props.store,Fe(de.props),dt?kt:null)},de.onDeselect=function(Ae){de.props.onDeselect(Ae)},de.onSelect=function(Ae){de.props.onSelect(Ae)},de.onClick=function(Ae){de.props.onClick(Ae)},de.onOpenChange=function(Ae){de.props.onOpenChange(Ae)},de.onDestroy=function(Ae){de.props.onDestroy(Ae)},de.getFlatInstanceArray=function(){return de.instanceArray},de.step=function(Ae){var kt=de.getFlatInstanceArray(),dt=de.props.store.getState().activeKey[Fe(de.props)],Zt=kt.length;if(!Zt)return null;Ae<0&&(kt=kt.concat().reverse());var un=-1;if(kt.every(function(Ht,sn){return Ht&&Ht.props.eventKey===dt?(un=sn,!1):!0}),!de.props.defaultActiveFirst&&un!==-1&&En(kt.slice(un,Zt-1)))return;var Le=(un+1)%Zt,et=Le;do{var mt=kt[et];if(!mt||mt.props.disabled)et=(et+1)%Zt;else return mt}while(et!==Le);return null},de.renderCommonMenuItem=function(Ae,kt,dt){var Zt=de.props.store.getState(),un=Object(G.a)(de),Le=un.props,et=Y(Ae,Le.eventKey,kt),mt=Ae.props;if(!mt||typeof Ae.type=="string")return Ae;var Ht=et===Zt.activeKey,sn=Object(Z.a)(Object(Z.a)({mode:mt.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:de.renderMenuItem,rootPrefixCls:Le.prefixCls,index:kt,parentMenu:Le.parentMenu,manualRef:mt.disabled?void 0:Object(m.a)(Ae.ref,At.bind(Object(G.a)(de))),eventKey:et,active:!mt.disabled&&Ht,multiple:Le.multiple,onClick:function(nr){(mt.onClick||w)(nr),de.onClick(nr)},onItemHover:de.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:de.onOpenChange,onDeselect:de.onDeselect,onSelect:de.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:mt.itemIcon||de.props.itemIcon,expandIcon:mt.expandIcon||de.props.expandIcon},dt),{},{direction:Le.direction});return(Le.mode==="inline"||Qe())&&(sn.triggerSubMenuAction="click"),K.cloneElement(Ae,sn)},de.renderMenuItem=function(Ae,kt,dt){if(!Ae)return null;var Zt=de.props.store.getState(),un={openKeys:Zt.openKeys,selectedKeys:Zt.selectedKeys,triggerSubMenuAction:de.props.triggerSubMenuAction,subMenuKey:dt};return de.renderCommonMenuItem(Ae,kt,un)},lt.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},lt.store.getState().activeKey),{},Object(_.a)({},lt.eventKey,yt(lt,lt.activeKey)))}),de.instanceArray=[],de}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(de){return this.props.visible||de.visible||this.props.className!==de.className||!a()(this.props.style,de.style)}},{key:"componentDidUpdate",value:function(de){var Ae=this.props,kt="activeKey"in Ae?Ae.activeKey:Ae.store.getState().activeKey[Fe(Ae)],dt=yt(Ae,kt);if(dt!==kt)We(Ae.store,Fe(Ae),dt);else if("activeKey"in de){var Zt=yt(de,de.activeKey);dt!==Zt&&We(Ae.store,Fe(Ae),dt)}}},{key:"render",value:function(){var de=this,Ae=Object(M.a)({},this.props);this.instanceArray=[];var kt=c()(Ae.prefixCls,Ae.className,"".concat(Ae.prefixCls,"-").concat(Ae.mode)),dt={className:kt,role:Ae.role||"menu"};Ae.id&&(dt.id=Ae.id),Ae.focusable&&(dt.tabIndex=0,dt.onKeyDown=this.onKeyDown);var Zt=Ae.prefixCls,un=Ae.eventKey,Le=Ae.visible,et=Ae.level,mt=Ae.mode,Ht=Ae.overflowedIndicator,sn=Ae.theme;return Je.forEach(function(yn){return delete Ae[yn]}),delete Ae.onClick,K.createElement(tn,Object.assign({},Ae,{prefixCls:Zt,mode:mt,tag:"ul",level:et,theme:sn,visible:Le,overflowedIndicator:Ht},dt),K.Children.map(Ae.children,function(yn,nr){return de.renderMenuItem(yn,nr,un||"0-menu-")}))}}]),Ct}(K.Component);nt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:w};var st=Object(I.b)()(nt),De=st,ye=D("Kwbf");function we(Qt,Et,Ct){var lt=Qt.prefixCls,de=Qt.motion,Ae=Qt.defaultMotions,kt=Ae===void 0?{}:Ae,dt=Qt.openAnimation,Zt=Qt.openTransitionName,un=Et.switchingModeFromInline;if(de)return de;if(Object(s.a)(dt)==="object"&&dt)Object(ye.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof dt=="string")return{motionName:"".concat(lt,"-open-").concat(dt)};if(Zt)return{motionName:Zt};var Le=kt[Ct];return Le||(un?null:kt.other)}var ae=function(Qt){Object(P.a)(Ct,Qt);var Et=Object(k.a)(Ct);function Ct(lt){var de;Object(V.a)(this,Ct),de=Et.call(this,lt),de.inlineOpenKeys=[],de.onSelect=function(dt){var Zt=Object(G.a)(de),un=Zt.props;if(un.selectable){var Le=de.store.getState(),et=Le.selectedKeys,mt=dt.key;un.multiple?et=et.concat([mt]):et=[mt],"selectedKeys"in un||de.store.setState({selectedKeys:et}),un.onSelect(Object(Z.a)(Object(Z.a)({},dt),{},{selectedKeys:et}))}},de.onClick=function(dt){var Zt=de.getRealMenuMode(),un=Object(G.a)(de),Le=un.store,et=un.props.onOpenChange;Zt!=="inline"&&!("openKeys"in de.props)&&(Le.setState({openKeys:[]}),et([])),de.props.onClick(dt)},de.onKeyDown=function(dt,Zt){de.innerMenu.getWrappedInstance().onKeyDown(dt,Zt)},de.onOpenChange=function(dt){var Zt=Object(G.a)(de),un=Zt.props,Le=de.store.getState().openKeys.concat(),et=!1,mt=function(sn){var yn=!1;if(sn.open)yn=Le.indexOf(sn.key)===-1,yn&&Le.push(sn.key);else{var nr=Le.indexOf(sn.key);yn=nr!==-1,yn&&Le.splice(nr,1)}et=et||yn};Array.isArray(dt)?dt.forEach(mt):mt(dt),et&&("openKeys"in de.props||de.store.setState({openKeys:Le}),un.onOpenChange(Le))},de.onDeselect=function(dt){var Zt=Object(G.a)(de),un=Zt.props;if(un.selectable){var Le=de.store.getState().selectedKeys.concat(),et=dt.key,mt=Le.indexOf(et);mt!==-1&&Le.splice(mt,1),"selectedKeys"in un||de.store.setState({selectedKeys:Le}),un.onDeselect(Object(Z.a)(Object(Z.a)({},dt),{},{selectedKeys:Le}))}},de.onMouseEnter=function(dt){de.restoreModeVerticalFromInline();var Zt=de.props.onMouseEnter;Zt&&Zt(dt)},de.onTransitionEnd=function(dt){var Zt=dt.propertyName==="width"&&dt.target===dt.currentTarget,un=dt.target.className,Le=Object.prototype.toString.call(un)==="[object SVGAnimatedString]"?un.animVal:un,et=dt.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(Zt||et)&&de.restoreModeVerticalFromInline()},de.setInnerMenu=function(dt){de.innerMenu=dt},de.isRootMenu=!0;var Ae=lt.defaultSelectedKeys,kt=lt.defaultOpenKeys;return"selectedKeys"in lt&&(Ae=lt.selectedKeys||[]),"openKeys"in lt&&(kt=lt.openKeys||[]),de.store=Object(I.c)({selectedKeys:Ae,openKeys:kt,activeKey:{"0-menu-":yt(lt,lt.activeKey)}}),de.state={switchingModeFromInline:!1},de}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(de){this.updateOpentKeysWhenSwitchMode(de),this.updateMiniStore();var Ae=this.props,kt=Ae.siderCollapsed,dt=Ae.inlineCollapsed,Zt=Ae.onOpenChange;(!de.inlineCollapsed&&dt||!de.siderCollapsed&&kt)&&Zt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(de){var Ae=this.props,kt=this.store,dt=this.inlineOpenKeys,Zt=kt.getState(),un={};de.mode==="inline"&&Ae.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ae||((Ae.inlineCollapsed&&!de.inlineCollapsed||Ae.siderCollapsed&&!de.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Zt.openKeys.concat(),un.openKeys=[]),(!Ae.inlineCollapsed&&de.inlineCollapsed||!Ae.siderCollapsed&&de.siderCollapsed)&&(un.openKeys=dt,this.inlineOpenKeys=[])),Object.keys(un).length&&kt.setState(un)}},{key:"updateMenuDisplay",value:function(){var de=this.props.collapsedWidth,Ae=this.store,kt=this.prevOpenKeys,dt=this.getInlineCollapsed()&&(de===0||de==="0"||de==="0px");dt?(this.prevOpenKeys=Ae.getState().openKeys.concat(),this.store.setState({openKeys:[]})):kt&&(this.store.setState({openKeys:kt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var de=this.props.mode,Ae=this.state.switchingModeFromInline,kt=this.getInlineCollapsed();return Ae&&kt?"inline":kt?"vertical":de}},{key:"getInlineCollapsed",value:function(){var de=this.props,Ae=de.inlineCollapsed,kt=de.siderCollapsed;return kt!==void 0?kt:Ae}},{key:"restoreModeVerticalFromInline",value:function(){var de=this.state.switchingModeFromInline;de&&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 de=Object(Z.a)({},Object(r.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ae=this.getRealMenuMode();return de.className+=" ".concat(de.prefixCls,"-root"),de.direction==="rtl"&&(de.className+=" ".concat(de.prefixCls,"-rtl")),de=Object(Z.a)(Object(Z.a)({},de),{},{mode:Ae,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:we(this.props,this.state,Ae)}),delete de.openAnimation,delete de.openTransitionName,K.createElement(I.a,{store:this.store},K.createElement(De,Object.assign({},de,{ref:this.setInnerMenu}),this.props.children))}}]),Ct}(K.Component);ae.defaultProps={selectable:!0,onClick:w,onSelect:w,onOpenChange:w,onDeselect:w,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:K.createElement("span",null,"\xB7\xB7\xB7")};var se=ae,pe=function(Qt){Object(P.a)(Ct,Qt);var Et=Object(k.a)(Ct);function Ct(){var lt;return Object(V.a)(this,Ct),lt=Et.apply(this,arguments),lt.onKeyDown=function(de){var Ae=de.keyCode;return Ae===p.a.ENTER?(lt.onClick(de),!0):void 0},lt.onMouseLeave=function(de){var Ae=lt.props,kt=Ae.eventKey,dt=Ae.onItemHover,Zt=Ae.onMouseLeave;dt({key:kt,hover:!1}),Zt({key:kt,domEvent:de})},lt.onMouseEnter=function(de){var Ae=lt.props,kt=Ae.eventKey,dt=Ae.onItemHover,Zt=Ae.onMouseEnter;dt({key:kt,hover:!0}),Zt({key:kt,domEvent:de})},lt.onClick=function(de){var Ae=lt.props,kt=Ae.eventKey,dt=Ae.multiple,Zt=Ae.onClick,un=Ae.onSelect,Le=Ae.onDeselect,et=Ae.isSelected,mt={key:kt,keyPath:[kt],item:Object(G.a)(lt),domEvent:de};Zt(mt),dt?et?Le(mt):un(mt):et||un(mt)},lt.saveNode=function(de){lt.node=de},lt}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var de=this.props;de.onDestroy&&de.onDestroy(de.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 de,Ae=Object(Z.a)({},this.props),kt=c()(this.getPrefixCls(),Ae.className,(de={},Object(_.a)(de,this.getActiveClassName(),!Ae.disabled&&Ae.active),Object(_.a)(de,this.getSelectedClassName(),Ae.isSelected),Object(_.a)(de,this.getDisabledClassName(),Ae.disabled),de)),dt=Object(Z.a)(Object(Z.a)({},Ae.attribute),{},{title:typeof Ae.title=="string"?Ae.title:void 0,className:kt,role:Ae.role||"menuitem","aria-disabled":Ae.disabled});Ae.role==="option"?dt=Object(Z.a)(Object(Z.a)({},dt),{},{role:"option","aria-selected":Ae.isSelected}):(Ae.role===null||Ae.role==="none")&&(dt.role="none");var Zt={onClick:Ae.disabled?null:this.onClick,onMouseLeave:Ae.disabled?null:this.onMouseLeave,onMouseEnter:Ae.disabled?null:this.onMouseEnter},un=Object(Z.a)({},Ae.style);Ae.mode==="inline"&&(Ae.direction==="rtl"?un.paddingRight=Ae.inlineIndent*Ae.level:un.paddingLeft=Ae.inlineIndent*Ae.level),Je.forEach(function(et){return delete Ae[et]}),delete Ae.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=K.createElement(this.props.itemIcon,this.props)),K.createElement("li",Object.assign({},Object(r.default)(Ae,["onClick","onMouseEnter","onMouseLeave","onSelect"]),dt,Zt,{style:un,ref:this.saveNode}),Ae.children,Le)}}]),Ct}(K.Component);pe.isMenuItem=!0,pe.defaultProps={onSelect:w,onMouseEnter:w,onMouseLeave:w,manualRef:w};var _e=Object(I.b)(function(Qt,Et){var Ct=Qt.activeKey,lt=Qt.selectedKeys,de=Et.eventKey,Ae=Et.subMenuKey;return{active:Ct[Ae]===de,isSelected:lt.indexOf(de)!==-1}})(pe),be=_e,Ke=function(Qt){Object(P.a)(Ct,Qt);var Et=Object(k.a)(Ct);function Ct(){var lt;return Object(V.a)(this,Ct),lt=Et.apply(this,arguments),lt.renderInnerMenuItem=function(de){var Ae=lt.props,kt=Ae.renderMenuItem,dt=Ae.index;return kt(de,dt,lt.props.subMenuKey)},lt}return Object(U.a)(Ct,[{key:"render",value:function(){var de=Object(M.a)({},this.props),Ae=de.className,kt=Ae===void 0?"":Ae,dt=de.rootPrefixCls,Zt="".concat(dt,"-item-group-title"),un="".concat(dt,"-item-group-list"),Le=de.title,et=de.children;return Je.forEach(function(mt){return delete de[mt]}),delete de.onClick,delete de.direction,K.createElement("li",Object.assign({},de,{className:"".concat(kt," ").concat(dt,"-item-group")}),K.createElement("div",{className:Zt,title:typeof Le=="string"?Le:void 0},Le),K.createElement("ul",{className:un},K.Children.map(et,this.renderInnerMenuItem)))}}]),Ct}(K.Component);Ke.isMenuItemGroup=!0,Ke.defaultProps={disabled:!0};var Ot=Ke,rn=function(Et){var Ct=Et.className,lt=Et.rootPrefixCls,de=Et.style;return K.createElement("li",{className:"".concat(Ct," ").concat(lt,"-item-divider"),style:de})};rn.defaultProps={disabled:!0,className:"",style:{}};var Dn=rn,bt=he.e=se},"24hK":function(Gt,he,D){"use strict";D.d(he,"a",function(){return V});class Z{constructor(U){this.element=U,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class V{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let U=this._first;for(;U!==Z.Undefined;){const G=U.next;U.prev=Z.Undefined,U.next=Z.Undefined,U=G}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(U){return this._insert(U,!1)}push(U){return this._insert(U,!0)}_insert(U,G){const P=new Z(U);if(this._first===Z.Undefined)this._first=P,this._last=P;else if(G){const K=this._last;this._last=P,P.prev=K,K.next=P}else{const K=this._first;this._first=P,P.next=K,K.prev=P}this._size+=1;let k=!1;return()=>{k||(k=!0,this._remove(P))}}shift(){if(this._first===Z.Undefined)return;{const U=this._first.element;return this._remove(this._first),U}}pop(){if(this._last===Z.Undefined)return;{const U=this._last.element;return this._remove(this._last),U}}_remove(U){if(U.prev!==Z.Undefined&&U.next!==Z.Undefined){const G=U.prev;G.next=U.next,U.next.prev=G}else U.prev===Z.Undefined&&U.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):U.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):U.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let U=this._first;for(;U!==Z.Undefined;)yield U.element,U=U.next}}},"3/fG":function(Gt,he,D){"use strict";D.d(he,"a",function(){return V});function Z(U,G){let P;return G.length===0?P=U:P=U.replace(/\{(\d+)\}/g,function(k,K){const I=K[0];return typeof G[I]!="undefined"?G[I]:k}),P}function V(U,G,...P){return Z(G,P)}},"4wi7":function(Gt,he,D){"use strict";var Z=D("14J3"),V=D("BMrR"),U=D("sRBo"),G=D("kaz8"),P=D("5NDa"),k=D("5rEg"),K=D("9og8"),I=D("tJVT"),r=D("WmNS"),M=D.n(r),_=D("q1tI"),p=D.n(_),m=D("oOBs"),u=D.n(m),a=D("xOL1"),o=D.n(a),c=D("BdwD"),s=function(n){var O=n.data,T=n.value,C=T===void 0?[]:T,R=n.handleChangePage,S=n.setSelectedRowKeys,v=n.selectedRowKeys,E=n.onChange,f=E===void 0?function(){}:E,h=Object(_.useState)([]),y=Object(I.a)(h,2),g=y[0],x=y[1],j=Object(_.useState)([]),B=Object(I.a)(j,2),A=B[0],H=B[1],F=Object(_.useState)([]),w=Object(I.a)(F,2),Y=w[0],q=w[1],ie=Object(_.useState)(1),ge=Object(I.a)(ie,2),Je=ge[0],xe=ge[1],ke=Object(_.useState)(),Qe=Object(I.a)(ke,2),Ye=Qe[0],ve=Qe[1];return Object(_.useEffect)(function(){x(O),H([]),q([])},[O]),Object(_.useEffect)(function(){S&&(H(v),q(v))},[v]),p.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},p.a.createElement("div",{className:u.a.leftdiv},p.a.createElement(k.a.Search,{size:"large",onChange:function(){var fe=Object(K.a)(M.a.mark(function at(Jt){return M.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:x(O.filter(function(ze){var gt;return ze==null||((gt=ze.name)===null||gt===void 0)?void 0:gt.includes(Jt.target.value)}));case 1:case"end":return St.stop()}},at)}));return function(at){return fe.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),g.length===0&&p.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),p.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},p.a.createElement(G.a.Group,{value:A.map(function(fe){return"".concat(fe.id)}),onChange:function(at){S(g.filter(function(Jt){return at.includes("".concat(Jt.id))}))},style:{marginTop:"10px"}},g.map(function(fe,at){return p.a.createElement(V.a,{key:fe.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},p.a.createElement(G.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:fe.is_published,value:"".concat(fe.id)},p.a.createElement("div",{className:u.a.listClass},p.a.createElement("span",{className:u.a.spantitle,style:{width:fe.is_published?"108px":"170px"}},fe.name),fe.is_published&&p.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),p.a.createElement("div",{className:u.a.rightdiv},p.a.createElement(k.a.Search,{onChange:function(at){q(A.filter(function(Jt){return Jt.name.includes(at.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),Y.length===0&&p.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),Y.length>0&&p.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},p.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},Y.map(function(fe,at){return p.a.createElement(V.a,{justify:"space-between",style:{marginTop:"10px"},key:fe.id},p.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},fe.name),p.a.createElement("img",{src:o.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){S(A.filter(function(Ft){return"".concat(Ft.id)!="".concat(fe.id)}))}}))})))))};he.a=s},"55Ip":function(Gt,he,D){"use strict";D.d(he,"a",function(){return i});var Z=D("Ty5D"),V=D("dI71"),U=D("q1tI"),G=D.n(U),P=D("YS25"),k=D("17x9"),K=D.n(k),I=D("wx14"),r=D("zLVn"),M=D("9R94"),_=function(E){Object(V.a)(f,E);function f(){for(var y,g=arguments.length,x=new Array(g),j=0;j<g;j++)x[j]=arguments[j];return y=E.call.apply(E,[this].concat(x))||this,y.history=Object(P.a)(y.props),y}var h=f.prototype;return h.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},f}(G.a.Component),p=function(E){Object(V.a)(f,E);function f(){for(var y,g=arguments.length,x=new Array(g),j=0;j<g;j++)x[j]=arguments[j];return y=E.call.apply(E,[this].concat(x))||this,y.history=Object(P.b)(y.props),y}var h=f.prototype;return h.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},f}(G.a.Component),m=function(f,h){return typeof f=="function"?f(h):f},u=function(f,h){return typeof f=="string"?Object(P.c)(f,null,null,h):f},a=function(f){return f},o=G.a.forwardRef;typeof o=="undefined"&&(o=a);function c(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var s=o(function(E,f){var h=E.innerRef,y=E.navigate,g=E.onClick,x=Object(r.a)(E,["innerRef","navigate","onClick"]),j=x.target,B=Object(I.a)({},x,{onClick:function(H){try{g&&g(H)}catch(F){throw H.preventDefault(),F}!H.defaultPrevented&&H.button===0&&(!j||j==="_self")&&!c(H)&&(H.preventDefault(),y())}});return a!==o?B.ref=f||h:B.ref=h,G.a.createElement("a",B)}),i=o(function(E,f){var h=E.component,y=h===void 0?s:h,g=E.replace,x=E.to,j=E.innerRef,B=Object(r.a)(E,["component","replace","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(A){A||Object(M.a)(!1);var H=A.history,F=u(m(x,A.location),A.location),w=F?H.createHref(F):"",Y=Object(I.a)({},B,{href:w,navigate:function(){var ie=m(x,A.location),ge=g?H.replace:H.push;ge(ie)}});return a!==o?Y.ref=f||j:Y.innerRef=j,G.a.createElement(y,Y)})});if(!1)var n,O;var T=function(f){return f},C=G.a.forwardRef;typeof C=="undefined"&&(C=T);function R(){for(var E=arguments.length,f=new Array(E),h=0;h<E;h++)f[h]=arguments[h];return f.filter(function(y){return y}).join(" ")}var S=C(function(E,f){var h=E["aria-current"],y=h===void 0?"page":h,g=E.activeClassName,x=g===void 0?"active":g,j=E.activeStyle,B=E.className,A=E.exact,H=E.isActive,F=E.location,w=E.sensitive,Y=E.strict,q=E.style,ie=E.to,ge=E.innerRef,Je=Object(r.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(xe){xe||Object(M.a)(!1);var ke=F||xe.location,Qe=u(m(ie,ke),ke),Ye=Qe.pathname,ve=Ye&&Ye.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),fe=ve?Object(Z.f)(ke.pathname,{path:ve,exact:A,sensitive:w,strict:Y}):null,at=!!(H?H(fe,ke):fe),Jt=at?R(B,x):B,Ft=at?Object(I.a)({},q,{},j):q,St=Object(I.a)({"aria-current":at&&y||null,className:Jt,style:Ft,to:Qe},Je);return T!==C?St.ref=f||ge:St.innerRef=ge,G.a.createElement(i,St)})});if(!1)var v},"5VLF":function(Gt,he,D){"use strict";var Z,V;function U(G,P,k){var K=function(I,r){return G.js_beautify(I,r)};return K.js=G.js_beautify,K.css=P.css_beautify,K.html=k.html_beautify,K.js_beautify=G.js_beautify,K.css_beautify=P.css_beautify,K.html_beautify=k.html_beautify,K}!(Z=[D("6UM0"),D("TXwP"),D("psGv")],V=function(G,P,k){return U(G,P,k)}.apply(he,Z),V!==void 0&&(Gt.exports=V))},"5Y4S":function(Gt,he,D){"use strict";D.d(he,"a",function(){return U});var Z=D("MNsG");const V=Z.b.performance&&typeof Z.b.performance.now=="function";class U{constructor(G){this._highResolution=V&&G,this._startTime=this._now(),this._stopTime=-1}static create(G=!0){return new U(G)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Z.b.performance.now():Date.now()}}},"6+eU":function(Gt,he,D){"use strict";D.d(he,"a",function(){return C});var Z=D("wx14"),V=D("rePB"),U=D("VTBJ"),G=D("1OyB"),P=D("vuIU"),k=D("Ji7U"),K=D("LK+K"),I=D("q1tI"),r=D.n(I),M=D("TSYQ"),_=D.n(M),p=function(S){var v,E="".concat(S.rootPrefixCls,"-item"),f=_()(E,"".concat(E,"-").concat(S.page),(v={},Object(V.a)(v,"".concat(E,"-active"),S.active),Object(V.a)(v,S.className,!!S.className),Object(V.a)(v,"".concat(E,"-disabled"),!S.page),v)),h=function(){S.onClick(S.page)},y=function(x){S.onKeyPress(x,S.onClick,S.page)};return r.a.createElement("li",{title:S.showTitle?S.page:null,className:f,onClick:h,onKeyPress:y,tabIndex:"0"},S.itemRender(S.page,"page",r.a.createElement("a",{rel:"nofollow"},S.page)))},m=p,u={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(R){Object(k.a)(v,R);var S=Object(K.a)(v);function v(){var E;Object(G.a)(this,v);for(var f=arguments.length,h=new Array(f),y=0;y<f;y++)h[y]=arguments[y];return E=S.call.apply(S,[this].concat(h)),E.state={goInputText:""},E.buildOptionText=function(g){return"".concat(g," ").concat(E.props.locale.items_per_page)},E.changeSize=function(g){E.props.changeSize(Number(g))},E.handleChange=function(g){E.setState({goInputText:g.target.value})},E.handleBlur=function(g){var x=E.props,j=x.goButton,B=x.quickGo,A=x.rootPrefixCls,H=E.state.goInputText;if(j||H==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;E.setState({goInputText:""}),B(E.getValidValue())},E.go=function(g){var x=E.state.goInputText;if(x==="")return;(g.keyCode===u.ENTER||g.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(P.a)(v,[{key:"getValidValue",value:function(){var f=this.state,h=f.goInputText,y=f.current;return!h||isNaN(h)?y:Number(h)}},{key:"getPageSizeOptions",value:function(){var f=this.props,h=f.pageSize,y=f.pageSizeOptions;return y.some(function(g){return g.toString()===h.toString()})?y:y.concat([h.toString()]).sort(function(g,x){var j=isNaN(Number(g))?0:Number(g),B=isNaN(Number(x))?0:Number(x);return j-B})}},{key:"render",value:function(){var f=this,h=this.props,y=h.pageSize,g=h.locale,x=h.rootPrefixCls,j=h.changeSize,B=h.quickGo,A=h.goButton,H=h.selectComponentClass,F=h.buildOptionText,w=h.selectPrefixCls,Y=h.disabled,q=this.state.goInputText,ie="".concat(x,"-options"),ge=H,Je=null,xe=null,ke=null;if(!j&&!B)return null;var Qe=this.getPageSizeOptions();if(j&&ge){var Ye=Qe.map(function(ve,fe){return r.a.createElement(ge.Option,{key:fe,value:ve.toString()},(F||f.buildOptionText)(ve))});Je=r.a.createElement(ge,{disabled:Y,prefixCls:w,showSearch:!1,className:"".concat(ie,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(y||Qe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(fe){return fe.parentNode}},Ye)}return B&&(A&&(ke=typeof A=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:Y,className:"".concat(ie,"-quick-jumper-button")},g.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),xe=r.a.createElement("div",{className:"".concat(ie,"-quick-jumper")},g.jump_to,r.a.createElement("input",{disabled:Y,type:"text",value:q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,ke)),r.a.createElement("li",{className:"".concat(ie)},Je,xe)}}]),v}(r.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var o=a,c=D("N2Kk");function s(){}function i(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function n(R,S,v){return v}function O(R,S,v){var E=typeof R=="undefined"?S.pageSize:R;return Math.floor((v.total-1)/E)+1}var T=function(R){Object(k.a)(v,R);var S=Object(K.a)(v);function v(E){var f;Object(G.a)(this,v),f=S.call(this,E),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(O(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(j,B){var A=f.props.prefixCls,H=j||r.a.createElement("button",{type:"button","aria-label":B,className:"".concat(A,"-item-link")});return typeof j=="function"&&(H=r.a.createElement(j,Object(U.a)({},f.props))),H},f.savePaginationNode=function(j){f.paginationNode=j},f.isValid=function(j){return i(j)&&j!==f.state.current},f.shouldDisplayQuickJumper=function(){var j=f.props,B=j.showQuickJumper,A=j.pageSize,H=j.total;return H<=A?!1:B},f.handleKeyDown=function(j){(j.keyCode===u.ARROW_UP||j.keyCode===u.ARROW_DOWN)&&j.preventDefault()},f.handleKeyUp=function(j){var B=f.getValidValue(j),A=f.state.currentInputValue;B!==A&&f.setState({currentInputValue:B}),j.keyCode===u.ENTER?f.handleChange(B):j.keyCode===u.ARROW_UP?f.handleChange(B-1):j.keyCode===u.ARROW_DOWN&&f.handleChange(B+1)},f.changePageSize=function(j){var B=f.state.current,A=O(j,f.state,f.props);B=B>A?A:B,A===0&&(B=f.state.current),typeof j=="number"&&("pageSize"in f.props||f.setState({pageSize:j}),"current"in f.props||f.setState({current:B,currentInputValue:B})),f.props.onShowSizeChange(B,j),"onChange"in f.props&&f.props.onChange&&f.props.onChange(B,j)},f.handleChange=function(j){var B=f.props.disabled,A=j;if(f.isValid(A)&&!B){var H=O(void 0,f.state,f.props);A>H?A=H:A<1&&(A=1),"current"in f.props||f.setState({current:A,currentInputValue:A});var F=f.state.pageSize;return f.props.onChange(A,F),A}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current<O(void 0,f.state,f.props)},f.runIfEnter=function(j,B){if(j.key==="Enter"||j.charCode===13){for(var A=arguments.length,H=new Array(A>2?A-2:0),F=2;F<A;F++)H[F-2]=arguments[F];B.apply(void 0,H)}},f.runIfEnterPrev=function(j){f.runIfEnter(j,f.prev)},f.runIfEnterNext=function(j){f.runIfEnter(j,f.next)},f.runIfEnterJumpPrev=function(j){f.runIfEnter(j,f.jumpPrev)},f.runIfEnterJumpNext=function(j){f.runIfEnter(j,f.jumpNext)},f.handleGoTO=function(j){(j.keyCode===u.ENTER||j.type==="click")&&f.handleChange(f.state.currentInputValue)};var h=E.onChange!==s,y="current"in E;y&&!h&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var g=E.defaultCurrent;"current"in E&&(g=E.current);var x=E.defaultPageSize;return"pageSize"in E&&(x=E.pageSize),g=Math.min(g,O(x,void 0,E)),f.state={current:g,currentInputValue:g,pageSize:x},f}return Object(P.a)(v,[{key:"componentDidUpdate",value:function(f,h){var y=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(y,"-item-").concat(h.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(f){var h=f.target.value,y=O(void 0,this.state,this.props),g=this.state.currentInputValue,x;return h===""?x=h:isNaN(Number(h))?x=g:h>=y?x=y:x=Number(h),x}},{key:"getShowSizeChanger",value:function(){var f=this.props,h=f.showSizeChanger,y=f.total,g=f.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:y>g}},{key:"renderPrev",value:function(f){var h=this.props,y=h.prevIcon,g=h.itemRender,x=g(f,"prev",this.getItemIcon(y,"prev page")),j=!this.hasPrev();return Object(I.isValidElement)(x)?Object(I.cloneElement)(x,{disabled:j}):x}},{key:"renderNext",value:function(f){var h=this.props,y=h.nextIcon,g=h.itemRender,x=g(f,"next",this.getItemIcon(y,"next page")),j=!this.hasNext();return Object(I.isValidElement)(x)?Object(I.cloneElement)(x,{disabled:j}):x}},{key:"render",value:function(){var f=this,h=this.props,y=h.prefixCls,g=h.className,x=h.style,j=h.disabled,B=h.hideOnSinglePage,A=h.total,H=h.locale,F=h.showQuickJumper,w=h.showLessItems,Y=h.showTitle,q=h.showTotal,ie=h.simple,ge=h.itemRender,Je=h.showPrevNextJumpers,xe=h.jumpPrevIcon,ke=h.jumpNextIcon,Qe=h.selectComponentClass,Ye=h.selectPrefixCls,ve=h.pageSizeOptions,fe=this.state,at=fe.current,Jt=fe.pageSize,Ft=fe.currentInputValue;if(B===!0&&A<=Jt)return null;var St=O(void 0,this.state,this.props),ze=[],gt=null,ct=null,jt=null,oe=null,Ne=null,Ge=F&&F.goButton,Xe=w?1:2,Bt=at-1>0?at-1:0,Wt=at+1<St?at+1:St,en=Object.keys(this.props).reduce(function(ae,se){return(se.substr(0,5)==="data-"||se.substr(0,5)==="aria-"||se==="role")&&(ae[se]=f.props[se]),ae},{});if(ie)return Ge&&(typeof Ge=="boolean"?Ne=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):Ne=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ge),Ne=r.a.createElement("li",{title:Y?"".concat(H.jump_to).concat(at,"/").concat(St):null,className:"".concat(y,"-simple-pager")},Ne)),r.a.createElement("ul",Object(Z.a)({className:_()(y,"".concat(y,"-simple"),Object(V.a)({},"".concat(y,"-disabled"),j),g),style:x,ref:this.savePaginationNode},en),r.a.createElement("li",{title:Y?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:_()("".concat(y,"-prev"),Object(V.a)({},"".concat(y,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Bt)),r.a.createElement("li",{title:Y?"".concat(at,"/").concat(St):null,className:"".concat(y,"-simple-pager")},r.a.createElement("input",{type:"text",value:Ft,disabled:j,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(y,"-slash")},"/"),St),r.a.createElement("li",{title:Y?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:_()("".concat(y,"-next"),Object(V.a)({},"".concat(y,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Wt)),Ne);if(St<=3+Xe*2){var tt={locale:H,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:Y,itemRender:ge};St||ze.push(r.a.createElement(m,Object(Z.a)({},tt,{key:"noPager",page:St,className:"".concat(y,"-disabled")})));for(var tn=1;tn<=St;tn+=1){var En=at===tn;ze.push(r.a.createElement(m,Object(Z.a)({},tt,{key:tn,page:tn,active:En})))}}else{var We=w?H.prev_3:H.prev_5,Fe=w?H.next_3:H.next_5;Je&&(gt=r.a.createElement("li",{title:Y?We:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:_()("".concat(y,"-jump-prev"),Object(V.a)({},"".concat(y,"-jump-prev-custom-icon"),!!xe))},ge(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(xe,"prev page"))),ct=r.a.createElement("li",{title:Y?Fe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:_()("".concat(y,"-jump-next"),Object(V.a)({},"".concat(y,"-jump-next-custom-icon"),!!ke))},ge(this.getJumpNextPage(),"jump-next",this.getItemIcon(ke,"next page")))),oe=r.a.createElement(m,{locale:H,last:!0,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:St,page:St,active:!1,showTitle:Y,itemRender:ge}),jt=r.a.createElement(m,{locale:H,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:Y,itemRender:ge});var yt=Math.max(1,at-Xe),At=Math.min(at+Xe,St);at-1<=Xe&&(At=1+Xe*2),St-at<=Xe&&(yt=St-Xe*2);for(var nt=yt;nt<=At;nt+=1){var st=at===nt;ze.push(r.a.createElement(m,{locale:H,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:nt,page:nt,active:st,showTitle:Y,itemRender:ge}))}at-1>=Xe*2&&at!==1+2&&(ze[0]=Object(I.cloneElement)(ze[0],{className:"".concat(y,"-item-after-jump-prev")}),ze.unshift(gt)),St-at>=Xe*2&&at!==St-2&&(ze[ze.length-1]=Object(I.cloneElement)(ze[ze.length-1],{className:"".concat(y,"-item-before-jump-next")}),ze.push(ct)),yt!==1&&ze.unshift(jt),At!==St&&ze.push(oe)}var De=null;q&&(De=r.a.createElement("li",{className:"".concat(y,"-total-text")},q(A,[A===0?0:(at-1)*Jt+1,at*Jt>A?A:at*Jt])));var ye=!this.hasPrev()||!St,we=!this.hasNext()||!St;return r.a.createElement("ul",Object(Z.a)({className:_()(y,g,Object(V.a)({},"".concat(y,"-disabled"),j)),style:x,unselectable:"unselectable",ref:this.savePaginationNode},en),De,r.a.createElement("li",{title:Y?H.prev_page:null,onClick:this.prev,tabIndex:ye?null:0,onKeyPress:this.runIfEnterPrev,className:_()("".concat(y,"-prev"),Object(V.a)({},"".concat(y,"-disabled"),ye)),"aria-disabled":ye},this.renderPrev(Bt)),ze,r.a.createElement("li",{title:Y?H.next_page:null,onClick:this.next,tabIndex:we?null:0,onKeyPress:this.runIfEnterNext,className:_()("".concat(y,"-next"),Object(V.a)({},"".concat(y,"-disabled"),we)),"aria-disabled":we},this.renderNext(Wt)),r.a.createElement(o,{disabled:j,locale:H,rootPrefixCls:y,selectComponentClass:Qe,selectPrefixCls:Ye,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:at,pageSize:Jt,pageSizeOptions:ve,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ge}))}}],[{key:"getDerivedStateFromProps",value:function(f,h){var y={};if("current"in f&&(y.current=f.current,f.current!==h.current&&(y.currentInputValue=y.current)),"pageSize"in f&&f.pageSize!==h.pageSize){var g=h.current,x=O(f.pageSize,h,f);g=g>x?x:g,"current"in f||(y.current=g,y.currentInputValue=g),y.pageSize=f.pageSize}return y}}]),v}(r.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:s,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:s,locale:c.a,style:{},itemRender:n,totalBoundaryShowSizeChanger:50};var C=T},"6RRn":function(Gt,he,D){"use strict";var Z=D("wCXF"),V=D("n6Qo");D.d(he,"b",function(){return V.a});var U=D("IBYe"),G=D("6eGT"),P=D("hW8S");D.d(he,"a",function(){return P.a}),he.c=Z.b},"6UM0":function(Gt,he,D){var Z,V;(function(){var U;(function(){"use strict";var P=[function(r,M,_){var p=_(1).Beautifier,m=_(5).Options;function u(a,o){var c=new p(a,o);return c.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new m}},function(r,M,_){var p=_(2).Output,m=_(3).Token,u=_(4),a=_(5).Options,o=_(7).Tokenizer,c=_(7).line_starters,s=_(7).positionable_operators,i=_(7).TOKEN;function n(w,Y){return Y.indexOf(w)!==-1}function O(w){return w.replace(/^\s+/g,"")}function T(w){for(var Y={},q=0;q<w.length;q++)Y[w[q].replace(/-/g,"_")]=w[q];return Y}function C(w,Y){return w&&w.type===i.RESERVED&&w.text===Y}function R(w,Y){return w&&w.type===i.RESERVED&&n(w.text,Y)}var S=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],E=T(v),f=[E.before_newline,E.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function y(w,Y){if(Y.multiline_frame||Y.mode===h.ForInitializer||Y.mode===h.Conditional)return;w.remove_indent(Y.start_line_index)}function g(w){w=w.replace(u.allLineBreaks,`
`);for(var Y=[],q=w.indexOf(`
`);q!==-1;)Y.push(w.substring(0,q)),w=w.substring(q+1),q=w.indexOf(`
`);return w.length&&Y.push(w),Y}function x(w){return w===h.ArrayLiteral}function j(w){return n(w,[h.Expression,h.ForInitializer,h.Conditional])}function B(w,Y){for(var q=0;q<w.length;q++){var ie=w[q].trim();if(ie.charAt(0)!==Y)return!1}return!0}function A(w,Y){for(var q=0,ie=w.length,ge;q<ie;q++)if(ge=w[q],ge&&ge.indexOf(Y)!==0)return!1;return!0}function H(w,Y){Y=Y||{},this._source_text=w||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(Y)}H.prototype.create_flags=function(w,Y){var q=0;w&&(q=w.indentation_level,!this._output.just_added_newline()&&w.line_indent_level>q&&(q=w.line_indent_level));var ie={mode:Y,parent:w,last_token:w?w.last_token:new m(i.START_BLOCK,""),last_word:w?w.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:q,alignment:0,line_indent_level:w?w.line_indent_level:q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},H.prototype._reset=function(w){var Y=w.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var q=new o(w,this._options);return this._tokens=q.tokenize(),w},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w,Y=this._reset(this._source_text),q=this._options.eol;this._options.eol==="auto"&&(q=`
`,Y&&u.lineBreak.test(Y||"")&&(q=Y.match(u.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return w=this._output.get_code(q),w},H.prototype.handle_token=function(w,Y){w.type===i.START_EXPR?this.handle_start_expr(w):w.type===i.END_EXPR?this.handle_end_expr(w):w.type===i.START_BLOCK?this.handle_start_block(w):w.type===i.END_BLOCK?this.handle_end_block(w):w.type===i.WORD?this.handle_word(w):w.type===i.RESERVED?this.handle_word(w):w.type===i.SEMICOLON?this.handle_semicolon(w):w.type===i.STRING?this.handle_string(w):w.type===i.EQUALS?this.handle_equals(w):w.type===i.OPERATOR?this.handle_operator(w):w.type===i.COMMA?this.handle_comma(w):w.type===i.BLOCK_COMMENT?this.handle_block_comment(w,Y):w.type===i.COMMENT?this.handle_comment(w,Y):w.type===i.DOT?this.handle_dot(w):w.type===i.EOF?this.handle_eof(w):w.type===i.UNKNOWN?this.handle_unknown(w,Y):this.handle_unknown(w,Y)},H.prototype.handle_whitespace_and_comments=function(w,Y){var q=w.newlines,ie=this._options.keep_array_indentation&&x(this._flags.mode);if(w.comments_before)for(var ge=w.comments_before.next();ge;)this.handle_whitespace_and_comments(ge,Y),this.handle_token(ge,Y),ge=w.comments_before.next();if(ie)for(var Je=0;Je<q;Je+=1)this.print_newline(Je>0,Y);else if(this._options.max_preserve_newlines&&q>this._options.max_preserve_newlines&&(q=this._options.max_preserve_newlines),this._options.preserve_newlines&&q>1){this.print_newline(!1,Y);for(var xe=1;xe<q;xe+=1)this.print_newline(!0,Y)}};var F=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(w,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var q=this._options.preserve_newlines&&w.newlines||Y,ie=n(this._flags.last_token.text,s)||n(w.text,s);if(ie){var ge=n(this._flags.last_token.text,s)&&n(this._options.operator_position,f)||n(w.text,s);q=q&&ge}if(q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,F))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(w,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var q=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&C(q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(w)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(w){this._output.just_added_newline()&&(this._options.keep_array_indentation&&w.newlines&&(w.text==="["||x(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(w.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},H.prototype.print_token=function(w){if(this._output.raw){this._output.add_raw_token(w);return}if(this._options.comma_first&&w.previous&&w.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(w),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(w),this._output.non_breaking_space=!0,this._output.add_token(w.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.set_mode=function(w){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,w),this._flags=this.create_flags(this._previous_flags,w),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&y(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(w){var Y=!1;return Y=Y||R(this._flags.last_token,["var","let","const"])&&w.type===i.WORD,Y=Y||C(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&R(this._flags.last_token,F)&&!w.newlines,Y=Y||C(this._flags.last_token,"else")&&!(C(w,"if")&&!w.comments_before),Y=Y||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),Y=Y||this._flags.last_token.type===i.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(w.text==="--"||w.text==="++")&&this._last_last_text!=="function"&&w.type!==i.WORD&&w.type!==i.RESERVED,Y=Y||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),Y?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(w,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w,R(w,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w);var Y=h.Expression;if(w.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,c)&&(this._output.space_before_token=!0),this.print_token(w),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=h.ArrayLiteral,x(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),n(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=h.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=h.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&w.whitespace_before===""?this._output.space_before_token=!1:(n(this._flags.last_token.text,c)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var q=this._tokens.peek(-3);if(this._options.space_after_named_function&&q){var ie=this._tokens.peek(-4);R(q,["async","function"])||q.text==="*"&&R(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(q.text==="{"||q.text===","||q.text==="*"&&(ie.text==="{"||ie.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(w);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&n(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(w,w.newlines),this.print_token(w),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(w,w.text==="]"&&x(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(w),this.restore_mode(),y(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(w){this.handle_whitespace_and_comments(w);var Y=this._tokens.peek(),q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):q&&(n(q.text,[":",","])&&n(Y.type,[i.STRING,i.WORD,i.RESERVED])||n(Y.text,["get","set","..."])&&n(q.type,[i.WORD,i.RESERVED]))?n(this._last_last_text,["class","interface"])&&!n(q.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):n(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!Y.comments_before&&Y.text==="}",ge=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Je=0,xe=null;this._flags.inline_frame=!0;do if(Je+=1,xe=this._tokens.peek(Je-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==i.EOF&&!(xe.type===i.END_BLOCK&&xe.opened===w))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(ge||this._flags.last_token.type===i.EQUALS||R(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(x(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(w),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(w),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(w){for(this.handle_whitespace_and_comments(w);this._flags.mode===h.Statement;)this.restore_mode();var Y=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(x(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(w)},H.prototype.handle_word=function(w){if(w.type===i.RESERVED){if(n(w.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)w.type=i.WORD;else if(w.text==="import"&&n(this._tokens.peek().text,["(","."]))w.type=i.WORD;else if(n(w.text,["as","from"])&&!this._flags.import_block)w.type=i.WORD;else if(this._flags.mode===h.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(w.type=i.WORD)}}if(this.start_of_statement(w)?R(this._flags.last_token,["var","let","const"])&&w.type===i.WORD&&(this._flags.declaration_statement=!0):w.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(w),this.print_newline()):this.handle_whitespace_and_comments(w),this._flags.do_block&&!this._flags.do_while)if(C(w,"while")){this._output.space_before_token=!0,this.print_token(w),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&&C(w,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(w,["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(w),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w)),C(w,"function")){(n(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(n(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!w.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,F)?this._output.space_before_token=!0:C(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||x(this._flags.mode))||this.print_newline(),this.print_token(w),this._flags.last_word=w.text;return}var q="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?q="SPACE":R(w,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines?q="NEWLINE":(q="SPACE",this._output.space_before_token=!0):q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===h.BlockStatement?q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&j(this._flags.mode)?q="SPACE":this._flags.last_token.type===i.STRING?q="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&n(this._last_last_text,["{",","]))?q="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?q="SPACE":q="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,q="NEWLINE"),R(w,c)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?q="SPACE":q="NEWLINE"),R(w,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else q==="NEWLINE"?R(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(w,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!R(w,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(w,"if")&&C(w.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(w,c)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&x(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():q==="SPACE"&&(this._output.space_before_token=!0);w.previous&&(w.previous.type===i.WORD||w.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(w),this._flags.last_word=w.text,w.type===i.RESERVED&&(w.text==="do"?this._flags.do_block=!0:w.text==="if"?this._flags.if_block=!0:w.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(w,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(w){this.start_of_statement(w)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(w);for(var Y=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&C(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(w)},H.prototype.handle_string=function(w){w.text.startsWith("`")&&w.newlines===0&&w.whitespace_before===""&&(w.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(w)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(w),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w):w.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(w.previous.text==="]"||w.previous.text===")")&&w.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(w)},H.prototype.handle_equals=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0},H.prototype.handle_comma=function(w){this.handle_whitespace_and_comments(w,!0),this.print_token(w),this._output.space_before_token=!0,this._flags.declaration_statement?(j(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)},H.prototype.handle_operator=function(w){var Y=w.text==="*"&&(R(this._flags.last_token,["function","yield"])||n(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),q=n(w.text,["-","+"])&&(n(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||n(this._flags.last_token.text,c)||this._flags.last_token.text===",");if(!this.start_of_statement(w)){var ie=!Y;this.handle_whitespace_and_comments(w,ie)}if(w.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(w);return}if(w.text==="::"){this.print_token(w);return}if(this._flags.last_token.type===i.OPERATOR&&n(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(w),w.text===":"&&this._flags.in_case){this.print_token(w),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ge=!0,Je=!0,xe=!1;if(w.text===":"?this._flags.ternary_depth===0?ge=!1:(this._flags.ternary_depth-=1,xe=!0):w.text==="?"&&(this._flags.ternary_depth+=1),!q&&!Y&&this._options.preserve_newlines&&n(w.text,s)){var ke=w.text===":",Qe=ke&&xe,Ye=ke&&!xe;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!Ye,this.print_token(w),(!ke||Qe)&&this.allow_wrap_or_preserved_newline(w),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!ke||Qe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(w):this._output.space_before_token=!1,this.print_token(w),this._output.space_before_token=!0;return;case E.preserve_newline:Ye||this.allow_wrap_or_preserved_newline(w),ge=!(this._output.just_added_newline()||Ye),this._output.space_before_token=ge,this.print_token(w),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(w),ge=!1;var ve=this._tokens.peek();Je=ve&&n(ve.type,[i.WORD,i.RESERVED])}else if(w.text==="...")this.allow_wrap_or_preserved_newline(w),ge=this._flags.last_token.type===i.START_BLOCK,Je=!1;else if(n(w.text,["--","++","!","~"])||q){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(w),ge=!1,Je=!1,w.newlines&&(w.text==="--"||w.text==="++"||w.text==="~")){var fe=R(this._flags.last_token,S)&&w.newlines;fe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(fe,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(ge=!0),this._flags.last_token.type===i.RESERVED?ge=!0:this._flags.last_token.type===i.END_EXPR?ge=!(this._flags.last_token.text==="]"&&(w.text==="--"||w.text==="++")):this._flags.last_token.type===i.OPERATOR&&(ge=n(w.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(w.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&(Je=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ge,this.print_token(w),this._output.space_before_token=Je},H.prototype.handle_block_comment=function(w,Y){if(this._output.raw){this._output.add_raw_token(w),w.directives&&w.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(w.directives){this.print_newline(!1,Y),this.print_token(w),w.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(w.text)&&!w.newlines){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0;return}else this.print_block_commment(w,Y)},H.prototype.print_block_commment=function(w,Y){var q=g(w.text),ie,ge=!1,Je=!1,xe=w.whitespace_before,ke=xe.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(w),this._output.add_token(q[0]),this.print_newline(!1,Y),q.length>1){for(q=q.slice(1),ge=B(q,"*"),Je=A(q,xe),ge&&(this._flags.alignment=1),ie=0;ie<q.length;ie++)ge?(this.print_token_line_indentation(w),this._output.add_token(O(q[ie]))):Je&&q[ie]?(this.print_token_line_indentation(w),this._output.add_token(q[ie].substring(ke))):(this._output.current_line.set_indent(-1),this._output.add_token(q[ie])),this.print_newline(!1,Y);this._flags.alignment=0}},H.prototype.handle_comment=function(w,Y){w.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(w),this.print_newline(!1,Y)},H.prototype.handle_dot=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,S)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(w,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(w)},H.prototype.handle_unknown=function(w,Y){this.print_token(w),w.text[w.text.length-1]===`
`&&this.print_newline(!1,Y)},H.prototype.handle_eof=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w)},r.exports.Beautifier=H},function(r){function M(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}M.prototype.clone_empty=function(){var m=new M(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},M.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},M.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},M.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var u=m.lastIndexOf(`
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},M.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function _(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}_.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},_.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},_.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,u){this.__indent_cache=new _(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new M(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return m!==`
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(m)!==0&&o.item(-1)!==u){this.__lines.splice(a+1,0,new M(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},function(r){function M(_,p,m,u){this.type=_,this.text=p,this.comments_before=null,this.newlines=m||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=M},function(r,M){var _="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="(?:\\\\u[0-9a-fA-F]{4}|["+_+m+"])",o="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])*";M.identifier=new RegExp(a+o,"g"),M.identifierStart=new RegExp(a),M.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])+");var c=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;M.newline=/[\n\r\u2028\u2029]/,M.lineBreak=new RegExp(`\r
|`+M.newline.source),M.allLineBreaks=new RegExp(M.lineBreak.source,"g")},function(r,M,_){var p=_(6).Options,m=["before-newline","after-newline","preserve-newline"];function u(a){p.call(this,a,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s<c.length;s++)c[s]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=c[s];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new p,r.exports.Options=u},function(r){function M(m,u){this.raw_options=_(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}M.prototype._get_array=function(m,u){var a=this.raw_options[m],o=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},M.prototype._get_boolean=function(m,u){var a=this.raw_options[m],o=a===void 0?!!u:!!a;return o},M.prototype._get_characters=function(m,u){var a=this.raw_options[m],o=u||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),o},M.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var o=parseInt(a,10);return isNaN(o)&&(o=u),o},M.prototype._get_selection=function(m,u,a){var o=this._get_selection_list(m,u,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o[0]},M.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var o=this._get_array(m,a);if(!this._is_valid_selection(o,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o},M.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function _(m,u){var a={};m=p(m);var o;for(o in m)o!==u&&(a[o]=m[o]);if(u&&m[u])for(o in m[u])a[o]=m[u][o];return a}function p(m){var u={},a;for(a in m){var o=a.replace(/-/g,"_");u[o]=m[a]}return u}r.exports.Options=M,r.exports.normalizeOpts=p,r.exports.mergeOpts=_},function(r,M,_){var p=_(8).InputScanner,m=_(9).Tokenizer,u=_(9).TOKEN,a=_(13).Directives,o=_(4),c=_(12).Pattern,s=_(14).TemplatablePattern;function i(B,A){return A.indexOf(B)!==-1}var n={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},O=new a(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,R=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var E=new RegExp(v),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+h.join("|")+")$"),g,x=function(B,A){m.call(this,B,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new c(this._input),F=new s(this._input).read_options(this._options);this.__patterns={template:F,identifier:F.starting_with(o.identifier).matching(o.identifierMatch),number:H.matching(T),punct:H.matching(E),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(o.lineBreak),shebang:H.starting_with(/#!/).until_after(o.lineBreak),xml:H.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:F.until(/['\\\n\r\u2028\u2029]/),double_quote:F.until(/["\\\n\r\u2028\u2029]/),template_text:F.until(/[`\\$]/),template_expression:F.until(/[`}\\]/)}};x.prototype=new m,x.prototype._is_comment=function(B){return B.type===n.COMMENT||B.type===n.BLOCK_COMMENT||B.type===n.UNKNOWN},x.prototype._is_opening=function(B){return B.type===n.START_BLOCK||B.type===n.START_EXPR},x.prototype._is_closing=function(B,A){return(B.type===n.END_BLOCK||B.type===n.END_EXPR)&&A&&(B.text==="]"&&A.text==="["||B.text===")"&&A.text==="("||B.text==="}"&&A.text==="{")},x.prototype._reset=function(){g=!1},x.prototype._get_next_token=function(B,A){var H=null;this._readWhitespace();var F=this._input.peek();return F===null?this._create_token(n.EOF,""):(H=H||this._read_non_javascript(F),H=H||this._read_string(F),H=H||this._read_word(B),H=H||this._read_singles(F),H=H||this._read_comment(F),H=H||this._read_regexp(F,B),H=H||this._read_xml(F,B),H=H||this._read_punctuation(),H=H||this._create_token(n.UNKNOWN,this._input.next()),H)},x.prototype._read_word=function(B){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(o.allLineBreaks,`
`),!(B.type===n.DOT||B.type===n.RESERVED&&(B.text==="set"||B.text==="get"))&&y.test(A)?(A==="in"||A==="of")&&(B.type===n.WORD||B.type===n.STRING)?this._create_token(n.OPERATOR,A):this._create_token(n.RESERVED,A):this._create_token(n.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(n.WORD,A)},x.prototype._read_singles=function(B){var A=null;return B==="("||B==="["?A=this._create_token(n.START_EXPR,B):B===")"||B==="]"?A=this._create_token(n.END_EXPR,B):B==="{"?A=this._create_token(n.START_BLOCK,B):B==="}"?A=this._create_token(n.END_BLOCK,B):B===";"?A=this._create_token(n.SEMICOLON,B):B==="."&&R.test(this._input.peek(1))?A=this._create_token(n.DOT,B):B===","&&(A=this._create_token(n.COMMA,B)),A&&this._input.next(),A},x.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(n.EQUALS,B):B==="?."?this._create_token(n.DOT,B):this._create_token(n.OPERATOR,B)},x.prototype._read_non_javascript=function(B){var A="";if(B==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(n.UNKNOWN,A.trim()+`
`);if(A=this.__patterns.include.read(),A)return this._create_token(n.UNKNOWN,A.trim()+`
`);B=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(C)){do B=this._input.next(),H+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(n.WORD,H)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)A+=this._input.next();return g=!0,this._create_token(n.COMMENT,A)}}else if(g&&B==="-"&&(A=this.__patterns.html_comment_end.read(),A))return g=!1,this._create_token(n.COMMENT,A);return null},x.prototype._read_comment=function(B){var A=null;if(B==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var F=O.get_directives(H);F&&F.ignore==="start"&&(H+=O.readIgnored(this._input)),H=H.replace(o.allLineBreaks,`
`),A=this._create_token(n.BLOCK_COMMENT,H),A.directives=F}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),A=this._create_token(n.COMMENT,H))}return A},x.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var A=this._input.next();return this.has_char_escapes=!1,B==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(A=j(A)),this._input.peek()===B&&(A+=this._input.next()),A=A.replace(o.allLineBreaks,`
`),this._create_token(n.STRING,A)}return null},x.prototype._allow_regexp_or_xml=function(B){return B.type===n.RESERVED&&i(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===n.END_EXPR&&B.text===")"&&B.opened.previous.type===n.RESERVED&&i(B.opened.previous.text,["if","while","for"])||i(B.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},x.prototype._read_regexp=function(B,A){if(B==="/"&&this._allow_regexp_or_xml(A)){for(var H=this._input.next(),F=!1,w=!1;this._input.hasNext()&&(F||w||this._input.peek()!==B)&&!this._input.testChar(o.newline);)H+=this._input.peek(),F?F=!1:(F=this._input.peek()==="\\",this._input.peek()==="["?w=!0:this._input.peek()==="]"&&(w=!1)),this._input.next();return this._input.peek()===B&&(H+=this._input.next(),H+=this._input.read(o.identifier)),this._create_token(n.STRING,H)}return null},x.prototype._read_xml=function(B,A){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(A)){var H="",F=this.__patterns.xml.read_match();if(F){for(var w=F[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=w.indexOf("{")===0,q=0;F;){var ie=!!F[1],ge=F[2],Je=!!F[F.length-1]||ge.slice(0,8)==="![CDATA[";if(!Je&&(ge===w||Y&&ge.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--q:++q),H+=F[0],q<=0)break;F=this.__patterns.xml.read_match()}return F||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(o.allLineBreaks,`
`),this._create_token(n.STRING,H)}}return null};function j(B){for(var A="",H=0,F=new p(B),w=null;F.hasNext();)if(w=F.match(/([\s]|[^\\]|\\\\)+/g),w&&(A+=w[0]),F.peek()==="\\"){if(F.next(),F.peek()==="x")w=F.match(/x([0-9A-Fa-f]{2})/g);else if(F.peek()==="u")w=F.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",F.hasNext()&&(A+=F.next());continue}if(!w)return B;if(H=parseInt(w[1],16),H>126&&H<=255&&w[0].indexOf("x")===0)return B;if(H>=0&&H<32){A+="\\"+w[0];continue}else H===34||H===39||H===92?A+="\\"+String.fromCharCode(H):A+=String.fromCharCode(H)}return A}x.prototype._read_string_recursive=function(B,A,H){var F,w;B==="'"?w=this.__patterns.single_quote:B==='"'?w=this.__patterns.double_quote:B==="`"?w=this.__patterns.template_text:B==="}"&&(w=this.__patterns.template_expression);for(var Y=w.read(),q="";this._input.hasNext();){if(q=this._input.next(),q===B||!A&&o.newline.test(q)){this._input.back();break}else q==="\\"&&this._input.hasNext()?(F=this._input.peek(),F==="x"||F==="u"?this.has_char_escapes=!0:F==="\r"&&this._input.peek(1)===`
`&&this._input.next(),q+=this._input.next()):H&&(H==="${"&&q==="$"&&this._input.peek()==="{"&&(q+=this._input.next()),H===q&&(B==="`"?q+=this._read_string_recursive("}",A,"`"):q+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(q+=this._input.next())));q+=w.read(),Y+=q}return Y},r.exports.Tokenizer=x,r.exports.TOKEN=n,r.exports.positionable_operators=S.slice(),r.exports.line_starters=f.slice()},function(r){var M=RegExp.prototype.hasOwnProperty("sticky");function _(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},_.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},_.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(M&&p.sticky)&&(u.index!==m&&(u=null)),u},_.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},_.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},_.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},_.prototype.read=function(p,m,u){var a="",o;return p&&(o=this.match(p),o&&(a+=o[0])),m&&(o||!p)&&(a+=this.readUntil(m,u)),a},_.prototype.readUntil=function(p,m){var u="",a=this.__position;p.lastIndex=this.__position;var o=p.exec(this.__input);return o?(a=o.index,m&&(a+=o[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},_.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},_.prototype.get_regexp=function(p,m){var u=null,a="g";return m&&M&&(a="y"),typeof p=="string"&&p!==""?u=new RegExp(p,a):p&&(u=new RegExp(p.source,a)),u},_.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},_.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=_},function(r,M,_){var p=_(8).InputScanner,m=_(3).Token,u=_(10).TokenStream,a=_(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(s,i){this._input=new p(s),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var s,i=new m(o.START,""),n=null,O=[],T=new u;i.type!==o.EOF;){for(s=this._get_next_token(i,n);this._is_comment(s);)T.add(s),s=this._get_next_token(i,n);T.isEmpty()||(s.comments_before=T,T=new u),s.parent=n,this._is_opening(s)?(O.push(n),n=s):n&&this._is_closing(s,n)&&(s.opened=n,n.closed=s,n=O.pop(),s.parent=n),s.previous=i,i.next=s,this.__tokens.add(s),i=s}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(s,i){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(o.RAW,n):this._create_token(o.EOF,"")},c.prototype._is_comment=function(s){return!1},c.prototype._is_opening=function(s){return!1},c.prototype._is_closing=function(s,i){return!1},c.prototype._create_token=function(s,i){var n=new m(s,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=c,r.exports.TOKEN=o},function(r){function M(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}M.prototype.restart=function(){this.__position=0},M.prototype.isEmpty=function(){return this.__tokens_length===0},M.prototype.hasNext=function(){return this.__position<this.__tokens_length},M.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},M.prototype.peek=function(_){var p=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(p=this.__tokens[_]),p},M.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},r.exports.TokenStream=M},function(r,M,_){var p=_(12).Pattern;function m(u,a){p.call(this,u,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new p,m.prototype.__set_whitespace_patterns=function(u,a){u+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var a=this.__split(this._newline_regexp,u);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return u},m.prototype.matching=function(u,a){var o=this._create();return o.__set_whitespace_patterns(u,a),o._update(),o},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(u,a){u.lastIndex=0;for(var o=0,c=[],s=u.exec(a);s;)c.push(a.substring(o,s.index)),o=s.index+s[0].length,s=u.exec(a);return o<a.length?c.push(a.substring(o,a.length)):c.push(""),c},r.exports.WhitespacePattern=m},function(r){function M(_,p){this._input=_,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}M.prototype.read=function(){var _=this._input.read(this._starting_pattern);return(!this._starting_pattern||_)&&(_+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),_},M.prototype.read_match=function(){return this._input.match(this._match_pattern)},M.prototype.until_after=function(_){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(_),p._update(),p},M.prototype.until=function(_){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(_),p._update(),p},M.prototype.starting_with=function(_){var p=this._create();return p._starting_pattern=this._input.get_regexp(_,!0),p._update(),p},M.prototype.matching=function(_){var p=this._create();return p._match_pattern=this._input.get_regexp(_,!0),p._update(),p},M.prototype._create=function(){return new M(this._input,this)},M.prototype._update=function(){},r.exports.Pattern=M},function(r){function M(_,p){_=typeof _=="string"?_:_.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+p,"g")}M.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(_);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(_);return p},M.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=M},function(r,M,_){var p=_(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(a,o){p.call(this,a,o),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var c=new p(a);this.__patterns={handlebars_comment:c.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:c.starting_with(/{{{/).until_after(/}}}/),handlebars:c.starting_with(/{{/).until_after(/}}/),php:c.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:c.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:c.starting_with(/{%/).until_after(/%}/),django_value:c.starting_with(/{{/).until_after(/}}/),django_comment:c.starting_with(/{#/).until_after(/#}/),smarty:c.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:c.starting_with(/{\*/).until_after(/\*}/),smarty_literal:c.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new p,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(a){var o=this._create();return o._disabled[a]=!0,o._update(),o},u.prototype.read_options=function(a){var o=this._create();for(var c in m)o._disabled[c]=a.templating.indexOf(c)===-1;return o._update(),o},u.prototype.exclude=function(a){var o=this._create();return o._excluded[a]=!0,o._update(),o},u.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),a+=o,o=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},u.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},u.prototype._read_template=function(){var a="",o=this._input.peek();if(o==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(a=a||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},r.exports.TemplatablePattern=u}],k={};function K(r){var M=k[r];if(M!==void 0)return M.exports;var _=k[r]={exports:{}};return P[r](_,_.exports,K),_.exports}var I=K(0);U=I})();var G=U;!(Z=[],V=function(){return{js_beautify:G}}.apply(he,Z),V!==void 0&&(Gt.exports=V))})()},"6eGT":function(Gt,he,D){"use strict";function Z(V){return null}he.a=Z},"746U":function(Gt,he,D){"use strict";D.d(he,"f",function(){return Z}),D.d(he,"l",function(){return V}),D.d(he,"k",function(){return U}),D.d(he,"j",function(){return G}),D.d(he,"g",function(){return P}),D.d(he,"m",function(){return k}),D.d(he,"h",function(){return K}),D.d(he,"n",function(){return I}),D.d(he,"c",function(){return r}),D.d(he,"a",function(){return M}),D.d(he,"i",function(){return _}),D.d(he,"o",function(){return p}),D.d(he,"e",function(){return a}),D.d(he,"d",function(){return o}),D.d(he,"p",function(){return c}),D.d(he,"b",function(){return s});function Z(i){return Array.isArray(i)}function V(i){return typeof i=="string"}function U(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function G(i){return typeof i=="number"&&!isNaN(i)}function P(i){return i===!0||i===!1}function k(i){return typeof i=="undefined"}function K(i){return!I(i)}function I(i){return k(i)||i===null}function r(i,n){if(!i)throw new Error(n?`Unexpected type, expected '${n}'`:"Unexpected type")}function M(i){if(I(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function _(i){return typeof i=="function"}function p(i,n){const O=Math.min(i.length,n.length);for(let T=0;T<O;T++)m(i[T],n[T])}function m(i,n){if(V(n)){if(typeof i!==n)throw new Error(`argument does not match constraint: typeof ${n}`)}else if(_(n)){try{if(i instanceof n)return}catch(O){}if(!I(i)&&i.constructor===n)return;if(n.length===1&&n.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(i){let n=[],O=Object.getPrototypeOf(i);for(;Object.prototype!==O;)n=n.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return n}function a(i){const n=[];for(const O of u(i))typeof i[O]=="function"&&n.push(O);return n}function o(i,n){const O=C=>function(){const R=Array.prototype.slice.call(arguments,0);return n(C,R)};let T={};for(const C of i)T[C]=O(C);return T}function c(i){return i===null?void 0:i}function s(i,n="Unreachable"){throw new Error(n)}},"7Cbv":function(Gt,he,D){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function U(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(V)}var G=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(m){return typeof m=="string"&&G.test(m)}for(var k=P,K=[],I=0;I<256;++I)K.push((I+256).toString(16).substr(1));function r(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(K[m[u+0]]+K[m[u+1]]+K[m[u+2]]+K[m[u+3]]+"-"+K[m[u+4]]+K[m[u+5]]+"-"+K[m[u+6]]+K[m[u+7]]+"-"+K[m[u+8]]+K[m[u+9]]+"-"+K[m[u+10]]+K[m[u+11]]+K[m[u+12]]+K[m[u+13]]+K[m[u+14]]+K[m[u+15]]).toLowerCase();if(!k(a))throw TypeError("Stringified UUID is invalid");return a}var M=r;function _(m,u,a){m=m||{};var o=m.random||(m.rng||U)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,u){a=a||0;for(var c=0;c<16;++c)u[a+c]=o[c];return u}return M(o)}var p=he.a=_},"7ahc":function(Gt,he,D){"use strict";D.d(he,"a",function(){return O});var Z=D("k1fw"),V=D("0Owb"),U=D("+L6B"),G=D("2/Rp"),P=D("y8nQ"),k=D("Vl3Y"),K=D("tJVT"),I=D("OaEy"),r=D("2fM7"),M=D("q1tI"),_=D.n(M),p=D("VrN/"),m=D.n(p),u=D("p77/"),a=D.n(u),o=D("c5Ni"),c=D.n(o),s=r.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},n={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};he.b=function(T){var C=T.callback,R=T.onCancel,S=Object(M.useState)("python"),v=Object(K.a)(S,2),E=v[0],f=v[1];function h(g){f(n[g][1])}function y(g){C(g)}return _.a.createElement(k.a,Object(V.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),_.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},_.a.createElement(r.a,{onChange:h},Object.keys(n).map(function(g){return _.a.createElement(s,{key:g,value:g},n[g][0])}))),_.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},_.a.createElement(O,{mode:E})),_.a.createElement("div",{className:"flex-container flex-end"},_.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(G.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function O(T){var C=T.value,R=T.onChange,S=T.mode,v=T.options,E=v===void 0?{}:v,f=Object(M.useRef)(),h=Object(M.useState)(),y=Object(K.a)(h,2),g=y[0],x=y[1];return Object(M.useEffect)(function(){if(g){function j(B){var A=B.getValue();R&&R(A)}return g.on("change",j),function(){g.off("change",j)}}},[g,R]),Object(M.useEffect)(function(){g&&g.setOption("mode",S)},[g,S]),Object(M.useEffect)(function(){g&&((C!==g.getValue()||C==="")&&setTimeout(function(){g.setValue(C||" ")},300))},[g,C]),Object(M.useEffect)(function(){if(f.current&&!g){var j=m.a.fromTextArea(f.current,Object(Z.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));x(j)}},[f.current,g]),_.a.createElement("div",{className:"my-codemirror-container"},_.a.createElement("textarea",{ref:f}))}},"7ixt":function(Gt,he,D){"use strict";D.d(he,"a",function(){return U});var Z={adjustX:1,adjustY:1},V=[0,0],U={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:V}},G=U},"815F":function(Gt,he,D){"use strict";D.d(he,"e",function(){return K}),D.d(he,"c",function(){return r}),D.d(he,"d",function(){return M}),D.d(he,"a",function(){return p}),D.d(he,"f",function(){return m}),D.d(he,"b",function(){return u});var Z=D("KQm4"),V=D("VTBJ"),U=D("Ff2n"),G=D("Zm9Q"),P=D("Kwbf"),k=D("OZM5");function K(a,o){return a!=null?a:o}function I(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=new Map;function c(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(n){var O=n.key,T=n.children;Object(P.a)(O!=null,"Tree node must have a certain key: [".concat(i).concat(O,"]"));var C=String(O);Object(P.a)(!o.has(C)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(C)),o.set(C,!0),c(T,"".concat(i).concat(C," > "))})}c(a)}function r(a){function o(c){var s=Object(G.a)(c);return s.map(function(i){if(!Object(k.i)(i))return Object(P.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var n=i.key,O=i.props,T=O.children,C=Object(U.a)(O,["children"]),R=Object(V.a)({key:n},C),S=o(T);return S.length&&(R.children=S),R}).filter(function(i){return i})}return o(a)}function M(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(o===!0?[]:o),s=[];function i(n){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(T,C){var R=Object(k.h)(O?O.pos:"0",C),S=K(T.key,R),v=Object(V.a)(Object(V.a)({},T),{},{parent:O,pos:R,children:null,data:T,isStart:[].concat(Object(Z.a)(O?O.isStart:[]),[C===0]),isEnd:[].concat(Object(Z.a)(O?O.isEnd:[]),[C===n.length-1])});return s.push(v),o===!0||c.has(S)?v.children=i(T.children||[],v):v.children=[],v})}return i(a),s}function _(a,o,c){var s;c?typeof c=="string"?s=function(O){return O[c]}:typeof c=="function"&&(s=function(O){return c(O)}):s=function(O,T){return K(O.key,T)};function i(n,O,T){var C=n?n.children:a,R=n?Object(k.h)(T.pos,O):"0";if(n){var S=s(n,R),v={node:n,index:O,pos:R,key:S,parentPos:T.node?T.pos:null,level:T.level+1};o(v)}C&&C.forEach(function(E,f){i(E,f,{node:n,pos:R,level:T?T.level+1:-1})})}i(null)}function p(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=o.initWrapper,s=o.processEntity,i=o.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,O={},T={},C={posEntities:O,keyEntities:T};return c&&(C=c(C)||C),_(a,function(R){var S=R.node,v=R.index,E=R.pos,f=R.key,h=R.parentPos,y=R.level,g={node:S,index:v,key:f,pos:E,level:y},x=K(f,E);O[E]=g,T[x]=g,g.parent=O[h],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),s&&s(g,C)},n),i&&i(C),C}function m(a,o){var c=o.expandedKeys,s=o.selectedKeys,i=o.loadedKeys,n=o.loadingKeys,O=o.checkedKeys,T=o.halfCheckedKeys,C=o.dragOverNodeKey,R=o.dropPosition,S=o.keyEntities,v=S[a],E={eventKey:a,expanded:c.indexOf(a)!==-1,selected:s.indexOf(a)!==-1,loaded:i.indexOf(a)!==-1,loading:n.indexOf(a)!==-1,checked:O.indexOf(a)!==-1,halfChecked:T.indexOf(a)!==-1,pos:String(v?v.pos:""),dragOver:C===a&&R===0,dragOverGapTop:C===a&&R===-1,dragOverGapBottom:C===a&&R===1};return E}function u(a){var o=a.data,c=a.expanded,s=a.selected,i=a.checked,n=a.loaded,O=a.loading,T=a.halfChecked,C=a.dragOver,R=a.dragOverGapTop,S=a.dragOverGapBottom,v=a.pos,E=a.active,f=Object(V.a)(Object(V.a)({},o),{},{expanded:c,selected:s,checked:i,loaded:n,loading:O,halfChecked:T,dragOver:C,dragOverGapTop:R,dragOverGapBottom:S,pos:v,active:E});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),f}},"8EBN":function(Gt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";Z.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 V=0;V<Z.modeInfo.length;V++){var U=Z.modeInfo[V];U.mimes&&(U.mime=U.mimes[0])}Z.findModeByMIME=function(G){G=G.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var k=Z.modeInfo[P];if(k.mime==G)return k;if(k.mimes){for(var K=0;K<k.mimes.length;K++)if(k.mimes[K]==G)return k}}if(/\+xml$/.test(G))return Z.findModeByMIME("application/xml");if(/\+json$/.test(G))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(G){G=G.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var k=Z.modeInfo[P];if(k.ext){for(var K=0;K<k.ext.length;K++)if(k.ext[K]==G)return k}}},Z.findModeByFileName=function(G){for(var P=0;P<Z.modeInfo.length;P++){var k=Z.modeInfo[P];if(k.file&&k.file.test(G))return k}var K=G.lastIndexOf("."),I=K>-1&&G.substring(K+1,G.length);if(I)return Z.findModeByExtension(I)},Z.findModeByName=function(G){G=G.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var k=Z.modeInfo[P];if(k.name.toLowerCase()==G)return k;if(k.alias){for(var K=0;K<k.alias.length;K++)if(k.alias[K].toLowerCase()==G)return k}}}})},"8HAY":function(Gt,he,D){"use strict";D.d(he,"a",function(){return P}),D.d(he,"b",function(){return k}),D.d(he,"d",function(){return K}),D.d(he,"e",function(){return I}),D.d(he,"c",function(){return r});var Z=D("MI8n"),V=D("pmY6"),U=D("3/fG"),G=function(M,_,p,m){function u(a){return a instanceof p?a:new p(function(o){o(a)})}return new(p||(p=Promise))(function(a,o){function c(n){try{i(m.next(n))}catch(O){o(O)}}function s(n){try{i(m.throw(n))}catch(O){o(O)}}function i(n){n.done?a(n.value):u(n.value).then(c,s)}i((m=m.apply(M,_||[])).next())})};class P extends V.a{constructor(M,_="",p="",m=!0,u){super();this._onDidChange=this._register(new Z.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=M,this._label=_,this._cssClass=p,this._enabled=m,this._actionCallback=u}get id(){return this._id}get label(){return this._label}set label(M){this._setLabel(M)}_setLabel(M){this._label!==M&&(this._label=M,this._onDidChange.fire({label:M}))}get tooltip(){return this._tooltip||""}set tooltip(M){this._setTooltip(M)}_setTooltip(M){this._tooltip!==M&&(this._tooltip=M,this._onDidChange.fire({tooltip:M}))}get class(){return this._cssClass}set class(M){this._setClass(M)}_setClass(M){this._cssClass!==M&&(this._cssClass=M,this._onDidChange.fire({class:M}))}get enabled(){return this._enabled}set enabled(M){this._setEnabled(M)}_setEnabled(M){this._enabled!==M&&(this._enabled=M,this._onDidChange.fire({enabled:M}))}get checked(){return this._checked}set checked(M){this._setChecked(M)}_setChecked(M){this._checked!==M&&(this._checked=M,this._onDidChange.fire({checked:M}))}run(M,_){return G(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(M))})}}class k extends V.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new Z.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Z.b),this.onDidRun=this._onDidRun.event}run(M,_){return G(this,void 0,void 0,function*(){if(!M.enabled)return;this._onBeforeRun.fire({action:M});let p;try{yield this.runAction(M,_)}catch(m){p=m}this._onDidRun.fire({action:M,error:p})})}runAction(M,_){return G(this,void 0,void 0,function*(){yield M.run(_)})}}class K extends P{constructor(M){super(K.ID,M,M?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class I{constructor(M,_,p,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=M,this.label=_,this.class=m,this._actions=p}get actions(){return this._actions}dispose(){}run(){return G(this,void 0,void 0,function*(){})}}class r extends P{constructor(){super(r.ID,U.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(Gt,he,D){Gt.exports={button:"button___1wy9m"}},"9Bee":function(Gt,he,D){"use strict";var Z=D("DYRE"),V=D("zeV3"),U=D("+L6B"),G=D("2/Rp"),P=D("k1fw"),k=D("9og8"),K=D("tJVT"),I=D("WmNS"),r=D.n(I),M=D("q1tI"),_=D.n(M),p=D("vg9a"),m=D("DlQD"),u=D.n(m),a=D("rUJ1");function o(X,L){var N=X.match(/^(\s+)(?:```)/);if(N===null)return L;var z=N[1];return L.split(`
`).map(function(ne){var J=ne.match(/^\s+/);if(J===null)return ne;var je=Object(K.a)(J,1),$t=je[0];return $t.length>=z.length?ne.slice(z.length):ne}).join(`
`)}var c=[],s=["<ul>"],i=new u.a.Renderer,n=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){c.length=0,s=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(X,L,N,z){if(L>=X.length||X[L].level<=N)return L;var ne=X[L];z.push("<li><a href='#"+ne.anchor+"'>"+ne.text+"</a>"),L++;var J=[];return L=C(X,L,ne.level,J),J.length>0&&(z.push("<ul>"),J.forEach(function(je){z.push(je)}),z.push("</ul>")),z.push("</li>"),L=C(X,L,N,z),L}function R(){return C(c,0,0,s),s.push("</ul>"),s.join("")}var S={heading:function(L){var N=n.exec(L);if(N)return{type:"heading",raw:N[0],depth:N[1].length,text:N[2]}},fences:function(L){var N=this.rules.block.fences.exec(L);if(N){var z=N[0],ne=o(z,N[3]||""),J=N[2]?N[2].trim():N[2];if(["latex","katex","math"].indexOf(J)>=0){var je=f(),$t=ne;ne=je,h[je]={type:"block",expression:$t}}return{type:"code",raw:z,lang:J,text:ne}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,f=function(){return"__special_katext_id_".concat(E++,"__")},h={};function y(){return h}function g(){E=0,h={}}function x(X){return X=X.replace(v,function(L,N){var z=f();return h[z]={type:"inline",expression:N},z}),X}var j=i.listitem;i.listitem=function(X){return j(x(X))};var B=i.paragraph;i.paragraph=function(X){return B(x(X))};var A=i.tablecell;i.tablecell=function(X,L){return A(x(X),L)},i.code=function(X,L,N){var z=(L||"").match(/\S*/)[0];return z?["latex","katex","math"].indexOf(z)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(N?X:Object(a.escape)(X,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(N?X:Object(a.escape)(X,!0))+"</code></pre>"},i.heading=function(X,L,N){var z=this.options.headerPrefix+N.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:z,level:L,text:X}),"<h"+L+' id="'+z+'">'+X+"</h"+L+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:S,renderer:i});var H=u.a,F=D("SJMd"),w=D("ulZh"),Y=D.n(w),q=D("m3rI"),ie=D("Oy/b"),ge=D("p5ED"),Je=D("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var xe=function(X,L){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,z){N.__proto__=z}||function(N,z){for(var ne in z)Object.prototype.hasOwnProperty.call(z,ne)&&(N[ne]=z[ne])})(X,L)};function ke(X,L){function N(){this.constructor=X}xe(X,L),X.prototype=L===null?Object.create(L):(N.prototype=L.prototype,new N)}function Qe(X,L,N,z){return new(N||(N=Promise))(function(ne,J){function je(Jn){try{In(z.next(Jn))}catch(ln){J(ln)}}function $t(Jn){try{In(z.throw(Jn))}catch(ln){J(ln)}}function In(Jn){var ln;Jn.done?ne(Jn.value):(ln=Jn.value,ln instanceof N?ln:new N(function(tr){tr(ln)})).then(je,$t)}In((z=z.apply(X,L||[])).next())})}function Ye(X,L){var N,z,ne,J,je={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return J={next:$t(0),throw:$t(1),return:$t(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function $t(In){return function(Jn){return function(ln){if(N)throw new TypeError("Generator is already executing.");for(;je;)try{if(N=1,z&&(ne=2&ln[0]?z.return:ln[0]?z.throw||((ne=z.return)&&ne.call(z),0):z.next)&&!(ne=ne.call(z,ln[1])).done)return ne;switch(z=0,ne&&(ln=[2&ln[0],ne.value]),ln[0]){case 0:case 1:ne=ln;break;case 4:return je.label++,{value:ln[1],done:!1};case 5:je.label++,z=ln[1],ln=[0];continue;case 7:ln=je.ops.pop(),je.trys.pop();continue;default:if(!(ne=je.trys,(ne=ne.length>0&&ne[ne.length-1])||ln[0]!==6&&ln[0]!==2)){je=0;continue}if(ln[0]===3&&(!ne||ln[1]>ne[0]&&ln[1]<ne[3])){je.label=ln[1];break}if(ln[0]===6&&je.label<ne[1]){je.label=ne[1],ne=ln;break}if(ne&&je.label<ne[2]){je.label=ne[2],je.ops.push(ln);break}ne[2]&&je.ops.pop(),je.trys.pop();continue}ln=L.call(X,je)}catch(tr){ln=[6,tr],z=0}finally{N=ne=0}if(5&ln[0])throw ln[1];return{value:ln[0]?ln[1]:void 0,done:!0}}([In,Jn])}}}function ve(){for(var X=0,L=0,N=arguments.length;L<N;L++)X+=arguments[L].length;var z=Array(X),ne=0;for(L=0;L<N;L++)for(var J=arguments[L],je=0,$t=J.length;je<$t;je++,ne++)z[ne]=J[je];return z}var fe=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(L,N){for(var z=0,ne=N;z<ne.length;z++){var J=ne[z],je=J[0],$t=J[1];L.setAttribute(je,$t)}},X.createRect=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",N.toString()),z&&X.setAttributes(ne,z),ne},X.createLine=function(L,N,z,ne,J){var je=document.createElementNS("http://www.w3.org/2000/svg","line");return je.setAttribute("x1",L.toString()),je.setAttribute("y1",N.toString()),je.setAttribute("x2",z.toString()),je.setAttribute("y2",ne.toString()),J&&X.setAttributes(je,J),je},X.createPolygon=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",L),N&&X.setAttributes(z,N),z},X.createCircle=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(L/2).toString()),z.setAttribute("cy",(L/2).toString()),z.setAttribute("r",L.toString()),N&&X.setAttributes(z,N),z},X.createEllipse=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(N/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(N/2).toString()),z&&X.setAttributes(ne,z),ne},X.createGroup=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&X.setAttributes(N,L),N},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(L,N,z,ne,J,je,$t){var In=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(In,[["id",L],["orient",N],["markerWidth",z.toString()],["markerHeight",ne.toString()],["refX",J.toString()],["refY",je.toString()]]),In.appendChild($t),In},X.createText=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),L&&X.setAttributes(N,L),N},X.createTSpan=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=L,N&&X.setAttributes(z,N),z},X.createImage=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&X.setAttributes(N,L),N},X.createPoint=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=L,z.y=N,z},X.createPath=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",L),N&&X.setAttributes(z,N),z},X}(),at=function(){function X(){}return X.addKey=function(L){X.key=L},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Jt=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(L,N,z){var ne=this;return new Promise(function(J){var je=z!==void 0?z:document.createElement("canvas");L===null&&(ne.markersOnly=!0,ne.naturalSize=!1);var $t=document.createElementNS("http://www.w3.org/2000/svg","svg");$t.setAttribute("xmlns","http://www.w3.org/2000/svg"),$t.setAttribute("width",N.width.baseVal.valueAsString),$t.setAttribute("height",N.height.baseVal.valueAsString),$t.setAttribute("viewBox","0 0 "+N.viewBox.baseVal.width.toString()+" "+N.viewBox.baseVal.height.toString()),$t.innerHTML=N.innerHTML,ne.naturalSize===!0?($t.width.baseVal.value=L.naturalWidth,$t.height.baseVal.value=L.naturalHeight):ne.width!==void 0&&ne.height!==void 0&&($t.width.baseVal.value=ne.width,$t.height.baseVal.value=ne.height),je.width=$t.width.baseVal.value,je.height=$t.height.baseVal.value;var In=$t.outerHTML,Jn=je.getContext("2d");ne.markersOnly!==!0&&Jn.drawImage(L,0,0,je.width,je.height);var ln=window.URL,tr=new Image(je.width,je.height);tr.setAttribute("crossOrigin","anonymous");var qn=new Blob([In],{type:"image/svg+xml"}),kr=ln.createObjectURL(qn);tr.onload=function(){Jn.drawImage(tr,0,0),ln.revokeObjectURL(kr);var li=je.toDataURL(ne.imageType,ne.imageQuality);J(li)},tr.src=kr})},X}(),Ft=function(){},St=function(){function X(L){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},X.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new ze("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new gt("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new gt("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},X.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),ze=function(X,L){this.selector=X,this.style=L},gt=function(X,L){this.localName=X,this.style=L},ct=function(){function X(L,N,z,ne,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=L,this.displayMode=N,this.markerItems=z,this.uiStyleSettings=ne,this.styles=J,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(L){var N=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(J){var je=document.createElement("div");je.className=""+N.toolbarButtonStyleClass.name,je.setAttribute("data-type-name",J.typeName),je.innerHTML=J.icon,je.addEventListener("click",function(){N.markerToolbarButtonClicked(je,J)}),N.buttons.push(je),N.markerButtons.push(je)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",ne.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ne),this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(L){this.buttonClickListeners.push(L)},X.prototype.removeButtonClickListener=function(L){this.buttonClickListeners.indexOf(L)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(L),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var L=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var N=0;N<this.markerButtons.length;N++)N<L||N===L&&this.markerButtons.length-1===L?this.markerButtonBlock.appendChild(this.markerButtons[N]):(N===L&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[N]))}},X.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},X.prototype.resetButtonStyles=function(){var L=this;this.buttons.forEach(function(N){N.className=N.className.replace(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name,"").trim(),N.className=N.className.replace(L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:L.toolbarActiveButtonStyleColorsClass.name,"").trim(),N.className+=" "+(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(L,N,z){var ne=this,J=document.createElement("div");switch(J.className=""+this.toolbarButtonStyleClass.name,J.innerHTML=N,J.setAttribute("data-action",z),J.addEventListener("click",function(){ne.actionToolbarButtonClicked(J,z)}),z){case"select":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":J.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":J.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":J.style.fill=this.uiStyleSettings.closeButtonColor}L.appendChild(J),this.buttons.push(J)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new gt("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new gt("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new gt("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new gt("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new gt("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new gt("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new gt("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new gt("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},X.prototype.markerToolbarButtonClicked=function(L,N){this.setActiveButton(L),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",N)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(L,N){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",N)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(L){this.resetButtonStyles(),L.className=L.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),L.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(L){var N=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===L});N&&this.setActiveButton(N)},X.prototype.setCurrentMarker=function(L){var N=this;this.currentMarker=L,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){N.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},X}(),jt=function(){function X(L,N,z,ne){this.panels=[],this.panelButtons=[],this.markerjsContainer=L,this.displayMode=N,this.uiStyleSettings=z,this.styles=ne,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var L;this.toolboxStyleClass=this.styles.addClass(new gt("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 gt("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new gt("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new gt("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new gt("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 gt("toolbox-panel-row_colors",`
background-color: `+((L=this.uiStyleSettings.toolboxBackgroundColor)!==null&&L!==void 0?L:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new gt("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
padding: `+N+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new gt("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new gt("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(L){var N;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolboxStyleClass.name+" "+((N=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(L){var N,z,ne=this;this.panels=L,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var je;J.uiStyleSettings=ne.uiStyleSettings;var $t=document.createElement("div");$t.className=ne.toolboxButtonStyleClass.name+" "+((je=ne.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:ne.toolboxButtonStyleColorsClass.name),$t.innerHTML=J.icon,$t.title=J.title,$t.addEventListener("click",function(){ne.panelButtonClick(J)}),ne.panelButtons.push($t),ne.buttonRow.appendChild($t)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(L){var N=this,z=-1;if(L!==this.activePanel){z=this.panels.indexOf(L),this.panelRow.innerHTML="";var ne=L.getUi();ne.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ne),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=L}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){N.displayMode==="inline"?N.panelRow.style.display="none":N.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,je){var $t,In;J.className=N.toolboxButtonStyleClass.name+" "+(je===z?""+(($t=N.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&$t!==void 0?$t:N.toolboxActiveButtonStyleColorsClass.name):""+((In=N.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&In!==void 0?In:N.toolboxButtonStyleColorsClass.name))})},X}(),oe=function(X,L){this.title=X,this.icon=L},Ne=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return je.colors=[],je.addTransparent=!1,je.colorBoxes=[],je.colors=z,je.currentColor=ne,je.setCurrentColor=je.setCurrentColor.bind(je),je.getColorBox=je.getColorBox.bind(je),je}return ke(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(ne){var J=N.getColorBox(ne);z.appendChild(J),N.colorBoxes.push(J)}),z},L.prototype.getColorBox=function(N){var z=this,ne=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-ne,je=document.createElement("div");je.style.display="inline-block",je.style.boxSizing="content-box",je.style.width=J-2+"px",je.style.height=J-2+"px",je.style.padding="1px",je.style.marginRight="2px",je.style.marginBottom="2px",je.style.borderWidth="2px",je.style.borderStyle="solid",je.style.borderRadius=(J+2)/2+"px",je.style.borderColor=N===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",je.addEventListener("click",function(){z.setCurrentColor(N,je)});var $t=document.createElement("div");return $t.style.display="inline-block",$t.style.width=J-2+"px",$t.style.height=J-2+"px",$t.style.backgroundColor=N,$t.style.borderRadius=J/2+"px",N==="transparent"&&($t.style.fill=this.uiStyleSettings.toolboxAccentColor,$t.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),je.appendChild($t),je},L.prototype.setCurrentColor=function(N,z){var ne=this;this.currentColor=N,this.colorBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(N)},L}(oe),Ge=function(){function X(L,N,z){this._state="new",this._isSelected=!1,this._container=L,this._overlayContainer=N,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(L){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(L,N){},X.prototype.dblClick=function(L,N){},X.prototype.manipulate=function(L){},X.prototype.pointerUp=function(L){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(L){this.container.childNodes.length>0?this.container.insertBefore(L,this.container.childNodes[0]):this.container.appendChild(L)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(L){this._state=L.state,this.notes=L.notes},X.prototype.scale=function(L,N){},X.prototype.colorChanged=function(L){this.onColorChanged&&this.onColorChanged(L),this.stateChanged()},X.prototype.fillColorChanged=function(L){this.onFillColorChanged&&this.onFillColorChanged(L),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var L=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),L.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(L)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Xe=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(L){return this.topLeft.ownsTarget(L)?this.topLeft:this.topCenter.ownsTarget(L)?this.topCenter:this.topRight.ownsTarget(L)?this.topRight:this.centerLeft.ownsTarget(L)?this.centerLeft:this.centerRight.ownsTarget(L)?this.centerRight:this.bottomLeft.ownsTarget(L)?this.bottomLeft:this.bottomCenter.ownsTarget(L)?this.bottomCenter:this.bottomRight.ownsTarget(L)?this.bottomRight:void 0},X}(),Bt=function(){function X(){this.GRIP_SIZE=10,this.visual=fe.createGroup(),this.visual.appendChild(fe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(fe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},X}(),Wt=function(){function X(){}return X.toITransformMatrix=function(L){return{a:L.a,b:L.b,c:L.c,d:L.d,e:L.e,f:L.f}},X.toSVGMatrix=function(L,N){return L.a=N.a,L.b=N.b,L.c=N.c,L.d=N.d,L.e=N.e,L.f=N.f,L},X}(),en=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(fe.createTransform()),J.setupControlBox(),J}return ke(L,X),Object.defineProperty(L.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"visual",{get:function(){return this._visual},set:function(N){this._visual=N;var z=fe.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!!(this.controlGrips.findGripByVisual(N)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N))},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.left=N.x,this.top=N.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ne=this.unrotatePoint(N);if(this.manipulationStartX=ne.x,this.manipulationStartY=ne.y,this.offsetX=ne.x-this.left,this.offsetY=ne.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var je=this.container.transform.baseVal.getItem(0);je.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(je,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},L.prototype.pointerUp=function(N){var z=this.state;X.prototype.pointerUp.call(this,N),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(N),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},L.prototype.moveVisual=function(N){this.visual.style.transform="translate("+N.x+"px, "+N.y+"px)"},L.prototype.manipulate=function(N){var z=this.unrotatePoint(N);this.state==="creating"?this.resize(N):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(N)},L.prototype.resize=function(N){var z=this.manipulationStartLeft,ne=this.manipulationStartWidth,J=this.manipulationStartTop,je=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+N.x-this.manipulationStartX,ne=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ne=this.manipulationStartWidth+N.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+N.y-this.manipulationStartY,je=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:je=this.manipulationStartHeight+N.y-this.manipulationStartY}ne>=0?(this.left=z,this.width=ne):(this.left=z+ne,this.width=-ne),je>=0?(this.top=J,this.height=je):(this.top=J+je,this.height=-je),this.setSize()},L.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},L.prototype.rotate=function(N){if(Math.abs(N.x-this.centerX)>.1){var z=Math.sign(N.x-this.centerX);this.rotationAngle=180*Math.atan((N.y-this.centerY)/(N.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},L.prototype.applyRotation=function(){var N=this.container.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(N,0)},L.prototype.rotatePoint=function(N){if(this.rotationAngle===0)return N;var z=this.container.getCTM(),ne=fe.createPoint(N.x,N.y);return{x:(ne=ne.matrixTransform(z)).x,y:ne.y}},L.prototype.unrotatePoint=function(N){if(this.rotationAngle===0)return N;var z=this.container.getCTM();z=z.inverse();var ne=fe.createPoint(N.x,N.y);return{x:(ne=ne.matrixTransform(z)).x,y:ne.y}},L.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=fe.createGroup();var N=fe.createTransform();N.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(N),this.container.appendChild(this.controlBox),this.controlRect=fe.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=fe.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 Xe,this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){var N=this.controlBox.transform.baseVal.getItem(0);N.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(N,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},L.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},L.prototype.createGrip=function(){var N=new Bt;return N.visual.transform.baseVal.appendItem(fe.createTransform()),this.controlBox.appendChild(N.visual),N},L.prototype.positionGrips=function(){var N=this.controlGrips.topLeft.GRIP_SIZE,z=-N/2,ne=z,J=(this.width+this.CB_DISTANCE)/2-N/2,je=(this.height+this.CB_DISTANCE)/2-N/2,$t=this.height+this.CB_DISTANCE-N/2,In=this.width+this.CB_DISTANCE-N/2;this.positionGrip(this.controlGrips.topLeft.visual,z,ne),this.positionGrip(this.controlGrips.topCenter.visual,J,ne),this.positionGrip(this.controlGrips.topRight.visual,In,ne),this.positionGrip(this.controlGrips.centerLeft.visual,z,je),this.positionGrip(this.controlGrips.centerRight.visual,In,je),this.positionGrip(this.controlGrips.bottomLeft.visual,z,$t),this.positionGrip(this.controlGrips.bottomCenter.visual,J,$t),this.positionGrip(this.controlGrips.bottomRight.visual,In,$t),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,ne-3*this.CB_DISTANCE)},L.prototype.positionGrip=function(N,z,ne){var J=N.transform.baseVal.getItem(0);J.setTranslate(z,ne),N.transform.baseVal.replaceItem(J,0)},L.prototype.hideControlBox=function(){this.controlBox.style.display="none"},L.prototype.showControlBox=function(){this.controlBox.style.display=""},L.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Wt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Wt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Wt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Wt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z);var ne=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:ne.x*N,y:ne.y*z});this.left=J.x,this.top=J.y,this.width=this.width*N,this.height=this.height*z,this.adjustControlBox()},L}(Ge),tt=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return ke(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},L.prototype.createVisual=function(){this.visual=fe.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},L.prototype.setSize=function(){X.prototype.setSize.call(this),fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&fe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},L.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&fe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&fe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&fe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){var z=N;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setSize()},L.title="Rectangle marker",L}(en),tn=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return je.widths=[],je.widthBoxes=[],je.widths=z,je.currentWidth=ne,je.setCurrentWidth=je.setCurrentWidth.bind(je),je}return ke(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ne===N.currentWidth?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentWidth(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.innerText=ne.toString(),je.style.marginRight="5px",J.appendChild(je);var $t=document.createElement("div");$t.style.minHeight="20px",$t.style.flexGrow="2",$t.style.display="flex",$t.style.alignItems="center";var In=document.createElement("hr");In.style.minWidth="20px",In.style.border="0px",In.style.borderTop=ne+"px solid "+N.uiStyleSettings.toolboxColor,In.style.flexGrow="2",$t.appendChild(In),J.appendChild($t),N.widthBoxes.push(J)}),z},L.prototype.setCurrentWidth=function(N,z){var ne=this;this.currentWidth=N,this.widthBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},L}(oe),En=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return je.styles=[],je.styleBoxes=[],je.styles=z,je.currentStyle=ne,je.setCurrentStyle=je.setCurrentStyle.bind(je),je}return ke(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/N.styles.length-5+"%",J.style.borderColor=ne===N.currentStyle?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentStyle(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.style.minHeight="20px",je.style.flexGrow="2",je.style.overflow="hidden";var $t=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+N.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ne!==""?'stroke-dasharray="'+ne+'"':"")+` />
</svg>`;je.innerHTML=$t,J.appendChild(je),N.styleBoxes.push(J)}),z},L.prototype.setCurrentStyle=function(N,z){var ne=this;this.currentStyle=N,this.styleBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},L}(oe),We=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ne("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new En("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return ke(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="FrameMarker",L.title="Frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',L}(tt),Fe=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},yt=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return ke(L,X),L.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!(!this.grip1.ownsTarget(N)&&!this.grip2.ownsTarget(N))},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.manipulationStartX=N.x,this.manipulationStartY=N.y,this.state==="new"&&(this.x1=N.x,this.y1=N.y,this.x2=N.x,this.y2=N.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},L.prototype.pointerUp=function(N){var z=this.state;X.prototype.pointerUp.call(this,N),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(N),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},L.prototype.adjustVisual=function(){},L.prototype.manipulate=function(N){this.state==="creating"?this.resize(N):this.state==="move"?(this.x1=this.manipulationStartX1+N.x-this.manipulationStartX,this.y1=this.manipulationStartY1+N.y-this.manipulationStartY,this.x2=this.manipulationStartX2+N.x-this.manipulationStartX,this.y2=this.manipulationStartY2+N.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(N)},L.prototype.resize=function(N){switch(this.activeGrip){case this.grip1:this.x1=N.x,this.y1=N.y;break;case this.grip2:case void 0:this.x2=N.x,this.y2=N.y}this.adjustVisual(),this.adjustControlBox()},L.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=fe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){this.positionGrips()},L.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},L.prototype.createGrip=function(){var N=new Bt;return N.visual.transform.baseVal.appendItem(fe.createTransform()),this.controlBox.appendChild(N.visual),N},L.prototype.positionGrips=function(){var N=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-N/2,this.y1-N/2),this.positionGrip(this.grip2.visual,this.x2-N/2,this.y2-N/2)},L.prototype.positionGrip=function(N,z,ne){var J=N.transform.baseVal.getItem(0);J.setTranslate(z,ne),N.transform.baseVal.replaceItem(J,0)},L.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.x1=this.x1*N,this.y1=this.y1*z,this.x2=this.x2*N,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},L}(Ge),At=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ne("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new En("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return ke(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorLine&&N!==this.visibleLine)},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.selectorLine=fe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=fe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},L.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),fe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),fe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},L.typeName="LineMarker",L.title="Line marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',L}(yt),nt=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return je.fonts=[],je.fontBoxes=[],je.fonts=z,je.currentFont=ne,je.setCurrentFont=je.setCurrentFont.bind(je),je}return ke(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(ne){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/N.fonts.length-5+"%",J.style.borderColor=ne===N.currentFont?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentFont(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.style.display="flex",je.style.minHeight="20px",je.style.flexGrow="2",je.style.fontFamily=ne,je.style.overflow="hidden";var $t=document.createElement("div");$t.style.whiteSpace="nowrap",$t.style.overflow="hidden",$t.style.textOverflow="ellipsis",$t.innerHTML="The quick brown fox jumps over the lazy dog",je.appendChild($t),J.appendChild(je),N.fontBoxes.push(J)}),z},L.prototype.setCurrentFont=function(N,z){var ne=this;this.currentFont=N,this.fontBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},L}(oe),st=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=ne.defaultColor,J.fontFamily=ne.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new Ne("Color",ne.defaultColorSet,ne.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new nt("Font",ne.defaultFontFamilies,ne.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return ke(L,X),L.prototype.ownsTarget=function(N){if(X.prototype.ownsTarget.call(this,N)||N===this.visual||N===this.textElement||N===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(ne){ne===N&&(z=!0)}),z},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.bgRectangle=fe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=fe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(fe.createTransform()),this.textElement.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.isMoved=!1,this.pointerDownPoint=N,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.renderText=function(){var N=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(z){N.textElement.appendChild(fe.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},L.prototype.getTextScale=function(){var N=this.textElement.getBBox(),z=1;if(N.width>0&&N.height>0){var ne=(1*this.width-this.width*this.padding*2/100)/N.width,J=(1*this.height-this.height*this.padding*2/100)/N.height;z=Math.min(ne,J)}return z},L.prototype.getTextPosition=function(N){var z=this.textElement.getBBox(),ne=0,J=0;return z.width>0&&z.height>0&&(ne=(this.width-z.width*N)/2,J=this.height/2-z.height*N/2),{x:ne,y:J}},L.prototype.sizeText=function(){var N=this.textElement.getBBox(),z=this.getTextScale(),ne=this.getTextPosition(z);ne.y-=N.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ne.x+"px, "+ne.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ne.x,ne.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(N.x-this.pointerDownPoint.x)>5||Math.abs(N.y-this.pointerDownPoint.y)>5)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.isMoved=!0,this.setSize(),this.sizeText()},L.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},L.prototype.pointerUp=function(N){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,N),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},L.prototype.showTextEditor=function(){var N=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(N.textEditor.style.fontSize);N.textEditor.clientWidth>=Number.parseInt(N.textEditor.style.maxWidth)&&z>.9;)z-=.1,N.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var ne=z.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(ne)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){N.textEditDivClicked(N.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},L.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var N=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ne=this.textElement.getBBox(),J={x:ne.width*N,y:ne.height*N};z.x-=J.x/2,z.y-=J.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*N,12)+"px",this.textElement.style.display="none"}},L.prototype.textEditDivClicked=function(N){this.text=N.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},L.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},L.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},L.prototype.dblClick=function(N,z){X.prototype.dblClick.call(this,N,z),this.showTextEditor()},L.prototype.setColor=function(N){this.textElement&&fe.setAttributes(this.textElement,[["fill",N]]),this.color=N,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(N)},L.prototype.setFont=function(N){this.textElement&&fe.setAttributes(this.textElement,[["font-family",N]]),this.fontFamily=N,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},L.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},L.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var z=N;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setSize(),this.sizeText(),this.positionTextEditor()},L.typeName="TextMarker",L.title="Text marker",L.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',L}(en),De=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=ne.defaultColor,J.lineWidth=ne.defaultStrokeWidth,J.pixelRatio=ne.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new Ne("Color",ne.defaultColorSet,ne.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return ke(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.drawingImage)},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.drawingImage=fe.createImage(),this.visual.appendChild(this.drawingImage);var N=fe.createTransform();this.visual.transform.baseVal.appendItem(N),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(N.x,N.y),this.drawing=!0):X.prototype.pointerDown.call(this,N,z)},L.prototype.manipulate=function(N){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(N.x,N.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(N){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,N)},L.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},L.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},L.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},L.prototype.finishCreation=function(){for(var N=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ne=z[0],J=z[1],je=z[2],$t=z[3],In=!1,Jn=0;Jn<this.canvasElement.height;Jn++)for(var ln=0;ln<this.canvasElement.width;ln++)N.data[Jn*this.canvasElement.width*4+4*ln+3]>0&&(In=!0,Jn<J&&(J=Jn),ln<ne&&(ne=ln),Jn>$t&&($t=Jn),ln>je&&(je=ln));if(In){this.left=ne/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(je-ne)/this.pixelRatio,this.height=($t-J)/this.pixelRatio;var tr=document.createElement("canvas");tr.width=je-ne,tr.height=$t-J,tr.getContext("2d").putImageData(this.canvasContext.getImageData(ne,J,je-ne,$t-J),0,0),this.drawingImgUrl=tr.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},L.prototype.setDrawingImage=function(){fe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},L.prototype.setColor=function(N){this.color=N,this.colorChanged(N)},L.prototype.setLineWidth=function(N){this.lineWidth=N},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){this.createVisual(),X.prototype.restoreState.call(this,N),this.drawingImgUrl=N.drawingImgUrl,this.setDrawingImage()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setDrawingImage()},L.typeName="FreehandMarker",L.title="Freehand marker",L.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',L}(en),ye=function(X){function L(N,z,ne){var J=X.call(this,N,ne||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return J.typeBoxes=[],J.currentType=z,J.setCurrentType=J.setCurrentType.bind(J),J}return ke(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var ne=function($t){var In="both";switch($t){case 0:In="both";break;case 1:In="start";break;case 2:In="end";break;case 3:In="none"}var Jn=document.createElement("div");if(Jn.style.display="flex",Jn.style.flexGrow="2",Jn.style.alignItems="center",Jn.style.justifyContent="space-between",Jn.style.padding="5px",Jn.style.borderWidth="2px",Jn.style.borderStyle="solid",Jn.style.borderColor=In===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Jn.addEventListener("click",function(){N.setCurrentType(In,Jn)}),z.appendChild(Jn),In==="both"||In==="start"){var ln=document.createElement("div");ln.style.display="flex",ln.style.alignItems="center",ln.style.minHeight="20px",ln.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ln.style.marginLeft="5px",Jn.appendChild(ln)}var tr=document.createElement("div");tr.style.display="flex",tr.style.alignItems="center",tr.style.minHeight="20px",tr.style.flexGrow="2";var qn=document.createElement("hr");if(qn.style.minWidth="20px",qn.style.border="0px",qn.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),qn.style.flexGrow="2",tr.appendChild(qn),Jn.appendChild(tr),In==="both"||In==="end"){var kr=document.createElement("div");kr.style.display="flex",kr.style.alignItems="center",kr.style.minHeight="20px",kr.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,kr.style.marginRight="5px",Jn.appendChild(kr)}J.typeBoxes.push(Jn)},J=this,je=0;je<4;je++)ne(je);return z},L.prototype.setCurrentType=function(N,z){var ne=this;this.currentType=N,this.typeBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},L}(oe),we=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ye("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return ke(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.arrow1&&N!==this.arrow2)},L.prototype.getArrowPoints=function(N,z){var ne=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return N-ne/2+","+(z+J/2)+" "+N+","+(z-J/2)+" "+(N+ne/2)+","+(z+J/2)},L.prototype.createTips=function(){this.arrow1=fe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=fe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.arrow2)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",fe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),fe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(N,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var ne=this.arrow2.transform.baseVal.getItem(0);ne.setRotate(N+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ne,0)}},L.prototype.setArrowType=function(N){this.arrowType=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},L.typeName="ArrowMarker",L.title="Arrow marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',L}(At),ae=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.fillColor=ne.defaultFillColor,J.strokeWidth=0,J.fillPanel=new Ne("Color",ne.defaultColorSet,ne.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return ke(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="CoverMarker",L.title="Cover marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',L}(tt),se=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return je.opacities=[],je.opacityBoxes=[],je.opacities=z,je.currentOpacity=ne,je.setCurrentOpacity=je.setCurrentOpacity.bind(je),je}return ke(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ne===N.currentOpacity?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentOpacity(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.innerText=100*ne+"%",J.appendChild(je),N.opacityBoxes.push(J)}),z},L.prototype.setCurrentOpacity=function(N,z){var ne=this;this.currentOpacity=N,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},L}(oe),pe=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=ne.defaultHighlightColor,J.strokeWidth=0,J.opacity=ne.defaultHighlightOpacity,J.fillPanel=new Ne("Color",ne.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new se("Opacity",ne.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return ke(L,X),L.prototype.setOpacity=function(N){this.opacity=N,this.visual&&fe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="HighlightMarker",L.title="Highlight marker",L.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',L}(ae),_e='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',be=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=ne.defaultStrokeColor,J.bgColor=ne.defaultFillColor,J.fontFamily=ne.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new Ne("Text color",ne.defaultColorSet,J.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new Ne("Fill color",ne.defaultColorSet,J.bgColor,_e),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new nt("Font",ne.defaultFontFamilies,ne.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new Bt,J.tipGrip.visual.transform.baseVal.appendItem(fe.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return ke(L,X),L.prototype.ownsTarget=function(N){return X.prototype.ownsTarget.call(this,N)||this.tipGrip.ownsTarget(N)||this.tip===N},L.prototype.createTip=function(){fe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=fe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},L.prototype.pointerDown=function(N,z){this.state==="new"&&X.prototype.pointerDown.call(this,N,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,N,z)},L.prototype.pointerUp=function(N){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,N);else{var z=this.state==="creating";X.prototype.pointerUp.call(this,N),this.setTipPoints(z),this.positionTip()}},L.prototype.manipulate=function(N){if(this.tipMoving){var z=this.unrotatePoint(N);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,N)},L.prototype.setBgColor=function(N){this.bgRectangle&&this.tip&&(fe.setAttributes(this.bgRectangle,[["fill",N]]),fe.setAttributes(this.tip,[["fill",N]])),this.bgColor=N,this.fillColorChanged(N)},L.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},L.prototype.setTipPoints=function(N){N===void 0&&(N=!1);var z=Math.min(this.height/2,15),ne=this.height/5;N&&(this.tipPosition={x:z+ne/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+ne,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ne,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ne,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-ne},this.tipBase2Position={x:this.width,y:this.height-z}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+ne,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-ne})},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.positionTip()},L.prototype.positionTip=function(){fe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var N=this.tipGrip.visual.transform.baseVal.getItem(0);N.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(N,0)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},L.prototype.getState=function(){var N=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var z=N;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,X.prototype.restoreState.call(this,N),this.createTip(),this.setTipPoints()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.tipPosition={x:this.tipPosition.x*N,y:this.tipPosition.y*z},this.positionTip()},L.typeName="CalloutMarker",L.title="Callout marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',L}(st),Ke=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.fillColor=ne.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new Ne("Line color",ve(ne.defaultColorSet,["transparent"]),ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new Ne("Fill color",ve(ne.defaultColorSet,["transparent"]),J.fillColor,_e),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new En("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new se("Opacity",ne.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return ke(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},L.prototype.createVisual=function(){this.visual=fe.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},L.prototype.setSize=function(){X.prototype.setSize.call(this),fe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},L.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&fe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},L.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&fe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(N),this.stateChanged()},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&fe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&fe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.setOpacity=function(N){this.opacity=N,this.visual&&fe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var z=N;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setSize()},L.typeName="EllipseMarker",L.title="Ellipse marker",L.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',L}(en),Ot=function(X){function L(N,z,ne){return X.call(this,N,z,ne)||this}return ke(L,X),Object.defineProperty(L.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.tip1&&N!==this.tip2)},L.prototype.createTips=function(){this.tip1=fe.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=fe.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.tip2)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(fe.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(N,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var ne=this.tip2.transform.baseVal.getItem(0);ne.setRotate(N+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ne,0)}},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N),this.createTips(),this.adjustVisual()},L.typeName="MeasurementMarker",L.title="Measurement marker",L.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',L}(At),rn=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokePanel.colors=ne.defaultColorSet,J.fillColor="transparent",J}return ke(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="EllipseFrameMarker",L.title="Ellipse frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',L}(Ke),Dn=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(L){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(L)||(this.undoStack.push(L),JSON.stringify(this.lastRedoStep)!==JSON.stringify(L)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(L){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=L)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var L=this.undoStack.pop();return L!==void 0&&this.redoStack.push(L),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),bt=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ne("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new En("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return ke(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorCurve&&N!==this.visibleCurve&&!this.curveGrip.ownsTarget(N))},L.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.selectorCurve=fe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=fe.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=N.x,this.curveY=N.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},L.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),fe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),fe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=fe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=fe.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},L.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},L.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var N=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-N/2,this.curveY-N/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},L.prototype.manipulate=function(N){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+N.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+N.y-this.manipulationStartY),X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){this.activeGrip===this.curveGrip&&(this.curveX=N.x,this.curveY=N.y),X.prototype.resize.call(this,N),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual()},L.prototype.scale=function(N,z){this.curveX=this.curveX*N,this.curveY=this.curveY*z,X.prototype.scale.call(this,N,z)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},L.typeName="CurveMarker",L.title="Curve marker",L.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',L}(yt),Qt=function(){function X(L,N){N===void 0&&(N=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=L,this.cancelable=N}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),Et=function(X){function L(N,z,ne){var J=X.call(this,N,!1)||this;return J.dataUrl=z,J.state=ne,J}return ke(L,X),L}(Qt),Ct=function(X){function L(N,z,ne){ne===void 0&&(ne=!1);var J=X.call(this,N,ne)||this;return J.marker=z,J}return ke(L,X),L}(Qt),lt=function(){function X(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return X.prototype.addEventListener=function(L,N){this[L].push(N)},X.prototype.removeEventListener=function(L,N){var z=this[L].indexOf(N);z>-1&&this[L].splice(z,1)},X}(),de=function(){function X(L){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Fe,this._isOpen=!1,this.undoRedoManager=new Dn,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new lt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new St(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=L,this.targetRoot=document.body,this.width=L.clientWidth,this.height=L.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[We,De,we,st,rn,Ke,pe,be,Ot,ae,At,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[We,De,we,st,Ke,pe,be]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[We,De,we,st,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(L){var N=this;this._availableMarkerTypes.splice(0),L.forEach(function(z){if(typeof z=="string"){var ne=N.ALL_MARKER_TYPES.find(function(J){return J.typeName===z});ne!==void 0&&N._availableMarkerTypes.push(ne)}else N._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(L){this._zoomLevel=L,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),at.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var L=this;this.styles.styleSheetRoot===void 0&&Ft.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ft.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(N){return N(new Qt(L))})},X.prototype.render=function(){return Qe(this,void 0,void 0,function(){var L;return Ye(this,function(N){switch(N.label){case 0:return this.setCurrentMarker(),(L=new Jt).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.markersOnly=this.renderMarkersOnly,L.width=this.renderWidth,L.height=this.renderHeight,[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return N.sent(),[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,N.sent()]}})})},X.prototype.close=function(L){var N=this;if(L===void 0&&(L=!1),this.isOpen){var z=!1;L||this.eventListeners.beforeclose.forEach(function(ne){var J=new Qt(N,!0);ne(J),J.defaultPrevented&&(z=!0)}),z||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ne){return ne(new Qt(N))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var L,N=[],z=0;z<arguments.length;z++)N[z]=arguments[z];(L=this._availableMarkerTypes).push.apply(L,N)},X.prototype.addRenderEventListener=function(L){this.addEventListener("render",function(N){L(N.dataUrl,N.state)})},X.prototype.removeRenderEventListener=function(L){},X.prototype.addCloseEventListener=function(L){this.addEventListener("close",function(){L()})},X.prototype.removeCloseEventListener=function(L){},X.prototype.setupResizeObserver=function(){var L=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return L.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var L=1*this.target.clientWidth/this.target.clientHeight,N=this.editorCanvas.clientWidth/L>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*L:this.editorCanvas.clientWidth,z=N<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/L;this.resize(N,z)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(L,N){this._isResizing=!0;var z=L/this.imageWidth,ne=N/this.imageHeight;this.imageWidth=Math.round(L),this.imageHeight=Math.round(N),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(z,ne),this._isResizing=!1},X.prototype.scaleMarkers=function(L,N){var z,ne=this;this._currentMarker&&this._currentMarker instanceof st?this._currentMarker.scale(L,N):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==ne._currentMarker&&J.scale(L,N)}),z!==void 0&&this.setCurrentMarker(z)},X.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},X.prototype.setTopLeft=function(){var L=this.editingTarget.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=L.left-N.left,this.top=L.top-N.top},X.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},X.prototype.addDefs=function(){for(var L,N=[],z=0;z<arguments.length;z++)N[z]=arguments[z];this.defs=fe.createDefs(),this.addDefsToImage(),(L=this.defs).append.apply(L,N)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},X.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var L=document.createElement("a");L.href="https://markerjs.com/",L.target="_blank",L.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',L.title="Powered by marker.js",L.style.display="grid",L.style.alignItems="center",L.style.justifyItems="center",L.style.padding="3px",L.style.width="20px",L.style.height="20px",this.logoUI.appendChild(L),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new ct(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new jt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(L){this.markerImage.removeChild(L.container),this.markers.indexOf(L)>-1&&this.markers.splice(this.markers.indexOf(L),1),L.dispose()},X.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},X.prototype.toolbarButtonClicked=function(L,N){if(L==="marker"&&N!==void 0)this.createNewMarker(N);else if(L==="action")switch(N){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var L=this;if(this._currentMarker!==void 0){var N=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ne){var J=new Ct(L,L._currentMarker,!0);ne(J),J.defaultPrevented&&(N=!0)}),!N){var z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ne){return ne(new Ct(L,z))})}}},X.prototype.clear=function(){var L=this,N=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(je){var $t=new Ct(L,void 0,!0);je($t),$t.defaultPrevented&&(N=!0)}),!N)){this.setCurrentMarker();for(var z=function(je){var $t=ne.markers[je];ne.setCurrentMarker(ne.markers[je]),ne._currentMarker.dispose(),ne.markerImage.removeChild(ne._currentMarker.container),ne.markers.splice(ne.markers.indexOf(ne._currentMarker),1),ne.eventListeners.markerdelete.forEach(function(In){return In(new Ct(L,$t))})},ne=this,J=this.markers.length-1;J>=0;J--)z(J);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var L;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(L=this._currentMarker.notes)!==null&&L!==void 0?L:"",this.overlayContainer.appendChild(this.notesArea))},X.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var L=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var N=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===N.width&&z.height===N.height){var ne=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(N),ne<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new Qt(L))})}else this.undoRedoManager.replaceLastUndoStep(N),this.eventListeners.statechange.forEach(function(J){return J(new Qt(L))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var L=this,N=this.undoRedoManager.undo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Qt(L))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var L=this,N=this.undoRedoManager.redo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Qt(L))}))},X.prototype.stepZoom=function(){var L=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=L<this.zoomSteps.length-1?this.zoomSteps[L+1]:this.zoomSteps[0]},X.prototype.panTo=function(L){this.contentDiv.scrollBy({left:this.prevPanPoint.x-L.x,top:this.prevPanPoint.y-L.y}),this.prevPanPoint=L},X.prototype.startRenderAndClose=function(){return Qe(this,void 0,void 0,function(){var L,N,z=this;return Ye(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return L=ne.sent(),N=this.getState(),this.eventListeners.render.forEach(function(J){return J(new Et(z,L,N))}),this.close(!0),[2]}})})},X.prototype.getState=function(L){L===!0&&this.setCurrentMarker();var N={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return N.markers.push(z.getState())}),N},X.prototype.restoreState=function(L){var N=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);L.markers.forEach(function(z){var ne=N._availableMarkerTypes.find(function(je){return je.typeName===z.typeName});if(ne!==void 0){var J=N.addNewMarker(ne);J.restoreState(z),N.markers.push(J)}}),L.width&&L.height&&(L.width!==this.imageWidth||L.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/L.width,this.imageHeight/L.height),this.eventListeners.restorestate.forEach(function(z){return z(new Qt(N))})},X.prototype.addNewMarker=function(L){var N=fe.createGroup();return this.markerImage.appendChild(N),new L(N,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(L){var N,z=this;(N=typeof L=="string"?this._availableMarkerTypes.find(function(ne){return ne.typeName===L}):L)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(N),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(N.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ne){return ne(new Ct(z,z._currentMarker))}))},X.prototype.markerCreated=function(L){var N=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(L),this.setCurrentMarker(L),L instanceof De&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(De):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new Ct(N,N._currentMarker))})},X.prototype.colorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=L,this.settings.defaultStrokeColor=L)},X.prototype.fillColorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=L)},X.prototype.markerStateChanged=function(L){var N=this;this.eventListeners.markerchange.forEach(function(z){return z(new Ct(N,L))})},X.prototype.setCurrentMarker=function(L){var N=this;this._currentMarker!==L&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new Ct(N,N._currentMarker))})),this._currentMarker=L,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(z){return z(new Ct(N,N._currentMarker))}))},X.prototype.onPointerDown=function(L){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||L.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var N=this.markers.find(function(z){return z.ownsTarget(L.target)});N!==void 0?(this.setCurrentMarker(N),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:L.clientX,y:L.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY))},X.prototype.onDblClick=function(L){if(this._isFocused||this.focus(),this.mode==="select"){var N=this.markers.find(function(z){return z.ownsTarget(L.target)});N!==void 0&&N!==this._currentMarker&&this.setCurrentMarker(N),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(L){this.touchPoints!==1&&L.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||L.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(L.clientX,L.clientY)):this.zoomLevel>1&&this.panTo({x:L.clientX,y:L.clientY}))},X.prototype.onPointerUp=function(L){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(L.clientX,L.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(L){this._currentMarker===void 0||this.notesArea!==void 0||L.key!=="Delete"&&L.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(L,N){var z=this.markerImage.getBoundingClientRect();return{x:(L-z.left)/this.zoomLevel,y:(N-z.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(L){at.addKey(L)},X.prototype.addEventListener=function(L,N){this.eventListeners.addEventListener(L,N)},X.prototype.removeEventListener=function(L,N){this.eventListeners.removeEventListener(L,N)},X.prototype.renderState=function(L){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(L),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var L=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(N){return N(new Qt(L))}))},X.prototype.blur=function(){var L=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(N){return N(new Qt(L))}))},X.instanceCounter=0,X}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ae=function(X,L){return(Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,z){N.__proto__=z}||function(N,z){for(var ne in z)Object.prototype.hasOwnProperty.call(z,ne)&&(N[ne]=z[ne])})(X,L)};function kt(X,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function N(){this.constructor=X}Ae(X,L),X.prototype=L===null?Object.create(L):(N.prototype=L.prototype,new N)}function dt(X,L,N,z){return new(N||(N=Promise))(function(ne,J){function je(Jn){try{In(z.next(Jn))}catch(ln){J(ln)}}function $t(Jn){try{In(z.throw(Jn))}catch(ln){J(ln)}}function In(Jn){var ln;Jn.done?ne(Jn.value):(ln=Jn.value,ln instanceof N?ln:new N(function(tr){tr(ln)})).then(je,$t)}In((z=z.apply(X,L||[])).next())})}function Zt(X,L){var N,z,ne,J,je={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return J={next:$t(0),throw:$t(1),return:$t(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function $t(In){return function(Jn){return function(ln){if(N)throw new TypeError("Generator is already executing.");for(;je;)try{if(N=1,z&&(ne=2&ln[0]?z.return:ln[0]?z.throw||((ne=z.return)&&ne.call(z),0):z.next)&&!(ne=ne.call(z,ln[1])).done)return ne;switch(z=0,ne&&(ln=[2&ln[0],ne.value]),ln[0]){case 0:case 1:ne=ln;break;case 4:return je.label++,{value:ln[1],done:!1};case 5:je.label++,z=ln[1],ln=[0];continue;case 7:ln=je.ops.pop(),je.trys.pop();continue;default:if(!(ne=je.trys,(ne=ne.length>0&&ne[ne.length-1])||ln[0]!==6&&ln[0]!==2)){je=0;continue}if(ln[0]===3&&(!ne||ln[1]>ne[0]&&ln[1]<ne[3])){je.label=ln[1];break}if(ln[0]===6&&je.label<ne[1]){je.label=ne[1],ne=ln;break}if(ne&&je.label<ne[2]){je.label=ne[2],je.ops.push(ln);break}ne[2]&&je.ops.pop(),je.trys.pop();continue}ln=L.call(X,je)}catch(tr){ln=[6,tr],z=0}finally{N=ne=0}if(5&ln[0])throw ln[1];return{value:ln[0]?ln[1]:void 0,done:!0}}([In,Jn])}}}var un=function(){function X(){}return X.addKey=function(L){X.key=L},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Le=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(L,N){for(var z=0,ne=N;z<ne.length;z++){var J=ne[z],je=J[0],$t=J[1];L.setAttribute(je,$t)}},X.createRect=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",N.toString()),z&&X.setAttributes(ne,z),ne},X.createLine=function(L,N,z,ne,J){var je=document.createElementNS("http://www.w3.org/2000/svg","line");return je.setAttribute("x1",L.toString()),je.setAttribute("y1",N.toString()),je.setAttribute("x2",z.toString()),je.setAttribute("y2",ne.toString()),J&&X.setAttributes(je,J),je},X.createPolygon=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",L),N&&X.setAttributes(z,N),z},X.createCircle=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(L/2).toString()),z.setAttribute("cy",(L/2).toString()),z.setAttribute("r",L.toString()),N&&X.setAttributes(z,N),z},X.createEllipse=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(N/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(N/2).toString()),z&&X.setAttributes(ne,z),ne},X.createGroup=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&X.setAttributes(N,L),N},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(L,N,z,ne,J,je,$t){var In=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(In,[["id",L],["orient",N],["markerWidth",z.toString()],["markerHeight",ne.toString()],["refX",J.toString()],["refY",je.toString()]]),In.appendChild($t),In},X.createText=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),L&&X.setAttributes(N,L),N},X.createTSpan=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=L,N&&X.setAttributes(z,N),z},X.createImage=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&X.setAttributes(N,L),N},X.createPoint=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=L,z.y=N,z},X.createPath=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",L),N&&X.setAttributes(z,N),z},X.createElement=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg",L);return N&&X.setAttributes(z,N),z},X.getHollowRectanglePath=function(L,N,z,ne,J,je,$t,In){return"M"+L+","+N+"V"+(N+ne)+"H"+(L+z)+"V"+N+"H"+J+"V"+je+"H"+(J+$t)+"V"+(je+In)+"H"+J+"V"+N+"Z"},X}(),et=function(){function X(L){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},X.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new mt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new mt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new mt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ht("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ht("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},X.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),mt=function(X,L){this.selector=X,this.style=L},Ht=function(X,L){this.localName=X,this.style=L},sn=function(){function X(){this.blocks=[],this.display=""}return X.prototype.addButtonBlock=function(L){L.className=this.blockClassName,L.buttonClassName=this.buttonClassName,L.buttonColorsClassName=this.buttonColorsClassName,L.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(L)},X.prototype.addElementBlock=function(L){L.className===void 0&&(L.className=this.blockClassName),this.blocks.push(L)},X.prototype.getUI=function(){var L=document.createElement("div");return L.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,L.style.display=this.display,this.blocks.forEach(function(N){return L.appendChild(N.getUI())}),L},X}(),yn=function(){function X(){}return X.prototype.getUI=function(){var L=document.createElement("div");if(L.className=this.className,this.minWidth!==void 0&&(L.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":L.style.justifyContent="flex-start";break;case"center":L.style.justifyContent="center";break;case"end":L.style.justifyContent="flex-end"}return L.style.whiteSpace="nowrap",L},X}(),nr=function(X){function L(){var N=X!==null&&X.apply(this,arguments)||this;return N.buttons=[],N}return kt(L,X),L.prototype.addButton=function(N){N.className=this.buttonClassName,N.colorsClassName=this.buttonColorsClassName,N.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(N)},L.prototype.getUI=function(){var N=X.prototype.getUI.call(this);return this.buttons.forEach(function(z){return N.appendChild(z.getUI())}),N},L}(yn),Kn=function(){function X(L,N){this._isActive=!1,this._isHidden=!1,this._icon=L,this.title=N,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(X.prototype,"icon",{get:function(){return this._icon},set:function(L){this._icon=L,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isActive",{get:function(){return this._isActive},set:function(L){this._isActive=L,this.adjustClassName()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){var L=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return L.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},X.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},X.prototype.hide=function(){this._isHidden=!0},X}(),Cn=function(X){function L(){var N=X!==null&&X.apply(this,arguments)||this;return N.elements=[],N}return kt(L,X),L.prototype.addElement=function(N){this.elements.push(N)},L.prototype.getUI=function(){var N=X.prototype.getUI.call(this);return this.elements.forEach(function(z){return N.appendChild(z)}),N},L}(yn),br=function(){function X(L,N){this.horizontal=L,this.vertical=N}return Object.defineProperty(X.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),X.prototype.getVerticalLength=function(L){return L/this.ratio},X.prototype.getHorizontalLength=function(L){return L*this.ratio},X}(),Er=function(){function X(){}return X.getIcon=function(L,N){if(L>0&&N>0){var z=new br(L,N),ne=z.ratio>=1?20:z.getHorizontalLength(20),J=z.ratio<1?20:z.getVerticalLength(20),je=document.createElementNS("http://www.w3.org/2000/svg","svg");je.setAttribute("xmlns","http://www.w3.org/2000/svg"),je.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(je);var $t=Le.createDefs();je.appendChild($t);var In=Le.createElement("clipPath",[["id","text-bg-clip"]]);$t.appendChild(In);var Jn=Le.createPath(Le.getHollowRectanglePath((24-ne)/2,(24-J)/2,ne,J,(24-ne)/2+2,(24-J)/2+2,ne-4,J-4));je.appendChild(Jn);var ln=Le.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ln.appendChild(Le.createTSpan(L+":"+N)),je.appendChild(ln);var tr=ln.getBBox();Le.setAttributes(ln,[["x",((24-tr.width)/2).toString()],["y",((24-tr.height)/2-tr.y).toString()]]);var qn=Le.createPath(Le.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(tr.width))/2,(24-Math.ceil(tr.height))/2,Math.ceil(tr.width),Math.ceil(tr.height)));return In.appendChild(qn),Le.setAttributes(Jn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(je),je.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},X}(),rr=function(X){function L(N,z,ne){var J=X.call(this,N,z)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=ne,J}return kt(L,X),L.prototype.setupDropdown=function(){var N=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(z){z.className=N.className,z.colorsClassName=N.colorsClassName,N.dropdownBlock.appendChild(z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},L.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},L.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},L.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},L.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},L.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},L}(Kn),cr=function(){function X(L,N){this.GRIP_SIZE=10,this.color=L,this.fillColor=N,this.visual=Le.createGroup(),this.visual.appendChild(Le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Le.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},X.prototype.setCenter=function(L,N){this.visual.childNodes.forEach(function(z){return Le.setAttributes(z,[["cx",L.toString()],["cy",N.toString()]])})},X}(),Pr=function(){function X(L,N,z,ne){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=L,this.canvasHeight=N,this.margin=z,this.container=ne,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(L){this._aspectRatio=L,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.gridContainer&&Le.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(L){this._zoomFactor=L,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var L=this;this.cropShadeElement=Le.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Le.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var N=0;N<this.numberOfGridLines;N++)this.horizontalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(z){return L.gridContainer.appendChild(z)}),this.verticalGridLines.forEach(function(z){return L.gridContainer.appendChild(z)}),this.cropRectElement=Le.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(L){this.cropRect=L;var N=Object.assign({},this.cropRect);this.zoomFactor!==1&&(N.width=this.cropRect.width*this.zoomFactor,N.height=this.cropRect.height*this.zoomFactor,N.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-N.width/2,N.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-N.height/2),Le.setAttributes(this.cropRectElement,[["x",N.x.toString()],["y",N.y.toString()],["width",N.width.toString()],["height",N.height.toString()]]);var z=N.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,je){var $t=N.y+z*(je+1);Le.setAttributes(J,[["x1",""+N.x],["y1",""+$t],["x2",""+(N.x+N.width)],["y2",""+$t]])});var ne=N.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,je){var $t=N.x+ne*(je+1);Le.setAttributes(J,[["x1",""+$t],["y1",""+N.y],["x2",""+$t],["y2",""+(N.y+N.height)]])}),Le.setAttributes(this.cropShadeElement,[["d",Le.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,N.x,N.y,N.width,N.height)]]),this.topLeftGrip.setCenter(N.x,N.y),this.topRightGrip.setCenter(N.x+N.width,N.y),this.bottomLeftGrip.setCenter(N.x,N.y+N.height),this.bottomRightGrip.setCenter(N.x+N.width,N.y+N.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},X.prototype.clientToLocalCoordinates=function(L,N){var z=this.container.getBoundingClientRect();return{x:L-z.left+this.margin,y:N-z.top+this.margin}},X.prototype.onPointerDown=function(L){this.container.setPointerCapture(L.pointerId),this.previousPoint=this.clientToLocalCoordinates(L.clientX,L.clientY),this.cropRectElement===L.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(L.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(L.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(L.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(L.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(L){if(this.isMoving)this.move(this.clientToLocalCoordinates(L.clientX,L.clientY));else if(this.activeGrip){var N=this.clientToLocalCoordinates(L.clientX,L.clientY);this.resize(N)}L.preventDefault()},X.prototype.onPointerUp=function(L){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(L.pointerId)},X.prototype.move=function(L){var N=L.x-this.previousPoint.x,z=L.y-this.previousPoint.y;this.zoomFactor!==1&&(N=-N/this.zoomFactor,z=-z/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+N),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=L},X.prototype.resize=function(L){var N=Object.assign({},this.cropRect),z=L.x-this.previousPoint.x,ne=L.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:N.x+z<this.margin&&(z=this.margin-N.x),N.x+=z,N.width=this.cropRect.x+this.cropRect.width-N.x;break;case this.bottomRightGrip:case this.topRightGrip:N.width+z>this.canvasWidth*this.zoomFactor&&(z=this.canvasWidth*this.zoomFactor-N.width),N.width+=z}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(N.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(z),N.height=this.aspectRatio.getVerticalLength(N.width)):(N.y+=ne,N.height=this.cropRect.y+this.cropRect.height-N.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?N.height=this.aspectRatio.getVerticalLength(N.width):N.height+=ne}N.width<10&&(N.x=this.cropRect.x,N.width=10),N.height<10&&(N.y=this.cropRect.y,N.height=10),this.previousPoint=L,N.x>=this.margin&&N.y>=this.margin&&N.x-this.margin+N.width<=this.canvasWidth&&N.y-this.margin+N.height<=this.canvasHeight&&(this.cropRect=N,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var L=this.cropRect.x+this.cropRect.width/2,N=this.cropRect.y+this.cropRect.height/2,z=this.aspectRatio.getHorizontalLength(this.cropRect.height),ne=this.aspectRatio.getVerticalLength(this.cropRect.width);z/this.canvasWidth<ne/this.canvasHeight?this.cropRect.width=z:this.cropRect.height=ne,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=L-this.cropRect.width/2,this.cropRect.y=N-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},X.prototype.getRescaledRect=function(L,N,z,ne,J,je){var $t=z/L,In=ne/N;return{x:(J.x-je)*$t+je,y:(J.y-je)*In+je,width:J.width*$t,height:J.height*In}},X.prototype.scaleCanvas=function(L,N){var z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,L,N,this.cropRect,this.margin);this.canvasWidth=L,this.canvasHeight=N,this.onCropChange&&this.onCropChange(z),this.setCropRectangle(z)},X}(),Kr=function(){function X(L){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=L,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(X.prototype,"angle",{get:function(){return this._angle},set:function(L){this._angle=L,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},X.prototype.onPointerDown=function(L){this.controlContainer.setPointerCapture(L.pointerId),this.isDragging=!0,this.previousPoint={x:L.clientX,y:L.clientY}},X.prototype.onPointerMove=function(L){this.isDragging&&(this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.previousPoint.x=L.clientX)},X.prototype.onPointerUp=function(L){this.isDragging&&this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(L.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var L=this.angleLabelText.getBBox();Le.setAttributes(this.angleLabelElement,[["x",((this.width-L.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var L=this.scaleShape.transform.baseVal.getItem(0);L.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(L,0)}},X.prototype.getVisual=function(){var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("width",this.width+"px"),L.setAttribute("height",this.height+"px"),L.setAttribute("viewBox","0 0 "+this.width+" "+this.height),L.style.flexShrink="0",document.body.appendChild(L);for(var N="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,z=1;z<=this.width/5+10;z++){var ne=z%5==0?this.height/3:this.height/6;N+="h4v"+-ne+"h1v"+ne}N+="v1H0Z",this.scaleShape=Le.createPath(N);var J=Le.createTransform();this.scaleShape.transform.baseVal.appendItem(J),L.appendChild(this.scaleShape),this.angleLabelElement=Le.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Le.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var je=Le.createTSpan("");return je.innerHTML="&deg;",this.angleLabelElement.appendChild(je),L.appendChild(this.angleLabelElement),document.body.removeChild(L),L},X}(),hi=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(L,N,z,ne,J,je,$t){var In=this;return new Promise(function(Jn){var ln=document.createElement("canvas");ln.width=L.width.baseVal.value-2*ne,ln.height=L.height.baseVal.value-2*ne;var tr=1,qn=1;In.naturalSize===!0?(tr=N.naturalWidth/(L.width.baseVal.value-2*ne)/je,qn=N.naturalHeight/(L.height.baseVal.value-2*ne)/$t,ln.width=N.naturalWidth/je,ln.height=N.naturalHeight/$t):In.width!==void 0&&In.height!==void 0&&(tr=In.width/z.width,qn=In.height/z.height,ln.width*=tr,ln.height*=qn);var kr=ln.getContext("2d");kr.translate(ln.width/2,ln.height/2),kr.rotate(J*Math.PI/180),kr.scale(je,$t),kr.translate(-ln.width/2,-ln.height/2),kr.drawImage(N,0,0,ln.width,ln.height);var li=document.createElement("canvas");li.width=z.width*tr,li.height=z.height*qn,li.getContext("2d").putImageData(kr.getImageData((z.x-ne)*tr,(z.y-ne)*qn,z.width*tr,z.height*qn),0,0),Jn(li.toDataURL(In.imageType,In.imageQuality))})},X}(),pn=function(){function X(L){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=X.instanceCounter++,this.styles=new et(this.instanceNo),this.target=L,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(L){this._zoomToCropEnabled=L,L?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(L){this._gridLines=L,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(L){this._rotationAngle=L,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var L;return(L=this._aspectRatio)!==null&&L!==void 0?L:this.aspectRatios[0]},set:function(L){this._aspectRatio=L},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(L){L===void 0&&(L=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),L||this.closeEventListeners.forEach(function(N){return N()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(L){this.renderEventListeners.push(L)},X.prototype.removeRenderEventListener=function(L){this.renderEventListeners.indexOf(L)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(L),1)},X.prototype.addCloseEventListener=function(L){this.closeEventListeners.push(L)},X.prototype.removeCloseEventListener=function(L){this.closeEventListeners.indexOf(L)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(L),1)},X.prototype.setupResizeObserver=function(){var L=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var L=1*this.target.clientWidth/this.target.clientHeight,N=this.contentDiv.clientWidth/L>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*L:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,z=N+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/L;this.resize(N,z)}},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Le.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},X.prototype.resize=function(L,N){this.imageWidth=Math.round(L),this.imageHeight=Math.round(N),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},X.prototype.setEditingTarget=function(){var L=document.createElement("canvas");L.width=this.target.naturalWidth,L.height=this.target.naturalHeight,L.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var N=L.toDataURL();Le.setAttributes(this.editingTarget,[["href",N]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var L=this.target.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=L.left-N.left-this.CANVAS_MARGIN,this.top=L.top-N.top-this.CANVAS_MARGIN},X.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Le.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Le.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Le.createGroup(),this.editingTargetRotationScaleContainer=Le.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var L=Le.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(L);var N=Le.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(N),this.editingTargetContainer=Le.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},X.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},X.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Le.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Pr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},X.prototype.zoomToCrop=function(){if(this.cropRect){var L=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,N=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=L+"px "+N+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-L+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-N+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},X.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},X.prototype.cropRectChanged=function(L){this.cropRect=L,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},X.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,N=this.target.offsetTop>L+this.CANVAS_MARGIN?this.target.offsetTop-(L+this.CANVAS_MARGIN):0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var L=this;this.topToolbar=new sn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var N=new nr;N.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(N);var z=[];this.aspectRatios.forEach(function(qn){var kr=new Kn(Er.getIcon(qn.horizontal,qn.vertical),qn.horizontal===0&&qn.vertical===0?"FREE":qn.horizontal+":"+qn.vertical);kr.onClick=function(){return L.ratioButtonClicked(qn)},z.push(kr)}),this.aspectRatioButton=new rr(Er.getIcon(0,0),"Aspect ratio",z),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,N.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ne=new Kn('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ne.isActive=this.isGridVisible,ne.onClick=function(){L.isGridVisible=!L.isGridVisible,ne.isActive=L.isGridVisible},N.addButton(ne);var J=new Kn('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(J.isActive=this.zoomToCropEnabled,J.onClick=function(){L.zoomToCropEnabled=!L.zoomToCropEnabled,J.isActive=L.zoomToCropEnabled},N.addButton(J),!un.isLicensed){var je=new Cn;this.topToolbar.addElementBlock(je);var $t=document.createElement("div");$t.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var In=document.createElement("a");In.style.color="currentColor",In.href="https://markerjs.com/products/cropro",In.target="_blank",In.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',$t.appendChild(In),je.addElement($t)}var Jn=new nr;Jn.minWidth=3*this.toolbarHeight+"px",Jn.contentAlign="end",this.topToolbar.addButtonBlock(Jn);var ln=new Kn('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ln.onClick=this.startRenderAndClose,Jn.addButton(ln),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ln.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var tr=new Kn('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");tr.onClick=this.close,Jn.addButton(tr),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(tr.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var L=this;this.bottomToolbar=new sn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var N=new nr;N.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(N);var z=new Kn('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");z.onClick=this.rotateLeftButtonClicked,N.addButton(z);var ne=new Kn('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ne.onClick=this.rotateRightButtonClicked,N.addButton(ne);var J=new Cn;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),this.straightener=new Kr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Jn){L.rotateBy(Jn),L.straightener.angle=L.rotationAngle},J.addElement(this.straightener.getUI());var je=new nr;je.minWidth=2*this.toolbarHeight+"px",je.contentAlign="end",this.bottomToolbar.addButtonBlock(je);var $t=new Kn('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");$t.onClick=this.flipHorizontallyButtonClicked,je.addButton($t);var In=new Kn('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");In.onClick=this.flipVerticallyButtonClicked,je.addButton(In)},X.prototype.ratioButtonClicked=function(L){this.aspectRatio=L,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Er.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new br(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(L){if(L){var N=this.cropLayer.getRescaledRect(L.width,L.height,this.imageWidth,this.imageHeight,L.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(N),this.cropRectChanged(N),this.flippedHorizontally=L.flippedHorizontally,this.flippedVertically=L.flippedVertically,this.applyFlip(),this.rotationAngle=L.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(L,N){var z=this.cropImage.getBoundingClientRect();return{x:L-z.left,y:N-z.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var L=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},X.prototype.rotateLeftButtonClicked=function(){var L=this.rotationAngle-90;this.rotationAngle%90!=0&&(L+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(L)},X.prototype.rotateRightButtonClicked=function(){var L=this.rotationAngle+90;this.rotationAngle%90!=0&&(L-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(L)},X.prototype.rotateTo=function(L){L=(L=L>180?L-360:L)<=-180?L+360:L,this.rotationAngle=L,this.applyRotation()},X.prototype.rotateBy=function(L){this.rotateTo((this.rotationAngle+L)%360)},X.prototype.applyRotation=function(){var L=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var N=this.editingTargetRotationContainer.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(N,0);var z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/z.width,this.imageHeight/z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=L},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return dt(this,void 0,void 0,function(){var L,N;return Zt(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return L=z.sent(),N=this.getState(),this.renderEventListeners.forEach(function(ne){return ne(L,N)}),this.close(!0),[2]}})})},X.prototype.render=function(){return dt(this,void 0,void 0,function(){var L;return Zt(this,function(N){switch(N.label){case 0:return(L=new hi).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.width=this.renderWidth,L.height=this.renderHeight,this.unzoomFromCrop(),Le.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,L.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return N.sent(),[4,L.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,N.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ht("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 Ht("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ht("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var L=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ht("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*L)+`px;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new mt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new mt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ht("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 Ht("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ht("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 Ht("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ht("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},X.instanceCounter=0,X}(),or=D("8hTe"),mi=D.n(or),wi=/<pre[^>]*>/g;function ti(X){var L=document.createElement("div");return L.innerHTML=X,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var ni=he.a=function(X){var L=X.value,N=L===void 0?"":L,z=X.edit,ne=z===void 0?!1:z,J=X.className,je=X.showTextOnly,$t=X.showLines,In=X.replaces,Jn=X.zoomImg,ln=X.hasMask,tr=X.style,qn=tr===void 0?{}:tr,kr=X.stylesPrev,li=kr===void 0?{}:kr,ai=String(N),Gr=Object(M.useRef)(),Li=Object(M.useRef)(),Vi=Object(M.useState)(""),Dr=Object(K.a)(Vi,2),Sr=Dr[0],ri=Dr[1],Br=Object(M.useState)("office"),Bn=Object(K.a)(Br,2),_n=Bn[0],Sn=Bn[1],bn=function(){var Re=new pn(Li.current);Re.displayMode="popup",Re.addRenderEventListener(function(){var $e=Object(k.a)(r.a.mark(function it(Dt){var Tt;return r.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:return Gr.current.style.display="none",_t.next=3,Object(Je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dt}});case 3:Tt=_t.sent,Tt!=null&&Tt.id&&In(Li.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Tt==null?void 0:Tt.id,"?type=").concat(Tt.content_type));case 5:case"end":return _t.stop()}},it)}));return function(it){return $e.apply(this,arguments)}}()),Re.show()},ur=function(){var Re=new de(Li.current);Re.settings.displayMode="popup",Re.addEventListener("render",function(){var $e=Object(k.a)(r.a.mark(function it(Dt){var Tt;return r.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:if(Gr.current.style.display="none",!Li.current){_t.next=6;break}return _t.next=4,Object(Je.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dt.dataUrl}});case 4:Tt=_t.sent,Tt!=null&&Tt.id&&In(Li.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Tt==null?void 0:Tt.id,"?type=").concat(Tt.content_type));case 6:case"end":return _t.stop()}},it)}));return function(it){return $e.apply(this,arguments)}}()),Re.show(),window.markerArea=Re},sr=Object(M.useMemo)(function(){Gr.current&&(Gr.current.style.zIndex=-1);try{var rt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Re=/\"\/api\/attachments\/|\"\/attachments\/download\//g,$e=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ai=ai.replace(rt,"("+q.a.API_SERVER+"/api/attachments/").replace(Re,'"'+q.a.API_SERVER+"/api/attachments/").replace($e,'"'+q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Be){}var it=H(ai),Dt=y();if(ai.match(/\[TOC\]/)&&(it=it.replace("<p>[TOC]</p>",R()),O()),it=it.replace(/(__special_katext_id_\d+__)/g,function(Be,_t){var ot=Dt[_t],ht=ot.type,wt=ot.expression;return Object(ie.renderToString)(ti(wt)||"",{displayMode:ht==="block",throwOnError:!1,output:"html"})}),it=it.replace(/▁/g,"\u2581\u2581\u2581"),g(),je){var Tt=document.createElement("div");return Tt.innerHTML=it,Tt.innerText}return setTimeout(function(){return Ce()},500),it},[ai]),Q=Object(M.useRef)();T.WebkitLineClamp=$t,$t&&(qn=Object(P.a)(Object(P.a)({},qn),T));function ce(rt){var Re=rt.target;if(Re.tagName.toUpperCase()==="IMG"){if(Jn){var $e=Re.getAttribute("src");ri($e),Sn("image")}}else if(Re.tagName.toUpperCase()==="A"){var it=Re.getAttribute("href");if(it.indexOf("office")>-1)rt.preventDefault(),ri(it),Sn("office");else if(it.indexOf("application/pdf")>-1)rt.preventDefault(),ri(it),Sn("pdf");else if(it.indexOf("text/html")>-1)rt.preventDefault(),ri(it),Sn("html");else if(it.startsWith("#")){rt.preventDefault();var Dt=document.getElementById(it.replace("#",""));Dt&&Dt.scrollIntoView(!0)}}}var Ce=function(){var Re,$e=(Re=Q.current)===null||Re===void 0?void 0:Re.querySelectorAll("video");$e==null||$e.forEach(function(it){if(it.oncontextmenu=function(){return!1},it.src.indexOf(".m3u8")>-1&&!it.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var Dt=new Y.a;Dt.loadSource(it.src),Dt.attachMedia(it)}}})};Object(M.useEffect)(function(){if(Q.current&&sr&&(sr.match(wi)&&window.PR.prettyPrint()),Q.current)return Q.current.addEventListener("click",ce),function(){Q.current.removeEventListener("click",ce),g(),O()}},[sr,Q.current,ce]);var Te=function(Re){if(!ne)return;Re.target.nodeName==="IMG"?(Gr.current.style.zIndex=1,Gr.current.style.display="flex",Gr.current.style.width=Re.target.clientWidth+"px",Gr.current.style.height=Re.target.clientHeight+"px",Gr.current.style.top=Re.target.offsetTop+"px",Gr.current.style.left=Re.target.offsetLeft+"px",Li.current.src=Re.target.getAttribute("src")):Gr.current.style.display="none"};return _.a.createElement("div",{style:{position:"relative"}},_.a.createElement("div",{ref:Q,style:Object(P.a)({},qn),className:"".concat(J||""," markdown-body ").concat(mi.a.mdBody),onMouseOver:Te,dangerouslySetInnerHTML:{__html:sr}}),_.a.createElement("div",{ref:Gr,className:mi.a.button},_.a.createElement(V.a,null,_.a.createElement(G.a,{onClick:function(){return bn()}},"\u88C1\u526A"),_.a.createElement(G.a,{onClick:function(){return ur()}},"\u7F16\u8F91"))),_.a.createElement("img",{ref:Li,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),_.a.createElement(ge.a,{close:!0,data:Sr,type:Sr!=null&&Sr.length?_n:"",style:Object(P.a)({},li),onClose:function(){return ri("")}}))}},"9VGf":function(Gt,he,D){"use strict";D.d(he,"a",function(){return U});var Z=D("q1tI"),V=D.n(Z);function U(G,P){var k=Object(Z.useRef)();Object(Z.useEffect)(function(){k.current=G}),Object(Z.useEffect)(function(){function K(){k.current()}if(P!==null){var I=setInterval(K,P);return function(){return clearInterval(I)}}},[P])}},AHFd:function(Gt,he,D){"use strict";D.d(he,"a",function(){return I});var Z=D("giR+"),V=D("fyUT"),U=D("OaEy"),G=D("2fM7"),P=D("tJVT"),k=D("q1tI"),K=D.n(k),I;(function(M){M[M.Number=1]="Number",M[M.Percent=2]="Percent"})(I||(I={}));var r=function(_){var p=_.value,m=_.onChange,u=_.disabled,a=_.hidePercentOption,o=a===void 0?!1:a,c=Object(k.useMemo)(function(){return o?I.Number:I.Percent},[o]),s=Object(k.useState)(c),i=Object(P.a)(s,2),n=i[0],O=i[1],T=Object(k.useCallback)(function(R){return n===I.Number?"".concat(R,"\u5206"):"".concat(R,"%")},[n]),C=Object(k.useCallback)(function(R){if(n===I.Number){var S=R.replace("\u5206","");return isNaN(parseInt(S,10))?0:S}else{var v=R.replace("%","");return v}},[n]);return Object(k.useEffect)(function(){O(p.type)},[p]),K.a.createElement("div",{style:{display:"inline-block"}},K.a.createElement(G.a,{onChange:function(S){O(S),m({type:S,inputValue:S===I.Number?5:20})},value:n||c,style:{width:100},options:o?[{label:"\u5206\u503C",value:I.Number}]:[{label:"\u767E\u5206\u6BD4",value:I.Percent},{label:"\u5206\u503C",value:I.Number}],disabled:u}),K.a.createElement(V.a,{disabled:u,value:p.inputValue,formatter:T,parser:C,max:n===I.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(S){m({type:n,inputValue:S})}}))};he.b=r},BU3w:function(Gt,he,D){"use strict";D.d(he,"a",function(){return k});var Z=D("MNnm"),V="rc-util-key";function U(K){if(K.attachTo)return K.attachTo;var I=document.querySelector("head");return I||document.body}function G(K){var I,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var M=document.createElement("style");if((I=r.csp)===null||I===void 0?void 0:I.nonce){var _;M.nonce=(_=r.csp)===null||_===void 0?void 0:_.nonce}M.innerHTML=K;var p=U(r),m=p.firstChild;return r.prepend&&p.prepend?p.prepend(M):r.prepend&&m?p.insertBefore(M,m):p.appendChild(M),M}var P=new Map;function k(K,I){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},M=U(r);if(!P.has(M)){var _=G("",r),p=_.parentNode;P.set(M,p),p.removeChild(_)}var m=Array.from(P.get(M).children).find(function(s){return s.tagName==="STYLE"&&s[V]===I});if(m){var u,a;if(((u=r.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((a=r.csp)===null||a===void 0?void 0:a.nonce)){var o;m.nonce=(o=r.csp)===null||o===void 0?void 0:o.nonce}return m.innerHTML!==K&&(m.innerHTML=K),m}var c=G(K,r);return c[V]=I,c}},Bd2K:function(Gt,he,D){(function(Z){Z(D("VrN/"),D("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(r,M,_){if(_!=Z.Init&&_&&r.removeKeyMap("autoCloseTags"),!M)return;var p={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(p["'/'"]=function(m){return k(m)}),(typeof M!="object"||M.whenOpening!==!1)&&(p["'>'"]=function(m){return G(m)}),r.addKeyMap(p)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function G(r){if(r.getOption("disableInput"))return Z.Pass;for(var M=r.listSelections(),_=[],p=r.getOption("autoCloseTags"),m=0;m<M.length;m++){if(!M[m].empty())return Z.Pass;var u=M[m].head,a=r.getTokenAt(u),o=Z.innerMode(r.getMode(),a.state),c=o.state,s=o.mode.xmlCurrentTag&&o.mode.xmlCurrentTag(c),i=s&&s.name;if(!i)return Z.Pass;var n=o.mode.configuration=="html",O=typeof p=="object"&&p.dontCloseTags||n&&V,T=typeof p=="object"&&p.indentTags||n&&U;a.end>u.ch&&(i=i.slice(0,i.length-a.end+u.ch));var C=i.toLowerCase();if(!i||a.type=="string"&&(a.end!=u.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&s.close||a.string.indexOf("/")==u.ch-a.start-1||O&&K(O,C)>-1||I(r,o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(c)||[],i,u,!0))return Z.Pass;var R=typeof p=="object"&&p.emptyTags;if(R&&K(R,i)>-1){_[m]={text:"/>",newPos:Z.Pos(u.line,u.ch+2)};continue}var S=T&&K(T,C)>-1;_[m]={indent:S,text:">"+(S?`
`:"")+"</"+i+">",newPos:S?Z.Pos(u.line+1,0):Z.Pos(u.line,u.ch+1)}}for(var v=typeof p=="object"&&p.dontIndentOnAutoClose,m=M.length-1;m>=0;m--){var E=_[m];r.replaceRange(E.text,M[m].head,M[m].anchor,"+insert");var f=r.listSelections().slice(0);f[m]={head:E.newPos,anchor:E.newPos},r.setSelections(f),!v&&E.indent&&(r.indentLine(E.newPos.line,null,!0),r.indentLine(E.newPos.line+1,null,!0))}}function P(r,M){for(var _=r.listSelections(),p=[],m=M?"/":"</",u=r.getOption("autoCloseTags"),a=typeof u=="object"&&u.dontIndentOnSlash,o=0;o<_.length;o++){if(!_[o].empty())return Z.Pass;var c=_[o].head,s=r.getTokenAt(c),i=Z.innerMode(r.getMode(),s.state),n=i.state;if(M&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=c.ch-1))return Z.Pass;var O,T=i.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(T&&i.mode.name=="javascript")O=m+"script";else if(T&&i.mode.name=="css")O=m+"style";else{var C=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(n);if(!C||C.length&&I(r,C,C[C.length-1],c))return Z.Pass;O=m+C[C.length-1]}r.getLine(c.line).charAt(s.end)!=">"&&(O+=">"),p[o]=O}if(r.replaceSelections(p),_=r.listSelections(),!a)for(var o=0;o<_.length;o++)(o==_.length-1||_[o].head.line<_[o+1].head.line)&&r.indentLine(_[o].head.line)}function k(r){return r.getOption("disableInput")?Z.Pass:P(r,!0)}Z.commands.closeTag=function(r){return P(r)};function K(r,M){if(r.indexOf)return r.indexOf(M);for(var _=0,p=r.length;_<p;++_)if(r[_]==M)return _;return-1}function I(r,M,_,p,m){if(!Z.scanForClosingTag)return!1;var u=Math.min(r.lastLine()+1,p.line+500),a=Z.scanForClosingTag(r,p,null,u);if(!a||a.tag!=_)return!1;for(var o=m?1:0,c=M.length-1;c>=0&&M[c]==_;c--)++o;p=a.to;for(var c=1;c<o;c++){var s=Z.scanForClosingTag(r,p,null,u);if(!s||s.tag!=_)return!1;p=s.to}return!0}})},BdwD:function(Gt,he,D){"use strict";var Z=D("+L6B"),V=D("2/Rp"),U=D("0Owb"),G=D("k1fw"),P=D("q1tI"),k=D.n(P),K=D("FOrL"),I=D.n(K),r=function(_){var p=_.buttonProps,m=p===void 0?{}:p,u=_.styles,a=u===void 0?{}:u,o=_.customText,c=_.ButtonText,s=_.ButtonClick,i=_.Buttonclass,n=_.ButtonTwo;return k.a.createElement("section",{className:"tc animated fadeIn",style:Object(G.a)(Object(G.a)({},{color:"#999",margin:"200px auto"}),a)},k.a.createElement("img",{src:I.a}),k.a.createElement("p",{className:"mt20 font14"},o||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),c&&k.a.createElement(V.a,Object(U.a)({className:i,onClick:s},m),c),n&&n)};he.a=r},BjJ7:function(Gt,he,D){"use strict";D.d(he,"d",function(){return V}),D.d(he,"c",function(){return U}),D.d(he,"e",function(){return G}),D.d(he,"b",function(){return P}),D.d(he,"a",function(){return K});var Z=D("m3rI");function V(I){var r=!0;if(I.length>0){for(var M=0;M<I.length;M++)if(I[M].compile_success==0||!I[M].compile_success){r=!1;break}}else r=!1;return r}function U(I){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",M=[],_=0;_<I.length;_++){var p=I[_],m=r?"".concat(r,"/").concat(p.name):"".concat(p.name);M.push({title:p.name,isLeaf:!(p.type==="tree"),key:m})}return M}function G(I,r,M){for(var _=0;_<I.length;_++){var p=I[_];if(p.key===r){p.children=M;break}p.children&&G(p.children,r,M)}return I}function P(I,r,M){var _;return function(){var p=this,m=arguments,u=function(){_=null,M||I.apply(p,m)},a=M&&!_;clearTimeout(_),_=setTimeout(u,r),a&&I.apply(p,m)}}var k=!0,K=Z.a.API_SERVER},"C+DQ":function(Gt,he,D){},"C/vA":function(Gt,he,D){"use strict";D.d(he,"a",function(){return Z});function Z(V){const U=this;let G=!1,P;return function(){return G||(G=!0,P=V.apply(U,arguments)),P}}},"Cg/j":function(Gt,he,D){"use strict";D.d(he,"b",function(){return Z}),D.d(he,"a",function(){return V}),D.d(he,"c",function(){return G}),D.d(he,"d",function(){return P});var Z;(function(k){k.serviceIds=new Map,k.DI_TARGET="$di$target",k.DI_DEPENDENCIES="$di$dependencies";function K(I){return I[k.DI_DEPENDENCIES]||[]}k.getServiceDependencies=K})(Z||(Z={}));const V=G("instantiationService");function U(k,K,I,r){K[Z.DI_TARGET]===K?K[Z.DI_DEPENDENCIES].push({id:k,index:I,optional:r}):(K[Z.DI_DEPENDENCIES]=[{id:k,index:I,optional:r}],K[Z.DI_TARGET]=K)}function G(k){if(Z.serviceIds.has(k))return Z.serviceIds.get(k);const K=function(I,r,M){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");U(K,I,M,!1)};return K.toString=()=>k,Z.serviceIds.set(k,K),K}function P(k){return function(K,I,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");U(k,K,r,!0)}}},DlQD:function(Gt,he,D){(function(Z,V){Gt.exports=V()})(this,function(){"use strict";function Z(De,ye){for(var we=0;we<ye.length;we++){var ae=ye[we];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(De,ae.key,ae)}}function V(De,ye,we){return ye&&Z(De.prototype,ye),we&&Z(De,we),De}function U(De,ye){if(!De)return;if(typeof De=="string")return G(De,ye);var we=Object.prototype.toString.call(De).slice(8,-1);if(we==="Object"&&De.constructor&&(we=De.constructor.name),we==="Map"||we==="Set")return Array.from(De);if(we==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(we))return G(De,ye)}function G(De,ye){(ye==null||ye>De.length)&&(ye=De.length);for(var we=0,ae=new Array(ye);we<ye;we++)ae[we]=De[we];return ae}function P(De,ye){var we;if(typeof Symbol=="undefined"||De[Symbol.iterator]==null){if(Array.isArray(De)||(we=U(De))||ye&&De&&typeof De.length=="number"){we&&(De=we);var ae=0;return function(){return ae>=De.length?{done:!0}:{done:!1,value:De[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 we=De[Symbol.iterator](),we.next.bind(we)}function k(De,ye){return ye={exports:{}},De(ye,ye.exports),ye.exports}var K=k(function(De){function ye(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function we(ae){De.exports.defaults=ae}De.exports={defaults:ye(),getDefaults:ye,changeDefaults:we}}),I=K.defaults,r=K.getDefaults,M=K.changeDefaults,_=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},o=function(ye){return a[ye]};function c(De,ye){if(ye){if(_.test(De))return De.replace(p,o)}else if(m.test(De))return De.replace(u,o);return De}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(De){return De.replace(s,function(ye,we){return we=we.toLowerCase(),we==="colon"?":":we.charAt(0)==="#"?we.charAt(1)==="x"?String.fromCharCode(parseInt(we.substring(2),16)):String.fromCharCode(+we.substring(1)):""})}var n=/(^|[^\[])\^/g;function O(De,ye){De=De.source||De,ye=ye||"";var we={replace:function(se,pe){return pe=pe.source||pe,pe=pe.replace(n,"$1"),De=De.replace(se,pe),we},getRegex:function(){return new RegExp(De,ye)}};return we}var T=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(De,ye,we){if(De){var ae;try{ae=decodeURIComponent(i(we)).replace(T,"").toLowerCase()}catch(se){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}ye&&!C.test(we)&&(we=h(ye,we));try{we=encodeURI(we).replace(/%25/g,"%")}catch(se){return null}return we}var S={},v=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(De,ye){S[" "+De]||(v.test(De)?S[" "+De]=De+"/":S[" "+De]=j(De,"/",!0)),De=S[" "+De];var we=De.indexOf(":")===-1;return ye.substring(0,2)==="//"?we?ye:De.replace(E,"$1")+ye:ye.charAt(0)==="/"?we?ye:De.replace(f,"$1")+ye:De+ye}var y={exec:function(){}};function g(De){for(var ye=1,we,ae;ye<arguments.length;ye++){we=arguments[ye];for(ae in we)Object.prototype.hasOwnProperty.call(we,ae)&&(De[ae]=we[ae])}return De}function x(De,ye){var we=De.replace(/\|/g,function(pe,_e,be){for(var Ke=!1,Ot=_e;--Ot>=0&&be[Ot]==="\\";)Ke=!Ke;return Ke?"|":" |"}),ae=we.split(/ \|/),se=0;if(ae.length>ye)ae.splice(ye);else for(;ae.length<ye;)ae.push("");for(;se<ae.length;se++)ae[se]=ae[se].trim().replace(/\\\|/g,"|");return ae}function j(De,ye,we){var ae=De.length;if(ae===0)return"";for(var se=0;se<ae;){var pe=De.charAt(ae-se-1);if(pe===ye&&!we)se++;else if(pe!==ye&&we)se++;else break}return De.substr(0,ae-se)}function B(De,ye){if(De.indexOf(ye[1])===-1)return-1;for(var we=De.length,ae=0,se=0;se<we;se++)if(De[se]==="\\")se++;else if(De[se]===ye[0])ae++;else if(De[se]===ye[1]&&(ae--,ae<0))return se;return-1}function A(De){De&&De.sanitize&&!De.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var H={escape:c,unescape:i,edit:O,cleanUrl:R,resolveUrl:h,noopTest:y,merge:g,splitCells:x,rtrim:j,findClosingBracket:B,checkSanitizeDeprecation:A},F=K.defaults,w=H.rtrim,Y=H.splitCells,q=H.escape,ie=H.findClosingBracket;function ge(De,ye,we){var ae=ye.href,se=ye.title?q(ye.title):null,pe=De[1].replace(/\\([\[\]])/g,"$1");return De[0].charAt(0)!=="!"?{type:"link",raw:we,href:ae,title:se,text:pe}:{type:"image",raw:we,href:ae,title:se,text:q(pe)}}function Je(De,ye){var we=De.match(/^(\s+)(?:```)/);if(we===null)return ye;var ae=we[1];return ye.split(`
`).map(function(se){var pe=se.match(/^\s+/);if(pe===null)return se;var _e=pe[0];return _e.length>=ae.length?se.slice(ae.length):se}).join(`
`)}var xe=function(){function De(we){this.options=we||F}var ye=De.prototype;return ye.space=function(ae){var se=this.rules.block.newline.exec(ae);if(se)return se[0].length>1?{type:"space",raw:se[0]}:{raw:`
`}},ye.code=function(ae,se){var pe=this.rules.block.code.exec(ae);if(pe){var _e=se[se.length-1];if(_e&&_e.type==="paragraph")return{raw:pe[0],text:pe[0].trimRight()};var be=pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:pe[0],codeBlockStyle:"indented",text:this.options.pedantic?be:w(be,`
`)}}},ye.fences=function(ae){var se=this.rules.block.fences.exec(ae);if(se){var pe=se[0],_e=Je(pe,se[3]||"");return{type:"code",raw:pe,lang:se[2]?se[2].trim():se[2],text:_e}}},ye.heading=function(ae){var se=this.rules.block.heading.exec(ae);if(se)return{type:"heading",raw:se[0],depth:se[1].length,text:se[2]}},ye.nptable=function(ae){var se=this.rules.block.nptable.exec(ae);if(se){var pe={type:"table",header:Y(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
`):[],raw:se[0]};if(pe.header.length===pe.align.length){var _e=pe.align.length,be;for(be=0;be<_e;be++)/^ *-+: *$/.test(pe.align[be])?pe.align[be]="right":/^ *:-+: *$/.test(pe.align[be])?pe.align[be]="center":/^ *:-+ *$/.test(pe.align[be])?pe.align[be]="left":pe.align[be]=null;for(_e=pe.cells.length,be=0;be<_e;be++)pe.cells[be]=Y(pe.cells[be],pe.header.length);return pe}}},ye.hr=function(ae){var se=this.rules.block.hr.exec(ae);if(se)return{type:"hr",raw:se[0]}},ye.blockquote=function(ae){var se=this.rules.block.blockquote.exec(ae);if(se){var pe=se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:se[0],text:pe}}},ye.list=function(ae){var se=this.rules.block.list.exec(ae);if(se){for(var pe=se[0],_e=se[2],be=_e.length>1,Ke=_e[_e.length-1]===")",Ot={type:"list",raw:pe,ordered:be,start:be?+_e.slice(0,-1):"",loose:!1,items:[]},rn=se[0].match(this.rules.block.item),Dn=!1,bt,Qt,Et,Ct,lt,de,Ae,kt=rn.length,dt=0;dt<kt;dt++)bt=rn[dt],pe=bt,Qt=bt.length,bt=bt.replace(/^ *([*+-]|\d+[.)]) */,""),~bt.indexOf(`
`)&&(Qt-=bt.length,bt=this.options.pedantic?bt.replace(/^ {1,4}/gm,""):bt.replace(new RegExp("^ {1,"+Qt+"}","gm"),"")),dt!==kt-1&&(Et=this.rules.block.bullet.exec(rn[dt+1])[0],(be?Et.length===1||!Ke&&Et[Et.length-1]===")":Et.length>1||this.options.smartLists&&Et!==_e)&&(Ct=rn.slice(dt+1).join(`
`),Ot.raw=Ot.raw.substring(0,Ot.raw.length-Ct.length),dt=kt-1)),lt=Dn||/\n\n(?!\s*$)/.test(bt),dt!==kt-1&&(Dn=bt.charAt(bt.length-1)===`
`,lt||(lt=Dn)),lt&&(Ot.loose=!0),de=/^\[[ xX]\] /.test(bt),Ae=void 0,de&&(Ae=bt[1]!==" ",bt=bt.replace(/^\[[ xX]\] +/,"")),Ot.items.push({type:"list_item",raw:pe,task:de,checked:Ae,loose:lt,text:bt});return Ot}},ye.html=function(ae){var se=this.rules.block.html.exec(ae);if(se)return{type:this.options.sanitize?"paragraph":"html",raw:se[0],pre:!this.options.sanitizer&&(se[1]==="pre"||se[1]==="script"||se[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):q(se[0]):se[0]}},ye.def=function(ae){var se=this.rules.block.def.exec(ae);if(se){se[3]&&(se[3]=se[3].substring(1,se[3].length-1));var pe=se[1].toLowerCase().replace(/\s+/g," ");return{tag:pe,raw:se[0],href:se[2],title:se[3]}}},ye.table=function(ae){var se=this.rules.block.table.exec(ae);if(se){var pe={type:"table",header:Y(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
`):[]};if(pe.header.length===pe.align.length){pe.raw=se[0];var _e=pe.align.length,be;for(be=0;be<_e;be++)/^ *-+: *$/.test(pe.align[be])?pe.align[be]="right":/^ *:-+: *$/.test(pe.align[be])?pe.align[be]="center":/^ *:-+ *$/.test(pe.align[be])?pe.align[be]="left":pe.align[be]=null;for(_e=pe.cells.length,be=0;be<_e;be++)pe.cells[be]=Y(pe.cells[be].replace(/^ *\| *| *\| *$/g,""),pe.header.length);return pe}}},ye.lheading=function(ae){var se=this.rules.block.lheading.exec(ae);if(se)return{type:"heading",raw:se[0],depth:se[2].charAt(0)==="="?1:2,text:se[1]}},ye.paragraph=function(ae){var se=this.rules.block.paragraph.exec(ae);if(se)return{type:"paragraph",raw:se[0],text:se[1].charAt(se[1].length-1)===`
`?se[1].slice(0,-1):se[1]}},ye.text=function(ae,se){var pe=this.rules.block.text.exec(ae);if(pe){var _e=se[se.length-1];return _e&&_e.type==="text"?{raw:pe[0],text:pe[0]}:{type:"text",raw:pe[0],text:pe[0]}}},ye.escape=function(ae){var se=this.rules.inline.escape.exec(ae);if(se)return{type:"escape",raw:se[0],text:q(se[1])}},ye.tag=function(ae,se,pe){var _e=this.rules.inline.tag.exec(ae);if(_e)return!se&&/^<a /i.test(_e[0])?se=!0:se&&/^<\/a>/i.test(_e[0])&&(se=!1),!pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(_e[0])?pe=!0:pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(_e[0])&&(pe=!1),{type:this.options.sanitize?"text":"html",raw:_e[0],inLink:se,inRawBlock:pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):q(_e[0]):_e[0]}},ye.link=function(ae){var se=this.rules.inline.link.exec(ae);if(se){var pe=ie(se[2],"()");if(pe>-1){var _e=se[0].indexOf("!")===0?5:4,be=_e+se[1].length+pe;se[2]=se[2].substring(0,pe),se[0]=se[0].substring(0,be).trim(),se[3]=""}var Ke=se[2],Ot="";if(this.options.pedantic){var rn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ke);rn?(Ke=rn[1],Ot=rn[3]):Ot=""}else Ot=se[3]?se[3].slice(1,-1):"";Ke=Ke.trim().replace(/^<([\s\S]*)>$/,"$1");var Dn=ge(se,{href:Ke&&Ke.replace(this.rules.inline._escapes,"$1"),title:Ot&&Ot.replace(this.rules.inline._escapes,"$1")},se[0]);return Dn}},ye.reflink=function(ae,se){var pe;if((pe=this.rules.inline.reflink.exec(ae))||(pe=this.rules.inline.nolink.exec(ae))){var _e=(pe[2]||pe[1]).replace(/\s+/g," ");if(_e=se[_e.toLowerCase()],!_e||!_e.href){var be=pe[0].charAt(0);return{type:"text",raw:be,text:be}}var Ke=ge(pe,_e,pe[0]);return Ke}},ye.strong=function(ae,se,pe){pe===void 0&&(pe="");var _e=this.rules.inline.strong.start.exec(ae);if(_e&&(!_e[1]||_e[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){se=se.slice(-1*ae.length);var be=_e[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var Ke;(_e=be.exec(se))!=null;)if(Ke=this.rules.inline.strong.middle.exec(se.slice(0,_e.index+3)),Ke)return{type:"strong",raw:ae.slice(0,Ke[0].length),text:ae.slice(2,Ke[0].length-2)}}},ye.em=function(ae,se,pe){pe===void 0&&(pe="");var _e=this.rules.inline.em.start.exec(ae);if(_e&&(!_e[1]||_e[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){se=se.slice(-1*ae.length);var be=_e[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var Ke;(_e=be.exec(se))!=null;)if(Ke=this.rules.inline.em.middle.exec(se.slice(0,_e.index+2)),Ke)return{type:"em",raw:ae.slice(0,Ke[0].length),text:ae.slice(1,Ke[0].length-1)}}},ye.codespan=function(ae){var se=this.rules.inline.code.exec(ae);if(se){var pe=se[2].replace(/\n/g," "),_e=/[^ ]/.test(pe),be=pe.startsWith(" ")&&pe.endsWith(" ");return _e&&be&&(pe=pe.substring(1,pe.length-1)),pe=q(pe,!0),{type:"codespan",raw:se[0],text:pe}}},ye.br=function(ae){var se=this.rules.inline.br.exec(ae);if(se)return{type:"br",raw:se[0]}},ye.del=function(ae){var se=this.rules.inline.del.exec(ae);if(se)return{type:"del",raw:se[0],text:se[1]}},ye.autolink=function(ae,se){var pe=this.rules.inline.autolink.exec(ae);if(pe){var _e,be;return pe[2]==="@"?(_e=q(this.options.mangle?se(pe[1]):pe[1]),be="mailto:"+_e):(_e=q(pe[1]),be=_e),{type:"link",raw:pe[0],text:_e,href:be,tokens:[{type:"text",raw:_e,text:_e}]}}},ye.url=function(ae,se){var pe;if(pe=this.rules.inline.url.exec(ae)){var _e,be;if(pe[2]==="@")_e=q(this.options.mangle?se(pe[0]):pe[0]),be="mailto:"+_e;else{var Ke;do Ke=pe[0],pe[0]=this.rules.inline._backpedal.exec(pe[0])[0];while(Ke!==pe[0]);_e=q(pe[0]),pe[1]==="www."?be="http://"+_e:be=_e}return{type:"link",raw:pe[0],text:_e,href:be,tokens:[{type:"text",raw:_e,text:_e}]}}},ye.inlineText=function(ae,se,pe){var _e=this.rules.inline.text.exec(ae);if(_e){var be;return se?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):q(_e[0]):_e[0]:be=q(this.options.smartypants?pe(_e[0]):_e[0]),{type:"text",raw:_e[0],text:be}}},De}(),ke=H.noopTest,Qe=H.edit,Ye=H.merge,ve={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ke,table:ke,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=Qe(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=Qe(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Qe(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=/<!--(?!-?>)[\s\S]*?-->/,ve.html=Qe(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Qe(ve._paragraph).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.blockquote=Qe(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=Ye({},ve),ve.gfm=Ye({},ve.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*|$)"}),ve.gfm.nptable=Qe(ve.gfm.nptable).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.gfm.table=Qe(ve.gfm.table).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.pedantic=Ye({},ve.normal,{html:Qe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ke,paragraph:Qe(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var fe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ke,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ke,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};fe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",fe.punctuation=Qe(fe.punctuation).replace(/punctuation/g,fe._punctuation).getRegex(),fe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",fe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",fe.em.start=Qe(fe.em.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.middle=Qe(fe.em.middle).replace(/punctuation/g,fe._punctuation).replace(/overlapSkip/g,fe._overlapSkip).getRegex(),fe.em.endAst=Qe(fe.em.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.endUnd=Qe(fe.em.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.start=Qe(fe.strong.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.middle=Qe(fe.strong.middle).replace(/punctuation/g,fe._punctuation).replace(/blockSkip/g,fe._blockSkip).getRegex(),fe.strong.endAst=Qe(fe.strong.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.endUnd=Qe(fe.strong.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.blockSkip=Qe(fe._blockSkip,"g").getRegex(),fe.overlapSkip=Qe(fe._overlapSkip,"g").getRegex(),fe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,fe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,fe._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,fe.autolink=Qe(fe.autolink).replace("scheme",fe._scheme).replace("email",fe._email).getRegex(),fe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,fe.tag=Qe(fe.tag).replace("comment",ve._comment).replace("attribute",fe._attribute).getRegex(),fe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,fe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,fe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,fe.link=Qe(fe.link).replace("label",fe._label).replace("href",fe._href).replace("title",fe._title).getRegex(),fe.reflink=Qe(fe.reflink).replace("label",fe._label).getRegex(),fe.reflinkSearch=Qe(fe.reflinkSearch,"g").replace("reflink",fe.reflink).replace("nolink",fe.nolink).getRegex(),fe.normal=Ye({},fe),fe.pedantic=Ye({},fe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Qe(/^!?\[(label)\]\((.*?)\)/).replace("label",fe._label).getRegex(),reflink:Qe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fe._label).getRegex()}),fe.gfm=Ye({},fe.normal,{escape:Qe(fe.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),fe.gfm.url=Qe(fe.gfm.url,"i").replace("email",fe.gfm._extended_email).getRegex(),fe.breaks=Ye({},fe.gfm,{br:Qe(fe.br).replace("{2,}","*").getRegex(),text:Qe(fe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var at={block:ve,inline:fe},Jt=K.defaults,Ft=at.block,St=at.inline;function ze(De){return De.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function gt(De){var ye="",we,ae,se=De.length;for(we=0;we<se;we++)ae=De.charCodeAt(we),Math.random()>.5&&(ae="x"+ae.toString(16)),ye+="&#"+ae+";";return ye}var ct=function(){function De(we){this.tokens=[],this.tokens.links=Object.create(null),this.options=we||Jt,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:Ft.normal,inline:St.normal};this.options.pedantic?(ae.block=Ft.pedantic,ae.inline=St.pedantic):this.options.gfm&&(ae.block=Ft.gfm,this.options.breaks?ae.inline=St.breaks:ae.inline=St.gfm),this.tokenizer.rules=ae}De.lex=function(ae,se){var pe=new De(se);return pe.lex(ae)};var ye=De.prototype;return ye.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},ye.blockTokens=function(ae,se,pe){se===void 0&&(se=[]),pe===void 0&&(pe=!0),ae=ae.replace(/^ +$/gm,"");for(var _e,be,Ke,Ot;ae;){if(_e=this.tokenizer.space(ae)){ae=ae.substring(_e.raw.length),_e.type&&se.push(_e);continue}if(_e=this.tokenizer.code(ae,se)){ae=ae.substring(_e.raw.length),_e.type?se.push(_e):(Ot=se[se.length-1],Ot.raw+=`
`+_e.raw,Ot.text+=`
`+_e.text);continue}if(_e=this.tokenizer.fences(ae)){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(_e=this.tokenizer.heading(ae)){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(_e=this.tokenizer.nptable(ae)){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(_e=this.tokenizer.hr(ae)){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(_e=this.tokenizer.blockquote(ae)){ae=ae.substring(_e.raw.length),_e.tokens=this.blockTokens(_e.text,[],pe),se.push(_e);continue}if(_e=this.tokenizer.list(ae)){for(ae=ae.substring(_e.raw.length),Ke=_e.items.length,be=0;be<Ke;be++)_e.items[be].tokens=this.blockTokens(_e.items[be].text,[],!1);se.push(_e);continue}if(_e=this.tokenizer.html(ae)){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(pe&&(_e=this.tokenizer.def(ae))){ae=ae.substring(_e.raw.length),this.tokens.links[_e.tag]||(this.tokens.links[_e.tag]={href:_e.href,title:_e.title});continue}if(_e=this.tokenizer.table(ae)){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(_e=this.tokenizer.lheading(ae)){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(pe&&(_e=this.tokenizer.paragraph(ae))){ae=ae.substring(_e.raw.length),se.push(_e);continue}if(_e=this.tokenizer.text(ae,se)){ae=ae.substring(_e.raw.length),_e.type?se.push(_e):(Ot=se[se.length-1],Ot.raw+=`
`+_e.raw,Ot.text+=`
`+_e.text);continue}if(ae){var rn="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(rn);break}else throw new Error(rn)}}return se},ye.inline=function(ae){var se,pe,_e,be,Ke,Ot,rn=ae.length;for(se=0;se<rn;se++){Ot=ae[se];switch(Ot.type){case"paragraph":case"text":case"heading":{Ot.tokens=[],this.inlineTokens(Ot.text,Ot.tokens);break}case"table":{for(Ot.tokens={header:[],cells:[]},be=Ot.header.length,pe=0;pe<be;pe++)Ot.tokens.header[pe]=[],this.inlineTokens(Ot.header[pe],Ot.tokens.header[pe]);for(be=Ot.cells.length,pe=0;pe<be;pe++)for(Ke=Ot.cells[pe],Ot.tokens.cells[pe]=[],_e=0;_e<Ke.length;_e++)Ot.tokens.cells[pe][_e]=[],this.inlineTokens(Ke[_e],Ot.tokens.cells[pe][_e]);break}case"blockquote":{this.inline(Ot.tokens);break}case"list":{for(be=Ot.items.length,pe=0;pe<be;pe++)this.inline(Ot.items[pe].tokens);break}}}return ae},ye.inlineTokens=function(ae,se,pe,_e,be){se===void 0&&(se=[]),pe===void 0&&(pe=!1),_e===void 0&&(_e=!1),be===void 0&&(be="");var Ke,Ot=ae,rn;if(this.tokens.links){var Dn=Object.keys(this.tokens.links);if(Dn.length>0)for(;(rn=this.tokenizer.rules.inline.reflinkSearch.exec(Ot))!=null;)Dn.includes(rn[0].slice(rn[0].lastIndexOf("[")+1,-1))&&(Ot=Ot.slice(0,rn.index)+"["+"a".repeat(rn[0].length-2)+"]"+Ot.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(rn=this.tokenizer.rules.inline.blockSkip.exec(Ot))!=null;)Ot=Ot.slice(0,rn.index)+"["+"a".repeat(rn[0].length-2)+"]"+Ot.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Ke=this.tokenizer.escape(ae)){ae=ae.substring(Ke.raw.length),se.push(Ke);continue}if(Ke=this.tokenizer.tag(ae,pe,_e)){ae=ae.substring(Ke.raw.length),pe=Ke.inLink,_e=Ke.inRawBlock,se.push(Ke);continue}if(Ke=this.tokenizer.link(ae)){ae=ae.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,_e)),se.push(Ke);continue}if(Ke=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,_e)),se.push(Ke);continue}if(Ke=this.tokenizer.strong(ae,Ot,be)){ae=ae.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],pe,_e),se.push(Ke);continue}if(Ke=this.tokenizer.em(ae,Ot,be)){ae=ae.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],pe,_e),se.push(Ke);continue}if(Ke=this.tokenizer.codespan(ae)){ae=ae.substring(Ke.raw.length),se.push(Ke);continue}if(Ke=this.tokenizer.br(ae)){ae=ae.substring(Ke.raw.length),se.push(Ke);continue}if(Ke=this.tokenizer.del(ae)){ae=ae.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],pe,_e),se.push(Ke);continue}if(Ke=this.tokenizer.autolink(ae,gt)){ae=ae.substring(Ke.raw.length),se.push(Ke);continue}if(!pe&&(Ke=this.tokenizer.url(ae,gt))){ae=ae.substring(Ke.raw.length),se.push(Ke);continue}if(Ke=this.tokenizer.inlineText(ae,_e,ze)){ae=ae.substring(Ke.raw.length),be=Ke.raw.slice(-1),se.push(Ke);continue}if(ae){var bt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return se},V(De,null,[{key:"rules",get:function(){return{block:Ft,inline:St}}}]),De}(),jt=K.defaults,oe=H.cleanUrl,Ne=H.escape,Ge=function(){function De(we){this.options=we||jt}var ye=De.prototype;return ye.code=function(ae,se,pe){var _e=(se||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(ae,_e);be!=null&&be!==ae&&(pe=!0,ae=be)}return _e?'<pre><code class="'+this.options.langPrefix+Ne(_e,!0)+'">'+(pe?ae:Ne(ae,!0))+`</code></pre>
`:"<pre><code>"+(pe?ae:Ne(ae,!0))+`</code></pre>
`},ye.blockquote=function(ae){return`<blockquote>
`+ae+`</blockquote>
`},ye.html=function(ae){return ae},ye.heading=function(ae,se,pe,_e){return this.options.headerIds?"<h"+se+' id="'+this.options.headerPrefix+_e.slug(pe)+'">'+ae+"</h"+se+`>
`:"<h"+se+">"+ae+"</h"+se+`>
`},ye.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ye.list=function(ae,se,pe){var _e=se?"ol":"ul",be=se&&pe!==1?' start="'+pe+'"':"";return"<"+_e+be+`>
`+ae+"</"+_e+`>
`},ye.listitem=function(ae){return"<li>"+ae+`</li>
`},ye.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ye.paragraph=function(ae){return"<p>"+ae+`</p>
`},ye.table=function(ae,se){return se&&(se="<tbody>"+se+"</tbody>"),`<table>
<thead>
`+ae+`</thead>
`+se+`</table>
`},ye.tablerow=function(ae){return`<tr>
`+ae+`</tr>
`},ye.tablecell=function(ae,se){var pe=se.header?"th":"td",_e=se.align?"<"+pe+' align="'+se.align+'">':"<"+pe+">";return _e+ae+"</"+pe+`>
`},ye.strong=function(ae){return"<strong>"+ae+"</strong>"},ye.em=function(ae){return"<em>"+ae+"</em>"},ye.codespan=function(ae){return"<code>"+ae+"</code>"},ye.br=function(){return this.options.xhtml?"<br/>":"<br>"},ye.del=function(ae){return"<del>"+ae+"</del>"},ye.link=function(ae,se,pe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return pe;var _e='<a href="'+Ne(ae)+'"';return se&&(_e+=' title="'+se+'"'),_e+=">"+pe+"</a>",_e},ye.image=function(ae,se,pe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return pe;var _e='<img src="'+ae+'" alt="'+pe+'"';return se&&(_e+=' title="'+se+'"'),_e+=this.options.xhtml?"/>":">",_e},ye.text=function(ae){return ae},De}(),Xe=function(){function De(){}var ye=De.prototype;return ye.strong=function(ae){return ae},ye.em=function(ae){return ae},ye.codespan=function(ae){return ae},ye.del=function(ae){return ae},ye.html=function(ae){return ae},ye.text=function(ae){return ae},ye.link=function(ae,se,pe){return""+pe},ye.image=function(ae,se,pe){return""+pe},ye.br=function(){return""},De}(),Bt=function(){function De(){this.seen={}}var ye=De.prototype;return ye.slug=function(ae){var se=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(se)){var pe=se;do this.seen[pe]++,se=pe+"-"+this.seen[pe];while(this.seen.hasOwnProperty(se))}return this.seen[se]=0,se},De}(),Wt=K.defaults,en=H.unescape,tt=function(){function De(we){this.options=we||Wt,this.options.renderer=this.options.renderer||new Ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new Bt}De.parse=function(ae,se){var pe=new De(se);return pe.parse(ae)};var ye=De.prototype;return ye.parse=function(ae,se){se===void 0&&(se=!0);var pe="",_e,be,Ke,Ot,rn,Dn,bt,Qt,Et,Ct,lt,de,Ae,kt,dt,Zt,un,Le,et=ae.length;for(_e=0;_e<et;_e++){Ct=ae[_e];switch(Ct.type){case"space":continue;case"hr":{pe+=this.renderer.hr();continue}case"heading":{pe+=this.renderer.heading(this.parseInline(Ct.tokens),Ct.depth,en(this.parseInline(Ct.tokens,this.textRenderer)),this.slugger);continue}case"code":{pe+=this.renderer.code(Ct.text,Ct.lang,Ct.escaped);continue}case"table":{for(Qt="",bt="",Ot=Ct.header.length,be=0;be<Ot;be++)bt+=this.renderer.tablecell(this.parseInline(Ct.tokens.header[be]),{header:!0,align:Ct.align[be]});for(Qt+=this.renderer.tablerow(bt),Et="",Ot=Ct.cells.length,be=0;be<Ot;be++){for(Dn=Ct.tokens.cells[be],bt="",rn=Dn.length,Ke=0;Ke<rn;Ke++)bt+=this.renderer.tablecell(this.parseInline(Dn[Ke]),{header:!1,align:Ct.align[Ke]});Et+=this.renderer.tablerow(bt)}pe+=this.renderer.table(Qt,Et);continue}case"blockquote":{Et=this.parse(Ct.tokens),pe+=this.renderer.blockquote(Et);continue}case"list":{for(lt=Ct.ordered,de=Ct.start,Ae=Ct.loose,Ot=Ct.items.length,Et="",be=0;be<Ot;be++)dt=Ct.items[be],Zt=dt.checked,un=dt.task,kt="",dt.task&&(Le=this.renderer.checkbox(Zt),Ae?dt.tokens.length>0&&dt.tokens[0].type==="text"?(dt.tokens[0].text=Le+" "+dt.tokens[0].text,dt.tokens[0].tokens&&dt.tokens[0].tokens.length>0&&dt.tokens[0].tokens[0].type==="text"&&(dt.tokens[0].tokens[0].text=Le+" "+dt.tokens[0].tokens[0].text)):dt.tokens.unshift({type:"text",text:Le}):kt+=Le),kt+=this.parse(dt.tokens,Ae),Et+=this.renderer.listitem(kt,un,Zt);pe+=this.renderer.list(Et,lt,de);continue}case"html":{pe+=this.renderer.html(Ct.text);continue}case"paragraph":{pe+=this.renderer.paragraph(this.parseInline(Ct.tokens));continue}case"text":{for(Et=Ct.tokens?this.parseInline(Ct.tokens):Ct.text;_e+1<et&&ae[_e+1].type==="text";)Ct=ae[++_e],Et+=`
`+(Ct.tokens?this.parseInline(Ct.tokens):Ct.text);pe+=se?this.renderer.paragraph(Et):Et;continue}default:{var mt='Token with "'+Ct.type+'" type was not found.';if(this.options.silent){console.error(mt);return}else throw new Error(mt)}}}return pe},ye.parseInline=function(ae,se){se=se||this.renderer;var pe="",_e,be,Ke=ae.length;for(_e=0;_e<Ke;_e++){be=ae[_e];switch(be.type){case"escape":{pe+=se.text(be.text);break}case"html":{pe+=se.html(be.text);break}case"link":{pe+=se.link(be.href,be.title,this.parseInline(be.tokens,se));break}case"image":{pe+=se.image(be.href,be.title,be.text);break}case"strong":{pe+=se.strong(this.parseInline(be.tokens,se));break}case"em":{pe+=se.em(this.parseInline(be.tokens,se));break}case"codespan":{pe+=se.codespan(be.text);break}case"br":{pe+=se.br();break}case"del":{pe+=se.del(this.parseInline(be.tokens,se));break}case"text":{pe+=se.text(be.text);break}default:{var Ot='Token with "'+be.type+'" type was not found.';if(this.options.silent){console.error(Ot);return}else throw new Error(Ot)}}}return pe},De}(),tn=H.merge,En=H.checkSanitizeDeprecation,We=H.escape,Fe=K.getDefaults,yt=K.changeDefaults,At=K.defaults;function nt(De,ye,we){if(typeof De=="undefined"||De===null)throw new Error("marked(): input parameter is undefined or null");if(typeof De!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(De)+", string expected");if(typeof ye=="function"&&(we=ye,ye=null),ye=tn({},nt.defaults,ye||{}),En(ye),we){var ae=ye.highlight,se;try{se=ct.lex(De,ye)}catch(Ke){return we(Ke)}var pe=function(Ot){var rn;if(!Ot)try{rn=tt.parse(se,ye)}catch(Dn){Ot=Dn}return ye.highlight=ae,Ot?we(Ot):we(null,rn)};if(!ae||ae.length<3)return pe();if(delete ye.highlight,!se.length)return pe();var _e=0;nt.walkTokens(se,function(Ke){Ke.type==="code"&&(_e++,setTimeout(function(){ae(Ke.text,Ke.lang,function(Ot,rn){if(Ot)return pe(Ot);rn!=null&&rn!==Ke.text&&(Ke.text=rn,Ke.escaped=!0),_e--,_e===0&&pe()})},0))}),_e===0&&pe();return}try{var be=ct.lex(De,ye);return ye.walkTokens&&nt.walkTokens(be,ye.walkTokens),tt.parse(be,ye)}catch(Ke){if(Ke.message+=`
Please report this to https://github.com/markedjs/marked.`,ye.silent)return"<p>An error occurred:</p><pre>"+We(Ke.message+"",!0)+"</pre>";throw Ke}}nt.options=nt.setOptions=function(De){return tn(nt.defaults,De),yt(nt.defaults),nt},nt.getDefaults=Fe,nt.defaults=At,nt.use=function(De){var ye=tn({},De);if(De.renderer&&function(){var ae=nt.defaults.renderer||new Ge,se=function(be){var Ke=ae[be];ae[be]=function(){for(var Ot=arguments.length,rn=new Array(Ot),Dn=0;Dn<Ot;Dn++)rn[Dn]=arguments[Dn];var bt=De.renderer[be].apply(ae,rn);return bt===!1&&(bt=Ke.apply(ae,rn)),bt}};for(var pe in De.renderer)se(pe);ye.renderer=ae}(),De.tokenizer&&function(){var ae=nt.defaults.tokenizer||new xe,se=function(be){var Ke=ae[be];ae[be]=function(){for(var Ot=arguments.length,rn=new Array(Ot),Dn=0;Dn<Ot;Dn++)rn[Dn]=arguments[Dn];var bt=De.tokenizer[be].apply(ae,rn);return bt===!1&&(bt=Ke.apply(ae,rn)),bt}};for(var pe in De.tokenizer)se(pe);ye.tokenizer=ae}(),De.walkTokens){var we=nt.defaults.walkTokens;ye.walkTokens=function(ae){De.walkTokens(ae),we&&we(ae)}}nt.setOptions(ye)},nt.walkTokens=function(De,ye){for(var we=P(De),ae;!(ae=we()).done;){var se=ae.value;ye(se);switch(se.type){case"table":{for(var pe=P(se.tokens.header),_e;!(_e=pe()).done;){var be=_e.value;nt.walkTokens(be,ye)}for(var Ke=P(se.tokens.cells),Ot;!(Ot=Ke()).done;)for(var rn=Ot.value,Dn=P(rn),bt;!(bt=Dn()).done;){var Qt=bt.value;nt.walkTokens(Qt,ye)}break}case"list":{nt.walkTokens(se.items,ye);break}default:se.tokens&&nt.walkTokens(se.tokens,ye)}}},nt.Parser=tt,nt.parser=tt.parse,nt.Renderer=Ge,nt.TextRenderer=Xe,nt.Lexer=ct,nt.lexer=ct.lex,nt.Tokenizer=xe,nt.Slugger=Bt,nt.parse=nt;var st=nt;return st})},ELLl:function(Gt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},U=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(a,o,c){c&&c!=Z.Init&&(a.removeKeyMap(P),a.state.closeBrackets=null),o&&(k(G(o,"pairs")),a.state.closeBrackets=o,a.addKeyMap(P))});function G(a,o){return o=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[o]!=null?a[o]:V[o]}var P={Backspace:r,Enter:M};function k(a){for(var o=0;o<a.length;o++){var c=a.charAt(o),s="'"+c+"'";P[s]||(P[s]=K(c))}}k(V.pairs+"`");function K(a){return function(o){return p(o,a)}}function I(a){var o=a.state.closeBrackets;if(!o||o.override)return o;var c=a.getModeAt(a.getCursor());return c.closeBrackets||o}function r(a){var o=I(a);if(!o||a.getOption("disableInput"))return Z.Pass;for(var c=G(o,"pairs"),s=a.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Z.Pass;var n=m(a,s[i].head);if(!n||c.indexOf(n)%2!=0)return Z.Pass}for(var i=s.length-1;i>=0;i--){var O=s[i].head;a.replaceRange("",U(O.line,O.ch-1),U(O.line,O.ch+1),"+delete")}}function M(a){var o=I(a),c=o&&G(o,"explode");if(!c||a.getOption("disableInput"))return Z.Pass;for(var s=a.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Z.Pass;var n=m(a,s[i].head);if(!n||c.indexOf(n)%2!=0)return Z.Pass}a.operation(function(){var O=a.lineSeparator()||`
`;a.replaceSelection(O+O,null),a.execCommand("goCharLeft"),s=a.listSelections();for(var T=0;T<s.length;T++){var C=s[T].head.line;a.indentLine(C,null,!0),a.indentLine(C+1,null,!0)}})}function _(a){var o=Z.cmpPos(a.anchor,a.head)>0;return{anchor:new U(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new U(a.head.line,a.head.ch+(o?1:-1))}}function p(a,o){var c=I(a);if(!c||a.getOption("disableInput"))return Z.Pass;var s=G(c,"pairs"),i=s.indexOf(o);if(i==-1)return Z.Pass;for(var n=G(c,"closeBefore"),O=G(c,"triples"),T=s.charAt(i+1)==o,C=a.listSelections(),R=i%2==0,S,v=0;v<C.length;v++){var E=C[v],f=E.head,h,y=a.getRange(f,U(f.line,f.ch+1));if(R&&!E.empty())h="surround";else if((T||!R)&&y==o)T&&u(a,f)?h="both":O.indexOf(o)>=0&&a.getRange(f,U(f.line,f.ch+3))==o+o+o?h="skipThree":h="skip";else if(T&&f.ch>1&&O.indexOf(o)>=0&&a.getRange(U(f.line,f.ch-2),f)==o+o){if(f.ch>2&&/\bstring/.test(a.getTokenTypeAt(U(f.line,f.ch-2))))return Z.Pass;h="addFour"}else if(T){var g=f.ch==0?" ":a.getRange(U(f.line,f.ch-1),f);if(!Z.isWordChar(y)&&g!=o&&!Z.isWordChar(g))h="both";else return Z.Pass}else if(R&&(y.length===0||/\s/.test(y)||n.indexOf(y)>-1))h="both";else return Z.Pass;if(!S)S=h;else if(S!=h)return Z.Pass}var x=i%2?s.charAt(i-1):o,j=i%2?o:s.charAt(i+1);a.operation(function(){if(S=="skip")a.execCommand("goCharRight");else if(S=="skipThree")for(var B=0;B<3;B++)a.execCommand("goCharRight");else if(S=="surround"){for(var A=a.getSelections(),B=0;B<A.length;B++)A[B]=x+A[B]+j;a.replaceSelections(A,"around"),A=a.listSelections().slice();for(var B=0;B<A.length;B++)A[B]=_(A[B]);a.setSelections(A)}else S=="both"?(a.replaceSelection(x+j,null),a.triggerElectric(x+j),a.execCommand("goCharLeft")):S=="addFour"&&(a.replaceSelection(x+x+x+x,"before"),a.execCommand("goCharRight"))})}function m(a,o){var c=a.getRange(U(o.line,o.ch-1),U(o.line,o.ch+1));return c.length==2?c:null}function u(a,o){var c=a.getTokenAt(U(o.line,o.ch+1));return/\bstring/.test(c.type)&&c.start==o.ch&&(o.ch==0||!/\bstring/.test(a.getTokenTypeAt(o)))}})},F0VM:function(Gt,he,D){Gt.exports={flex_box_center:"flex_box_center___2fDN3",flex_space_between:"flex_space_between___BHBBv",flex_box_vertical_center:"flex_box_vertical_center___tpxsE",flex_box_center_end:"flex_box_center_end___rP7bQ",flex_box_column:"flex_box_column___1_rF-",md:"md___3SObb",title:"title___HfZ1b"}},FOrL:function(Gt,he,D){Gt.exports=D.p+"static/nodata.a6b3f948.png"},FWmy:function(Gt,he,D){"use strict";D.d(he,"a",function(){return Z});function Z(V,U){if(!V)throw new Error(U?`Assertion failed (${U})`:"Assertion Failed")}},Gytx:function(Gt,he){Gt.exports=function(Z,V,U,G){var P=U?U.call(G,Z,V):void 0;if(P!==void 0)return!!P;if(Z===V)return!0;if(typeof Z!="object"||!Z||typeof V!="object"||!V)return!1;var k=Object.keys(Z),K=Object.keys(V);if(k.length!==K.length)return!1;for(var I=Object.prototype.hasOwnProperty.bind(V),r=0;r<k.length;r++){var M=k[r];if(!I(M))return!1;var _=Z[M],p=V[M];if(P=U?U.call(G,_,p,M):void 0,P===!1||P===void 0&&_!==p)return!1}return!0}},HmJG:function(Gt,he,D){},I8Z2:function(Gt,he,D){"use strict";D.d(he,"a",function(){return G}),D.d(he,"b",function(){return m}),D.d(he,"c",function(){return a});var Z=D("q1tI"),V=function(){var o=function(c,s){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var O in n)n.hasOwnProperty(O)&&(i[O]=n[O])},o(c,s)};return function(c,s){o(c,s);function i(){this.constructor=c}c.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),U=Z.createContext(null),G=function(o){V(c,o);function c(){return o!==null&&o.apply(this,arguments)||this}return c.prototype.render=function(){return Z.createElement(U.Provider,{value:this.props.store},this.props.children)},c}(Z.Component),P=D("Gytx"),k=D.n(P),K=D("2mql"),I=D.n(K),r=function(){var o=function(c,s){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var O in n)n.hasOwnProperty(O)&&(i[O]=n[O])},o(c,s)};return function(c,s){o(c,s);function i(){this.constructor=c}c.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),M=function(){return M=Object.assign||function(o){for(var c,s=1,i=arguments.length;s<i;s++){c=arguments[s];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(o[n]=c[n])}return o},M.apply(this,arguments)};function _(o){return o.displayName||o.name||"Component"}var p=function(){return{}};function m(o,c){c===void 0&&(c={});var s=!!o,i=o||p;return function(O){var T=function(R){r(S,R);function S(v,E){var f=R.call(this,v,E)||this;return f.unsubscribe=null,f.handleChange=function(){if(!f.unsubscribe)return;var h=i(f.store.getState(),f.props);f.setState({subscribed:h})},f.store=f.context,f.state={subscribed:i(f.store.getState(),v),store:f.store,props:v},f}return S.getDerivedStateFromProps=function(v,E){return o&&o.length===2&&v!==E.props?{subscribed:i(E.store.getState(),v),props:v}:{props:v}},S.prototype.componentDidMount=function(){this.trySubscribe()},S.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},S.prototype.shouldComponentUpdate=function(v,E){return!k()(this.props,v)||!k()(this.state.subscribed,E.subscribed)},S.prototype.trySubscribe=function(){s&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},S.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},S.prototype.render=function(){var v=M(M(M({},this.props),this.state.subscribed),{store:this.store});return Z.createElement(O,M({},v,{ref:this.props.miniStoreForwardedRef}))},S.displayName="Connect("+_(O)+")",S.contextType=U,S}(Z.Component);if(c.forwardRef){var C=Z.forwardRef(function(R,S){return Z.createElement(T,M({},R,{miniStoreForwardedRef:S}))});return I()(C,O)}return I()(T,O)}}var u=function(){return u=Object.assign||function(o){for(var c,s=1,i=arguments.length;s<i;s++){c=arguments[s];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(o[n]=c[n])}return o},u.apply(this,arguments)};function a(o){var c=o,s=[];function i(T){c=u(u({},c),T);for(var C=0;C<s.length;C++)s[C]()}function n(){return c}function O(T){return s.push(T),function(){var R=s.indexOf(T);s.splice(R,1)}}return{setState:i,getState:n,subscribe:O}}},IBYe:function(Gt,he,D){"use strict";function Z(V){return null}he.a=Z},J66h:function(Gt,he,D){(function(Z){var V,U;(function(G,P){Gt.exports=P(G)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Z!="undefined"?Z:this,function(G){"use strict";G=G||{};var P=G.Base64,k="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=function(x){for(var j={},B=0,A=x.length;B<A;B++)j[x.charAt(B)]=B;return j}(K),r=String.fromCharCode,M=function(x){if(x.length<2){var j=x.charCodeAt(0);return j<128?x:j<2048?r(192|j>>>6)+r(128|j&63):r(224|j>>>12&15)+r(128|j>>>6&63)+r(128|j&63)}else{var j=65536+(x.charCodeAt(0)-55296)*1024+(x.charCodeAt(1)-56320);return r(240|j>>>18&7)+r(128|j>>>12&63)+r(128|j>>>6&63)+r(128|j&63)}},_=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(x){return x.replace(_,M)},m=function(x){var j=[0,2,1][x.length%3],B=x.charCodeAt(0)<<16|(x.length>1?x.charCodeAt(1):0)<<8|(x.length>2?x.charCodeAt(2):0),A=[K.charAt(B>>>18),K.charAt(B>>>12&63),j>=2?"=":K.charAt(B>>>6&63),j>=1?"=":K.charAt(B&63)];return A.join("")},u=G.btoa&&typeof G.btoa=="function"?function(x){return G.btoa(x)}:function(x){if(x.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return x.replace(/[\s\S]{1,3}/g,m)},a=function(x){return u(p(String(x)))},o=function(x){return x.replace(/[+\/]/g,function(j){return j=="+"?"-":"_"}).replace(/=/g,"")},c=function(x,j){return j?o(a(x)):a(x)},s=function(x){return c(x,!0)},i;G.Uint8Array&&(i=function(x,j){for(var B="",A=0,H=x.length;A<H;A+=3){var F=x[A],w=x[A+1],Y=x[A+2],q=F<<16|w<<8|Y;B+=K.charAt(q>>>18)+K.charAt(q>>>12&63)+(typeof w!="undefined"?K.charAt(q>>>6&63):"=")+(typeof Y!="undefined"?K.charAt(q&63):"=")}return j?o(B):B});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(x){switch(x.length){case 4:var j=(7&x.charCodeAt(0))<<18|(63&x.charCodeAt(1))<<12|(63&x.charCodeAt(2))<<6|63&x.charCodeAt(3),B=j-65536;return r((B>>>10)+55296)+r((B&1023)+56320);case 3:return r((15&x.charCodeAt(0))<<12|(63&x.charCodeAt(1))<<6|63&x.charCodeAt(2));default:return r((31&x.charCodeAt(0))<<6|63&x.charCodeAt(1))}},T=function(x){return x.replace(n,O)},C=function(x){var j=x.length,B=j%4,A=(j>0?I[x.charAt(0)]<<18:0)|(j>1?I[x.charAt(1)]<<12:0)|(j>2?I[x.charAt(2)]<<6:0)|(j>3?I[x.charAt(3)]:0),H=[r(A>>>16),r(A>>>8&255),r(A&255)];return H.length-=[0,0,2,1][B],H.join("")},R=G.atob&&typeof G.atob=="function"?function(x){return G.atob(x)}:function(x){return x.replace(/\S{1,4}/g,C)},S=function(x){return R(String(x).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(x){return T(R(x))},E=function(x){return String(x).replace(/[-_]/g,function(j){return j=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(x){return v(E(x))},h;G.Uint8Array&&(h=function(x){return Uint8Array.from(S(E(x)),function(j){return j.charCodeAt(0)})});var y=function(){var x=G.Base64;return G.Base64=P,x};if(G.Base64={VERSION:k,atob:S,btoa:u,fromBase64:f,toBase64:c,utob:p,encode:c,encodeURI:s,btou:T,decode:f,noConflict:y,fromUint8Array:i,toUint8Array:h},typeof Object.defineProperty=="function"){var g=function(x){return{value:x,enumerable:!1,writable:!0,configurable:!0}};G.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",g(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",g(function(x){return c(this,x)})),Object.defineProperty(String.prototype,"toBase64URI",g(function(){return c(this,!0)}))}}return G.Meteor&&(Base64=G.Base64),Gt.exports?Gt.exports.Base64=G.Base64:!(V=[],U=function(){return G.Base64}.apply(he,V),U!==void 0&&(Gt.exports=U)),{Base64:G.Base64}})}).call(this,D("IyRk"))},JYp7:function(Gt,he,D){"use strict";D.d(he,"a",function(){return Z});var Z;(function(V){function U(n){return n&&typeof n=="object"&&typeof n[Symbol.iterator]=="function"}V.is=U;const G=Object.freeze([]);function P(){return G}V.empty=P;function*k(n){yield n}V.single=k;function K(n){return n||G}V.from=K;function I(n){return!n||n[Symbol.iterator]().next().done===!0}V.isEmpty=I;function r(n){return n[Symbol.iterator]().next().value}V.first=r;function M(n,O){for(const T of n)if(O(T))return!0;return!1}V.some=M;function _(n,O){for(const T of n)if(O(T))return T;return}V.find=_;function*p(n,O){for(const T of n)O(T)&&(yield T)}V.filter=p;function*m(n,O){let T=0;for(const C of n)yield O(C,T++)}V.map=m;function*u(...n){for(const O of n)for(const T of O)yield T}V.concat=u;function*a(n){for(const O of n)for(const T of O)yield T}V.concatNested=a;function o(n,O,T){let C=T;for(const R of n)C=O(C,R);return C}V.reduce=o;function*c(n,O,T=n.length){for(O<0&&(O+=n.length),T<0?T+=n.length:T>n.length&&(T=n.length);O<T;O++)yield n[O]}V.slice=c;function s(n,O=Number.POSITIVE_INFINITY){const T=[];if(O===0)return[T,n];const C=n[Symbol.iterator]();for(let R=0;R<O;R++){const S=C.next();if(S.done)return[T,V.empty()];T.push(S.value)}return[T,{[Symbol.iterator](){return C}}]}V.consume=s;function i(n,O,T=(C,R)=>C===R){const C=n[Symbol.iterator](),R=O[Symbol.iterator]();for(;;){const S=C.next(),v=R.next();if(S.done!==v.done)return!1;if(S.done)return!0;if(!T(S.value,v.value))return!1}}V.equals=i})(Z||(Z={}))},LSTS:function(Gt,he,D){"use strict";Object.defineProperty(he,"__esModule",{value:!0});var Z=function(){function p(m,u){for(var a=0;a<u.length;a++){var o=u[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}return function(m,u,a){return u&&p(m.prototype,u),a&&p(m,a),m}}(),V=D("q1tI"),U=k(V),G=D("17x9"),P=k(G);function k(p){return p&&p.__esModule?p:{default:p}}function K(p,m){var u={};for(var a in p){if(m.indexOf(a)>=0)continue;if(!Object.prototype.hasOwnProperty.call(p,a))continue;u[a]=p[a]}return u}function I(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function r(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function M(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var _=function(p){M(m,p);function m(u){I(this,m);var a=r(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,u));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return Z(m,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var a=this.getParentElement(this.scrollComponent);a.scrollTop=a.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var a=!1,o={get passive(){a=!0}};try{document.addEventListener("test",null,o),document.removeEventListener("test",null,o)}catch(c){}return a}},{key:"eventListenerOptions",value:function(){var a=this.props.useCapture;return this.isPassiveSupported()&&(a={useCapture:this.props.useCapture,passive:!0}),a}},{key:"setDefaultLoader",value:function(a){this.defaultLoader=a}},{key:"detachMousewheelListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.scrollComponent.parentNode),a.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.getParentElement(this.scrollComponent)),a.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(a){var o=this.props.getScrollParent&&this.props.getScrollParent();return o!=null?o:a&&a.parentNode}},{key:"filterProps",value:function(a){return a}},{key:"attachScrollListener",value:function(){var a=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!a)return;var o=window;this.props.useWindow===!1&&(o=a),o.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),o.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(a){a.deltaY===1&&!this.isPassiveSupported()&&a.preventDefault()}},{key:"scrollListener",value:function(){var a=this.scrollComponent,o=window,c=this.getParentElement(a),s=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,n=o.pageYOffset!==void 0?o.pageYOffset:i.scrollTop;this.props.isReverse?s=n:s=this.calculateOffset(a,n)}else this.props.isReverse?s=c.scrollTop:s=a.scrollHeight-c.scrollTop-c.clientHeight;s<Number(this.props.threshold)&&a&&a.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=c.scrollHeight,this.beforeScrollTop=c.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(a,o){return a?this.calculateTopPosition(a)+(a.offsetHeight-o-window.innerHeight):0}},{key:"calculateTopPosition",value:function(a){return a?a.offsetTop+this.calculateTopPosition(a.offsetParent):0}},{key:"render",value:function(){var a=this,o=this.filterProps(this.props),c=o.children,s=o.element,i=o.hasMore,n=o.initialLoad,O=o.isReverse,T=o.loader,C=o.loadMore,R=o.pageStart,S=o.ref,v=o.threshold,E=o.useCapture,f=o.useWindow,h=o.getScrollParent,y=K(o,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);y.ref=function(x){a.scrollComponent=x,S&&S(x)};var g=[c];return i&&(T?O?g.unshift(T):g.push(T):this.defaultLoader&&(O?g.unshift(this.defaultLoader):g.push(this.defaultLoader))),U.default.createElement(s,y,g)}}]),m}(V.Component);_.propTypes={children:P.default.node.isRequired,element:P.default.node,hasMore:P.default.bool,initialLoad:P.default.bool,isReverse:P.default.bool,loader:P.default.node,loadMore:P.default.func.isRequired,pageStart:P.default.number,ref:P.default.func,getScrollParent:P.default.func,threshold:P.default.number,useCapture:P.default.bool,useWindow:P.default.bool},_.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},he.default=_,Gt.exports=he.default},LdHM:function(Gt,he,D){"use strict";D.d(he,"b",function(){return n}),D.d(he,"a",function(){return T});var Z=D("1OyB"),V=D("vuIU"),U=D("Ji7U"),G=D("LK+K"),P=D("q1tI"),k=D("rePB"),K=D("Ff2n"),I=D("ODXe"),r=D("4IlW"),M=D("bX4T"),_=D("YrtM"),p=D("TSYQ"),m=D.n(p),u=D("+nKL"),a=D("8OUc"),o=function(Y,q){var ie=Y.prefixCls,ge=Y.id,Je=Y.flattenOptions,xe=Y.childrenAsData,ke=Y.values,Qe=Y.searchValue,Ye=Y.multiple,ve=Y.defaultActiveFirstOption,fe=Y.height,at=Y.itemHeight,Jt=Y.notFoundContent,Ft=Y.open,St=Y.menuItemSelectedIcon,ze=Y.virtual,gt=Y.onSelect,ct=Y.onToggleOpen,jt=Y.onActiveValue,oe=Y.onScroll,Ne=Y.onMouseEnter,Ge="".concat(ie,"-item"),Xe=Object(_.a)(function(){return Je},[Ft,Je],function(st,De){return De[0]&&st[1]!==De[1]}),Bt=P.useRef(null),Wt=function(De){De.preventDefault()},en=function(De){Bt.current&&Bt.current.scrollTo({index:De})},tt=function(De){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,we=Xe.length,ae=0;ae<we;ae+=1){var se=(De+ae*ye+we)%we,pe=Xe[se],_e=pe.group,be=pe.data;if(!_e&&!be.disabled)return se}return-1},tn=P.useState(function(){return tt(0)}),En=Object(I.a)(tn,2),We=En[0],Fe=En[1],yt=function(De){Fe(De);var ye=Xe[De];if(!ye){jt(null,-1);return}jt(ye.data.value,De)};P.useEffect(function(){yt(ve!==!1?tt(0):-1)},[Xe.length,Qe]),P.useEffect(function(){var st=setTimeout(function(){if(!Ye&&Ft&&ke.size===1){var De=Array.from(ke)[0],ye=Xe.findIndex(function(we){var ae=we.data;return ae.value===De});yt(ye),en(ye)}});return function(){return clearTimeout(st)}},[Ft]);var At=function(De){De!==void 0&&gt(De,{selected:!ke.has(De)}),Ye||ct(!1)};if(P.useImperativeHandle(q,function(){return{onKeyDown:function(De){var ye=De.which;switch(ye){case r.a.UP:case r.a.DOWN:{var we=0;if(ye===r.a.UP?we=-1:ye===r.a.DOWN&&(we=1),we!==0){var ae=tt(We+we,we);en(ae),yt(ae)}break}case r.a.ENTER:{var se=Xe[We];se&&!se.data.disabled?At(se.data.value):At(void 0),Ft&&De.preventDefault();break}case r.a.ESC:ct(!1)}},onKeyUp:function(){},scrollTo:function(De){en(De)}}}),Xe.length===0)return P.createElement("div",{role:"listbox",id:"".concat(ge,"_list"),className:"".concat(Ge,"-empty"),onMouseDown:Wt},Jt);function nt(st){var De=Xe[st];if(!De)return null;var ye=De.data||{},we=ye.value,ae=ye.label,se=ye.children,pe=Object(M.a)(ye,!0),_e=xe?se:ae;return De?P.createElement("div",Object.assign({"aria-label":typeof _e=="string"?_e:null},pe,{key:st,role:"option",id:"".concat(ge,"_list_").concat(st),"aria-selected":ke.has(we)}),we):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(ge,"_list"),style:{height:0,width:0,overflow:"hidden"}},nt(We-1),nt(We),nt(We+1)),P.createElement(u.a,{itemKey:"key",ref:Bt,data:Xe,height:fe,itemHeight:at,fullHeight:!1,onMouseDown:Wt,onScroll:oe,virtual:ze,onMouseEnter:Ne},function(st,De){var ye,we=st.group,ae=st.groupOption,se=st.data,pe=se.label,_e=se.key;if(we)return P.createElement("div",{className:m()(Ge,"".concat(Ge,"-group"))},pe!==void 0?pe:_e);var be=se.disabled,Ke=se.value,Ot=se.title,rn=se.children,Dn=se.style,bt=se.className,Qt=Object(K.a)(se,["disabled","value","title","children","style","className"]),Et=ke.has(Ke),Ct="".concat(Ge,"-option"),lt=m()(Ge,Ct,bt,(ye={},Object(k.a)(ye,"".concat(Ct,"-grouped"),ae),Object(k.a)(ye,"".concat(Ct,"-active"),We===De&&!be),Object(k.a)(ye,"".concat(Ct,"-disabled"),be),Object(k.a)(ye,"".concat(Ct,"-selected"),Et),ye)),de=xe?rn:pe,Ae=!St||typeof St=="function"||Et;return P.createElement("div",Object.assign({},Qt,{"aria-selected":Et,className:lt,title:Ot,onMouseMove:function(){if(We===De||be)return;yt(De)},onClick:function(){be||At(Ke)},style:Dn}),P.createElement("div",{className:"".concat(Ct,"-content")},de||Ke),P.isValidElement(St)||Et,Ae&&P.createElement(a.a,{className:"".concat(Ge,"-option-state"),customizeIcon:St,customizeIconProps:{isSelected:Et}},Et?"\u2713":null))}))},c=P.forwardRef(o);c.displayName="OptionList";var s=c,i=function(){return null};i.isSelectOption=!0;var n=i,O=function(){return null};O.isSelectOptGroup=!0;var T=O,C=D("VTBJ"),R=D("Zm9Q");function S(w){var Y=w.key,q=w.props,ie=q.children,ge=q.value,Je=Object(K.a)(q,["children","value"]);return Object(C.a)({key:Y,value:ge!==void 0?ge:Y,children:ie},Je)}function v(w){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(w).map(function(q,ie){if(!P.isValidElement(q)||!q.type)return null;var ge=q.type.isSelectOptGroup,Je=q.key,xe=q.props,ke=xe.children,Qe=Object(K.a)(xe,["children"]);return Y||!ge?S(q):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat(Je===null?ie:Je,"__"),label:Je},Qe),{},{options:v(ke)})}).filter(function(q){return q})}var E=D("2Qr1"),f=D("qNPg"),h=D("U8pU"),y=D("Kwbf"),g=D("WKfj");function x(w){var Y=w.mode,q=w.options,ie=w.children,ge=w.backfill,Je=w.allowClear,xe=w.placeholder,ke=w.getInputElement,Qe=w.showSearch,Ye=w.onSearch,ve=w.defaultOpen,fe=w.autoFocus,at=w.labelInValue,Jt=w.value,Ft=w.inputValue,St=w.optionLabelProp,ze=Y==="multiple"||Y==="tags",gt=Qe!==void 0?Qe:ze||Y==="combobox",ct=q||v(ie);if(Object(y.a)(Y!=="tags"||ct.every(function(Ge){return!Ge.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var jt=ct.some(function(Ge){return Ge.options?Ge.options.some(function(Xe){return typeof("value"in Xe?Xe.value:Xe.key)=="number"}):typeof("value"in Ge?Ge.value:Ge.key)=="number"});Object(y.a)(!jt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(y.a)(Y!=="combobox"||!St,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(y.a)(Y==="combobox"||!ge,"`backfill` only works with `combobox` mode."),Object(y.a)(Y==="combobox"||!ke,"`getInputElement` only work with `combobox` mode."),Object(y.b)(Y!=="combobox"||!ke||!Je||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ye&&!gt&&Y!=="combobox"&&Y!=="tags"&&Object(y.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(y.b)(!ve||fe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Jt!=null){var oe=Object(g.d)(Jt);Object(y.a)(!at||oe.every(function(Ge){return Object(h.a)(Ge)==="object"&&("key"in Ge||"value"in Ge)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(y.a)(!ze||Array.isArray(Jt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Ne=null;Object(R.a)(ie).some(function(Ge){if(!P.isValidElement(Ge)||!Ge.type)return!1;var Xe=Ge.type;if(Xe.isSelectOption)return!1;if(Xe.isSelectOptGroup){var Bt=Object(R.a)(Ge.props.children).every(function(Wt){return!P.isValidElement(Wt)||!Ge.type||Wt.type.isSelectOption?!0:(Ne=Wt.type,!1)});return!Bt}return Ne=Xe,!0}),Ne&&Object(y.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ne.displayName||Ne.name||Ne,"`.")),Object(y.a)(Ft===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=x,B=Object(f.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:v,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:j,fillOptionsWithMissingValue:E.a}),A=function(w){Object(U.a)(q,w);var Y=Object(G.a)(q);function q(){var ie;return Object(Z.a)(this,q),ie=Y.apply(this,arguments),ie.selectRef=P.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(V.a)(q,[{key:"render",value:function(){return P.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),q}(P.Component);A.Option=n,A.OptGroup=T;var H=A,F=he.c=H},M8RZ:function(Gt,he,D){"use strict";D.d(he,"a",function(){return r});var Z=D("fWQN"),V=D("mtLc"),U=D("yKVA"),G=D("879j"),P=D("q1tI"),k=D.n(P),K=D("i8i4"),I=D.n(K),r=function(M){Object(U.a)(p,M);var _=Object(G.a)(p);function p(m){var u;Object(Z.a)(this,p),u=_.call(this,m);var a=window.document;return u.node=a.createElement("div"),a.body.appendChild(u.node),u}return Object(V.a)(p,[{key:"render",value:function(){var u=this.props.children;return Object(K.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(k.a.Component)},MI8n:function(Gt,he,D){"use strict";D.d(he,"c",function(){return P}),D.d(he,"b",function(){return r}),D.d(he,"e",function(){return M}),D.d(he,"a",function(){return _}),D.d(he,"d",function(){return p}),D.d(he,"f",function(){return m});var Z=D("/cxE"),V=D("pmY6"),U=D("24hK"),G=D("5Y4S"),P;(function(u){u.None=()=>V.a.None;function a(x){return(j,B=null,A)=>{let H=!1,F;return F=x(w=>H?void 0:(F?F.dispose():H=!0,j.call(B,w)),null,A),H&&F.dispose(),F}}u.once=a;function o(x,j){return T((B,A=null,H)=>x(F=>B.call(A,j(F)),null,H))}u.map=o;function c(x,j){return T((B,A=null,H)=>x(F=>{j(F),B.call(A,F)},null,H))}u.forEach=c;function s(x,j){return T((B,A=null,H)=>x(F=>j(F)&&B.call(A,F),null,H))}u.filter=s;function i(x){return x}u.signal=i;function n(...x){return(j,B=null,A)=>Object(V.e)(...x.map(H=>H(F=>j.call(B,F),null,A)))}u.any=n;function O(x,j,B){let A=B;return o(x,H=>(A=j(A,H),A))}u.reduce=O;function T(x){let j;const B=new r({onFirstListenerAdd(){j=x(B.fire,B)},onLastListenerRemove(){j.dispose()}});return B.event}function C(x,j,B=100,A=!1,H){let F,w,Y,q=0;const ie=new r({leakWarningThreshold:H,onFirstListenerAdd(){F=x(ge=>{q++,w=j(w,ge),A&&!Y&&(ie.fire(w),w=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Je=w;w=void 0,Y=void 0,(!A||q>1)&&ie.fire(Je),q=0},B)})},onLastListenerRemove(){F.dispose()}});return ie.event}u.debounce=C;function R(x,j=(B,A)=>B===A){let B=!0,A;return s(x,H=>{const F=B||!j(H,A);return B=!1,A=H,F})}u.latch=R;function S(x,j){return[u.filter(x,j),u.filter(x,B=>!j(B))]}u.split=S;function v(x,j=!1,B=[]){let A=B.slice(),H=x(Y=>{A?A.push(Y):w.fire(Y)});const F=()=>{A&&A.forEach(Y=>w.fire(Y)),A=null},w=new r({onFirstListenerAdd(){H||(H=x(Y=>w.fire(Y)))},onFirstListenerDidAdd(){A&&(j?setTimeout(F):F())},onLastListenerRemove(){H&&H.dispose(),H=null}});return w.event}u.buffer=v;class E{constructor(x){this.event=x}map(x){return new E(o(this.event,x))}forEach(x){return new E(c(this.event,x))}filter(x){return new E(s(this.event,x))}reduce(x,j){return new E(O(this.event,x,j))}latch(){return new E(R(this.event))}debounce(x,j=100,B=!1,A){return new E(C(this.event,x,j,B,A))}on(x,j,B){return this.event(x,j,B)}once(x,j,B){return a(this.event)(x,j,B)}}function f(x){return new E(x)}u.chain=f;function h(x,j,B=A=>A){const A=(...Y)=>w.fire(B(...Y)),H=()=>x.on(j,A),F=()=>x.removeListener(j,A),w=new r({onFirstListenerAdd:H,onLastListenerRemove:F});return w.event}u.fromNodeEventEmitter=h;function y(x,j,B=A=>A){const A=(...Y)=>w.fire(B(...Y)),H=()=>x.addEventListener(j,A),F=()=>x.removeEventListener(j,A),w=new r({onFirstListenerAdd:H,onLastListenerRemove:F});return w.event}u.fromDOMEventEmitter=y;function g(x){return new Promise(j=>a(x)(j))}u.toPromise=g})(P||(P={}));class k{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${k._idPool++}`}start(u){this._stopWatch=new G.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}k._idPool=0;let K=-1;class I{constructor(u,a=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let a=K;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||u<a)return;this._stacks||(this._stacks=new Map);const o=new Error().stack.split(`
`).slice(3).join(`
`),c=this._stacks.get(o)||0;if(this._stacks.set(o,c+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let s,i=0;for(const[n,O]of this._stacks)(!s||i<O)&&(s=n,i=O);console.warn(`[${this.name}] potential listener LEAK detected, having ${u} listeners already. MOST frequent listener (${i}):`),console.warn(s)}return()=>{const s=this._stacks.get(o)||0;this._stacks.set(o,s-1)}}}class r{constructor(u){var a;this._disposed=!1,this._options=u,this._leakageMon=K>0?new I(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new k(this._options._profName):void 0}get event(){return this._event||(this._event=(u,a,o)=>{var c;this._listeners||(this._listeners=new U.a);const s=this._listeners.isEmpty();s&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(a?[u,a]:u);s&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,a);const n=(c=this._leakageMon)===null||c===void 0?void 0:c.check(this._listeners.size),O=Object(V.i)(()=>{if(n&&n(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return o instanceof V.b?o.add(O):Array.isArray(o)&&o.push(O),O}),this._event}fire(u){var a,o;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new U.a);for(let c of this._listeners)this._deliveryQueue.push([c,u]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[c,s]=this._deliveryQueue.shift();try{typeof c=="function"?c.call(void 0,s):c[0].call(c[1],s)}catch(i){Object(Z.f)(i)}}(o=this._perfMon)===null||o===void 0||o.stop()}}dispose(){var u,a,o,c,s;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(c=(o=this._options)===null||o===void 0?void 0:o.onLastListenerRemove)===null||c===void 0||c.call(o),(s=this._leakageMon)===null||s===void 0||s.dispose())}}class M extends r{constructor(u){super(u);this._isPaused=0,this._eventQueue=new U.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class _ extends M{constructor(u){var a;super(u);this._delay=(a=u.delay)!==null&&a!==void 0?a:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class p{constructor(){this.buffers=[]}wrapEvent(u){return(a,o,c)=>u(s=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>a.call(o,s)):a.call(o,s)},void 0,c)}bufferEvents(u){const a=[];this.buffers.push(a);const o=u();return this.buffers.pop(),a.forEach(c=>c()),o}}class m{constructor(){this.listening=!1,this.inputEvent=P.None,this.inputEventListener=V.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Gt,he,D){"use strict";(function(Z,V){D.d(he,"b",function(){return o}),D.d(he,"i",function(){return n}),D.d(he,"f",function(){return O}),D.d(he,"d",function(){return T}),D.d(he,"g",function(){return C}),D.d(he,"h",function(){return R}),D.d(he,"c",function(){return S}),D.d(he,"k",function(){return v}),D.d(he,"j",function(){return E}),D.d(he,"a",function(){return f}),D.d(he,"e",function(){return g});var U;const G="en";let P=!1,k=!1,K=!1,I=!1,r=!1,M=!1,_=!1,p,m=G,u,a;const o=typeof self=="object"?self:typeof Z=="object"?Z:{};let c;typeof o.vscode!="undefined"&&typeof o.vscode.process!="undefined"?c=o.vscode.process:typeof V!="undefined"&&(c=V);const s=typeof((U=c==null?void 0:c.versions)===null||U===void 0?void 0:U.electron)=="string"&&c.type==="renderer";if(typeof navigator=="object"&&!s)a=navigator.userAgent,P=a.indexOf("Windows")>=0,k=a.indexOf("Macintosh")>=0,_=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=a.indexOf("Linux")>=0,M=!0,p=navigator.language,m=p;else if(typeof c=="object"){P=c.platform==="win32",k=c.platform==="darwin",K=c.platform==="linux",I=K&&!!c.env.SNAP&&!!c.env.SNAP_REVISION,p=G,m=G;const x=c.env.VSCODE_NLS_CONFIG;if(x)try{const j=JSON.parse(x),B=j.availableLanguages["*"];p=j.locale,m=B||G,u=j._translationsConfigFile}catch(j){}r=!0}else console.error("Unable to resolve platform.");let i=0;k?i=1:P?i=3:K&&(i=2);const n=P,O=k,T=K,C=r,R=M,S=_,v=a,E=function(){if(o.setImmediate)return o.setImmediate.bind(o);if(typeof o.postMessage=="function"&&!o.importScripts){let B=[];o.addEventListener("message",H=>{if(H.data&&H.data.vscodeSetImmediateId)for(let F=0,w=B.length;F<w;F++){const Y=B[F];if(Y.id===H.data.vscodeSetImmediateId){B.splice(F,1),Y.callback();return}}});let A=0;return H=>{const F=++A;B.push({id:F,callback:H}),o.postMessage({vscodeSetImmediateId:F},"*")}}if(typeof(c==null?void 0:c.nextTick)=="function")return c.nextTick.bind(c);const j=Promise.resolve();return B=>j.then(B)}(),f=k||_?2:P?1:3;let h=!0,y=!1;function g(){if(!y){y=!0;const x=new Uint8Array(2);x[0]=1,x[1]=2;const j=new Uint16Array(x.buffer);h=j[0]===(2<<8)+1}return h}}).call(this,D("IyRk"),D("Q2Ig"))},N0LK:function(Gt,he,D){"use strict";D.d(he,"C",function(){return Z}),D.d(he,"v",function(){return U}),D.d(he,"s",function(){return G}),D.d(he,"t",function(){return P}),D.d(he,"U",function(){return k}),D.d(he,"J",function(){return K}),D.d(he,"O",function(){return I}),D.d(he,"p",function(){return r}),D.d(he,"T",function(){return M}),D.d(he,"q",function(){return _}),D.d(he,"N",function(){return p}),D.d(he,"M",function(){return m}),D.d(he,"Q",function(){return u}),D.d(he,"u",function(){return a}),D.d(he,"x",function(){return o}),D.d(he,"I",function(){return c}),D.d(he,"f",function(){return s}),D.d(he,"h",function(){return i}),D.d(he,"g",function(){return n}),D.d(he,"i",function(){return O}),D.d(he,"G",function(){return T}),D.d(he,"H",function(){return C}),D.d(he,"r",function(){return R}),D.d(he,"R",function(){return S}),D.d(he,"d",function(){return v}),D.d(he,"e",function(){return E}),D.d(he,"E",function(){return f}),D.d(he,"F",function(){return h}),D.d(he,"j",function(){return y}),D.d(he,"z",function(){return g}),D.d(he,"K",function(){return j}),D.d(he,"L",function(){return B}),D.d(he,"m",function(){return H}),D.d(he,"k",function(){return w}),D.d(he,"A",function(){return q}),D.d(he,"a",function(){return ie}),D.d(he,"n",function(){return ge}),D.d(he,"l",function(){return Je}),D.d(he,"D",function(){return xe}),D.d(he,"B",function(){return ke}),D.d(he,"b",function(){return Qe}),D.d(he,"S",function(){return Ye}),D.d(he,"o",function(){return ve}),D.d(he,"P",function(){return fe}),D.d(he,"w",function(){return at}),D.d(he,"c",function(){return Jt}),D.d(he,"y",function(){return ze});function Z(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const V=/{(\d+)}/g;function U(oe,...Ne){return Ne.length===0?oe:oe.replace(V,function(Ge,Xe){const Bt=parseInt(Xe,10);return isNaN(Bt)||Bt<0||Bt>=Ne.length?Ge:Ne[Bt]})}function G(oe){return oe.replace(/[<>&]/g,function(Ne){switch(Ne){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Ne}})}function P(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k(oe,Ne=" "){const Ge=K(oe,Ne);return I(Ge,Ne)}function K(oe,Ne){if(!oe||!Ne)return oe;const Ge=Ne.length;if(Ge===0||oe.length===0)return oe;let Xe=0;for(;oe.indexOf(Ne,Xe)===Xe;)Xe=Xe+Ge;return oe.substring(Xe)}function I(oe,Ne){if(!oe||!Ne)return oe;const Ge=Ne.length,Xe=oe.length;if(Ge===0||Xe===0)return oe;let Bt=Xe,Wt=-1;for(;!(Wt=oe.lastIndexOf(Ne,Bt-1),Wt===-1||Wt+Ge!==Bt);){if(Wt===0)return"";Bt=Wt}return oe.substring(0,Bt)}function r(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function M(oe){return oe.replace(/\*/g,"")}function _(oe,Ne,Ge={}){if(!oe)throw new Error("Cannot create regex from empty string");Ne||(oe=P(oe)),Ge.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let Xe="";return Ge.global&&(Xe+="g"),Ge.matchCase||(Xe+="i"),Ge.multiline&&(Xe+="m"),Ge.unicode&&(Xe+="u"),new RegExp(oe,Xe)}function p(oe){if(oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$")return!1;const Ne=oe.exec("");return!!(Ne&&oe.lastIndex===0)}function m(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function u(oe){return oe.split(/\r\n|\r|\n/)}function a(oe){for(let Ne=0,Ge=oe.length;Ne<Ge;Ne++){const Xe=oe.charCodeAt(Ne);if(Xe!==32&&Xe!==9)return Ne}return-1}function o(oe,Ne=0,Ge=oe.length){for(let Xe=Ne;Xe<Ge;Xe++){const Bt=oe.charCodeAt(Xe);if(Bt!==32&&Bt!==9)return oe.substring(Ne,Xe)}return oe.substring(Ne,Ge)}function c(oe,Ne=oe.length-1){for(let Ge=Ne;Ge>=0;Ge--){const Xe=oe.charCodeAt(Ge);if(Xe!==32&&Xe!==9)return Ge}return-1}function s(oe,Ne){return oe<Ne?-1:oe>Ne?1:0}function i(oe,Ne,Ge=0,Xe=oe.length,Bt=0,Wt=Ne.length){for(;Ge<Xe&&Bt<Wt;Ge++,Bt++){let tn=oe.charCodeAt(Ge),En=Ne.charCodeAt(Bt);if(tn<En)return-1;if(tn>En)return 1}const en=Xe-Ge,tt=Wt-Bt;return en<tt?-1:en>tt?1:0}function n(oe,Ne){return O(oe,Ne,0,oe.length,0,Ne.length)}function O(oe,Ne,Ge=0,Xe=oe.length,Bt=0,Wt=Ne.length){for(;Ge<Xe&&Bt<Wt;Ge++,Bt++){let tn=oe.charCodeAt(Ge),En=Ne.charCodeAt(Bt);if(tn===En)continue;if(tn>=128||En>=128)return i(oe.toLowerCase(),Ne.toLowerCase(),Ge,Xe,Bt,Wt);T(tn)&&(tn-=32),T(En)&&(En-=32);const We=tn-En;if(We===0)continue;return We}const en=Xe-Ge,tt=Wt-Bt;return en<tt?-1:en>tt?1:0}function T(oe){return oe>=97&&oe<=122}function C(oe){return oe>=65&&oe<=90}function R(oe,Ne){return oe.length===Ne.length&&O(oe,Ne)===0}function S(oe,Ne){const Ge=Ne.length;return Ne.length>oe.length?!1:O(oe,Ne,0,Ge)===0}function v(oe,Ne){let Ge,Xe=Math.min(oe.length,Ne.length);for(Ge=0;Ge<Xe;Ge++)if(oe.charCodeAt(Ge)!==Ne.charCodeAt(Ge))return Ge;return Xe}function E(oe,Ne){let Ge,Xe=Math.min(oe.length,Ne.length);const Bt=oe.length-1,Wt=Ne.length-1;for(Ge=0;Ge<Xe;Ge++)if(oe.charCodeAt(Bt-Ge)!==Ne.charCodeAt(Wt-Ge))return Ge;return Xe}function f(oe){return 55296<=oe&&oe<=56319}function h(oe){return 56320<=oe&&oe<=57343}function y(oe,Ne){return(oe-55296<<10)+(Ne-56320)+65536}function g(oe,Ne,Ge){const Xe=oe.charCodeAt(Ge);if(f(Xe)&&Ge+1<Ne){const Bt=oe.charCodeAt(Ge+1);if(h(Bt))return y(Xe,Bt)}return Xe}function x(oe,Ne){const Ge=oe.charCodeAt(Ne-1);if(h(Ge)&&Ne>1){const Xe=oe.charCodeAt(Ne-2);if(f(Xe))return y(Xe,Ge)}return Ge}function j(oe,Ne){const Ge=Ft.getInstance(),Xe=Ne,Bt=oe.length,Wt=g(oe,Bt,Ne);Ne+=Wt>=65536?2:1;let en=Ge.getGraphemeBreakType(Wt);for(;Ne<Bt;){const tt=g(oe,Bt,Ne),tn=Ge.getGraphemeBreakType(tt);if(Jt(en,tn))break;Ne+=tt>=65536?2:1,en=tn}return Ne-Xe}function B(oe,Ne){const Ge=Ft.getInstance(),Xe=Ne,Bt=x(oe,Ne);Ne-=Bt>=65536?2:1;let Wt=Ge.getGraphemeBreakType(Bt);for(;Ne>0;){const en=x(oe,Ne),tt=Ge.getGraphemeBreakType(en);if(Jt(tt,Wt))break;Ne-=en>=65536?2:1,Wt=tt}return Xe-Ne}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function H(oe){return A.test(oe)}const F=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function w(oe){return F.test(oe)}const Y=/^[\t\n\r\x20-\x7E]*$/;function q(oe){return Y.test(oe)}const ie=/[\u2028\u2029]/;function ge(oe){return ie.test(oe)}function Je(oe){for(let Ne=0,Ge=oe.length;Ne<Ge;Ne++)if(xe(oe.charCodeAt(Ne)))return!0;return!1}function xe(oe){return oe=+oe,oe>=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function ke(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const Qe=String.fromCharCode(65279);function Ye(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function ve(oe,Ne=!1){return oe?(Ne&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function fe(oe){const Ne=90-65+1;return oe=oe%(2*Ne),oe<Ne?String.fromCharCode(97+oe):String.fromCharCode(65+oe-Ne)}function at(oe){const Ne=Ft.getInstance();return Ne.getGraphemeBreakType(oe)}function Jt(oe,Ne){return oe===0?Ne!==5&&Ne!==7:oe===2&&Ne===3?!1:oe===4||oe===2||oe===3||(Ne===4||Ne===2||Ne===3)?!0:oe===8&&(Ne===8||Ne===9||Ne===11||Ne===12)||((oe===11||oe===9)&&(Ne===9||Ne===10)||((oe===12||oe===10)&&Ne===10||(Ne===5||Ne===13||(Ne===7||(oe===1||oe===13&&Ne===14)))))?!1:!(oe===6&&Ne===6)}class Ft{constructor(){this._data=St()}static getInstance(){return Ft._INSTANCE||(Ft._INSTANCE=new Ft),Ft._INSTANCE}getGraphemeBreakType(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;const Ne=this._data,Ge=Ne.length/3;let Xe=1;for(;Xe<=Ge;)if(oe<Ne[3*Xe])Xe=2*Xe;else if(oe>Ne[3*Xe+1])Xe=2*Xe+1;else return Ne[3*Xe+2];return 0}}Ft._INSTANCE=null;function St(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function ze(oe,Ne){if(oe===0)return 0;const Ge=gt(oe,Ne);if(Ge!==void 0)return Ge;const Xe=x(Ne,oe);return oe-=ct(Xe),oe}function gt(oe,Ne){let Ge=x(Ne,oe);for(oe-=ct(Ge);jt(Ge)||Ge===65039||Ge===8419;){if(oe===0)return;Ge=x(Ne,oe),oe-=ct(Ge)}if(!ke(Ge))return;if(oe>=0){const Xe=x(Ne,oe);Xe===8205&&(oe-=ct(Xe))}return oe}function ct(oe){return oe>=65536?2:1}function jt(oe){return 127995<=oe&&oe<=127999}},NLgs:function(Gt,he,D){"use strict";D.d(he,"e",function(){return c}),D.d(he,"f",function(){return s}),D.d(he,"d",function(){return n}),D.d(he,"c",function(){return O}),D.d(he,"a",function(){return T}),D.d(he,"b",function(){return C});var Z=D("miYZ"),V=D("tsqr"),U=D("9og8"),G=D("2qtc"),P=D("kLXV"),k=D("WmNS"),K=D.n(k),I=D("q1tI"),r=D.n(I),M=D("9kvl"),_=D("xKgJ"),p=D("1vsH"),m=D("RCxd"),u=D("yTi+"),a=D.n(u),o=D("m3rI"),c=function(S){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(s(S)&&i(v))},s=function(S){return Object(_.p)()?!0:(S({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},i=function(){var S,v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(M.c)()._store.getState(),f=E.user;return(S=f.userInfo)!==null&&S!==void 0&&S.profile_completed?!0:(P.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:v?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){M.d.push("/account/profile/edit")}}),!1)},n=function(){var S,v=Object(M.c)()._store.getState(),E=v.user;return(S=E.userInfo)!==null&&S!==void 0&&S.professional_certification?!0:(P.a.confirm({title:"\u63D0\u793A",centered:!0,content:r.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(p.S)("/account/certification")}}),!1)},O=function(){var S;if(Object(_.a)())return!0;var v=Object(M.c)()._store.getState(),E=v.user,f=v.globalSetting;return P.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:o.a.IMG_SERVER+(f==null||((S=f.setting)===null||S===void 0)?void 0:S.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},T=function(S,v){var E;if(S)return!0;var f=Object(M.c)()._store.getState(),h=f.user,y=f.globalSetting;return P.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,v||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),r.a.createElement("div",{style:{marginLeft:"110px"}},r.a.createElement("img",{src:o.a.IMG_SERVER+(y==null||((E=y.setting)===null||E===void 0)?void 0:E.authority_qrcode_url),width:200}),r.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(p.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},C=function(S){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(M.c)()._store.getState(),f=E.shixunsDetail.detail;return(f==null?void 0:f.public)===2||(f==null?void 0:f.public)===1||(f==null?void 0:f.shixun_status)===3?(P.a.info({centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(f==null?void 0:f.public)===2?"\u5DF2\u516C\u5F00":(f==null?void 0:f.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",v,"\u3002"),r.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),r.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:a.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(f==null?void 0:f.shixun_status)===2?(P.a.confirm({centered:!0,icon:r.a.createElement(m.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",v,"\u3002"),r.a.createElement("br",null),r.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){P.a.confirm({width:440,centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var y=Object(U.a)(K.a.mark(function x(){var j;return K.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,S({type:"shixunsDetail/cancelRelease",payload:{id:f==null?void 0:f.identifier}});case 2:j=A.sent,j.status!==401&&(V.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),S({type:"shixunsDetail/getShixunsDetail",payload:{id:f==null?void 0:f.identifier}}),S({type:"practiceSetting/getCommonData",payload:{id:f==null?void 0:f.identifier}}));case 4:case"end":return A.stop()}},x)}));function g(){return y.apply(this,arguments)}return g}()})}}),!0):!1}},Nd3P:function(Gt,he,D){Gt.exports={wrap:"wrap___h8kK3",maxWidth70:"maxWidth70___31ilo",maxWidth80:"maxWidth80___QYyBn",maxWidth100:"maxWidth100___1Caz0",maxWidth110:"maxWidth110___2Ikef",maxWidth120:"maxWidth120___1TY6-",reviewStatusTooltip:"reviewStatusTooltip___btvLr",color32C:"color32C___3168D",MdEditor:"MdEditor___1md-c",tr1:"tr1___33AUl"}},NvD2:function(Gt,he,D){"use strict";D.d(he,"a",function(){return k});var Z=D("Kwbf");function V(K,I){var r=new Set;return K.forEach(function(M){I.has(M)||r.add(M)}),r}function U(K){var I=K||{},r=I.disabled,M=I.disableCheckbox,_=I.checkable;return!!(r||M)||_===!1}function G(K,I,r,M){for(var _=new Set(K),p=new Set,m=0;m<=r;m+=1){var u=I.get(m)||new Set;u.forEach(function(s){var i=s.key,n=s.node,O=s.children,T=O===void 0?[]:O;_.has(i)&&!M(n)&&T.filter(function(C){return!M(C.node)}).forEach(function(C){_.add(C.key)})})}for(var a=new Set,o=r;o>=0;o-=1){var c=I.get(o)||new Set;c.forEach(function(s){var i=s.parent,n=s.node;if(M(n)||!s.parent||a.has(s.parent.key))return;if(M(s.parent.node)){a.add(i.key);return}var O=!0,T=!1;(i.children||[]).filter(function(C){return!M(C.node)}).forEach(function(C){var R=C.key,S=_.has(R);O&&!S&&(O=!1),!T&&(S||p.has(R))&&(T=!0)}),O&&_.add(i.key),T&&p.add(i.key),a.add(i.key)})}return{checkedKeys:Array.from(_),halfCheckedKeys:Array.from(V(p,_))}}function P(K,I,r,M,_){for(var p=new Set(K),m=new Set(I),u=0;u<=M;u+=1){var a=r.get(u)||new Set;a.forEach(function(i){var n=i.key,O=i.node,T=i.children,C=T===void 0?[]:T;!p.has(n)&&!m.has(n)&&!_(O)&&C.filter(function(R){return!_(R.node)}).forEach(function(R){p.delete(R.key)})})}m=new Set;for(var o=new Set,c=M;c>=0;c-=1){var s=r.get(c)||new Set;s.forEach(function(i){var n=i.parent,O=i.node;if(_(O)||!i.parent||o.has(i.parent.key))return;if(_(i.parent.node)){o.add(n.key);return}var T=!0,C=!1;(n.children||[]).filter(function(R){return!_(R.node)}).forEach(function(R){var S=R.key,v=p.has(S);T&&!v&&(T=!1),!C&&(v||m.has(S))&&(C=!0)}),T||p.delete(n.key),C&&m.add(n.key),o.add(n.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(V(m,p))}}function k(K,I,r,M){var _=[],p;M?p=M:p=U;var m=new Set(K.filter(function(c){var s=!!r[c];return s||_.push(c),s})),u=new Map,a=0;Object.keys(r).forEach(function(c){var s=r[c],i=s.level,n=u.get(i);n||(n=new Set,u.set(i,n)),n.add(s),a=Math.max(a,i)}),Object(Z.a)(!_.length,"Tree missing follow keys: ".concat(_.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var o;return I===!0?o=G(m,u,a,p):o=P(m,I.halfCheckedKeys,u,a,p),o}},OH33:function(Gt,he,D){"use strict";D.r(he);var Z=D("g9YV"),V=D("wCAj"),U=D("Znn+"),G=D("ZTPi"),P=D("5Dmo"),k=D("3S7+"),K=D("sPJy"),I=D("bE4q"),r=D("+L6B"),M=D("2/Rp"),_=D("miYZ"),p=D("tsqr"),m=D("9og8"),u=D("2qtc"),a=D("kLXV"),o=D("tJVT"),c=D("WmNS"),s=D.n(c),i=D("q1tI"),n=D.n(i),O=D("ErOA"),T=D("Ty5D"),C=D("55Ip"),R=D("9kvl"),S=D("jhfD"),v=D("1vsH"),E=D("T2oS"),f=D("W9HT"),h=D("DjyN"),y=D("NUBc"),g=D("k1fw"),x=D("9Bee"),j=function(_n){var Sn=_n.shixunHomeworks,bn=_n.dispatch,ur=Object(T.i)();return n.a.createElement(a.a,{centered:!0,title:"\u63D0\u793A",visible:Sn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function sr(){var Q;return s.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,bn({type:"shixunHomeworks/deleteReply",payload:{object_id:Sn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Q=Ce.sent,Q.status===0&&(p.b.success("\u5220\u9664\u6210\u529F"),bn({type:"shixunHomeworks/setActionTabs",payload:{}}),bn({type:"shixunHomeworks/getReplyList",payload:Object(g.a)({},Sn.actionTabs.params)}));case 4:case"end":return Ce.stop()}},sr)})),onCancel:function(){bn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},B=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(j),A=D("wd/R"),H=D.n(A),F=D("iF7n"),w=D.n(F),Y=D("xKgJ"),q=D("BdwD");H.a.lang("ZH-cn");var ie=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],ge=function(_n){var Sn,bn,ur=_n.shixunHomeworks,sr=_n.classroomList,Q=_n.globalSetting,ce=_n.user,Ce=_n.loading,Te=_n.dispatch,rt=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(T.i)()),{},{per_page:10})),Re=Object(o.a)(rt,2),$e=Re[0],it=Re[1],Dt=Object(i.useState)([]),Tt=Object(o.a)(Dt,2),Be=Tt[0],_t=Tt[1],ot=Object(i.useState)(-1),ht=Object(o.a)(ot,2),wt=ht[0],It=ht[1],vt=Object(i.useState)(""),Xt=Object(o.a)(vt,2),dn=Xt[0],Pn=Xt[1],Gn=Object(i.useState)(""),On=Object(o.a)(Gn,2),Nn=On[0],Mn=On[1],Pt=sr.detailLeftMenus,hn=Object(T.h)(),Kt=Object(i.useState)({}),Rt=Object(o.a)(Kt,2),Un=Rt[0],Rn=Rt[1],Yt=ur.workDetail,ft=ur.workList,jn=Object(i.useState)("1"),fn=Object(o.a)(jn,2),Qn=fn[0],qt=fn[1],An=Object(i.useState)(!1),Fn=Object(o.a)(An,2),vn=Fn[0],yr=Fn[1];Object(i.useEffect)(function(){ft.homework_status&&Ln()},[ft]);function Ln(){return wn.apply(this,arguments)}function wn(){return wn=Object(m.a)(s.a.mark(function Lt(){var Ze,Nt,Mt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return yr(!0),zn.next=3,Object(O.a)("/api/courses/".concat($e.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(g.a)(Object(g.a)({},$e),{},{id:$e.categoryId})});case 3:Mt=zn.sent,_t(Mt),yr(!1),$e.defaultExpandedRowKeys=["".concat(Mt==null||((Ze=Mt.data)===null||Ze===void 0||((Nt=Ze[0])===null||Nt===void 0))?void 0:Nt.identifier)],Qn!="2"&&qt(Mt!=null&&Mt.description?"1":"2"),it(Object(g.a)({},$e));case 9:case"end":return zn.stop()}},Lt)})),wn.apply(this,arguments)}return n.a.createElement("section",{className:w.a.bg},n.a.createElement(f.a,{spinning:vn},n.a.createElement(G.a,{onChange:function(Ze){qt(Ze)},activeKey:Qn},n.a.createElement(G.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(Be!=null&&Be.description)&&n.a.createElement(q.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(x.a,{value:(Be==null?void 0:Be.description)||""}))),n.a.createElement(G.a.TabPane,{key:2,tab:"\u9898\u76EE\u5217\u8868"},n.a.createElement("div",null,n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},$e.defaultExpandedRowKeys&&n.a.createElement(V.a,{dataSource:Be==null?void 0:Be.data,rowKey:function(Ze){return Ze==null?void 0:Ze.identifier},pagination:!1,expandable:{expandedRowRender:function(Ze){var Nt,Mt;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",Ze==null?void 0:Ze.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",Ze==null?void 0:Ze.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(Y.c)()&&(Be==null||((Nt=Be.homework_status)===null||Nt===void 0)?void 0:Nt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(M.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(Ze==null?void 0:Ze.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[$e.coursesId,$e.categoryId])}},"\u7F16\u8F91"),Object(Y.c)()&&(Be==null||((Mt=Be.homework_status)===null||Mt===void 0)?void 0:Mt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(M.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){a.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var zn=Object(m.a)(s.a.mark(function lr(){var er;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,Object(O.a)("/api/problems/".concat(Ze==null?void 0:Ze.identifier,".json"),{method:"delete"});case 2:er=mr.sent,(er==null?void 0:er.status)===0&&(p.b.info("\u5220\u9664\u6210\u529F"),$e.page=1,Ln());case 4:case"end":return mr.stop()}},lr)}));function kn(){return zn.apply(this,arguments)}return kn}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:$e.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(Ze,Nt,Mt){return n.a.createElement("div",null,ie[Ze])}},{title:"\u901A\u8FC7\u7387",dataIndex:"pass_rate",key:"pass_rate"},{title:"\u901A\u8FC7\u4EBA\u6570",dataIndex:"submit_info",key:"submit_info"},{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline",ellipsis:!0,width:"10%",key:"tag_discipline"},{title:"\u64CD\u4F5C",dataIndex:"identifier",key:"identifier",render:function(Ze,Nt,Mt){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat($e.coursesId,"/program_homework/").concat($e.categoryId,"/").concat(Ze,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function cn(){var zn;return s.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return lr.next=2,Object(O.a)("/api/problems/".concat(Nt==null?void 0:Nt.identifier,"/start.json"),{method:"get"});case 2:zn=lr.sent,zn&&(window.open("/myproblems/".concat(zn==null?void 0:zn.identifier,"?type=1")),localStorage.setItem("program_homework",[$e.coursesId,$e.categoryId]));case 4:case"end":return lr.stop()}},cn)})),style:{margin:"0px 20px"}},Object(Y.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(Be==null||((Sn=Be.data)===null||Sn===void 0||((bn=Sn[0])===null||bn===void 0))?void 0:bn.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(y.a,{defaultCurrent:1,total:Be==null?void 0:Be.count,hideOnSinglePage:!0,showTotal:function(Ze){return n.a.createElement("span",null,"\u5171",Ze,"\u6761")},current:$e.page||1,pageSize:$e.per_page||10,onChange:function(Ze,Nt){$e.page=Ze,$e.per_page=Nt,it(Object(g.a)({},$e)),Ln()}})))))),n.a.createElement(B,null))},Je=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.classroomList,bn=Bn.loading,ur=Bn.user,sr=Bn.globalSetting;return{shixunHomeworks:_n,globalSetting:sr,classroomList:Sn,user:ur,loading:bn.effects}})(ge),xe=D("oBTY"),ke=D("giR+"),Qe=D("fyUT"),Ye=D("7Kak"),ve=D("9yH6"),fe=D("qVdP"),at=D("jsC+"),Jt=D("5NDa"),Ft=D("5rEg"),St=D("14J3"),ze=D("BMrR"),gt=D("sRBo"),ct=D("kaz8"),jt=D("jCWc"),oe=D("kPKH"),Ne=D("lUTK"),Ge=D("BvKs"),Xe=D("jrin"),Bt=D("y8nQ"),Wt=D("Vl3Y"),en=D("8Skl"),tt=D("y3Kf"),tn=D("Llu2"),En=D("0NbB"),We=D("T7RX"),Fe=D("PpiC"),yt=D("IMoZ"),At=function(_n){var Sn=_n.shixunHomeworks,bn=_n.dispatch,ur=Object(Fe.a)(_n,["shixunHomeworks","dispatch"]),sr=Object(T.i)(),Q=Object(i.useState)(!0),ce=Object(o.a)(Q,2),Ce=ce[0],Te=ce[1],rt=Object(i.useState)(!1),Re=Object(o.a)(rt,2),$e=Re[0],it=Re[1],Dt=Wt.a.useForm(),Tt=Object(o.a)(Dt,1),Be=Tt[0],_t=function(){var ot=Object(m.a)(s.a.mark(function ht(){var wt,It;return s.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return wt=Be.getFieldValue(),Xt.next=3,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(xe.a)(Sn.actionTabs.selectArrs),cover_all:Ce,hidden_comment:wt.hidden_comment,comment:wt.comment}});case 3:It=Xt.sent,It.status===0&&(p.b.success("\u8BC4\u9605\u6210\u529F"),Be.resetFields(),bn({type:"shixunHomeworks/setActionTabs",payload:{}}),bn({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Sn.actionTabs.params)}));case 5:case"end":return Xt.stop()}},ht)}));return function(){return ot.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:Sn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function ot(){var ht;return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:ht=Be.getFieldValue(),JSON.stringify(ht)==="{}"||ht.hidden_comment===""&&ht.comment===""?it(!0):Sn.workList.partial_comment?bn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:Sn.actionTabs.selectArrs,params:Sn.actionTabs.params}}):_t();case 2:case"end":return It.stop()}},ot)})),onCancel:function(){bn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Wt.a,{form:Be,onChange:function(){$e&&it(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Wt.a.Item,{name:"comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Wt.a.Item,{name:"hidden_comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),$e&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(a.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(yt.a,{className:"c-orange mr20"}),"\u63D0\u793A"),visible:Sn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:function(){_t()},onCancel:function(){bn({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(ve.a.Group,{onChange:function(ht){Te(ht.target.value)},value:Ce},n.a.createElement(ve.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(ve.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},nt=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(At),st=D("XYT7"),De=D("Nd3P"),ye=D.n(De),we=function(_n){var Sn,bn,ur,sr,Q=_n.shixunHomeworks,ce=_n.dispatch,Ce=Object(Fe.a)(_n,["shixunHomeworks","dispatch"]),Te=Object(T.i)(),rt=Object(i.useState)(!1),Re=Object(o.a)(rt,2),$e=Re[0],it=Re[1],Dt=Object(i.useState)((Sn=Q.actionTabs.selectArrs)===null||Sn===void 0||((bn=Sn.data)===null||bn===void 0)?void 0:bn.name),Tt=Object(o.a)(Dt,2),Be=Tt[0],_t=Tt[1],ot=Wt.a.useForm(),ht=Object(o.a)(ot,1),wt=ht[0];Object(i.useEffect)(function(){var vt,Xt,dn,Pn,Gn,On;Q.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&wt.setFieldsValue({comment:(vt=Q.actionTabs.selectArrs)===null||vt===void 0||((Xt=vt.data)===null||Xt===void 0)?void 0:Xt.work_comment,hidden_comment:(dn=Q.actionTabs.selectArrs)===null||dn===void 0||((Pn=dn.data)===null||Pn===void 0)?void 0:Pn.work_comment_hidden}),_t((Gn=Q.actionTabs.selectArrs)===null||Gn===void 0||((On=Gn.data)===null||On===void 0)?void 0:On.name)},[Q.actionTabs.key]);var It=function(){var vt=Object(m.a)(s.a.mark(function Xt(){var dn,Pn,Gn,On;return s.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Gn=wt.getFieldValue(),Mn.next=3,Object(O.a)("/api/student_works/".concat((dn=Q.actionTabs.selectArrs)===null||dn===void 0||((Pn=dn.data)===null||Pn===void 0)?void 0:Pn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:Gn.hidden_comment,comment:Gn.comment}});case 3:if(On=Mn.sent,!(On.status===0)){Mn.next=9;break}return p.b.success("\u8BC4\u9605\u6210\u529F"),wt.resetFields(),ce({type:"shixunHomeworks/setActionTabs",payload:{}}),Mn.abrupt("return",ce({type:"shixunHomeworks/getWorkList",payload:Te}));case 9:case"end":return Mn.stop()}},Xt)}));return function(){return vt.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:(ur=Q.actionTabs.selectArrs)!==null&&ur!==void 0&&(sr=ur.data)!==null&&sr!==void 0&&sr.work_comment_hidden?"\u66F4\u6539"+Be+"\u70B9\u8BC4":Be+"\u70B9\u8BC4",visible:Q.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function vt(){var Xt;return s.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:Xt=wt.getFieldValue(),JSON.stringify(Xt)==="{}"||Xt.hidden_comment===""&&Xt.comment===""?it(!0):It();case 2:case"end":return Pn.stop()}},vt)})),onCancel:function(){ce({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Wt.a,{form:wt,onChange:function(){$e&&it(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Wt.a.Item,{name:"comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Wt.a.Item,{name:"hidden_comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),$e&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},ae=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(we),se=function(_n){var Sn=_n.shixunHomeworks,bn=_n.dispatch,ur=Object(Fe.a)(_n,["shixunHomeworks","dispatch"]),sr=Object(T.i)(),Q=Object(i.useState)([]),ce=Object(o.a)(Q,2),Ce=ce[0],Te=ce[1],rt=Object(i.useState)([]),Re=Object(o.a)(rt,2),$e=Re[0],it=Re[1];Object(i.useEffect)(function(){Sn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&Dt()},[Sn.actionTabs.key]);function Dt(){return Tt.apply(this,arguments)}function Tt(){return Tt=Object(m.a)(s.a.mark(function _t(){var ot;return s.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:ot=wt.sent,Te(ot);case 4:case"end":return wt.stop()}},_t)})),Tt.apply(this,arguments)}var Be=[{title:"\u5206\u73ED\u60C5\u51B5",dataIndex:"name"},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u68C0\u6D4B\u8FDB\u5EA6",dataIndex:"status"},{title:"\u4E0A\u6B21\u8BC4\u5206\u65F6\u95F4",dataIndex:"last_analysis_time"}];return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:"\u4EE3\u7801\u8D28\u91CF\u8BC4\u5206",visible:Sn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B",width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function _t(){var ot;return s.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:$e}});case 2:ot=wt.sent,(ot==null?void 0:ot.status)===0&&(R.d.replace("/classrooms/".concat(sr.coursesId,"/shixun_homework/").concat(sr.categoryId,"/detail?tabs=4")),window.location.reload(),bn({type:"shixunHomeworks/setActionTabs",payload:{}}),it([]));case 4:case"end":return wt.stop()}},_t)})),onCancel:function(){it([]),bn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(V.a,{rowSelection:{type:"checkbox",onChange:function(ot,ht){it(Object(xe.a)(ot))},selectedRowKeys:$e,getCheckboxProps:function(ot){return{disabled:ot.status==="\u8FDB\u884C\u4E2D"||ot.works_count===0}}},rowKey:function(ot){return ot.key||ot.id},scroll:{y:300},pagination:!1,columns:Be,dataSource:Ce==null?void 0:Ce.group_list})))},pe=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(se),_e=D("Ot1p"),be=D("mgmH"),Ke=function(_n){var Sn,bn,ur,sr,Q,ce,Ce,Te,rt,Re=_n.shixunHomeworks,$e=_n.loading,it=_n.dispatch,Dt=_n.setExportParams,Tt=_n.user,Be=Object(T.i)(),_t=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),Be)),ot=Object(o.a)(_t,2),ht=ot[0],wt=ot[1],It=Wt.a.useForm(),vt=Object(o.a)(It,1),Xt=vt[0],dn=Object(i.useState)(),Pn=Object(o.a)(dn,2),Gn=Pn[0],On=Pn[1],Nn=Object(i.useState)({}),Mn=Object(o.a)(Nn,2),Pt=Mn[0],hn=Mn[1],Kt=Object(i.useState)([]),Rt=Object(o.a)(Kt,2),Un=Rt[0],Rn=Rt[1],Yt=Object(i.useState)(!1),ft=Object(o.a)(Yt,2),jn=ft[0],fn=ft[1],Qn=Object(i.useState)([]),qt=Object(o.a)(Qn,2),An=qt[0],Fn=qt[1],vn=Object(i.useState)(!1),yr=Object(o.a)(vn,2),Ln=yr[0],wn=yr[1],Lt=Object(i.useState)(),Ze=Object(o.a)(Lt,2),Nt=Ze[0],Mt=Ze[1],cn=Object(i.useState)(1),zn=Object(o.a)(cn,2),kn=zn[0],lr=zn[1],er=Object(i.useState)(),Rr=Object(o.a)(er,2),mr=Rr[0],xr=Rr[1],Zr=Object(i.useState)(),Yr=Object(o.a)(Zr,2),Jr=Yr[0],vi=Yr[1],_i=Object(i.useState)(),Ee=Object(o.a)(_i,2),Ue=Ee[0],Ve=Ee[1],Se=Object(i.useState)(),re=Object(o.a)(Se,2),me=re[0],ue=re[1],Oe=Object(i.useState)(),Pe=Object(o.a)(Oe,2),qe=Pe[0],Ie=Pe[1],ut=Object(i.useState)(!1),Ut=Object(o.a)(ut,2),an=Ut[0],mn=Ut[1],Hn=Object(T.h)();Object(i.useEffect)(function(){return Vn(!0),function(){hn([]),Rn([])}},[ht.coursesId]),Object(i.useEffect)(function(){var gn,nn=JSON.parse(JSON.stringify(Re.workList));!(nn!=null&&(gn=nn.student_works)!==null&&gn!==void 0&&gn.length)&&nn!==null&&nn!==void 0&&nn.id?(nn.student_works=[Object(g.a)({},nn)],hn(nn)):(nn!=null&&nn.id&&Rn([Object(g.a)(Object(g.a)({},nn),{number:"\u6211"})]),hn(Object(g.a)({},nn)))},[Re.workList]);var Vn=function(nn){Dt(Object(g.a)({},ht));var xn=it({type:"shixunHomeworks/getWorkList",payload:ht});return nn&&xn.then(function(zt){var Vt,pr,Mr;(zt!=null&&(Vt=zt.homework_status)!==null&&Vt!==void 0&&Vt.includes("\u8FDB\u884C\u4E2D")||zt!=null&&(pr=zt.homework_status)!==null&&pr!==void 0&&pr.includes("\u8865\u4EA4\u4E2D")||zt!=null&&(Mr=zt.homework_status)!==null&&Mr!==void 0&&Mr.includes("\u63D0\u4EA4\u4E2D"))&&!Object(Y.s)()&&dr()}),xn};Object(i.useEffect)(function(){fr()},[]);var fr=function(){var gn=Object(m.a)(s.a.mark(function nn(){var xn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Vt.next=2,Object(st.I)({categoryId:Be.categoryId});case 2:xn=Vt.sent,On(xn==null?void 0:xn.update_score);case 4:case"end":return Vt.stop()}},nn)}));return function(){return gn.apply(this,arguments)}}(),dr=function(){var gn=Object(m.a)(s.a.mark(function nn(){var xn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return it({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),Vt.next=3,Object(st.Z)({categoryId:Be.categoryId});case 3:xn=Vt.sent,it({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(xn==null?void 0:xn.status)===0&&(p.b.success(xn==null?void 0:xn.message),Vn());case 6:case"end":return Vt.stop()}},nn)}));return function(){return gn.apply(this,arguments)}}(),wr=function(){ht.page=1;var nn=Object.assign({},Xt.getFieldValue());delete ht.course_group,delete ht.teacher_comment,Object.keys(nn).map(function(xn){switch(xn){case"task_status":nn[xn].includes("all")||!nn[xn].length?(delete ht.work_status,Xt.setFieldsValue(Object(Xe.a)({},"task_status","all"))):(ht.work_status=nn[xn],Xt.setFieldsValue(Object(Xe.a)({},"task_status",ht.work_status)));break;case"course_group_info":nn[xn].includes("all")||!nn[xn].length?(delete ht.course_group,Xt.setFieldsValue(Object(Xe.a)({},"course_group_info","all"))):(ht.course_group=nn[xn],Xt.setFieldsValue(Object(Xe.a)({},"course_group_info",ht.course_group)));break;case"teacher_comment":if(nn[xn].includes("all")||!nn[xn].length)delete ht.teacher_comment,Xt.setFieldsValue(Object(Xe.a)({},"teacher_comment","all"));else{var zt;ht.teacher_comment=((zt=nn[xn])===null||zt===void 0?void 0:zt.length)===1?Number(nn[xn][0]):"",Xt.setFieldsValue(Object(Xe.a)({},"teacher_comment",nn[xn]))}break}}),Vn()};Object(i.useEffect)(function(){if(document.getElementById("divhe")){var gn=document.getElementById("divhe").scrollHeight;gn>47&&(Ie(47),mn(!0))}},[document.getElementById("divhe")]);var Ar=function(nn,xn){ht.page=nn,ht.limit=20,Vn()};function gr(){lr(1),xr(""),vi(""),Ve(""),ue(""),Fn([])}var Cr=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(nn,xn,zt){return ht.limit*(ht.page-1)+zt+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(nn){return n.a.createElement(k.a,{placement:"bottomLeft",title:nn},n.a.createElement("span",{className:"current"},nn))}},!(Pt!=null&&Pt.is_excellent)&&!Object(Y.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:ht.order==="student_id"?ht.b_order==="desc"?"descend":"ascend":null,render:function(nn){return n.a.createElement(k.a,{placement:"bottomLeft",title:nn||"--"},n.a.createElement("span",{className:"current"},nn||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(nn,xn){return nn?n.a.createElement(k.a,{placement:"bottom",title:nn},n.a.createElement("span",{className:"current"},nn)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:ht.order==="work_status"?ht.b_order==="desc"?"descend":"ascend":null,render:function(nn){return n.a.createElement(v.f,{status:nn})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(nn,xn){return n.a.createElement(k.a,{placement:"bottomLeft",title:nn},n.a.createElement("span",{className:"current"},nn))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(nn,xn){return n.a.createElement("span",null,nn||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(nn,xn){return n.a.createElement("span",null,nn||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(nn,xn){return nn&&nn!="--"?n.a.createElement(k.a,{placement:"bottom",title:nn},n.a.createElement("span",{className:"current"},nn)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(nn){return nn?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(nn,xn){return Object(Y.s)()?n.a.createElement("div",null,Object(v.B)(xn==null?void 0:xn.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(C.a,{target:"_blank",onClick:function(Vt){Vt.stopPropagation()},to:"/classrooms/".concat(ht.coursesId,"/program_homework/").concat(ht.categoryId,"/").concat(xn.id,"/").concat(xn.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(Vt){var pr;if(Vt.stopPropagation(),(pr=Tt.userInfo)!==null&&pr!==void 0&&pr.professional_certification)window.open("/classrooms/".concat(ht.coursesId,"/program_homework/").concat(ht.categoryId,"/").concat(xn.id,"/").concat(xn.user_id,"/comment"),"_blank");else return a.a.confirm({title:"\u63D0\u793A",centered:!0,content:n.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(v.S)("/account/certification")}}),!1}},"\u67E5\u770B\u4F5C\u4E1A")}}].filter(function(gn){return!!gn}),Lr=function(){return n.a.createElement(Ge.a,null,n.a.createElement(Ge.a.Item,{onClick:function(){Object(be.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(Ge.a.Item,{key:"2"},n.a.createElement(C.a,{to:"/classrooms/".concat(ht.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(ye.a.wrap," minH500 bg-white pl30 pr30 pt30")},((Sn=Pt.homework_status)===null||Sn===void 0?void 0:Sn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(q.a,null),!((bn=Pt.homework_status)!==null&&bn!==void 0&&bn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement("aside",null,!Object(Y.c)()&&n.a.createElement("div",{className:"c-light-black font12"},n.a.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4 ",Pt==null?void 0:Pt.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",Pt==null?void 0:Pt.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(Pt==null?void 0:Pt.late_time)||"- -")),Object(Y.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Wt.a,{form:Xt,onChange:wr,initialValues:(ur={},Object(Xe.a)(ur,"task_status","all"),Object(Xe.a)(ur,"course_group_info","all"),Object(Xe.a)(ur,"teacher_comment","all"),ur)},((sr=Pt.task_status)===null||sr===void 0?void 0:sr.length)>0&&n.a.createElement(Wt.a.Item,{name:"task_status"},n.a.createElement(ct.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(oe.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ct.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1"},Pt.task_status&&Pt.task_status.map(function(gn,nn){return n.a.createElement(ct.a,{name:"task_status",value:gn.id},gn.name,"(",gn.count,")")}))))),((Q=Pt.course_group_info)===null||Q===void 0?void 0:Q.length)>0&&n.a.createElement(Wt.a.Item,{name:"course_group_info"},n.a.createElement(ct.a.Group,{style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(oe.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ct.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1",id:"divhe",style:{height:qe+"px",overflow:"hidden"}},(ce=Pt.course_group_info)===null||ce===void 0?void 0:ce.map(function(gn,nn){return n.a.createElement(ct.a,{value:gn.course_group_id},gn.group_group_name,"(",gn.count,")")})),an&&n.a.createElement("span",{onClick:function(){var nn=document.getElementById("divhe").scrollHeight;qe>47?Ie(47):Ie(nn)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},qe===47?"\u5C55\u5F00":"\u6536\u8D77",qe===47?n.a.createElement(en.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(tt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((Ce=Pt.teacher_comment)===null||Ce===void 0?void 0:Ce.length)>0&&n.a.createElement(Wt.a.Item,{name:"teacher_comment"},n.a.createElement(ct.a.Group,{style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(oe.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ct.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1"},Pt.teacher_comment&&Pt.teacher_comment.map(function(gn,nn){return n.a.createElement(ct.a,{value:String(gn.id)},gn.name,"(",gn.count,")")})))))),n.a.createElement(ze.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(oe.a,null,n.a.createElement(Ft.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(nn){ht.search=nn,ht.page=1,Vn()},style:{width:240}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},Pt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Pt.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(oe.a,null,Object(Y.c)()&&n.a.createElement(M.a,{className:"ml10",onClick:function(){it({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Pt.student_works.map(function(nn){return nn.id}),params:ht}})}},n.a.createElement("span",{className:"".concat(ye.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(Y.c)()&&n.a.createElement(M.a,{className:"ml10",onClick:dr},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(Y.c)()&&n.a.createElement(at.a,{overlay:Lr,className:"ml10"},n.a.createElement(M.a,null,n.a.createElement(tn.a,null),"\u5BFC\u51FA",n.a.createElement(En.a,null)))))),n.a.createElement(ze.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(Y.c)()&&Gn&&n.a.createElement("span",null,n.a.createElement("span",{style:{color:"red"}},"*"),"\u5217\u8868\u4E2D\u4F5C\u4E1A\u8BB0\u5F55\u5B58\u5728\u5DEE\u5F02\uFF0C\u8BF7\u70B9\u51FB\u201C\u66F4\u65B0\u6210\u7EE9\u201D\u6309\u94AE")),n.a.createElement(V.a,{className:"mt30",loading:$e["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(nn){return{onClick:function(zt){window.open("/classrooms/".concat(ht.coursesId,"/program_homework/").concat(ht.categoryId,"/").concat(nn.id,"/").concat(nn.user_id,"/comment"),"_blank")}}},dataSource:Pt.student_works,columns:Cr,onChange:function(nn,xn,zt){zt.field&&(ht.order=zt.field),zt.order||(ht.b_order="asc"),zt.order==="ascend"&&(ht.b_order="asc"),zt.order==="descend"&&(ht.b_order="desc"),zt.order||(ht.b_order="asc"),Vn()}}),n.a.createElement(nt,null),n.a.createElement(ae,null),n.a.createElement(We.a,null)),n.a.createElement(a.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:jn,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(m.a)(s.a.mark(function gn(){var nn,xn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(!(kn===2)){Vt.next=13;break}if(!(An.length<=0)){Vt.next=4;break}return p.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),Vt.abrupt("return");case 4:if(me){Vt.next=7;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 7:return Vt.next=9,Object(O.a)("/api/homework_commons/".concat(ht.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:ht.categoryId,comment:me,status:An}});case 9:nn=Vt.sent,nn.status===0&&(Mt(nn),fn(!1),wn(!0)),Vt.next=32;break;case 13:if(!(Ue===0||Jr===0)){Vt.next=16;break}Vt.next=22;break;case 16:if(Ue){Vt.next=19;break}return p.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 19:if(Jr){Vt.next=22;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 22:if(!(Ue>Jr)){Vt.next=25;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),Vt.abrupt("return");case 25:if(me){Vt.next=28;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Vt.abrupt("return");case 28:return Vt.next=30,Object(O.a)("/api/homework_commons/".concat(ht.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:ht.categoryId,comment:me,min_score:Ue,max_score:Jr}});case 30:xn=Vt.sent,xn.status===0&&(Mt(xn),fn(!1),wn(!0));case 32:case"end":return Vt.stop()}},gn)})),onCancel:function(){fn(!1),gr()}},n.a.createElement("div",{style:{padding:"32px"}},n.a.createElement("div",null,n.a.createElement("div",null,n.a.createElement("span",{style:{width:"80px"}},"\u6253\u56DE\u65B9\u5F0F\uFF1A"),n.a.createElement(ve.a.Group,{value:kn,onChange:function(nn){lr(nn.target.value)}},n.a.createElement(ve.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(ve.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),kn===1&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),n.a.createElement(Qe.a,{min:0,max:100,value:Ue,onChange:function(nn){return Ve(nn)},style:{width:"100px"}}),n.a.createElement("span",{style:{width:"80px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),n.a.createElement(Qe.a,{min:0,max:100,value:Jr,onChange:function(nn){return vi(nn)},style:{width:"100px"}})),kn===2&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"80px"}},"\u4F5C\u4E1A\u72B6\u6001\uFF1A"),n.a.createElement(ct.a.Group,{onChange:function(nn){Fn(Object(xe.a)(nn))},style:{width:"100%"}},(Te=Pt.task_status)===null||Te===void 0?void 0:Te.map(function(gn,nn){return n.a.createElement(ct.a,{name:"task_status",value:gn.id},gn.name,"(",gn.count,")")}))),n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*")," \u8BC4\u8BED\uFF1A"),n.a.createElement(_e.a,{className:ye.a.MdEditor,onChange:function(nn){return ue(nn)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(a.a,{visible:Ln,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(m.a)(s.a.mark(function gn(){var nn,xn;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(!(kn===2)){Vt.next=7;break}return Vt.next=3,Object(O.a)("/api/homework_commons/".concat(ht.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:ht.categoryId,comment:me,status:An}});case 3:nn=Vt.sent,nn.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),gr(),Vn(),wn(!1)),Vt.next=11;break;case 7:return Vt.next=9,Object(O.a)("/api/homework_commons/".concat(ht.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:ht.categoryId,comment:me,min_score:Ue,max_score:Jr}});case 9:xn=Vt.sent,xn.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),gr(),Vn(),wn(!1));case 11:case"end":return Vt.stop()}},gn)})),onCancel:function(){gr(),wn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},kn===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",Ue,"-",Jr,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),kn===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((rt=Pt.task_status)===null||rt===void 0?void 0:rt.filter(function(gn){return An==null?void 0:An.includes(gn.id)}).map(function(gn){return gn.name}).toString())+",","\u7684\u5B66\u751F\u8FDB\u884C\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),n.a.createElement("br",null),n.a.createElement("span",null,"\u8BE5\u6761\u4EF6\u4E0B\u5171\u6709",Nt==null?void 0:Nt.count,"\u540D\u5B66\u751F")))),n.a.createElement(pe,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(y.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:Ar,current:ht.page||1,defaultPageSize:20,total:Pt.work_count})))},Ot=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading,bn=Bn.user;return{shixunHomeworks:_n,loading:Sn.effects,user:bn}})(Ke),rn=D("fOrg"),Dn=D("+KLJ"),bt=function(_n){var Sn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,group_ids:[]}),Q)),Ce=Object(o.a)(ce,2),Te=Ce[0],rt=Ce[1],Re=Object(T.h)(),$e=bn.codeReview,it=Object(i.useState)({}),Dt=Object(o.a)(it,2),Tt=Dt[0],Be=Dt[1],_t=Wt.a.useForm(),ot=Object(o.a)(_t,1),ht=ot[0];Te.order="code_rate",Te.sort="desc",Te.category=Te.categoryId,Object(i.useEffect)(function(){wt(),console.log("params",Te)},[Te]),Object(i.useEffect)(function(){bn.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&wt()},[bn.actionTabs.key]);var wt=function(){var dn=Object(m.a)(s.a.mark(function Pn(){var Gn;return s.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Te)});case 2:Gn=Nn.sent,Gn.status===-2&&setTimeout(function(){return wt()},1500);case 4:case"end":return Nn.stop()}},Pn)}));return function(){return dn.apply(this,arguments)}}(),It=function(){},vt=function(Pn,Gn){Te.page=Pn,Te.limit=20,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Te)})},Xt=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(Pn,Gn,On){return Te.limit*(Te.page-1)+On+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(Pn){return n.a.createElement("span",{className:"c-orange"},Pn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(Pn,Gn){return n.a.createElement("div",null,n.a.createElement(C.a,{target:"_blank",to:"/classrooms/".concat(Te.coursesId,"/program_homework/").concat(Te.categoryId,"/review_detail/").concat(Gn.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},($e==null?void 0:$e.status)===-2&&n.a.createElement(Dn.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(ze.a,null,n.a.createElement(oe.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",$e.last_review_time,n.a.createElement(M.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){sr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Te}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(oe.a,null,n.a.createElement(Ft.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Pn){Te.search=Pn,sr({type:"shixunHomeworks/getCodeReview",payload:Te})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((Sn=$e.group_info)===null||Sn===void 0?void 0:Sn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(ze.a,null,n.a.createElement(oe.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(oe.a,{flex:"80px"},n.a.createElement(ct.a,{checked:Te.group_ids=="",value:"all",onChange:function(Pn){delete Te.group_ids,Te.group_ids=[],Te.page=1,rt(Object(g.a)({},Te))}},"\u5168\u90E8")),n.a.createElement(oe.a,{flex:"1"},$e.group_info&&$e.group_info.map(function(dn,Pn){return n.a.createElement(ct.a,{style:{marginLeft:0},value:dn.id,checked:Te.group_ids.includes(dn.id),onChange:function(On){On.target.checked?Te.group_ids.push(dn.id):Te.group_ids.splice(Te.group_ids.indexOf(dn.id),1),Te.page=1,rt(Object(g.a)({},Te))}},dn.name,"(",dn.members_count,")")}))),n.a.createElement(ze.a,{className:"font14 c-red mt5"},n.a.createElement(oe.a,null,"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u67E5\u91CD\u5206\u73ED"))),n.a.createElement("p",{className:"mt10"},n.a.createElement("span",{className:"c-red"},$e.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",$e.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(V.a,{className:"mt30",loading:ur["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:$e.users_reviews,columns:Xt,onChange:function(Pn,Gn,On){On.order==="ascend"&&(Te.b_order="asc"),On.order==="descend"&&(Te.b_order="desc"),On.order||delete Te.b_order,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Te)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(y.a,{showSizeChanger:!1,onChange:vt,defaultCurrent:Te.page||1,current:Te.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:$e.copy_reviews_count})))},Qt=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading;return{shixunHomeworks:_n,loading:Sn.effects}})(bt),Et=D("OaEy"),Ct=D("2fM7"),lt=D("iQDF"),de=D("+eQT"),Ae=D("/MfK"),kt=D("w5pM"),dt=D("Lyp1"),Zt=D("LvDl"),un=D("xb3X"),Le=D.n(un),et=D("AHFd"),mt=D("eozf"),Ht=de.a.RangePicker,sn=Ct.a.Option,yn=function(_n){var Sn,bn,ur,sr,Q,ce,Ce,Te,rt,Re,$e=_n.shixunHomeworks,it=_n.loading,Dt=_n.dispatch,Tt=Object(T.i)(),Be=$e.workSetting,_t=$e.workList,ot=$e.changeData,ht=Object(i.useState)(!0),wt=Object(o.a)(ht,2),It=wt[0],vt=wt[1],Xt=Object(i.useState)(!1),dn=Object(o.a)(Xt,2),Pn=dn[0],Gn=dn[1],On=Object(i.useState)([]),Nn=Object(o.a)(On,2),Mn=Nn[0],Pt=Nn[1],hn=Object(i.useState)([]),Kt=Object(o.a)(hn,2),Rt=Kt[0],Un=Kt[1],Rn=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:et.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,send_type:void 0,difficult_count:[],difficult_settings:[],late_penalty:0}),Yt=Object(o.a)(Rn,2),ft=Yt[0],jn=Yt[1];Object(i.useEffect)(function(){return fn(),function(){Pt([].concat())}},[]);var fn=function(){Dt({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Tt)})};Object(i.useEffect)(function(){var Lt;if(!(Be!=null&&Be.course_id))return;Object.keys(ft).map(function(Ze){ft[Ze]=Be[Ze]}),(!ft.allow_late||!ft.unified_late)&&(ft.late_minus_score=20,ft.penalty_type=et.a.Percent),ft.unified_setting||(ft.unified_late=!1,ft.unified_anonymous_comment=!1,ft.unified_anonymous_appeal=!1),Mn=JSON.parse(JSON.stringify(Be.group_settings.map(function(Ze){return Object(g.a)(Object(g.a)({},Ze),{},{group_name:[Ze.group_name]})}).filter(function(Ze){return Ze.publish_time!==null}))),Rt=JSON.parse(JSON.stringify(Be.allow_late_settings.map(function(Ze){return Object(g.a)(Object(g.a)({},Ze),{},{group_name:[Ze.group_name]})}).filter(function(Ze){return Ze.late_time!==null}))),ft.difficult_settings.length===0&&(ft.difficult_settings=[0,0,0]),jn(Object(g.a)({},ft)),Pt(Object(xe.a)(Mn)),((Lt=Rt)===null||Lt===void 0?void 0:Lt.length)<=0?Un([{late_minus_score:20}]):Un(Object(xe.a)(Rt))},[Be]);var Qn=function(){var Ze,Nt=JSON.parse(JSON.stringify(ft));if(Nt.categoryId=Tt.categoryId,ft.unified_setting||(Mn=(Ze=Mn)===null||Ze===void 0?void 0:Ze.map(function(cn){var zn;if(!cn.publish_time||!cn.end_time)throw p.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!cn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return cn.group_name=typeof(cn==null?void 0:cn.group_name)=="string"?[cn==null?void 0:cn.group_name]:cn==null?void 0:cn.group_name,cn.group_id=(zn=Be.group_settings)===null||zn===void 0?void 0:zn.filter(function(kn){var lr;return cn==null||((lr=cn.group_name)===null||lr===void 0)?void 0:lr.includes(kn.group_name)}).map(function(kn){return kn.group_id||kn.id}).toString().split(","),cn})),Nt.group_settings=Mn,ft.allow_late)if(ft.unified_late){if(ft.late_minus_score===null||ft.late_minus_score===void 0||ft.late_minus_score<0||ft.late_minus_score>100)throw p.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!ft.late_time)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var Mt;Rt=(Mt=Rt)===null||Mt===void 0?void 0:Mt.map(function(cn){var zn,kn;if(cn.late_minus_score===null||cn.late_minus_score===void 0||cn.late_minus_score<0||cn.late_minus_score>100)throw p.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!cn.late_time)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!cn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return cn.group_name=typeof(cn==null?void 0:cn.group_name)=="string"?[cn==null?void 0:cn.group_name]:cn==null?void 0:cn.group_name,cn.group_id=cn==null||((zn=cn.group_name)===null||zn===void 0||((kn=zn.map(function(lr){var er,Rr,mr=(er=Be.group_settings)===null||er===void 0||((Rr=er.filter(function(xr){return(xr==null?void 0:xr.group_name)===lr}))===null||Rr===void 0)?void 0:Rr[0];return mr==null?void 0:mr.group_id}))===null||kn===void 0))?void 0:kn.toString().split(","),cn}),Nt.allow_late_settings=Rt}Nt.send_type===1&&(Nt.difficult_settings=Nt.difficult_settings.map(function(cn){return cn||0})),qt(Nt)},qt=function(Ze){var Nt;if(Ze.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ze!=null&&Ze.work_efficiency&&Ze.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Mt={shixun_evaluation:Ze.shixun_evaluation,challenge_settings:Ze.challenge_settings},cn=function(){var zn=Object(m.a)(s.a.mark(function kn(){var lr;return s.a.wrap(function(Rr){for(;;)switch(Rr.prev=Rr.next){case 0:return Gn(!0),Rr.next=3,Object(O.a)("/api/homework_commons/".concat(Tt.categoryId,"/publish_setting.json"),{method:"post",body:Object(g.a)({},Ze)});case 3:lr=Rr.sent,lr.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),vt(!0),fn(),Dt({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Tt)})),Gn(!1);case 6:case"end":return Rr.stop()}},kn)}));return function(){return zn.apply(this,arguments)}}();!Object(Zt.isEqual)(ot,Mt)&&!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))?a.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:cn}):cn()},An=function(Ze,Nt){var Mt,cn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Nt?Nt.find(function(zn){return zn[cn]===Ze}):Be==null||((Mt=Be.group_settings)===null||Mt===void 0)?void 0:Mt.find(function(zn){return zn.group_id[0]===Ze})},Fn=(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.anonymous_comment),vn=function(Ze){var Nt=An(Ze,Be==null?void 0:Be.allow_late_settings,"id"),Mt=An(Ze,Be==null?void 0:Be.anonymous_comment_settings);return(Be==null?void 0:Be.allow_late)&&Nt&&(Nt==null?void 0:Nt.late_time)!==null||(Be==null?void 0:Be.anonymous_comment)&&Mt&&(Mt==null?void 0:Mt.evaluation_start)!==null},yr=Object(i.useMemo)(function(){var Lt;if(Be!=null&&Be.unified_setting){var Ze;return!(_t!=null&&(Ze=_t.homework_status)!==null&&Ze!==void 0&&Ze.includes("\u5DF2\u622A\u6B62"))||(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.anonymous_comment)}var Nt=Be==null||((Lt=Be.group_settings)===null||Lt===void 0)?void 0:Lt.some(function(Mt){return H()(Mt.end_time)<=H()()});return!Nt||(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.all_group_late)},[Be,_t]),Ln=Be==null?void 0:Be.anonymous_comment,wn=function(Ze){if(!Ze)return!1;var Nt=An(Ze,Be==null?void 0:Be.anonymous_comment_settings);return(Be==null?void 0:Be.anonymous_comment)&&Nt&&(Nt==null?void 0:Nt.evaluation_start)!==null};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"},n.a.createElement("div",{className:Le.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(oe.a,null,Object(Y.c)()&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return vt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(ve.a.Group,{disabled:It||!(_t!=null&&(Sn=_t.homework_status)!==null&&Sn!==void 0&&Sn.includes("\u672A\u53D1\u5E03")),value:ft.send_type,onChange:function(Ze){ft.send_type=Ze.target.value,jn(Object.assign({},ft))}},n.a.createElement(ve.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(ve.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),ft.send_type===1&&n.a.createElement(ze.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(oe.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement(Qe.a,{precision:0,disabled:It||!(_t!=null&&(bn=_t.homework_status)!==null&&bn!==void 0&&bn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ft.difficult_count[0]||0),min:0,max:ft.difficult_count[0]||0,value:ft.difficult_settings[0],onChange:function(Ze){ft.difficult_settings[0]=Ze,jn(Object.assign({},ft))},className:"ml10 mr20"})),n.a.createElement(oe.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement(Qe.a,{precision:0,disabled:It||!(_t!=null&&(ur=_t.homework_status)!==null&&ur!==void 0&&ur.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ft.difficult_count[1]||0),min:0,max:ft.difficult_count[1]||0,value:ft.difficult_settings[1],onChange:function(Ze){ft.difficult_settings[1]=Ze,jn(Object.assign({},ft))},className:"ml10 mr20"})),n.a.createElement(oe.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement(Qe.a,{precision:0,disabled:It||!(_t!=null&&(sr=_t.homework_status)!==null&&sr!==void 0&&sr.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ft.difficult_count[2]||0),min:0,max:ft.difficult_count[2]||0,value:ft.difficult_settings[2],onChange:function(Ze){ft.difficult_settings[2]=Ze,jn(Object.assign({},ft))},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(ve.a.Group,{disabled:It||!(_t!=null&&(Q=_t.homework_status)!==null&&Q!==void 0&&Q.includes("\u672A\u53D1\u5E03")),value:ft.unified_setting,onChange:function(Ze){var Nt;if(!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))){p.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(ft.unified_setting=!ft.unified_setting,ft.unified_setting||(ft.unified_late=!1),jn(Object.assign({},ft)),ft.unified_setting===!1&&Mn==""){Pt(Mn.concat({}));return}ft.unified_setting&&(Pt([]),Un([{late_minus_score:5}]))}},n.a.createElement(ve.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(ve.a,{className:"ml20",disabled:(Be==null||((ce=Be.group_settings)===null||ce===void 0)?void 0:ce.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Be==null||((Ce=Be.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")),ft.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(Ze){return Object(mt.b)(Ze,Be==null?void 0:Be.course_end_date)},disabledTime:function(Ze){return Object(mt.c)(Ze)},disabled:It||!(_t!=null&&(Te=_t.homework_status)!==null&&Te!==void 0&&Te.includes("\u672A\u53D1\u5E03")),value:ft.publish_time?H()(ft.publish_time):"",onChange:function(Ze,Nt){ft.publish_time=Nt,(ft.end_time==""||!ft.end_time)&&ft.unified_setting&&(ft.end_time=H()(Ze).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),jn(Object.assign({},ft))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:It||Fn,disabledDate:function(Ze){return Object(mt.b)(Ze,Be==null?void 0:Be.course_end_date,ft.publish_time)},disabledTime:function(Ze){return Object(mt.c)(Ze,ft.publish_time)},value:ft.end_time?H()(ft.end_time):"",onChange:function(Ze,Nt){ft.end_time=Nt,jn(Object.assign({},ft))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!ft.unified_setting&&((rt=Mn)===null||rt===void 0?void 0:rt.length)>0&&n.a.createElement(ze.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(oe.a,{span:24},n.a.createElement(ze.a,null,n.a.createElement(oe.a,{span:10}),n.a.createElement(oe.a,{span:10},n.a.createElement(ze.a,{className:"c-grey-c ml30"},n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(oe.a,{span:4}))),Mn&&Mn.map(function(Lt,Ze){var Nt,Mt,cn,zn,kn;return n.a.createElement(oe.a,{span:24,key:Ze},n.a.createElement(ze.a,{gutter:[8,16]},n.a.createElement(oe.a,{span:10},n.a.createElement(ze.a,{gutter:[8,16]},n.a.createElement(oe.a,null,"\u53D1\u5E03\u89C4\u5219 ",Ze+1),n.a.createElement(oe.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(Ct.a,{disabled:It||!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))&&Lt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Lt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(er){Mn[Ze].group_name=er,Mn[Ze].group_id=Lt.group_id;var Rr=Object(Zt.flattenDeep)(Mn.map(function(xr){return xr.group_name})),mr=Rt.map(function(xr){var Zr=(xr==null?void 0:xr.group_name)||[];return Object(g.a)(Object(g.a)({},xr),{},{group_name:Object(Zt.remove)(Zr,function(Yr){return Rr.includes(Yr)})})});Un(mr),Pt(Mn.slice())}},Be.group_settings&&Be.group_settings.map(function(lr){if(!Mn.map(function(er){return er.group_name}).toString().split(",").includes(String(lr.group_name)))return n.a.createElement(sn,{value:lr.group_name,key:lr.id},lr.group_name)}))))),n.a.createElement(oe.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Ht,{allowClear:!1,ranges:{\u6B64\u523B:[Lt.publish_time?H()(Lt.publish_time):H()(),H()()]},disabled:It||(H()()<=H()((Mt=An((cn=Lt.group_id)===null||cn===void 0?void 0:cn[0]))===null||Mt===void 0?void 0:Mt.publish_time)?!1:[!0,vn((zn=Lt.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(er){return Object(mt.b)(er,Be==null?void 0:Be.course_end_date)},disabledTime:function(er){return Object(mt.c)(er)},showTime:{format:"HH:mm",defaultValue:[H()(Object(v.d)(),"HH:mm"),H()(Object(v.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Lt.publish_time&&[H()(Lt.publish_time),Lt.end_time?H()(Lt.end_time):void 0],onChange:function(er,Rr){Mn[Ze].publish_time=Rr[0],Mn[Ze].end_time=Rr[1],Pt(Object(xe.a)(Mn))}}))),!It&&n.a.createElement(oe.a,{span:4},Ze>0&&!Lt.id&&n.a.createElement(Ae.a,{onClick:function(){Mn=Mn.filter(function(er,Rr){return Ze!==Rr}),Pt(Mn.slice()),setTimeout(function(){return Pt(Mn.slice())},10)}}),Mn.length<(Be==null||((kn=Be.group_settings)===null||kn===void 0)?void 0:kn.length)&&n.a.createElement(kt.a,{className:"c-green ml20",onClick:function(){Pt(Mn.concat({}))}}))))})),n.a.createElement(ze.a,{className:"mt30"},n.a.createElement(oe.a,null,n.a.createElement(ze.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(k.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},n.a.createElement(dt.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(oe.a,{span:24,className:"mt10"},n.a.createElement(ct.a,{checked:ft.allow_late,disabled:It||yr,onChange:function(){ft.allow_late=!ft.allow_late,Rt==""&&Un([{late_minus_score:5}]),jn(Object.assign({},ft))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(k.a,{overlayStyle:{width:380,maxWidth:380},title:n.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),n.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},n.a.createElement(dt.a,null)))),(ft==null?void 0:ft.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(ve.a.Group,{disabled:It||(Be==null?void 0:Be.anonymous_comment)||(Be==null?void 0:Be.allow_late),value:ft.unified_late,onChange:function(Ze){ft.unified_late=Ze.target.value,Rt==""&&!Ze.target.value&&Un([{late_minus_score:5}]),jn(Object(g.a)({},ft))}},(ft==null?void 0:ft.unified_setting)&&n.a.createElement(ve.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Be==null||((Re=Be.group_settings)===null||Re===void 0)?void 0:Re.length)&&n.a.createElement(ve.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),ft!=null&&ft.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(oe.a,{className:"ml5"},n.a.createElement(et.b,{disabled:It||Ln,value:{type:ft.penalty_type,inputValue:ft.late_minus_score},onChange:function(Ze){jn(Object(g.a)(Object(g.a)({},ft),{},{late_minus_score:Ze.inputValue,penalty_type:Ze.type}))}})),n.a.createElement(oe.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},ft.penalty_type===et.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(oe.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(oe.a,{className:"ml5"},n.a.createElement(de.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:It||Ln,value:ft.late_time?H()(ft.late_time):"",disabledDate:function(Ze){return Object(mt.b)(Ze,Be==null?void 0:Be.course_end_date)},disabledTime:function(Ze){return Object(mt.c)(Ze)},onChange:function(Ze,Nt){ft.late_time=Nt,jn(Object.assign({},ft))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Rt.map(function(Lt,Ze){var Nt;return n.a.createElement(oe.a,{span:24,key:Ze},n.a.createElement(ze.a,{className:"mt25"},n.a.createElement(oe.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Ze+1,"\uFF1A"),n.a.createElement(Ct.a,{disabled:It||!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))&&Lt.id||(Be==null?void 0:Be.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Lt.group_name=="string"?[Lt.group_name]:Lt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(cn){Rt[Ze].group_name=cn,Rt[Ze].group_id=Lt.group_id,Un(Rt.slice())}},Be.group_settings&&Be.group_settings.map(function(Mt){if(ft!=null&&ft.unified_setting&&!Rt.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name)))return n.a.createElement(sn,{value:Mt.group_name,key:Mt.id},Mt.group_name);if(Mn.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name))&&(!Rt.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name))&&H()(Mt.end_time)<=H()()))return n.a.createElement(sn,{value:Mt.group_name,key:Mt.id},Mt.group_name)}))),n.a.createElement(oe.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(et.b,{disabled:It||wn(Lt.id),value:{type:Lt.penalty_type,inputValue:Lt.late_minus_score},onChange:function(cn){Rt[Ze].late_minus_score=cn.inputValue,Rt[Ze].penalty_type=cn.type,Un(Object(xe.a)(Rt))}})),n.a.createElement(oe.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(de.a,{disabled:It||wn(Lt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(cn){return Object(mt.b)(cn,Be==null?void 0:Be.course_end_date)},disabledTime:function(cn){return Object(mt.c)(cn)},format:"YYYY-MM-DD HH:mm",value:Lt!=null&&Lt.late_time?H()(Lt.late_time):void 0,onChange:function(cn,zn){Rt[Ze].late_time=zn,Un(Object(xe.a)(Rt))}})),!It&&n.a.createElement(oe.a,{className:"ml20"},Ze>0&&!Lt.id&&n.a.createElement(Ae.a,{onClick:function(){Rt=Rt.filter(function(cn,zn){return Ze!==zn}),Un(Rt.slice()),setTimeout(function(){return Un(Rt.slice())},10)}}),n.a.createElement(kt.a,{className:"c-green ml20",onClick:function(){Un(Rt.concat({penalty_type:et.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!It&&n.a.createElement("div",{className:Le.a.btns},n.a.createElement(M.a,{type:"primary",loading:Pn,onClick:function(){return Qn()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){vt(!0),fn()}},"\u53D6\u6D88")))},nr=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading;return{shixunHomeworks:_n,loading:Sn.effects}})(yn);function Kn(Bn,_n){for(var Sn=[],bn=Bn;bn<_n;bn++)Sn.push(bn);return Sn}var Cn=function(_n){var Sn=new Date,bn=H()(_n).format("HH");if(H()(_n).isSame(H()(Sn),"day")){var ur=H()(Sn).format("HH"),sr=H()(Sn).format("mm");return{disabledHours:function(){return Kn(0,24).splice(1,ur*1-1)},disabledMinutes:function(){return console.log("\u7981\u6B62\u65F6\u95F4\uFF1A",bn,ur),H()(_n).isSame(H()(Sn),"hour")&&bn<=ur?Kn(0,60).splice(0,sr):Kn(60,60)}}}else if(H()(_n).isSame(H()(),"day")){var Q=H()().format("HH"),ce=H()().format("mm");return{disabledHours:function(){return Kn(0,24).splice(0,Q)},disabledMinutes:function(){return bn<=Q?Kn(0,ce):Kn(60,60)}}}else return},br=de.a.RangePicker,Er=Ct.a.Option,rr=function(_n){var Sn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=Object(T.h)(),Ce=bn.workSetting,Te=bn.workList,rt=bn.changeData,Re=Object(i.useState)(!0),$e=Object(o.a)(Re,2),it=$e[0],Dt=$e[1],Tt=Object(i.useState)({}),Be=Object(o.a)(Tt,2),_t=Be[0],ot=Be[1],ht=Object(i.useState)(!1),wt=Object(o.a)(ht,2),It=wt[0],vt=wt[1],Xt=Wt.a.useForm(),dn=Object(o.a)(Xt,1),Pn=dn[0],Gn=Object(i.useState)([]),On=Object(o.a)(Gn,2),Nn=On[0],Mn=On[1],Pt=Object(i.useState)([]),hn=Object(o.a)(Pt,2),Kt=hn[0],Rt=hn[1],Un=Object(i.useState)(!1),Rn=Object(o.a)(Un,2),Yt=Rn[0],ft=Rn[1],jn=Object(i.useState)([]),fn=Object(o.a)(jn,2),Qn=fn[0],qt=fn[1],An=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,open_code:!1,rank_forbidden:!1,open_code_type:void 0,comment_public:!0,total_score:"",eff_score:0,rank_forbidden_start:"",rank_forbidden_end:""}),Fn=Object(o.a)(An,2),vn=Fn[0],yr=Fn[1];Object(i.useEffect)(function(){return Ln(),function(){Mn([].concat())}},[]);var Ln=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Q)})},wn=function(Mt){return Mt&&Mt<H()().startOf("day")};Object(i.useEffect)(function(){var Nt;if(!(Ce!=null&&Ce.course_id))return;Object.keys(vn).map(function(Mt){vn[Mt]=Ce[Mt]}),(!vn.allow_late||!vn.unified_late)&&(vn.late_penalty=5),Nn=JSON.parse(JSON.stringify(Ce.group_settings.map(function(Mt){return Object(g.a)(Object(g.a)({},Mt),{},{group_name:[Mt.group_name]})}).filter(function(Mt){return Mt.publish_time!==null}))),Kt=JSON.parse(JSON.stringify(Ce.allow_late_settings.map(function(Mt){return Object(g.a)(Object(g.a)({},Mt),{},{group_name:[Mt.group_name]})}).filter(function(Mt){return Mt.rank_forbidden_start!==null}))),yr(Object(g.a)({},vn)),Mn(Object(xe.a)(Nn)),((Nt=Kt)===null||Nt===void 0?void 0:Nt.length)<=0?Rt([{}]):Rt(Object(xe.a)(Kt))},[Ce]),console.log(vn,"data");var Lt=function(){var Mt,cn=JSON.parse(JSON.stringify(vn));if(cn.categoryId=Q.categoryId,vn.unified_setting||(Nn=(Mt=Nn)===null||Mt===void 0?void 0:Mt.map(function(kn){var lr;if(!kn.publish_time||!kn.end_time)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return kn.group_name=typeof(kn==null?void 0:kn.group_name)=="string"?[kn==null?void 0:kn.group_name]:kn==null?void 0:kn.group_name,kn.group_id=(lr=Ce.group_settings)===null||lr===void 0?void 0:lr.filter(function(er){var Rr;return kn==null||((Rr=kn.group_name)===null||Rr===void 0)?void 0:Rr.includes(er.group_name)}).map(function(er){return er.group_id||er.id}).toString().split(","),kn})),cn.group_settings=Nn,vn.rank_forbidden)if(vn.unified_setting){if(!vn.rank_forbidden_start)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!vn.rank_forbidden_end)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(H()(vn.rank_forbidden_end)<H()(vn.rank_forbidden_start))throw p.b.error("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4"),new String("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4")}else{var zn;Kt=(zn=Kt)===null||zn===void 0?void 0:zn.map(function(kn){var lr,er;if(!kn.rank_forbidden_start)throw p.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.rank_forbidden_end)throw p.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return kn.group_name=typeof(kn==null?void 0:kn.group_name)=="string"?[kn==null?void 0:kn.group_name]:kn==null?void 0:kn.group_name,kn.group_id=kn==null||((lr=kn.group_name)===null||lr===void 0||((er=lr.map(function(Rr){var mr,xr,Zr=(mr=Ce.group_settings)===null||mr===void 0||((xr=mr.filter(function(Yr){return(Yr==null?void 0:Yr.group_name)===Rr}))===null||xr===void 0)?void 0:xr[0];return Zr==null?void 0:Zr.group_id}))===null||er===void 0))?void 0:er.toString().split(","),kn}),cn.group_settingss=Kt}Ze(cn)},Ze=function(Mt){if(console.log(Mt.total_score,Mt.eff_score),Mt.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Mt!=null&&Mt.work_efficiency&&Mt.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var cn={shixun_evaluation:Mt.shixun_evaluation},zn=function(){var kn=Object(m.a)(s.a.mark(function lr(){var er;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return vt(!0),mr.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/public_setting.json"),{method:"post",body:Object(g.a)({},Mt)});case 3:er=mr.sent,er.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),Dt(!0),Ln(),sr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Q)})),vt(!1);case 6:case"end":return mr.stop()}},lr)}));return function(){return kn.apply(this,arguments)}}();zn()};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"},n.a.createElement("div",{className:Le.a.title},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(oe.a,null,(Ce==null?void 0:Ce.can_edit)&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Dt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(ze.a,null,n.a.createElement(oe.a,{span:24,className:"mt15 mt20"},n.a.createElement(ct.a,{checked:vn.score_open,disabled:it,onChange:function(Mt){vn.score_open=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u6210\u7EE9")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u5B83\u5B66\u751F\u7684\u6210\u7EE9\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u770B\u81EA\u5DF1\u7684\u6210\u7EE9)")),n.a.createElement(oe.a,{span:24,className:"mt15"},n.a.createElement(ct.a,{checked:vn.open_code,disabled:it,onChange:function(Mt){vn.open_code=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u4EE3\u7801")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u4ED6\u5B66\u751F\u7684\u4EE3\u7801\u8BE6\u60C5)")),!!vn.open_code&&n.a.createElement(oe.a,{span:24,className:"mt10 ml25"},n.a.createElement(ve.a.Group,{disabled:it,value:vn.open_code_type,onChange:function(Mt){vn.open_code_type=Mt.target.value,yr(Object.assign({},vn))}},n.a.createElement(ve.a,{value:0},"\u4EFB\u610F\u65F6\u95F4\u67E5\u770B"),n.a.createElement(ve.a,{style:{marginLeft:60},value:1},"\u7EC3\u4E60\u65F6\u95F4\u7ED3\u675F\u540E"))),n.a.createElement(oe.a,{span:24,className:"mt15 mt20"},n.a.createElement(ct.a,{checked:vn.rank_forbidden,disabled:it,onChange:function(Mt){vn.rank_forbidden=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u5F00\u542F\u5C01\u699C")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\u5219\u5728\u8BBE\u7F6E\u7684\u8FD9\u6BB5\u65F6\u95F4\u5185\uFF0C\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u4FE1\u606F\uFF0C\u5176\u4ED6\u65F6\u95F4\u53EF\u4EE5\u67E5\u770B)")),!!vn.rank_forbidden&&vn.unified_setting&&n.a.createElement(oe.a,{span:24,className:"mt10 "},n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(ze.a,{align:"middle",className:"mt25 "},n.a.createElement(oe.a,null,"\u5F00\u59CB\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:wn,disabledTime:Cn,disabled:it||H()()>H()(Ce.rank_forbidden_start),value:vn.rank_forbidden_start?H()(vn.rank_forbidden_start):"",onChange:function(Mt,cn){vn.rank_forbidden_start=cn,(vn.end_time==""||!vn.end_time)&&vn.unified_setting&&(vn.end_time=H()(Mt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),yr(Object.assign({},vn))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"))),n.a.createElement(ze.a,{align:"middle",className:"mt25"},n.a.createElement(oe.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:it,disabledDate:wn,value:vn.rank_forbidden_end?H()(vn.rank_forbidden_end):"",onChange:function(Mt,cn){vn.rank_forbidden_end=cn,yr(Object.assign({},vn))}})),n.a.createElement(oe.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))))),console.log("----",Nn),!vn.unified_setting&&((Sn=Nn)===null||Sn===void 0?void 0:Sn.length)>0&&!!vn.rank_forbidden&&n.a.createElement(ze.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(oe.a,{span:24},n.a.createElement(ze.a,null,n.a.createElement(oe.a,{span:10}),n.a.createElement(oe.a,{span:10},n.a.createElement(ze.a,{className:"c-grey-c ml30"},n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(oe.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(oe.a,{span:4}))),Kt.map(function(Nt,Mt){var cn,zn,kn,lr,er,Rr,mr;return n.a.createElement(oe.a,{span:24,key:Mt},n.a.createElement(ze.a,{className:"mt25"},n.a.createElement(oe.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",Mt+1,"\uFF1A"),n.a.createElement(Ct.a,{disabled:it||!(Te!=null&&(cn=Te.homework_status)!==null&&cn!==void 0&&cn.includes("\u672A\u53D1\u5E03"))&&Nt.id,mode:"multiple",style:{width:306},value:typeof Nt.group_name=="string"?[Nt.group_name]:Nt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Zr){Kt[Mt].group_name=Zr,Kt[Mt].group_id=Nt.group_id,Rt(Kt.slice())}},Ce.group_settings&&Ce.group_settings.map(function(xr){if(vn!=null&&vn.unified_setting&&!Kt.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(xr.group_name)))return n.a.createElement(Er,{value:xr.group_name,key:xr.id},xr.group_name);if(Nn.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(xr.group_name))&&!Kt.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(xr.group_name)))return n.a.createElement(Er,{value:xr.group_name,key:xr.id},xr.group_name)}))),n.a.createElement(oe.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(br,{allowClear:!1,disabled:it||(Ce!=null&&(zn=Ce.group_settings)!==null&&zn!==void 0&&(kn=zn.filter(function(xr){return xr.id===Nt.id}))!==null&&kn!==void 0&&(lr=kn[0])!==null&&lr!==void 0&&lr.rank_forbidden_start?H()()<H()(Ce==null||((er=Ce.group_settings)===null||er===void 0||((Rr=er.filter(function(xr){return xr.id===Nt.id}))===null||Rr===void 0||((mr=Rr[0])===null||mr===void 0)))?void 0:mr.rank_forbidden_start)?!1:[!0,!1]:!1),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4","\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4"],disabledDate:wn,disabledTime:Cn,showTime:{format:"HH:mm",defaultValue:[H()(Object(v.d)(),"HH:mm"),H()(Object(v.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Nt.rank_forbidden_start&&[H()(Nt.rank_forbidden_start),Nt.rank_forbidden_end?H()(Nt.rank_forbidden_end):void 0],onChange:function(Zr,Yr){Kt[Mt].rank_forbidden_start=Yr[0],Kt[Mt].rank_forbidden_end=Yr[1],Rt(Object(xe.a)(Kt))}}))),!it&&n.a.createElement(oe.a,{className:"ml20"},Mt>0&&!Nt.id&&n.a.createElement(Ae.a,{onClick:function(){Kt=Kt.filter(function(Zr,Yr){return Mt!==Yr}),Rt(Kt.slice()),setTimeout(function(){return Rt(Kt.slice())},10)}}),n.a.createElement(kt.a,{className:"c-green ml20",onClick:function(){Rt(Kt.concat({}))}}))))})),!it&&n.a.createElement("div",{className:Le.a.btns},n.a.createElement(M.a,{type:"primary",loading:It,onClick:function(){return Lt()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){Dt(!0),Ln()}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Yt,onCancel:function(){return ft(!1)}},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Ft.a.Search,{onChange:function(Mt){}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Mt,cn){qt(Mt)}},pagination:!1,dataSource:[{name:"1"}],columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]}))))},cr=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading;return{shixunHomeworks:_n,loading:Sn.effects}})(rr),Pr=function(_n){var Sn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=bn.workSetting,Ce=bn.workList,Te=bn.changeData,rt=Object(i.useState)(!0),Re=Object(o.a)(rt,2),$e=Re[0],it=Re[1],Dt=Object(i.useState)(!1),Tt=Object(o.a)(Dt,2),Be=Tt[0],_t=Tt[1],ot=Object(i.useState)(!1),ht=Object(o.a)(ot,2),wt=ht[0],It=ht[1],vt=Wt.a.useForm(),Xt=Object(o.a)(vt,1),dn=Xt[0],Pn=Object(i.useState)([]),Gn=Object(o.a)(Pn,2),On=Gn[0],Nn=Gn[1],Mn=Object(i.useState)([]),Pt=Object(o.a)(Mn,2),hn=Pt[0],Kt=Pt[1],Rt=!(Ce!=null&&(Sn=Ce.homework_status)!==null&&Sn!==void 0&&Sn.includes("\u672A\u53D1\u5E03")),Un=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,is_onpage_time:!0,training_time_rules:1,hack_settings:[],punish_time:void 0,hack_score_settings:void 0}),Rn=Object(o.a)(Un,2),Yt=Rn[0],ft=Rn[1];Object(i.useEffect)(function(){return jn(),function(){Nn([].concat())}},[]);var jn=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Q)})};Object(i.useEffect)(function(){if(!(ce!=null&&ce.course_id))return;Object.keys(Yt).map(function(An){Yt[An]=ce[An]}),(!Yt.allow_late||!Yt.unified_late)&&(Yt.late_penalty=5),On=JSON.parse(JSON.stringify(ce.group_settings.map(function(An){return Object(g.a)(Object(g.a)({},An),{},{group_name:[An.group_name]})}).filter(function(An){return An.publish_time!==null}))),hn=JSON.parse(JSON.stringify(ce.allow_late_settings.map(function(An){return Object(g.a)(Object(g.a)({},An),{},{group_name:[An.group_name]})}).filter(function(An){return An.late_time!==null}))),qt(),ft(Object(g.a)({},Yt)),Nn(Object(xe.a)(On)),Kt(Object(xe.a)(hn))},[ce]);var fn=function(){var Fn=JSON.parse(JSON.stringify(Yt));Qn(Fn)},Qn=function(Fn){if(console.log(Fn.total_score,Fn.eff_score),Fn.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var vn=function(){var yr=Object(m.a)(s.a.mark(function Ln(){var wn;return s.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return _t(!0),Ze.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(g.a)({},Fn)});case 3:wn=Ze.sent,wn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),it(!0),jn(),sr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Q)})),_t(!1);case 6:case"end":return Ze.stop()}},Ln)}));return function(){return yr.apply(this,arguments)}}();(Yt==null?void 0:Yt.hack_score_settings)!==(ce==null?void 0:ce.hack_score_settings)&&Rt?a.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:vn}):vn()},qt=function(){var Fn,vn=Yt.total_score,yr=(Fn=Yt.hack_settings)===null||Fn===void 0?void 0:Fn.length,Ln=0,wn;switch(Yt.hack_score_settings){case 0:var Lt=(vn/yr).toFixed(2);Yt.hack_settings.map(function(er,Rr){Ln=Rr,er.hack_score=Lt>0?Lt:0}),wn=(vn-Lt*(yr-1)).toFixed(2),Yt.hack_settings[Ln].hack_score=wn>0?wn:0;break;case 1:var Ze=[0,1,3,6],Nt=0,Mt=Yt.hack_settings.filter(function(er){return er.difficult===1}).length*Ze[1],cn=Yt.hack_settings.filter(function(er){return er.difficult===2}).length*Ze[2],zn=Yt.hack_settings.filter(function(er){return er.difficult===3}).length*Ze[3],kn=vn/(Mt+cn+zn);console.log(kn,2222),Yt.hack_settings.map(function(er,Rr){Ln=Rr,er.hack_score=(Ze[er.difficult]*kn).toFixed(2),Nt=Nt+Number(er.hack_score)});var lr=Yt.hack_settings[Ln].hack_score;wn=(vn-Nt+Number(lr)).toFixed(2),Yt.hack_settings[Ln].hack_score=wn>0?wn:0;break}};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(oe.a,{flex:"1"}),n.a.createElement(oe.a,null,(ce==null?void 0:ce.can_edit)&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return it(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(ze.a,{align:"middle"},n.a.createElement(oe.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement(Qe.a,{min:0,className:"ml10 mr10",style:{width:160},value:Yt.total_score,disabled:$e||Rt,onChange:function(Fn){Yt.total_score=Fn,ft(Object.assign({},Yt)),qt()}}),"\xA0\u5206"),n.a.createElement(oe.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement(Qe.a,{className:"ml10 mr10",style:{width:160},min:0,value:Yt.punish_time,precision:0,disabled:$e,onChange:function(Fn){Yt.punish_time=Fn,ft(Object.assign({},Yt)),qt()}}),"\xA0\u5206\u949F")),n.a.createElement(ze.a,{align:"middle",style:{marginTop:20}},n.a.createElement(oe.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(oe.a,{flex:"1"},n.a.createElement(Wt.a.Item,{className:"ml20"},n.a.createElement(ve.a.Group,{disabled:$e||Rt,value:Yt.hack_score_settings,onChange:function(Fn){Yt.hack_score_settings=Fn.target.value,ft(Object.assign({},Yt)),qt()}},n.a.createElement(ve.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(ve.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(ve.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:Le.a.hackList},Yt.hack_settings&&Yt.hack_settings.map(function(An,Fn){return n.a.createElement(ze.a,{key:Fn,align:"middle",style:{marginTop:20}},n.a.createElement(oe.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,An.hack_name)),n.a.createElement(oe.a,{flex:"150px"},n.a.createElement(Qe.a,{min:0,step:.1,value:An.hack_score,disabled:$e||Yt.hack_score_settings!==2||Rt,onChange:function(yr){Yt.hack_settings[Fn].hack_score=yr;var Ln=Yt.hack_settings.reduce(function(wn,Lt){return wn+Number(Lt.hack_score)},0);Yt.total_score=Ln.toFixed(2),ft(Object(g.a)({},Yt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(oe.a,{style:{lineHeight:"20px"}},An.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),An.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),An.difficult===3&&n.a.createElement("span",{className:"tag-style-border-small bg-orange c-white mr10"},"\u56F0\u96BE")))})),n.a.createElement("div",{style:{height:100}}),!$e&&n.a.createElement("div",{className:Le.a.btns},n.a.createElement(M.a,{type:"primary",loading:Be,onClick:function(){return fn()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){it(!0),jn()}},"\u53D6\u6D88")))},Kr=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading;return{shixunHomeworks:_n,loading:Sn.effects}})(Pr),hi=function(_n){var Sn,bn,ur=_n.shixunHomeworks,sr=_n.loading,Q=_n.dispatch,ce=Object(i.useState)(!0),Ce=Object(o.a)(ce,2),Te=Ce[0],rt=Ce[1],Re=Object(i.useState)(!1),$e=Object(o.a)(Re,2),it=$e[0],Dt=$e[1],Tt=Object(i.useState)([]),Be=Object(o.a)(Tt,2),_t=Be[0],ot=Be[1],ht=Object(i.useState)([]),wt=Object(o.a)(ht,2),It=wt[0],vt=wt[1],Xt=Object(i.useState)([]),dn=Object(o.a)(Xt,2),Pn=dn[0],Gn=dn[1],On=Object(i.useState)([]),Nn=Object(o.a)(On,2),Mn=Nn[0],Pt=Nn[1],hn=Object(T.i)();function Kt(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(m.a)(s.a.mark(function ft(){var jn;return s.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(O.a)("/api/homework_commons/".concat(hn.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:jn=Qn.sent,vt(jn);case 4:case"end":return Qn.stop()}},ft)})),Rt.apply(this,arguments)}function Un(){return Rn.apply(this,arguments)}function Rn(){return Rn=Object(m.a)(s.a.mark(function ft(){var jn;return s.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(O.a)("/api/courses/".concat(hn==null?void 0:hn.coursesId,"/teachers"),{method:"get",params:{homework_id:hn.categoryId}});case 2:jn=Qn.sent,jn==null||jn.teacher_list.map(function(qt){qt.key=qt.user_id}),Gn(jn==null?void 0:jn.teacher_list),Pt(jn==null?void 0:jn.teacher_list);case 6:case"end":return Qn.stop()}},ft)})),Rn.apply(this,arguments)}Object(i.useEffect)(function(){Kt(),Un()},[hn]);var Yt=function(){};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(ze.a,null,n.a.createElement(oe.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(It==null?void 0:It.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){Dt(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),n.a.createElement(ze.a,{style:{marginTop:"20px",marginBottom:"20px"}},(It==null||((Sn=It.data)===null||Sn===void 0)?void 0:Sn.length)<=0&&n.a.createElement(q.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),It==null||((bn=It.data)===null||bn===void 0)?void 0:bn.map(function(ft){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"}},ft==null?void 0:ft.real_name),(It==null?void 0:It.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(m.a)(s.a.mark(function jn(){var fn;return s.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(O.a)("/api/homework_commons/".concat(hn.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:ft.id}});case 2:fn=qt.sent,fn.status===0&&(p.b.info("\u5220\u9664\u6210\u529F"),Kt(),Un());case 4:case"end":return qt.stop()}},jn)}))},"X"))})),n.a.createElement(ze.a,null,!Te&&n.a.createElement(oe.a,{className:"mb50"},n.a.createElement(M.a,{type:"primary",size:"large",onClick:function(){return Yt()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){rt(!0)}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:it,onCancel:function(){return Dt(!1)},onOk:Object(m.a)(s.a.mark(function ft(){var jn;return s.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:if(!(_t.length===0)){Qn.next=3;break}return p.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),Qn.abrupt("return");case 3:return Qn.next=5,Object(O.a)("/api/homework_commons/".concat(hn.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:_t}});case 5:jn=Qn.sent,jn.status===0&&(p.b.info("\u6DFB\u52A0\u6210\u529F"),ot([]),Kt(),Un(),Dt(!1));case 7:case"end":return Qn.stop()}},ft)}))},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Ft.a.Search,{onChange:function(jn){Gn(Mn.filter(function(fn){return fn.name.indexOf(jn.target.value)>-1}))}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(jn,fn){ot(jn)},selectedRowKeys:_t,getCheckboxProps:function(jn){return{disabled:jn.is_collaborator}}},pagination:!1,dataSource:Pn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},pn=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading;return{shixunHomeworks:_n,loading:Sn.effects}})(hi),or=de.a.RangePicker,mi=Ct.a.Option,wi=function(_n){var Sn=_n.shixunHomeworks,bn=_n.loading,ur=_n.dispatch;return n.a.createElement("section",{className:"bg-white pl30 pr30 pt10 mb10"},n.a.createElement(G.a,null,n.a.createElement(G.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},n.a.createElement(nr,null)),n.a.createElement(G.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(Kr,null)),n.a.createElement(G.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(cr,null)),n.a.createElement(G.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(pn,null))))},ti=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading;return{shixunHomeworks:_n,loading:Sn.effects}})(wi),ni=D("RotF"),X=D.n(ni),L=function(_n){var Sn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=Object(T.h)(),Ce=Object(i.useState)([]),Te=Object(o.a)(Ce,2),rt=Te[0],Re=Te[1],$e=Object(i.useState)([]),it=Object(o.a)($e,2),Dt=it[0],Tt=it[1],Be=Object(i.useState)(!0),_t=Object(o.a)(Be,2),ot=_t[0],ht=_t[1],wt=Object(i.useState)(!1),It=Object(o.a)(wt,2),vt=It[0],Xt=It[1],dn=Object(i.useState)(1),Pn=Object(o.a)(dn,2),Gn=Pn[0],On=Pn[1],Nn=Object(i.useState)([]),Mn=Object(o.a)(Nn,2),Pt=Mn[0],hn=Mn[1],Kt=Object(i.useState)(!1),Rt=Object(o.a)(Kt,2),Un=Rt[0],Rn=Rt[1],Yt=Object(i.useState)(!1),ft=Object(o.a)(Yt,2),jn=ft[0],fn=ft[1];Object(i.useEffect)(function(){bn.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(An.resetFields(),Re([]),Rn(!0),vn()):Rn(!1)},[bn.actionTabs.key]);var Qn=Wt.a.useForm(),qt=Object(o.a)(Qn,1),An=qt[0],Fn=[],vn=function(){var wn=Object(m.a)(s.a.mark(function Lt(){var Ze,Nt,Mt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(!(ot&&!vt)){zn.next=11;break}return Xt(!0),On(Gn+1),zn.next=5,Object(st.x)(Object(g.a)(Object(g.a)({},Q),{},{page:Gn}));case 5:Nt=zn.sent,Mt=Object(xe.a)(Nt.group_list),Nt!=null&&Nt.ungroup_list&&Mt.push({id:Nt==null?void 0:Nt.ungroup_list.id,name:Nt==null?void 0:Nt.ungroup_list.name,works_count:Nt==null?void 0:Nt.ungroup_list.work_count,last_review_time:Nt==null?void 0:Nt.ungroup_list.last_review_time}),Re([].concat(Object(xe.a)(rt),Object(xe.a)(Mt))),Xt(!1),((Ze=Nt.group_list)===null||Ze===void 0?void 0:Ze.length)<10&&ht(!1);case 11:case"end":return zn.stop()}},Lt)}));return function(){return wn.apply(this,arguments)}}(),yr=function(){sr({type:"shixunHomeworks/setActionTabs",payload:{}}),fn(!1),ht(!0),Xt(!1),On(1),Re([]),An.resetFields()},Ln=[{title:"",dataIndex:"id",width:280,render:function(Lt,Ze){return n.a.createElement(ct.a,{disabled:!(Ze.works_count>1),value:String(Ze.id)},Ze.name)}},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u4E0A\u6B21\u67E5\u91CD\u65F6\u95F4",dataIndex:"last_review_time",width:130}];return n.a.createElement(a.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Un,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(m.a)(s.a.mark(function wn(){var Lt,Ze;return s.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Lt=An.getFieldValue(),Mt.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(xe.a)(Lt.group_ids)}});case 3:if(Ze=Mt.sent,!(Ze.status===0)){Mt.next=11;break}return yr(),p.b.success("\u64CD\u4F5C\u6210\u529F"),Mt.next=9,sr({type:"shixunHomeworks/getWorkList",payload:bn.actionTabs.params});case 9:R.d.push("/classrooms/".concat(Q.coursesId,"/program_homework/").concat(Q.categoryId,"/detail?tabs=2")),sr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return Mt.stop()}},wn)})),onCancel:yr},bn.codeReviewCourse&&n.a.createElement(Wt.a,{form:An,onChange:function(Lt){hn(Object(g.a)({},An.getFieldValue()))},initialValues:(Sn={},Object(Xe.a)(Sn,"group_ids",Fn),Object(Xe.a)(Sn,"end_time",H()(H()().add(7,"days").format("YYYY-MM-DD HH:mm"))),Sn)},n.a.createElement("div",{className:"flexd-table-header mt20"},n.a.createElement(V.a,{pagination:!1,dataSource:[],columns:Ln})),n.a.createElement(Wt.a.Item,{name:"group_ids"},n.a.createElement(ct.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(Lt){vn()},hasMore:ot,useWindow:!1},n.a.createElement(V.a,{loading:ur.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:Ln,dataSource:rt,pagination:!1})))))),n.a.createElement(ze.a,null,n.a.createElement(oe.a,{className:"ml10"},n.a.createElement(ct.a,{checked:jn,onChange:function(Lt){fn(Lt.target.checked);var Ze=[];Lt.target.checked&&(Ze=rt.filter(function(Nt){return Nt.works_count>1}).map(function(Nt){return Nt.id+""})),An.setFieldsValue(Object(Xe.a)({},"group_ids",Ze))}},"\u5168\u9009"))))},N=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading;return{shixunHomeworks:_n,loading:Sn}})(L),z=D("nPLb"),ne=D("XpUO"),J=D("bTeP"),je=D.n(J),$t=D("HBuW"),In=D("NLgs"),Jn=D("m3rI"),ln=D("+92d"),tr=D.n(ln),qn=D("wwSX"),kr=D.n(qn),li=D("zlzj"),ai=D.n(li),Gr=D("deN7"),Li=[tr.a,kr.a,ai.a],Vi=function(_n){var Sn,bn,ur=_n.user,sr=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(T.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(Y.s)()?[ur.userInfo.course.course_group_id]:[]},Object(T.i)())),Q=Object(o.a)(sr,2),ce=Q[0],Ce=Q[1],Te=Object(i.useState)([]),rt=Object(o.a)(Te,2),Re=rt[0],$e=rt[1],it=Object(i.useState)([]),Dt=Object(o.a)(it,2),Tt=Dt[0],Be=Dt[1],_t=Object(i.useState)([]),ot=Object(o.a)(_t,2),ht=ot[0],wt=ot[1],It=Object(i.useState)(!1),vt=Object(o.a)(It,2),Xt=vt[0],dn=vt[1],Pn=Object(i.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(Kt,Rt,Un){return Kt<4?n.a.createElement("img",{src:Li[Kt-1]}):Kt}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(Kt,Rt,Un){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Jn.a.IMG_SERVER+"/images/"+(Rt==null?void 0:Rt.image_url)}),Kt)}},{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(Kt){return Kt||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),Gn=Object(o.a)(Pn,2),On=Gn[0],Nn=Gn[1];Object(i.useEffect)(function(){On.splice(7);for(var hn=function(Rn){var Yt,ft,jn,fn,Qn={};Qn.title=Re!=null&&Re.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Rn+1)+"\uFF08".concat(Re==null||((Yt=Re.question_data)===null||Yt===void 0||((ft=Yt[Rn])===null||ft===void 0))?void 0:ft.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function qt(){var An,Fn,vn;return s.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Ln.next=2,Object(O.a)("/api/problems/".concat(Re==null||((An=Re.question_data)===null||An===void 0||((Fn=An[Rn])===null||Fn===void 0))?void 0:Fn.identifier,"/start.json"),{method:"get"});case 2:vn=Ln.sent,vn&&(window.open("/myproblems/".concat(vn==null?void 0:vn.identifier,"?type=1")),localStorage.setItem("program_homework",[ce.coursesId,ce.categoryId]));case 4:case"end":return Ln.stop()}},qt)}))},"\u9898\u76EE"+(Rn+1)+"\uFF08".concat(Re==null||((jn=Re.question_data)===null||jn===void 0||((fn=jn[Rn])===null||fn===void 0))?void 0:fn.question_score,"\uFF09")),Qn.dataIndex="question_data",Qn.width=250,Qn.render=function(qt,An){var Fn,vn,yr,Ln,wn;return n.a.createElement("div",null,(qt==null||((Fn=qt[Rn])===null||Fn===void 0)?void 0:Fn.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(s.a.mark(function Lt(){var Ze,Nt,Mt,cn,zn,kn,lr,er;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(qt!=null&&(Ze=qt[Rn])!==null&&Ze!==void 0&&Ze.open_code){mr.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),mr.abrupt("return");case 3:return mr.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,homework_common_id:ce.categoryId,hack_user_code_id:qt==null||((Nt=qt[Rn])===null||Nt===void 0)?void 0:Nt.hack_user_code_id})});case 5:er=mr.sent,a.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",qt==null||((Mt=qt[Rn])===null||Mt===void 0)?void 0:Mt.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",qt==null||((cn=qt[Rn])===null||cn===void 0)?void 0:cn.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",qt==null||((zn=qt[Rn])===null||zn===void 0)?void 0:zn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",qt==null||((kn=qt[Rn])===null||kn===void 0)?void 0:kn.score)),content:n.a.createElement(Gr.a,{languages:[{language:qt==null||((lr=qt[Rn])===null||lr===void 0)?void 0:lr.language,code:er==null?void 0:er.code}],v:qt,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:qt.language,game_id:qt.id,diff_code_count:qt.diff_code_count})});case 7:case"end":return mr.stop()}},Lt)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(qt==null||((vn=qt[Rn])===null||vn===void 0)?void 0:vn.answer_question_time)||"- -"),qt!=null&&(yr=qt[Rn])!==null&&yr!==void 0&&yr.submit_count?n.a.createElement(k.a,{title:"".concat((qt==null||((Ln=qt[Rn])===null||Ln===void 0)?void 0:Ln.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(qt==null||((wn=qt[Rn])===null||wn===void 0)?void 0:wn.submit_count)||0):null))},On.push(Qn)},Kt=0;Kt<(Re==null||((Rt=Re.question_data)===null||Rt===void 0)?void 0:Rt.length);Kt++){var Rt;hn(Kt)}Nn(Object(xe.a)(On))},[Re==null?void 0:Re.question_data]),Object(i.useEffect)(function(){var hn;ur!=null&&(hn=ur.userInfo)!==null&&hn!==void 0&&hn.course&&(Object(Y.s)()&&(ce.course_group=Object(Y.s)()?[ur.userInfo.course.course_group_id]:[],Ce(Object(g.a)({},ce))),Mn(1))},[ur==null?void 0:ur.userInfo]);function Mn(hn){return Pt.apply(this,arguments)}function Pt(){return Pt=Object(m.a)(s.a.mark(function hn(Kt){var Rt,Un,Rn,Yt,ft,jn,fn;return s.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return dn(!0),qt.next=3,Object(O.a)("/api/courses/rank_list.json",{method:"get",params:Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,rank_type:2,homework_common_id:ce.categoryId})});case 3:if(Rt=qt.sent,$e(Rt),dn(!1),Object(Y.s)()?(Kt===1&&Be([Rt==null||((Un=Rt.course_group)===null||Un===void 0||((Rn=Un[0])===null||Rn===void 0))?void 0:Rn.id]),Rt!=null&&Rt.my_rank?wt([Rt==null?void 0:Rt.my_rank].concat(Object(xe.a)(Rt==null?void 0:Rt.rank_list))):wt(Object(xe.a)(Rt==null?void 0:Rt.rank_list))):wt(Object(xe.a)(Rt==null?void 0:Rt.rank_list)),Kt===1){for(Yt={title:n.a.createElement(k.a,{title:`\u603B\u8017\u65F6\u65F6\u4E3A\u505A\u9898\u901A\u8FC7\u65F6\u957F\u548C\u7F5A\u65F6\u65F6\u957F\u7684\u603B\u548C\uFF0C
\u7F5A\u65F6\u65F6\u957F=\u8BC4\u6D4B\u51FA\u9519\u6B21\u6570X\u8BBE\u7F6E\u7684\u7F5A\u65F6\uFF08\u5F53\u524D\u4E3A`.concat(Rt==null?void 0:Rt.punish_time,"\u5206\uFF09")},n.a.createElement("span",{style:{marginRight:3}},"\u603B\u8017\u65F6")," ",n.a.createElement("span",{style:{fontSize:"14px"},className:"iconfont icon-tishixiaowenhao c-blue"})),dataIndex:"finish_time",width:150,ellipsis:!0,fixed:"left",key:"finish_time"},On.push(Yt),ft=function(Fn){var vn,yr,Ln,wn,Lt={};Lt.title=Rt!=null&&Rt.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(Rt==null||((vn=Rt.question_data)===null||vn===void 0||((yr=vn[Fn])===null||yr===void 0))?void 0:yr.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function Ze(){var Nt,Mt,cn;return s.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(O.a)("/api/problems/".concat(Rt==null||((Nt=Rt.question_data)===null||Nt===void 0||((Mt=Nt[Fn])===null||Mt===void 0))?void 0:Mt.identifier,"/start.json"),{method:"get"});case 2:cn=kn.sent,cn&&(window.open("/myproblems/".concat(cn==null?void 0:cn.identifier,"?type=1")),localStorage.setItem("program_homework",[ce.coursesId,ce.categoryId]));case 4:case"end":return kn.stop()}},Ze)}))},"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(Rt==null||((Ln=Rt.question_data)===null||Ln===void 0||((wn=Ln[Fn])===null||wn===void 0))?void 0:wn.question_score,"\uFF09")),Lt.dataIndex="question_data",Lt.width=250,Lt.render=function(Ze,Nt){var Mt,cn,zn,kn,lr;return n.a.createElement("div",null,(Ze==null||((Mt=Ze[Fn])===null||Mt===void 0)?void 0:Mt.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(s.a.mark(function er(){var Rr,mr,xr,Zr,Yr,Jr,vi,_i;return s.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(Ze!=null&&(Rr=Ze[Fn])!==null&&Rr!==void 0&&Rr.open_code){Ue.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),Ue.abrupt("return");case 3:return Ue.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,homework_common_id:ce.categoryId,hack_user_code_id:Ze==null||((mr=Ze[Fn])===null||mr===void 0)?void 0:mr.hack_user_code_id})});case 5:_i=Ue.sent,a.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",Ze==null||((xr=Ze[Fn])===null||xr===void 0)?void 0:xr.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Ze==null||((Zr=Ze[Fn])===null||Zr===void 0)?void 0:Zr.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Ze==null||((Yr=Ze[Fn])===null||Yr===void 0)?void 0:Yr.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Ze==null||((Jr=Ze[Fn])===null||Jr===void 0)?void 0:Jr.score)),content:n.a.createElement(Gr.a,{languages:[{language:Ze==null||((vi=Ze[Fn])===null||vi===void 0)?void 0:vi.language,code:_i==null?void 0:_i.code}],v:Ze,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Ze.language,game_id:Ze.id,diff_code_count:Ze.diff_code_count})});case 7:case"end":return Ue.stop()}},er)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Ze==null||((cn=Ze[Fn])===null||cn===void 0)?void 0:cn.answer_question_time)||"- -"),Ze!=null&&(zn=Ze[Fn])!==null&&zn!==void 0&&zn.submit_count?n.a.createElement(k.a,{title:"".concat((Ze==null||((kn=Ze[Fn])===null||kn===void 0)?void 0:kn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Ze==null||((lr=Ze[Fn])===null||lr===void 0)?void 0:lr.submit_count)||0):null))},On.push(Lt)},jn=0;jn<(Rt==null||((fn=Rt.question_data)===null||fn===void 0)?void 0:fn.length);jn++)ft(jn);Nn(Object(xe.a)(On))}case 8:case"end":return qt.stop()}},hn)})),Pt.apply(this,arguments)}return console.log("----",On),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(Re==null?void 0:Re.message)==="\u5C01\u699C\u4E2D"?n.a.createElement(q.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(Y.c)()&&n.a.createElement("div",{style:{flex:1}},n.a.createElement(ct.a.Group,{className:je.a.checkboxgroup,value:Tt,onChange:function(Kt){if(ce.type===1)Be([]),ce.course_group=[],ce.page=1,Ce(Object(g.a)({},ce)),Mn();else if(ce.type===2){var Rt;Be(["\u5168\u90E8"].concat()),ce.course_group=Re==null||((Rt=Re.course_group)===null||Rt===void 0)?void 0:Rt.map(function(Un){return Un.id}),ce.page=1,Ce(Object(g.a)({},ce)),Mn()}else Be(Object(xe.a)(Kt.filter(function(Un){return Un!="\u5168\u90E8"}))),ce.course_group=Kt.filter(function(Un){return Un!="\u5168\u90E8"}),ce.page=1,Ce(Object(g.a)({},ce)),Mn()}},n.a.createElement(ct.a,{value:"\u5168\u90E8",onChange:function(Kt){Kt.target.checked?ce.type=2:ce.type=1}},"\u5168\u90E8\u5206\u73ED"),Re==null||((Sn=Re.course_group)===null||Sn===void 0)?void 0:Sn.map(function(hn,Kt){return n.a.createElement(ct.a,{onChange:function(Un){ce.type=3},value:hn.id},hn==null?void 0:hn.name)}))),Object(Y.s)()&&n.a.createElement(ve.a.Group,{onChange:function(Kt){Kt.target.value==="\u5168\u90E8"?(ce.course_group=[],ce.page=1,Ce(Object(g.a)({},ce)),Mn()):(ce.course_group=[Kt.target.value],ce.page=1,Ce(Object(g.a)({},ce)),Mn())},defaultValue:ur.userInfo.course.course_group_id},n.a.createElement(ve.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Re==null||((bn=Re.course_group)===null||bn===void 0)?void 0:bn.map(function(hn,Kt){return n.a.createElement(ve.a,{value:hn.id},hn.name)}))),Object(Y.c)()&&n.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:10}},n.a.createElement("span",{style:{fontSize:14,color:"#B1BACD"}},"\u6392\u884C\u89C4\u5219\uFF1A\u65F6\u95F4\u7ED3\u675F\u540E\u6B63\u5F0F\u5C01\u699C\uFF0C\u65F6\u95F4\u6BB5\u4E4B\u5916\u7684\u63D0\u4EA4\u4E0D\u8BA1\u5165\u6392\u884C\u3002"," ",n.a.createElement("a",{onClick:function(){a.a.warning({title:"\u8BA1\u5206\u89C4\u5219",width:500,content:n.a.createElement("div",null,n.a.createElement("p",null,"\u6392\u540D\u89C4\u5219\uFF1A\u7ECF\u5178ACM\u89C4\u5219"),n.a.createElement("p",null,"AC\uFF08\u901A\u8FC7\u9898\u76EE\uFF09\u8D8A\u591A\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"AC\u76F8\u540C\uFF0C\u603B\u7528\u65F6\u8D8A\u5C11\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"\u603B\u7528\u65F6=\u2211\uFF08\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6\uFF09"),n.a.createElement("p",null,"\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6=\u6BD4\u8D5B\u5F00\u59CB\u5230\u63D0\u4EA4\u88AB\u901A\u8FC7\u7684\u65F6\u95F4+\u7F5A\u65F6"),n.a.createElement("p",null,"\u7F5A\u65F6=\uFF08\u901A\u8FC7\u524D\uFF09\u9519\u8BEF\u4EE3\u7801\u63D0\u4EA4\u6B21\u6570*\u6BCF\u6B21\u7F5A\u65F6"),n.a.createElement("p",null,"\u4E0D\u7B97\u7F5A\u65F6\u7684\u60C5\u51B5\uFF1A\u6CA1\u6709\u901A\u8FC7\u7684\u9898\u76EE\u3001\uFF08\u7CFB\u7EDF\uFF09\u5185\u90E8\u9519\u8BEF\u3001\u7F16\u8BD1\u9519\u8BEF"))})}},"\u70B9\u51FB\u67E5\u770B\u8BA1\u5206\u89C4\u5219")),n.a.createElement(M.a,{onClick:function(){Object(be.v)(Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,rank_type:2,homework_common_id:ce.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(f.a,{spinning:Xt},n.a.createElement(V.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(Kt,Rt){return Rt===0&&Object(Y.s)()&&je.a.tables},dataSource:ht,columns:On})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(y.a,{current:ce.page,pageSize:ce.per_page,total:Re==null?void 0:Re.count,hideOnSinglePage:!0,onChange:function(Kt,Rt){ce.page=Kt,ce.per_page=Rt,Ce(Object(g.a)({},ce)),Mn()}}))))},Dr=Object(R.a)(function(Bn){var _n=Bn.user;return{user:_n}})(Vi),Sr=[{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%"}],ri=function(_n){var Sn,bn=_n.shixunHomeworks,ur=_n.globalSetting,sr=_n.loading,Q=_n.dispatch,ce=Object(T.i)(),Ce=Object(T.h)(),Te=Object(T.g)(),rt=Object(i.useState)([]),Re=Object(o.a)(rt,2),$e=Re[0],it=Re[1],Dt=Object(i.useState)(Ce.query.tabs||"0"),Tt=Object(o.a)(Dt,2),Be=Tt[0],_t=Tt[1],ot=Object(i.useState)({}),ht=Object(o.a)(ot,2),wt=ht[0],It=ht[1],vt=bn.workList,Xt=Object(i.useState)(!1),dn=Object(o.a)(Xt,2),Pn=dn[0],Gn=dn[1],On;ce.category=Ce.query.category_id,ce.order="work_score",ce.b_order="desc";var Nn=function(Yt){_t(Yt),Yt==="0"&&Q({type:"shixunHomeworks/getWorkList",payload:ce})},Mn=function(){a.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u4F60\u5728\u8BE5\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A\uFF0C\u65E0\u6CD5\u6062\u590D",n.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u91CD\u505A\uFF1F"),onOk:function(){var Yt=Object(m.a)(s.a.mark(function jn(){var fn,Qn,qt;return s.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Qn=(fn=bn.workList)===null||fn===void 0?void 0:fn.myshixun_identifier,Fn.next=3,Object(st.X)({id:Qn});case 3:qt=Fn.sent,qt&&(p.b.info(`\u5DF2\u6E05\u7A7A\u672C\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55
\u8BF7\u70B9\u51FB\u201C\u5F00\u542F\u6311\u6218\u201D\u91CD\u505A\u8BFE\u7A0B\u5B9E\u9A8C`),Q({type:"shixunHomeworks/getWorkList",payload:wt}));case 5:case"end":return Fn.stop()}},jn)}));function ft(){return Yt.apply(this,arguments)}return ft}()})},Pt=function Rn(Yt){var ft;Yt=(ft=Yt)!==null&&ft!==void 0&&ft.includes(".json")?Yt:"".concat(Yt,".json"),a.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var jn=Object(m.a)(s.a.mark(function Qn(){var qt,An;return s.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object($t.Bb)({url:Yt});case 2:if(qt=vn.sent,qt){vn.next=5;break}return vn.abrupt("return");case 5:return p.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),vn.next=8,Object($t.E)({id:qt.shixun_identifier});case 8:if(An=vn.sent,!(An!=null&&An.game_identifier)){vn.next=12;break}return Object(v.S)("/tasks/".concat(An.game_identifier,"?coursesId=").concat(ce.coursesId)),vn.abrupt("return");case 12:(An==null?void 0:An.status)===2?Rn(An==null?void 0:An.message):(An==null?void 0:An.status)===3&&hn(An==null?void 0:An.message);case 13:case"end":return vn.stop()}},Qn)}));function fn(){return jn.apply(this,arguments)}return fn}()})},hn=function(Yt){a.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",Yt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Kt=function(){var Rn=Object(m.a)(s.a.mark(function Yt(ft){var jn,fn;return s.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return ft=(jn=ft)!==null&&jn!==void 0&&jn.includes(".json")?ft:"".concat(ft,".json"),qt.next=3,Object($t.Bb)({url:ft});case 3:if(fn=qt.sent,console.log(fn,"execRes"),!(fn!=null&&fn.game_identifier)){qt.next=8;break}return Object(v.S)("/tasks/".concat(fn.game_identifier,"?coursesId=").concat(ce.coursesId)),qt.abrupt("return");case 8:(fn==null?void 0:fn.status)===-3?Object(v.q)():(fn==null?void 0:fn.status)===2?Pt(fn==null?void 0:fn.message):(fn==null?void 0:fn.status)===3&&hn(fn==null?void 0:fn.message);case 9:case"end":return qt.stop()}},Yt)}));return function(ft){return Rn.apply(this,arguments)}}(),Rt=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(Ot,{setExportParams:It}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement(Je,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(Dr,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(Qt,null)},{name:Object(Y.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement(ti,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(ce.coursesId,"/program_homework/").concat(ce.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(Rn){var Yt;if(Object(Y.s)())return Rn.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(Y.s)()||(vt==null||((Yt=vt.homework_status)===null||Yt===void 0)?void 0:Yt[0])!=="\u5DF2\u622A\u6B62")return Rn.name!=="\u8D28\u91CF\u68C0\u6D4B";var ft;return!vt.code_review&&(vt==null||((ft=vt.homework_status)===null||ft===void 0)?void 0:ft[0])!=="\u672A\u53D1\u5E03"?!0:Rn.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(Rn){return vt.open_code_quality_analysis?!0:Rn.name!=="\u8D28\u91CF\u68C0\u6D4B"}),Un=function(){var Yt,ft,jn,fn,Qn,qt,An,Fn;return n.a.createElement("aside",{className:je.a.workListTabButton},Object(Y.s)()&&((Yt=bn.workList)===null||Yt===void 0?void 0:Yt.redo_work)&&n.a.createElement(M.a,{onClick:Mn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((ft=bn.workList)===null||ft===void 0?void 0:ft.shixun_status)>1&&((jn=bn.workList)===null||jn===void 0?void 0:jn.time_status)<5&&Object(Y.s)()&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var yr,Ln,wn,Lt,Ze,Nt,Mt;if(!Object(In.e)(Q,!0))return;(yr=bn.workList)!==null&&yr!==void 0&&(Ln=yr.task_operation)!==null&&Ln!==void 0&&(wn=Ln[1])!==null&&wn!==void 0&&wn.includes("/")?Kt((Lt=bn.workList)===null||Lt===void 0||((Ze=Lt.task_operation)===null||Ze===void 0)?void 0:Ze[1]):Object(v.S)("/tasks/".concat((Nt=bn.workList)===null||Nt===void 0||((Mt=Nt.task_operation)===null||Mt===void 0)?void 0:Mt[1]))}},(fn=bn.workList)===null||fn===void 0||((Qn=fn.task_operation)===null||Qn===void 0)?void 0:Qn[0]),((qt=bn.workList)===null||qt===void 0?void 0:qt.commit_des)&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var yr;Object(v.S)("/classrooms/".concat(ce.coursesId,"/shixun_homework/").concat(ce.categoryId,"/").concat((yr=bn.workList)===null||yr===void 0?void 0:yr.id,"/commitsummary"))}},(An=bn.workList)===null||An===void 0?void 0:An.commit_des),Object(Y.c)()&&(vt==null||((Fn=vt.homework_status)===null||Fn===void 0)?void 0:Fn[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){Te.push("/classrooms/".concat(ce.coursesId,"/program_homework/").concat(ce.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(Y.c)()&&vt.publish_immediately&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){Q({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[ce.categoryId],selectArrsAll:[vt],params:ce,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(Y.c)()&&vt.end_immediately&&n.a.createElement(M.a,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){Q({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:ce,type:2,detail:!0,selectArrs:[ce.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},vt.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},vt.category&&n.a.createElement(I.a,{separator:">"},n.a.createElement(I.a.Item,null,n.a.createElement(C.a,{to:"/classrooms/".concat(vt.course_id,"/program_homework")},vt.course_name)),n.a.createElement(I.a.Item,null,n.a.createElement(C.a,{to:"/classrooms/".concat(vt.course_id,"/program_homework/").concat(vt.category.main?"":vt.category.category_id)},vt.category.category_name)),n.a.createElement(I.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[je.a.title,"mt20"].join(" ")},n.a.createElement(C.a,{to:"/classrooms/".concat(vt.course_id,"/program_homework/").concat(vt.category.main?"":vt.category.category_id)},n.a.createElement(S.a,{className:"font16 c-black"})),n.a.createElement(k.a,{title:vt.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},vt.homework_name)),n.a.createElement(v.m,{temporary:!0,status:vt.homework_status}),Object(Y.s)()&&n.a.createElement("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},n.a.createElement(M.a,{onClick:Object(m.a)(s.a.mark(function Rn(){var Yt,ft;return s.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(O.a)("/api/problems/".concat((Yt=bn.workList)===null||Yt===void 0?void 0:Yt.start_identifier,"/start.json"),{method:"get"});case 2:ft=fn.sent,ft&&(window.open("/myproblems/".concat(ft==null?void 0:ft.identifier,"?type=1")),localStorage.setItem("program_homework",[ce.coursesId,ce.categoryId]));case 4:case"end":return fn.stop()}},Rn)})),type:"primary"},(Sn=vt.homework_status)!==null&&Sn!==void 0&&Sn.includes("\u5DF2\u622A\u6B62")?"\u67E5\u770B\u4F5C\u4E1A":"\u8FDB\u5165\u7EC3\u4E60"," ")))),n.a.createElement("aside",{className:"mt30 relative ".concat(je.a.workListTabWrap)},n.a.createElement(G.a,{type:"card",defaultActiveKey:Be,activeKey:Be,tabBarExtraContent:Un(),onChange:Nn},Rt.map(function(Rn,Yt){return n.a.createElement(G.a.TabPane,{tab:Rn.name,key:Rn.id,forceRender:Rn.forceRender},Rn.compontent)})))),n.a.createElement(N,null),n.a.createElement(z.a,{courseEndTime:vt==null?void 0:vt.course_end_date}),n.a.createElement(ne.a,{courseEndTime:vt==null?void 0:vt.course_end_date}),n.a.createElement(a.a,{visible:Pn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){Gn(!1)}},n.a.createElement("p",null,"\u4E00\u3001\u7B49\u7EA7\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"1. \u7F3A\u9677\u7B49\u7EA7"),n.a.createElement("p",{style:{marginLeft:"10px"}},n.a.createElement(V.a,{dataSource:Sr,columns:[{title:"\u7B49\u7EA7",dataIndex:"live"},{title:"\u7F3A\u9677\u8BC4\u4F30\u89C4\u5219",dataIndex:"gz"},{title:"\u6F0F\u6D1E\u8BC4\u4F30\u89C4\u5219",dataIndex:"ld"},{title:"\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219",dataIndex:"gf"}],pagination:!1})),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219\u4E2D\u6570\u503C\u6765\u6E90\u4E3A\u8BA1\u7B97\u6280\u672F\u503A\u52A1\u65F6\u95F4\u5360\u5F00\u53D1\u6240\u6709\u4EE3\u7801\u6240\u9700\u8981\u7684\u65F6\u95F4\u7684\u6BD4\u4F8B\uFF08Technical Debt Ratio\uFF09"),n.a.createElement("p",{style:{marginLeft:"20px"}},"Technical Debt Ratio = \u6280\u672F\u503A\u52A1\u65F6\u95F4 / \u5F00\u53D1\u65F6\u95F4"),n.a.createElement("p",{style:{marginLeft:"20px"}},"\u6280\u672F\u503A\u52A1\u65F6\u95F4\u4E3A\u4FEE\u590D\u6240\u6709\u95EE\u9898\u6240\u9700\u8981\u7684\u65F6\u95F4\u3002"),n.a.createElement("p",null,"\u4E8C\u3001\u590D\u6742\u5EA6\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6839\u636E\u4EE3\u7801\u8DEF\u5F84\u6570\u8BA1\u7B97\u7684\u6570\u503C\uFF0C\u6BCF\u5F53\u4E00\u4E2A\u51FD\u6570\u7684\u63A7\u5236\u6D41\u5206\u53C9\u65F6\uFF0C\u590D\u6742\u5EA6\u8BA1\u6570\u5668\u5C31\u4F1A\u81EA\u589E\u4E00\u3002"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6BCF\u4E2A\u7A0B\u5E8F\u8BED\u8A00\u7684\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u590D\u6742\u5EA6\u6570\u636E\u4E0D\u540C\uFF0C\u4F46\u6BCF\u4E2A\u51FD\u6570\u7684\u6700\u5C0F\u590D\u6742\u5EA6\u4E3A1\u3002\uFF08\u7279\u5B9A\u8BED\u8A00\u7684\u8BE6\u7EC6\u6570\u636E\u7565\uFF09"),n.a.createElement("p",null,"\u4E09\u3001\u4EE3\u7801\u8D28\u91CF\u5206\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u4EE3\u7801\u8D28\u91CF\u5206 = 0.5*\u7F3A\u9677\u5206\u6570 + 0.3*\u6F0F\u6D1E\u5206\u6570 + 0.2*\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u5176\u4E2D\uFF1A"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u7F3A\u9677/\u6F0F\u6D1E/\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570\u8BA1\u7B97\u89C4\u5219\u4E3A\uFF1A100 - 100 *((100*\u5D29\u6E83\u6570 + 5*\u4E25\u91CD\u6570 + 3*\u4E3B\u8981\u6570 + 1*\u6B21\u6570\uFF09/ \u4EE3\u7801\u884C\u6570\uFF09"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u5206\u6570\u4E3A\u7A7A\u7684\u4EE3\u8868\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F\u3002")))},Br=he.default=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Sn=Bn.loading,bn=Bn.globalSetting;return{shixunHomeworks:_n,globalSetting:bn,loading:Sn.effects}})(ri)},OLES:function(Gt,he,D){"use strict";var Z=D("U8pU"),V=D("VTBJ"),U=D("Ff2n"),G=D("q1tI"),P=D("uciX"),k=D("7ixt"),K=function(m){var u=m.overlay,a=m.prefixCls,o=m.id,c=m.overlayInnerStyle;return G.createElement("div",{className:"".concat(a,"-inner"),id:o,role:"tooltip",style:c},typeof u=="function"?u():u)},I=K,r=function(m,u){var a=m.overlayClassName,o=m.trigger,c=o===void 0?["hover"]:o,s=m.mouseEnterDelay,i=s===void 0?0:s,n=m.mouseLeaveDelay,O=n===void 0?.1:n,T=m.overlayStyle,C=m.prefixCls,R=C===void 0?"rc-tooltip":C,S=m.children,v=m.onVisibleChange,E=m.afterVisibleChange,f=m.transitionName,h=m.animation,y=m.placement,g=y===void 0?"right":y,x=m.align,j=x===void 0?{}:x,B=m.destroyTooltipOnHide,A=B===void 0?!1:B,H=m.defaultVisible,F=m.getTooltipContainer,w=m.overlayInnerStyle,Y=Object(U.a)(m,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),q=Object(G.useRef)(null);Object(G.useImperativeHandle)(u,function(){return q.current});var ie=Object(V.a)({},Y);"visible"in m&&(ie.popupVisible=m.visible);var ge=function(){var Ye=m.arrowContent,ve=Ye===void 0?null:Ye,fe=m.overlay,at=m.id;return[G.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},ve),G.createElement(I,{key:"content",prefixCls:R,id:at,overlay:fe,overlayInnerStyle:w})]},Je=!1,xe=!1;if(typeof A=="boolean")Je=A;else if(A&&Object(Z.a)(A)==="object"){var ke=A.keepParent;Je=ke===!0,xe=ke===!1}return G.createElement(P.a,Object.assign({popupClassName:a,prefixCls:R,popup:ge,action:c,builtinPlacements:k.a,popupPlacement:g,ref:q,popupAlign:j,getPopupContainer:F,onPopupVisibleChange:v,afterPopupVisibleChange:E,popupTransitionName:f,popupAnimation:h,defaultPopupVisible:H,destroyPopupOnHide:Je,autoDestroy:xe,mouseLeaveDelay:O,popupStyle:T,mouseEnterDelay:i},ie),S)},M=Object(G.forwardRef)(r),_=he.a=M},OZM5:function(Gt,he,D){"use strict";D.d(he,"b",function(){return M}),D.d(he,"a",function(){return _}),D.d(he,"k",function(){return p}),D.d(he,"h",function(){return m}),D.d(he,"i",function(){return u}),D.d(he,"g",function(){return a}),D.d(he,"c",function(){return o}),D.d(he,"d",function(){return c}),D.d(he,"j",function(){return n}),D.d(he,"e",function(){return O}),D.d(he,"f",function(){return T});var Z=D("KQm4"),V=D("U8pU"),U=D("Ff2n"),G=D("q1tI"),P=D.n(G),k=D("Kwbf"),K=D("WaYH"),I=.25,r=2;function M(C,R){var S=C.slice(),v=S.indexOf(R);return v>=0&&S.splice(v,1),S}function _(C,R){var S=C.slice();return S.indexOf(R)===-1&&S.push(R),S}function p(C){return C.split("-")}function m(C,R){return"".concat(C,"-").concat(R)}function u(C){return C&&C.type&&C.type.isTreeNode}function a(C,R){var S=[C],v=R[C];function E(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(h){var y=h.key,g=h.children;S.push(y),E(g)})}return E(v.children),S}function o(C,R){var S=C.clientY,v=R.selectHandle.getBoundingClientRect(),E=v.top,f=v.bottom,h=v.height,y=Math.max(h*I,r);return S<=E+y?-1:S>=f-y?1:0}function c(C,R){if(!C)return;var S=R.multiple;return S?C.slice():C.length?[C[0]]:C}var s=function(R){return R};function i(C,R){if(!C)return[];var S=R||{},v=S.processProps,E=v===void 0?s:v,f=Array.isArray(C)?C:[C];return f.map(function(h){var y=h.children,g=Object(U.a)(h,["children"]),x=i(y,R);return P.a.createElement(K.a,Object.assign({},E(g)),x)})}function n(C){if(!C)return null;var R;if(Array.isArray(C))R={checkedKeys:C,halfCheckedKeys:void 0};else if(Object(V.a)(C)==="object")R={checkedKeys:C.checked||void 0,halfCheckedKeys:C.halfChecked||void 0};else return Object(k.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function O(C,R){var S=new Set;function v(E){if(S.has(E))return;var f=R[E];if(!f)return;S.add(E);var h=f.parent,y=f.node;if(y.disabled)return;h&&v(h.key)}return(C||[]).forEach(function(E){v(E)}),Object(Z.a)(S)}function T(C){var R={};return Object.keys(C).forEach(function(S){(S.startsWith("data-")||S.startsWith("aria-"))&&(R[S]=C[S])}),R}},Ot1p:function(Gt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("rAM+"),G=D("miYZ"),P=D("tsqr"),k=D("9og8"),K=D("tJVT"),I=D("jrin"),r=D("WmNS"),M=D.n(r),_=D("q1tI"),p=D.n(_),m=D("VrN/"),u=D.n(m),a=D("bdgK"),o=D("p77/"),c=D("Bd2K"),s=D("ELLl"),i=D("19Vz"),n=D("lZu9"),O=D("+NIl"),T=D("kSUc"),C=D("9Bee"),R=function(be){var Ke=be.value,Ot=Ke===void 0?"":Ke,rn=be.className,Dn=be.showTextOnly,bt=be.showLines,Qt=be.style,Et=Qt===void 0?{}:Qt,Ct=Object(_.useMemo)(function(){return""},[Ot]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ct}}))},S=D("0Owb"),v=D("dejd"),E=D("C+DQ"),f=D("1vsH"),h=D("m3rI"),y=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function g(be){var Ke=be.onActionCallback,Ot=be.title,rn=be.icon,Dn=be.actionName,bt=be.className,Qt=bt===void 0?"":bt,Et=be.children;function Ct(){Ke(Dn)}return p.a.createElement("a",{title:Ot,className:Qt,onClick:Ct},p.a.createElement("i",{className:"md-iconfont ".concat(rn)}),Et)}var x=function(be){var Ke=be.watch,Ot=be.showNullButton,rn=be.onActionCallback,Dn=be.fullScreen,bt=be.insertTemp,Qt=be.hidetoolBar,Et=be.uuid,Ct=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.F)("_educoder_session"),"&key=").concat(Et,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var lt=[].concat(y,[{title:"".concat(Ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Qt&&lt.map(function(de,Ae){return p.a.createElement("li",{key:Ae},de.actionName?p.a.createElement(g,Object(S.a)({},de,{onActionCallback:rn})):p.a.createElement("span",{className:"v-line"}))}),Ot?p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rn},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,bt&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(bt),onActionCallback:rn},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(g,{icon:"".concat(Dn?"icon-shrink":"icon-enlarge"),title:Dn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rn})))},j=D("M8RZ"),B=D("+L6B"),A=D("2/Rp"),H=D("y8nQ"),F=D("Vl3Y"),w=D("5NDa"),Y=D("5rEg"),q={labelCol:{span:4},wrapperCol:{span:20}},ie=function(be){var Ke=be.callback,Ot=be.onCancel;function rn(Dn){Ke(Dn)}return p.a.createElement(F.a,Object(S.a)({},q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rn}),p.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(Y.a,null)),p.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(Y.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:Ot},"\u53D6\u6D88")))},ge=D("7ahc"),Je=D("HmJG"),xe=D("BjJ7"),ke=F.a.useForm,Qe={width:280,marginRight:10},Ye={labelCol:{span:5},wrapperCol:{span:19}},ve=function(be){var Ke=be.callback,Ot=be.onCancel,rn=ke(),Dn=Object(K.a)(rn,1),bt=Dn[0];function Qt(lt){Ke(lt)}function Et(lt,de){if(lt.status===-1){P.b.error(lt.message);return}bt.setFieldsValue({src:"/api/attachments/".concat(lt.id),type:de.type})}function Ct(lt){var de=lt.target.files[0];at(de,Et)}return p.a.createElement(F.a,Object(S.a)({form:bt},Ye,{className:"upload-image-panel",onFinish:Qt}),p.a.createElement(F.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(F.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(Y.a,{style:Qe})),p.a.createElement(fe,{onFileChange:Ct}))),p.a.createElement(F.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(Y.a,{style:{width:264}})),p.a.createElement(F.a.Item,{style:{textAlign:"right"}},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:Ot},"\u53D6\u6D88")))};function fe(be){var Ke=be.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Ke}))}function at(be,Ke){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ot=new FormData;Ot.append("editormd-image-file",be),Ot.append("file_param_name","editormd-image-file"),Ot.append("byxhr","true");var rn=new window.XMLHttpRequest;rn.withCredentials=!0,rn.addEventListener("load",function(Dn){Ke(JSON.parse(Dn.target.responseText),be)},!1),rn.addEventListener("error",function(Dn){console.error(Dn)},!1),rn.open("POST","".concat(xe.a,"/api/attachments.json")),rn.send(Ot)}var Jt=D("giR+"),Ft=D("fyUT"),St=D("7Kak"),ze=D("9yH6"),gt=ze.a.Group,ct={margin:"0 8px"},jt=function(be){var Ke=be.callback,Ot=be.onCancel;function rn(Dn){Ke(Dn)}return p.a.createElement(F.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rn},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:ct},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:ct},"\u884C\u6570"),p.a.createElement(F.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Ft.a,null)),p.a.createElement("span",{style:ct},"\u5217\u6570"),p.a.createElement(F.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Ft.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:ct},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(F.a.Item,{name:"align"},p.a.createElement(gt,null,p.a.createElement(ze.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(ze.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(ze.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(ze.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:Ot},"\u53D6\u6D88")))},oe=D("ErOA"),Ne=D("7Cbv"),Ge="link",Xe="upload-image",Bt="code-block",Wt="add-table",en="------------",tt={default:en,left:":".concat(en),center:":".concat(en,":"),right:"".concat(en,":")},tn=D("9VGf"),En,We;function Fe(){}var yt=0,At=1e4,nt="\u2581",st=`
**\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 De(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,we=ye?"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"],se=(En={},Object(I.a)(En,we+"-B","bold"),Object(I.a)(En,we+"-I","italic"),En),pe=(We={},Object(I.a)(We,Ge,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(We,Bt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(We,Xe,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(We,Wt,"\u6DFB\u52A0\u8868\u683C"),We),_e=he.a=function(be){var Ke=be.defaultValue,Ot=Ke===void 0?"":Ke,rn=be.onChange,Dn=be.width,bt=Dn===void 0?"100%":Dn,Qt=be.height,Et=Qt===void 0?400:Qt,Ct=be.miniToolbar,lt=Ct===void 0?!1:Ct,de=be.isFocus,Ae=de===void 0?!1:de,kt=be.watch,dt=be.insertTemp,Zt=be.mode,un=Zt===void 0?"markdown":Zt,Le=be.id,et=Le===void 0?"markdown-editor-id":Le,mt=be.showResizeBar,Ht=mt===void 0?!1:mt,sn=be.noStorage,yn=sn===void 0?!1:sn,nr=be.showNullButton,Kn=nr===void 0?!1:nr,Cn=be.hidetoolBar,br=Cn===void 0?!1:Cn,Er=be.fullScreen,rr=Er===void 0?!1:Er,cr=be.onBlur,Pr=be.onCMBeforeChange,Kr=be.onFullScreen,hi=be.className,pn=hi===void 0?"":hi,or=be.disablePaste,mi=or===void 0?!1:or,wi=be.placeholder,ti=wi===void 0?"":wi,ni=be.values,X=ni===void 0?"":ni,L=Object(_.useState)(null),N=Object(K.a)(L,2),z=N[0],ne=N[1],J=Object(_.useState)(Ot),je=Object(K.a)(J,2),$t=je[0],In=je[1],Jn=Object(_.useState)(kt),ln=Object(K.a)(Jn,2),tr=ln[0],qn=ln[1],kr=Object(_.useState)(rr),li=Object(K.a)(kr,2),ai=li[0],Gr=li[1],Li=Object(_.useState)(""),Vi=Object(K.a)(Li,2),Dr=Vi[0],Sr=Vi[1],ri=Object(_.useState)(0),Br=Object(K.a)(ri,2),Bn=Br[0],_n=Br[1],Sn=Object(_.useState)(Et),bn=Object(K.a)(Sn,2),ur=bn[0],sr=bn[1],Q=Object(_.useState)(!1),ce=Object(K.a)(Q,2),Ce=ce[0],Te=ce[1],rt=Object(_.useRef)(Object(Ne.a)()),Re=Object(_.useRef)(!1),$e=Object(_.useRef)(),it=Object(_.useRef)(),Dt=Object(_.useRef)(),Tt=Object(_.useRef)(),Be=Object(_.useRef)(),_t=function(){var Pt=Object(k.a)(M.a.mark(function hn(){var Kt,Rt;return M.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return Rn.next=2,Object(oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:rt.current}});case 2:Rt=Rn.sent,Rt!=null&&(Kt=Rt.attachments)!==null&&Kt!==void 0&&Kt.length&&(console.log("cm:",z,it),Rt.attachments.map(function(Yt){Yt.content_type.indexOf("image")>-1?z.replaceSelection("![,](/api/attachments/".concat(Yt.id,"?type=").concat(Yt.content_type,")")):Yt.content_type.indexOf("video")>-1?z.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Yt.content_type.indexOf("pdf")>-1?z.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,'&disposition=inline" target="_blank">').concat(Yt.name,"</a>")):z.replaceSelection("[".concat(Yt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}));case 4:case"end":return Rn.stop()}},hn)}));return function(){return Pt.apply(this,arguments)}}();Object(_.useEffect)(function(){In(X),z==null||z.setValue(X)},[X]),Object(_.useEffect)(function(){Kr==null||Kr(ai)},[ai]),Object(_.useEffect)(function(){if(it.current){var Pt=u.a.fromTextArea(it.current,{mode:un,lineNumbers:!lt,lineWrapping:!0,value:Ot,autoCloseTags:!0,autoCloseBrackets:!0});Ae&&Pt.focus();function hn(Kt,Rt){if(mi){Rt.preventDefault();return}var Un=Rt.clipboardData;if(Un){var Rn=Un.types.toString(),Yt=Un.items;if(Rn==="Files"||Un.types.indexOf("Files")>-1){if(Rt.preventDefault(),un=="stex")return;try{var ft,jn=Yt[1];((ft=Yt[0])===null||ft===void 0?void 0:ft.kind)==="file"&&(jn=Yt[0]);var fn=jn.getAsFile(),Qn=fn.name.split(".").pop();at(fn,function(qt){if(qt.id){var An,Fn,vn;(fn==null||((An=fn.type)===null||An===void 0)?void 0:An.indexOf("image"))>-1?Pt.replaceSelection("![,](/api/attachments/".concat(qt.id,"?type=").concat(qt.content_type,")")):(fn==null||((Fn=fn.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Pt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,'"></video>')):(fn==null||((vn=fn.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):ae.includes(Qn)?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Pt.replaceSelection("[".concat(fn.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,"?type=").concat(qt.content_type,")"))}else(qt==null?void 0:qt.status)===401&&(document.location.href="/user/login")})}catch(qt){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Pt.on("paste",hn),Pt.on("dragleave",function(Kt,Rt){Dt.current.classList.remove("mouse-hover-md")}),Pt.on("dragover",function(Kt,Rt){Dt.current.classList.add("mouse-hover-md")}),Pt.on("drop",function(Kt,Rt){Dt.current.classList.add("mouse-hover-md");var Un;if(Un=Rt.dataTransfer.files,Un.length>0){Rt.preventDefault(),Rt.stopPropagation();for(var Rn=function(jn){var fn=Un[jn],Qn=fn.name.split(".").pop();at(fn,function(qt){if(qt.id){var An,Fn,vn;(fn==null||((An=fn.type)===null||An===void 0)?void 0:An.indexOf("image"))>-1?Pt.replaceSelection("![,](/api/attachments/".concat(qt.id,"?type=").concat(qt.content_type,")")):(fn==null||((Fn=fn.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Pt.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,'"></video>')):(fn==null||((vn=fn.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):ae.includes(Qn)?Pt.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Pt.replaceSelection("[".concat(fn.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(qt.id,"?type=").concat(qt.content_type,")"))}else(qt==null?void 0:qt.status)===401&&(document.location.href="/user/login")})},Yt=0;Yt<Un.length;Yt++)Rn(Yt)}}),ne(Pt),function(){Pt.off("paste",hn)}}},[]);var ot=Object(_.useCallback)(function(){if(Dt.current)try{}catch(Pt){console.log(Pt,"---- to set md editor body height")}},[ur,Dt,ai]);Object(_.useEffect)(function(){function Pt(){var Kt=new a.default(function(Rt){var Un=Object(U.a)(Rt),Rn;try{for(Un.s();!(Rn=Un.n()).done;){var Yt=Rn.value;(Yt.target.offsetHeight>0||Yt.target.offsetWidth>0)&&(ot(),z.setSize("100%","100%"),z.refresh())}}catch(ft){Un.e(ft)}finally{Un.f()}});return Kt.observe(it.current.parentElement),Kt}if(z){var hn=Pt();return function(){hn.unobserve(it.current.parentElement)}}},[z,ot]),Object(_.useEffect)(function(){if(z){for(var Pt=[],hn=function(){var Yt=Rt[Kt];Un=Object(K.a)(Yt,2);var ft=Un[0],jn=Un[1],fn=Object(I.a)({},ft,function(){ht(jn)});Pt.push(fn),z.addKeyMap(fn)},Kt=0,Rt=Object.entries(se);Kt<Rt.length;Kt++){var Un;hn()}return $e.current=setInterval(function(){Re.current&&_t()},4e3),function(){clearInterval($e.current);var Rn=Object(U.a)(Pt),Yt;try{for(Rn.s();!(Yt=Rn.n()).done;){var ft=Yt.value;z.removeKeyMap(ft)}}catch(jn){Rn.e(jn)}finally{Rn.f()}}}},[z]),Object(_.useEffect)(function(){rr!==ai&&Gr(rr)},[rr]),Object(tn.a)(function(){if(!yn&&Bn>0){var Pt=new Date().getTime(),hn=window.sessionStorage.getItem(et);Pt>=Bn+At&&(!hn||hn!==$t)&&(window.sessionStorage.setItem(et,$t),Te(!0))}},At),Object(_.useEffect)(function(){qn(kt)},[z,kt]),Object(_.useEffect)(function(){z&&(Ae&&z.focus())},[z,Ae]),Object(_.useEffect)(function(){if(tr&&z){var Pt=z.getScrollerElement();function hn(Kt){var Rt=Kt.target;if(Be.current){var Un=Rt.scrollTop/Rt.scrollHeight;Be.current.scrollTop=Be.current.scrollHeight*Un}}return Pt.addEventListener("scroll",hn),function(){Pt.removeEventListener("scroll",hn)}}},[z,tr]),Object(_.useEffect)(function(){if(z&&Pr){function Pt(hn,Kt){Pr(hn,Kt)}return z.on("beforeChange",Pt),function(){z.off("beforeChange",Pt)}}},[z,Pr]),Object(_.useEffect)(function(){if(z&&cr){function Pt(){cr(z.getValue())}return z.on("blur",Pt),function(){z.off("blur",Pt)}}},[z,cr]),Object(_.useEffect)(function(){if(z){function Pt(hn){var Kt=hn.getValue();In(Kt),_n(new Date().getTime()),hn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rn&&rn(Kt)}return z.on("change",Pt),function(){z.off("change",Pt)}}},[z,rn]),Object(_.useEffect)(function(){z&&(Ot==null?(z.setValue(""),In("")):Ot!==z.getValue()&&(z.setValue(Ot),In(Ot),z.setCursor(z.lineCount(),0)))},[z,Ot]);var ht=Object(_.useCallback)(function(Pt){var hn=z.getCursor(),Kt=z.getSelection(),Rt=Kt.split(`
`);switch(Pt){case"bold":return z.replaceSelection("**"+Kt+"**"),Kt===""&&z.setCursor(hn.line,hn.ch+2),z.focus();case"italic":return z.replaceSelection("*"+Kt+"*"),Kt===""&&z.setCursor(hn.line,hn.ch+1),z.focus();case"code":return z.replaceSelection("`"+Kt+"`"),Kt===""&&z.setCursor(hn.line,hn.ch+1),z.focus();case"inline-latex":return z.replaceSelection("`$$"+Kt+"$$`"),Kt===""&&z.setCursor(hn.line,hn.ch+3),z.focus();case"latex":return z.replaceSelection("```latex\n"+Kt+"\n```"),z.setCursor(hn.line+1,Kt.length+1),z.focus();case"line-break":return z.replaceSelection(`<br/>
`),z.focus();case"list-ul":return Kt===""?z.replaceSelection("- "+Kt):z.replaceSelection(Rt.map(function(Un){return Un===""?"":"- ".concat(Un)}).join(`
`)),z.focus();case"list-ol":return Kt===""?z.replaceSelection("1. "+Kt):z.replaceSelection(Rt.map(function(Un,Rn){return Un===""?"":"".concat(Rn+1,". ").concat(Un)}).join(`
`)),z.focus();case"add-null-ch":return Kt===""&&z.setCursor(hn.line,hn.ch+1),z.replaceSelection(nt),z.focus();case"inster-template-1":return Kt===""&&z.setCursor(hn.line,hn.ch),z.replaceSelection(st),z.focus();case"eraser":return z.setValue(""),z.focus();case"trigger-watch":return qn(!tr),z.focus();case"trigger-full-screen":return Gr(!ai),z.focus();case Ge:Sr(Ge);return;case Bt:Sr(Bt);return;case Xe:Sr(Xe);return;case Wt:Sr(Wt);return;default:throw new Error}},[z,tr,ai]),wt=Object(_.useCallback)(function(Pt){Sr("");switch(Dr){case Ge:var hn=Pt.title,Kt=Pt.link;return z.replaceSelection("[".concat(hn,"](").concat(Kt,")")),z.focus();case Bt:var Rt=Pt.language,Un=Pt.content;return z.replaceSelection(["```"+Rt,Un,"```"].join(`
`)),z.focus();case Xe:var Rn=Pt.src,Yt=Pt.alt;return Yt?z.replaceSelection("![ ".concat(Yt," ]( ").concat(Rn,' "').concat(Yt,'" )')):z.replaceSelection("![,](".concat(Rn,")")),z.focus();case Wt:for(var ft=Pt.row,jn=Pt.col,fn=Pt.align,Qn=`
`,qt=0;qt<ft;qt++){for(var An=[],Fn=[],vn=0;vn<jn;vn++)qt===1&&Fn.push(tt[fn]),An.push(" ");qt===1&&(Qn+="| ".concat(Fn.join(" | "),` |
`)),Qn+="| ".concat(An.join(jn===1?"":" | "),` |
`)}return z.replaceSelection(Qn+`
`),z.focus();default:throw new Error}},[z,Dr]),It=Object(_.useMemo)(function(){switch(Dr){case Ge:return p.a.createElement(ie,{callback:wt,onCancel:vt});case Bt:return p.a.createElement(ge.b,{callback:wt,onCancel:vt});case Xe:return p.a.createElement(ve,{callback:wt,onCancel:vt});case Wt:return p.a.createElement(jt,{callback:wt,onCancel:vt});default:return null}},[Dr]);function vt(){Sr("")}Object(_.useEffect)(function(){if(Tt.current){var Pt=Tt.current,hn=!1,Kt=0;function Rt(Yt){hn=!0,Kt=Yt.pageY}function Un(){hn=!1}function Rn(Yt){if(hn){var ft=Yt.pageY-Kt;ft<0&&(ft=0),ft>300&&(ft=300);var jn=Et+ft+"px";sr(jn)}}return Pt.addEventListener("mousedown",Rt),document.addEventListener("mousemove",Rn),document.addEventListener("mouseup",Un),function(){Pt.removeEventListener("mousedown",Rt),document.removeEventListener("mousemove",Rn),document.removeEventListener("mouseup",Un)}}},[z,Tt]),Object(_.useEffect)(function(){sr(Et)},[Et]);var Xt=De(bt),dn=De(ur),Pn={width:Xt,height:dn},Gn=Object(_.useMemo)(function(){if(Bn){var Pt=new Date(Bn),hn=Pt.getHours(),Kt=Pt.getMinutes(),Rt=Pt.getSeconds();return hn=hn<10?"0"+hn:hn,Kt=Kt<10?"0"+Kt:Kt,Rt=Rt<10?"0"+Rt:Rt,"".concat(hn,":").concat(Kt,":").concat(Rt)}return 0},[Bn]);function On(){window.sessionStorage.removeItem(et),Te(!1),_n(0)}function Nn(){Te(!1),_n(0),z.setValue(window.sessionStorage.getItem(et))}function Mn(Pt,hn){var Kt=z.getValue();Kt=Kt.replace(Pt,hn),In(Kt),z==null||z.setValue(Kt)}return p.a.createElement(_.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Dt},p.a.createElement("div",{className:"markdown-editor-container ".concat(pn," ").concat(tr?"on-preview":""," ").concat(lt?"mini":""," ").concat(ai?"full-screen":""),style:Pn},p.a.createElement(x,{insertTemp:dt,watch:tr,fullScreen:ai,showNullButton:Kn,onActionCallback:ht,hidetoolBar:br,uuid:rt.current,setOpenPhones:function(){Re.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:it,placeholder:ti})),tr?p.a.createElement("div",{ref:Be,className:"preview-container"},un==="stex"&&p.a.createElement(R,{value:$t}),un!=="stex"&&p.a.createElement(C.a,{edit:!0,value:$t,replaces:Mn})):null))),Ht?p.a.createElement("a",{ref:Tt,className:"editor-resize"}):null,p.a.createElement(j.a,null,pe[Dr]?p.a.createElement(V.a,{centered:!0,title:pe[Dr],visible:!0,onCancel:vt,footer:null,className:"markdown-popup-form"},It):null))}},RotF:function(Gt,he,D){Gt.exports=D("LSTS")},"SA+Z":function(Gt,he,D){var Z=D("wTVA"),V=D("EbDI"),U=D("ZhPi"),G=D("wkBT");function P(k){return Z(k)||V(k)||U(k)||G()}Gt.exports=P,Gt.exports.__esModule=!0,Gt.exports.default=Gt.exports},SJMd:function(Gt,he){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var D,Z,V,U=!1,G,P;window.PR_SHOULD_USE_CONTINUATION=!0;var k,K;(function(){var I=window,r=["break,continue,do,else,for,if,return,while"],M=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],_=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[_,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[_,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[_,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",o=[_,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",s=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],i=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],n=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[p,u,m,o,c,s,i,n],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,C="str",R="kwd",S="com",v="typ",E="lit",f="pun",h="pln",y="tag",g="dec",x="src",j="atn",B="atv",A="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(gt){for(var ct=0,jt=!1,oe=!1,Ne=0,Ge=gt.length;Ne<Ge;++Ne){var Xe=gt[Ne];if(Xe.ignoreCase)oe=!0;else if(/[a-z]/i.test(Xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){jt=!0,oe=!1;break}}var Bt={b:8,t:9,n:10,v:11,f:12,r:13};function Wt(We){var Fe=We.charCodeAt(0);if(Fe!==92)return Fe;var yt=We.charAt(1);return Fe=Bt[yt],Fe||("0"<=yt&&yt<="7"?parseInt(We.substring(1),8):yt==="u"||yt==="x"?parseInt(We.substring(2),16):We.charCodeAt(1))}function en(We){if(We<32)return(We<16?"\\x0":"\\x")+We.toString(16);var Fe=String.fromCharCode(We);return Fe==="\\"||Fe==="-"||Fe==="]"||Fe==="^"?"\\"+Fe:Fe}function tt(We){var Fe=We.substring(1,We.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),yt=[],At=Fe[0]==="^",nt=["["];At&&nt.push("^");for(var st=At?1:0,De=Fe.length;st<De;++st){var ye=Fe[st];if(/\\[bdsw]/i.test(ye))nt.push(ye);else{var we=Wt(ye),ae;st+2<De&&Fe[st+1]==="-"?(ae=Wt(Fe[st+2]),st+=2):ae=we,yt.push([we,ae]),ae<65||we>122||(ae<65||we>90||yt.push([Math.max(65,we)|32,Math.min(ae,90)|32]),ae<97||we>122||yt.push([Math.max(97,we)&~32,Math.min(ae,122)&~32]))}}yt.sort(function(be,Ke){return be[0]-Ke[0]||Ke[1]-be[1]});for(var se=[],pe=[],st=0;st<yt.length;++st){var _e=yt[st];_e[0]<=pe[1]+1?pe[1]=Math.max(pe[1],_e[1]):se.push(pe=_e)}for(var st=0;st<se.length;++st){var _e=se[st];nt.push(en(_e[0])),_e[1]>_e[0]&&(_e[1]+1>_e[0]&&nt.push("-"),nt.push(en(_e[1])))}return nt.push("]"),nt.join("")}function tn(We){for(var Fe=We.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")),yt=Fe.length,At=[],nt=0,st=0;nt<yt;++nt){var De=Fe[nt];if(De==="(")++st;else if(De.charAt(0)==="\\"){var ye=+De.substring(1);ye&&(ye<=st?At[ye]=-1:Fe[nt]=en(ye))}}for(var nt=1;nt<At.length;++nt)At[nt]===-1&&(At[nt]=++ct);for(var nt=0,st=0;nt<yt;++nt){var De=Fe[nt];if(De==="(")++st,At[st]||(Fe[nt]="(?:");else if(De.charAt(0)==="\\"){var ye=+De.substring(1);ye&&ye<=st&&(Fe[nt]="\\"+At[ye])}}for(var nt=0;nt<yt;++nt)Fe[nt]==="^"&&Fe[nt+1]!=="^"&&(Fe[nt]="");if(We.ignoreCase&&jt)for(var nt=0;nt<yt;++nt){var De=Fe[nt],we=De.charAt(0);De.length>=2&&we==="["?Fe[nt]=tt(De):we!=="\\"&&(Fe[nt]=De.replace(/[a-zA-Z]/g,function(pe){var _e=pe.charCodeAt(0);return"["+String.fromCharCode(_e&~32,_e|32)+"]"}))}return Fe.join("")}for(var En=[],Ne=0,Ge=gt.length;Ne<Ge;++Ne){var Xe=gt[Ne];if(Xe.global||Xe.multiline)throw new Error(""+Xe);En.push("(?:"+tn(Xe)+")")}return new RegExp(En.join("|"),oe?"gi":"g")}function w(gt,ct){var jt=/(?:^|\s)nocode(?:\s|$)/,oe=[],Ne=0,Ge=[],Xe=0;function Bt(Wt){var en=Wt.nodeType;if(en==1){if(jt.test(Wt.className))return;for(var tt=Wt.firstChild;tt;tt=tt.nextSibling)Bt(tt);var tn=Wt.nodeName.toLowerCase();(tn==="br"||tn==="li")&&(oe[Xe]=`
`,Ge[Xe<<1]=Ne++,Ge[Xe++<<1|1]=Wt)}else if(en==3||en==4){var En=Wt.nodeValue;En.length&&(ct?En=En.replace(/\r\n?/g,`
`):En=En.replace(/[ \t\r\n]+/g," "),oe[Xe]=En,Ge[Xe<<1]=Ne,Ne+=En.length,Ge[Xe++<<1|1]=Wt)}}return Bt(gt),{sourceCode:oe.join("").replace(/\n$/,""),spans:Ge}}function Y(gt,ct,jt,oe,Ne){if(!jt)return;var Ge={sourceNode:gt,pre:1,langExtension:null,numberLines:null,sourceCode:jt,spans:null,basePos:ct,decorations:null};oe(Ge),Ne.push.apply(Ne,Ge.decorations)}var q=/\S/;function ie(gt){for(var ct=void 0,jt=gt.firstChild;jt;jt=jt.nextSibling){var oe=jt.nodeType;ct=oe===1?ct?gt:jt:oe===3&&q.test(jt.nodeValue)?gt:ct}return ct===gt?void 0:ct}function ge(gt,ct){var jt={},oe;(function(){for(var Xe=gt.concat(ct),Bt=[],Wt={},en=0,tt=Xe.length;en<tt;++en){var tn=Xe[en],En=tn[3];if(En)for(var We=En.length;--We>=0;)jt[En.charAt(We)]=tn;var Fe=tn[1],yt=""+Fe;Wt.hasOwnProperty(yt)||(Bt.push(Fe),Wt[yt]=null)}Bt.push(/[\0-\uffff]/),oe=F(Bt)})();var Ne=ct.length,Ge=function(Xe){for(var Bt=Xe.sourceCode,Wt=Xe.basePos,en=Xe.sourceNode,tt=[Wt,h],tn=0,En=Bt.match(oe)||[],We={},Fe=0,yt=En.length;Fe<yt;++Fe){var At=En[Fe],nt=We[At],st=void 0,De;if(typeof nt=="string")De=!1;else{var ye=jt[At.charAt(0)];if(ye)st=At.match(ye[1]),nt=ye[0];else{for(var we=0;we<Ne;++we)if(ye=ct[we],st=At.match(ye[1]),st){nt=ye[0];break}st||(nt=h)}De=nt.length>=5&&nt.substring(0,5)==="lang-",De&&!(st&&typeof st[1]=="string")&&(De=!1,nt=x),De||(We[At]=nt)}var ae=tn;if(tn+=At.length,!De)tt.push(Wt+ae,nt);else{var se=st[1],pe=At.indexOf(se),_e=pe+se.length;st[2]&&(_e=At.length-st[2].length,pe=_e-se.length);var be=nt.substring(5);Y(en,Wt+ae,At.substring(0,pe),Ge,tt),Y(en,Wt+ae+pe,se,fe(be,se),tt),Y(en,Wt+ae+_e,At.substring(_e),Ge,tt)}}Xe.decorations=tt};return Ge}function Je(gt){var ct=[],jt=[];gt.tripleQuotedStrings?ct.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):gt.multiLineStrings?ct.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ct.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),gt.verbatimStrings&&jt.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var oe=gt.hashComments;oe&&(gt.cStyleComments?(oe>1?ct.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ct.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),jt.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ct.push([S,/^#[^\r\n]*/,null,"#"])),gt.cStyleComments&&(jt.push([S,/^\/\/[^\r\n]*/,null]),jt.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ne=gt.regexLiterals;if(Ne){var Ge=Ne>1?"":`
\r`,Xe=Ge?".":"[\\S\\s]",Bt="/(?=[^/*"+Ge+"])(?:[^/\\x5B\\x5C"+Ge+"]|\\x5C"+Xe+"|\\x5B(?:[^\\x5C\\x5D"+Ge+"]|\\x5C"+Xe+")*(?:\\x5D|$))+/";jt.push(["lang-regex",RegExp("^"+H+"("+Bt+")")])}var Wt=gt.types;Wt&&jt.push([v,Wt]);var en=(""+gt.keywords).replace(/^ | $/g,"");en.length&&jt.push([R,new RegExp("^(?:"+en.replace(/[\s,]+/g,"|")+")\\b"),null]),ct.push([h,/^\s+/,null,` \r
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return gt.regexLiterals&&(tt+="(?!s*/)"),jt.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[f,new RegExp(tt),null]),ge(ct,jt)}var xe=Je({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ke(gt,ct,jt){for(var oe=/(?:^|\s)nocode(?:\s|$)/,Ne=/\r\n?|\n/,Ge=gt.ownerDocument,Xe=Ge.createElement("li");gt.firstChild;)Xe.appendChild(gt.firstChild);var Bt=[Xe];function Wt(Fe){var yt=Fe.nodeType;if(yt==1&&!oe.test(Fe.className))if(Fe.nodeName==="br")en(Fe),Fe.parentNode&&Fe.parentNode.removeChild(Fe);else for(var At=Fe.firstChild;At;At=At.nextSibling)Wt(At);else if((yt==3||yt==4)&&jt){var nt=Fe.nodeValue,st=nt.match(Ne);if(st){var De=nt.substring(0,st.index);Fe.nodeValue=De;var ye=nt.substring(st.index+st[0].length);if(ye){var we=Fe.parentNode;we.insertBefore(Ge.createTextNode(ye),Fe.nextSibling)}en(Fe),De||Fe.parentNode.removeChild(Fe)}}}function en(Fe){for(;!Fe.nextSibling;)if(Fe=Fe.parentNode,!Fe)return;function yt(st,De){var ye=De?st.cloneNode(!1):st,we=st.parentNode;if(we){var ae=yt(we,1),se=st.nextSibling;ae.appendChild(ye);for(var pe=se;pe;pe=se)se=pe.nextSibling,ae.appendChild(pe)}return ye}for(var At=yt(Fe.nextSibling,0),nt;(nt=At.parentNode)&&nt.nodeType===1;)At=nt;Bt.push(At)}for(var tt=0;tt<Bt.length;++tt)Wt(Bt[tt]);ct===(ct|0)&&Bt[0].setAttribute("value",ct);var tn=Ge.createElement("ol");tn.className="linenums";for(var En=Math.max(0,ct-1|0)||0,tt=0,We=Bt.length;tt<We;++tt)Xe=Bt[tt],Xe.className="L"+(tt+En)%10,Xe.firstChild||Xe.appendChild(Ge.createTextNode("\xA0")),tn.appendChild(Xe);gt.appendChild(tn)}function Qe(gt){var ct=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ct=ct&&+ct[1]<=8;var jt=/\n/g,oe=gt.sourceCode,Ne=oe.length,Ge=0,Xe=gt.spans,Bt=Xe.length,Wt=0,en=gt.decorations,tt=en.length,tn=0;en[tt]=Ne;var En,We;for(We=En=0;We<tt;)en[We]!==en[We+2]?(en[En++]=en[We++],en[En++]=en[We++]):We+=2;for(tt=En,We=En=0;We<tt;){for(var Fe=en[We],yt=en[We+1],At=We+2;At+2<=tt&&en[At+1]===yt;)At+=2;en[En++]=Fe,en[En++]=yt,We=At}tt=en.length=En;var nt=gt.sourceNode,st="";nt&&(st=nt.style.display,nt.style.display="none");try{for(var De=null;Wt<Bt;){var ye=Xe[Wt],we=Xe[Wt+2]||Ne,ae=en[tn+2]||Ne,At=Math.min(we,ae),se=Xe[Wt+1],pe;if(se.nodeType!==1&&(pe=oe.substring(Ge,At))){ct&&(pe=pe.replace(jt,"\r")),se.nodeValue=pe;var _e=se.ownerDocument,be=_e.createElement("span");be.className=en[tn+1];var Ke=se.parentNode;Ke.replaceChild(be,se),be.appendChild(se),Ge<we&&(Xe[Wt+1]=se=_e.createTextNode(oe.substring(At,we)),Ke.insertBefore(se,be.nextSibling))}Ge=At,Ge>=we&&(Wt+=2),Ge>=ae&&(tn+=2)}}finally{nt&&(nt.style.display=st)}}var Ye={};function ve(gt,ct){for(var jt=ct.length;--jt>=0;){var oe=ct[jt];Ye.hasOwnProperty(oe)?I.console&&console.warn("cannot override language handler %s",oe):Ye[oe]=gt}}function fe(gt,ct){return gt&&Ye.hasOwnProperty(gt)||(gt=/^\s*</.test(ct)?"default-markup":"default-code"),Ye[gt]}ve(xe,["default-code"]),ve(ge([],[[h,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ve(ge([[h,/^[\s]+/,null,` \r
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[y,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[f,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ve(ge([],[[B,/^[\s\S]+/]]),["uq.val"]),ve(Je({keywords:p,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),ve(Je({keywords:"null,true,false"}),["json"]),ve(Je({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),ve(Je({keywords:m,cStyleComments:!0}),["java"]),ve(Je({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve(Je({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve(Je({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(Je({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(Je({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve(Je({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(ge([],[[C,/^[\s\S]+/]]),["regex"]);function at(gt){var ct=gt.langExtension;try{var jt=w(gt.sourceNode,gt.pre),oe=jt.sourceCode;gt.sourceCode=oe,gt.spans=jt.spans,gt.basePos=0,fe(ct,oe)(gt),Qe(gt)}catch(Ne){I.console&&console.log(Ne&&Ne.stack||Ne)}}function Jt(gt,ct,jt){var oe=jt||!1,Ne=ct||null,Ge=document.createElement("div");Ge.innerHTML="<pre>"+gt+"</pre>",Ge=Ge.firstChild,oe&&ke(Ge,oe,!0);var Xe={langExtension:Ne,numberLines:oe,sourceNode:Ge,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return at(Xe),Ge.innerHTML}function Ft(gt,ct){var jt=ct||document.body,oe=jt.ownerDocument||document;function Ne(ye){return jt.getElementsByTagName(ye)}for(var Ge=[Ne("pre"),Ne("code"),Ne("xmp")],Xe=[],Bt=0;Bt<Ge.length;++Bt)for(var Wt=0,en=Ge[Bt].length;Wt<en;++Wt)Xe.push(Ge[Bt][Wt]);Ge=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var tn=0,En=/\blang(?:uage)?-([\w.]+)(?!\S)/,We=/\bprettyprint\b/,Fe=/\bprettyprinted\b/,yt=/pre|xmp/i,At=/^code$/i,nt=/^(?:pre|code|xmp)$/i,st={};function De(){for(var ye=I.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;tn<Xe.length&&tt.now()<ye;tn++){for(var we=Xe[tn],ae=st,se=we;se=se.previousSibling;){var pe=se.nodeType,_e=(pe===7||pe===8)&&se.nodeValue;if(_e?!/^\??prettify\b/.test(_e):pe!==3||/\S/.test(se.nodeValue))break;if(_e){ae={},_e.replace(/\b(\w+)=([\w:.%+-]+)/g,function(kt,dt,Zt){ae[dt]=Zt});break}}var be=we.className;if((ae!==st||We.test(be))&&!Fe.test(be)){for(var Ke=!1,Ot=we.parentNode;Ot;Ot=Ot.parentNode){var rn=Ot.tagName;if(nt.test(rn)&&Ot.className&&We.test(Ot.className)){Ke=!0;break}}if(!Ke){we.className+=" prettyprinted";var Dn=ae.lang;if(!Dn){Dn=be.match(En);var bt;!Dn&&(bt=ie(we))&&At.test(bt.tagName)&&(Dn=bt.className.match(En)),Dn&&(Dn=Dn[1])}var Qt;if(yt.test(we.tagName))Qt=1;else{var Et=we.currentStyle,Ct=oe.defaultView,lt=Et?Et.whiteSpace:Ct&&Ct.getComputedStyle?Ct.getComputedStyle(we,null).getPropertyValue("white-space"):0;Qt=lt&&lt.substring(0,3)==="pre"}var de=ae.linenums;(de=de==="true"||+de)||(de=be.match(/\blinenums\b(?::(\d+))?/),de=de?de[1]&&de[1].length?+de[1]:!0:!1),de&&ke(we,de,Qt);var Ae={langExtension:Dn,sourceNode:we,numberLines:de,pre:Qt,sourceCode:null,basePos:null,spans:null,decorations:null};at(Ae)}}}tn<Xe.length?I.setTimeout(De,250):typeof gt=="function"&&gt()}De()}var St=I.PR={createSimpleLexer:ge,registerLangHandler:ve,sourceDecorator:Je,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:B,PR_COMMENT:S,PR_DECLARATION:g,PR_KEYWORD:R,PR_LITERAL:E,PR_NOCODE:A,PR_PLAIN:h,PR_PUNCTUATION:f,PR_SOURCE:x,PR_STRING:C,PR_TAG:y,PR_TYPE:v,prettyPrintOne:U?I.prettyPrintOne=Jt:k=Jt,prettyPrint:K=U?I.prettyPrint=Ft:K=Ft},ze=I.define;typeof ze=="function"&&ze.amd&&ze("google-code-prettify",[],function(){return St})})()},T7RX:function(Gt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("k1fw"),G=D("miYZ"),P=D("tsqr"),k=D("9og8"),K=D("PpiC"),I=D("WmNS"),r=D.n(I),M=D("q1tI"),_=D.n(M),p=D("ErOA"),m=D("Ty5D"),u=D("9kvl"),a=function(c){var s=c.shixunHomeworks,i=c.dispatch,n=Object(K.a)(c,["shixunHomeworks","dispatch"]),O=Object(m.i)();return _.a.createElement(V.a,{centered:!0,title:"\u63D0\u793A",visible:s.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(k.a)(r.a.mark(function T(){var C;return r.a.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=2,Object(p.a)("/api/myshixuns/".concat(s.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:O.coursesId}});case 2:C=S.sent,C.shixun_identifier&&(P.b.success("\u64CD\u4F5C\u6210\u529F"),i({type:"shixunHomeworks/setActionTabs",payload:{}}),i({type:"shixunHomeworks/getWorkList",payload:Object(U.a)({},s.actionTabs.params)}));case 4:case"end":return S.stop()}},T)})),onCancel:function(){i({type:"shixunHomeworks/setActionTabs",payload:{}})}},_.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),_.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};he.a=Object(u.a)(function(o){var c=o.shixunHomeworks;return{shixunHomeworks:c}})(a)},T8No:function(Gt,he,D){"use strict";D.d(he,"a",function(){return K}),D.d(he,"e",function(){return I}),D.d(he,"c",function(){return f}),D.d(he,"b",function(){return h}),D.d(he,"d",function(){return y}),D.d(he,"f",function(){return j});var Z=D("MNsG"),V=D("N0LK"),U=D("Cg/j");let G=Z.k||"";const P=new Map;P.set("false",!1),P.set("true",!0),P.set("isMac",Z.f),P.set("isLinux",Z.d),P.set("isWindows",Z.i),P.set("isWeb",Z.h),P.set("isMacNative",Z.f&&!Z.h),P.set("isEdge",G.indexOf("Edg/")>=0),P.set("isFirefox",G.indexOf("Firefox")>=0),P.set("isChrome",G.indexOf("Chrome")>=0),P.set("isSafari",G.indexOf("Safari")>=0);const k=Object.prototype.hasOwnProperty;class K{static has(A){return p.create(A)}static equals(A,H){return m.create(A,H)}static regex(A,H){return C.create(A,H)}static not(A){return c.create(A)}static and(...A){return v.create(A,null)}static or(...A){return E.create(A,null,!0)}static deserialize(A,H=!1){return A?this._deserializeOrExpression(A,H):void 0}static _deserializeOrExpression(A,H){let F=A.split("||");return E.create(F.map(w=>this._deserializeAndExpression(w,H)),null,!0)}static _deserializeAndExpression(A,H){let F=A.split("&&");return v.create(F.map(w=>this._deserializeOne(w,H)),null)}static _deserializeOne(A,H){if(A=A.trim(),A.indexOf("!=")>=0){let F=A.split("!=");return o.create(F[0].trim(),this._deserializeValue(F[1],H))}if(A.indexOf("==")>=0){let F=A.split("==");return m.create(F[0].trim(),this._deserializeValue(F[1],H))}if(A.indexOf("=~")>=0){let F=A.split("=~");return C.create(F[0].trim(),this._deserializeRegexValue(F[1],H))}if(A.indexOf(" in ")>=0){let F=A.split(" in ");return u.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const F=A.split(">=");return n.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const F=A.split(">");return i.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const F=A.split("<=");return T.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const F=A.split("<");return O.create(F[0].trim(),F[1].trim())}return/^\!\s*/.test(A)?c.create(A.substr(1).trim()):p.create(A)}static _deserializeValue(A,H){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let F=/^'([^']*)'$/.exec(A);return F?F[1].trim():A}static _deserializeRegexValue(A,H){if(Object(V.C)(A)){if(H)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let F=A.indexOf("/"),w=A.lastIndexOf("/");if(F===w||F<0){if(H)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let Y=A.slice(F+1,w),q=A[w+1]==="i"?"i":"";try{return new RegExp(Y,q)}catch(ie){if(H)throw new Error(`bad regexp-value '${A}', parse error: ${ie}`);return console.warn(`bad regexp-value '${A}', parse error: ${ie}`),null}}}function I(A,H){const F=A?A.substituteConstants():void 0,w=H?H.substituteConstants():void 0;return!F&&!w?!0:!F||!w?!1:F.equals(w)}function r(A,H){return A.cmp(H)}class M{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return _.INSTANCE}}M.INSTANCE=new M;class _{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return M.INSTANCE}}_.INSTANCE=new _;class p{constructor(A,H){this.key=A,this.negated=H,this.type=2}static create(A,H=null){const F=P.get(A);return typeof F=="boolean"?F?_.INSTANCE:M.INSTANCE:new p(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=P.get(this.key);return typeof A=="boolean"?A?_.INSTANCE:M.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this)),this.negated}}class m{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=4}static create(A,H,F=null){if(typeof H=="boolean")return H?p.create(A,F):c.create(A,F);const w=P.get(A);if(typeof w=="boolean"){const Y=w?"true":"false";return H===Y?_.INSTANCE:M.INSTANCE}return new m(A,H,F)}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=P.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?_.INSTANCE:M.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class u{constructor(A,H){this.key=A,this.valueKey=H,this.type=10,this.negated=null}static create(A,H){return new u(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const H=A.getValue(this.valueKey),F=A.getValue(this.key);return Array.isArray(H)?H.indexOf(F)>=0:typeof F=="string"&&typeof H=="object"&&H!==null?k.call(H,F):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(A){this._actual=A,this.type=11}static create(A){return new a(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class o{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=5}static create(A,H,F=null){if(typeof H=="boolean")return H?c.create(A,F):p.create(A,F);const w=P.get(A);if(typeof w=="boolean"){const Y=w?"true":"false";return H===Y?M.INSTANCE:_.INSTANCE}return new o(A,H,F)}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=P.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?M.INSTANCE:_.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class c{constructor(A,H){this.key=A,this.negated=H,this.type=3}static create(A,H=null){const F=P.get(A);return typeof F=="boolean"?F?M.INSTANCE:_.INSTANCE:new c(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=P.get(this.key);return typeof A=="boolean"?A?M.INSTANCE:_.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function s(A,H){if(typeof A=="string"){const F=parseFloat(A);isNaN(F)||(A=F)}return typeof A=="string"||typeof A=="number"?H(A):M.INSTANCE}class i{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=12}static create(A,H,F=null){return s(H,w=>new i(A,w,F))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class n{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=13}static create(A,H,F=null){return s(H,w=>new n(A,w,F))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=14}static create(A,H,F=null){return s(H,w=>new O(A,w,F))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class T{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=15}static create(A,H,F=null){return s(H,w=>new T(A,w,F))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class C{constructor(A,H){this.key=A,this.regexp=H,this.type=7,this.negated=null}static create(A,H){return new C(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const H=this.regexp?this.regexp.source:"",F=A.regexp?A.regexp.source:"";return H<F?-1:H>F?1:0}equals(A){if(A.type===this.type){const H=this.regexp?this.regexp.source:"",F=A.regexp?A.regexp.source:"";return this.key===A.key&&H===F}return!1}substituteConstants(){return this}evaluate(A){let H=A.getValue(this.key);return this.regexp?this.regexp.test(H):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(A){this._actual=A,this.type=8}static create(A){return new R(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function S(A){let H=null;for(let F=0,w=A.length;F<w;F++){const Y=A[F].substituteConstants();if(A[F]!==Y&&H===null){H=[];for(let q=0;q<F;q++)H[q]=A[q]}H!==null&&(H[F]=Y)}return H===null?A:H}class v{constructor(A,H){this.expr=A,this.negated=H,this.type=6}static create(A,H){return v._normalizeArr(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,F=this.expr.length;H<F;H++){const w=r(this.expr[H],A.expr[H]);if(w!==0)return w}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:v.create(A,this.negated)}evaluate(A){for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].evaluate(A))return!1;return!0}static _normalizeArr(A,H){const F=[];let w=!1;for(const Y of A){if(!Y)continue;if(Y.type===1){w=!0;continue}if(Y.type===0)return M.INSTANCE;if(Y.type===6){F.push(...Y.expr);continue}F.push(Y)}if(F.length===0&&w)return _.INSTANCE;if(F.length===0)return;if(F.length===1)return F[0];F.sort(r);for(let Y=1;Y<F.length;Y++)F[Y-1].equals(F[Y])&&(F.splice(Y,1),Y--);if(F.length===1)return F[0];for(;F.length>1;){const Y=F[F.length-1];if(Y.type!==9)break;F.pop();const q=F.pop(),ie=F.length===0,ge=E.create(Y.expr.map(Je=>v.create([Je,q],null)),null,ie);ge&&(F.push(ge),F.sort(r))}return F.length===1?F[0]:new v(F,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){const A=[];for(let H of this.expr)A.push(H.negate());this.negated=E.create(A,this,!0)}return this.negated}}class E{constructor(A,H){this.expr=A,this.negated=H,this.type=9}static create(A,H,F){return E._normalizeArr(A,H,F)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,F=this.expr.length;H<F;H++){const w=r(this.expr[H],A.expr[H]);if(w!==0)return w}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:E.create(A,this.negated,!1)}evaluate(A){for(let H=0,F=this.expr.length;H<F;H++)if(this.expr[H].evaluate(A))return!0;return!1}static _normalizeArr(A,H,F){let w=[],Y=!1;if(A){for(let q=0,ie=A.length;q<ie;q++){const ge=A[q];if(!ge)continue;if(ge.type===0){Y=!0;continue}if(ge.type===1)return _.INSTANCE;if(ge.type===9){w=w.concat(ge.expr);continue}w.push(ge)}if(w.length===0&&Y)return M.INSTANCE;w.sort(r)}if(w.length===0)return;if(w.length===1)return w[0];for(let q=1;q<w.length;q++)w[q-1].equals(w[q])&&(w.splice(q,1),q--);if(w.length===1)return w[0];if(F){for(let q=0;q<w.length;q++)for(let ie=q+1;ie<w.length;ie++)j(w[q],w[ie])&&(w.splice(ie,1),ie--);if(w.length===1)return w[0]}return new E(w,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){let A=[];for(let H of this.expr)A.push(H.negate());for(;A.length>1;){const H=A.shift(),F=A.shift(),w=[];for(const q of B(H))for(const ie of B(F))w.push(v.create([q,ie],null));const Y=A.length===0;A.unshift(E.create(w,null,Y))}this.negated=A[0]}return this.negated}}class f extends p{constructor(A,H,F){super(A,null);this._defaultValue=H,typeof F=="object"?f._info.push(Object.assign(Object.assign({},F),{key:A})):F!==!0&&f._info.push({key:A,description:F,type:H!=null?typeof H:void 0})}static all(){return f._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return m.create(this.key,A)}}f._info=[];const h=Object(U.c)("contextKeyService"),y="setContext";function g(A,H){return A<H?-1:A>H?1:0}function x(A,H,F,w){return A<F?-1:A>F?1:H<w?-1:H>w?1:0}function j(A,H){if(H.type===6&&A.type!==9&&A.type!==6){for(const Y of H.expr)if(A.equals(Y))return!0}const F=A.negate(),w=B(F).concat(B(H));w.sort(r);for(let Y=0;Y<w.length;Y++){const q=w[Y],ie=q.negate();for(let ge=Y+1;ge<w.length;ge++){const Je=w[ge];if(ie.equals(Je))return!0}}return!1}function B(A){return A.type===9?A.expr:[A]}},TXwP:function(Gt,he,D){var Z,V;(function(){var U;(function(){"use strict";var P=[,,function(r){function M(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}M.prototype.clone_empty=function(){var m=new M(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},M.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},M.prototype.has_match=function(m){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},M.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var u=m.lastIndexOf(`
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},M.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function _(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}_.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},_.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},_.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,u){this.__indent_cache=new _(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new M(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return m!==`
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(m)!==0&&o.item(-1)!==u){this.__lines.splice(a+1,0,new M(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},,,,function(r){function M(m,u){this.raw_options=_(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}M.prototype._get_array=function(m,u){var a=this.raw_options[m],o=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},M.prototype._get_boolean=function(m,u){var a=this.raw_options[m],o=a===void 0?!!u:!!a;return o},M.prototype._get_characters=function(m,u){var a=this.raw_options[m],o=u||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),o},M.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var o=parseInt(a,10);return isNaN(o)&&(o=u),o},M.prototype._get_selection=function(m,u,a){var o=this._get_selection_list(m,u,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o[0]},M.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var o=this._get_array(m,a);if(!this._is_valid_selection(o,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o},M.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function _(m,u){var a={};m=p(m);var o;for(o in m)o!==u&&(a[o]=m[o]);if(u&&m[u])for(o in m[u])a[o]=m[u][o];return a}function p(m){var u={},a;for(a in m){var o=a.replace(/-/g,"_");u[o]=m[a]}return u}r.exports.Options=M,r.exports.normalizeOpts=p,r.exports.mergeOpts=_},,function(r){var M=RegExp.prototype.hasOwnProperty("sticky");function _(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},_.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},_.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(M&&p.sticky)&&(u.index!==m&&(u=null)),u},_.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},_.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},_.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},_.prototype.read=function(p,m,u){var a="",o;return p&&(o=this.match(p),o&&(a+=o[0])),m&&(o||!p)&&(a+=this.readUntil(m,u)),a},_.prototype.readUntil=function(p,m){var u="",a=this.__position;p.lastIndex=this.__position;var o=p.exec(this.__input);return o?(a=o.index,m&&(a+=o[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},_.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},_.prototype.get_regexp=function(p,m){var u=null,a="g";return m&&M&&(a="y"),typeof p=="string"&&p!==""?u=new RegExp(p,a):p&&(u=new RegExp(p.source,a)),u},_.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},_.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=_},,,,,function(r){function M(_,p){_=typeof _=="string"?_:_.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+p,"g")}M.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(_);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(_);return p},M.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=M},,function(r,M,_){var p=_(16).Beautifier,m=_(17).Options;function u(a,o){var c=new p(a,o);return c.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new m}},function(r,M,_){var p=_(17).Options,m=_(2).Output,u=_(8).InputScanner,a=_(13).Directives,o=new a(/\/\*/,/\*\//),c=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=/\s/,n=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(R,S){this._source_text=R||"",this._options=new p(S),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}C.prototype.eatString=function(R){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return S},C.prototype.eatWhitespace=function(R){for(var S=i.test(this._input.peek()),v=0;i.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
`&&((v===0||v<this._options.max_preserve_newlines)&&(v++,this._output.add_new_line(!0)));return S},C.prototype.foundNestedPseudoClass=function(){for(var R=0,S=1,v=this._input.peek(S);v;){if(v==="{")return!0;if(v==="(")R+=1;else if(v===")"){if(R===0)return!1;R-=1}else if(v===";"||v==="}")return!1;S++,v=this._input.peek(S)}return!1},C.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},C.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,S=this._options.eol;S==="auto"&&(S=`
`,R&&c.test(R||"")&&(S=R.match(c)[0])),R=R.replace(s,`
`);var v=R.match(/^[\t ]*/)[0];this._output=new m(this._options,v),this._input=new u(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,f=!1,h=!1,y=!1,g=!1,x=!1,j=!1,B=this._ch,A=!1,H,F,w;H=this._input.read(n),F=H!=="",w=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(O),q=o.get_directives(Y);q&&q.ignore==="start"&&(Y+=o.readIgnored(this._input)),this.print_string(Y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(F),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s$/,""),this.print_string(ie),this._output.space_before_token=!0),ie=ie.replace(/\s$/,""),ie==="extend"?g=!0:ie==="import"&&(x=!0),ie in this.NESTED_AT_RULE?(this._nestedLevel+=1,ie in this.CONDITIONAL_GROUP_RULE&&(y=!0)):!f&&E===0&&ie.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(F),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),y?(y=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(w==="("?this._output.space_before_token=!1:w!==","&&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(),w==="{"&&this._output.trim(!0),x=!1,g=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ge=0;ge<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ge++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ge])){A=!0;break}(f||y)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&E===0?(this.print_string(":"),h||(h=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Je=w==='"'||w==="'";this.preserveSingleSpace(Je||F),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,E===0?(h&&(this.outdent(),h=!1),g=!1,x=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),E++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),E&&(E--,this.outdent()));else{var xe=!1;this._input.lookBack("with")&&(xe=!0),this.preserveSingleSpace(F||xe),this.print_string(this._ch),h&&w==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||j)&&E===0&&!x&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&E===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(F),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ke=w==='"'||w==="'";this.preserveSingleSpace(ke||F),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&A&&this._output.add_new_line()}var Qe=this._output.get_code(S);return Qe},r.exports.Beautifier=C},function(r,M,_){var p=_(6).Options;function m(u){p.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var c=0;c<o.length;c++)o[c]!=="expand"?this.brace_style="collapse":this.brace_style=o[c]}m.prototype=new p,r.exports.Options=m}],k={};function K(r){var M=k[r];if(M!==void 0)return M.exports;var _=k[r]={exports:{}};return P[r](_,_.exports,K),_.exports}var I=K(15);U=I})();var G=U;!(Z=[],V=function(){return{css_beautify:G}}.apply(he,Z),V!==void 0&&(Gt.exports=V))})()},Vhoy:function(Gt,he,D){"use strict";D.d(he,"d",function(){return G}),D.d(he,"e",function(){return P}),D.d(he,"c",function(){return k}),D.d(he,"b",function(){return K}),D.d(he,"a",function(){return I});var Z=D("MI8n");class V{constructor(){this._icons=new Map,this._onDidRegister=new Z.b}add(r){const M=this._icons.get(r.id);M?r.description?M.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const U=new V,G=U;function P(r,M){return new K(r,M)}function k(r){return r?r.replace(/\$\((.*?)\)/g,(M,_)=>` ${_} `).trim():""}class K{constructor(r,M,_){this.id=r,this.definition=M,this.description=_,U.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var I;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const M=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function _(u){if(u instanceof K)return["codicon","codicon-"+u.id];const a=M.exec(u.id);if(!a)return _(K.error);let[,o,c]=a;const s=["codicon","codicon-"+o];return c&&s.push("codicon-modifier-"+c.substr(1)),s}r.asClassNameArray=_;function p(u){return _(u).join(" ")}r.asClassName=p;function m(u){return"."+_(u).join(".")}r.asCSSSelector=m})(I||(I={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(Gt,he,D){(function(Z,V){Gt.exports=V()})(this,function(){"use strict";var Z=navigator.userAgent,V=navigator.platform,U=/gecko\/\d/i.test(Z),G=/MSIE \d/.test(Z),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),k=/Edge\/(\d+)/.exec(Z),K=G||P||k,I=K&&(G?document.documentMode||6:+(k||P)[1]),r=!k&&/WebKit\//.test(Z),M=r&&/Qt\/\d+\.\d+/.test(Z),_=!k&&/Chrome\//.test(Z),p=/Opera\//.test(Z),m=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),a=/PhantomJS/.test(Z),o=!k&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),c=/Android/.test(Z),s=o||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),i=o||/Mac/.test(V),n=/\bCrOS\b/.test(Z),O=/win/i.test(V),T=p&&Z.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(p=!1,r=!0);var C=i&&(M||p&&(T==null||T<12.11)),R=U||K&&I>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var d=e.className,l=S(t).exec(d);if(l){var b=d.slice(l.index+l[0].length);e.className=d.slice(0,l.index)+(b?l[1]+b:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return E(e).appendChild(t)}function h(e,t,d,l){var b=document.createElement(e);if(d&&(b.className=d),l&&(b.style.cssText=l),typeof t=="string")b.appendChild(document.createTextNode(t));else if(t)for(var W=0;W<t.length;++W)b.appendChild(t[W]);return b}function y(e,t,d,l){var b=h(e,t,d,l);return b.setAttribute("role","presentation"),b}var g;document.createRange?g=function(e,t,d,l){var b=document.createRange();return b.setEnd(l||e,d),b.setStart(e,t),b}:g=function(e,t,d){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(b){return l}return l.collapse(!0),l.moveEnd("character",d),l.moveStart("character",t),l};function x(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function j(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var d=e.className;S(t).test(d)||(e.className+=(d?" ":"")+t)}function A(e,t){for(var d=e.split(" "),l=0;l<d.length;l++)d[l]&&!S(d[l]).test(t)&&(t+=" "+d[l]);return t}var H=function(e){e.select()};o?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(H=function(e){try{e.select()}catch(t){}});function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function w(e,t,d){t||(t={});for(var l in e)e.hasOwnProperty(l)&&(d!==!1||!t.hasOwnProperty(l))&&(t[l]=e[l]);return t}function Y(e,t,d,l,b){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var W=l||0,$=b||0;;){var ee=e.indexOf(" ",W);if(ee<0||ee>=t)return $+(t-W);$+=ee-W,$+=d-$%d,W=ee+1}}var q=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},q.prototype.set=function(e,t){this.f=t;var d=+new Date+e;(!this.id||d<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=d)};function ie(e,t){for(var d=0;d<e.length;++d)if(e[d]==t)return d;return-1}var ge=50,Je={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},ke={origin:"*mouse"},Qe={origin:"+move"};function Ye(e,t,d){for(var l=0,b=0;;){var W=e.indexOf(" ",l);W==-1&&(W=e.length);var $=W-l;if(W==e.length||b+$>=t)return l+Math.min($,t-b);if(b+=W-l,b+=d-b%d,l=W+1,b>=t)return l}}var ve=[""];function fe(e){for(;ve.length<=e;)ve.push(at(ve)+" ");return ve[e]}function at(e){return e[e.length-1]}function Jt(e,t){for(var d=[],l=0;l<e.length;l++)d[l]=t(e[l],l);return d}function Ft(e,t,d){for(var l=0,b=d(t);l<e.length&&d(e[l])<=b;)l++;e.splice(l,0,t)}function St(){}function ze(e,t){var d;return Object.create?d=Object.create(e):(St.prototype=e,d=new St),t&&w(t,d),d}var gt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ct(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||gt.test(e))}function jt(e,t){return t?t.source.indexOf("\\w")>-1&&ct(e)?!0:t.test(e):ct(e)}function oe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ne=/[\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 Ge(e){return e.charCodeAt(0)>=768&&Ne.test(e)}function Xe(e,t,d){for(;(d<0?t>0:t<e.length)&&Ge(e.charAt(t));)t+=d;return t}function Bt(e,t,d){for(var l=t>d?-1:1;;){if(t==d)return t;var b=(t+d)/2,W=l<0?Math.ceil(b):Math.floor(b);if(W==t)return e(W)?t:d;e(W)?d=W:t=W+l}}function Wt(e,t,d,l){if(!e)return l(t,d,"ltr",0);for(var b=!1,W=0;W<e.length;++W){var $=e[W];($.from<d&&$.to>t||t==d&&$.to==t)&&(l(Math.max($.from,t),Math.min($.to,d),$.level==1?"rtl":"ltr",W),b=!0)}b||l(t,d,"ltr")}var en=null;function tt(e,t,d){var l;en=null;for(var b=0;b<e.length;++b){var W=e[b];if(W.from<t&&W.to>t)return b;W.to==t&&(W.from!=W.to&&d=="before"?l=b:en=b),W.from==t&&(W.from!=W.to&&d!="before"?l=b:en=b)}return l!=null?l:en}var tn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function d(le){return le<=247?e.charAt(le):1424<=le&&le<=1524?"R":1536<=le&&le<=1785?t.charAt(le-1536):1774<=le&&le<=2220?"r":8192<=le&&le<=8203?"w":le==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,b=/[stwN]/,W=/[LRr]/,$=/[Lb1n]/,ee=/[1n]/;function te(le,Me,He){this.level=le,this.from=Me,this.to=He}return function(le,Me){var He=Me=="ltr"?"L":"R";if(le.length==0||Me=="ltr"&&!l.test(le))return!1;for(var xt=le.length,pt=[],on=0;on<xt;++on)pt.push(d(le.charCodeAt(on)));for(var Tn=0,Wn=He;Tn<xt;++Tn){var Yn=pt[Tn];Yn=="m"?pt[Tn]=Wn:Wn=Yn}for(var Zn=0,Xn=He;Zn<xt;++Zn){var ar=pt[Zn];ar=="1"&&Xn=="r"?pt[Zn]="n":W.test(ar)&&(Xn=ar,ar=="r"&&(pt[Zn]="R"))}for(var Tr=1,_r=pt[0];Tr<xt-1;++Tr){var Fr=pt[Tr];Fr=="+"&&_r=="1"&&pt[Tr+1]=="1"?pt[Tr]="1":Fr==","&&_r==pt[Tr+1]&&(_r=="1"||_r=="n")&&(pt[Tr]=_r),_r=Fr}for(var pi=0;pi<xt;++pi){var Hi=pt[pi];if(Hi==",")pt[pi]="N";else if(Hi=="%"){var Ci=void 0;for(Ci=pi+1;Ci<xt&&pt[Ci]=="%";++Ci);for(var oa=pi&&pt[pi-1]=="!"||Ci<xt&&pt[Ci]=="1"?"1":"N",na=pi;na<Ci;++na)pt[na]=oa;pi=Ci-1}}for(var ki=0,ra=He;ki<xt;++ki){var zi=pt[ki];ra=="L"&&zi=="1"?pt[ki]="L":W.test(zi)&&(ra=zi)}for(var Ui=0;Ui<xt;++Ui)if(b.test(pt[Ui])){var Ii=void 0;for(Ii=Ui+1;Ii<xt&&b.test(pt[Ii]);++Ii);for(var Oi=(Ui?pt[Ui-1]:He)=="L",ia=(Ii<xt?pt[Ii]:He)=="L",So=Oi==ia?Oi?"L":"R":He,to=Ui;to<Ii;++to)pt[to]=So;Ui=Ii-1}for(var Xi=[],Pa,Wi=0;Wi<xt;)if($.test(pt[Wi])){var ms=Wi;for(++Wi;Wi<xt&&$.test(pt[Wi]);++Wi);Xi.push(new te(0,ms,Wi))}else{var Ga=Wi,lo=Xi.length,uo=Me=="rtl"?1:0;for(++Wi;Wi<xt&&pt[Wi]!="L";++Wi);for(var Ji=Ga;Ji<Wi;)if(ee.test(pt[Ji])){Ga<Ji&&(Xi.splice(lo,0,new te(1,Ga,Ji)),lo+=uo);var Oo=Ji;for(++Ji;Ji<Wi&&ee.test(pt[Ji]);++Ji);Xi.splice(lo,0,new te(2,Oo,Ji)),lo+=uo,Ga=Ji}else++Ji;Ga<Wi&&Xi.splice(lo,0,new te(1,Ga,Wi))}return Me=="ltr"&&(Xi[0].level==1&&(Pa=le.match(/^\s+/))&&(Xi[0].from=Pa[0].length,Xi.unshift(new te(0,0,Pa[0].length))),at(Xi).level==1&&(Pa=le.match(/\s+$/))&&(at(Xi).to-=Pa[0].length,Xi.push(new te(0,xt-Pa[0].length,xt)))),Me=="rtl"?Xi.reverse():Xi}}();function En(e,t){var d=e.order;return d==null&&(d=e.order=tn(e.text,t)),d}var We=[],Fe=function(e,t,d){if(e.addEventListener)e.addEventListener(t,d,!1);else if(e.attachEvent)e.attachEvent("on"+t,d);else{var l=e._handlers||(e._handlers={});l[t]=(l[t]||We).concat(d)}};function yt(e,t){return e._handlers&&e._handlers[t]||We}function At(e,t,d){if(e.removeEventListener)e.removeEventListener(t,d,!1);else if(e.detachEvent)e.detachEvent("on"+t,d);else{var l=e._handlers,b=l&&l[t];if(b){var W=ie(b,d);W>-1&&(l[t]=b.slice(0,W).concat(b.slice(W+1)))}}}function nt(e,t){var d=yt(e,t);if(!d.length)return;for(var l=Array.prototype.slice.call(arguments,2),b=0;b<d.length;++b)d[b].apply(null,l)}function st(e,t,d){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),nt(e,d||t.type,e,t),pe(t)||t.codemirrorIgnore}function De(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var d=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<t.length;++l)ie(d,t[l])==-1&&d.push(t[l])}function ye(e,t){return yt(e,t).length>0}function we(e){e.prototype.on=function(t,d){Fe(this,t,d)},e.prototype.off=function(t,d){At(this,t,d)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function _e(e){ae(e),se(e)}function be(e){return e.target||e.srcElement}function Ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var Ot=function(){if(K&&I<9)return!1;var e=h("div");return"draggable"in e||"dragDrop"in e}(),rn;function Dn(e){if(rn==null){var t=h("span","\u200B");f(e,h("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(rn=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&I<8))}var d=rn?h("span","\u200B"):h("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return d.setAttribute("cm-text",""),d}var bt;function Qt(e){if(bt!=null)return bt;var t=f(e,document.createTextNode("A\u062EA")),d=g(t,0,1).getBoundingClientRect(),l=g(t,1,2).getBoundingClientRect();return E(e),!d||d.left==d.right?!1:bt=l.right-d.right<3}var Et=`
b`.split(/\n/).length!=3?function(e){for(var t=0,d=[],l=e.length;t<=l;){var b=e.indexOf(`
`,t);b==-1&&(b=e.length);var W=e.slice(t,e.charAt(b-1)=="\r"?b-1:b),$=W.indexOf("\r");$!=-1?(d.push(W.slice(0,$)),t+=$+1):(d.push(W),t=b+1)}return d}:function(e){return e.split(/\r\n?|\n/)},Ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(d){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},lt=function(){var e=h("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),de=null;function Ae(e){if(de!=null)return de;var t=f(e,h("span","x")),d=t.getBoundingClientRect(),l=g(t,0,1).getBoundingClientRect();return de=Math.abs(d.left-l.left)>1}var kt={},dt={};function Zt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),kt[e]=t}function un(e,t){dt[e]=t}function Le(e){if(typeof e=="string"&&dt.hasOwnProperty(e))e=dt[e];else if(e&&typeof e.name=="string"&&dt.hasOwnProperty(e.name)){var t=dt[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 Le("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Le("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function et(e,t){t=Le(t);var d=kt[t.name];if(!d)return et(e,"text/plain");var l=d(e,t);if(mt.hasOwnProperty(t.name)){var b=mt[t.name];for(var W in b){if(!b.hasOwnProperty(W))continue;l.hasOwnProperty(W)&&(l["_"+W]=l[W]),l[W]=b[W]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)l[$]=t.modeProps[$];return l}var mt={};function Ht(e,t){var d=mt.hasOwnProperty(e)?mt[e]:mt[e]={};w(t,d)}function sn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var d={};for(var l in t){var b=t[l];b instanceof Array&&(b=b.concat([])),d[l]=b}return d}function yn(e,t){for(var d;e.innerMode&&!(d=e.innerMode(t),!d||d.mode==e);)t=d.state,e=d.mode;return d||{mode:e,state:t}}function nr(e,t,d){return e.startState?e.startState(t,d):!0}var Kn=function(e,t,d){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=d};Kn.prototype.eol=function(){return this.pos>=this.string.length},Kn.prototype.sol=function(){return this.pos==this.lineStart},Kn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Kn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Kn.prototype.eat=function(e){var t=this.string.charAt(this.pos),d;if(typeof e=="string"?d=t==e:d=t&&(e.test?e.test(t):e(t)),d)return++this.pos,t},Kn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Kn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Kn.prototype.skipToEnd=function(){this.pos=this.string.length},Kn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Kn.prototype.backUp=function(e){this.pos-=e},Kn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Kn.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Kn.prototype.match=function(e,t,d){if(typeof e=="string"){var l=function($){return d?$.toLowerCase():$},b=this.string.substr(this.pos,e.length);if(l(b)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var W=this.string.slice(this.pos).match(e);return W&&W.index>0?null:(W&&t!==!1&&(this.pos+=W[0].length),W)}},Kn.prototype.current=function(){return this.string.slice(this.start,this.pos)},Kn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Kn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Kn.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 d=e;!d.lines;)for(var l=0;;++l){var b=d.children[l],W=b.chunkSize();if(t<W){d=b;break}t-=W}return d.lines[t]}function br(e,t,d){var l=[],b=t.line;return e.iter(t.line,d.line+1,function(W){var $=W.text;b==d.line&&($=$.slice(0,d.ch)),b==t.line&&($=$.slice(t.ch)),l.push($),++b}),l}function Er(e,t,d){var l=[];return e.iter(t,d,function(b){l.push(b.text)}),l}function rr(e,t){var d=t-e.height;if(d)for(var l=e;l;l=l.parent)l.height+=d}function cr(e){if(e.parent==null)return null;for(var t=e.parent,d=ie(t.lines,e),l=t.parent;l;t=l,l=l.parent)for(var b=0;!(l.children[b]==t);++b)d+=l.children[b].chunkSize();return d+t.first}function Pr(e,t){var d=e.first;e:do{for(var l=0;l<e.children.length;++l){var b=e.children[l],W=b.height;if(t<W){e=b;continue e}t-=W,d+=b.chunkSize()}return d}while(!e.lines);for(var $=0;$<e.lines.length;++$){var ee=e.lines[$],te=ee.height;if(t<te)break;t-=te}return d+$}function Kr(e,t){return t>=e.first&&t<e.first+e.size}function hi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function pn(e,t,d){if(d===void 0&&(d=null),!(this instanceof pn))return new pn(e,t,d);this.line=e,this.ch=t,this.sticky=d}function or(e,t){return e.line-t.line||e.ch-t.ch}function mi(e,t){return e.sticky==t.sticky&&or(e,t)==0}function wi(e){return pn(e.line,e.ch)}function ti(e,t){return or(e,t)<0?t:e}function ni(e,t){return or(e,t)<0?e:t}function X(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function L(e,t){if(t.line<e.first)return pn(e.first,0);var d=e.first+e.size-1;return t.line>d?pn(d,Cn(e,d).text.length):N(t,Cn(e,t.line).text.length)}function N(e,t){var d=e.ch;return d==null||d>t?pn(e.line,t):d<0?pn(e.line,0):e}function z(e,t){for(var d=[],l=0;l<t.length;l++)d[l]=L(e,t[l]);return d}var ne=function(e,t){this.state=e,this.lookAhead=t},J=function(e,t,d,l){this.state=t,this.doc=e,this.line=d,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};J.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},J.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},J.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},J.fromSaved=function(e,t,d){return t instanceof ne?new J(e,sn(e.mode,t.state),d,t.lookAhead):new J(e,sn(e.mode,t),d)},J.prototype.save=function(e){var t=e!==!1?sn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ne(t,this.maxLookAhead):t};function je(e,t,d,l){var b=[e.state.modeGen],W={};ai(e,t.text,e.doc.mode,d,function(le,Me){return b.push(le,Me)},W,l);for(var $=d.state,ee=function(le){d.baseTokens=b;var Me=e.state.overlays[le],He=1,xt=0;d.state=!0,ai(e,t.text,Me.mode,d,function(pt,on){for(var Tn=He;xt<pt;){var Wn=b[He];Wn>pt&&b.splice(He,1,pt,b[He+1],Wn),He+=2,xt=Math.min(pt,Wn)}if(!on)return;if(Me.opaque)b.splice(Tn,He-Tn,pt,"overlay "+on),He=Tn+2;else for(;Tn<He;Tn+=2){var Yn=b[Tn+1];b[Tn+1]=(Yn?Yn+" ":"")+"overlay "+on}},W),d.state=$,d.baseTokens=null,d.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)ee(te);return{styles:b,classes:W.bgClass||W.textClass?W:null}}function $t(e,t,d){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=In(e,cr(t)),b=t.text.length>e.options.maxHighlightLength&&sn(e.doc.mode,l.state),W=je(e,t,l);b&&(l.state=b),t.stateAfter=l.save(!b),t.styles=W.styles,W.classes?t.styleClasses=W.classes:t.styleClasses&&(t.styleClasses=null),d===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function In(e,t,d){var l=e.doc,b=e.display;if(!l.mode.startState)return new J(l,!0,t);var W=Gr(e,t,d),$=W>l.first&&Cn(l,W-1).stateAfter,ee=$?J.fromSaved(l,$,W):new J(l,nr(l.mode),W);return l.iter(W,t,function(te){Jn(e,te.text,ee);var le=ee.line;te.stateAfter=le==t-1||le%5==0||le>=b.viewFrom&&le<b.viewTo?ee.save():null,ee.nextLine()}),d&&(l.modeFrontier=ee.line),ee}function Jn(e,t,d,l){var b=e.doc.mode,W=new Kn(t,e.options.tabSize,d);for(W.start=W.pos=l||0,t==""&&ln(b,d.state);!W.eol();)tr(b,W,d.state),W.start=W.pos}function ln(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var d=yn(e,t);if(d.mode.blankLine)return d.mode.blankLine(d.state)}function tr(e,t,d,l){for(var b=0;b<10;b++){l&&(l[0]=yn(e,d).mode);var W=e.token(t,d);if(t.pos>t.start)return W}throw new Error("Mode "+e.name+" failed to advance stream.")}var qn=function(e,t,d){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=d};function kr(e,t,d,l){var b=e.doc,W=b.mode,$;t=L(b,t);var ee=Cn(b,t.line),te=In(e,t.line,d),le=new Kn(ee.text,e.options.tabSize,te),Me;for(l&&(Me=[]);(l||le.pos<t.ch)&&!le.eol();)le.start=le.pos,$=tr(W,le,te.state),l&&Me.push(new qn(le,$,sn(b.mode,te.state)));return l?Me:new qn(le,$,te.state)}function li(e,t){if(e)for(;;){var d=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!d)break;e=e.slice(0,d.index)+e.slice(d.index+d[0].length);var l=d[1]?"bgClass":"textClass";t[l]==null?t[l]=d[2]:new RegExp("(?:^|\\s)"+d[2]+"(?:$|\\s)").test(t[l])||(t[l]+=" "+d[2])}return e}function ai(e,t,d,l,b,W,$){var ee=d.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var te=0,le=null,Me=new Kn(t,e.options.tabSize,l),He,xt=e.options.addModeClass&&[null];for(t==""&&li(ln(d,l.state),W);!Me.eol();){if(Me.pos>e.options.maxHighlightLength?(ee=!1,$&&Jn(e,t,l,Me.pos),Me.pos=t.length,He=null):He=li(tr(d,Me,l.state,xt),W),xt){var pt=xt[0].name;pt&&(He="m-"+(He?pt+" "+He:pt))}if(!ee||le!=He){for(;te<Me.start;)te=Math.min(Me.start,te+5e3),b(te,le);le=He}Me.start=Me.pos}for(;te<Me.pos;){var on=Math.min(Me.pos,te+5e3);b(on,le),te=on}}function Gr(e,t,d){for(var l,b,W=e.doc,$=d?-1:t-(e.doc.mode.innerMode?1e3:100),ee=t;ee>$;--ee){if(ee<=W.first)return W.first;var te=Cn(W,ee-1),le=te.stateAfter;if(le&&(!d||ee+(le instanceof ne?le.lookAhead:0)<=W.modeFrontier))return ee;var Me=Y(te.text,null,e.options.tabSize);(b==null||l>Me)&&(b=ee-1,l=Me)}return b}function Li(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var d=e.first,l=t-1;l>d;l--){var b=Cn(e,l).stateAfter;if(b&&(!(b instanceof ne)||l+b.lookAhead<t)){d=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,d)}var Vi=!1,Dr=!1;function Sr(){Vi=!0}function ri(){Dr=!0}function Br(e,t,d){this.marker=e,this.from=t,this.to=d}function Bn(e,t){if(e)for(var d=0;d<e.length;++d){var l=e[d];if(l.marker==t)return l}}function _n(e,t){for(var d,l=0;l<e.length;++l)e[l]!=t&&(d||(d=[])).push(e[l]);return d}function Sn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function bn(e,t,d){var l;if(e)for(var b=0;b<e.length;++b){var W=e[b],$=W.marker,ee=W.from==null||($.inclusiveLeft?W.from<=t:W.from<t);if(ee||W.from==t&&$.type=="bookmark"&&(!d||!W.marker.insertLeft)){var te=W.to==null||($.inclusiveRight?W.to>=t:W.to>t);(l||(l=[])).push(new Br($,W.from,te?null:W.to))}}return l}function ur(e,t,d){var l;if(e)for(var b=0;b<e.length;++b){var W=e[b],$=W.marker,ee=W.to==null||($.inclusiveRight?W.to>=t:W.to>t);if(ee||W.from==t&&$.type=="bookmark"&&(!d||W.marker.insertLeft)){var te=W.from==null||($.inclusiveLeft?W.from<=t:W.from<t);(l||(l=[])).push(new Br($,te?null:W.from-t,W.to==null?null:W.to-t))}}return l}function sr(e,t){if(t.full)return null;var d=Kr(e,t.from.line)&&Cn(e,t.from.line).markedSpans,l=Kr(e,t.to.line)&&Cn(e,t.to.line).markedSpans;if(!d&&!l)return null;var b=t.from.ch,W=t.to.ch,$=or(t.from,t.to)==0,ee=bn(d,b,$),te=ur(l,W,$),le=t.text.length==1,Me=at(t.text).length+(le?b:0);if(ee)for(var He=0;He<ee.length;++He){var xt=ee[He];if(xt.to==null){var pt=Bn(te,xt.marker);pt?le&&(xt.to=pt.to==null?null:pt.to+Me):xt.to=b}}if(te)for(var on=0;on<te.length;++on){var Tn=te[on];if(Tn.to!=null&&(Tn.to+=Me),Tn.from==null){var Wn=Bn(ee,Tn.marker);Wn||(Tn.from=Me,le&&(ee||(ee=[])).push(Tn))}else Tn.from+=Me,le&&(ee||(ee=[])).push(Tn)}ee&&(ee=Q(ee)),te&&te!=ee&&(te=Q(te));var Yn=[ee];if(!le){var Zn=t.text.length-2,Xn;if(Zn>0&&ee)for(var ar=0;ar<ee.length;++ar)ee[ar].to==null&&(Xn||(Xn=[])).push(new Br(ee[ar].marker,null,null));for(var Tr=0;Tr<Zn;++Tr)Yn.push(Xn);Yn.push(te)}return Yn}function Q(e){for(var t=0;t<e.length;++t){var d=e[t];d.from!=null&&d.from==d.to&&d.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ce(e,t,d){var l=null;if(e.iter(t.line,d.line+1,function(pt){if(pt.markedSpans)for(var on=0;on<pt.markedSpans.length;++on){var Tn=pt.markedSpans[on].marker;Tn.readOnly&&(!l||ie(l,Tn)==-1)&&(l||(l=[])).push(Tn)}}),!l)return null;for(var b=[{from:t,to:d}],W=0;W<l.length;++W)for(var $=l[W],ee=$.find(0),te=0;te<b.length;++te){var le=b[te];if(or(le.to,ee.from)<0||or(le.from,ee.to)>0)continue;var Me=[te,1],He=or(le.from,ee.from),xt=or(le.to,ee.to);(He<0||!$.inclusiveLeft&&!He)&&Me.push({from:le.from,to:ee.from}),(xt>0||!$.inclusiveRight&&!xt)&&Me.push({from:ee.to,to:le.to}),b.splice.apply(b,Me),te+=Me.length-3}return b}function Ce(e){var t=e.markedSpans;if(!t)return;for(var d=0;d<t.length;++d)t[d].marker.detachLine(e);e.markedSpans=null}function Te(e,t){if(!t)return;for(var d=0;d<t.length;++d)t[d].marker.attachLine(e);e.markedSpans=t}function rt(e){return e.inclusiveLeft?-1:0}function Re(e){return e.inclusiveRight?1:0}function $e(e,t){var d=e.lines.length-t.lines.length;if(d!=0)return d;var l=e.find(),b=t.find(),W=or(l.from,b.from)||rt(e)-rt(t);if(W)return-W;var $=or(l.to,b.to)||Re(e)-Re(t);return $||t.id-e.id}function it(e,t){var d=Dr&&e.markedSpans,l;if(d)for(var b=void 0,W=0;W<d.length;++W)b=d[W],b.marker.collapsed&&(t?b.from:b.to)==null&&(!l||$e(l,b.marker)<0)&&(l=b.marker);return l}function Dt(e){return it(e,!0)}function Tt(e){return it(e,!1)}function Be(e,t){var d=Dr&&e.markedSpans,l;if(d)for(var b=0;b<d.length;++b){var W=d[b];W.marker.collapsed&&(W.from==null||W.from<t)&&(W.to==null||W.to>t)&&(!l||$e(l,W.marker)<0)&&(l=W.marker)}return l}function _t(e,t,d,l,b){var W=Cn(e,t),$=Dr&&W.markedSpans;if($)for(var ee=0;ee<$.length;++ee){var te=$[ee];if(!te.marker.collapsed)continue;var le=te.marker.find(0),Me=or(le.from,d)||rt(te.marker)-rt(b),He=or(le.to,l)||Re(te.marker)-Re(b);if(Me>=0&&He<=0||Me<=0&&He>=0)continue;if(Me<=0&&(te.marker.inclusiveRight&&b.inclusiveLeft?or(le.to,d)>=0:or(le.to,d)>0)||Me>=0&&(te.marker.inclusiveRight&&b.inclusiveLeft?or(le.from,l)<=0:or(le.from,l)<0))return!0}}function ot(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function ht(e){for(var t;t=Tt(e);)e=t.find(1,!0).line;return e}function wt(e){for(var t,d;t=Tt(e);)e=t.find(1,!0).line,(d||(d=[])).push(e);return d}function It(e,t){var d=Cn(e,t),l=ot(d);return d==l?t:cr(l)}function vt(e,t){if(t>e.lastLine())return t;var d=Cn(e,t),l;if(!Xt(e,d))return t;for(;l=Tt(d);)d=l.find(1,!0).line;return cr(d)+1}function Xt(e,t){var d=Dr&&t.markedSpans;if(d)for(var l=void 0,b=0;b<d.length;++b){if(l=d[b],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&dn(e,t,l))return!0}}function dn(e,t,d){if(d.to==null){var l=d.marker.find(1,!0);return dn(e,l.line,Bn(l.line.markedSpans,d.marker))}if(d.marker.inclusiveRight&&d.to==t.text.length)return!0;for(var b=void 0,W=0;W<t.markedSpans.length;++W)if(b=t.markedSpans[W],b.marker.collapsed&&!b.marker.widgetNode&&b.from==d.to&&(b.to==null||b.to!=d.from)&&(b.marker.inclusiveLeft||d.marker.inclusiveRight)&&dn(e,t,b))return!0}function Pn(e){e=ot(e);for(var t=0,d=e.parent,l=0;l<d.lines.length;++l){var b=d.lines[l];if(b==e)break;t+=b.height}for(var W=d.parent;W;d=W,W=d.parent)for(var $=0;$<W.children.length;++$){var ee=W.children[$];if(ee==d)break;t+=ee.height}return t}function Gn(e){if(e.height==0)return 0;for(var t=e.text.length,d,l=e;d=Dt(l);){var b=d.find(0,!0);l=b.from.line,t+=b.from.ch-b.to.ch}for(l=e;d=Tt(l);){var W=d.find(0,!0);t-=l.text.length-W.from.ch,l=W.to.line,t+=l.text.length-W.to.ch}return t}function On(e){var t=e.display,d=e.doc;t.maxLine=Cn(d,d.first),t.maxLineLength=Gn(t.maxLine),t.maxLineChanged=!0,d.iter(function(l){var b=Gn(l);b>t.maxLineLength&&(t.maxLineLength=b,t.maxLine=l)})}var Nn=function(e,t,d){this.text=e,Te(this,t),this.height=d?d(this):1};Nn.prototype.lineNo=function(){return cr(this)},we(Nn);function Mn(e,t,d,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ce(e),Te(e,d);var b=l?l(e):1;b!=e.height&&rr(e,b)}function Pt(e){e.parent=null,Ce(e)}var hn={},Kt={};function Rt(e,t){if(!e||/^\s*$/.test(e))return null;var d=t.addModeClass?Kt:hn;return d[e]||(d[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,t){var d=y("span",null,null,r?"padding-right: .1px":null),l={pre:y("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var b=0;b<=(t.rest?t.rest.length:0);b++){var W=b?t.rest[b-1]:t.line,$=void 0;l.pos=0,l.addToken=Yt,Qt(e.display.measure)&&($=En(W,e.doc.direction))&&(l.addToken=jn(l.addToken,$)),l.map=[];var ee=t!=e.display.externalMeasured&&cr(W);Qn(W,l,$t(e,W,ee)),W.styleClasses&&(W.styleClasses.bgClass&&(l.bgClass=A(W.styleClasses.bgClass,l.bgClass||"")),W.styleClasses.textClass&&(l.textClass=A(W.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Dn(e.display.measure))),b==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var te=l.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return nt(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=A(l.pre.className,l.textClass||"")),l}function Rn(e){var t=h("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yt(e,t,d,l,b,W,$){if(!t)return;var ee=e.splitSpaces?ft(t,e.trailingSpace):t,te=e.cm.state.specialChars,le=!1,Me;if(!te.test(t))e.col+=t.length,Me=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,Me),K&&I<9&&(le=!0),e.pos+=t.length;else{Me=document.createDocumentFragment();for(var He=0;;){te.lastIndex=He;var xt=te.exec(t),pt=xt?xt.index-He:t.length-He;if(pt){var on=document.createTextNode(ee.slice(He,He+pt));K&&I<9?Me.appendChild(h("span",[on])):Me.appendChild(on),e.map.push(e.pos,e.pos+pt,on),e.col+=pt,e.pos+=pt}if(!xt)break;He+=pt+1;var Tn=void 0;if(xt[0]==" "){var Wn=e.cm.options.tabSize,Yn=Wn-e.col%Wn;Tn=Me.appendChild(h("span",fe(Yn),"cm-tab")),Tn.setAttribute("role","presentation"),Tn.setAttribute("cm-text"," "),e.col+=Yn}else xt[0]=="\r"||xt[0]==`
`?(Tn=Me.appendChild(h("span",xt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Tn.setAttribute("cm-text",xt[0]),e.col+=1):(Tn=e.cm.options.specialCharPlaceholder(xt[0]),Tn.setAttribute("cm-text",xt[0]),K&&I<9?Me.appendChild(h("span",[Tn])):Me.appendChild(Tn),e.col+=1);e.map.push(e.pos,e.pos+1,Tn),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,d||l||b||le||W||$){var Zn=d||"";l&&(Zn+=l),b&&(Zn+=b);var Xn=h("span",[Me],Zn,W);if($)for(var ar in $)$.hasOwnProperty(ar)&&ar!="style"&&ar!="class"&&Xn.setAttribute(ar,$[ar]);return e.content.appendChild(Xn)}e.content.appendChild(Me)}function ft(e,t){if(e.length>1&&!/ /.test(e))return e;for(var d=t,l="",b=0;b<e.length;b++){var W=e.charAt(b);W==" "&&d&&(b==e.length-1||e.charCodeAt(b+1)==32)&&(W="\xA0"),l+=W,d=W==" "}return l}function jn(e,t){return function(d,l,b,W,$,ee,te){b=b?b+" cm-force-border":"cm-force-border";for(var le=d.pos,Me=le+l.length;;){for(var He=void 0,xt=0;xt<t.length&&!(He=t[xt],He.to>le&&He.from<=le);xt++);if(He.to>=Me)return e(d,l,b,W,$,ee,te);e(d,l.slice(0,He.to-le),b,W,null,ee,te),W=null,l=l.slice(He.to-le),le=He.to}}}function fn(e,t,d,l){var b=!l&&d.widgetNode;b&&e.map.push(e.pos,e.pos+t,b),!l&&e.cm.display.input.needsContentAttribute&&(b||(b=e.content.appendChild(document.createElement("span"))),b.setAttribute("cm-marker",d.id)),b&&(e.cm.display.input.setUneditable(b),e.content.appendChild(b)),e.pos+=t,e.trailingSpace=!1}function Qn(e,t,d){var l=e.markedSpans,b=e.text,W=0;if(!l){for(var $=1;$<d.length;$+=2)t.addToken(t,b.slice(W,W=d[$]),Rt(d[$+1],t.cm.options));return}for(var ee=b.length,te=0,le=1,Me="",He,xt,pt=0,on,Tn,Wn,Yn,Zn;;){if(pt==te){on=Tn=Wn=xt="",Zn=null,Yn=null,pt=Infinity;for(var Xn=[],ar=void 0,Tr=0;Tr<l.length;++Tr){var _r=l[Tr],Fr=_r.marker;if(Fr.type=="bookmark"&&_r.from==te&&Fr.widgetNode)Xn.push(Fr);else if(_r.from<=te&&(_r.to==null||_r.to>te||Fr.collapsed&&_r.to==te&&_r.from==te)){if(_r.to!=null&&_r.to!=te&&pt>_r.to&&(pt=_r.to,Tn=""),Fr.className&&(on+=" "+Fr.className),Fr.css&&(xt=(xt?xt+";":"")+Fr.css),Fr.startStyle&&_r.from==te&&(Wn+=" "+Fr.startStyle),Fr.endStyle&&_r.to==pt&&(ar||(ar=[])).push(Fr.endStyle,_r.to),Fr.title&&((Zn||(Zn={})).title=Fr.title),Fr.attributes)for(var pi in Fr.attributes)(Zn||(Zn={}))[pi]=Fr.attributes[pi];Fr.collapsed&&(!Yn||$e(Yn.marker,Fr)<0)&&(Yn=_r)}else _r.from>te&&pt>_r.from&&(pt=_r.from)}if(ar)for(var Hi=0;Hi<ar.length;Hi+=2)ar[Hi+1]==pt&&(Tn+=" "+ar[Hi]);if(!Yn||Yn.from==te)for(var Ci=0;Ci<Xn.length;++Ci)fn(t,0,Xn[Ci]);if(Yn&&(Yn.from||0)==te){if(fn(t,(Yn.to==null?ee+1:Yn.to)-te,Yn.marker,Yn.from==null),Yn.to==null)return;Yn.to==te&&(Yn=!1)}}if(te>=ee)break;for(var oa=Math.min(ee,pt);;){if(Me){var na=te+Me.length;if(!Yn){var ki=na>oa?Me.slice(0,oa-te):Me;t.addToken(t,ki,He?He+on:on,Wn,te+ki.length==pt?Tn:"",xt,Zn)}if(na>=oa){Me=Me.slice(oa-te),te=oa;break}te=na,Wn=""}Me=b.slice(W,W=d[le++]),He=Rt(d[le++],t.cm.options)}}}function qt(e,t,d){this.line=t,this.rest=wt(t),this.size=this.rest?cr(at(this.rest))-d+1:1,this.node=this.text=null,this.hidden=Xt(e,t)}function An(e,t,d){for(var l=[],b,W=t;W<d;W=b){var $=new qt(e.doc,Cn(e.doc,W),W);b=W+$.size,l.push($)}return l}var Fn=null;function vn(e){Fn?Fn.ops.push(e):e.ownsGroup=Fn={ops:[e],delayedCallbacks:[]}}function yr(e){var t=e.delayedCallbacks,d=0;do{for(;d<t.length;d++)t[d].call(null);for(var l=0;l<e.ops.length;l++){var b=e.ops[l];if(b.cursorActivityHandlers)for(;b.cursorActivityCalled<b.cursorActivityHandlers.length;)b.cursorActivityHandlers[b.cursorActivityCalled++].call(null,b.cm)}}while(d<t.length)}function Ln(e,t){var d=e.ownsGroup;if(!d)return;try{yr(d)}finally{Fn=null,t(d)}}var wn=null;function Lt(e,t){var d=yt(e,t);if(!d.length)return;var l=Array.prototype.slice.call(arguments,2),b;Fn?b=Fn.delayedCallbacks:wn?b=wn:(b=wn=[],setTimeout(Ze,0));for(var W=function(ee){b.push(function(){return d[ee].apply(null,l)})},$=0;$<d.length;++$)W($)}function Ze(){var e=wn;wn=null;for(var t=0;t<e.length;++t)e[t]()}function Nt(e,t,d,l){for(var b=0;b<t.changes.length;b++){var W=t.changes[b];W=="text"?kn(e,t):W=="gutter"?er(e,t,d,l):W=="class"?lr(e,t):W=="widget"&&Rr(e,t,l)}t.changes=null}function Mt(e){return e.node==e.text&&(e.node=h("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&I<8&&(e.node.style.zIndex=2)),e.node}function cn(e,t){var d=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(d&&(d+=" CodeMirror-linebackground"),t.background)d?t.background.className=d:(t.background.parentNode.removeChild(t.background),t.background=null);else if(d){var l=Mt(t);t.background=l.insertBefore(h("div",null,d),l.firstChild),e.display.input.setUneditable(t.background)}}function zn(e,t){var d=e.display.externalMeasured;return d&&d.line==t.line?(e.display.externalMeasured=null,t.measure=d.measure,d.built):Un(e,t)}function kn(e,t){var d=t.text.className,l=zn(e,t);t.text==t.node&&(t.node=l.pre),t.text.parentNode.replaceChild(l.pre,t.text),t.text=l.pre,l.bgClass!=t.bgClass||l.textClass!=t.textClass?(t.bgClass=l.bgClass,t.textClass=l.textClass,lr(e,t)):d&&(t.text.className=d)}function lr(e,t){cn(e,t),t.line.wrapClass?Mt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var d=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=d||""}function er(e,t,d,l){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var b=Mt(t);t.gutterBackground=h("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),b.insertBefore(t.gutterBackground,t.text)}var W=t.line.gutterMarkers;if(e.options.lineNumbers||W){var $=Mt(t),ee=t.gutter=h("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),$.insertBefore(ee,t.text),t.line.gutterClass&&(ee.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!W||!W["CodeMirror-linenumbers"])&&(t.lineNumber=ee.appendChild(h("div",hi(e.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),W)for(var te=0;te<e.display.gutterSpecs.length;++te){var le=e.display.gutterSpecs[te].className,Me=W.hasOwnProperty(le)&&W[le];Me&&ee.appendChild(h("div",[Me],"CodeMirror-gutter-elt","left: "+l.gutterLeft[le]+"px; width: "+l.gutterWidth[le]+"px"))}}}function Rr(e,t,d){t.alignable&&(t.alignable=null);for(var l=S("CodeMirror-linewidget"),b=t.node.firstChild,W=void 0;b;b=W)W=b.nextSibling,l.test(b.className)&&t.node.removeChild(b);xr(e,t,d)}function mr(e,t,d,l){var b=zn(e,t);return t.text=t.node=b.pre,b.bgClass&&(t.bgClass=b.bgClass),b.textClass&&(t.textClass=b.textClass),lr(e,t),er(e,t,d,l),xr(e,t,l),t.node}function xr(e,t,d){if(Zr(e,t.line,t,d,!0),t.rest)for(var l=0;l<t.rest.length;l++)Zr(e,t.rest[l],t,d,!1)}function Zr(e,t,d,l,b){if(!t.widgets)return;for(var W=Mt(d),$=0,ee=t.widgets;$<ee.length;++$){var te=ee[$],le=h("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||le.setAttribute("cm-ignore-events","true"),Yr(te,le,d,l),e.display.input.setUneditable(le),b&&te.above?W.insertBefore(le,d.gutter||d.text):W.appendChild(le),Lt(te,"redraw")}}function Yr(e,t,d,l){if(e.noHScroll){(d.alignable||(d.alignable=[])).push(t);var b=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(b-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=b+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function Jr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var d="position: relative;";e.coverGutter&&(d+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(d+="width: "+t.display.wrapper.clientWidth+"px;"),f(t.display.measure,h("div",[e.node],null,d))}return e.height=e.node.parentNode.offsetHeight}function vi(e,t){for(var d=be(t);d!=e.wrapper;d=d.parentNode)if(!d||d.nodeType==1&&d.getAttribute("cm-ignore-events")=="true"||d.parentNode==e.sizer&&d!=e.mover)return!0}function _i(e){return e.lineSpace.offsetTop}function Ee(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ue(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,h("pre","x","CodeMirror-line-like")),d=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,l={left:parseInt(d.paddingLeft),right:parseInt(d.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Ve(e){return ge-e.display.nativeBarWidth}function Se(e){return e.display.scroller.clientWidth-Ve(e)-e.display.barWidth}function re(e){return e.display.scroller.clientHeight-Ve(e)-e.display.barHeight}function me(e,t,d){var l=e.options.lineWrapping,b=l&&Se(e);if(!t.measure.heights||l&&t.measure.width!=b){var W=t.measure.heights=[];if(l){t.measure.width=b;for(var $=t.text.firstChild.getClientRects(),ee=0;ee<$.length-1;ee++){var te=$[ee],le=$[ee+1];Math.abs(te.bottom-le.bottom)>2&&W.push((te.bottom+le.top)/2-d.top)}}W.push(d.bottom-d.top)}}function ue(e,t,d){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==t)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var b=0;b<e.rest.length;b++)if(cr(e.rest[b])>d)return{map:e.measure.maps[b],cache:e.measure.caches[b],before:!0}}function Oe(e,t){t=ot(t);var d=cr(t),l=e.display.externalMeasured=new qt(e.doc,t,d);l.lineN=d;var b=l.built=Un(e,l);return l.text=b.pre,f(e.display.lineMeasure,b.pre),l}function Pe(e,t,d,l){return ut(e,Ie(e,t),d,l)}function qe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ui(e,t)];var d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size)return d}function Ie(e,t){var d=cr(t),l=qe(e,d);l&&!l.text?l=null:l&&l.changes&&(Nt(e,l,d,vr(e)),e.curOp.forceUpdate=!0),l||(l=Oe(e,t));var b=ue(l,t,d);return{line:t,view:l,rect:null,map:b.map,cache:b.cache,before:b.before,hasHeights:!1}}function ut(e,t,d,l,b){t.before&&(d=-1);var W=d+(l||""),$;return t.cache.hasOwnProperty(W)?$=t.cache[W]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(me(e,t.view,t.rect),t.hasHeights=!0),$=Hn(e,t,d,l),$.bogus||(t.cache[W]=$)),{left:$.left,right:$.right,top:b?$.rtop:$.top,bottom:b?$.rbottom:$.bottom}}var Ut={left:0,right:0,top:0,bottom:0};function an(e,t,d){for(var l,b,W,$,ee,te,le=0;le<e.length;le+=3)if(ee=e[le],te=e[le+1],t<ee?(b=0,W=1,$="left"):t<te?(b=t-ee,W=b+1):(le==e.length-3||t==te&&e[le+3]>t)&&(W=te-ee,b=W-1,t>=te&&($="right")),b!=null){if(l=e[le+2],ee==te&&d==(l.insertLeft?"left":"right")&&($=d),d=="left"&&b==0)for(;le&&e[le-2]==e[le-3]&&e[le-1].insertLeft;)l=e[(le-=3)+2],$="left";if(d=="right"&&b==te-ee)for(;le<e.length-3&&e[le+3]==e[le+4]&&!e[le+5].insertLeft;)l=e[(le+=3)+2],$="right";break}return{node:l,start:b,end:W,collapse:$,coverStart:ee,coverEnd:te}}function mn(e,t){var d=Ut;if(t=="left")for(var l=0;l<e.length&&!((d=e[l]).left!=d.right);l++);else for(var b=e.length-1;b>=0&&!((d=e[b]).left!=d.right);b--);return d}function Hn(e,t,d,l){var b=an(t.map,d,l),W=b.node,$=b.start,ee=b.end,te=b.collapse,le;if(W.nodeType==3){for(var Me=0;Me<4;Me++){for(;$&&Ge(t.line.text.charAt(b.coverStart+$));)--$;for(;b.coverStart+ee<b.coverEnd&&Ge(t.line.text.charAt(b.coverStart+ee));)++ee;if(K&&I<9&&$==0&&ee==b.coverEnd-b.coverStart?le=W.parentNode.getBoundingClientRect():le=mn(g(W,$,ee).getClientRects(),l),le.left||le.right||$==0)break;ee=$,$=$-1,te="right"}K&&I<11&&(le=Vn(e.display.measure,le))}else{$>0&&(te=l="right");var He;e.options.lineWrapping&&(He=W.getClientRects()).length>1?le=He[l=="right"?He.length-1:0]:le=W.getBoundingClientRect()}if(K&&I<9&&!$&&(!le||!le.left&&!le.right)){var xt=W.parentNode.getClientRects()[0];xt?le={left:xt.left,right:xt.left+Hr(e.display),top:xt.top,bottom:xt.bottom}:le=Ut}for(var pt=le.top-t.rect.top,on=le.bottom-t.rect.top,Tn=(pt+on)/2,Wn=t.view.measure.heights,Yn=0;Yn<Wn.length-1&&!(Tn<Wn[Yn]);Yn++);var Zn=Yn?Wn[Yn-1]:0,Xn=Wn[Yn],ar={left:(te=="right"?le.right:le.left)-t.rect.left,right:(te=="left"?le.left:le.right)-t.rect.left,top:Zn,bottom:Xn};return!le.left&&!le.right&&(ar.bogus=!0),e.options.singleCursorHeightPerLine||(ar.rtop=pt,ar.rbottom=on),ar}function Vn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ae(e))return t;var d=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*d,right:t.right*d,top:t.top*l,bottom:t.bottom*l}}function fr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function dr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)fr(e.display.view[t])}function wr(e){dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ar(){return _&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function gr(){return _&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Cr(e){var t=0;if(e.widgets)for(var d=0;d<e.widgets.length;++d)e.widgets[d].above&&(t+=Jr(e.widgets[d]));return t}function Lr(e,t,d,l,b){if(!b){var W=Cr(t);d.top+=W,d.bottom+=W}if(l=="line")return d;l||(l="local");var $=Pn(t);if(l=="local"?$+=_i(e.display):$-=e.display.viewOffset,l=="page"||l=="window"){var ee=e.display.lineSpace.getBoundingClientRect();$+=ee.top+(l=="window"?0:gr());var te=ee.left+(l=="window"?0:Ar());d.left+=te,d.right+=te}return d.top+=$,d.bottom+=$,d}function gn(e,t,d){if(d=="div")return t;var l=t.left,b=t.top;if(d=="page")l-=Ar(),b-=gr();else if(d=="local"||!d){var W=e.display.sizer.getBoundingClientRect();l+=W.left,b+=W.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:l-$.left,top:b-$.top}}function nn(e,t,d,l,b){return l||(l=Cn(e.doc,t.line)),Lr(e,l,Pe(e,l,t.ch,b),d)}function xn(e,t,d,l,b,W){l=l||Cn(e.doc,t.line),b||(b=Ie(e,l));function $(on,Tn){var Wn=ut(e,b,on,Tn?"right":"left",W);return Tn?Wn.left=Wn.right:Wn.right=Wn.left,Lr(e,l,Wn,d)}var ee=En(l,e.doc.direction),te=t.ch,le=t.sticky;if(te>=l.text.length?(te=l.text.length,le="before"):te<=0&&(te=0,le="after"),!ee)return $(le=="before"?te-1:te,le=="before");function Me(on,Tn,Wn){var Yn=ee[Tn],Zn=Yn.level==1;return $(Wn?on-1:on,Zn!=Wn)}var He=tt(ee,te,le),xt=en,pt=Me(te,He,le=="before");return xt!=null&&(pt.other=Me(te,xt,le!="before")),pt}function zt(e,t){var d=0;t=L(e.doc,t),e.options.lineWrapping||(d=Hr(e.display)*t.ch);var l=Cn(e.doc,t.line),b=Pn(l)+_i(e.display);return{left:d,right:d,top:b,bottom:b+l.height}}function Vt(e,t,d,l,b){var W=pn(e,t,d);return W.xRel=b,l&&(W.outside=l),W}function pr(e,t,d){var l=e.doc;if(d+=e.display.viewOffset,d<0)return Vt(l.first,0,null,-1,-1);var b=Pr(l,d),W=l.first+l.size-1;if(b>W)return Vt(l.first+l.size-1,Cn(l,W).text.length,null,1,1);t<0&&(t=0);for(var $=Cn(l,b);;){var ee=oi(e,$,b,t,d),te=Be($,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!te)return ee;var le=te.find(1);if(le.line==b)return le;$=Cn(l,b=le.line)}}function Mr(e,t,d,l){l-=Cr(t);var b=t.text.length,W=Bt(function($){return ut(e,d,$-1).bottom<=l},b,0);return b=Bt(function($){return ut(e,d,$).top>l},W,b),{begin:W,end:b}}function ir(e,t,d,l){d||(d=Ie(e,t));var b=Lr(e,t,ut(e,d,l),"line").top;return Mr(e,t,d,b)}function Ur(e,t,d,l){return e.bottom<=d?!1:e.top>d?!0:(l?e.left:e.right)>t}function oi(e,t,d,l,b){b-=Pn(t);var W=Ie(e,t),$=Cr(t),ee=0,te=t.text.length,le=!0,Me=En(t,e.doc.direction);if(Me){var He=(e.options.lineWrapping?Xr:jr)(e,t,d,W,Me,l,b);le=He.level!=1,ee=le?He.from:He.to-1,te=le?He.to:He.from-1}var xt=null,pt=null,on=Bt(function(Tr){var _r=ut(e,W,Tr);return _r.top+=$,_r.bottom+=$,Ur(_r,l,b,!1)?(_r.top<=b&&_r.left<=l&&(xt=Tr,pt=_r),!0):!1},ee,te),Tn,Wn,Yn=!1;if(pt){var Zn=l-pt.left<pt.right-l,Xn=Zn==le;on=xt+(Xn?0:1),Wn=Xn?"after":"before",Tn=Zn?pt.left:pt.right}else{!le&&(on==te||on==ee)&&on++,Wn=on==0?"after":on==t.text.length?"before":ut(e,W,on-(le?1:0)).bottom+$<=b==le?"after":"before";var ar=xn(e,pn(d,on,Wn),"line",t,W);Tn=ar.left,Yn=b<ar.top?-1:b>=ar.bottom?1:0}return on=Xe(t.text,on,1),Vt(d,on,Wn,Yn,l-Tn)}function jr(e,t,d,l,b,W,$){var ee=Bt(function(He){var xt=b[He],pt=xt.level!=1;return Ur(xn(e,pn(d,pt?xt.to:xt.from,pt?"before":"after"),"line",t,l),W,$,!0)},0,b.length-1),te=b[ee];if(ee>0){var le=te.level!=1,Me=xn(e,pn(d,le?te.from:te.to,le?"after":"before"),"line",t,l);Ur(Me,W,$,!0)&&Me.top>$&&(te=b[ee-1])}return te}function Xr(e,t,d,l,b,W,$){var ee=Mr(e,t,l,$),te=ee.begin,le=ee.end;/\s/.test(t.text.charAt(le-1))&&le--;for(var Me=null,He=null,xt=0;xt<b.length;xt++){var pt=b[xt];if(pt.from>=le||pt.to<=te)continue;var on=pt.level!=1,Tn=ut(e,l,on?Math.min(le,pt.to)-1:Math.max(te,pt.from)).right,Wn=Tn<W?W-Tn+1e9:Tn-W;(!Me||He>Wn)&&(Me=pt,He=Wn)}return Me||(Me=b[b.length-1]),Me.from<te&&(Me={from:te,to:Me.to,level:Me.level}),Me.to>le&&(Me={from:Me.from,to:le,level:Me.level}),Me}var zr;function Wr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(zr==null){zr=h("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)zr.appendChild(document.createTextNode("x")),zr.appendChild(h("br"));zr.appendChild(document.createTextNode("x"))}f(e.measure,zr);var d=zr.offsetHeight/50;return d>3&&(e.cachedTextHeight=d),E(e.measure),d||1}function Hr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=h("span","xxxxxxxxxx"),d=h("pre",[t],"CodeMirror-line-like");f(e.measure,d);var l=t.getBoundingClientRect(),b=(l.right-l.left)/10;return b>2&&(e.cachedCharWidth=b),b||10}function vr(e){for(var t=e.display,d={},l={},b=t.gutters.clientLeft,W=t.gutters.firstChild,$=0;W;W=W.nextSibling,++$){var ee=e.display.gutterSpecs[$].className;d[ee]=W.offsetLeft+W.clientLeft+b,l[ee]=W.clientWidth}return{fixedPos:yi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:d,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function yi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qi(e){var t=Wr(e.display),d=e.options.lineWrapping,l=d&&Math.max(5,e.display.scroller.clientWidth/Hr(e.display)-3);return function(b){if(Xt(e.doc,b))return 0;var W=0;if(b.widgets)for(var $=0;$<b.widgets.length;$++)b.widgets[$].height&&(W+=b.widgets[$].height);return d?W+(Math.ceil(b.text.length/l)||1)*t:W+t}}function ji(e){var t=e.doc,d=Qi(e);t.iter(function(l){var b=d(l);b!=l.height&&rr(l,b)})}function Ri(e,t,d,l){var b=e.display;if(!d&&be(t).getAttribute("cm-not-content")=="true")return null;var W,$,ee=b.lineSpace.getBoundingClientRect();try{W=t.clientX-ee.left,$=t.clientY-ee.top}catch(He){return null}var te=pr(e,W,$),le;if(l&&te.xRel>0&&(le=Cn(e.doc,te.line).text).length==te.ch){var Me=Y(le,le.length,e.options.tabSize)-le.length;te=pn(te.line,Math.max(0,Math.round((W-Ue(e.display).left)/Hr(e.display))-Me))}return te}function ui(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var d=e.display.view,l=0;l<d.length;l++)if(t-=d[l].size,t<0)return l}function qr(e,t,d,l){t==null&&(t=e.doc.first),d==null&&(d=e.doc.first+e.doc.size),l||(l=0);var b=e.display;if(l&&d<b.viewTo&&(b.updateLineNumbers==null||b.updateLineNumbers>t)&&(b.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=b.viewTo)Dr&&It(e.doc,t)<b.viewTo&&ci(e);else if(d<=b.viewFrom)Dr&&vt(e.doc,d+l)>b.viewFrom?ci(e):(b.viewFrom+=l,b.viewTo+=l);else if(t<=b.viewFrom&&d>=b.viewTo)ci(e);else if(t<=b.viewFrom){var W=Fi(e,d,d+l,1);W?(b.view=b.view.slice(W.index),b.viewFrom=W.lineN,b.viewTo+=l):ci(e)}else if(d>=b.viewTo){var $=Fi(e,t,t,-1);$?(b.view=b.view.slice(0,$.index),b.viewTo=$.lineN):ci(e)}else{var ee=Fi(e,t,t,-1),te=Fi(e,d,d+l,1);ee&&te?(b.view=b.view.slice(0,ee.index).concat(An(e,ee.lineN,te.lineN)).concat(b.view.slice(te.index)),b.viewTo+=l):ci(e)}var le=b.externalMeasured;le&&(d<le.lineN?le.lineN+=l:t<le.lineN+le.size&&(b.externalMeasured=null))}function ii(e,t,d){e.curOp.viewChanged=!0;var l=e.display,b=e.display.externalMeasured;if(b&&t>=b.lineN&&t<b.lineN+b.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var W=l.view[ui(e,t)];if(W.node==null)return;var $=W.changes||(W.changes=[]);ie($,d)==-1&&$.push(d)}function ci(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fi(e,t,d,l){var b=ui(e,t),W,$=e.display.view;if(!Dr||d==e.doc.first+e.doc.size)return{index:b,lineN:d};for(var ee=e.display.viewFrom,te=0;te<b;te++)ee+=$[te].size;if(ee!=t){if(l>0){if(b==$.length-1)return null;W=ee+$[b].size-t,b++}else W=ee-t;t+=W,d+=W}for(;It(e.doc,d)!=d;){if(b==(l<0?0:$.length-1))return null;d+=l*$[b-(l<0?1:0)].size,b+=l}return{index:b,lineN:d}}function ha(e,t,d){var l=e.display,b=l.view;b.length==0||t>=l.viewTo||d<=l.viewFrom?(l.view=An(e,t,d),l.viewFrom=t):(l.viewFrom>t?l.view=An(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(ui(e,t))),l.viewFrom=t,l.viewTo<d?l.view=l.view.concat(An(e,l.viewTo,d)):l.viewTo>d&&(l.view=l.view.slice(0,ui(e,d)))),l.viewTo=d}function sa(e){for(var t=e.display.view,d=0,l=0;l<t.length;l++){var b=t[l];!b.hidden&&(!b.node||b.changes)&&++d}return d}function ei(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Zi(e,t){t===void 0&&(t=!0);for(var d=e.doc,l={},b=l.cursors=document.createDocumentFragment(),W=l.selection=document.createDocumentFragment(),$=0;$<d.sel.ranges.length;$++){if(!t&&$==d.sel.primIndex)continue;var ee=d.sel.ranges[$];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var te=ee.empty();(te||e.options.showCursorWhenSelecting)&&qi(e,ee.head,b),te||Qr(e,ee,W)}return l}function qi(e,t,d){var l=xn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),b=d.appendChild(h("div","\xA0","CodeMirror-cursor"));if(b.style.left=l.left+"px",b.style.top=l.top+"px",b.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var W=d.appendChild(h("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));W.style.display="",W.style.left=l.other.left+"px",W.style.top=l.other.top+"px",W.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function si(e,t){return e.top-t.top||e.left-t.left}function Qr(e,t,d){var l=e.display,b=e.doc,W=document.createDocumentFragment(),$=Ue(e.display),ee=$.left,te=Math.max(l.sizerWidth,Se(e)-l.sizer.offsetLeft)-$.right,le=b.direction=="ltr";function Me(Xn,ar,Tr,_r){ar<0&&(ar=0),ar=Math.round(ar),_r=Math.round(_r),W.appendChild(h("div",null,"CodeMirror-selected","position: absolute; left: "+Xn+`px;
top: `+ar+"px; width: "+(Tr==null?te-Xn:Tr)+`px;
height: `+(_r-ar)+"px"))}function He(Xn,ar,Tr){var _r=Cn(b,Xn),Fr=_r.text.length,pi,Hi;function Ci(ki,ra){return nn(e,pn(Xn,ki),"div",_r,ra)}function oa(ki,ra,zi){var Ui=ir(e,_r,null,ki),Ii=ra=="ltr"==(zi=="after")?"left":"right",Oi=zi=="after"?Ui.begin:Ui.end-(/\s/.test(_r.text.charAt(Ui.end-1))?2:1);return Ci(Oi,Ii)[Ii]}var na=En(_r,b.direction);return Wt(na,ar||0,Tr==null?Fr:Tr,function(ki,ra,zi,Ui){var Ii=zi=="ltr",Oi=Ci(ki,Ii?"left":"right"),ia=Ci(ra-1,Ii?"right":"left"),So=ar==null&&ki==0,to=Tr==null&&ra==Fr,Xi=Ui==0,Pa=!na||Ui==na.length-1;if(ia.top-Oi.top<=3){var Wi=(le?So:to)&&Xi,ms=(le?to:So)&&Pa,Ga=Wi?ee:(Ii?Oi:ia).left,lo=ms?te:(Ii?ia:Oi).right;Me(Ga,Oi.top,lo-Ga,Oi.bottom)}else{var uo,Ji,Oo,gs;Ii?(uo=le&&So&&Xi?ee:Oi.left,Ji=le?te:oa(ki,zi,"before"),Oo=le?ee:oa(ra,zi,"after"),gs=le&&to&&Pa?te:ia.right):(uo=le?oa(ki,zi,"before"):ee,Ji=!le&&So&&Xi?te:Oi.right,Oo=!le&&to&&Pa?ee:ia.left,gs=le?oa(ra,zi,"after"):te),Me(uo,Oi.top,Ji-uo,Oi.bottom),Oi.bottom<ia.top&&Me(ee,Oi.bottom,null,ia.top),Me(Oo,ia.top,gs-Oo,ia.bottom)}(!pi||si(Oi,pi)<0)&&(pi=Oi),si(ia,pi)<0&&(pi=ia),(!Hi||si(Oi,Hi)<0)&&(Hi=Oi),si(ia,Hi)<0&&(Hi=ia)}),{start:pi,end:Hi}}var xt=t.from(),pt=t.to();if(xt.line==pt.line)He(xt.line,xt.ch,pt.ch);else{var on=Cn(b,xt.line),Tn=Cn(b,pt.line),Wn=ot(on)==ot(Tn),Yn=He(xt.line,xt.ch,Wn?on.text.length+1:null).end,Zn=He(pt.line,Wn?0:null,pt.ch).start;Wn&&(Yn.top<Zn.top-2?(Me(Yn.right,Yn.top,null,Yn.bottom),Me(ee,Zn.top,Zn.left,Zn.bottom)):Me(Yn.right,Yn.top,Zn.left-Yn.right,Yn.bottom)),Yn.bottom<Zn.top&&Me(ee,Yn.bottom,null,Zn.top)}d.appendChild(W)}function Ti(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var d=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ca(e),t.cursorDiv.style.visibility=(d=!d)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ma(e){e.state.focused||(e.display.input.focus(),la(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ca(e))},100)}function la(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(nt(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ti(e)}function Ca(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(nt(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ta(e){for(var t=e.display,d=t.lineDiv.offsetTop,l=0;l<t.view.length;l++){var b=t.view[l],W=e.options.lineWrapping,$=void 0,ee=0;if(b.hidden)continue;if(K&&I<8){var te=b.node.offsetTop+b.node.offsetHeight;$=te-d,d=te}else{var le=b.node.getBoundingClientRect();$=le.bottom-le.top,!W&&b.text.firstChild&&(ee=b.text.firstChild.getBoundingClientRect().right-le.left-1)}var Me=b.line.height-$;if((Me>.005||Me<-.005)&&(rr(b.line,$),Sa(b.line),b.rest))for(var He=0;He<b.rest.length;He++)Sa(b.rest[He]);if(ee>e.display.sizerWidth){var xt=Math.ceil(ee/Hr(e.display));xt>e.display.maxLineLength&&(e.display.maxLineLength=xt,e.display.maxLine=b.line,e.display.maxLineChanged=!0)}}}function Sa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var d=e.widgets[t],l=d.node.parentNode;l&&(d.height=l.offsetHeight)}}function ka(e,t,d){var l=d&&d.top!=null?Math.max(0,d.top):e.scroller.scrollTop;l=Math.floor(l-_i(e));var b=d&&d.bottom!=null?d.bottom:l+e.wrapper.clientHeight,W=Pr(t,l),$=Pr(t,b);if(d&&d.ensure){var ee=d.ensure.from.line,te=d.ensure.to.line;ee<W?(W=ee,$=Pr(t,Pn(Cn(t,ee))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=$&&(W=Pr(t,Pn(Cn(t,te))-e.wrapper.clientHeight),$=te)}return{from:W,to:Math.max($,W+1)}}function co(e,t){if(st(e,"scrollCursorIntoView"))return;var d=e.display,l=d.sizer.getBoundingClientRect(),b=null;if(t.top+l.top<0?b=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(b=!1),b!=null&&!a){var W=h("div","\u200B",null,`position: absolute;
top: `+(t.top-d.viewOffset-_i(e.display))+`px;
height: `+(t.bottom-t.top+Ve(e)+d.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(W),W.scrollIntoView(b),e.display.lineSpace.removeChild(W)}}function Ro(e,t,d,l){l==null&&(l=0);var b;!e.options.lineWrapping&&t==d&&(t=t.ch?pn(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,d=t.sticky=="before"?pn(t.line,t.ch+1,"before"):t);for(var W=0;W<5;W++){var $=!1,ee=xn(e,t),te=!d||d==t?ee:xn(e,d);b={left:Math.min(ee.left,te.left),top:Math.min(ee.top,te.top)-l,right:Math.max(ee.left,te.left),bottom:Math.max(ee.bottom,te.bottom)+l};var le=Oa(e,b),Me=e.doc.scrollTop,He=e.doc.scrollLeft;if(le.scrollTop!=null&&(Da(e,le.scrollTop),Math.abs(e.doc.scrollTop-Me)>1&&($=!0)),le.scrollLeft!=null&&(Ni(e,le.scrollLeft),Math.abs(e.doc.scrollLeft-He)>1&&($=!0)),!$)break}return b}function za(e,t){var d=Oa(e,t);d.scrollTop!=null&&Da(e,d.scrollTop),d.scrollLeft!=null&&Ni(e,d.scrollLeft)}function Oa(e,t){var d=e.display,l=Wr(e.display);t.top<0&&(t.top=0);var b=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:d.scroller.scrollTop,W=re(e),$={};t.bottom-t.top>W&&(t.bottom=t.top+W);var ee=e.doc.height+Ee(d),te=t.top<l,le=t.bottom>ee-l;if(t.top<b)$.scrollTop=te?0:t.top;else if(t.bottom>b+W){var Me=Math.min(t.top,(le?ee:t.bottom)-W);Me!=b&&($.scrollTop=Me)}var He=e.options.fixedGutter?0:d.gutters.offsetWidth,xt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:d.scroller.scrollLeft-He,pt=Se(e)-d.gutters.offsetWidth,on=t.right-t.left>pt;return on&&(t.right=t.left+pt),t.left<10?$.scrollLeft=0:t.left<xt?$.scrollLeft=Math.max(0,t.left+He-(on?0:10)):t.right>pt+xt-3&&($.scrollLeft=t.right+(on?0:10)-pt),$}function Va(e,t){if(t==null)return;Ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){Ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ra(e,t,d){(t!=null||d!=null)&&Ya(e),t!=null&&(e.curOp.scrollLeft=t),d!=null&&(e.curOp.scrollTop=d)}function ho(e,t){Ya(e),e.curOp.scrollToPos=t}function Ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var d=zt(e,t.from),l=zt(e,t.to);Aa(e,d,l,t.margin)}}function Aa(e,t,d,l){var b=Oa(e,{left:Math.min(t.left,d.left),top:Math.min(t.top,d.top)-l,right:Math.max(t.right,d.right),bottom:Math.max(t.bottom,d.bottom)+l});Ra(e,b.scrollLeft,b.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;U||Ua(e,{top:t}),ya(e,t,!0),U&&Ua(e),Na(e,100)}function ya(e,t,d){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!d)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ni(e,t,d,l){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(d?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!l)return;e.doc.scrollLeft=t,Nr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,d=t.gutters.offsetWidth,l=Math.round(e.doc.height+Ee(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?d:0,docHeight:l,scrollHeight:l+Ve(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:d}}var pa=function(e,t,d){this.cm=d;var l=this.vert=h("div",[h("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),b=this.horiz=h("div",[h("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=b.tabIndex=-1,e(l),e(b),Fe(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),Fe(b,"scroll",function(){b.clientWidth&&t(b.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,d=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(d){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var b=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+b)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=d?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var W=e.viewWidth-e.barLeft-(d?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+W)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:d?l:0,bottom:t?l:0}},pa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pa.prototype.zeroWidthHack=function(){var e=i&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new q,this.disableVert=new q},pa.prototype.enableZeroWidthBar=function(e,t,d){e.style.pointerEvents="auto";function l(){var b=e.getBoundingClientRect(),W=d=="vert"?document.elementFromPoint(b.right-1,(b.top+b.bottom)/2):document.elementFromPoint((b.right+b.left)/2,b.bottom-1);W!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},pa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function ma(e,t){t||(t=fa(e));var d=e.display.barWidth,l=e.display.barHeight;Xa(e,t);for(var b=0;b<4&&d!=e.display.barWidth||l!=e.display.barHeight;b++)d!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Xa(e,fa(e)),d=e.display.barWidth,l=e.display.barHeight}function Xa(e,t){var d=e.display,l=d.scrollbars.update(t);d.sizer.style.paddingRight=(d.barWidth=l.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=l.bottom)+"px",d.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=l.bottom+"px",d.scrollbarFiller.style.width=l.right+"px"):d.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=l.bottom+"px",d.gutterFiller.style.width=t.gutterWidth+"px"):d.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Ja(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $a[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Fe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,d){d=="horizontal"?Ni(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Ia=0;function ua(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ia},vn(e.curOp)}function Ea(e){var t=e.curOp;t&&Ln(t,function(d){for(var l=0;l<d.ops.length;l++)d.ops[l].cm.curOp=null;ro(d)})}function ro(e){for(var t=e.ops,d=0;d<t.length;d++)Ao(t[d]);for(var l=0;l<t.length;l++)Do(t[l]);for(var b=0;b<t.length;b++)fo(t[b]);for(var W=0;W<t.length;W++)io(t[W]);for(var $=0;$<t.length;$++)po(t[$])}function Ao(e){var t=e.cm,d=t.display;ao(t),e.updateMaxLine&&On(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ea(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&xa(e.cm,e.update)}function fo(e){var t=e.cm,d=t.display;e.updatedDisplay&&Ta(t),e.barMeasure=fa(t),d.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pe(t,d.maxLine,d.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(d.scroller.clientWidth,d.sizer.offsetLeft+e.adjustWidthTo+Ve(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo-Se(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=d.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ni(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var d=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,d),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ma(t,e.barMeasure),e.updatedDisplay&&$r(t,e.barMeasure),e.selectionChanged&&Ti(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),d&&Ma(e.cm)}function po(e){var t=e.cm,d=t.display,l=t.doc;if(e.updatedDisplay&&Qa(t,e.update),d.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(d.wheelStartX=d.wheelStartY=null),e.scrollTop!=null&&ya(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ni(t,e.scrollLeft,!0,!0),e.scrollToPos){var b=Ro(t,L(l,e.scrollToPos.from),L(l,e.scrollToPos.to),e.scrollToPos.margin);co(t,b)}var W=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(W)for(var ee=0;ee<W.length;++ee)W[ee].lines.length||nt(W[ee],"hide");if($)for(var te=0;te<$.length;++te)$[te].lines.length&&nt($[te],"unhide");d.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&nt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ki(e,t){if(e.curOp)return t();ua(e);try{return t()}finally{Ea(e)}}function bi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ua(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Pi(e){return function(){if(this.curOp)return e.apply(this,arguments);ua(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function Ei(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ua(t);try{return e.apply(this,arguments)}finally{Ea(t)}}}function Na(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var d=+new Date+e.options.workTime,l=In(e,t.highlightFrontier),b=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(W){if(l.line>=e.display.viewFrom){var $=W.styles,ee=W.text.length>e.options.maxHighlightLength?sn(t.mode,l.state):null,te=je(e,W,l,!0);ee&&(l.state=ee),W.styles=te.styles;var le=W.styleClasses,Me=te.classes;Me?W.styleClasses=Me:le&&(W.styleClasses=null);for(var He=!$||$.length!=W.styles.length||le!=Me&&(!le||!Me||le.bgClass!=Me.bgClass||le.textClass!=Me.textClass),xt=0;!He&&xt<$.length;++xt)He=$[xt]!=W.styles[xt];He&&b.push(l.line),W.stateAfter=l.save(),l.nextLine()}else W.text.length<=e.options.maxHighlightLength&&Jn(e,W.text,l),W.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>d)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),b.length&&Ki(e,function(){for(var W=0;W<b.length;W++)ii(e,b[W],"text")})}var ea=function(e,t,d){var l=e.display;this.viewport=t,this.visible=ka(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=Se(e),this.force=d,this.dims=vr(e),this.events=[]};ea.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},ea.prototype.finish=function(){for(var e=0;e<this.events.length;e++)nt.apply(null,this.events[e])};function ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ve(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ve(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=j();if(!t||!x(e.display.lineDiv,t))return null;var d={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&x(e.display.lineDiv,l.anchorNode)&&(d.anchorNode=l.anchorNode,d.anchorOffset=l.anchorOffset,d.focusNode=l.focusNode,d.focusOffset=l.focusOffset)}return d}function so(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),d=document.createRange();d.setEnd(e.anchorNode,e.anchorOffset),d.collapse(!1),t.removeAllRanges(),t.addRange(d),t.extend(e.focusNode,e.focusOffset)}}function xa(e,t){var d=e.display,l=e.doc;if(t.editorIsHidden)return ci(e),!1;if(!t.force&&t.visible.from>=d.viewFrom&&t.visible.to<=d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&sa(e)==0)return!1;gi(e)&&(ci(e),t.dims=vr(e));var b=l.first+l.size,W=Math.max(t.visible.from-e.options.viewportMargin,l.first),$=Math.min(b,t.visible.to+e.options.viewportMargin);d.viewFrom<W&&W-d.viewFrom<20&&(W=Math.max(l.first,d.viewFrom)),d.viewTo>$&&d.viewTo-$<20&&($=Math.min(b,d.viewTo)),Dr&&(W=It(e.doc,W),$=vt(e.doc,$));var ee=W!=d.viewFrom||$!=d.viewTo||d.lastWrapHeight!=t.wrapperHeight||d.lastWrapWidth!=t.wrapperWidth;ha(e,W,$),d.viewOffset=Pn(Cn(e.doc,d.viewFrom)),e.display.mover.style.top=d.viewOffset+"px";var te=sa(e);if(!ee&&te==0&&!t.force&&d.renderedView==d.view&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo))return!1;var le=oo(e);return te>4&&(d.lineDiv.style.display="none"),go(e,d.updateLineNumbers,t.dims),te>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,so(le),E(d.cursorDiv),E(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,ee&&(d.lastWrapHeight=t.wrapperHeight,d.lastWrapWidth=t.wrapperWidth,Na(e,400)),d.updateLineNumbers=null,!0}function Qa(e,t){for(var d=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==Se(e)){if(d&&d.top!=null&&(d={top:Math.min(e.doc.height+Ee(e.display)-re(e),d.top)}),t.visible=ka(e.display,e.doc,d),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=ka(e.display,e.doc,d));if(!xa(e,t))break;Ta(e);var b=fa(e);ei(e),ma(e,b),$r(e,b),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ua(e,t){var d=new ea(e,t);if(xa(e,d)){Ta(e),Qa(e,d);var l=fa(e);ei(e),ma(e,l),$r(e,l),d.finish()}}function go(e,t,d){var l=e.display,b=e.options.lineNumbers,W=l.lineDiv,$=W.firstChild;function ee(on){var Tn=on.nextSibling;return r&&i&&e.display.currentWheelTarget==on?on.style.display="none":on.parentNode.removeChild(on),Tn}for(var te=l.view,le=l.viewFrom,Me=0;Me<te.length;Me++){var He=te[Me];if(!He.hidden)if(!He.node||He.node.parentNode!=W){var xt=mr(e,He,le,d);W.insertBefore(xt,$)}else{for(;$!=He.node;)$=ee($);var pt=b&&t!=null&&t<=le&&He.lineNumber;He.changes&&(ie(He.changes,"gutter")>-1&&(pt=!1),Nt(e,He,le,d)),pt&&(E(He.lineNumber),He.lineNumber.appendChild(document.createTextNode(hi(e.options,le)))),$=He.node.nextSibling}le+=He.size}for(;$;)$=ee($)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function $r(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ve(e)+"px"}function Nr(e){var t=e.display,d=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=yi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,b=t.gutters.offsetWidth,W=l+"px",$=0;$<d.length;$++)if(!d[$].hidden){e.options.fixedGutter&&(d[$].gutter&&(d[$].gutter.style.left=W),d[$].gutterBackground&&(d[$].gutterBackground.style.left=W));var ee=d[$].alignable;if(ee)for(var te=0;te<ee.length;te++)ee[te].style.left=W}e.options.fixedGutter&&(t.gutters.style.left=l+b+"px")}function gi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,d=hi(e.options,t.first+t.size-1),l=e.display;if(d.length!=l.lineNumChars){var b=l.measure.appendChild(h("div",[h("div",d)],"CodeMirror-linenumber CodeMirror-gutter-elt")),W=b.firstChild.offsetWidth,$=b.offsetWidth-W;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(W,l.lineGutter.offsetWidth-$)+1,l.lineNumWidth=l.lineNumInnerWidth+$,l.lineNumChars=l.lineNumInnerWidth?d.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Za(e.display),!0}return!1}function Bi(e,t){for(var d=[],l=!1,b=0;b<e.length;b++){var W=e[b],$=null;if(typeof W!="string"&&($=W.style,W=W.className),W=="CodeMirror-linenumbers")if(t)l=!0;else continue;d.push({className:W,style:$})}return t&&!l&&d.push({className:"CodeMirror-linenumbers",style:null}),d}function La(e){var t=e.gutters,d=e.gutterSpecs;E(t),e.lineGutter=null;for(var l=0;l<d.length;++l){var b=d[l],W=b.className,$=b.style,ee=t.appendChild(h("div",null,"CodeMirror-gutter "+W));$&&(ee.style.cssText=$),W=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}t.style.display=d.length?"":"none",Za(e)}function ca(e){La(e.display),qr(e),Nr(e)}function ja(e,t,d,l){var b=this;this.input=d,b.scrollbarFiller=h("div",null,"CodeMirror-scrollbar-filler"),b.scrollbarFiller.setAttribute("cm-not-content","true"),b.gutterFiller=h("div",null,"CodeMirror-gutter-filler"),b.gutterFiller.setAttribute("cm-not-content","true"),b.lineDiv=y("div",null,"CodeMirror-code"),b.selectionDiv=h("div",null,null,"position: relative; z-index: 1"),b.cursorDiv=h("div",null,"CodeMirror-cursors"),b.measure=h("div",null,"CodeMirror-measure"),b.lineMeasure=h("div",null,"CodeMirror-measure"),b.lineSpace=y("div",[b.measure,b.lineMeasure,b.selectionDiv,b.cursorDiv,b.lineDiv],null,"position: relative; outline: none");var W=y("div",[b.lineSpace],"CodeMirror-lines");b.mover=h("div",[W],null,"position: relative"),b.sizer=h("div",[b.mover],"CodeMirror-sizer"),b.sizerWidth=null,b.heightForcer=h("div",null,null,"position: absolute; height: "+ge+"px; width: 1px;"),b.gutters=h("div",null,"CodeMirror-gutters"),b.lineGutter=null,b.scroller=h("div",[b.sizer,b.heightForcer,b.gutters],"CodeMirror-scroll"),b.scroller.setAttribute("tabIndex","-1"),b.wrapper=h("div",[b.scrollbarFiller,b.gutterFiller,b.scroller],"CodeMirror"),K&&I<8&&(b.gutters.style.zIndex=-1,b.scroller.style.paddingRight=0),!r&&!(U&&s)&&(b.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(b.wrapper):e(b.wrapper)),b.viewFrom=b.viewTo=t.first,b.reportedViewFrom=b.reportedViewTo=t.first,b.view=[],b.renderedView=null,b.externalMeasured=null,b.viewOffset=0,b.lastWrapHeight=b.lastWrapWidth=0,b.updateLineNumbers=null,b.nativeBarWidth=b.barHeight=b.barWidth=0,b.scrollbarsClipped=!1,b.lineNumWidth=b.lineNumInnerWidth=b.lineNumChars=null,b.alignWidgets=!1,b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.maxLine=null,b.maxLineLength=0,b.maxLineChanged=!1,b.wheelDX=b.wheelDY=b.wheelStartX=b.wheelStartY=null,b.shift=!1,b.selForContextMenu=null,b.activeTouch=null,b.gutterSpecs=Bi(l.gutters,l.lineNumbers),La(b),d.init(b)}var da=0,Si=null;K?Si=-.53:U?Si=15:_?Si=-.7:m&&(Si=-1/3);function Fa(e){var t=e.wheelDeltaX,d=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),d==null&&e.detail&&e.axis==e.VERTICAL_AXIS?d=e.detail:d==null&&(d=e.wheelDelta),{x:t,y:d}}function Ba(e){var t=Fa(e);return t.x*=Si,t.y*=Si,t}function Ha(e,t){var d=Fa(t),l=d.x,b=d.y,W=e.display,$=W.scroller,ee=$.scrollWidth>$.clientWidth,te=$.scrollHeight>$.clientHeight;if(!(l&&ee||b&&te))return;if(b&&i&&r){e:for(var le=t.target,Me=W.view;le!=$;le=le.parentNode)for(var He=0;He<Me.length;He++)if(Me[He].node==le){e.display.currentWheelTarget=le;break e}}if(l&&!U&&!p&&Si!=null){b&&te&&Da(e,Math.max(0,$.scrollTop+b*Si)),Ni(e,Math.max(0,$.scrollLeft+l*Si)),(!b||b&&te)&&ae(t),W.wheelStartX=null;return}if(b&&Si!=null){var xt=b*Si,pt=e.doc.scrollTop,on=pt+W.wrapper.clientHeight;xt<0?pt=Math.max(0,pt+xt-50):on=Math.min(e.doc.height,on+xt+50),Ua(e,{top:pt,bottom:on})}da<20&&(W.wheelStartX==null?(W.wheelStartX=$.scrollLeft,W.wheelStartY=$.scrollTop,W.wheelDX=l,W.wheelDY=b,setTimeout(function(){if(W.wheelStartX==null)return;var Tn=$.scrollLeft-W.wheelStartX,Wn=$.scrollTop-W.wheelStartY,Yn=Wn&&W.wheelDY&&Wn/W.wheelDY||Tn&&W.wheelDX&&Tn/W.wheelDX;if(W.wheelStartX=W.wheelStartY=null,!Yn)return;Si=(Si*da+Yn)/(da+1),++da},200)):(W.wheelDX+=l,W.wheelDY+=b))}var Gi=function(e,t){this.ranges=e,this.primIndex=t};Gi.prototype.primary=function(){return this.ranges[this.primIndex]},Gi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var d=this.ranges[t],l=e.ranges[t];if(!mi(d.anchor,l.anchor)||!mi(d.head,l.head))return!1}return!0},Gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Vr(wi(this.ranges[t].anchor),wi(this.ranges[t].head));return new Gi(e,this.primIndex)},Gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Gi.prototype.contains=function(e,t){t||(t=e);for(var d=0;d<this.ranges.length;d++){var l=this.ranges[d];if(or(t,l.from())>=0&&or(e,l.to())<=0)return d}return-1};var Vr=function(e,t){this.anchor=e,this.head=t};Vr.prototype.from=function(){return ni(this.anchor,this.head)},Vr.prototype.to=function(){return ti(this.anchor,this.head)},Vr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Or(e,t,d){var l=e&&e.options.selectionsMayTouch,b=t[d];t.sort(function(xt,pt){return or(xt.from(),pt.from())}),d=ie(t,b);for(var W=1;W<t.length;W++){var $=t[W],ee=t[W-1],te=or(ee.to(),$.from());if(l&&!$.empty()?te>0:te>=0){var le=ni(ee.from(),$.from()),Me=ti(ee.to(),$.to()),He=ee.empty()?$.from()==$.head:ee.from()==ee.head;W<=d&&--d,t.splice(--W,2,new Vr(He?Me:le,He?le:Me))}}return new Gi(t,d)}function $n(e,t){return new Gi([new Vr(e,t||e)],0)}function hr(e){return e.text?pn(e.from.line+e.text.length-1,at(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ir(e,t){if(or(e,t.from)<0)return e;if(or(e,t.to)<=0)return hr(t);var d=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=hr(t).ch-t.to.ch),pn(d,l)}function fi(e,t){for(var d=[],l=0;l<e.sel.ranges.length;l++){var b=e.sel.ranges[l];d.push(new Vr(Ir(b.anchor,t),Ir(b.head,t)))}return Or(e.cm,d,e.sel.primIndex)}function ga(e,t,d){return e.line==t.line?pn(d.line,e.ch-t.ch+d.ch):pn(d.line+(e.line-t.line),e.ch)}function aa(e,t,d){for(var l=[],b=pn(e.first,0),W=b,$=0;$<t.length;$++){var ee=t[$],te=ga(ee.from,b,W),le=ga(hr(ee),b,W);if(b=ee.to,W=le,d=="around"){var Me=e.sel.ranges[$],He=or(Me.head,Me.anchor)<0;l[$]=new Vr(He?le:te,He?te:le)}else l[$]=new Vr(te,te)}return new Gi(l,e.sel.primIndex)}function Mi(e){e.doc.mode=et(e.options,e.doc.modeOption),$i(e)}function $i(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Na(e,100),e.state.modeGen++,e.curOp&&qr(e)}function va(e,t){return t.from.ch==0&&t.to.ch==0&&at(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,t,d,l){function b(Zn){return d?d[Zn]:null}function W(Zn,Xn,ar){Mn(Zn,Xn,ar,l),Lt(Zn,"change",Zn,t)}function $(Zn,Xn){for(var ar=[],Tr=Zn;Tr<Xn;++Tr)ar.push(new Nn(le[Tr],b(Tr),l));return ar}var ee=t.from,te=t.to,le=t.text,Me=Cn(e,ee.line),He=Cn(e,te.line),xt=at(le),pt=b(le.length-1),on=te.line-ee.line;if(t.full)e.insert(0,$(0,le.length)),e.remove(le.length,e.size-le.length);else if(va(e,t)){var Tn=$(0,le.length-1);W(He,He.text,pt),on&&e.remove(ee.line,on),Tn.length&&e.insert(ee.line,Tn)}else if(Me==He)if(le.length==1)W(Me,Me.text.slice(0,ee.ch)+xt+Me.text.slice(te.ch),pt);else{var Wn=$(1,le.length-1);Wn.push(new Nn(xt+Me.text.slice(te.ch),pt,l)),W(Me,Me.text.slice(0,ee.ch)+le[0],b(0)),e.insert(ee.line+1,Wn)}else if(le.length==1)W(Me,Me.text.slice(0,ee.ch)+le[0]+He.text.slice(te.ch),b(0)),e.remove(ee.line+1,on);else{W(Me,Me.text.slice(0,ee.ch)+le[0],b(0)),W(He,xt+He.text.slice(te.ch),pt);var Yn=$(1,le.length-1);on>1&&e.remove(ee.line+1,on-1),e.insert(ee.line+1,Yn)}Lt(e,"change",e,t)}function Ai(e,t,d){function l(b,W,$){if(b.linked)for(var ee=0;ee<b.linked.length;++ee){var te=b.linked[ee];if(te.doc==W)continue;var le=$&&te.sharedHist;if(d&&!le)continue;t(te.doc,le),l(te.doc,b,le)}}l(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ji(e),Mi(e),_s(e),e.options.lineWrapping||On(e),e.options.mode=t.modeOption,qr(e)}function _s(e){(e.doc.direction=="rtl"?B:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ki(e,function(){_s(e),qr(e)})}function Go(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function rs(e,t){var d={from:wi(t.from),to:hr(t),text:br(e,t.from,t.to)};return Es(e,d,t.from.line,t.to.line+1),Ai(e,function(l){return Es(l,d,t.from.line,t.to.line+1)},!0),d}function ys(e){for(;e.length;){var t=at(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),at(e.done);if(e.done.length&&!at(e.done).ranges)return at(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),at(e.done)}function bs(e,t,d,l){var b=e.history;b.undone.length=0;var W=+new Date,$,ee;if((b.lastOp==l||b.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&b.lastModTime>W-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(b,b.lastOp==l)))ee=at($.changes),or(t.from,t.to)==0&&or(t.from,ee.to)==0?ee.to=hr(t):$.changes.push(rs(e,t));else{var te=at(b.done);for((!te||!te.ranges)&&zo(e.sel,b.done),$={changes:[rs(e,t)],generation:b.generation},b.done.push($);b.done.length>b.undoDepth;)b.done.shift(),b.done[0].ranges||b.done.shift()}b.done.push(d),b.generation=++b.maxGeneration,b.lastModTime=b.lastSelTime=W,b.lastOp=b.lastSelOp=l,b.lastOrigin=b.lastSelOrigin=t.origin,ee||nt(e,"historyAdded")}function ml(e,t,d,l){var b=t.charAt(0);return b=="*"||b=="+"&&d.ranges.length==l.ranges.length&&d.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,d,l){var b=e.history,W=l&&l.origin;d==b.lastSelOp||W&&b.lastSelOrigin==W&&(b.lastModTime==b.lastSelTime&&b.lastOrigin==W||ml(e,W,at(b.done),t))?b.done[b.done.length-1]=t:zo(t,b.done),b.lastSelTime=+new Date,b.lastSelOrigin=W,b.lastSelOp=d,l&&l.clearRedo!==!1&&ys(b.undone)}function zo(e,t){var d=at(t);d&&d.ranges&&d.equals(e)||t.push(e)}function Es(e,t,d,l){var b=t["spans_"+e.id],W=0;e.iter(Math.max(e.first,d),Math.min(e.first+e.size,l),function($){$.markedSpans&&((b||(b=t["spans_"+e.id]={}))[W]=$.markedSpans),++W})}function vl(e){if(!e)return null;for(var t,d=0;d<e.length;++d)e[d].marker.explicitlyCleared?t||(t=e.slice(0,d)):t&&t.push(e[d]);return t?t.length?t:null:e}function _l(e,t){var d=t["spans_"+e.id];if(!d)return null;for(var l=[],b=0;b<t.text.length;++b)l.push(vl(d[b]));return l}function xs(e,t){var d=_l(e,t),l=sr(e,t);if(!d)return l;if(!l)return d;for(var b=0;b<d.length;++b){var W=d[b],$=l[b];if(W&&$){e:for(var ee=0;ee<$.length;++ee){for(var te=$[ee],le=0;le<W.length;++le)if(W[le].marker==te.marker)continue e;W.push(te)}}else $&&(d[b]=$)}return d}function vo(e,t,d){for(var l=[],b=0;b<e.length;++b){var W=e[b];if(W.ranges){l.push(d?Gi.prototype.deepCopy.call(W):W);continue}var $=W.changes,ee=[];l.push({changes:ee});for(var te=0;te<$.length;++te){var le=$[te],Me=void 0;if(ee.push({from:le.from,to:le.to,text:le.text}),t)for(var He in le)(Me=He.match(/^spans_(\d+)$/))&&(ie(t,Number(Me[1]))>-1&&(at(ee)[He]=le[He],delete le[He]))}}return l}function is(e,t,d,l){if(l){var b=e.anchor;if(d){var W=or(t,b)<0;W!=or(d,b)<0?(b=t,t=d):W!=or(t,d)<0&&(t=d)}return new Vr(b,t)}else return new Vr(d||t,t)}function Vo(e,t,d,l,b){b==null&&(b=e.cm&&(e.cm.display.shift||e.extend)),Yi(e,new Gi([is(e.sel.primary(),t,d,b)],0),l)}function ws(e,t,d){for(var l=[],b=e.cm&&(e.cm.display.shift||e.extend),W=0;W<e.sel.ranges.length;W++)l[W]=is(e.sel.ranges[W],t[W],null,b);var $=Or(e.cm,l,e.sel.primIndex);Yi(e,$,d)}function as(e,t,d,l){var b=e.sel.ranges.slice(0);b[t]=d,Yi(e,Or(e.cm,b,e.sel.primIndex),l)}function Cs(e,t,d,l){Yi(e,$n(t,d),l)}function yl(e,t,d){var l={ranges:t.ranges,update:function(b){this.ranges=[];for(var W=0;W<b.length;W++)this.ranges[W]=new Vr(L(e,b[W].anchor),L(e,b[W].head))},origin:d&&d.origin};return nt(e,"beforeSelectionChange",e,l),e.cm&&nt(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?Or(e.cm,l.ranges,l.ranges.length-1):t}function Ts(e,t,d){var l=e.history.done,b=at(l);b&&b.ranges?(l[l.length-1]=t,Yo(e,t,d)):Yi(e,t,d)}function Yi(e,t,d){Yo(e,t,d),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,d)}function Yo(e,t,d){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,d));var l=d&&d.bias||(or(t.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,Rs(e,t,l,!0)),!(d&&d.scroll===!1)&&e.cm&&_a(e.cm)}function Ss(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,De(e.cm)),Lt(e,"cursorActivity",e)}function Os(e){Ss(e,Rs(e,e.sel,null,!1))}function Rs(e,t,d,l){for(var b,W=0;W<t.ranges.length;W++){var $=t.ranges[W],ee=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[W],te=Xo(e,$.anchor,ee&&ee.anchor,d,l),le=Xo(e,$.head,ee&&ee.head,d,l);(b||te!=$.anchor||le!=$.head)&&(b||(b=t.ranges.slice(0,W)),b[W]=new Vr(te,le))}return b?Or(e.cm,b,t.primIndex):t}function _o(e,t,d,l,b){var W=Cn(e,t.line);if(W.markedSpans)for(var $=0;$<W.markedSpans.length;++$){var ee=W.markedSpans[$],te=ee.marker,le="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,Me="selectRight"in te?!te.selectRight:te.inclusiveRight;if((ee.from==null||(le?ee.from<=t.ch:ee.from<t.ch))&&(ee.to==null||(Me?ee.to>=t.ch:ee.to>t.ch))){if(b&&(nt(te,"beforeCursorEnter"),te.explicitlyCleared))if(W.markedSpans){--$;continue}else break;if(!te.atomic)continue;if(d){var He=te.find(l<0?1:-1),xt=void 0;if((l<0?Me:le)&&(He=As(e,He,-l,He&&He.line==t.line?W:null)),He&&He.line==t.line&&(xt=or(He,d))&&(l<0?xt<0:xt>0))return _o(e,He,t,l,b)}var pt=te.find(l<0?-1:1);return(l<0?le:Me)&&(pt=As(e,pt,l,pt.line==t.line?W:null)),pt?_o(e,pt,t,l,b):null}}return t}function Xo(e,t,d,l,b){var W=l||1,$=_o(e,t,d,W,b)||!b&&_o(e,t,d,W,!0)||_o(e,t,d,-W,b)||!b&&_o(e,t,d,-W,!0);return $||(e.cantEdit=!0,pn(e.first,0))}function As(e,t,d,l){return d<0&&t.ch==0?t.line>e.first?L(e,pn(t.line-1)):null:d>0&&t.ch==(l||Cn(e,t.line)).text.length?t.line<e.first+e.size-1?pn(t.line+1,0):null:new pn(t.line,t.ch+d)}function Ds(e){e.setSelection(pn(e.firstLine(),0),pn(e.lastLine()),xe)}function Ls(e,t,d){var l={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return l.canceled=!0}};return d&&(l.update=function(b,W,$,ee){b&&(l.from=L(e,b)),W&&(l.to=L(e,W)),$&&(l.text=$),ee!==void 0&&(l.origin=ee)}),nt(e,"beforeChange",e,l),e.cm&&nt(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function yo(e,t,d){if(e.cm){if(!e.cm.curOp)return bi(e.cm,yo)(e,t,d);if(e.cm.state.suppressEdits)return}if((ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))&&(t=Ls(e,t,!0),!t))return;var l=Vi&&!d&&ce(e,t.from,t.to);if(l)for(var b=l.length-1;b>=0;--b)Ps(e,{from:l[b].from,to:l[b].to,text:b?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&or(t.from,t.to)==0)return;var d=fi(e,t);bs(e,t,d,e.cm?e.cm.curOp.id:NaN),Lo(e,t,d,sr(e,t));var l=[];Ai(e,function(b,W){!W&&ie(l,b.history)==-1&&(Ns(b.history,t),l.push(b.history)),Lo(b,t,null,sr(b,t))})}function $o(e,t,d){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!d)return;for(var b=e.history,W,$=e.sel,ee=t=="undo"?b.done:b.undone,te=t=="undo"?b.undone:b.done,le=0;le<ee.length&&!(W=ee[le],d?W.ranges&&!W.equals(e.sel):!W.ranges);le++);if(le==ee.length)return;for(b.lastOrigin=b.lastSelOrigin=null;;)if(W=ee.pop(),W.ranges){if(zo(W,te),d&&!W.equals(e.sel)){Yi(e,W,{clearRedo:!1});return}$=W}else if(l){ee.push(W);return}else break;var Me=[];zo($,te),te.push({changes:Me,generation:b.generation}),b.generation=W.generation||++b.maxGeneration;for(var He=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),xt=function(Tn){var Wn=W.changes[Tn];if(Wn.origin=t,He&&!Ls(e,Wn,!1))return ee.length=0,{};Me.push(rs(e,Wn));var Yn=Tn?fi(e,Wn):at(ee);Lo(e,Wn,Yn,xs(e,Wn)),!Tn&&e.cm&&e.cm.scrollIntoView({from:Wn.from,to:hr(Wn)});var Zn=[];Ai(e,function(Xn,ar){!ar&&ie(Zn,Xn.history)==-1&&(Ns(Xn.history,Wn),Zn.push(Xn.history)),Lo(Xn,Wn,null,xs(Xn,Wn))})},pt=W.changes.length-1;pt>=0;--pt){var on=xt(pt);if(on)return on.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new Gi(Jt(e.sel.ranges,function(b){return new Vr(pn(b.anchor.line+t,b.anchor.ch),pn(b.head.line+t,b.head.ch))}),e.sel.primIndex),e.cm){qr(e.cm,e.first,e.first-t,t);for(var d=e.cm.display,l=d.viewFrom;l<d.viewTo;l++)ii(e.cm,l,"gutter")}}function Lo(e,t,d,l){if(e.cm&&!e.cm.curOp)return bi(e.cm,Lo)(e,t,d,l);if(t.to.line<e.first){Ms(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var b=t.text.length-1-(e.first-t.from.line);Ms(e,b),t={from:pn(e.first,0),to:pn(t.to.line+b,t.to.ch),text:[at(t.text)],origin:t.origin}}var W=e.lastLine();t.to.line>W&&(t={from:t.from,to:pn(W,Cn(e,W).text.length),text:[t.text[0]],origin:t.origin}),t.removed=br(e,t.from,t.to),d||(d=fi(e,t)),e.cm?bl(e.cm,t,l):Wa(e,t,l),Yo(e,d,xe),e.cantEdit&&Xo(e,pn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,d){var l=e.doc,b=e.display,W=t.from,$=t.to,ee=!1,te=W.line;e.options.lineWrapping||(te=cr(ot(Cn(l,W.line))),l.iter(te,$.line+1,function(pt){if(pt==b.maxLine)return ee=!0,!0})),l.sel.contains(t.from,t.to)>-1&&De(e),Wa(l,t,d,Qi(e)),e.options.lineWrapping||(l.iter(te,W.line+t.text.length,function(pt){var on=Gn(pt);on>b.maxLineLength&&(b.maxLine=pt,b.maxLineLength=on,b.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),Li(l,W.line),Na(e,400);var le=t.text.length-($.line-W.line)-1;t.full?qr(e):W.line==$.line&&t.text.length==1&&!va(e.doc,t)?ii(e,W.line,"text"):qr(e,W.line,$.line+1,le);var Me=ye(e,"changes"),He=ye(e,"change");if(He||Me){var xt={from:W,to:$,text:t.text,removed:t.removed,origin:t.origin};He&&Lt(e,"change",e,xt),Me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(xt)}e.display.selForContextMenu=null}function bo(e,t,d,l,b){var W;l||(l=d),or(l,d)<0&&(W=[l,d],d=W[0],l=W[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:d,to:l,text:t,origin:b})}function ks(e,t,d,l){d<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,d,l){for(var b=0;b<e.length;++b){var W=e[b],$=!0;if(W.ranges){W.copied||(W=e[b]=W.deepCopy(),W.copied=!0);for(var ee=0;ee<W.ranges.length;ee++)ks(W.ranges[ee].anchor,t,d,l),ks(W.ranges[ee].head,t,d,l);continue}for(var te=0;te<W.changes.length;++te){var le=W.changes[te];if(d<le.from.line)le.from=pn(le.from.line+l,le.from.ch),le.to=pn(le.to.line+l,le.to.ch);else if(t<=le.to.line){$=!1;break}}$||(e.splice(0,b+1),b=0)}}function Ns(e,t){var d=t.from.line,l=t.to.line,b=t.text.length-(l-d)-1;Is(e.done,d,l,b),Is(e.undone,d,l,b)}function Po(e,t,d,l){var b=t,W=t;return typeof t=="number"?W=Cn(e,X(e,t)):b=cr(t),b==null?null:(l(W,b)&&e.cm&&ii(e.cm,b,d),W)}function Mo(e){this.lines=e,this.parent=null;for(var t=0,d=0;d<e.length;++d)e[d].parent=this,t+=e[d].height;this.height=t}Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var d=e,l=e+t;d<l;++d){var b=this.lines[d];this.height-=b.height,Pt(b),Lt(b,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,d){this.height+=d,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var l=0;l<t.length;++l)t[l].parent=this},iterN:function(e,t,d){for(var l=e+t;e<l;++e)if(d(this.lines[e]))return!0}};function ko(e){this.children=e;for(var t=0,d=0,l=0;l<e.length;++l){var b=e[l];t+=b.chunkSize(),d+=b.height,b.parent=this}this.size=t,this.height=d,this.parent=null}ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var d=0;d<this.children.length;++d){var l=this.children[d],b=l.chunkSize();if(e<b){var W=Math.min(t,b-e),$=l.height;if(l.removeInner(e,W),this.height-=$-l.height,b==W&&(this.children.splice(d--,1),l.parent=null),(t-=W)==0)break;e=0}else e-=b}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var ee=[];this.collapse(ee),this.children=[new Mo(ee)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,d){this.size+=t.length,this.height+=d;for(var l=0;l<this.children.length;++l){var b=this.children[l],W=b.chunkSize();if(e<=W){if(b.insertInner(e,t,d),b.lines&&b.lines.length>50){for(var $=b.lines.length%25+25,ee=$;ee<b.lines.length;){var te=new Mo(b.lines.slice(ee,ee+=25));b.height-=te.height,this.children.splice(++l,0,te),te.parent=this}b.lines=b.lines.slice(0,$),this.maybeSpill()}break}e-=W}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),d=new ko(t);if(e.parent){e.size-=d.size,e.height-=d.height;var b=ie(e.parent.children,e);e.parent.children.splice(b+1,0,d)}else{var l=new ko(e.children);l.parent=e,e.children=[l,d],e=l}d.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,d){for(var l=0;l<this.children.length;++l){var b=this.children[l],W=b.chunkSize();if(e<W){var $=Math.min(t,W-e);if(b.iterN(e,$,d))return!0;if((t-=$)==0)break;e=0}else e-=W}}};var Io=function(e,t,d){if(d)for(var l in d)d.hasOwnProperty(l)&&(this[l]=d[l]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,d=this.line,l=cr(d);if(l==null||!t)return;for(var b=0;b<t.length;++b)t[b]==this&&t.splice(b--,1);t.length||(d.widgets=null);var W=Jr(this);rr(d,Math.max(0,d.height-W)),e&&(Ki(e,function(){Us(e,d,-W),ii(e,l,"widget")}),Lt(e,"lineWidgetCleared",e,this,l))},Io.prototype.changed=function(){var e=this,t=this.height,d=this.doc.cm,l=this.line;this.height=null;var b=Jr(this)-t;if(!b)return;Xt(this.doc,l)||rr(l,l.height+b),d&&Ki(d,function(){d.curOp.forceUpdate=!0,Us(d,l,b),Lt(d,"lineWidgetChanged",d,e,cr(l))})},we(Io);function Us(e,t,d){Pn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,d)}function El(e,t,d,l){var b=new Io(e,d,l),W=e.cm;return W&&b.noHScroll&&(W.display.alignWidgets=!0),Po(e,t,"widget",function($){var ee=$.widgets||($.widgets=[]);if(b.insertAt==null?ee.push(b):ee.splice(Math.min(ee.length-1,Math.max(0,b.insertAt)),0,b),b.line=$,W&&!Xt(e,$)){var te=Pn($)<e.scrollTop;rr($,$.height+Jr(b)),te&&Va(W,b.height),W.curOp.forceUpdate=!0}return!0}),W&&Lt(W,"lineWidgetAdded",W,b,typeof t=="number"?t:cr(t)),b}var js=0,qa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};qa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ua(e),ye(this,"clear")){var d=this.find();d&&Lt(this,"clear",d.from,d.to)}for(var l=null,b=null,W=0;W<this.lines.length;++W){var $=this.lines[W],ee=Bn($.markedSpans,this);e&&!this.collapsed?ii(e,cr($),"text"):e&&(ee.to!=null&&(b=cr($)),ee.from!=null&&(l=cr($))),$.markedSpans=_n($.markedSpans,ee),ee.from==null&&this.collapsed&&!Xt(this.doc,$)&&e&&rr($,Wr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var le=ot(this.lines[te]),Me=Gn(le);Me>e.display.maxLineLength&&(e.display.maxLine=le,e.display.maxLineLength=Me,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&qr(e,l,b+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Lt(e,"markerCleared",e,this,l,b),t&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var d,l,b=0;b<this.lines.length;++b){var W=this.lines[b],$=Bn(W.markedSpans,this);if($.from!=null&&(d=pn(t?W:cr(W),$.from),e==-1))return d;if($.to!=null&&(l=pn(t?W:cr(W),$.to),e==1))return l}return d&&{from:d,to:l}},qa.prototype.changed=function(){var e=this,t=this.find(-1,!0),d=this,l=this.doc.cm;if(!t||!l)return;Ki(l,function(){var b=t.line,W=cr(t.line),$=qe(l,W);if($&&(fr($),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Xt(d.doc,b)&&d.height!=null){var ee=d.height;d.height=null;var te=Jr(d)-ee;te&&rr(b,b.height+te)}Lt(l,"markerChanged",l,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ie(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice(ie(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},we(qa);function Eo(e,t,d,l,b){if(l&&l.shared)return xl(e,t,d,l,b);if(e.cm&&!e.cm.curOp)return bi(e.cm,Eo)(e,t,d,l,b);var W=new qa(e,b),$=or(t,d);if(l&&w(l,W,!1),$>0||$==0&&W.clearWhenEmpty!==!1)return W;if(W.replacedWith&&(W.collapsed=!0,W.widgetNode=y("span",[W.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||W.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(W.widgetNode.insertLeft=!0)),W.collapsed){if(_t(e,t.line,t,d,W)||t.line!=d.line&&_t(e,d.line,t,d,W))throw new Error("Inserting collapsed marker partially overlapping an existing one");ri()}W.addToHistory&&bs(e,{from:t,to:d,origin:"markText"},e.sel,NaN);var ee=t.line,te=e.cm,le;if(e.iter(ee,d.line+1,function(He){te&&W.collapsed&&!te.options.lineWrapping&&ot(He)==te.display.maxLine&&(le=!0),W.collapsed&&ee!=t.line&&rr(He,0),Sn(He,new Br(W,ee==t.line?t.ch:null,ee==d.line?d.ch:null)),++ee}),W.collapsed&&e.iter(t.line,d.line+1,function(He){Xt(e,He)&&rr(He,0)}),W.clearOnEnter&&Fe(W,"beforeCursorEnter",function(){return W.clear()}),W.readOnly&&(Sr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),W.collapsed&&(W.id=++js,W.atomic=!0),te){if(le&&(te.curOp.updateMaxLine=!0),W.collapsed)qr(te,t.line,d.line+1);else if(W.className||W.startStyle||W.endStyle||W.css||W.attributes||W.title)for(var Me=t.line;Me<=d.line;Me++)ii(te,Me,"text");W.atomic&&Os(te.doc),Lt(te,"markerAdded",te,W)}return W}var No=function(e,t){this.markers=e,this.primary=t;for(var d=0;d<e.length;++d)e[d].parent=this};No.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Lt(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},we(No);function xl(e,t,d,l,b){l=w(l),l.shared=!1;var W=[Eo(e,t,d,l,b)],$=W[0],ee=l.widgetNode;return Ai(e,function(te){ee&&(l.widgetNode=ee.cloneNode(!0)),W.push(Eo(te,L(te,t),L(te,d),l,b));for(var le=0;le<te.linked.length;++le)if(te.linked[le].isParent)return;$=at(W)}),new No(W,$)}function Fs(e){return e.findMarks(pn(e.first,0),e.clipPos(pn(e.lastLine())),function(t){return t.parent})}function wl(e,t){for(var d=0;d<t.length;d++){var l=t[d],b=l.find(),W=e.clipPos(b.from),$=e.clipPos(b.to);if(or(W,$)){var ee=Eo(e,W,$,l.primary,l.primary.type);l.markers.push(ee),ee.parent=l}}}function Cl(e){for(var t=function(l){var b=e[l],W=[b.primary.doc];Ai(b.primary.doc,function(te){return W.push(te)});for(var $=0;$<b.markers.length;$++){var ee=b.markers[$];ie(W,ee.doc)==-1&&(ee.parent=null,b.markers.splice($--,1))}},d=0;d<e.length;d++)t(d)}var Tl=0,ta=function(e,t,d,l,b){if(!(this instanceof ta))return new ta(e,t,d,l,b);d==null&&(d=0),ko.call(this,[new Mo([new Nn("",null)])]),this.first=d,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=d;var W=pn(d,0);this.sel=$n(W),this.history=new Go(null),this.id=++Tl,this.modeOption=t,this.lineSep=l,this.direction=b=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:W,to:W,text:e}),Yi(this,$n(W),xe)};ta.prototype=ze(ko.prototype,{constructor:ta,iter:function(e,t,d){d?this.iterN(e-this.first,t-e,d):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var d=0,l=0;l<t.length;++l)d+=t[l].height;this.insertInner(e-this.first,t,d)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Er(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ei(function(e){var t=pn(this.first,0),d=this.first+this.size-1;yo(this,{from:t,to:pn(d,Cn(this,d).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),Yi(this,$n(t),xe)}),replaceRange:function(e,t,d,l){t=L(this,t),d=d?L(this,d):t,bo(this,e,t,d,l)},getRange:function(e,t,d){var l=br(this,L(this,e),L(this,t));return d===!1?l:l.join(d||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Kr(this,e))return Cn(this,e)},getLineNumber:function(e){return cr(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Cn(this,e)),ot(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return L(this,e)},getCursor:function(e){var t=this.sel.primary(),d;return e==null||e=="head"?d=t.head:e=="anchor"?d=t.anchor:e=="end"||e=="to"||e===!1?d=t.to():d=t.from(),d},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ei(function(e,t,d){Cs(this,L(this,typeof e=="number"?pn(e,t||0):e),null,d)}),setSelection:Ei(function(e,t,d){Cs(this,L(this,e),L(this,t||e),d)}),extendSelection:Ei(function(e,t,d){Vo(this,L(this,e),t&&L(this,t),d)}),extendSelections:Ei(function(e,t){ws(this,z(this,e),t)}),extendSelectionsBy:Ei(function(e,t){var d=Jt(this.sel.ranges,e);ws(this,z(this,d),t)}),setSelections:Ei(function(e,t,d){if(!e.length)return;for(var l=[],b=0;b<e.length;b++)l[b]=new Vr(L(this,e[b].anchor),L(this,e[b].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Yi(this,Or(this.cm,l,t),d)}),addSelection:Ei(function(e,t,d){var l=this.sel.ranges.slice(0);l.push(new Vr(L(this,e),L(this,t||e))),Yi(this,Or(this.cm,l,l.length-1),d)}),getSelection:function(e){for(var t=this.sel.ranges,d,l=0;l<t.length;l++){var b=br(this,t[l].from(),t[l].to());d=d?d.concat(b):b}return e===!1?d:d.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],d=this.sel.ranges,l=0;l<d.length;l++){var b=br(this,d[l].from(),d[l].to());e!==!1&&(b=b.join(e||this.lineSeparator())),t[l]=b}return t},replaceSelection:function(e,t,d){for(var l=[],b=0;b<this.sel.ranges.length;b++)l[b]=e;this.replaceSelections(l,t,d||"+input")},replaceSelections:Ei(function(e,t,d){for(var l=[],b=this.sel,W=0;W<b.ranges.length;W++){var $=b.ranges[W];l[W]={from:$.from(),to:$.to(),text:this.splitLines(e[W]),origin:d}}for(var ee=t&&t!="end"&&aa(this,l,t),te=l.length-1;te>=0;te--)yo(this,l[te]);ee?Ts(this,ee):this.cm&&_a(this.cm)}),undo:Ei(function(){$o(this,"undo")}),redo:Ei(function(){$o(this,"redo")}),undoSelection:Ei(function(){$o(this,"undo",!0)}),redoSelection:Ei(function(){$o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,d=0,l=0;l<e.done.length;l++)e.done[l].ranges||++t;for(var b=0;b<e.undone.length;b++)e.undone[b].ranges||++d;return{undo:t,redo:d}},clearHistory:function(){var e=this;this.history=new Go(this.history.maxGeneration),Ai(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vo(this.history.done),undone:vo(this.history.undone)}},setHistory:function(e){var t=this.history=new Go(this.history.maxGeneration);t.done=vo(e.done.slice(0),null,!0),t.undone=vo(e.undone.slice(0),null,!0)},setGutterMarker:Ei(function(e,t,d){return Po(this,e,"gutter",function(l){var b=l.gutterMarkers||(l.gutterMarkers={});return b[t]=d,!d&&oe(b)&&(l.gutterMarkers=null),!0})}),clearGutter:Ei(function(e){var t=this;this.iter(function(d){d.gutterMarkers&&d.gutterMarkers[e]&&Po(t,d,"gutter",function(){return d.gutterMarkers[e]=null,oe(d.gutterMarkers)&&(d.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Kr(this,e))return null;if(t=e,e=Cn(this,e),!e)return null}else if(t=cr(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ei(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(l){var b=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[b])l[b]=d;else{if(S(d).test(l[b]))return!1;l[b]+=" "+d}return!0})}),removeLineClass:Ei(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(l){var b=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",W=l[b];if(W)if(d==null)l[b]=null;else{var $=W.match(S(d));if(!$)return!1;var ee=$.index+$[0].length;l[b]=W.slice(0,$.index)+(!$.index||ee==W.length?"":" ")+W.slice(ee)||null}else return!1;return!0})}),addLineWidget:Ei(function(e,t,d){return El(this,e,t,d)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,d){return Eo(this,L(this,e),L(this,t),d,d&&d.type||"range")},setBookmark:function(e,t){var d={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=L(this,e),Eo(this,e,e,d,"bookmark")},findMarksAt:function(e){e=L(this,e);var t=[],d=Cn(this,e.line).markedSpans;if(d)for(var l=0;l<d.length;++l){var b=d[l];(b.from==null||b.from<=e.ch)&&(b.to==null||b.to>=e.ch)&&t.push(b.marker.parent||b.marker)}return t},findMarks:function(e,t,d){e=L(this,e),t=L(this,t);var l=[],b=e.line;return this.iter(e.line,t.line+1,function(W){var $=W.markedSpans;if($)for(var ee=0;ee<$.length;ee++){var te=$[ee];!(te.to!=null&&b==e.line&&e.ch>=te.to||te.from==null&&b!=e.line||te.from!=null&&b==t.line&&te.from>=t.ch)&&(!d||d(te.marker))&&l.push(te.marker.parent||te.marker)}++b}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var d=t.markedSpans;if(d)for(var l=0;l<d.length;++l)d[l].from!=null&&e.push(d[l].marker)}),e},posFromIndex:function(e){var t,d=this.first,l=this.lineSeparator().length;return this.iter(function(b){var W=b.text.length+l;if(W>e)return t=e,!0;e-=W,++d}),L(this,pn(d,t))},indexFromPos:function(e){e=L(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var d=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){t+=l.text.length+d}),t},copy:function(e){var t=new ta(Er(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,d=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<d&&(d=e.to);var l=new ta(Er(this,t,d),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(l,Fs(this)),l},unlinkDoc:function(e){if(e instanceof xi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var d=this.linked[t];if(d.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(Fs(this));break}if(e.history==this.history){var l=[e.id];Ai(e,function(b){return l.push(b.id)},!0),e.history=new Go(null),e.history.done=vo(this.history.done,l),e.history.undone=vo(this.history.undone,l)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Et(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ei(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),ta.prototype.eachLine=ta.prototype.iter;var Bs=0;function Sl(e){var t=this;if(Hs(t),st(t,e)||vi(t.display,e))return;ae(e),K&&(Bs=+new Date);var d=Ri(t,e,!0),l=e.dataTransfer.files;if(!d||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var b=l.length,W=Array(b),$=0,ee=function(){++$==b&&bi(t,function(){d=L(t.doc,d);var pt={from:d,to:d,text:t.doc.splitLines(W.filter(function(on){return on!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,pt),Ts(t.doc,$n(L(t.doc,d),L(t.doc,hr(pt))))})()},te=function(pt,on){if(t.options.allowDropFileTypes&&ie(t.options.allowDropFileTypes,pt.type)==-1){ee();return}var Tn=new FileReader;Tn.onerror=function(){return ee()},Tn.onload=function(){var Wn=Tn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Wn)){ee();return}W[on]=Wn,ee()},Tn.readAsText(pt)},le=0;le<l.length;le++)te(l[le],le);else{if(t.state.draggingText&&t.doc.sel.contains(d)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Me=e.dataTransfer.getData("Text");if(Me){var He;if(t.state.draggingText&&!t.state.draggingText.copy&&(He=t.listSelections()),Yo(t.doc,$n(d,d)),He)for(var xt=0;xt<He.length;++xt)bo(t.doc,"",He[xt].anchor,He[xt].head,"drag");t.replaceSelection(Me,"around","paste"),t.display.input.focus()}}catch(pt){}}}function Ol(e,t){if(K&&(!e.state.draggingText||+new Date-Bs<100)){_e(t);return}if(st(e,t)||vi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var d=h("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(d.width=d.height=1,e.display.wrapper.appendChild(d),d._top=d.offsetTop),t.dataTransfer.setDragImage(d,0,0),p&&d.parentNode.removeChild(d)}}function Rl(e,t){var d=Ri(e,t);if(!d)return;var l=document.createDocumentFragment();qi(e,d,l),e.display.dragCursor||(e.display.dragCursor=h("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,l)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),d=[],l=0;l<t.length;l++){var b=t[l].CodeMirror;b&&d.push(b)}d.length&&d[0].operation(function(){for(var W=0;W<d.length;W++)e(d[W])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;Fe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ll)},100))}),Fe(window,"blur",function(){return Ws(Ca)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var eo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Uo=0;Uo<10;Uo++)eo[Uo+48]=eo[Uo+96]=String(Uo);for(var Jo=65;Jo<=90;Jo++)eo[Jo]=String.fromCharCode(Jo);for(var jo=1;jo<=12;jo++)eo[jo+111]=eo[jo+63235]="F"+jo;var Ka={};Ka.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ka.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ka.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ka.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ka.default=i?Ka.macDefault:Ka.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var d,l,b,W,$=0;$<t.length-1;$++){var ee=t[$];if(/^(cmd|meta|m)$/i.test(ee))W=!0;else if(/^a(lt)?$/i.test(ee))d=!0;else if(/^(c|ctrl|control)$/i.test(ee))l=!0;else if(/^s(hift)?$/i.test(ee))b=!0;else throw new Error("Unrecognized modifier name: "+ee)}return d&&(e="Alt-"+e),l&&(e="Ctrl-"+e),W&&(e="Cmd-"+e),b&&(e="Shift-"+e),e}function Ml(e){var t={};for(var d in e)if(e.hasOwnProperty(d)){var l=e[d];if(/^(name|fallthrough|(de|at)tach)$/.test(d))continue;if(l=="..."){delete e[d];continue}for(var b=Jt(d.split(" "),Pl),W=0;W<b.length;W++){var $=void 0,ee=void 0;W==b.length-1?(ee=b.join(" "),$=l):(ee=b.slice(0,W+1).join(" "),$="...");var te=t[ee];if(!te)t[ee]=$;else if(te!=$)throw new Error("Inconsistent bindings for "+ee)}delete e[d]}for(var le in t)e[le]=t[le];return e}function xo(e,t,d,l){t=Qo(t);var b=t.call?t.call(e,l):t[e];if(b===!1)return"nothing";if(b==="...")return"multi";if(b!=null&&d(b))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return xo(e,t.fallthrough,d,l);for(var W=0;W<t.fallthrough.length;W++){var $=xo(e,t.fallthrough[W],d,l);if($)return $}}}function Gs(e){var t=typeof e=="string"?e:eo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function zs(e,t,d){var l=e;return t.altKey&&l!="Alt"&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!d&&t.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(p&&e.keyCode==34&&e.char)return!1;var d=eo[e.keyCode];return d==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(d=e.code),zs(d,e,t))}function Qo(e){return typeof e=="string"?Ka[e]:e}function wo(e,t){for(var d=e.doc.sel.ranges,l=[],b=0;b<d.length;b++){for(var W=t(d[b]);l.length&&or(W.from,at(l).to)<=0;){var $=l.pop();if(or($.from,W.from)<0){W.from=$.from;break}}l.push(W)}Ki(e,function(){for(var ee=l.length-1;ee>=0;ee--)bo(e.doc,"",l[ee].from,l[ee].to,"+delete");_a(e)})}function os(e,t,d){var l=Xe(e.text,t+d,d);return l<0||l>e.text.length?null:l}function ss(e,t,d){var l=os(e,t.ch,d);return l==null?null:new pn(t.line,l,d<0?"after":"before")}function ls(e,t,d,l,b){if(e){t.doc.direction=="rtl"&&(b=-b);var W=En(d,t.doc.direction);if(W){var $=b<0?at(W):W[0],ee=b<0==($.level==1),te=ee?"after":"before",le;if($.level>0||t.doc.direction=="rtl"){var Me=Ie(t,d);le=b<0?d.text.length-1:0;var He=ut(t,Me,le).top;le=Bt(function(xt){return ut(t,Me,xt).top==He},b<0==($.level==1)?$.from:$.to-1,le),te=="before"&&(le=os(d,le,1))}else le=b<0?$.to:$.from;return new pn(l,le,te)}}return new pn(l,b<0?d.text.length:0,b<0?"before":"after")}function kl(e,t,d,l){var b=En(t,e.doc.direction);if(!b)return ss(t,d,l);d.ch>=t.text.length?(d.ch=t.text.length,d.sticky="before"):d.ch<=0&&(d.ch=0,d.sticky="after");var W=tt(b,d.ch,d.sticky),$=b[W];if(e.doc.direction=="ltr"&&$.level%2==0&&(l>0?$.to>d.ch:$.from<d.ch))return ss(t,d,l);var ee=function(Yn,Zn){return os(t,Yn instanceof pn?Yn.ch:Yn,Zn)},te,le=function(Yn){return e.options.lineWrapping?(te=te||Ie(e,t),ir(e,t,te,Yn)):{begin:0,end:t.text.length}},Me=le(d.sticky=="before"?ee(d,-1):d.ch);if(e.doc.direction=="rtl"||$.level==1){var He=$.level==1==l<0,xt=ee(d,He?1:-1);if(xt!=null&&(He?xt<=$.to&&xt<=Me.end:xt>=$.from&&xt>=Me.begin)){var pt=He?"before":"after";return new pn(d.line,xt,pt)}}var on=function(Yn,Zn,Xn){for(var ar=function(pi,Hi){return Hi?new pn(d.line,ee(pi,1),"before"):new pn(d.line,pi,"after")};Yn>=0&&Yn<b.length;Yn+=Zn){var Tr=b[Yn],_r=Zn>0==(Tr.level!=1),Fr=_r?Xn.begin:ee(Xn.end,-1);if(Tr.from<=Fr&&Fr<Tr.to)return ar(Fr,_r);if(Fr=_r?Tr.from:ee(Tr.to,-1),Xn.begin<=Fr&&Fr<Xn.end)return ar(Fr,_r)}},Tn=on(W+l,l,Me);if(Tn)return Tn;var Wn=l>0?Me.end:ee(Me.begin,-1);return Wn!=null&&!(l>0&&Wn==t.text.length)&&(Tn=on(l>0?0:b.length-1,l,le(Wn)),Tn)?Tn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return wo(e,function(t){if(t.empty()){var d=Cn(e.doc,t.head.line).text.length;return t.head.ch==d&&t.head.line<e.lastLine()?{from:t.head,to:pn(t.head.line+1,0)}:{from:t.head,to:pn(t.head.line,d)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return wo(e,function(t){return{from:pn(t.from().line,0),to:L(e.doc,pn(t.to().line+1,0))}})},delLineLeft:function(e){return wo(e,function(t){return{from:pn(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return{from:l,to:t.from()}})},delWrappedLineRight:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div");return{from:t.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(pn(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(pn(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div")},Qe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:d},"div")},Qe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return l.ch<e.getLine(l.line).search(/\S/)?Xs(e,t.head):l},Qe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],d=e.listSelections(),l=e.options.tabSize,b=0;b<d.length;b++){var W=d[b].from(),$=Y(e.getLine(W.line),W.ch,l);t.push(fe(l-$%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ki(e,function(){for(var t=e.listSelections(),d=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var b=t[l].head,W=Cn(e.doc,b.line).text;if(W){if(b.ch==W.length&&(b=new pn(b.line,b.ch-1)),b.ch>0)b=new pn(b.line,b.ch+1),e.replaceRange(W.charAt(b.ch-1)+W.charAt(b.ch-2),pn(b.line,b.ch-2),b,"+transpose");else if(b.line>e.doc.first){var $=Cn(e.doc,b.line-1).text;$&&(b=new pn(b.line,1),e.replaceRange(W.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),pn(b.line-1,$.length-1),b,"+transpose"))}}d.push(new Vr(b,b))}e.setSelections(d)})},newlineAndIndent:function(e){return Ki(e,function(){for(var t=e.listSelections(),d=t.length-1;d>=0;d--)e.replaceRange(e.doc.lineSeparator(),t[d].anchor,t[d].head,"+input");t=e.listSelections();for(var l=0;l<t.length;l++)e.indentLine(t[l].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var d=Cn(e.doc,t),l=ot(d);return l!=d&&(t=cr(l)),ls(!0,e,l,t,1)}function Il(e,t){var d=Cn(e.doc,t),l=ht(d);return l!=d&&(t=cr(l)),ls(!0,e,d,t,-1)}function Xs(e,t){var d=Ys(e,t.line),l=Cn(e.doc,d.line),b=En(l,e.doc.direction);if(!b||b[0].level==0){var W=Math.max(d.ch,l.text.search(/\S/)),$=t.line==d.line&&t.ch<=W&&t.ch;return pn(d.line,$?0:W,d.sticky)}return d}function Zo(e,t,d){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var l=e.display.shift,b=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d&&(e.display.shift=!1),b=t(e)!=Je}finally{e.display.shift=l,e.state.suppressEdits=!1}return b}function Nl(e,t,d){for(var l=0;l<e.state.keyMaps.length;l++){var b=xo(t,e.state.keyMaps[l],d,e);if(b)return b}return e.options.extraKeys&&xo(t,e.options.extraKeys,d,e)||xo(t,e.options.keyMap,d,e)}var Ul=new q;function Bo(e,t,d,l){var b=e.state.keySeq;if(b){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==b&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,b+" "+t,d,l))return!0}return $s(e,t,d,l)}function $s(e,t,d,l){var b=Nl(e,t,l);return b=="multi"&&(e.state.keySeq=t),b=="handled"&&Lt(e,"keyHandled",e,t,d),(b=="handled"||b=="multi")&&(ae(d),Ti(e)),!!b}function Js(e,t){var d=Vs(t,!0);return d?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+d,t,function(l){return Zo(e,l,!0)})||Bo(e,d,t,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return Zo(e,l)}):Bo(e,d,t,function(l){return Zo(e,l)}):!1}function jl(e,t,d){return Bo(e,"'"+d+"'",t,function(l){return Zo(e,l,!0)})}var us=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),st(t,e))return;K&&I<11&&e.keyCode==27&&(e.returnValue=!1);var d=e.keyCode;t.display.shift=d==16||e.shiftKey;var l=Js(t,e);p&&(us=l?d:null,!l&&d==88&&!lt&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),U&&!i&&!l&&d==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),d==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function d(l){(l.keyCode==18||!l.altKey)&&(v(t,"CodeMirror-crosshair"),At(document,"keyup",d),At(document,"mouseover",d))}Fe(document,"keyup",d),Fe(document,"mouseover",d)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),st(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(vi(t.display,e)||st(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var d=e.keyCode,l=e.charCode;if(p&&d==us){us=null,ae(e);return}if(p&&(!e.which||e.which<10)&&Js(t,e))return;var b=String.fromCharCode(l==null?d:l);if(b=="\b")return;if(jl(t,e,b))return;t.display.input.onKeyPress(e)}var Bl=400,cs=function(e,t,d){this.time=e,this.pos=t,this.button=d};cs.prototype.compare=function(e,t,d){return this.time+Bl>e&&or(t,this.pos)==0&&d==this.button};var Ho,Wo;function Hl(e,t){var d=+new Date;return Wo&&Wo.compare(d,e,t)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(d,e,t)?(Wo=new cs(d,e,t),Ho=null,"double"):(Ho=new cs(d,e,t),Wo=null,"single")}function el(e){var t=this,d=t.display;if(st(t,e)||d.activeTouch&&d.input.supportsTouch())return;if(d.input.ensurePolled(),d.shift=e.shiftKey,vi(d,e)){r||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100));return}if(ds(t,e))return;var l=Ri(t,e),b=Ke(e),W=l?Hl(l,b):"single";if(window.focus(),b==1&&t.state.selectingText&&t.state.selectingText(e),l&&Wl(t,b,l,W,e))return;b==1?l?Gl(t,l,W,e):be(e)==d.scroller&&ae(e):b==2?(l&&Vo(t.doc,l),setTimeout(function(){return d.input.focus()},20)):b==3&&(R?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,d,l,b){var W="Click";return l=="double"?W="Double"+W:l=="triple"&&(W="Triple"+W),W=(t==1?"Left":t==2?"Middle":"Right")+W,Bo(e,zs(W,b),b,function($){if(typeof $=="string"&&($=Fo[$]),!$)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=$(e,d)!=Je}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,d){var l=e.getOption("configureMouse"),b=l?l(e,t,d):{};if(b.unit==null){var W=n?d.shiftKey&&d.metaKey:d.altKey;b.unit=W?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(b.extend==null||e.doc.extend)&&(b.extend=e.doc.extend||d.shiftKey),b.addNew==null&&(b.addNew=i?d.metaKey:d.ctrlKey),b.moveOnDrag==null&&(b.moveOnDrag=!(i?d.altKey:d.ctrlKey)),b}function Gl(e,t,d,l){K?setTimeout(F(Ma,e),0):e.curOp.focus=j();var b=Kl(e,d,l),W=e.doc.sel,$;e.options.dragDrop&&Ot&&!e.isReadOnly()&&d=="single"&&($=W.contains(t))>-1&&(or(($=W.ranges[$]).from(),t)<0||t.xRel>0)&&(or($.to(),t)>0||t.xRel<0)?zl(e,l,t,b):Vl(e,l,t,b)}function zl(e,t,d,l){var b=e.display,W=!1,$=bi(e,function(le){r&&(b.scroller.draggable=!1),e.state.draggingText=!1,At(b.wrapper.ownerDocument,"mouseup",$),At(b.wrapper.ownerDocument,"mousemove",ee),At(b.scroller,"dragstart",te),At(b.scroller,"drop",$),W||(ae(le),l.addNew||Vo(e.doc,d,null,null,l.extend),r&&!m||K&&I==9?setTimeout(function(){b.wrapper.ownerDocument.body.focus({preventScroll:!0}),b.input.focus()},20):b.input.focus())}),ee=function(le){W=W||Math.abs(t.clientX-le.clientX)+Math.abs(t.clientY-le.clientY)>=10},te=function(){return W=!0};r&&(b.scroller.draggable=!0),e.state.draggingText=$,$.copy=!l.moveOnDrag,b.scroller.dragDrop&&b.scroller.dragDrop(),Fe(b.wrapper.ownerDocument,"mouseup",$),Fe(b.wrapper.ownerDocument,"mousemove",ee),Fe(b.scroller,"dragstart",te),Fe(b.scroller,"drop",$),no(e),setTimeout(function(){return b.input.focus()},20)}function tl(e,t,d){if(d=="char")return new Vr(t,t);if(d=="word")return e.findWordAt(t);if(d=="line")return new Vr(pn(t.line,0),L(e.doc,pn(t.line+1,0)));var l=d(e,t);return new Vr(l.from,l.to)}function Vl(e,t,d,l){var b=e.display,W=e.doc;ae(t);var $,ee,te=W.sel,le=te.ranges;if(l.addNew&&!l.extend?(ee=W.sel.contains(d),ee>-1?$=le[ee]:$=new Vr(d,d)):($=W.sel.primary(),ee=W.sel.primIndex),l.unit=="rectangle")l.addNew||($=new Vr(d,d)),d=Ri(e,t,!0,!0),ee=-1;else{var Me=tl(e,d,l.unit);l.extend?$=is($,Me.anchor,Me.head,l.extend):$=Me}l.addNew?ee==-1?(ee=le.length,Yi(W,Or(e,le.concat([$]),ee),{scroll:!1,origin:"*mouse"})):le.length>1&&le[ee].empty()&&l.unit=="char"&&!l.extend?(Yi(W,Or(e,le.slice(0,ee).concat(le.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),te=W.sel):as(W,ee,$,ke):(ee=0,Yi(W,new Gi([$],0),ke),te=W.sel);var He=d;function xt(Xn){if(or(He,Xn)==0)return;if(He=Xn,l.unit=="rectangle"){for(var ar=[],Tr=e.options.tabSize,_r=Y(Cn(W,d.line).text,d.ch,Tr),Fr=Y(Cn(W,Xn.line).text,Xn.ch,Tr),pi=Math.min(_r,Fr),Hi=Math.max(_r,Fr),Ci=Math.min(d.line,Xn.line),oa=Math.min(e.lastLine(),Math.max(d.line,Xn.line));Ci<=oa;Ci++){var na=Cn(W,Ci).text,ki=Ye(na,pi,Tr);pi==Hi?ar.push(new Vr(pn(Ci,ki),pn(Ci,ki))):na.length>ki&&ar.push(new Vr(pn(Ci,ki),pn(Ci,Ye(na,Hi,Tr))))}ar.length||ar.push(new Vr(d,d)),Yi(W,Or(e,te.ranges.slice(0,ee).concat(ar),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Xn)}else{var ra=$,zi=tl(e,Xn,l.unit),Ui=ra.anchor,Ii;or(zi.anchor,Ui)>0?(Ii=zi.head,Ui=ni(ra.from(),zi.anchor)):(Ii=zi.anchor,Ui=ti(ra.to(),zi.head));var Oi=te.ranges.slice(0);Oi[ee]=Yl(e,new Vr(L(W,Ui),Ii)),Yi(W,Or(e,Oi,ee),ke)}}var pt=b.wrapper.getBoundingClientRect(),on=0;function Tn(Xn){var ar=++on,Tr=Ri(e,Xn,!0,l.unit=="rectangle");if(!Tr)return;if(or(Tr,He)!=0){e.curOp.focus=j(),xt(Tr);var _r=ka(b,W);(Tr.line>=_r.to||Tr.line<_r.from)&&setTimeout(bi(e,function(){on==ar&&Tn(Xn)}),150)}else{var Fr=Xn.clientY<pt.top?-20:Xn.clientY>pt.bottom?20:0;Fr&&setTimeout(bi(e,function(){if(on!=ar)return;b.scroller.scrollTop+=Fr,Tn(Xn)}),50)}}function Wn(Xn){e.state.selectingText=!1,on=Infinity,Xn&&(ae(Xn),b.input.focus()),At(b.wrapper.ownerDocument,"mousemove",Yn),At(b.wrapper.ownerDocument,"mouseup",Zn),W.history.lastSelOrigin=null}var Yn=bi(e,function(Xn){Xn.buttons===0||!Ke(Xn)?Wn(Xn):Tn(Xn)}),Zn=bi(e,Wn);e.state.selectingText=Zn,Fe(b.wrapper.ownerDocument,"mousemove",Yn),Fe(b.wrapper.ownerDocument,"mouseup",Zn)}function Yl(e,t){var d=t.anchor,l=t.head,b=Cn(e.doc,d.line);if(or(d,l)==0&&d.sticky==l.sticky)return t;var W=En(b);if(!W)return t;var $=tt(W,d.ch,d.sticky),ee=W[$];if(ee.from!=d.ch&&ee.to!=d.ch)return t;var te=$+(ee.from==d.ch==(ee.level!=1)?0:1);if(te==0||te==W.length)return t;var le;if(l.line!=d.line)le=(l.line-d.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Me=tt(W,l.ch,l.sticky),He=Me-$||(l.ch-d.ch)*(ee.level==1?-1:1);Me==te-1||Me==te?le=He<0:le=He>0}var xt=W[te+(le?-1:0)],pt=le==(xt.level==1),on=pt?xt.from:xt.to,Tn=pt?"after":"before";return d.ch==on&&d.sticky==Tn?t:new Vr(new pn(d.line,on,Tn),l)}function nl(e,t,d,l){var b,W;if(t.touches)b=t.touches[0].clientX,W=t.touches[0].clientY;else try{b=t.clientX,W=t.clientY}catch(xt){return!1}if(b>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ae(t);var $=e.display,ee=$.lineDiv.getBoundingClientRect();if(W>ee.bottom||!ye(e,d))return pe(t);W-=ee.top-$.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var le=$.gutters.childNodes[te];if(le&&le.getBoundingClientRect().right>=b){var Me=Pr(e.doc,W),He=e.display.gutterSpecs[te];return nt(e,d,e,Me,He.className,t),pe(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(vi(e.display,t)||Xl(e,t))return;if(st(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(e,t){return ye(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wr(e)}var Co={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function d(l,b,W,$){e.defaults[l]=b,W&&(t[l]=$?function(ee,te,le){le!=Co&&W(ee,te,le)}:W)}e.defineOption=d,e.Init=Co,d("value","",function(l,b){return l.setValue(b)},!0),d("mode",null,function(l,b){l.doc.modeOption=b,Mi(l)},!0),d("indentUnit",2,Mi,!0),d("indentWithTabs",!1),d("smartIndent",!0),d("tabSize",4,function(l){$i(l),wr(l),qr(l)},!0),d("lineSeparator",null,function(l,b){if(l.doc.lineSep=b,!b)return;var W=[],$=l.doc.first;l.doc.iter(function(te){for(var le=0;;){var Me=te.text.indexOf(b,le);if(Me==-1)break;le=Me+b.length,W.push(pn($,Me))}$++});for(var ee=W.length-1;ee>=0;ee--)bo(l.doc,b,W[ee],pn(W[ee].line,W[ee].ch+b.length))}),d("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,b,W){l.state.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),W!=Co&&l.refresh()}),d("specialCharPlaceholder",Rn,function(l){return l.refresh()},!0),d("electricChars",!0),d("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),d("spellcheck",!1,function(l,b){return l.getInputField().spellcheck=b},!0),d("autocorrect",!1,function(l,b){return l.getInputField().autocorrect=b},!0),d("autocapitalize",!1,function(l,b){return l.getInputField().autocapitalize=b},!0),d("rtlMoveVisually",!O),d("wholeLineUpdateBefore",!0),d("theme","default",function(l){il(l),ca(l)},!0),d("keyMap","default",function(l,b,W){var $=Qo(b),ee=W!=Co&&Qo(W);ee&&ee.detach&&ee.detach(l,$),$.attach&&$.attach(l,ee||null)}),d("extraKeys",null),d("configureMouse",null),d("lineWrapping",!1,Ql,!0),d("gutters",[],function(l,b){l.display.gutterSpecs=Bi(b,l.options.lineNumbers),ca(l)},!0),d("fixedGutter",!0,function(l,b){l.display.gutters.style.left=b?yi(l.display)+"px":"0",l.refresh()},!0),d("coverGutterNextToScrollbar",!1,function(l){return ma(l)},!0),d("scrollbarStyle","native",function(l){Ja(l),ma(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),d("lineNumbers",!1,function(l,b){l.display.gutterSpecs=Bi(l.options.gutters,b),ca(l)},!0),d("firstLineNumber",1,ca,!0),d("lineNumberFormatter",function(l){return l},ca,!0),d("showCursorWhenSelecting",!1,ei,!0),d("resetSelectionOnContextMenu",!0),d("lineWiseCopyCut",!0),d("pasteLinesPerSelection",!0),d("selectionsMayTouch",!1),d("readOnly",!1,function(l,b){b=="nocursor"&&(Ca(l),l.display.input.blur()),l.display.input.readOnlyChanged(b)}),d("screenReaderLabel",null,function(l,b){b=b===""?null:b,l.display.input.screenReaderLabelChanged(b)}),d("disableInput",!1,function(l,b){b||l.display.input.reset()},!0),d("dragDrop",!0,Jl),d("allowDropFileTypes",null),d("cursorBlinkRate",530),d("cursorScrollMargin",0),d("cursorHeight",1,ei,!0),d("singleCursorHeightPerLine",!0,ei,!0),d("workTime",100),d("workDelay",100),d("flattenSpans",!0,$i,!0),d("addModeClass",!1,$i,!0),d("pollInterval",100),d("undoDepth",200,function(l,b){return l.doc.history.undoDepth=b}),d("historyEventDelay",1250),d("viewportMargin",10,function(l){return l.refresh()},!0),d("maxHighlightLength",1e4,$i,!0),d("moveInputWithCursor",!0,function(l,b){b||l.display.input.resetPosition()}),d("tabindex",null,function(l,b){return l.display.input.getField().tabIndex=b||""}),d("autofocus",null),d("direction","ltr",function(l,b){return l.doc.setDirection(b)},!0),d("phrases",null)}function Jl(e,t,d){var l=d&&d!=Co;if(!t!=!l){var b=e.display.dragFunctions,W=t?Fe:At;W(e.display.scroller,"dragstart",b.start),W(e.display.scroller,"dragenter",b.enter),W(e.display.scroller,"dragover",b.over),W(e.display.scroller,"dragleave",b.leave),W(e.display.scroller,"drop",b.drop)}}function Ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),On(e)),ji(e),qr(e),wr(e),setTimeout(function(){return ma(e)},100)}function xi(e,t){var d=this;if(!(this instanceof xi))return new xi(e,t);this.options=t=t?w(t):{},w(al,t,!1);var l=t.value;typeof l=="string"?l=new ta(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var b=new xi.inputStyles[t.inputStyle](this),W=this.display=new ja(e,l,b,t);W.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ja(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new q,keySeq:null,specialChars:null},t.autofocus&&!s&&W.input.focus(),K&&I<11&&setTimeout(function(){return d.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,vs(this,l),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){d.hasFocus()&&!d.state.focused&&la(d)},20):Ca(this);for(var $ in qo)qo.hasOwnProperty($)&&qo[$](this,t[$],Co);gi(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee<hs.length;++ee)hs[ee](this);Ea(this),r&&t.lineWrapping&&getComputedStyle(W.lineDiv).textRendering=="optimizelegibility"&&(W.lineDiv.style.textRendering="auto")}xi.defaults=al,xi.optionHandlers=qo;function Zl(e){var t=e.display;Fe(t.scroller,"mousedown",bi(e,el)),K&&I<11?Fe(t.scroller,"dblclick",bi(e,function(te){if(st(e,te))return;var le=Ri(e,te);if(!le||ds(e,te)||vi(e.display,te))return;ae(te);var Me=e.findWordAt(le);Vo(e.doc,Me.anchor,Me.head)})):Fe(t.scroller,"dblclick",function(te){return st(e,te)||ae(te)}),Fe(t.scroller,"contextmenu",function(te){return rl(e,te)}),Fe(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||rl(e,te)});var d,l={end:0};function b(){t.activeTouch&&(d=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function W(te){if(te.touches.length!=1)return!1;var le=te.touches[0];return le.radiusX<=1&&le.radiusY<=1}function $(te,le){if(le.left==null)return!0;var Me=le.left-te.left,He=le.top-te.top;return Me*Me+He*He>20*20}Fe(t.scroller,"touchstart",function(te){if(!st(e,te)&&!W(te)&&!ds(e,te)){t.input.ensurePolled(),clearTimeout(d);var le=+new Date;t.activeTouch={start:le,moved:!1,prev:le-l.end<=300?l:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Fe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Fe(t.scroller,"touchend",function(te){var le=t.activeTouch;if(le&&!vi(t,te)&&le.left!=null&&!le.moved&&new Date-le.start<300){var Me=e.coordsChar(t.activeTouch,"page"),He;!le.prev||$(le,le.prev)?He=new Vr(Me,Me):!le.prev.prev||$(le,le.prev.prev)?He=e.findWordAt(Me):He=new Vr(pn(Me.line,0),L(e.doc,pn(Me.line+1,0))),e.setSelection(He.anchor,He.head),e.focus(),ae(te)}b()}),Fe(t.scroller,"touchcancel",b),Fe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),Ni(e,t.scroller.scrollLeft,!0),nt(e,"scroll",e))}),Fe(t.scroller,"mousewheel",function(te){return Ha(e,te)}),Fe(t.scroller,"DOMMouseScroll",function(te){return Ha(e,te)}),Fe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){st(e,te)||_e(te)},over:function(te){st(e,te)||(Rl(e,te),_e(te))},start:function(te){return Ol(e,te)},drop:bi(e,Sl),leave:function(te){st(e,te)||Hs(e)}};var ee=t.input.getField();Fe(ee,"keyup",function(te){return Zs.call(e,te)}),Fe(ee,"keydown",bi(e,Qs)),Fe(ee,"keypress",bi(e,qs)),Fe(ee,"focus",function(te){return la(e,te)}),Fe(ee,"blur",function(te){return Ca(e,te)})}var hs=[];xi.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,d,l){var b=e.doc,W;d==null&&(d="add"),d=="smart"&&(b.mode.indent?W=In(e,t).state:d="prev");var $=e.options.tabSize,ee=Cn(b,t),te=Y(ee.text,null,$);ee.stateAfter&&(ee.stateAfter=null);var le=ee.text.match(/^\s*/)[0],Me;if(!l&&!/\S/.test(ee.text))Me=0,d="not";else if(d=="smart"&&(Me=b.mode.indent(W,ee.text.slice(le.length),ee.text),Me==Je||Me>150)){if(!l)return;d="prev"}d=="prev"?t>b.first?Me=Y(Cn(b,t-1).text,null,$):Me=0:d=="add"?Me=te+e.options.indentUnit:d=="subtract"?Me=te-e.options.indentUnit:typeof d=="number"&&(Me=te+d),Me=Math.max(0,Me);var He="",xt=0;if(e.options.indentWithTabs)for(var pt=Math.floor(Me/$);pt;--pt)xt+=$,He+=" ";if(xt<Me&&(He+=fe(Me-xt)),He!=le)return bo(b,He,pn(t,0),pn(t,le.length),"+input"),ee.stateAfter=null,!0;for(var on=0;on<b.sel.ranges.length;on++){var Tn=b.sel.ranges[on];if(Tn.head.line==t&&Tn.head.ch<le.length){var Wn=pn(t,le.length);as(b,on,new Vr(Wn,Wn));break}}}var wa=null;function es(e){wa=e}function fs(e,t,d,l,b){var W=e.doc;e.display.shift=!1,l||(l=W.sel);var $=+new Date-200,ee=b=="paste"||e.state.pasteIncoming>$,te=Et(t),le=null;if(ee&&l.ranges.length>1)if(wa&&wa.text.join(`
`)==t){if(l.ranges.length%wa.text.length==0){le=[];for(var Me=0;Me<wa.text.length;Me++)le.push(W.splitLines(wa.text[Me]))}}else te.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(le=Jt(te,function(Yn){return[Yn]}));for(var He=e.curOp.updateInput,xt=l.ranges.length-1;xt>=0;xt--){var pt=l.ranges[xt],on=pt.from(),Tn=pt.to();pt.empty()&&(d&&d>0?on=pn(on.line,on.ch-d):e.state.overwrite&&!ee?Tn=pn(Tn.line,Math.min(Cn(W,Tn.line).text.length,Tn.ch+at(te).length)):ee&&wa&&wa.lineWise&&wa.text.join(`
`)==te.join(`
`)&&(on=Tn=pn(on.line,0)));var Wn={from:on,to:Tn,text:le?le[xt%le.length]:te,origin:b||(ee?"paste":e.state.cutIncoming>$?"cut":"+input")};yo(e.doc,Wn),Lt(e,"inputRead",e,Wn)}t&&!ee&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=He),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var d=e.clipboardData&&e.clipboardData.getData("Text");if(d)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ki(t,function(){return fs(t,d,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var d=e.doc.sel,l=d.ranges.length-1;l>=0;l--){var b=d.ranges[l];if(b.head.ch>100||l&&d.ranges[l-1].head.line==b.head.line)continue;var W=e.getModeAt(b.head),$=!1;if(W.electricChars){for(var ee=0;ee<W.electricChars.length;ee++)if(t.indexOf(W.electricChars.charAt(ee))>-1){$=Ko(e,b.head.line,"smart");break}}else W.electricInput&&(W.electricInput.test(Cn(e.doc,b.head.line).text.slice(0,b.head.ch))&&($=Ko(e,b.head.line,"smart")));$&&Lt(e,"electricInput",e,b.head.line)}}function ll(e){for(var t=[],d=[],l=0;l<e.doc.sel.ranges.length;l++){var b=e.doc.sel.ranges[l].head.line,W={anchor:pn(b,0),head:pn(b+1,0)};d.push(W),t.push(e.getRange(W.anchor,W.head))}return{text:t,ranges:d}}function ul(e,t,d,l){e.setAttribute("autocorrect",d?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=h("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=h("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),o&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,d=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,b){var W=this.options,$=W[l];if(W[l]==b&&l!="mode")return;W[l]=b,t.hasOwnProperty(l)&&bi(this,t[l])(this,b,$),nt(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,b){this.state.keyMaps[b?"push":"unshift"](Qo(l))},removeKeyMap:function(l){for(var b=this.state.keyMaps,W=0;W<b.length;++W)if(b[W]==l||b[W].name==l)return b.splice(W,1),!0},addOverlay:Pi(function(l,b){var W=l.token?l:e.getMode(this.options,l);if(W.startState)throw new Error("Overlays may not be stateful.");Ft(this.state.overlays,{mode:W,modeSpec:l,opaque:b&&b.opaque,priority:b&&b.priority||0},function($){return $.priority}),this.state.modeGen++,qr(this)}),removeOverlay:Pi(function(l){for(var b=this.state.overlays,W=0;W<b.length;++W){var $=b[W].modeSpec;if($==l||typeof l=="string"&&$.name==l){b.splice(W,1),this.state.modeGen++,qr(this);return}}}),indentLine:Pi(function(l,b,W){typeof b!="string"&&typeof b!="number"&&(b==null?b=this.options.smartIndent?"smart":"prev":b=b?"add":"subtract"),Kr(this.doc,l)&&Ko(this,l,b,W)}),indentSelection:Pi(function(l){for(var b=this.doc.sel.ranges,W=-1,$=0;$<b.length;$++){var ee=b[$];if(ee.empty())ee.head.line>W&&(Ko(this,ee.head.line,l,!0),W=ee.head.line,$==this.doc.sel.primIndex&&_a(this));else{var te=ee.from(),le=ee.to(),Me=Math.max(W,te.line);W=Math.min(this.lastLine(),le.line-(le.ch?0:1))+1;for(var He=Me;He<W;++He)Ko(this,He,l);var xt=this.doc.sel.ranges;te.ch==0&&b.length==xt.length&&xt[$].from().ch>0&&as(this.doc,$,new Vr(te,xt[$].to()),xe)}}}),getTokenAt:function(l,b){return kr(this,l,b)},getLineTokens:function(l,b){return kr(this,pn(l),b,!0)},getTokenTypeAt:function(l){l=L(this.doc,l);var b=$t(this,Cn(this.doc,l.line)),W=0,$=(b.length-1)/2,ee=l.ch,te;if(ee==0)te=b[2];else for(;;){var le=W+$>>1;if((le?b[le*2-1]:0)>=ee)$=le;else if(b[le*2+1]<ee)W=le+1;else{te=b[le*2+2];break}}var Me=te?te.indexOf("overlay "):-1;return Me<0?te:Me==0?null:te.slice(0,Me-1)},getModeAt:function(l){var b=this.doc.mode;return b.innerMode?e.innerMode(b,this.getTokenAt(l).state).mode:b},getHelper:function(l,b){return this.getHelpers(l,b)[0]},getHelpers:function(l,b){var W=[];if(!d.hasOwnProperty(b))return W;var $=d[b],ee=this.getModeAt(l);if(typeof ee[b]=="string")$[ee[b]]&&W.push($[ee[b]]);else if(ee[b])for(var te=0;te<ee[b].length;te++){var le=$[ee[b][te]];le&&W.push(le)}else ee.helperType&&$[ee.helperType]?W.push($[ee.helperType]):$[ee.name]&&W.push($[ee.name]);for(var Me=0;Me<$._global.length;Me++){var He=$._global[Me];He.pred(ee,this)&&ie(W,He.val)==-1&&W.push(He.val)}return W},getStateAfter:function(l,b){var W=this.doc;return l=X(W,l==null?W.first+W.size-1:l),In(this,l+1,b).state},cursorCoords:function(l,b){var W,$=this.doc.sel.primary();return l==null?W=$.head:typeof l=="object"?W=L(this.doc,l):W=l?$.from():$.to(),xn(this,W,b||"page")},charCoords:function(l,b){return nn(this,L(this.doc,l),b||"page")},coordsChar:function(l,b){return l=gn(this,l,b||"page"),pr(this,l.left,l.top)},lineAtHeight:function(l,b){return l=gn(this,{top:l,left:0},b||"page").top,Pr(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,b,W){var $=!1,ee;if(typeof l=="number"){var te=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>te&&(l=te,$=!0),ee=Cn(this.doc,l)}else ee=l;return Lr(this,ee,{top:0,left:0},b||"page",W||$).top+($?this.doc.height-Pn(ee):0)},defaultTextHeight:function(){return Wr(this.display)},defaultCharWidth:function(){return Hr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,b,W,$,ee){var te=this.display;l=xn(this,L(this.doc,l));var le=l.bottom,Me=l.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),te.sizer.appendChild(b),$=="over")le=l.top;else if($=="above"||$=="near"){var He=Math.max(te.wrapper.clientHeight,this.doc.height),xt=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);($=="above"||l.bottom+b.offsetHeight>He)&&l.top>b.offsetHeight?le=l.top-b.offsetHeight:l.bottom+b.offsetHeight<=He&&(le=l.bottom),Me+b.offsetWidth>xt&&(Me=xt-b.offsetWidth)}b.style.top=le+"px",b.style.left=b.style.right="",ee=="right"?(Me=te.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):(ee=="left"?Me=0:ee=="middle"&&(Me=(te.sizer.clientWidth-b.offsetWidth)/2),b.style.left=Me+"px"),W&&za(this,{left:Me,top:le,right:Me+b.offsetWidth,bottom:le+b.offsetHeight})},triggerOnKeyDown:Pi(Qs),triggerOnKeyPress:Pi(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Pi(el),execCommand:function(l){if(Fo.hasOwnProperty(l))return Fo[l].call(null,this)},triggerElectric:Pi(function(l){sl(this,l)}),findPosH:function(l,b,W,$){var ee=1;b<0&&(ee=-1,b=-b);for(var te=L(this.doc,l),le=0;le<b&&!(te=ps(this.doc,te,ee,W,$),te.hitSide);++le);return te},moveH:Pi(function(l,b){var W=this;this.extendSelectionsBy(function($){return W.display.shift||W.doc.extend||$.empty()?ps(W.doc,$.head,l,b,W.options.rtlMoveVisually):l<0?$.from():$.to()},Qe)}),deleteH:Pi(function(l,b){var W=this.doc.sel,$=this.doc;W.somethingSelected()?$.replaceSelection("",null,"+delete"):wo(this,function(ee){var te=ps($,ee.head,l,b,!1);return l<0?{from:te,to:ee.head}:{from:ee.head,to:te}})}),findPosV:function(l,b,W,$){var ee=1,te=$;b<0&&(ee=-1,b=-b);for(var le=L(this.doc,l),Me=0;Me<b;++Me){var He=xn(this,le,"div");if(te==null?te=He.left:He.left=te,le=dl(this,He,ee,W),le.hitSide)break}return le},moveV:Pi(function(l,b){var W=this,$=this.doc,ee=[],te=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Me){if(te)return l<0?Me.from():Me.to();var He=xn(W,Me.head,"div");Me.goalColumn!=null&&(He.left=Me.goalColumn),ee.push(He.left);var xt=dl(W,He,l,b);return b=="page"&&Me==$.sel.primary()&&Va(W,nn(W,xt,"div").top-He.top),xt},Qe),ee.length)for(var le=0;le<$.sel.ranges.length;le++)$.sel.ranges[le].goalColumn=ee[le]}),findWordAt:function(l){var b=this.doc,W=Cn(b,l.line).text,$=l.ch,ee=l.ch;if(W){var te=this.getHelper(l,"wordChars");(l.sticky=="before"||ee==W.length)&&$?--$:++ee;for(var le=W.charAt($),Me=jt(le,te)?function(He){return jt(He,te)}:/\s/.test(le)?function(He){return/\s/.test(He)}:function(He){return!/\s/.test(He)&&!jt(He)};$>0&&Me(W.charAt($-1));)--$;for(;ee<W.length&&Me(W.charAt(ee));)++ee}return new Vr(pn(l.line,$),pn(l.line,ee))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),nt(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Pi(function(l,b){Ra(this,l,b)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Ve(this)-this.display.barHeight,width:l.scrollWidth-Ve(this)-this.display.barWidth,clientHeight:re(this),clientWidth:Se(this)}},scrollIntoView:Pi(function(l,b){l==null?(l={from:this.doc.sel.primary().head,to:null},b==null&&(b=this.options.cursorScrollMargin)):typeof l=="number"?l={from:pn(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=b||0,l.from.line!=null?ho(this,l):Aa(this,l.from,l.to,l.margin)}),setSize:Pi(function(l,b){var W=this,$=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};l!=null&&(this.display.wrapper.style.width=$(l)),b!=null&&(this.display.wrapper.style.height=$(b)),this.options.lineWrapping&&dr(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(te){if(te.widgets){for(var le=0;le<te.widgets.length;le++)if(te.widgets[le].noHScroll){ii(W,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,nt(this,"refresh",this)}),operation:function(l){return Ki(this,l)},startOperation:function(){return ua(this)},endOperation:function(){return Ea(this)},refresh:Pi(function(){var l=this.display.cachedTextHeight;qr(this),this.curOp.forceUpdate=!0,wr(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(l==null||Math.abs(l-Wr(this.display))>.5||this.options.lineWrapping)&&ji(this),nt(this,"refresh",this)}),swapDoc:Pi(function(l){var b=this.doc;return b.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,l),wr(this),this.display.input.reset(),Ra(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Lt(this,"swapDoc",this,b),b}),phrase:function(l){var b=this.options.phrases;return b&&Object.prototype.hasOwnProperty.call(b,l)?b[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},we(e),e.registerHelper=function(l,b,W){d.hasOwnProperty(l)||(d[l]=e[l]={_global:[]}),d[l][b]=W},e.registerGlobalHelper=function(l,b,W,$){e.registerHelper(l,b,$),d[l]._global.push({pred:W,val:$})}}function ps(e,t,d,l,b){var W=t,$=d,ee=Cn(e,t.line),te=b&&e.direction=="rtl"?-d:d;function le(){var Zn=t.line+te;return Zn<e.first||Zn>=e.first+e.size?!1:(t=new pn(Zn,t.ch,t.sticky),ee=Cn(e,Zn))}function Me(Zn){var Xn;if(l=="codepoint"){var ar=ee.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(ar)?Xn=null:Xn=new pn(t.line,Math.max(0,Math.min(ee.text.length,t.ch+d*(ar>=55296&&ar<56320?2:1))),-d)}else b?Xn=kl(e.cm,ee,t,d):Xn=ss(ee,t,d);if(Xn==null)if(!Zn&&le())t=ls(b,e.cm,ee,t.line,te);else return!1;else t=Xn;return!0}if(l=="char"||l=="codepoint")Me();else if(l=="column")Me(!0);else if(l=="word"||l=="group")for(var He=null,xt=l=="group",pt=e.cm&&e.cm.getHelper(t,"wordChars"),on=!0;!(d<0&&!Me(!on));on=!1){var Tn=ee.text.charAt(t.ch)||`
`,Wn=jt(Tn,pt)?"w":xt&&Tn==`
`?"n":!xt||/\s/.test(Tn)?null:"p";if(xt&&!on&&!Wn&&(Wn="s"),He&&He!=Wn){d<0&&(d=1,Me(),t.sticky="after");break}if(Wn&&(He=Wn),d>0&&!Me(!on))break}var Yn=Xo(e,t,W,$,!0);return mi(W,Yn)&&(Yn.hitSide=!0),Yn}function dl(e,t,d,l){var b=e.doc,W=t.left,$;if(l=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(ee-.5*Wr(e.display),3);$=(d>0?t.bottom:t.top)+d*te}else l=="line"&&($=d>0?t.bottom+3:t.top-3);for(var le;!(le=pr(e,W,$),!le.outside);){if(d<0?$<=0:$>=b.height){le.hitSide=!0;break}$+=d*5}return le}var di=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};di.prototype.init=function(e){var t=this,d=this,l=d.cm,b=d.div=e.lineDiv;ul(b,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function W(ee){for(var te=ee.target;te;te=te.parentNode){if(te==b)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Fe(b,"paste",function(ee){if(!W(ee)||st(l,ee)||ol(ee,l))return;I<=11&&setTimeout(bi(l,function(){return t.updateFromDOM()}),20)}),Fe(b,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),Fe(b,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),Fe(b,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Fe(b,"touchstart",function(){return d.forceCompositionEnd()}),Fe(b,"input",function(){t.composing||t.readFromDOMSoon()});function $(ee){if(!W(ee)||st(l,ee))return;if(l.somethingSelected())es({lineWise:!1,text:l.getSelections()}),ee.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var te=ll(l);es({lineWise:!0,text:te.text}),ee.type=="cut"&&l.operation(function(){l.setSelections(te.ranges,0,xe),l.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var le=wa.text.join(`
`);if(ee.clipboardData.setData("Text",le),ee.clipboardData.getData("Text")==le){ee.preventDefault();return}}var Me=cl(),He=Me.firstChild;l.display.lineSpace.insertBefore(Me,l.display.lineSpace.firstChild),He.value=wa.text.join(`
`);var xt=document.activeElement;H(He),setTimeout(function(){l.display.lineSpace.removeChild(Me),xt.focus(),xt==b&&d.showPrimarySelection()},50)}Fe(b,"copy",$),Fe(b,"cut",$)},di.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},di.prototype.prepareSelection=function(){var e=Zi(this.cm,!1);return e.focus=document.activeElement==this.div,e},di.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},di.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},di.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,d=t.doc.sel.primary(),l=d.from(),b=d.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||b.line<t.display.viewFrom){e.removeAllRanges();return}var W=ts(t,e.anchorNode,e.anchorOffset),$=ts(t,e.focusNode,e.focusOffset);if(W&&!W.bad&&$&&!$.bad&&or(ni(W,$),l)==0&&or(ti(W,$),b)==0)return;var ee=t.display.view,te=l.line>=t.display.viewFrom&&hl(t,l)||{node:ee[0].measure.map[2],offset:0},le=b.line<t.display.viewTo&&hl(t,b);if(!le){var Me=ee[ee.length-1].measure,He=Me.maps?Me.maps[Me.maps.length-1]:Me.map;le={node:He[He.length-1],offset:He[He.length-2]-He[He.length-3]}}if(!te||!le){e.removeAllRanges();return}var xt=e.rangeCount&&e.getRangeAt(0),pt;try{pt=g(te.node,te.offset,le.offset,le.node)}catch(on){}pt&&(!U&&t.state.focused?(e.collapse(te.node,te.offset),pt.collapsed||(e.removeAllRanges(),e.addRange(pt))):(e.removeAllRanges(),e.addRange(pt)),xt&&e.anchorNode==null?e.addRange(xt):U&&this.startGracePeriod()),this.rememberSelection()},di.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},di.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},di.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},di.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},di.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},di.prototype.blur=function(){this.div.blur()},di.prototype.getField=function(){return this.div},di.prototype.supportsTouch=function(){return!0},di.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ki(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},di.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},di.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&_&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var d=ts(t,e.anchorNode,e.anchorOffset),l=ts(t,e.focusNode,e.focusOffset);d&&l&&Ki(t,function(){Yi(t.doc,$n(d,l),xe),(d.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},di.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,d=e.doc.sel.primary(),l=d.from(),b=d.to();if(l.ch==0&&l.line>e.firstLine()&&(l=pn(l.line-1,Cn(e.doc,l.line-1).length)),b.ch==Cn(e.doc,b.line).text.length&&b.line<e.lastLine()&&(b=pn(b.line+1,0)),l.line<t.viewFrom||b.line>t.viewTo-1)return!1;var W,$,ee;l.line==t.viewFrom||(W=ui(e,l.line))==0?($=cr(t.view[0].line),ee=t.view[0].node):($=cr(t.view[W].line),ee=t.view[W-1].node.nextSibling);var te=ui(e,b.line),le,Me;if(te==t.view.length-1?(le=t.viewTo-1,Me=t.lineDiv.lastChild):(le=cr(t.view[te+1].line)-1,Me=t.view[te+1].node.previousSibling),!ee)return!1;for(var He=e.doc.splitLines(tu(e,ee,Me,$,le)),xt=br(e.doc,pn($,0),pn(le,Cn(e.doc,le).text.length));He.length>1&&xt.length>1;)if(at(He)==at(xt))He.pop(),xt.pop(),le--;else if(He[0]==xt[0])He.shift(),xt.shift(),$++;else break;for(var pt=0,on=0,Tn=He[0],Wn=xt[0],Yn=Math.min(Tn.length,Wn.length);pt<Yn&&Tn.charCodeAt(pt)==Wn.charCodeAt(pt);)++pt;for(var Zn=at(He),Xn=at(xt),ar=Math.min(Zn.length-(He.length==1?pt:0),Xn.length-(xt.length==1?pt:0));on<ar&&Zn.charCodeAt(Zn.length-on-1)==Xn.charCodeAt(Xn.length-on-1);)++on;if(He.length==1&&xt.length==1&&$==l.line)for(;pt&&pt>l.ch&&Zn.charCodeAt(Zn.length-on-1)==Xn.charCodeAt(Xn.length-on-1);)pt--,on++;He[He.length-1]=Zn.slice(0,Zn.length-on).replace(/^\u200b+/,""),He[0]=He[0].slice(pt).replace(/\u200b+$/,"");var Tr=pn($,pt),_r=pn(le,xt.length?at(xt).length-on:0);if(He.length>1||He[0]||or(Tr,_r))return bo(e.doc,He,Tr,_r,"+input"),!0},di.prototype.ensurePolled=function(){this.forceCompositionEnd()},di.prototype.reset=function(){this.forceCompositionEnd()},di.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},di.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)},di.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ki(this.cm,function(){return qr(e.cm)})},di.prototype.setUneditable=function(e){e.contentEditable="false"},di.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||bi(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},di.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},di.prototype.onContextMenu=function(){},di.prototype.resetPosition=function(){},di.prototype.needsContentAttribute=!0;function hl(e,t){var d=qe(e,t.line);if(!d||d.hidden)return null;var l=Cn(e.doc,t.line),b=ue(d,l,t.line),W=En(l,e.doc.direction),$="left";if(W){var ee=tt(W,t.ch);$=ee%2?"right":"left"}var te=an(b.map,t.ch,$);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function To(e,t){return t&&(e.bad=!0),e}function tu(e,t,d,l,b){var W="",$=!1,ee=e.doc.lineSeparator(),te=!1;function le(pt){return function(on){return on.id==pt}}function Me(){$&&(W+=ee,te&&(W+=ee),$=te=!1)}function He(pt){pt&&(Me(),W+=pt)}function xt(pt){if(pt.nodeType==1){var on=pt.getAttribute("cm-text");if(on){He(on);return}var Tn=pt.getAttribute("cm-marker"),Wn;if(Tn){var Yn=e.findMarks(pn(l,0),pn(b+1,0),le(+Tn));Yn.length&&(Wn=Yn[0].find(0))&&He(br(e.doc,Wn.from,Wn.to).join(ee));return}if(pt.getAttribute("contenteditable")=="false")return;var Zn=/^(pre|div|p|li|table|br)$/i.test(pt.nodeName);if(!/^br$/i.test(pt.nodeName)&&pt.textContent.length==0)return;Zn&&Me();for(var Xn=0;Xn<pt.childNodes.length;Xn++)xt(pt.childNodes[Xn]);/^(pre|p)$/i.test(pt.nodeName)&&(te=!0),Zn&&($=!0)}else pt.nodeType==3&&He(pt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(xt(t),t==d);)t=t.nextSibling,te=!1;return W}function ts(e,t,d){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[d],!l)return To(e.clipPos(pn(e.display.viewTo-1)),!0);t=null,d=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var b=0;b<e.display.view.length;b++){var W=e.display.view[b];if(W.node==l)return nu(W,t,d)}}function nu(e,t,d){var l=e.text.firstChild,b=!1;if(!t||!x(l,t))return To(pn(cr(e.line),0),!0);if(t==l&&(b=!0,t=l.childNodes[d],d=0,!t)){var W=e.rest?at(e.rest):e.line;return To(pn(cr(W),W.text.length),b)}var $=t.nodeType==3?t:null,ee=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,d&&(d=$.nodeValue.length));ee.parentNode!=l;)ee=ee.parentNode;var te=e.measure,le=te.maps;function Me(Wn,Yn,Zn){for(var Xn=-1;Xn<(le?le.length:0);Xn++)for(var ar=Xn<0?te.map:le[Xn],Tr=0;Tr<ar.length;Tr+=3){var _r=ar[Tr+2];if(_r==Wn||_r==Yn){var Fr=cr(Xn<0?e.line:e.rest[Xn]),pi=ar[Tr]+Zn;return(Zn<0||_r!=Wn)&&(pi=ar[Tr+(Zn?1:0)]),pn(Fr,pi)}}}var He=Me($,ee,d);if(He)return To(He,b);for(var xt=ee.nextSibling,pt=$?$.nodeValue.length-d:0;xt;xt=xt.nextSibling){if(He=Me(xt,xt.firstChild,0),He)return To(pn(He.line,He.ch-pt),b);pt+=xt.textContent.length}for(var on=ee.previousSibling,Tn=d;on;on=on.previousSibling){if(He=Me(on,on.firstChild,-1),He)return To(pn(He.line,He.ch+Tn),b);Tn+=on.textContent.length}}var Di=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Di.prototype.init=function(e){var t=this,d=this,l=this.cm;this.createField(e);var b=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),o&&(b.style.width="0px"),Fe(b,"input",function(){K&&I>=9&&t.hasSelection&&(t.hasSelection=null),d.poll()}),Fe(b,"paste",function($){if(st(l,$)||ol($,l))return;l.state.pasteIncoming=+new Date,d.fastPoll()});function W($){if(st(l,$))return;if(l.somethingSelected())es({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ee=ll(l);es({lineWise:!0,text:ee.text}),$.type=="cut"?l.setSelections(ee.ranges,null,xe):(d.prevInput="",b.value=ee.text.join(`
`),H(b))}else return;$.type=="cut"&&(l.state.cutIncoming=+new Date)}Fe(b,"cut",W),Fe(b,"copy",W),Fe(e.scroller,"paste",function($){if(vi(e,$)||st(l,$))return;if(!b.dispatchEvent){l.state.pasteIncoming=+new Date,d.focus();return}var ee=new Event("paste");ee.clipboardData=$.clipboardData,b.dispatchEvent(ee)}),Fe(e.lineSpace,"selectstart",function($){vi(e,$)||ae($)}),Fe(b,"compositionstart",function(){var $=l.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:$,range:l.markText($,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Fe(b,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},Di.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Di.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Di.prototype.prepareSelection=function(){var e=this.cm,t=e.display,d=e.doc,l=Zi(e);if(e.options.moveInputWithCursor){var b=xn(e,d.sel.primary().head,"div"),W=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,b.top+$.top-W.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,b.left+$.left-W.left))}return l},Di.prototype.showSelection=function(e){var t=this.cm,d=t.display;f(d.cursorDiv,e.cursors),f(d.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Di.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var d=t.getSelection();this.textarea.value=d,t.state.focused&&H(this.textarea),K&&I>=9&&(this.hasSelection=d)}else e||(this.prevInput=this.textarea.value="",K&&I>=9&&(this.hasSelection=null))},Di.prototype.getField=function(){return this.textarea},Di.prototype.supportsTouch=function(){return!1},Di.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},Di.prototype.blur=function(){this.textarea.blur()},Di.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Di.prototype.receivedFocus=function(){this.slowPoll()},Di.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Di.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function d(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,d)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,d)},Di.prototype.poll=function(){var e=this,t=this.cm,d=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ct(d)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var b=d.value;if(b==l&&!t.somethingSelected())return!1;if(K&&I>=9&&this.hasSelection===b||i&&/[\uf700-\uf7ff]/.test(b))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var W=b.charCodeAt(0);if(W==8203&&!l&&(l="\u200B"),W==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,ee=Math.min(l.length,b.length);$<ee&&l.charCodeAt($)==b.charCodeAt($);)++$;return Ki(t,function(){fs(t,b.slice($),l.length-$,null,e.composing?"*compose":null),b.length>1e3||b.indexOf(`
`)>-1?d.value=e.prevInput="":e.prevInput=b,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Di.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Di.prototype.onKeyPress=function(){K&&I>=9&&(this.hasSelection=null),this.fastPoll()},Di.prototype.onContextMenu=function(e){var t=this,d=t.cm,l=d.display,b=t.textarea;t.contextMenuPending&&t.contextMenuPending();var W=Ri(d,e),$=l.scroller.scrollTop;if(!W||p)return;var ee=d.options.resetSelectionOnContextMenu;ee&&d.doc.sel.contains(W)==-1&&bi(d,Yi)(d.doc,$n(W),xe);var te=b.style.cssText,le=t.wrapper.style.cssText,Me=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",b.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Me.top-5)+"px; left: "+(e.clientX-Me.left-5)+`px;
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var He;r&&(He=window.scrollY),l.input.focus(),r&&window.scrollTo(null,He),l.input.reset(),d.somethingSelected()||(b.value=t.prevInput=" "),t.contextMenuPending=pt,l.selForContextMenu=d.doc.sel,clearTimeout(l.detectingSelectAll);function xt(){if(b.selectionStart!=null){var Tn=d.somethingSelected(),Wn="\u200B"+(Tn?b.value:"");b.value="\u21DA",b.value=Wn,t.prevInput=Tn?"":"\u200B",b.selectionStart=1,b.selectionEnd=Wn.length,l.selForContextMenu=d.doc.sel}}function pt(){if(t.contextMenuPending!=pt)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=le,b.style.cssText=te,K&&I<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=$),b.selectionStart!=null){(!K||K&&I<9)&&xt();var Tn=0,Wn=function(){l.selForContextMenu==d.doc.sel&&b.selectionStart==0&&b.selectionEnd>0&&t.prevInput=="\u200B"?bi(d,Ds)(d):Tn++<10?l.detectingSelectAll=setTimeout(Wn,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(Wn,200)}}if(K&&I>=9&&xt(),R){_e(e);var on=function(){At(window,"mouseup",on),setTimeout(pt,20)};Fe(window,"mouseup",on)}else setTimeout(pt,50)},Di.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Di.prototype.setUneditable=function(){},Di.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?w(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var d=j();t.autofocus=d==e||e.getAttribute("autofocus")!=null&&d==document.body}function l(){e.value=ee.getValue()}var b;if(e.form&&(Fe(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var W=e.form;b=W.submit;try{var $=W.submit=function(){l(),W.submit=b,W.submit(),W.submit=$}}catch(te){}}t.finishInit=function(te){te.save=l,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,l(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(At(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=b))}},e.style.display="none";var ee=xi(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return ee}function iu(e){e.off=At,e.on=Fe,e.wheelEventPixels=Ba,e.Doc=ta,e.splitLines=Et,e.countColumn=Y,e.findColumn=Ye,e.isWordChar=ct,e.Pass=Je,e.signal=nt,e.Line=Nn,e.changeEnd=hr,e.scrollbarModel=$a,e.Pos=pn,e.cmpPos=or,e.modes=kt,e.mimeModes=dt,e.resolveMode=Le,e.getMode=et,e.modeExtensions=mt,e.extendMode=Ht,e.copyState=sn,e.startState=nr,e.innerMode=yn,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=Kn,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ae,e.e_stopPropagation=se,e.e_stop=_e,e.addClass=B,e.contains=x,e.rmClass=v,e.keyNames=eo}$l(xi),ql(xi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ta.prototype)ta.prototype.hasOwnProperty(ns)&&ie(au,ns)<0&&(xi.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ta.prototype[ns]));return we(ta),xi.inputStyles={textarea:Di,contenteditable:di},xi.defineMode=function(e){!xi.defaults.mode&&e!="null"&&(xi.defaults.mode=e),Zt.apply(this,arguments)},xi.defineMIME=un,xi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xi.defineMIME("text/plain","null"),xi.defineExtension=function(e,t){xi.prototype[e]=t},xi.defineDocExtension=function(e,t){ta.prototype[e]=t},xi.fromTextArea=ru,iu(xi),xi.version="5.58.2",xi})},WaYH:function(Gt,he,D){"use strict";var Z=D("rePB"),V=D("Ff2n"),U=D("VTBJ"),G=D("1OyB"),P=D("vuIU"),k=D("JX7q"),K=D("Ji7U"),I=D("LK+K"),r=D("q1tI"),M=D("TSYQ"),_=D.n(M),p=D("sboe"),m=D("OZM5"),u=function(R){var S=R.prefixCls,v=R.level,E=R.isStart,f=R.isEnd;if(!v)return null;for(var h="".concat(S,"-indent-unit"),y=[],g=0;g<v;g+=1){var x;y.push(r.createElement("span",{key:g,className:_()(h,(x={},Object(Z.a)(x,"".concat(h,"-start"),E[g+1]),Object(Z.a)(x,"".concat(h,"-end"),f[g+1]),Object(Z.a)(x,"".concat(h,"-end-first-level"),!g&&f[0]),x))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(S,"-indent")},y)},a=u,o=D("815F"),c="open",s="close",i="---",n=function(C){Object(K.a)(S,C);var R=Object(I.a)(S);function S(){var v;return Object(G.a)(this,S),v=R.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(E){var f=v.props.context.onNodeClick;f(E,Object(o.b)(v.props)),v.isSelectable()?v.onSelect(E):v.onCheck(E)},v.onSelectorDoubleClick=function(E){var f=v.props.context.onNodeDoubleClick;f(E,Object(o.b)(v.props))},v.onSelect=function(E){if(v.isDisabled())return;var f=v.props.context.onNodeSelect;E.preventDefault(),f(E,Object(o.b)(v.props))},v.onCheck=function(E){if(v.isDisabled())return;var f=v.props,h=f.disableCheckbox,y=f.checked,g=v.props.context.onNodeCheck;if(!v.isCheckable()||h)return;E.preventDefault();var x=!y;g(E,Object(o.b)(v.props),x)},v.onMouseEnter=function(E){var f=v.props.context.onNodeMouseEnter;f(E,Object(o.b)(v.props))},v.onMouseLeave=function(E){var f=v.props.context.onNodeMouseLeave;f(E,Object(o.b)(v.props))},v.onContextMenu=function(E){var f=v.props.context.onNodeContextMenu;f(E,Object(o.b)(v.props))},v.onDragStart=function(E){var f=v.props.context.onNodeDragStart;E.stopPropagation(),v.setState({dragNodeHighlight:!0}),f(E,Object(k.a)(v));try{E.dataTransfer.setData("text/plain","")}catch(h){}},v.onDragEnter=function(E){var f=v.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),f(E,Object(k.a)(v))},v.onDragOver=function(E){var f=v.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),f(E,Object(k.a)(v))},v.onDragLeave=function(E){var f=v.props.context.onNodeDragLeave;E.stopPropagation(),f(E,Object(k.a)(v))},v.onDragEnd=function(E){var f=v.props.context.onNodeDragEnd;E.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(E,Object(k.a)(v))},v.onDrop=function(E){var f=v.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(E,Object(k.a)(v))},v.onExpand=function(E){var f=v.props.context.onNodeExpand;f(E,Object(o.b)(v.props))},v.setSelectHandle=function(E){v.selectHandle=E},v.getNodeState=function(){var E=v.props.expanded;return v.isLeaf()?null:E?c:s},v.hasChildren=function(){var E=v.props.eventKey,f=v.props.context.keyEntities,h=f[E]||{},y=h.children;return!!(y||[]).length},v.isLeaf=function(){var E=v.props,f=E.isLeaf,h=E.loaded,y=v.props.context.loadData,g=v.hasChildren();return f===!1?!1:f||!y&&!g||y&&h&&!g},v.isDisabled=function(){var E=v.props.disabled,f=v.props.context.disabled;return!!(f||E)},v.isCheckable=function(){var E=v.props.checkable,f=v.props.context.checkable;return!f||E===!1?!1:f},v.syncLoadData=function(E){var f=E.expanded,h=E.loading,y=E.loaded,g=v.props.context,x=g.loadData,j=g.onNodeLoad;if(h)return;x&&f&&!v.isLeaf()&&(!v.hasChildren()&&!y&&j(Object(o.b)(v.props)))},v.renderSwitcher=function(){var E=v.props,f=E.expanded,h=E.switcherIcon,y=v.props.context,g=y.prefixCls,x=y.switcherIcon,j=h||x;if(v.isLeaf())return r.createElement("span",{className:_()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof j=="function"?j(Object(U.a)(Object(U.a)({},v.props),{},{isLeaf:!0})):j);var B=_()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(f?c:s));return r.createElement("span",{onClick:v.onExpand,className:B},typeof j=="function"?j(Object(U.a)(Object(U.a)({},v.props),{},{isLeaf:!1})):j)},v.renderCheckbox=function(){var E=v.props,f=E.checked,h=E.halfChecked,y=E.disableCheckbox,g=v.props.context.prefixCls,x=v.isDisabled(),j=v.isCheckable();if(!j)return null;var B=typeof j!="boolean"?j:null;return r.createElement("span",{className:_()("".concat(g,"-checkbox"),f&&"".concat(g,"-checkbox-checked"),!f&&h&&"".concat(g,"-checkbox-indeterminate"),(x||y)&&"".concat(g,"-checkbox-disabled")),onClick:v.onCheck},B)},v.renderIcon=function(){var E=v.props.loading,f=v.props.context.prefixCls;return r.createElement("span",{className:_()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(v.getNodeState()||"docu"),E&&"".concat(f,"-icon_loading"))})},v.renderSelector=function(){var E=v.state.dragNodeHighlight,f=v.props,h=f.title,y=f.selected,g=f.icon,x=f.loading,j=f.data,B=v.props.context,A=B.prefixCls,H=B.showIcon,F=B.icon,w=B.draggable,Y=B.loadData,q=B.titleRender,ie=v.isDisabled(),ge="".concat(A,"-node-content-wrapper"),Je;if(H){var xe=g||F;Je=xe?r.createElement("span",{className:_()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof xe=="function"?xe(v.props):xe):v.renderIcon()}else Y&&x&&(Je=v.renderIcon());var ke;typeof h=="function"?ke=h(j):q?ke=q(j):ke=h;var Qe=r.createElement("span",{className:"".concat(A,"-title")},ke);return r.createElement("span",{ref:v.setSelectHandle,title:typeof h=="string"?h:"",className:_()("".concat(ge),"".concat(ge,"-").concat(v.getNodeState()||"normal"),!ie&&(y||E)&&"".concat(A,"-node-selected"),!ie&&w&&"draggable"),draggable:!ie&&w||void 0,"aria-grabbed":!ie&&w||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:w?v.onDragStart:void 0},Je,Qe)},v}return Object(P.a)(S,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var E=this.props.selectable,f=this.props.context.selectable;return typeof E=="boolean"?E:f}},{key:"render",value:function(){var E,f=this.props,h=f.eventKey,y=f.className,g=f.style,x=f.dragOver,j=f.dragOverGapTop,B=f.dragOverGapBottom,A=f.isLeaf,H=f.isStart,F=f.isEnd,w=f.expanded,Y=f.selected,q=f.checked,ie=f.halfChecked,ge=f.loading,Je=f.domRef,xe=f.active,ke=f.onMouseMove,Qe=Object(V.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ye=this.props.context,ve=Ye.prefixCls,fe=Ye.filterTreeNode,at=Ye.draggable,Jt=Ye.keyEntities,Ft=this.isDisabled(),St=Object(m.f)(Qe),ze=Jt[h]||{},gt=ze.level,ct=F[F.length-1];return r.createElement("div",Object.assign({ref:Je,className:_()(y,"".concat(ve,"-treenode"),(E={},Object(Z.a)(E,"".concat(ve,"-treenode-disabled"),Ft),Object(Z.a)(E,"".concat(ve,"-treenode-switcher-").concat(w?"open":"close"),!A),Object(Z.a)(E,"".concat(ve,"-treenode-checkbox-checked"),q),Object(Z.a)(E,"".concat(ve,"-treenode-checkbox-indeterminate"),ie),Object(Z.a)(E,"".concat(ve,"-treenode-selected"),Y),Object(Z.a)(E,"".concat(ve,"-treenode-loading"),ge),Object(Z.a)(E,"".concat(ve,"-treenode-active"),xe),Object(Z.a)(E,"".concat(ve,"-treenode-leaf-last"),ct),Object(Z.a)(E,"drag-over",!Ft&&x),Object(Z.a)(E,"drag-over-gap-top",!Ft&&j),Object(Z.a)(E,"drag-over-gap-bottom",!Ft&&B),Object(Z.a)(E,"filter-node",fe&&fe(Object(o.b)(this.props))),E)),style:g,onDragEnter:at?this.onDragEnter:void 0,onDragOver:at?this.onDragOver:void 0,onDragLeave:at?this.onDragLeave:void 0,onDrop:at?this.onDrop:void 0,onDragEnd:at?this.onDragEnd:void 0,onMouseMove:ke},St),r.createElement(a,{prefixCls:ve,level:gt,isStart:H,isEnd:F}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),S}(r.Component),O=function(R){return r.createElement(p.a.Consumer,null,function(S){return r.createElement(n,Object.assign({},R,{context:S}))})};O.displayName="TreeNode",O.defaultProps={title:i},O.isTreeNode=1;var T=he.a=O},XpUO:function(Gt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("sRBo"),G=D("kaz8"),P=D("jCWc"),k=D("kPKH"),K=D("iQDF"),I=D("+eQT"),r=D("giR+"),M=D("fyUT"),_=D("14J3"),p=D("BMrR"),m=D("7Kak"),u=D("9yH6"),a=D("miYZ"),o=D("tsqr"),c=D("jrin"),s=D("9og8"),i=D("k1fw"),n=D("oBTY"),O=D("y8nQ"),T=D("Vl3Y"),C=D("tJVT"),R=D("PpiC"),S=D("WmNS"),v=D.n(S),E=D("q1tI"),f=D.n(E),h=D("wd/R"),y=D.n(h),g=D("ErOA"),x=D("xKgJ"),j=D("1vsH"),B=D("Ty5D"),A=D("9kvl"),H=D("4wi7"),F=D("oUNq"),w=D("eozf"),Y=function(ie){var ge,Je,xe,ke,Qe,Ye,ve,fe,at,Jt,Ft,St,ze,gt,ct,jt,oe,Ne,Ge,Xe,Bt,Wt,en,tt,tn,En,We,Fe,yt,At,nt,st,De,ye,we,ae,se,pe,_e,be=ie.classroomList,Ke=ie.dispatch,Ot=ie.courseEndTime,rn=Object(R.a)(ie,["classroomList","dispatch","courseEndTime"]),Dn=Object(B.i)(),bt=T.a.useForm(),Qt=Object(C.a)(bt,1),Et=Qt[0],Ct=Object(E.useState)(1),lt=Object(C.a)(Ct,2),de=lt[0],Ae=lt[1],kt=Object(E.useState)([]),dt=Object(C.a)(kt,2),Zt=dt[0],un=dt[1],Le=Object(E.useState)(0),et=Object(C.a)(Le,2),mt=et[0],Ht=et[1],sn=Object(E.useState)(2e3),yn=Object(C.a)(sn,2),nr=yn[0],Kn=yn[1],Cn=Object(E.useState)(!0),br=Object(C.a)(Cn,2),Er=br[0],rr=br[1],cr=Object(E.useState)(!1),Pr=Object(C.a)(cr,2),Kr=Pr[0],hi=Pr[1],pn=Object(E.useState)(!1),or=Object(C.a)(pn,2),mi=or[0],wi=or[1],ti=Object(E.useState)([]),ni=Object(C.a)(ti,2),X=ni[0],L=ni[1],N=Object(E.useState)(!0),z=Object(C.a)(N,2),ne=z[0],J=z[1],je=Object(E.useState)(!((ge=be.actionTabs)!==null&&ge!==void 0&&(Je=ge.selectArrsAll)!==null&&Je!==void 0&&(xe=Je[0])!==null&&xe!==void 0&&xe.send_type)),$t=Object(C.a)(je,2),In=$t[0],Jn=$t[1],ln=Object(E.useState)([0,0,0]),tr=Object(C.a)(ln,2),qn=tr[0],kr=tr[1];Object(E.useEffect)(function(){if(be.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var Dr,Sr,ri,Br,Bn,_n;if((Dr=be.actionTabs)!==null&&Dr!==void 0&&(Sr=Dr.selectArrsAll)!==null&&Sr!==void 0&&(ri=Sr[0])!==null&&ri!==void 0&&ri.can_publish){var sr,Q,ce;kr(Object(n.a)((sr=be.actionTabs)===null||sr===void 0||((Q=sr.selectArrsAll)===null||Q===void 0||((ce=Q[0])===null||ce===void 0))?void 0:ce.difficult_count))}else{var Sn,bn,ur;kr(Object(n.a)((Sn=be.actionTabs)===null||Sn===void 0||((bn=Sn.selectArrsAll)===null||bn===void 0||((ur=bn[0])===null||ur===void 0))?void 0:ur.difficult_settings))}if(Jn(!((Br=be.actionTabs)!==null&&Br!==void 0&&(Bn=Br.selectArrsAll)!==null&&Bn!==void 0&&(_n=Bn[0])!==null&&_n!==void 0&&_n.send_type)),li(),be.actionTabs.type===2){var Ce,Te=(Ce=be.actionTabs.selectArrsAll)===null||Ce===void 0?void 0:Ce[0];J(Te.unified_setting)}}},[be.actionTabs]),Object(E.useEffect)(function(){if(Kr){if(mi)return;Ke({type:"classroomList/setActionTabs",payload:{}}),Object(x.c)()?(Ke({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},be.actionTabs.params),{},{type:1})}),Ke({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},Dn)})):Ke({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},be.actionTabs.params)})}},[Kr]);var li=function(){var Dr=Object(s.a)(v.a.mark(function Sr(ri){var Br,Bn;return v.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return rr(!0),Sn.next=3,Object(F.D)(Object(i.a)(Object(i.a)({},Dn),{},{page:ri||de,limit:2e4,homework_id:be.actionTabs.type===1?"":be.actionTabs.selectArrs[0]}));case 3:Br=Sn.sent,Br==null||Br.course_groups.map(function(bn,ur){bn.key=bn.id,bn.title=bn.name,bn.disabled=bn.is_published}),Br&&(un(Object(n.a)(Br==null?void 0:Br.course_groups)),Ht(Br==null?void 0:Br.course_groups_count),rr(!1),ri||Et.setFieldsValue((Bn={},Object(c.a)(Bn,"publish_time",y()(y()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(c.a)(Bn,"end_time",y()(y()(new Date(Object(j.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),Bn)));case 6:case"end":return Sn.stop()}},Sr)}));return function(ri){return Dr.apply(this,arguments)}}(),ai=function(){Object(x.c)()?be.actionTabs.detail?(Ke({type:"shixunHomeworks/setActionTabs",payload:{}}),Ke({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},Dn)}),Ke({type:"shixunHomeworks/getWorkSetting",payload:Object(i.a)({},Dn)})):Ke({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},be.actionTabs.params),{},{type:5})}):Ke({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},be.actionTabs.params)})},Gr=function(){var Dr=Object(s.a)(v.a.mark(function Sr(){var ri,Br,Bn,_n;return v.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(Br=Object(i.a)({},Et.getFieldsValue()),!(Br.end_time<=Br.publish_time)){bn.next=4;break}return o.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),bn.abrupt("return");case 4:if(!((X==null?void 0:X.length)<=0&&!ne&&Zt.length>0)){bn.next=7;break}return o.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),bn.abrupt("return");case 7:if(!(qn.reduce(function(ur,sr){return ur+sr})===0&&!In)){bn.next=10;break}return o.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),bn.abrupt("return");case 10:return Bn={homework_ids:Object(n.a)(be.actionTabs.selectArrs),group_ids:X.length>0?X.map(function(ur){return ur.id}):(ri=be.detailCommonHomeworksList)===null||ri===void 0?void 0:ri.course_groups,end_time:y()(Br.end_time).format("YYYY-MM-DD HH:mm"),publish_time:y()(Br.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:qn==null?void 0:qn.map(function(ur){return ur}),send_type:In?"0":"1",unified_setting:!X.length},bn.next=13,Object(g.a)("/api/courses/".concat(Dn.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(i.a)({},Bn)});case 13:_n=bn.sent,_n.status===0&&(Object(j.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),o.b.success("\u53D1\u5E03\u6210\u529F"),Ke({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),rn.onCallback&&rn.onCallback(),ai(),localStorage.getItem("Noviceguide")==="0"||Ke({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:f.a.createElement("div",null,"\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~")}}));case 15:case"end":return bn.stop()}},Sr)}));return function(){return Dr.apply(this,arguments)}}(),Li=function(){Ae(1),un([]),L([])},Vi=mt>de*nr;return f.a.createElement(V.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:be.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:Gr,onCancel:function(){Li(),ai(),Ke({type:"classroomList/setActionTabs",payload:{}})}},f.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",f.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),Zt&&f.a.createElement(T.a,{form:Et},f.a.createElement("div",{style:{paddingLeft:0}},be.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),f.a.createElement(u.a.Group,{value:In,disabled:!((ke=be.actionTabs)!==null&&ke!==void 0&&(Qe=ke.selectArrsAll)!==null&&Qe!==void 0&&(Ye=Qe[0])!==null&&Ye!==void 0&&Ye.can_publish),onChange:function(Sr){Jn(Sr.target.value)}},f.a.createElement(u.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),f.a.createElement(u.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!In&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{style:{marginRight:65}}),f.a.createElement("span",null,"\u7B80\u5355\u9898\u6570"," ",f.a.createElement(M.a,{value:qn[0],onChange:function(Sr){qn[0]=Sr,kr(Object(n.a)(qn))},min:0,disabled:!((ve=be.actionTabs)!==null&&ve!==void 0&&(fe=ve.selectArrsAll)!==null&&fe!==void 0&&(at=fe[0])!==null&&at!==void 0&&at.can_publish),placeholder:"\u6700\u5927".concat((Jt=be.actionTabs)===null||Jt===void 0||((Ft=Jt.selectArrsAll)===null||Ft===void 0||((St=Ft[0])===null||St===void 0||((ze=St.difficult_count)===null||ze===void 0)))?void 0:ze[0]),max:(gt=be.actionTabs)===null||gt===void 0||((ct=gt.selectArrsAll)===null||ct===void 0||((jt=ct[0])===null||jt===void 0||((oe=jt.difficult_count)===null||oe===void 0)))?void 0:oe[0],style:{width:60}})),f.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570"," ",f.a.createElement(M.a,{value:qn[1],onChange:function(Sr){qn[1]=Sr,kr(Object(n.a)(qn))},min:0,disabled:!((Ne=be.actionTabs)!==null&&Ne!==void 0&&(Ge=Ne.selectArrsAll)!==null&&Ge!==void 0&&(Xe=Ge[0])!==null&&Xe!==void 0&&Xe.can_publish),max:(Bt=be.actionTabs)===null||Bt===void 0||((Wt=Bt.selectArrsAll)===null||Wt===void 0||((en=Wt[0])===null||en===void 0||((tt=en.difficult_count)===null||tt===void 0)))?void 0:tt[1],placeholder:"\u6700\u5927".concat((tn=be.actionTabs)===null||tn===void 0||((En=tn.selectArrsAll)===null||En===void 0||((We=En[0])===null||We===void 0||((Fe=We.difficult_count)===null||Fe===void 0)))?void 0:Fe[1]),style:{width:60}})),f.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570"," ",f.a.createElement(M.a,{value:qn[2],onChange:function(Sr){qn[2]=Sr,kr(Object(n.a)(qn))},min:0,disabled:!((yt=be.actionTabs)!==null&&yt!==void 0&&(At=yt.selectArrsAll)!==null&&At!==void 0&&(nt=At[0])!==null&&nt!==void 0&&nt.can_publish),placeholder:"\u6700\u5927".concat((st=be.actionTabs)===null||st===void 0||((De=st.selectArrsAll)===null||De===void 0||((ye=De[0])===null||ye===void 0||((we=ye.difficult_count)===null||we===void 0)))?void 0:we[2]),max:(ae=be.actionTabs)===null||ae===void 0||((se=ae.selectArrsAll)===null||se===void 0||((pe=se[0])===null||pe===void 0||((_e=pe.difficult_count)===null||_e===void 0)))?void 0:_e[2],style:{width:60}}))),f.a.createElement(p.a,{className:"mt30",align:"middle"},f.a.createElement(k.a,null,f.a.createElement(T.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},f.a.createElement(I.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(Sr){return Sr.parentNode},disabledDate:function(Sr){return Object(w.b)(Sr,Ot)},disabledTime:function(Sr){return Object(w.c)(Sr)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:y()(Object(j.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),f.a.createElement(k.a,{className:"ml20"},f.a.createElement(T.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},f.a.createElement(I.a,{style:{width:170},getPopupContainer:function(Sr){return Sr.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:y()(Object(j.d)(),"HH:mm")},disabledDate:function(Sr){return Object(w.b)(Sr,Ot,Et.getFieldValue("publish_time"))},disabledTime:function(Sr){return Object(w.c)(Sr,Et.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),be.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),f.a.createElement(u.a.Group,{value:ne,onChange:function(Sr){J(Sr.target.value),L([])}},f.a.createElement(u.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),f.a.createElement(u.a,{className:"ml20",disabled:Zt.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Zt.length<=0&&be.actionTabs.type===2&&f.a.createElement("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},'\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03"')),(be.actionTabs.type===1||!ne)&&Zt.length>0&&f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},f.a.createElement("span",{style:{flex:1}},f.a.createElement(G.a,{checked:X.length===Zt.length,onChange:function(Sr){X.length===Zt.length?L([]):L(Zt.filter(function(ri){return!ri.is_published}))}},"\u5168\u9009")," "),f.a.createElement("span",{style:{width:16}}),f.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",X.length||0,"\u4E2A\u5206\u73ED")),(be.actionTabs.type===1||!ne)&&Zt.length>0&&f.a.createElement(H.a,{data:Zt,selectedRowKeys:X,setSelectedRowKeys:L})))};he.a=Object(A.a)(function(q){var ie=q.classroomList;return{classroomList:ie}})(Y)},Y1PL:function(Gt,he,D){"use strict";D.r(he),D.d(he,"ResizableTextArea",function(){return ie});var Z=D("wx14"),V=D("1OyB"),U=D("vuIU"),G=D("Ji7U"),P=D("LK+K"),k=D("q1tI"),K=D("VTBJ"),I=D("rePB"),r=D("Zm9Q"),M=D("Kwbf"),_=D("c+Xe"),p=D("m+aA"),m=D("bdgK"),u=new Map;function a(xe){xe.forEach(function(ke){var Qe,Ye=ke.target;(Qe=u.get(Ye))===null||Qe===void 0||Qe.forEach(function(ve){return ve(Ye)})})}var o=new m.default(a),c=null,s=null;function i(xe,ke){u.has(xe)||(u.set(xe,new Set),o.observe(xe)),u.get(xe).add(ke)}function n(xe,ke){u.has(xe)&&(u.get(xe).delete(ke),u.get(xe).size||(o.unobserve(xe),u.delete(xe)))}var O=function(xe){Object(G.a)(Qe,xe);var ke=Object(P.a)(Qe);function Qe(){return Object(V.a)(this,Qe),ke.apply(this,arguments)}return Object(U.a)(Qe,[{key:"render",value:function(){return this.props.children}}]),Qe}(k.Component),T=k.createContext(null);function C(xe){var ke=xe.children,Qe=xe.onBatchResize,Ye=k.useRef(0),ve=k.useRef([]),fe=k.useContext(T),at=k.useCallback(function(Jt,Ft,St){Ye.current+=1;var ze=Ye.current;ve.current.push({size:Jt,element:Ft,data:St}),Promise.resolve().then(function(){ze===Ye.current&&(Qe==null||Qe(ve.current),ve.current=[])}),fe==null||fe(Jt,Ft,St)},[Qe,fe]);return k.createElement(T.Provider,{value:at},ke)}function R(xe){var ke=xe.children,Qe=xe.disabled,Ye=k.useRef(null),ve=k.useRef(null),fe=k.useContext(T),at=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Jt=k.isValidElement(ke)&&Object(_.c)(ke),Ft=Jt?ke.ref:null,St=k.useMemo(function(){return Object(_.a)(Ft,Ye)},[Ft,Ye]),ze=k.useRef(xe);ze.current=xe;var gt=k.useCallback(function(ct){var jt=ze.current,oe=jt.onResize,Ne=jt.data,Ge=ct.getBoundingClientRect(),Xe=Ge.width,Bt=Ge.height,Wt=ct.offsetWidth,en=ct.offsetHeight,tt=Math.floor(Xe),tn=Math.floor(Bt);if(at.current.width!==tt||at.current.height!==tn||at.current.offsetWidth!==Wt||at.current.offsetHeight!==en){var En={width:tt,height:tn,offsetWidth:Wt,offsetHeight:en};at.current=En;var We=Wt===Math.round(Xe)?Xe:Wt,Fe=en===Math.round(Bt)?Bt:en,yt=Object(K.a)(Object(K.a)({},En),{},{offsetWidth:We,offsetHeight:Fe});fe==null||fe(yt,ct,Ne),oe&&Promise.resolve().then(function(){oe(yt,ct)})}},[]);return k.useEffect(function(){var ct=Object(p.a)(Ye.current)||Object(p.a)(ve.current);return ct&&!Qe&&i(ct,gt),function(){return n(ct,gt)}},[Ye.current,Qe]),k.createElement(O,{ref:ve},Jt?k.cloneElement(ke,{ref:St}):ke)}var S="rc-observer-key";function v(xe){var ke=xe.children,Qe=Object(r.a)(ke);return Qe.map(function(Ye,ve){var fe=(Ye==null?void 0:Ye.key)||"".concat(S,"-").concat(ve);return k.createElement(R,Object(Z.a)({},xe,{key:fe}),Ye)})}v.Collection=C;var E=v,f=D("bT9E"),h=D("TSYQ"),y=D.n(h),g=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,x=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],j={},B;function A(xe){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Qe=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(ke&&j[Qe])return j[Qe];var Ye=window.getComputedStyle(xe),ve=Ye.getPropertyValue("box-sizing")||Ye.getPropertyValue("-moz-box-sizing")||Ye.getPropertyValue("-webkit-box-sizing"),fe=parseFloat(Ye.getPropertyValue("padding-bottom"))+parseFloat(Ye.getPropertyValue("padding-top")),at=parseFloat(Ye.getPropertyValue("border-bottom-width"))+parseFloat(Ye.getPropertyValue("border-top-width")),Jt=x.map(function(St){return"".concat(St,":").concat(Ye.getPropertyValue(St))}).join(";"),Ft={sizingStyle:Jt,paddingSize:fe,borderSize:at,boxSizing:ve};return ke&&Qe&&(j[Qe]=Ft),Ft}function H(xe){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ye=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),xe.getAttribute("wrap")?B.setAttribute("wrap",xe.getAttribute("wrap")):B.removeAttribute("wrap");var ve=A(xe,ke),fe=ve.paddingSize,at=ve.borderSize,Jt=ve.boxSizing,Ft=ve.sizingStyle;B.setAttribute("style","".concat(Ft,";").concat(g)),B.value=xe.value||xe.placeholder||"";var St=Number.MIN_SAFE_INTEGER,ze=Number.MAX_SAFE_INTEGER,gt=B.scrollHeight,ct;if(Jt==="border-box"?gt+=at:Jt==="content-box"&&(gt-=fe),Qe!==null||Ye!==null){B.value=" ";var jt=B.scrollHeight-fe;Qe!==null&&(St=jt*Qe,Jt==="border-box"&&(St=St+fe+at),gt=Math.max(St,gt)),Ye!==null&&(ze=jt*Ye,Jt==="border-box"&&(ze=ze+fe+at),ct=gt>ze?"":"hidden",gt=Math.min(ze,gt))}return{height:gt,minHeight:St,maxHeight:ze,overflowY:ct,resize:"none"}}var F=D("Gytx"),w=D.n(F),Y;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(Y||(Y={}));var q=function(xe){Object(G.a)(Qe,xe);var ke=Object(P.a)(Qe);function Qe(Ye){var ve;return Object(V.a)(this,Qe),ve=ke.call(this,Ye),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(fe){ve.textArea=fe},ve.handleResize=function(fe){var at=ve.state.resizeStatus,Jt=ve.props,Ft=Jt.autoSize,St=Jt.onResize;if(at!==Y.NONE)return;typeof St=="function"&&St(fe),Ft&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var fe=ve.props.autoSize;if(!fe||!ve.textArea)return;var at=fe.minRows,Jt=fe.maxRows,Ft=H(ve.textArea,!1,at,Jt);ve.setState({textareaStyles:Ft,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:Y.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:Y.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var fe=ve.props,at=fe.prefixCls,Jt=at===void 0?"rc-textarea":at,Ft=fe.autoSize,St=fe.onResize,ze=fe.className,gt=fe.disabled,ct=ve.state,jt=ct.textareaStyles,oe=ct.resizeStatus,Ne=Object(f.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ge=y()(Jt,ze,Object(I.a)({},"".concat(Jt,"-disabled"),gt));"value"in Ne&&(Ne.value=Ne.value||"");var Xe=Object(K.a)(Object(K.a)(Object(K.a)({},ve.props.style),jt),oe===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(E,{onResize:ve.handleResize,disabled:!(Ft||St)},k.createElement("textarea",Object(Z.a)({},Ne,{className:Ge,style:Xe,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:Y.NONE},ve}return Object(U.a)(Qe,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!w()(ve.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 ve=this.textArea.selectionStart,fe=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,fe)}}catch(at){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Qe}(k.Component),ie=q,ge=function(xe){Object(G.a)(Qe,xe);var ke=Object(P.a)(Qe);function Qe(Ye){var ve;Object(V.a)(this,Qe),ve=ke.call(this,Ye),ve.resizableTextArea=void 0,ve.focus=function(){ve.resizableTextArea.textArea.focus()},ve.saveTextArea=function(at){ve.resizableTextArea=at},ve.handleChange=function(at){var Jt=ve.props.onChange;ve.setValue(at.target.value,function(){ve.resizableTextArea.resizeTextarea()}),Jt&&Jt(at)},ve.handleKeyDown=function(at){var Jt=ve.props,Ft=Jt.onPressEnter,St=Jt.onKeyDown;at.keyCode===13&&Ft&&Ft(at),St&&St(at)};var fe=typeof Ye.value=="undefined"||Ye.value===null?Ye.defaultValue:Ye.value;return ve.state={value:fe},ve}return Object(U.a)(Qe,[{key:"setValue",value:function(ve,fe){"value"in this.props||this.setState({value:ve},fe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return k.createElement(ie,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ve){return"value"in ve?{value:ve.value}:null}}]),Qe}(k.Component),Je=he.default=ge},ZW9T:function(Gt,he,D){"use strict";D.d(he,"a",function(){return F});var Z=D("k1fw"),V=D("oBTY"),U=D("miYZ"),G=D("tsqr"),P=D("rAM+"),k=D("tJVT"),K=D("PpiC"),I=D("q1tI"),r=D.n(I),M=D("bdgK"),_=D("9og8"),p=D("WmNS"),m=D.n(p),u={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},a={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},o={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},c={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},s=D("5VLF"),i=D.n(s),n={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(Y,q){return q.map(function(ie){return{label:ie,kind:Y.languages.CompletionItemKind.Keyword,insertText:ie}})},T=function(Y){return Object.keys(n.tables).map(function(q){return{label:q,kind:Y.languages.CompletionItemKind.Variable,insertText:q}})},C=function(Y,q){var ie=n.tables[Y];return ie?ie.map(function(ge){return{label:ge,kind:q.languages.CompletionItemKind.Field,insertText:ge}}):[]};function R(w,Y,q,ie,ge){var Je=Y.getWordUntilPosition(q),xe={startLineNumber:q.lineNumber,endLineNumber:q.lineNumber,startColumn:Je.startColumn,endColumn:Je.endColumn},ke=ie.map(function(Qe){return{label:Qe,kind:w.languages.CompletionItemKind.Keyword,insertText:Qe,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}});return ge.map(function(Qe){ke.push(Object(Z.a)(Object(Z.a)({},Qe),{},{range:xe}))}),ke}var S=function(w){n.languages.map(function(ge){return w.languages.registerDocumentFormattingEditProvider(ge,{provideDocumentFormattingEdits:function(xe,ke,Qe){return Object(_.a)(m.a.mark(function Ye(){var ve;return m.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return ve=i()(xe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),at.abrupt("return",[{range:xe.getFullModelRange(),text:ve}]);case 2:case"end":return at.stop()}},Ye)}))()}}),ge});var Y=o.quickKey.map(function(ge){return{label:ge.label,kind:w.languages.CompletionItemKind.Method,insertText:ge.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),q=c.quickKey.map(function(ge){return{label:ge.label,kind:w.languages.CompletionItemKind.Method,insertText:ge.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ie=a.quickKey.map(function(ge){return{label:ge.label,kind:w.languages.CompletionItemKind.Method,insertText:ge.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}});w.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Je,xe){var ke=Je.getWordUntilPosition(xe),Qe={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Ye=Je.getLineContent(xe.lineNumber).substring(ke.startColumn-2,ke.endColumn);return{suggestions:[].concat(Object(V.a)(o.keywords.map(function(ve){return{label:ve,kind:w.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})),Object(V.a)(o.quickKey.map(function(ve){return{label:ve.label,kind:w.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Ye.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})))}}}),w.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Je,xe){var ke=Je.getWordUntilPosition(xe),Qe={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn};return{suggestions:Object(V.a)(u.keywords.map(function(Ye){return{label:Ye,kind:w.languages.CompletionItemKind.Function,documentation:Ye,insertText:Ye,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}}))}}}),w.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Je,xe){var ke=Je.getWordUntilPosition(xe),Qe={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Ye=Je.getLineContent(xe.lineNumber).substring(ke.startColumn-2,ke.endColumn);return{suggestions:[].concat(Object(V.a)(a.keywords.map(function(ve){return{label:ve,kind:w.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})),Object(V.a)(a.quickKey.map(function(ve){return{label:ve.label,kind:w.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Ye.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})))}}}),w.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Je,xe){var ke=Je.getWordUntilPosition(xe),Qe={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:ke.startColumn,endColumn:ke.endColumn},Ye=Je.getLineContent(xe.lineNumber).substring(ke.startColumn-2,ke.endColumn);return{suggestions:[].concat(Object(V.a)(c.keywords.map(function(ve){return{label:ve,kind:w.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})),Object(V.a)(c.quickKey.map(function(ve){return{label:ve.label,kind:w.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Ye.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=D("fjLI"),f=D("LvDl"),h=D("+ua5");function y(w){return/^\d+$/.test(w)?"".concat(w,"px"):w}function g(){}var x=!1,j={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function B(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=w;if(Array.isArray(w)){for(var q=0;q<w.length;q++){var ie=j[w[q]];if(ie)return ie}return Y[0]}return j[Y]||Y}var A=null,H=he.b=function(w){var Y=w.width,q=Y===void 0?"100%":Y,ie=w.height,ge=ie===void 0?"100%":ie,Je=w.value,xe=w.language,ke=xe===void 0?"javascript":xe,Qe=w.style,Ye=Qe===void 0?{}:Qe,ve=w.options,fe=ve===void 0?{}:ve,at=w.overrideServices,Jt=at===void 0?{}:at,Ft=w.theme,St=Ft===void 0?"vs-dark":Ft,ze=w.onEditBlur,gt=w.onSave,ct=w.autoHeight,jt=ct===void 0?!1:ct,oe=w.forbidCopy,Ne=oe===void 0?!1:oe,Ge=w.onChange,Xe=Ge===void 0?g:Ge,Bt=w.editorDidMount,Wt=Bt===void 0?g:Bt,en=w.onFocus,tt=en===void 0?g:en,tn=w.filename,En=tn===void 0?"educoder.txt":tn,We=w.errorLine,Fe=w.errorContent,yt=Fe===void 0?"":Fe,At=Object(K.a)(w,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),nt=Object(I.useRef)(),st=Object(I.useRef)({}),De=Object(I.useRef)(),ye=Object(I.useRef)(),we=Object(I.useRef)(!1),ae=Object(I.useRef)(),se=Object(I.useState)(!1),pe=Object(k.a)(se,2),_e=pe[0],be=pe[1];function Ke(){var mt;return nt.current&&(mt=new M.default(function(Ht){var sn=Object(P.a)(Ht),yn;try{for(sn.s();!(yn=sn.n()).done;){var nr=yn.value;(nr.target.offsetHeight>0||nr.target.offsetWidth>0)&&st.current.instance.layout()}}catch(Kn){sn.e(Kn)}finally{sn.f()}}),mt.observe(nt.current)),mt}function Ot(){G.b.warn(decodeURIComponent(v))}var rn=function(){var Ht=st.current.instance;if(Je!=null&&Ht&&_e){var sn=Ht.getModel();sn&&Je!==sn.getValue()&&(x=!0,sn.setValue(Je),Ht.layout(),x=!1)}};Object(I.useEffect)(function(){ye.current&&clearTimeout(ye.current),ye.current=setTimeout(function(){rn()},500)},[Je,_e,st.current]),Object(I.useEffect)(function(){if(We&&st.current&&st.current.instance){var mt=st.current.instance;mt.changeViewZones(function(sn){var yn=document.createElement("div");yn.style.padding="10px 20px",yn.style.width="calc(100% - 20px)",yn.className="my-error-line-wrp",yn.innerHTML=yt,sn.addZone({afterLineNumber:We||11,heightInLines:3,domNode:yn})});var Ht={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}};mt.addOverlayWidget(Ht),mt.revealPositionInCenter({lineNumber:20,column:1})}},[We,st.current,_e]);function Dn(){var mt=st.current.instance;if(mt){var Ht=mt.getSelection(),sn=st.current.pastePos||{},yn=new A.Range(sn.startLineNumber||Ht.endLineNumber,sn.startColumn||Ht.endColumn,sn.endLineNumber||Ht.endLineNumber,sn.endColumn||Ht.endColumn);setTimeout(function(){mt.executeEdits("",[{range:yn,text:""}])},300)}}function bt(mt){(window.navigator.platform.match("Mac")?mt.metaKey:mt.ctrlKey)&&mt.keyCode==83&&(mt.preventDefault(),gt())}var Qt=function(){if(jt&&st.current.instance){var Ht=st.current.instance.getContentHeight();Le(Ht<ge?ge:Ht)}else Le(ge)};function Et(mt){var Ht=document.createEvent("MouseEvents");Ht.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),mt.dispatchEvent(Ht)}function Ct(mt,Ht){var sn=window.URL||window.webkitURL||window,yn=new Blob([Ht]),nr=document.createElementNS("http://www.w3.org/1999/xhtml","a");nr.href=sn.createObjectURL(yn),nr.download=mt,Et(nr)}Object(I.useEffect)(function(){Qt()},[Qt]),Object(I.useEffect)(function(){nt.current&&!_e&&Promise.all([D.e(16),D.e(28)]).then(D.t.bind(null,"M/lh",7)).then(function(mt){try{A=mt,st.current.instance=A.editor.create(nt.current,{value:Je,language:B(ke),theme:St,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Jt);var Ht=st.current.instance,sn=E.d._menuItems,yn=Object(V.a)(sn).find(function(Er){return Er[0]._debugName=="EditorContext"}),nr=yn[1],Kn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Cn=function(rr,cr){var Pr=rr._first;do{var Kr,hi,pn=cr.includes((Kr=Pr.element)===null||Kr===void 0||((hi=Kr.command)===null||hi===void 0)?void 0:hi.id);pn&&rr._remove(Pr)}while(Pr=Pr.next)};if(Wt(Ht,A),setTimeout(function(){Qt(),st.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ct(En||"educoder.txt",Ht.getValue())}}),Ht.getDomNode().addEventListener("input",function(){De.current.autoFormat&&Ht.getAction("editor.action.formatDocument").run()})},500),st.current.subscription=Ht.onDidChangeModelContent(function(Er){we.current?clearTimeout(ae.current):(Qt(),Xe(Ht.getValue(),Er)),ae.current=setTimeout(function(){we.current=!1},500)}),window.Monaco||S(A,B(ke)),Ne&&(Cn(nr,Kn),nt.current.classList.add("noCopyPaste"),Ht.onKeyDown(function(Er){var rr=Er.keyCode,cr=Er.ctrlKey,Pr=Er.metaKey;(rr===33||rr===52)&&(Pr||cr)&&(Ot(),Er.preventDefault())})),window.Monaco=A,ze&&Ht.onDidBlurEditorWidget(function(){ze(Ht.getValue())}),tt&&Ht.onDidFocusEditorText(function(){tt(Ht.getValue())}),Ne){Ht.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Ot(),null}),Ht.onDidPaste(function(Er){st.current.pastePos=Er});try{window.addEventListener("paste",Dn)}catch(Er){}}var br=Ke();return be(!0),function(){var Er=st.current.instance;Er.dispose();var rr=Er.getModel();rr&&rr.dispose(),st.current.subscription&&st.current.subscription.dispose(),Ne&&window.removeEventListener("paste",Dn),br.unobserve(nt.current)}}catch(Er){}})},[]),Object(I.useEffect)(function(){var mt=st.current.instance;if(mt&&_e)return document.addEventListener("keydown",bt,!1),function(){document.removeEventListener("keydown",bt)}},[gt,_e]),Object(I.useEffect)(function(){var mt=st.current.instance;if(mt&&_e){var Ht=B(ke);A.editor.setModelLanguage(mt.getModel(),Ht),console.log("language:",ke,mt.getModel(),Ht)}},[ke,_e]),Object(I.useEffect)(function(){var mt=st.current.instance;mt&&_e&&A.editor.setTheme(St)},[St,_e]),Object(I.useEffect)(function(){var mt=st.current.instance;De.current=fe,mt&&_e&&(mt.updateOptions(Object(Z.a)({},fe)),setTimeout(function(){mt.getModel().updateOptions(Object(Z.a)({},fe))},200))},[JSON.stringify(fe),_e]),Object(I.useEffect)(function(){var mt=st.current.instance;mt&&_e&&mt.layout()},[q,ge,_e]);var lt=Object(I.useState)(y(q)),de=Object(k.a)(lt,2),Ae=de[0],kt=de[1],dt=Object(I.useState)(y(ge)),Zt=Object(k.a)(dt,2),un=Zt[0],Le=Zt[1],et=Object(Z.a)(Object(Z.a)({},Ye),{},{width:Ae,height:un});return r.a.createElement("div",{className:"my-monaco-editor",ref:nt,style:et})};function F(w){var Y=w.width,q=Y===void 0?"100%":Y,ie=w.height,ge=ie===void 0?"100%":ie,Je=w.original,xe=w.modified,ke=w.language,Qe=w.options,Ye=Qe===void 0?{}:Qe,ve=Object(I.useRef)(),fe=Object(I.useState)(null),at=Object(k.a)(fe,2),Jt=at[0],Ft=at[1];function St(jt){var oe;return ve.current&&(oe=new M.default(function(Ne){var Ge=Object(P.a)(Ne),Xe;try{for(Ge.s();!(Xe=Ge.n()).done;){var Bt=Xe.value;(Bt.target.offsetHeight>0||Bt.target.offsetWidth>0)&&jt.layout()}}catch(Wt){Ge.e(Wt)}finally{Ge.f()}}),oe.observe(ve.current)),oe}Object(I.useEffect)(function(){ve.current&&Promise.all([D.e(16),D.e(28)]).then(D.t.bind(null,"M/lh",7)).then(function(jt){A=jt;var oe=A.editor.createDiffEditor(ve.current,Object(Z.a)(Object(Z.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},Ye),{},{wordWrap:!0}));Ft(oe);var Ne=St(oe);return function(){oe.dispose();var Ge=oe.getModel();Ge&&Ge.dispose(),Ne.unobserve(ve.current)}})},[]),Object(I.useEffect)(function(){Jt&&Jt.setModel({original:A.editor.createModel(Je,ke),modified:A.editor.createModel(xe,ke)})},[Je,xe,ke,Jt]);var ze=y(q),gt=y(ge),ct={width:ze,height:gt};return r.a.createElement("div",{className:"my-diff-editor",ref:ve,style:ct})}},ZpRC:function(Gt,he,D){"use strict";function Z(_){return typeof _=="object"&&_!=null&&_.nodeType===1}function V(_,p){return(!p||_!=="hidden")&&_!=="visible"&&_!=="clip"}function U(_,p){if(_.clientHeight<_.scrollHeight||_.clientWidth<_.scrollWidth){var m=getComputedStyle(_,null);return V(m.overflowY,p)||V(m.overflowX,p)||function(u){var a=function(o){if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch(c){return null}}(u);return!!a&&(a.clientHeight<u.scrollHeight||a.clientWidth<u.scrollWidth)}(_)}return!1}function G(_,p,m,u,a,o,c,s){return o<_&&c>p||o>_&&c<p?0:o<=_&&s<=m||c>=p&&s>=m?o-_-u:c>p&&s<m||o<_&&s>m?c-p+a:0}var P=function(_,p){var m=window,u=p.scrollMode,a=p.block,o=p.inline,c=p.boundary,s=p.skipOverflowHiddenElements,i=typeof c=="function"?c:function(jt){return jt!==c};if(!Z(_))throw new TypeError("Invalid target");for(var n=document.scrollingElement||document.documentElement,O=[],T=_;Z(T)&&i(T);){if((T=T.parentElement)===n){O.push(T);break}T!=null&&T===document.body&&U(T)&&!U(document.documentElement)||T!=null&&U(T,s)&&O.push(T)}for(var C=m.visualViewport?m.visualViewport.width:innerWidth,R=m.visualViewport?m.visualViewport.height:innerHeight,S=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,E=_.getBoundingClientRect(),f=E.height,h=E.width,y=E.top,g=E.right,x=E.bottom,j=E.left,B=a==="start"||a==="nearest"?y:a==="end"?x:y+f/2,A=o==="center"?j+h/2:o==="end"?g:j,H=[],F=0;F<O.length;F++){var w=O[F],Y=w.getBoundingClientRect(),q=Y.height,ie=Y.width,ge=Y.top,Je=Y.right,xe=Y.bottom,ke=Y.left;if(u==="if-needed"&&y>=0&&j>=0&&x<=R&&g<=C&&y>=ge&&x<=xe&&j>=ke&&g<=Je)return H;var Qe=getComputedStyle(w),Ye=parseInt(Qe.borderLeftWidth,10),ve=parseInt(Qe.borderTopWidth,10),fe=parseInt(Qe.borderRightWidth,10),at=parseInt(Qe.borderBottomWidth,10),Jt=0,Ft=0,St="offsetWidth"in w?w.offsetWidth-w.clientWidth-Ye-fe:0,ze="offsetHeight"in w?w.offsetHeight-w.clientHeight-ve-at:0;if(n===w)Jt=a==="start"?B:a==="end"?B-R:a==="nearest"?G(v,v+R,R,ve,at,v+B,v+B+f,f):B-R/2,Ft=o==="start"?A:o==="center"?A-C/2:o==="end"?A-C:G(S,S+C,C,Ye,fe,S+A,S+A+h,h),Jt=Math.max(0,Jt+v),Ft=Math.max(0,Ft+S);else{Jt=a==="start"?B-ge-ve:a==="end"?B-xe+at+ze:a==="nearest"?G(ge,xe,q,ve,at+ze,B,B+f,f):B-(ge+q/2)+ze/2,Ft=o==="start"?A-ke-Ye:o==="center"?A-(ke+ie/2)+St/2:o==="end"?A-Je+fe+St:G(ke,Je,ie,Ye,fe+St,A,A+h,h);var gt=w.scrollLeft,ct=w.scrollTop;B+=ct-(Jt=Math.max(0,Math.min(ct+Jt,w.scrollHeight-q+ze))),A+=gt-(Ft=Math.max(0,Math.min(gt+Ft,w.scrollWidth-ie+St)))}H.push({el:w,top:Jt,left:Ft})}return H};function k(_){return _===Object(_)&&Object.keys(_).length!==0}function K(_,p){p===void 0&&(p="auto");var m="scrollBehavior"in document.body.style;_.forEach(function(u){var a=u.el,o=u.top,c=u.left;a.scroll&&m?a.scroll({top:o,left:c,behavior:p}):(a.scrollTop=o,a.scrollLeft=c)})}function I(_){return _===!1?{block:"end",inline:"nearest"}:k(_)?_:{block:"start",inline:"nearest"}}function r(_,p){var m=!_.ownerDocument.documentElement.contains(_);if(k(p)&&typeof p.behavior=="function")return p.behavior(m?[]:P(_,p));if(m)return;var u=I(p);return K(P(_,u),u.behavior)}var M=he.a=r},bT9E:function(Gt,he,D){"use strict";D.d(he,"a",function(){return V});var Z=D("VTBJ");function V(U,G){var P=Object(Z.a)({},U);return Array.isArray(G)&&G.forEach(function(k){delete P[k]}),P}},bTeP:function(Gt,he,D){Gt.exports={flex_box_center:"flex_box_center___14Ki3",flex_space_between:"flex_space_between___3TSad",flex_box_vertical_center:"flex_box_vertical_center___3pQXk",flex_box_center_end:"flex_box_center_end___29_cn",flex_box_column:"flex_box_column___16am0",title:"title___2mVJs",workListTabWrap:"workListTabWrap___1JlOB",workListTabButton:"workListTabButton___3umfp",tables:"tables___hLy6a",checkboxgroup:"checkboxgroup___2xMgu"}},biw7:function(Gt,he,D){"use strict";var Z=D("q1tI"),V=D.n(Z),U=Z.createContext(null);he.a=U},c5Ni:function(Gt,he,D){},deN7:function(Gt,he,D){"use strict";var Z=D("/zsF"),V=D("PArb"),U=D("14J3"),G=D("BMrR"),P=D("jCWc"),k=D("kPKH"),K=D("+L6B"),I=D("2/Rp"),r=D("miYZ"),M=D("tsqr"),_=D("9og8"),p=D("giR+"),m=D("fyUT"),u=D("2qtc"),a=D("kLXV"),o=D("7Kak"),c=D("9yH6"),s=D("tJVT"),i=D("k1fw"),n=D("OaEy"),O=D("2fM7"),T=D("WmNS"),C=D.n(T),R=D("q1tI"),S=D.n(R),v=D("ZW9T"),E=D("F0VM"),f=D.n(E),h=D("xKgJ"),y=D("J66h"),g=D.n(y),x=D("ErOA"),j=D("Ty5D"),B=D("9Bee"),A=D("XYT7"),H=D("RCxd"),F=D("/MfK"),w=O.a.Option,Y={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},q;(function(ge){ge[ge.SET_PATH=0]="SET_PATH",ge[ge.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(q||(q={}));function ie(ge,Je){switch(Je.type){case q.SET_PATH:return Object(i.a)(Object(i.a)({},ge),{},{selectedPath:Je.payload});case q.GET_PASSED_CONTENT:return Object(i.a)(Object(i.a)({},ge),{},{passedContent:Je.payload});default:throw new Error}}he.a=function(ge){var Je=ge.language,xe=ge.dispatch,ke=ge.shixunWorkReport,Qe=ge.v,Ye=ge.languages,ve=ge.onPathChange,fe=ge.autoHeight,at=ge.diff_code_count,Jt=ge.data,Ft=Object(R.useState)(Ye==null?void 0:Ye[0]),St=Object(s.a)(Ft,2),ze=St[0],gt=St[1],ct=ke!="shixunWorkReport"&&Object(j.i)();return Object(R.useEffect)(function(){gt(Ye==null?void 0:Ye[0])},[]),Object(R.useEffect)(function(){var jt;gt(Ye==null||((jt=Ye.filter(function(oe){return oe.language===(ze==null?void 0:ze.language)}))===null||jt===void 0)?void 0:jt[0])},[Ye]),S.a.createElement(S.a.Fragment,null,S.a.createElement("h2",null," ",S.a.createElement("span",null,S.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Ye==null?void 0:Ye.length)>1&&S.a.createElement(c.a.Group,{defaultValue:Je,style:{marginLeft:10},onChange:function(oe){var Ne;gt(Ye==null||((Ne=Ye.filter(function(Ge){return Ge.language===oe.target.value}))===null||Ne===void 0)?void 0:Ne[0])}},Ye==null?void 0:Ye.map(function(jt){return S.a.createElement(c.a,{value:jt==null?void 0:jt.language},jt==null?void 0:jt.language)}))),Object(h.c)()&&ke!="shixunWorkReport"&&S.a.createElement("span",null,S.a.createElement("span",null,"\u5F97\u5206 ",ze==null?void 0:ze.score,"/",ze==null?void 0:ze.total_score),S.a.createElement(I.a,{style:{margin:"0px 10px"},onClick:function(){var oe=ze==null?void 0:ze.score;a.a.confirm({title:"\u8C03\u5206",content:S.a.createElement("div",null,S.a.createElement("p",null,"\u5F97\u5206\uFF1A",ze==null?void 0:ze.score,"/",ze==null?void 0:ze.total_score),S.a.createElement("p",null,"\u8C03\u5206\uFF1A",S.a.createElement(m.a,{min:0,max:ze==null?void 0:ze.total_score,defaultValue:ze==null?void 0:ze.score,onChange:function(Ge){oe=Ge}}))),okText:"\u786E\u8BA4",onOk:function(){var Ne=Object(_.a)(C.a.mark(function Xe(){var Bt;return C.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(x.a)("/api/courses/".concat(ct==null?void 0:ct.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:ct==null?void 0:ct.coursesId,hack_user_code_id:ze==null?void 0:ze.hack_user_id,score:oe}});case 2:Bt=en.sent,Bt.status===0&&(M.b.success("\u8C03\u5206\u6210\u529F"),xe({type:"shixunHomeworks/setActionTabs",payload:{}}),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},ct)}));case 4:case"end":return en.stop()}},Xe)}));function Ge(){return Ne.apply(this,arguments)}return Ge}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(h.c)()&&ke!="shixunWorkReport"&&S.a.createElement(I.a,{onClick:function(){xe({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:ke.user_id,type:"1",language:ze==null?void 0:ze.language,v:Qe,data:Object(i.a)({},ke)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),S.a.createElement(v.b,{height:300,language:ze==null?void 0:ze.language,value:y.Base64.decode(ze==null?void 0:ze.code),autoHeight:fe,theme:"default",options:Y}),((ze==null?void 0:ze.comment)||(ze==null?void 0:ze.hidden_comment))&&S.a.createElement("div",null,S.a.createElement(G.a,{align:"middle",style:{borderTop:"1px solid #eee"}},S.a.createElement(k.a,{flex:1},S.a.createElement("h1",{className:f.a.title},"\u70B9\u8BC4\u5185\u5BB9")),S.a.createElement(k.a,{className:"pr30"},Object(h.c)()&&S.a.createElement(I.a,{onClick:Object(_.a)(C.a.mark(function jt(){return C.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:a.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:S.a.createElement(H.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(_.a)(C.a.mark(function Xe(){var Bt;return C.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(A.m)({comment_id:ze==null?void 0:ze.comment_id,homeworkId:ct.homeworkId,type:"hack"});case 2:Bt=en.sent,Bt.status===0&&(M.b.success("\u5220\u9664\u6210\u529F"),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},ct)}));case 4:case"end":return en.stop()}},Xe)}))()}});case 1:case"end":return Ne.stop()}},jt)}))},S.a.createElement(F.a,null),"\u5220\u9664"))),S.a.createElement(V.a,{style:{margin:0}}),(ze==null?void 0:ze.comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(B.a,{value:ze==null?void 0:ze.comment})),(ze==null?void 0:ze.hidden_comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(B.a,{value:ze==null?void 0:ze.hidden_comment}))))}},dejd:function(Gt,he,D){},dmUQ:function(Gt,he,D){"use strict";var Z=D("Ff2n"),V=D("rePB"),U=D("1OyB"),G=D("vuIU"),P=D("Ji7U"),k=D("md7G"),K=D("foSv"),I=D("q1tI"),r=D.n(I),M=D("TSYQ"),_=D.n(M),p=D("4IlW");function m(f,h){var y=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(f,x).enumerable})),y.push.apply(y,g)}return y}function u(f){for(var h=1;h<arguments.length;h++){var y=arguments[h]!=null?arguments[h]:{};h%2?m(Object(y),!0).forEach(function(g){Object(V.a)(f,g,y[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(y)):m(Object(y)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(y,g))})}return f}function a(f){var h=o();return function(){var g=Object(K.a)(f),x;if(h){var j=Object(K.a)(this).constructor;x=Reflect.construct(g,arguments,j)}else x=g.apply(this,arguments);return Object(k.a)(this,x)}}function o(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(f){return!1}}function c(){}function s(f){f.preventDefault()}var i=function(h){return h.replace(/[^\w.-]+/g,"")},n=200,O=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(h){return h!=null},R=function(h,y){return y===h||typeof y=="number"&&typeof h=="number"&&isNaN(y)&&isNaN(h)},S=function(f){Object(P.a)(y,f);var h=a(y);function y(g){var x;Object(U.a)(this,y),x=h.call(this,g),x.onKeyDown=function(A){var H=x.props,F=H.onKeyDown,w=H.onPressEnter;if(A.keyCode===p.a.UP){var Y=x.getRatio(A);x.up(A,Y,null),x.stop()}else if(A.keyCode===p.a.DOWN){var q=x.getRatio(A);x.down(A,q,null),x.stop()}else A.keyCode===p.a.ENTER&&w&&w(A);if(x.recordCursorPosition(),x.lastKeyCode=A.keyCode,F){for(var ie=arguments.length,ge=new Array(ie>1?ie-1:0),Je=1;Je<ie;Je++)ge[Je-1]=arguments[Je];F.apply(void 0,[A].concat(ge))}},x.onKeyUp=function(A){var H=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),H){for(var F=arguments.length,w=new Array(F>1?F-1:0),Y=1;Y<F;Y++)w[Y-1]=arguments[Y];H.apply(void 0,[A].concat(w))}},x.onChange=function(A){var H=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(A)),x.setState({inputValue:x.rawInput}),H(x.toNumber(x.rawInput))},x.onMouseUp=function(){var A=x.props.onMouseUp;x.recordCursorPosition(),A&&A.apply(void 0,arguments)},x.onFocus=function(){var A;x.setState({focused:!0}),(A=x.props).onFocus.apply(A,arguments)},x.onBlur=function(){var A=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var H=x.getCurrentValidValue(x.state.inputValue),F=x.setValue(H,c);if(A){var w=x.input.value,Y=x.getInputDisplayValue({focus:!1,value:F});x.input.value=Y&&Number(Y),A.apply(void 0,arguments),x.input.value=w}},x.getRatio=function(A){var H=1;return A.metaKey||A.ctrlKey?H=.1:A.shiftKey&&(H=10),H},x.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},x.getPrecision=function(A){if(C(x.props.precision))return x.props.precision;var H=String(A);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var F=0;return H.indexOf(".")>=0&&(F=H.length-H.indexOf(".")-1),F},x.getInputDisplayValue=function(A){var H=A||x.state,F=H.focused,w=H.inputValue,Y=H.value,q;F?q=w:q=x.toPrecisionAsStep(Y),q==null&&(q="");var ie=x.formatWrapper(q);return C(x.props.decimalSeparator)&&(ie=ie.toString().replace(".",x.props.decimalSeparator)),ie},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(A){}},x.restoreByAfter=function(A){if(A===void 0)return!1;var H=x.input.value,F=H.lastIndexOf(A);if(F===-1)return!1;var w=x.cursorBefore.length;return x.lastKeyCode===p.a.DELETE&&x.cursorBefore.charAt(w-1)===A[0]?(x.fixCaret(w,w),!0):F+A.length===H.length?(x.fixCaret(F,F),!0):!1},x.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(H,F){var w=A.substring(F);return x.restoreByAfter(w)})},x.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(A,H,F){x.pressingUpOrDown=!0,x.step("down",A,H,F)},x.up=function(A,H,F){x.pressingUpOrDown=!0,x.step("up",A,H,F)},x.saveInput=function(A){x.input=A};var j=g.value;j===void 0&&(j=g.defaultValue),x.state={focused:g.autoFocus};var B=x.getValidValue(x.toNumber(j));return x.state=u(u({},x.state),{},{inputValue:x.toPrecisionAsStep(B),value:B}),x}return Object(G.a)(y,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var j=this.props,B=j.value,A=j.onChange,H=j.max,F=j.min,w=this.state.focused;if(x){if(!R(x.value,B)||!R(x.max,H)||!R(x.min,F)){var Y=w?B:this.getValidValue(B),q;this.pressingUpOrDown?q=Y:this.inputting?q=this.rawInput:q=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:q})}var ie="value"in this.props?B:this.state.value;"max"in this.props&&x.max!==H&&typeof ie=="number"&&ie>H&&A&&A(H),"min"in this.props&&x.min!==F&&typeof ie=="number"&&ie<F&&A&&A(F)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ge=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?ge=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(ge=this.cursorStart):ge=this.input.value.length,this.fixCaret(ge,ge)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Je){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(x){var j=x;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(x){var j=x.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(x);return isNaN(A)?x:(A<j&&(A=j),A>B&&(A=B),A)}},{key:"setValue",value:function(x,j){var B=this.props.precision,A=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),H=this.state.value,F=H===void 0?null:H,w=this.state.inputValue,Y=w===void 0?null:w,q=typeof A=="number"?A.toFixed(B):"".concat(A),ie=A!==F||q!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},j)):this.setState({value:A,inputValue:this.toPrecisionAsStep(x)},j),ie&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,A=B.precision,H=B.step;if(C(A))return A;var F=this.getPrecision(j),w=this.getPrecision(H),Y=this.getPrecision(x);return x?Math.max(Y,F+w):F+w}},{key:"getPrecisionFactor",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(x,j);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var j=Math.abs(this.getMaxPrecision(x));return isNaN(j)?x.toString():Number(x).toFixed(j)}},{key:"toNumber",value:function(x){var j=this.props.precision,B=this.state.focused,A=x&&x.length>16&&B;return this.isNotCompleteNumber(x)||A?x:C(j)?Math.round(x*Math.pow(10,j))/Math.pow(10,j):Number(x)}},{key:"upStep",value:function(x,j){var B=this.props.step,A=this.getPrecisionFactor(x,j),H=Math.abs(this.getMaxPrecision(x,j)),F=((A*x+A*B*j)/A).toFixed(H);return this.toNumber(F)}},{key:"downStep",value:function(x,j){var B=this.props.step,A=this.getPrecisionFactor(x,j),H=Math.abs(this.getMaxPrecision(x,j)),F=((A*x-A*B*j)/A).toFixed(H);return this.toNumber(F)}},{key:"step",value:function(x,j){var B=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var F=this.props;if(F.disabled)return;var w=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(w))return;var Y=this["".concat(x,"Step")](w,A),q=Y>F.max||Y<F.min;if(Y>F.max?Y=F.max:Y<F.min&&(Y=F.min),this.setValue(Y,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),q)return;this.autoStepTimer=setTimeout(function(){B[x](j,A,!0)},H?n:O)}},{key:"fixCaret",value:function(x,j){if(x===void 0||j===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,A=this.input.selectionEnd;(x!==B||j!==A)&&this.input.setSelectionRange(x,j)}catch(H){}}},{key:"render",value:function(){var x,j=this.props,B=j.prefixCls,A=j.disabled,H=j.readOnly,F=j.useTouch,w=j.autoComplete,Y=j.upHandler,q=j.downHandler,ie=j.className,ge=j.max,Je=j.min,xe=j.style,ke=j.title,Qe=j.onMouseEnter,Ye=j.onMouseLeave,ve=j.onMouseOver,fe=j.onMouseOut,at=j.required,Jt=j.onClick,Ft=j.tabIndex,St=j.type,ze=j.placeholder,gt=j.id,ct=j.inputMode,jt=j.pattern,oe=j.step,Ne=j.maxLength,Ge=j.autoFocus,Xe=j.name,Bt=j.onPaste,Wt=j.onInput,en=Object(Z.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),tt=this.state,tn=tt.value,En=tt.focused,We=_()(B,(x={},Object(V.a)(x,ie,!!ie),Object(V.a)(x,"".concat(B,"-disabled"),A),Object(V.a)(x,"".concat(B,"-focused"),En),x)),Fe={};Object.keys(en).forEach(function(_e){(_e.substr(0,5)==="data-"||_e.substr(0,5)==="aria-"||_e==="role")&&(Fe[_e]=en[_e])});var yt=!H&&!A,At=this.getInputDisplayValue(null),nt=(tn||tn===0)&&(isNaN(tn)||Number(tn)>=ge),st=(tn||tn===0)&&(isNaN(tn)||Number(tn)<=Je),De=nt||A||H,ye=st||A||H,we=_()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(V.a)({},"".concat(B,"-handler-up-disabled"),De)),ae=_()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(V.a)({},"".concat(B,"-handler-down-disabled"),ye)),se=F?{onTouchStart:De?c:this.up,onTouchEnd:this.stop}:{onMouseDown:De?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},pe=F?{onTouchStart:ye?c:this.down,onTouchEnd:this.stop}:{onMouseDown:ye?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:We,style:xe,title:ke,onMouseEnter:Qe,onMouseLeave:Ye,onMouseOver:ve,onMouseOut:fe,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(B,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},se,{role:"button","aria-label":"Increase Value","aria-disabled":De,className:we}),Y||r.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:s})),r.a.createElement("span",Object.assign({unselectable:"on"},pe,{role:"button","aria-label":"Decrease Value","aria-disabled":ye,className:ae}),q||r.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:s}))),r.a.createElement("div",{className:"".concat(B,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Je,"aria-valuemax":ge,"aria-valuenow":tn,required:at,type:St,placeholder:ze,onPaste:Bt,onClick:Jt,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Ft,autoComplete:w,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:yt?this.onKeyDown:c,onKeyUp:yt?this.onKeyUp:c,autoFocus:Ge,maxLength:Ne,readOnly:H,disabled:A,max:ge,min:Je,step:oe,name:Xe,title:ke,id:gt,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(At),pattern:jt,inputMode:ct,onInput:Wt},Fe))))}}]),y}(r.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:i,required:!1,autoComplete:"off"};var v=S,E=he.a=v},eozf:function(Gt,he,D){"use strict";D.d(he,"b",function(){return Ye}),D.d(he,"c",function(){return ve});var Z=D("sRBo"),V=D("kaz8"),U=D("5Dmo"),G=D("3S7+"),P=D("/zsF"),k=D("PArb"),K=D("7Kak"),I=D("9yH6"),r=D("14J3"),M=D("BMrR"),_=D("+L6B"),p=D("2/Rp"),m=D("jCWc"),u=D("kPKH"),a=D("2qtc"),o=D("kLXV"),c=D("9og8"),s=D("miYZ"),i=D("tsqr"),n=D("oBTY"),O=D("k1fw"),T=D("tJVT"),C=D("OaEy"),R=D("2fM7"),S=D("iQDF"),v=D("+eQT"),E=D("WmNS"),f=D.n(E),h=D("q1tI"),y=D.n(h),g=D("/MfK"),x=D("w5pM"),j=D("Lyp1"),B=D("wd/R"),A=D.n(B),H=D("xKgJ"),F=D("ErOA"),w=D("LvDl"),Y=D.n(w),q=D("1vsH"),ie=D("zetH"),ge=D.n(ie),Je=D("Ty5D"),xe=D("9kvl"),ke=D("AHFd");function Qe(Ft,St){for(var ze=[],gt=Ft;gt<St;gt++)ze.push(gt);return ze}var Ye=function(St,ze,gt){var ct=St<A()().startOf("day"),jt=St>A()(ze).endOf("day"),oe=St<A()(gt).startOf("day");return ze?gt?A()()<=A()(gt)?oe||jt:ct||jt:St&&ct||jt:gt&&A()()<=A()(gt)?oe:ct},ve=function(St,ze){var gt=parseInt(A()(St).format("HH")),ct=parseInt(A()().format("HH")),jt=parseInt(A()().format("mm"));if(!St)return{disabledHours:function(){return Qe(0,ct)},disabledMinutes:function(){return Qe(0,jt)}};if(ze){var oe=parseInt(A()(ze).format("HH")),Ne=parseInt(A()(ze).format("mm"));return A()(St).isSame(A()(ze),"day")?{disabledHours:function(){return Qe(0,oe)},disabledMinutes:function(){return gt<=oe?Qe(0,Ne):[]}}:void 0}return A()(St).isSame(A()(),"day")?{disabledHours:function(){return Qe(0,ct)},disabledMinutes:function(){return A()(St).isSame(A()(),"hour")&&gt<=ct?Qe(0,jt):[]}}:void 0},fe=v.a.RangePicker,at=R.a.Option,Jt=function(St){var ze,gt,ct,jt,oe,Ne,Ge,Xe=St.shixunHomeworks,Bt=St.loading,Wt=St.dispatch,en=Object(Je.i)(),tt=Xe.workSetting,tn=Xe.workList,En=Xe.changeData,We=Object(h.useState)(!0),Fe=Object(T.a)(We,2),yt=Fe[0],At=Fe[1],nt=Object(h.useState)(!1),st=Object(T.a)(nt,2),De=st[0],ye=st[1],we=Object(h.useState)([]),ae=Object(T.a)(we,2),se=ae[0],pe=ae[1],_e=Object(h.useState)([]),be=Object(T.a)(_e,2),Ke=be[0],Ot=be[1],rn=Object(h.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:ke.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0}),Dn=Object(T.a)(rn,2),bt=Dn[0],Qt=Dn[1];Object(h.useEffect)(function(){return Et(),function(){pe([].concat())}},[]);var Et=function(){Wt({type:"shixunHomeworks/getWorkSetting",payload:Object(O.a)({},en)})};Object(h.useEffect)(function(){var Le;if(!(tt!=null&&tt.course_id))return;Object.keys(bt).map(function(et){bt[et]=tt[et]}),(!bt.allow_late||!bt.unified_late)&&(bt.late_penalty=20,bt.penalty_type=ke.a.Percent),bt.unified_setting||(bt.unified_late=!1,bt.unified_anonymous_comment=!1,bt.unified_anonymous_appeal=!1),se=JSON.parse(JSON.stringify(tt.group_settings.map(function(et){return Object(O.a)(Object(O.a)({},et),{},{group_name:[et.group_name]})}).filter(function(et){return et.publish_time!==null}))),Ke=JSON.parse(JSON.stringify(tt.allow_late_settings.map(function(et){return Object(O.a)(Object(O.a)({},et),{},{group_name:[et.group_name]})}).filter(function(et){return et.late_time!==null}))),Qt(Object(O.a)({},bt)),pe(Object(n.a)(se)),((Le=Ke)===null||Le===void 0?void 0:Le.length)<=0?Ot([{penalty_type:ke.a.Percent,late_penalty:20}]):Ot(Object(n.a)(Ke))},[tt]);var Ct=function(){var et,mt,Ht=JSON.parse(JSON.stringify(bt));if(Ht.challenge_settings.filter(function(yn){return!yn.hide}),Ht.categoryId=en.categoryId,(et=Ht.challenge_settings)!==null&&et!==void 0&&et.every(function(yn){return!yn.checked})){i.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(bt.unified_setting||(se=(mt=se)===null||mt===void 0?void 0:mt.map(function(yn){var nr;if(!yn.publish_time||!yn.end_time)throw i.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!yn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return yn.group_name=typeof(yn==null?void 0:yn.group_name)=="string"?[yn==null?void 0:yn.group_name]:yn==null?void 0:yn.group_name,yn.group_id=(nr=tt.group_settings)===null||nr===void 0?void 0:nr.filter(function(Kn){var Cn;return yn==null||((Cn=yn.group_name)===null||Cn===void 0)?void 0:Cn.includes(Kn.group_name)}).map(function(Kn){return Kn.group_id||Kn.id}).toString().split(","),yn})),Ht.group_settings=se,bt.allow_late)if(bt.unified_late){if(bt.late_penalty===null||bt.late_penalty===void 0||bt.late_penalty<0||bt.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!bt.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var sn;Ke=(sn=Ke)===null||sn===void 0?void 0:sn.map(function(yn){var nr,Kn;if(yn.late_penalty===null||yn.late_penalty===void 0||yn.late_penalty<0||yn.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!yn.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!yn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return yn.group_name=typeof(yn==null?void 0:yn.group_name)=="string"?[yn==null?void 0:yn.group_name]:yn==null?void 0:yn.group_name,yn.group_id=yn==null||((nr=yn.group_name)===null||nr===void 0||((Kn=nr.map(function(Cn){var br,Er,rr=(br=tt.group_settings)===null||br===void 0||((Er=br.filter(function(cr){return(cr==null?void 0:cr.group_name)===Cn}))===null||Er===void 0)?void 0:Er[0];return rr==null?void 0:rr.group_id}))===null||Kn===void 0))?void 0:Kn.toString().split(","),yn}),Ht.allow_late_settings=Ke}lt(Ht)},lt=function(et){var mt,Ht;if(et.total_score===null){i.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(et!=null&&et.work_efficiency&&et.eff_score===null){i.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var sn=et.challenge_settings.reduce(function(Kn,Cn){return Kn+Number(Cn.challenge_score)},0);if((sn==null?void 0:sn.toFixed(10))!==((mt=et.total_score-et.eff_score)===null||mt===void 0?void 0:mt.toFixed(10))){i.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(et.total_score,"\u5206"));return}var yn={shixun_evaluation:et.shixun_evaluation,challenge_settings:et.challenge_settings},nr=function(){var Kn=Object(c.a)(f.a.mark(function Cn(){var br;return f.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return ye(!0),rr.next=3,Object(F.a)("/api/homework_commons/".concat(en.categoryId,"/publish_setting.json"),{method:"post",body:Object(O.a)({},et)});case 3:br=rr.sent,br.status===0&&(i.b.success("\u66F4\u65B0\u6210\u529F"),At(!0),Et(),Wt({type:"shixunHomeworks/getWorkList",payload:Object(O.a)({},en)})),ye(!1);case 6:case"end":return rr.stop()}},Cn)}));return function(){return Kn.apply(this,arguments)}}();!Object(w.isEqual)(En,yn)&&!(tn!=null&&(Ht=tn.homework_status)!==null&&Ht!==void 0&&Ht.includes("\u672A\u53D1\u5E03"))?o.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:nr}):nr()},de=function(et,mt){var Ht,sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return mt?mt.find(function(yn){return yn[sn]===et}):tt==null||((Ht=tt.group_settings)===null||Ht===void 0)?void 0:Ht.find(function(yn){return yn.group_id[0]===et})},Ae=(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment),kt=function(et){var mt=de(et,tt==null?void 0:tt.allow_late_settings,"id"),Ht=de(et,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.allow_late)&&mt&&(mt==null?void 0:mt.late_time)!==null||(tt==null?void 0:tt.anonymous_comment)&&Ht&&(Ht==null?void 0:Ht.evaluation_start)!==null},dt=Object(h.useMemo)(function(){var Le;if(tt!=null&&tt.unified_setting){var et;return!(tn!=null&&(et=tn.homework_status)!==null&&et!==void 0&&et.includes("\u5DF2\u622A\u6B62"))||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment)}var mt=tt==null||((Le=tt.group_settings)===null||Le===void 0)?void 0:Le.some(function(Ht){return A()(Ht.end_time)<=A()()});return!mt||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.all_group_late)},[tt,tn]),Zt=tt==null?void 0:tt.anonymous_comment,un=function(et){if(!et)return!1;var mt=de(et,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.anonymous_comment)&&mt&&(mt==null?void 0:mt.evaluation_start)!==null};return y.a.createElement("section",{className:[ge.a.form," bg-white pl30 pr30 pt10"].join(" ")},y.a.createElement(M.a,null,y.a.createElement(u.a,{span:24},y.a.createElement(M.a,{align:"middle"},y.a.createElement(u.a,{flex:"1"}),y.a.createElement(u.a,null,Object(H.c)()&&yt&&y.a.createElement(p.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return At(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),y.a.createElement("div",null,y.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",y.a.createElement(I.a.Group,{disabled:yt||!(tn!=null&&(ze=tn.homework_status)!==null&&ze!==void 0&&ze.includes("\u672A\u53D1\u5E03")),value:bt.unified_setting,onChange:function(et){var mt;if(!(tn!=null&&(mt=tn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))){i.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(bt.unified_setting=!bt.unified_setting,bt.unified_setting||(bt.unified_late=!1),Qt(Object.assign({},bt)),bt.unified_setting===!1&&se==""){pe(se.concat({}));return}bt.unified_setting&&(pe([]),Ot([{late_penalty:5}]))}},y.a.createElement(I.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),y.a.createElement(I.a,{disabled:(tt==null||((gt=tt.group_settings)===null||gt===void 0)?void 0:gt.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(tt==null||((ct=tt.group_settings)===null||ct===void 0)?void 0:ct.length)===0&&y.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09"))),bt.unified_setting&&y.a.createElement("div",null,y.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u53D1\u5E03\u65F6\u95F4:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(v.a,{disabled:yt||!(tn!=null&&(jt=tn.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03")||tn!=null&&(oe=tn.homework_status)!==null&&oe!==void 0&&oe.includes("\u672A\u5F00\u59CB")),style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(et){return Ye(et,tt==null?void 0:tt.course_end_date)},disabledTime:function(et){return ve(et)},value:bt.publish_time?A()(bt.publish_time):"",onChange:function(et,mt){bt.publish_time=mt,(bt.end_time==""||!bt.end_time)&&bt.unified_setting&&(bt.end_time=A()(et).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Qt(Object.assign({},bt))}})),y.a.createElement(u.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),y.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u622A\u6B62\u65F6\u95F4:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(v.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(q.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:yt||Ae,disabledDate:function(et){return Ye(et,tt==null?void 0:tt.course_end_date,bt.publish_time)},disabledTime:function(et){return ve(et,bt.publish_time)},value:bt.end_time?A()(bt.end_time):"",onChange:function(et,mt){bt.end_time=mt,Qt(Object.assign({},bt))}})),y.a.createElement(u.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!bt.unified_setting&&((Ne=se)===null||Ne===void 0?void 0:Ne.length)>0&&y.a.createElement(M.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},y.a.createElement(u.a,{span:24},y.a.createElement(M.a,null,y.a.createElement(u.a,{span:10}),y.a.createElement(u.a,{span:10},y.a.createElement(M.a,{className:"c-grey-c ml30"},y.a.createElement(u.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),y.a.createElement(u.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),y.a.createElement(u.a,{span:4}))),se&&se.map(function(Le,et){var mt,Ht,sn,yn,nr;return y.a.createElement(u.a,{span:24,key:et},y.a.createElement(M.a,{gutter:[8,16]},y.a.createElement(u.a,{span:10},y.a.createElement(M.a,{gutter:[8,16]},y.a.createElement(u.a,null,"\u53D1\u5E03\u89C4\u5219 ",et+1),y.a.createElement(u.a,{flex:"1",style:{maxWidth:300}},y.a.createElement(R.a,{disabled:yt||!(tn!=null&&(mt=tn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))&&Le.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Le.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Cn){se[et].group_name=Cn,se[et].group_id=Le.group_id;var br=Object(w.flattenDeep)(se.map(function(rr){return rr.group_name})),Er=Ke.map(function(rr){var cr=(rr==null?void 0:rr.group_name)||[];return Object(O.a)(Object(O.a)({},rr),{},{group_name:Object(w.remove)(cr,function(Pr){return br.includes(Pr)})})});Ot(Er),pe(se.slice())}},tt.group_settings&&tt.group_settings.map(function(Kn){var Cn=se.map(function(br){return br.group_name}).flat();if(!Cn.includes(Kn.group_name))return y.a.createElement(at,{value:Kn.group_name,key:Kn.id},Kn.group_name)}))))),y.a.createElement(u.a,{span:10},y.a.createElement("div",{className:"ml30"},y.a.createElement(fe,{ranges:{\u6B64\u523B:[Le.publish_time?A()(Le.publish_time):A()(),A()()]},allowClear:!1,disabled:yt||(A()()<=A()((Ht=de((sn=Le.group_id)===null||sn===void 0?void 0:sn[0]))===null||Ht===void 0?void 0:Ht.publish_time)?!1:[!0,kt((yn=Le.group_id)===null||yn===void 0?void 0:yn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(Cn){return Ye(Cn,tt==null?void 0:tt.course_end_date)},disabledTime:function(Cn){return ve(Cn)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[A()(Object(q.d)(),"HH:mm"),A()(Object(q.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Le.publish_time&&[A()(Le.publish_time),Le.end_time?A()(Le.end_time):void 0],onChange:function(Cn,br){se[et].publish_time=br[0],se[et].end_time=br[1],pe(Object(n.a)(se))}}))),!yt&&y.a.createElement(u.a,{span:4},et>0&&!Le.id&&y.a.createElement(g.a,{onClick:function(){se=se.filter(function(Cn,br){return et!==br}),pe(se.slice()),setTimeout(function(){return pe(se.slice())},10)}}),se.length<(tt==null||((nr=tt.group_settings)===null||nr===void 0)?void 0:nr.length)&&y.a.createElement(x.a,{className:"c-green ml20",onClick:function(){pe(se.concat({}))}}))))})),y.a.createElement(k.a,null),y.a.createElement(M.a,null,y.a.createElement(u.a,null,y.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),y.a.createElement(G.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},y.a.createElement(j.a,{style:{marginLeft:4,cursor:"pointer"}}))),y.a.createElement(u.a,{span:24,className:"mt15 pl30"},y.a.createElement(V.a,{checked:bt.allow_late,disabled:yt||dt,onChange:function(){bt.allow_late=!bt.allow_late,Ke==""&&Ot([{late_penalty:5}]),Qt(Object.assign({},bt))}},y.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),y.a.createElement(G.a,{overlayStyle:{width:380,maxWidth:380},title:y.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},y.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),y.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),y.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},y.a.createElement(j.a,null)))),(bt==null?void 0:bt.allow_late)&&y.a.createElement("div",{style:{marginLeft:22}},y.a.createElement("div",{className:"ml30 mt20"},y.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),y.a.createElement(I.a.Group,{disabled:yt||(tt==null?void 0:tt.anonymous_comment)||(tt==null?void 0:tt.allow_late),value:bt.unified_late,onChange:function(et){bt.unified_late=et.target.value,Ke==""&&!et.target.value&&Ot([{penalty_type:ke.a.Percent,late_penalty:20}]),Qt(Object(O.a)({},bt))}},(bt==null?void 0:bt.unified_setting)&&y.a.createElement(I.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(tt==null||((Ge=tt.group_settings)===null||Ge===void 0)?void 0:Ge.length)>0&&y.a.createElement(I.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),bt!=null&&bt.unified_late?y.a.createElement(y.a.Fragment,null,y.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u8865\u4EA4\u6263\u5206:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(ke.b,{disabled:yt||Zt,value:{type:bt.penalty_type,inputValue:bt.late_penalty},onChange:function(et){Qt(Object(O.a)(Object(O.a)({},bt),{},{late_penalty:et.inputValue,penalty_type:et.type}))}})),y.a.createElement(u.a,{flex:"1",className:"ml5"},y.a.createElement("span",{className:"c-grey-c ml10"},bt.penalty_type===ke.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),y.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(u.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),y.a.createElement(u.a,{className:"ml5"},y.a.createElement(v.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(q.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:yt||Zt,value:bt.late_time?A()(bt.late_time):"",disabledDate:function(et){return Ye(et,tt==null?void 0:tt.course_end_date)},onChange:function(et,mt){bt.late_time=mt,Qt(Object.assign({},bt))}})),y.a.createElement(u.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Ke.map(function(Le,et){var mt;return y.a.createElement(u.a,{span:24,key:et},y.a.createElement(M.a,{className:"mt25"},y.a.createElement(u.a,{style:{marginLeft:30}},y.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",et+1,"\uFF1A"),y.a.createElement(R.a,{disabled:yt||!(tn!=null&&(mt=tn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))&&Le.id||(tt==null?void 0:tt.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Le.group_name=="string"?[Le.group_name]:Le.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(sn){Ke[et].group_name=sn,Ke[et].group_id=Le.group_id,Ot(Ke.slice())}},tt.group_settings&&tt.group_settings.map(function(Ht){var sn=Ke.map(function(nr){return nr.group_name}).flat(),yn=se.map(function(nr){return nr.group_name}).flat();if(bt!=null&&bt.unified_setting){if(!sn.includes(Ht.group_name))return y.a.createElement(at,{value:Ht.group_name,key:Ht.id},Ht.group_name)}else if(yn.includes(Ht.group_name)&&(!sn.includes(Ht.group_name)&&A()(Ht.end_time)<=A()()))return y.a.createElement(at,{value:Ht.group_name,key:Ht.id},Ht.group_name)}))),y.a.createElement(u.a,{className:"ml20"},y.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),y.a.createElement(ke.b,{disabled:yt||un(Le.id),value:{type:Le.penalty_type,inputValue:Le.late_penalty},onChange:function(sn){Ke[et].late_penalty=sn.inputValue,Ke[et].penalty_type=sn.type,Ot(Object(n.a)(Ke))}})),y.a.createElement(u.a,{className:"ml20"},y.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),y.a.createElement(v.a,{disabled:yt||un(Le.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:A()(Object(q.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(sn){return Ye(sn,tt==null?void 0:tt.course_end_date)},format:"YYYY-MM-DD HH:mm",value:Le!=null&&Le.late_time?A()(Le.late_time):void 0,onChange:function(sn,yn){Ke[et].late_time=yn,Ot(Object(n.a)(Ke))}})),!yt&&y.a.createElement(u.a,{className:"ml20"},et>0&&!Le.id&&y.a.createElement(g.a,{onClick:function(){Ke=Ke.filter(function(sn,yn){return et!==yn}),Ot(Ke.slice()),setTimeout(function(){return Ot(Ke.slice())},10)}}),y.a.createElement(x.a,{className:"c-green ml20",onClick:function(){Ot(Ke.concat({penalty_type:ke.a.Percent,late_minus_score:20}))}}))))})),y.a.createElement(k.a,null),!yt&&y.a.createElement(u.a,{className:"mb50"},y.a.createElement(p.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:De,onClick:function(){return Ct()}},"\u63D0\u4EA4"),y.a.createElement(p.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){At(!0),Et()}},"\u53D6\u6D88")))};he.a=Object(xe.a)(function(Ft){var St=Ft.shixunHomeworks,ze=Ft.loading;return{shixunHomeworks:St,loading:ze.effects}})(Jt)},fjLI:function(Gt,he,D){"use strict";D.d(he,"f",function(){return m}),D.d(he,"b",function(){return u}),D.d(he,"a",function(){return a}),D.d(he,"d",function(){return o}),D.d(he,"e",function(){return c}),D.d(he,"c",function(){return s});var Z=D("8HAY"),V=D("Vhoy"),U=D("MI8n"),G=D("JYp7"),P=D("pmY6"),k=D("24hK"),K=D("nnTU"),I=D("T8No"),r=D("Cg/j"),M=D("t9D7"),_=function(i,n,O,T){var C=arguments.length,R=C<3?n:T===null?T=Object.getOwnPropertyDescriptor(n,O):T,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(i,n,O,T);else for(var v=i.length-1;v>=0;v--)(S=i[v])&&(R=(C<3?S(R):C>3?S(n,O,R):S(n,O))||R);return C>3&&R&&Object.defineProperty(n,O,R),R},p=function(i,n){return function(O,T){n(O,T,i)}};function m(i){return i.command!==void 0}class u{constructor(i){this.id=u._idPool++,this._debugName=i}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const a=Object(r.c)("menuService"),o=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new U.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===u.CommandPalette}}addCommand(i){return this.addCommands(G.a.single(i))}addCommands(i){for(const n of i)this._commands.set(n.id,n);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(P.i)(()=>{let n=!1;for(const O of i)n=this._commands.delete(O.id)||n;n&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((n,O)=>i.set(O,n)),i}appendMenuItem(i,n){return this.appendMenuItems(G.a.single({id:i,item:n}))}appendMenuItems(i){const n=new Set,O=new k.a;for(const{id:T,item:C}of i){let R=this._menuItems.get(T);R||(R=new k.a,this._menuItems.set(T,R)),O.push(R.push(C)),n.add(T)}return this._onDidChangeMenu.fire(n),Object(P.i)(()=>{if(O.size>0){for(let T of O)T();this._onDidChangeMenu.fire(n),O.clear()}})}getMenuItems(i){let n;return this._menuItems.has(i)?n=[...this._menuItems.get(i)]:n=[],i===u.CommandPalette&&this._appendImplicitItems(n),n}_appendImplicitItems(i){const n=new Set;for(const O of i)m(O)&&(n.add(O.command.id),O.alt&&n.add(O.alt.id));this._commands.forEach((O,T)=>{n.has(T)||i.push({command:O})})}};class c extends Z.e{constructor(i,n,O,T){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=n,this._contextKeyService=O,this._options=T}get actions(){const i=[],n=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=n.getActions(this._options);n.dispose();for(const[,T]of O)T.length>0&&(i.push(...T),i.push(new Z.d));return i.length&&i.pop(),i}}let s=class i{constructor(n,O,T,C,R){var S,v;if(this._commandService=R,this.id=n.id,this.label=(T==null?void 0:T.renderShortTitle)&&n.shortTitle?typeof n.shortTitle=="string"?n.shortTitle:n.shortTitle.value:typeof n.title=="string"?n.title:n.title.value,this.tooltip=(v=typeof n.tooltip=="string"?n.tooltip:(S=n.tooltip)===null||S===void 0?void 0:S.value)!==null&&v!==void 0?v:"",this.enabled=!n.precondition||C.contextMatchesRules(n.precondition),this.checked=void 0,n.toggled){const E=n.toggled.condition?n.toggled:{condition:n.toggled};this.checked=C.contextMatchesRules(E.condition),this.checked&&E.tooltip&&(this.tooltip=typeof E.tooltip=="string"?E.tooltip:E.tooltip.value),E.title&&(this.label=typeof E.title=="string"?E.title:E.title.value)}this.item=n,this.alt=O?new i(O,void 0,T,C,R):void 0,this._options=T,M.d.isThemeIcon(n.icon)&&(this.class=V.a.asClassName(n.icon))}dispose(){}run(...n){var O,T;let C=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(C=[...C,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(C=[...C,...n]),this._commandService.executeCommand(this.id,...C)}};s=_([p(3,I.b),p(4,K.b)],s)},fyJ8:function(Gt,he,D){"use strict";var Z=D("rePB"),V=D("VTBJ"),U=D("Ff2n"),G=D("U8pU"),P=D("q1tI"),k=D.n(P),K=D("TSYQ"),I=D.n(K),r=D("c+Xe"),M=D("sR1s");function _(o){return o&&Object(G.a)(o)==="object"&&!Array.isArray(o)&&!P.isValidElement(o)}function p(o){return typeof o=="string"?!0:Object(r.c)(o)}function m(o,c){var s,i=o.prefixCls,n=o.className,O=o.record,T=o.index,C=o.dataIndex,R=o.render,S=o.children,v=o.component,E=v===void 0?"td":v,f=o.colSpan,h=o.rowSpan,y=o.fixLeft,g=o.fixRight,x=o.firstFixLeft,j=o.lastFixLeft,B=o.firstFixRight,A=o.lastFixRight,H=o.appendNode,F=o.additionalProps,w=F===void 0?{}:F,Y=o.ellipsis,q=o.align,ie=o.rowType,ge=o.isSticky,Je="".concat(i,"-cell"),xe,ke;if(S)ke=S;else{var Qe=Object(M.b)(O,C);if(ke=Qe,R){var Ye=R(Qe,O,T);_(Ye)?(ke=Ye.children,xe=Ye.props):ke=Ye}}Object(G.a)(ke)==="object"&&!Array.isArray(ke)&&!P.isValidElement(ke)&&(ke=null),Y&&(j||B)&&(ke=P.createElement("span",{className:"".concat(Je,"-content")},ke));var ve=xe||{},fe=ve.colSpan,at=ve.rowSpan,Jt=ve.style,Ft=ve.className,St=Object(U.a)(ve,["colSpan","rowSpan","style","className"]),ze=fe!==void 0?fe:f,gt=at!==void 0?at:h;if(ze===0||gt===0)return null;var ct={},jt=typeof y=="number",oe=typeof g=="number";jt&&(ct.position="sticky",ct.left=y),oe&&(ct.position="sticky",ct.right=g);var Ne={};q&&(Ne.textAlign=q);var Ge,Xe=Y===!0?{showTitle:!0}:Y;Xe&&(Xe.showTitle||ie==="header")&&(typeof ke=="string"||typeof ke=="number"?Ge=ke.toString():P.isValidElement(ke)&&typeof ke.props.children=="string"&&(Ge=ke.props.children));var Bt=Object(V.a)(Object(V.a)(Object(V.a)({title:Ge},St),w),{},{colSpan:ze&&ze!==1?ze:null,rowSpan:gt&&gt!==1?gt:null,className:I()(Je,n,(s={},Object(Z.a)(s,"".concat(Je,"-fix-left"),jt),Object(Z.a)(s,"".concat(Je,"-fix-left-first"),x),Object(Z.a)(s,"".concat(Je,"-fix-left-last"),j),Object(Z.a)(s,"".concat(Je,"-fix-right"),oe),Object(Z.a)(s,"".concat(Je,"-fix-right-first"),B),Object(Z.a)(s,"".concat(Je,"-fix-right-last"),A),Object(Z.a)(s,"".concat(Je,"-ellipsis"),Y),Object(Z.a)(s,"".concat(Je,"-with-append"),H),Object(Z.a)(s,"".concat(Je,"-fix-sticky"),(jt||oe)&&ge),s),w.className,Ft),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},w.style),Ne),ct),Jt),ref:p(E)?c:null});return P.createElement(E,Object.assign({},Bt),H,ke)}var u=P.forwardRef(m);u.displayName="Cell";var a=P.memo(u,function(o,c){return c.shouldCellUpdate?!c.shouldCellUpdate(c.record,o.record):!1});he.a=a},hW8S:function(Gt,he,D){"use strict";D.d(he,"a",function(){return G}),D.d(he,"c",function(){return P}),D.d(he,"b",function(){return k});var Z=D("VTBJ"),V=D("Ff2n"),U=D("Kwbf"),G="RC_TABLE_INTERNAL_COL_DEFINE";function P(K){var I=K.expandable,r=Object(V.a)(K,["expandable"]);return"expandable"in K?Object(Z.a)(Object(Z.a)({},r),I):r}function k(K){return Object.keys(K).reduce(function(I,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(I[r]=K[r]),I},{})}},iF7n:function(Gt,he,D){Gt.exports={flex_box_center:"flex_box_center___1Hyu4",flex_space_between:"flex_space_between___3ssyf",flex_box_vertical_center:"flex_box_vertical_center___1Gkv-",flex_box_center_end:"flex_box_center_end___1fs_5",flex_box_column:"flex_box_column___3KImt",top:"top___FkMRG",desc:"desc___zZgSM",liked:"liked___1eBGI",likedActive:"likedActive___1i_lJ",reply:"reply___1mww8",replyList:"replyList___3NmMj",comment:"comment___1kF3h"}},ic2d:function(Gt,he,D){"use strict";D.d(he,"a",function(){return G});var Z=D("FWmy"),V=D("746U");class U{constructor(){this.data=new Map}add(P,k){Z.a(V.l(P)),Z.a(V.k(k)),Z.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,k)}as(P){return this.data.get(P)||null}}const G=new U},k3GJ:function(Gt,he,D){"use strict";D.d(he,"a",function(){return mr});var Z=D("rePB"),V=D("ODXe"),U=D("Ff2n"),G=D("VTBJ"),P=D("q1tI"),k=D("TSYQ"),K=D.n(k),I=D("Zm9Q"),r=D("6cGi"),M=D("KQm4"),_=D("xEkU"),p=D.n(_),m=D("t23M");function u(Ee){var Ue=Object(P.useRef)(),Ve=Object(P.useRef)(!1);function Se(){for(var re=arguments.length,me=new Array(re),ue=0;ue<re;ue++)me[ue]=arguments[ue];Ve.current||(p.a.cancel(Ue.current),Ue.current=p()(function(){Ee.apply(void 0,me)}))}return Object(P.useEffect)(function(){return function(){Ve.current=!0,p.a.cancel(Ue.current)}},[]),Se}function a(Ee){var Ue=Object(P.useRef)([]),Ve=Object(P.useState)({}),Se=Object(V.a)(Ve,2),re=Se[1],me=Object(P.useRef)(typeof Ee=="function"?Ee():Ee),ue=u(function(){var Pe=me.current;Ue.current.forEach(function(qe){Pe=qe(Pe)}),Ue.current=[],me.current=Pe,re({})});function Oe(Pe){Ue.current.push(Pe),ue()}return[me.current,Oe]}var o=D("4IlW");function c(Ee,Ue){var Ve,Se=Ee.prefixCls,re=Ee.id,me=Ee.active,ue=Ee.rtl,Oe=Ee.tab,Pe=Oe.key,qe=Oe.tab,Ie=Oe.disabled,ut=Oe.closeIcon,Ut=Ee.tabBarGutter,an=Ee.tabPosition,mn=Ee.closable,Hn=Ee.renderWrapper,Vn=Ee.removeAriaLabel,fr=Ee.editable,dr=Ee.onClick,wr=Ee.onRemove,Ar=Ee.onFocus,gr="".concat(Se,"-tab");P.useEffect(function(){return wr},[]);var Cr={};an==="top"||an==="bottom"?Cr[ue?"marginLeft":"marginRight"]=Ut:Cr.marginBottom=Ut;var Lr=fr&&mn!==!1&&!Ie;function gn(zt){if(Ie)return;dr(zt)}function nn(zt){zt.preventDefault(),zt.stopPropagation(),fr.onEdit("remove",{key:Pe,event:zt})}var xn=P.createElement("div",{key:Pe,ref:Ue,className:K()(gr,(Ve={},Object(Z.a)(Ve,"".concat(gr,"-with-remove"),Lr),Object(Z.a)(Ve,"".concat(gr,"-active"),me),Object(Z.a)(Ve,"".concat(gr,"-disabled"),Ie),Ve)),style:Cr,onClick:gn},P.createElement("div",{role:"tab","aria-selected":me,id:re&&"".concat(re,"-tab-").concat(Pe),className:"".concat(gr,"-btn"),"aria-controls":re&&"".concat(re,"-panel-").concat(Pe),"aria-disabled":Ie,tabIndex:Ie?null:0,onClick:function(Vt){Vt.stopPropagation(),gn(Vt)},onKeyDown:function(Vt){[o.a.SPACE,o.a.ENTER].includes(Vt.which)&&(Vt.preventDefault(),gn(Vt))},onFocus:Ar},qe),Lr&&P.createElement("button",{type:"button","aria-label":Vn||"remove",tabIndex:0,className:"".concat(gr,"-remove"),onClick:function(Vt){Vt.stopPropagation(),nn(Vt)}},ut||fr.removeIcon||"\xD7"));return Hn&&(xn=Hn(xn)),xn}var s=P.forwardRef(c),i={width:0,height:0,left:0,top:0};function n(Ee,Ue,Ve){return Object(P.useMemo)(function(){for(var Se,re=new Map,me=Ue.get((Se=Ee[0])===null||Se===void 0?void 0:Se.key)||i,ue=me.left+me.width,Oe=0;Oe<Ee.length;Oe+=1){var Pe=Ee[Oe].key,qe=Ue.get(Pe);if(!qe){var Ie;qe=Ue.get((Ie=Ee[Oe-1])===null||Ie===void 0?void 0:Ie.key)||i}var ut=re.get(Pe)||Object(G.a)({},qe);ut.right=ue-ut.left-ut.width,re.set(Pe,ut)}return re},[Ee.map(function(Se){return Se.key}).join("_"),Ue,Ve])}var O={width:0,height:0,left:0,top:0,right:0};function T(Ee,Ue,Ve,Se,re){var me=re.tabs,ue=re.tabPosition,Oe=re.rtl,Pe,qe,Ie;["top","bottom"].includes(ue)?(Pe="width",qe=Oe?"right":"left",Ie=Math.abs(Ue.left)):(Pe="height",qe="top",Ie=-Ue.top);var ut=Ue[Pe],Ut=Ve[Pe],an=Se[Pe],mn=ut;return Ut+an>ut&&(mn=ut-an),Object(P.useMemo)(function(){if(!me.length)return[0,0];for(var Hn=me.length,Vn=Hn,fr=0;fr<Hn;fr+=1){var dr=Ee.get(me[fr].key)||O;if(dr[qe]+dr[Pe]>Ie+mn){Vn=fr-1;break}}for(var wr=0,Ar=Hn-1;Ar>=0;Ar-=1){var gr=Ee.get(me[Ar].key)||O;if(gr[qe]<Ie){wr=Ar+1;break}}return[wr,Vn]},[Ee,Ie,mn,ue,me.map(function(Hn){return Hn.key}).join("_"),Oe])}var C=D("wx14"),R=D("1OyB"),S=D("vuIU"),v=D("JX7q"),E=D("Ji7U"),f=D("LK+K"),h=D("I8Z2"),y=D("bT9E"),g=D("2GS6"),x=D("Gytx"),j=D.n(x),B=D("U8pU"),A=/iPhone/i,H=/iPod/i,F=/iPad/i,w=/\bAndroid(?:.+)Mobile\b/i,Y=/Android/i,q=/\bAndroid(?:.+)SD4930UR\b/i,ie=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ge=/Windows Phone/i,Je=/\bWindows(?:.+)ARM\b/i,xe=/BlackBerry/i,ke=/BB10/i,Qe=/Opera Mini/i,Ye=/\b(CriOS|Chrome)(?:.+)Mobile/i,ve=/Mobile(?:.+)Firefox\b/i;function fe(Ee,Ue){return Ee.test(Ue)}function at(Ee){var Ue=Ee||(typeof navigator!="undefined"?navigator.userAgent:""),Ve=(Ue||"").split("[FBAN");if(typeof Ve[1]!="undefined"){var Se=Ve,re=Object(V.a)(Se,1);Ue=re[0]}if(Ve=Ue.split("Twitter"),typeof Ve[1]!="undefined"){var me=Ve,ue=Object(V.a)(me,1);Ue=ue[0]}var Oe={apple:{phone:fe(A,Ue)&&!fe(ge,Ue),ipod:fe(H,Ue),tablet:!fe(A,Ue)&&fe(F,Ue)&&!fe(ge,Ue),device:(fe(A,Ue)||fe(H,Ue)||fe(F,Ue))&&!fe(ge,Ue)},amazon:{phone:fe(q,Ue),tablet:!fe(q,Ue)&&fe(ie,Ue),device:fe(q,Ue)||fe(ie,Ue)},android:{phone:!fe(ge,Ue)&&fe(q,Ue)||!fe(ge,Ue)&&fe(w,Ue),tablet:!fe(ge,Ue)&&!fe(q,Ue)&&!fe(w,Ue)&&(fe(ie,Ue)||fe(Y,Ue)),device:!fe(ge,Ue)&&(fe(q,Ue)||fe(ie,Ue)||fe(w,Ue)||fe(Y,Ue))||fe(/\bokhttp\b/i,Ue)},windows:{phone:fe(ge,Ue),tablet:fe(Je,Ue),device:fe(ge,Ue)||fe(Je,Ue)},other:{blackberry:fe(xe,Ue),blackberry10:fe(ke,Ue),opera:fe(Qe,Ue),firefox:fe(ve,Ue),chrome:fe(Ye,Ue),device:fe(xe,Ue)||fe(ke,Ue)||fe(Qe,Ue)||fe(ve,Ue)||fe(Ye,Ue)},any:null,phone:null,tablet:null};return Oe.any=Oe.apple.device||Oe.android.device||Oe.windows.device||Oe.other.device,Oe.phone=Oe.apple.phone||Oe.android.phone||Oe.windows.phone,Oe.tablet=Oe.apple.tablet||Oe.android.tablet||Oe.windows.tablet,Oe}var Jt=Object(G.a)(Object(G.a)({},at()),{},{isMobile:at}),Ft=Jt;function St(){}function ze(Ee,Ue,Ve){var Se=Ue||"";return Ee.key||"".concat(Se,"item_").concat(Ve)}function gt(Ee){return"".concat(Ee,"-menu-")}function ct(Ee,Ue){var Ve=-1;P.Children.forEach(Ee,function(Se){Ve+=1,Se&&Se.type&&Se.type.isMenuItemGroup?P.Children.forEach(Se.props.children,function(re){Ve+=1,Ue(re,Ve)}):Ue(Se,Ve)})}function jt(Ee,Ue,Ve){if(!Ee||Ve.find)return;P.Children.forEach(Ee,function(Se){if(Se){var re=Se.type;if(!re||!(re.isSubMenu||re.isMenuItem||re.isMenuItemGroup))return;Ue.indexOf(Se.key)!==-1?Ve.find=!0:Se.props.children&&jt(Se.props.children,Ue,Ve)}})}var oe=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Ne=function(Ue){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=Ue&&typeof Ue.getBoundingClientRect=="function"&&Ue.getBoundingClientRect().width;if(Se){if(Ve){var re=getComputedStyle(Ue),me=re.marginLeft,ue=re.marginRight;Se+=+me.replace("px","")+ +ue.replace("px","")}Se=+Se.toFixed(6)}return Se||0},Ge=function(Ue,Ve,Se){Ue&&Object(B.a)(Ue.style)==="object"&&(Ue.style[Ve]=Se)},Xe=function(){return Ft.any},Bt=D("bdgK"),Wt=D("i8i4"),en=D.n(Wt),tt=D("wgJM"),tn=D("l4aY"),En=D("m+aA"),We=D("c+Xe"),Fe=D("zT1h"),yt=D("QC+M");function At(Ee,Ue,Ve){return Ve?Ee[0]===Ue[0]:Ee[0]===Ue[0]&&Ee[1]===Ue[1]}function nt(Ee,Ue,Ve){var Se=Ee[Ue]||{};return Object(G.a)(Object(G.a)({},Se),Ve)}function st(Ee,Ue,Ve,Se){for(var re=Ve.points,me=Object.keys(Ee),ue=0;ue<me.length;ue+=1){var Oe=me[ue];if(At(Ee[Oe].points,re,Se))return"".concat(Ue,"-placement-").concat(Oe)}return""}var De=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ee=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ee)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ee==null?void 0:Ee.substr(0,4)))},ye=D("MNnm");function we(Ee,Ue){var Ve={};return Ve[Ee.toLowerCase()]=Ue.toLowerCase(),Ve["Webkit".concat(Ee)]="webkit".concat(Ue),Ve["Moz".concat(Ee)]="moz".concat(Ue),Ve["ms".concat(Ee)]="MS".concat(Ue),Ve["O".concat(Ee)]="o".concat(Ue.toLowerCase()),Ve}function ae(Ee,Ue){var Ve={animationend:we("Animation","AnimationEnd"),transitionend:we("Transition","TransitionEnd")};return Ee&&("AnimationEvent"in Ue||delete Ve.animationend.animation,"TransitionEvent"in Ue||delete Ve.transitionend.transition),Ve}var se=ae(Object(ye.a)(),typeof window!="undefined"?window:{}),pe={};if(Object(ye.a)()){var _e=document.createElement("div");pe=_e.style}var be={};function Ke(Ee){if(be[Ee])return be[Ee];var Ue=se[Ee];if(Ue)for(var Ve=Object.keys(Ue),Se=Ve.length,re=0;re<Se;re+=1){var me=Ve[re];if(Object.prototype.hasOwnProperty.call(Ue,me)&&me in pe)return be[Ee]=Ue[me],be[Ee]}return""}var Ot=Ke("animationend"),rn=Ke("transitionend"),Dn=!!(Ot&&rn),bt=Ot||"animationend",Qt=rn||"transitionend";function Et(Ee,Ue){if(!Ee)return null;if(Object(B.a)(Ee)==="object"){var Ve=Ue.replace(/-\w/g,function(Se){return Se[1].toUpperCase()});return Ee[Ve]}return"".concat(Ee,"-").concat(Ue)}var Ct="none",lt="appear",de="enter",Ae="leave",kt="none",dt="prepare",Zt="start",un="active",Le="end";function et(Ee){var Ue=Object(P.useRef)(!1),Ve=Object(P.useState)(Ee),Se=Object(V.a)(Ve,2),re=Se[0],me=Se[1];function ue(Oe){Ue.current||me(Oe)}return Object(P.useEffect)(function(){return function(){Ue.current=!0}},[]),[re,ue]}var mt=Object(ye.a)()?P.useLayoutEffect:P.useEffect,Ht=mt,sn=function(){var Ee=P.useRef(null);function Ue(){tt.a.cancel(Ee.current)}function Ve(Se){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ue();var me=Object(tt.a)(function(){re<=1?Se({isCanceled:function(){return me!==Ee.current}}):Ve(Se,re-1)});Ee.current=me}return P.useEffect(function(){return function(){Ue()}},[]),[Ve,Ue]},yn=[dt,Zt,un,Le],nr=!1,Kn=!0;function Cn(Ee){return Ee===un||Ee===Le}var br=function(Ee,Ue){var Ve=P.useState(kt),Se=Object(V.a)(Ve,2),re=Se[0],me=Se[1],ue=sn(),Oe=Object(V.a)(ue,2),Pe=Oe[0],qe=Oe[1];function Ie(){me(dt)}return Ht(function(){if(re!==kt&&re!==Le){var ut=yn.indexOf(re),Ut=yn[ut+1],an=Ue(re);an===nr?me(Ut):Pe(function(mn){function Hn(){if(mn.isCanceled())return;me(Ut)}an===!0?Hn():Promise.resolve(an).then(Hn)})}},[Ee,re]),P.useEffect(function(){return function(){qe()}},[]),[Ie,re]},Er=function(Ee){var Ue=Object(P.useRef)(),Ve=Object(P.useRef)(Ee);Ve.current=Ee;var Se=P.useCallback(function(ue){Ve.current(ue)},[]);function re(ue){ue&&(ue.removeEventListener(Qt,Se),ue.removeEventListener(bt,Se))}function me(ue){Ue.current&&Ue.current!==ue&&re(Ue.current),ue&&ue!==Ue.current&&(ue.addEventListener(Qt,Se),ue.addEventListener(bt,Se),Ue.current=ue)}return P.useEffect(function(){return function(){re(Ue.current)}},[]),[me,re]};function rr(Ee,Ue,Ve,Se){var re=Se.motionEnter,me=re===void 0?!0:re,ue=Se.motionAppear,Oe=ue===void 0?!0:ue,Pe=Se.motionLeave,qe=Pe===void 0?!0:Pe,Ie=Se.motionDeadline,ut=Se.motionLeaveImmediately,Ut=Se.onAppearPrepare,an=Se.onEnterPrepare,mn=Se.onLeavePrepare,Hn=Se.onAppearStart,Vn=Se.onEnterStart,fr=Se.onLeaveStart,dr=Se.onAppearActive,wr=Se.onEnterActive,Ar=Se.onLeaveActive,gr=Se.onAppearEnd,Cr=Se.onEnterEnd,Lr=Se.onLeaveEnd,gn=Se.onVisibleChanged,nn=et(),xn=Object(V.a)(nn,2),zt=xn[0],Vt=xn[1],pr=et(Ct),Mr=Object(V.a)(pr,2),ir=Mr[0],Ur=Mr[1],oi=et(null),jr=Object(V.a)(oi,2),Xr=jr[0],zr=jr[1],Wr=Object(P.useRef)(!1),Hr=Object(P.useRef)(null),vr=Object(P.useRef)(!1),yi=Object(P.useRef)(null);function Qi(){var si=Ve();return si||yi.current}var ji=Object(P.useRef)(!1);function Ri(si){var Qr=Qi();if(si&&!si.deadline&&si.target!==Qr)return;var Ti;ir===lt&&ji.current?Ti=gr==null?void 0:gr(Qr,si):ir===de&&ji.current?Ti=Cr==null?void 0:Cr(Qr,si):ir===Ae&&ji.current&&(Ti=Lr==null?void 0:Lr(Qr,si)),Ti!==!1&&!vr.current&&(Ur(Ct),zr(null))}var ui=Er(Ri),qr=Object(V.a)(ui,1),ii=qr[0],ci=P.useMemo(function(){var si,Qr,Ti;switch(ir){case"appear":return si={},Object(Z.a)(si,dt,Ut),Object(Z.a)(si,Zt,Hn),Object(Z.a)(si,un,dr),si;case"enter":return Qr={},Object(Z.a)(Qr,dt,an),Object(Z.a)(Qr,Zt,Vn),Object(Z.a)(Qr,un,wr),Qr;case"leave":return Ti={},Object(Z.a)(Ti,dt,mn),Object(Z.a)(Ti,Zt,fr),Object(Z.a)(Ti,un,Ar),Ti;default:return{}}},[ir]),Fi=br(ir,function(si){if(si===dt){var Qr=ci[dt];return Qr?Qr(Qi()):nr}if(ei in ci){var Ti;zr(((Ti=ci[ei])===null||Ti===void 0?void 0:Ti.call(ci,Qi(),null))||null)}return ei===un&&(ii(Qi()),Ie>0&&(clearTimeout(Hr.current),Hr.current=setTimeout(function(){Ri({deadline:!0})},Ie))),Kn}),ha=Object(V.a)(Fi,2),sa=ha[0],ei=ha[1],Zi=Cn(ei);ji.current=Zi,Ht(function(){Vt(Ue);var si=Wr.current;if(Wr.current=!0,!Ee)return;var Qr;!si&&Ue&&Oe&&(Qr=lt),si&&Ue&&me&&(Qr=de),(si&&!Ue&&qe||!si&&ut&&!Ue&&qe)&&(Qr=Ae),Qr&&(Ur(Qr),sa())},[Ue]),Object(P.useEffect)(function(){(ir===lt&&!Oe||ir===de&&!me||ir===Ae&&!qe)&&Ur(Ct)},[Oe,me,qe]),Object(P.useEffect)(function(){return function(){clearTimeout(Hr.current),vr.current=!0}},[]),Object(P.useEffect)(function(){zt!==void 0&&ir===Ct&&(gn==null||gn(zt))},[zt,ir]);var qi=Xr;return ci[dt]&&ei===Zt&&(qi=Object(G.a)({transition:"none"},qi)),[ir,ei,qi,zt!=null?zt:Ue]}var cr=function(Ee){Object(E.a)(Ve,Ee);var Ue=Object(f.a)(Ve);function Ve(){return Object(R.a)(this,Ve),Ue.apply(this,arguments)}return Object(S.a)(Ve,[{key:"render",value:function(){return this.props.children}}]),Ve}(P.Component),Pr=cr;function Kr(Ee){var Ue=Ee;Object(B.a)(Ee)==="object"&&(Ue=Ee.transitionSupport);function Ve(re){return!!(re.motionName&&Ue)}var Se=P.forwardRef(function(re,me){var ue=re.visible,Oe=ue===void 0?!0:ue,Pe=re.removeOnLeave,qe=Pe===void 0?!0:Pe,Ie=re.forceRender,ut=re.children,Ut=re.motionName,an=re.leavedClassName,mn=re.eventProps,Hn=Ve(re),Vn=Object(P.useRef)(),fr=Object(P.useRef)();function dr(){try{return Object(En.a)(Vn.current||fr.current)}catch(Ur){return null}}var wr=rr(Hn,Oe,dr,re),Ar=Object(V.a)(wr,4),gr=Ar[0],Cr=Ar[1],Lr=Ar[2],gn=Ar[3],nn=P.useRef(gn);gn&&(nn.current=!0);var xn=Object(P.useRef)(me);xn.current=me;var zt=P.useCallback(function(Ur){Vn.current=Ur,Object(We.b)(xn.current,Ur)},[]),Vt,pr=Object(G.a)(Object(G.a)({},mn),{},{visible:Oe});if(!ut)Vt=null;else if(gr===Ct||!Ve(re))gn?Vt=ut(Object(G.a)({},pr),zt):!qe&&nn.current?Vt=ut(Object(G.a)(Object(G.a)({},pr),{},{className:an}),zt):Ie?Vt=ut(Object(G.a)(Object(G.a)({},pr),{},{style:{display:"none"}}),zt):Vt=null;else{var Mr,ir;Cr===dt?ir="prepare":Cn(Cr)?ir="active":Cr===Zt&&(ir="start"),Vt=ut(Object(G.a)(Object(G.a)({},pr),{},{className:K()(Et(Ut,gr),(Mr={},Object(Z.a)(Mr,Et(Ut,"".concat(gr,"-").concat(ir)),ir),Object(Z.a)(Mr,Ut,typeof Ut=="string"),Mr)),style:Lr}),zt)}return P.createElement(Pr,{ref:fr},Vt)});return Se.displayName="CSSMotion",Se}var hi=Kr(Dn),pn="add",or="keep",mi="remove",wi="removed";function ti(Ee){var Ue;return Ee&&Object(B.a)(Ee)==="object"&&"key"in Ee?Ue=Ee:Ue={key:Ee},Object(G.a)(Object(G.a)({},Ue),{},{key:String(Ue.key)})}function ni(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ee.map(ti)}function X(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ve=[],Se=0,re=Ue.length,me=ni(Ee),ue=ni(Ue);me.forEach(function(qe){for(var Ie=!1,ut=Se;ut<re;ut+=1){var Ut=ue[ut];if(Ut.key===qe.key){Se<ut&&(Ve=Ve.concat(ue.slice(Se,ut).map(function(an){return Object(G.a)(Object(G.a)({},an),{},{status:pn})})),Se=ut),Ve.push(Object(G.a)(Object(G.a)({},Ut),{},{status:or})),Se+=1,Ie=!0;break}}Ie||Ve.push(Object(G.a)(Object(G.a)({},qe),{},{status:mi}))}),Se<re&&(Ve=Ve.concat(ue.slice(Se).map(function(qe){return Object(G.a)(Object(G.a)({},qe),{},{status:pn})})));var Oe={};Ve.forEach(function(qe){var Ie=qe.key;Oe[Ie]=(Oe[Ie]||0)+1});var Pe=Object.keys(Oe).filter(function(qe){return Oe[qe]>1});return Pe.forEach(function(qe){Ve=Ve.filter(function(Ie){var ut=Ie.key,Ut=Ie.status;return ut!==qe||Ut!==mi}),Ve.forEach(function(Ie){Ie.key===qe&&(Ie.status=or)})}),Ve}var L=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function N(Ee){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hi,Ve=function(Se){Object(E.a)(me,Se);var re=Object(f.a)(me);function me(){var ue;return Object(R.a)(this,me),ue=re.apply(this,arguments),ue.state={keyEntities:[]},ue.removeKey=function(Oe){ue.setState(function(Pe){var qe=Pe.keyEntities;return{keyEntities:qe.map(function(Ie){return Ie.key!==Oe?Ie:Object(G.a)(Object(G.a)({},Ie),{},{status:wi})})}})},ue}return Object(S.a)(me,[{key:"render",value:function(){var Oe=this,Pe=this.state.keyEntities,qe=this.props,Ie=qe.component,ut=qe.children,Ut=qe.onVisibleChanged,an=Object(U.a)(qe,["component","children","onVisibleChanged"]),mn=Ie||P.Fragment,Hn={};return L.forEach(function(Vn){Hn[Vn]=an[Vn],delete an[Vn]}),delete an.keys,P.createElement(mn,an,Pe.map(function(Vn){var fr=Vn.status,dr=Object(U.a)(Vn,["status"]),wr=fr===pn||fr===or;return P.createElement(Ue,Object(C.a)({},Hn,{key:dr.key,visible:wr,eventProps:dr,onVisibleChanged:function(gr){Ut==null||Ut(gr,{key:dr.key}),gr||Oe.removeKey(dr.key)}}),ut)}))}}],[{key:"getDerivedStateFromProps",value:function(Oe,Pe){var qe=Oe.keys,Ie=Pe.keyEntities,ut=ni(qe),Ut=X(Ie,ut);return{keyEntities:Ut.filter(function(an){var mn=Ie.find(function(Hn){var Vn=Hn.key;return an.key===Vn});return!(mn&&mn.status===wi&&an.status===mi)})}}}]),me}(P.Component);return Ve.defaultProps={component:"div"},Ve}var z=N(Dn),ne=hi;function J(Ee){var Ue=Ee.prefixCls,Ve=Ee.motion,Se=Ee.animation,re=Ee.transitionName;return Ve||(Se?{motionName:"".concat(Ue,"-").concat(Se)}:re?{motionName:re}:null)}function je(Ee){var Ue=Ee.prefixCls,Ve=Ee.visible,Se=Ee.zIndex,re=Ee.mask,me=Ee.maskMotion,ue=Ee.maskAnimation,Oe=Ee.maskTransitionName;if(!re)return null;var Pe={};return(me||Oe||ue)&&(Pe=Object(G.a)({motionAppear:!0},J({motion:me,prefixCls:Ue,transitionName:Oe,animation:ue}))),P.createElement(ne,Object(C.a)({},Pe,{visible:Ve,removeOnLeave:!0}),function(qe){var Ie=qe.className;return P.createElement("div",{style:{zIndex:Se},className:K()("".concat(Ue,"-mask"),Ie)})})}var $t=D("9mu1"),In=D("o0o1"),Jn=D.n(In),ln=D("HaE+"),tr=["measure","align",null,"motion"],qn=function(Ee,Ue){var Ve=Object(P.useState)(null),Se=Object(V.a)(Ve,2),re=Se[0],me=Se[1],ue=Object(P.useRef)(),Oe=Object(P.useRef)(!1);function Pe(ut){Oe.current||me(ut)}function qe(){tt.a.cancel(ue.current)}function Ie(ut){qe(),ue.current=Object(tt.a)(function(){Pe(function(Ut){switch(re){case"align":return"motion";case"motion":return"stable";default:}return Ut}),ut==null||ut()})}return Object(P.useEffect)(function(){Pe("measure")},[Ee]),Object(P.useEffect)(function(){switch(re){case"measure":Ue();break;default:}re&&(ue.current=Object(tt.a)(Object(ln.a)(Jn.a.mark(function ut(){var Ut,an;return Jn.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:Ut=tr.indexOf(re),an=tr[Ut+1],an&&Ut!==-1&&Pe(an);case 3:case"end":return Hn.stop()}},ut)}))))},[re]),Object(P.useEffect)(function(){return function(){Oe.current=!0,qe()}},[]),[re,Ie]},kr=function(Ee){var Ue=P.useState({width:0,height:0}),Ve=Object(V.a)(Ue,2),Se=Ve[0],re=Ve[1];function me(Oe){re({width:Oe.offsetWidth,height:Oe.offsetHeight})}var ue=P.useMemo(function(){var Oe={};if(Ee){var Pe=Se.width,qe=Se.height;Ee.indexOf("height")!==-1&&qe?Oe.height=qe:Ee.indexOf("minHeight")!==-1&&qe&&(Oe.minHeight=qe),Ee.indexOf("width")!==-1&&Pe?Oe.width=Pe:Ee.indexOf("minWidth")!==-1&&Pe&&(Oe.minWidth=Pe)}return Oe},[Ee,Se]);return[ue,me]},li=P.forwardRef(function(Ee,Ue){var Ve=Ee.visible,Se=Ee.prefixCls,re=Ee.className,me=Ee.style,ue=Ee.children,Oe=Ee.zIndex,Pe=Ee.stretch,qe=Ee.destroyPopupOnHide,Ie=Ee.forceRender,ut=Ee.align,Ut=Ee.point,an=Ee.getRootDomNode,mn=Ee.getClassNameFromAlign,Hn=Ee.onAlign,Vn=Ee.onMouseEnter,fr=Ee.onMouseLeave,dr=Ee.onMouseDown,wr=Ee.onTouchStart,Ar=Object(P.useRef)(),gr=Object(P.useRef)(),Cr=Object(P.useState)(),Lr=Object(V.a)(Cr,2),gn=Lr[0],nn=Lr[1],xn=kr(Pe),zt=Object(V.a)(xn,2),Vt=zt[0],pr=zt[1];function Mr(){Pe&&pr(an())}var ir=qn(Ve,Mr),Ur=Object(V.a)(ir,2),oi=Ur[0],jr=Ur[1],Xr=Object(P.useRef)();function zr(){return Ut||an}function Wr(){var ui;(ui=Ar.current)===null||ui===void 0||ui.forceAlign()}function Hr(ui,qr){var ii=mn(qr);gn!==ii&&nn(ii),oi==="align"&&(gn!==ii?Promise.resolve().then(function(){Wr()}):jr(function(){var ci;(ci=Xr.current)===null||ci===void 0||ci.call(Xr)}),Hn==null||Hn(ui,qr))}var vr=Object(G.a)({},J(Ee));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ui){var qr=vr[ui];vr[ui]=function(ii,ci){return jr(),qr==null?void 0:qr(ii,ci)}});function yi(){return new Promise(function(ui){Xr.current=ui})}P.useEffect(function(){!vr.motionName&&oi==="motion"&&jr()},[vr.motionName,oi]),P.useImperativeHandle(Ue,function(){return{forceAlign:Wr,getElement:function(){return gr.current}}});var Qi=Object(G.a)(Object(G.a)({},Vt),{},{zIndex:Oe,opacity:oi==="motion"||oi==="stable"||!Ve?void 0:0,pointerEvents:oi==="stable"?void 0:"none"},me),ji=!0;(ut==null?void 0:ut.points)&&(oi==="align"||oi==="stable")&&(ji=!1);var Ri=ue;return P.Children.count(ue)>1&&(Ri=P.createElement("div",{className:"".concat(Se,"-content")},ue)),P.createElement(ne,Object(C.a)({visible:Ve,ref:gr,leavedClassName:"".concat(Se,"-hidden")},vr,{onAppearPrepare:yi,onEnterPrepare:yi,removeOnLeave:qe,forceRender:Ie}),function(ui,qr){var ii=ui.className,ci=ui.style,Fi=K()(Se,re,gn,ii);return P.createElement($t.a,{target:zr(),key:"popup",ref:Ar,monitorWindowResize:!0,disabled:ji,align:ut,onAlign:Hr},P.createElement("div",{ref:qr,className:Fi,onMouseEnter:Vn,onMouseLeave:fr,onMouseDownCapture:dr,onTouchStartCapture:wr,style:Object(G.a)(Object(G.a)({},ci),Qi)},Ri))})});li.displayName="PopupInner";var ai=li,Gr=P.forwardRef(function(Ee,Ue){var Ve=Ee.prefixCls,Se=Ee.visible,re=Ee.zIndex,me=Ee.children,ue=Ee.mobile;ue=ue===void 0?{}:ue;var Oe=ue.popupClassName,Pe=ue.popupStyle,qe=ue.popupMotion,Ie=qe===void 0?{}:qe,ut=ue.popupRender,Ut=P.useRef();P.useImperativeHandle(Ue,function(){return{forceAlign:function(){},getElement:function(){return Ut.current}}});var an=Object(G.a)({zIndex:re},Pe),mn=me;return P.Children.count(me)>1&&(mn=P.createElement("div",{className:"".concat(Ve,"-content")},me)),ut&&(mn=ut(mn)),P.createElement(ne,Object(C.a)({visible:Se,ref:Ut,removeOnLeave:!0},Ie),function(Hn,Vn){var fr=Hn.className,dr=Hn.style,wr=K()(Ve,Oe,fr);return P.createElement("div",{ref:Vn,className:wr,style:Object(G.a)(Object(G.a)({},dr),an)},mn)})});Gr.displayName="MobilePopupInner";var Li=Gr,Vi=["visible","mobile"],Dr=P.forwardRef(function(Ee,Ue){var Ve=Ee.visible,Se=Ee.mobile,re=Object(U.a)(Ee,Vi),me=Object(P.useState)(Ve),ue=Object(V.a)(me,2),Oe=ue[0],Pe=ue[1],qe=Object(P.useState)(!1),Ie=Object(V.a)(qe,2),ut=Ie[0],Ut=Ie[1],an=Object(G.a)(Object(G.a)({},re),{},{visible:Oe});Object(P.useEffect)(function(){Pe(Ve),Ve&&Se&&Ut(De())},[Ve,Se]);var mn=ut?P.createElement(Li,Object(C.a)({},an,{mobile:Se,ref:Ue})):P.createElement(ai,Object(C.a)({},an,{ref:Ue}));return P.createElement("div",null,P.createElement(je,an),mn)});Dr.displayName="Popup";var Sr=Dr,ri=P.createContext(null),Br=ri;function Bn(){}function _n(){return""}function Sn(Ee){return Ee?Ee.ownerDocument:window.document}var bn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function ur(Ee){var Ue=function(Ve){Object(E.a)(re,Ve);var Se=Object(f.a)(re);function re(me){var ue;Object(R.a)(this,re),ue=Se.call(this,me),ue.popupRef=P.createRef(),ue.triggerRef=P.createRef(),ue.attachId=void 0,ue.clickOutsideHandler=void 0,ue.touchOutsideHandler=void 0,ue.contextMenuOutsideHandler1=void 0,ue.contextMenuOutsideHandler2=void 0,ue.mouseDownTimeout=void 0,ue.focusTime=void 0,ue.preClickTime=void 0,ue.preTouchTime=void 0,ue.delayTimer=void 0,ue.hasPopupMouseDown=void 0,ue.onMouseEnter=function(Pe){var qe=ue.props.mouseEnterDelay;ue.fireEvents("onMouseEnter",Pe),ue.delaySetPopupVisible(!0,qe,qe?null:Pe)},ue.onMouseMove=function(Pe){ue.fireEvents("onMouseMove",Pe),ue.setPoint(Pe)},ue.onMouseLeave=function(Pe){ue.fireEvents("onMouseLeave",Pe),ue.delaySetPopupVisible(!1,ue.props.mouseLeaveDelay)},ue.onPopupMouseEnter=function(){ue.clearDelayTimer()},ue.onPopupMouseLeave=function(Pe){var qe;if(Pe.relatedTarget&&!Pe.relatedTarget.setTimeout&&Object(tn.a)((qe=ue.popupRef.current)===null||qe===void 0?void 0:qe.getElement(),Pe.relatedTarget))return;ue.delaySetPopupVisible(!1,ue.props.mouseLeaveDelay)},ue.onFocus=function(Pe){ue.fireEvents("onFocus",Pe),ue.clearDelayTimer(),ue.isFocusToShow()&&(ue.focusTime=Date.now(),ue.delaySetPopupVisible(!0,ue.props.focusDelay))},ue.onMouseDown=function(Pe){ue.fireEvents("onMouseDown",Pe),ue.preClickTime=Date.now()},ue.onTouchStart=function(Pe){ue.fireEvents("onTouchStart",Pe),ue.preTouchTime=Date.now()},ue.onBlur=function(Pe){ue.fireEvents("onBlur",Pe),ue.clearDelayTimer(),ue.isBlurToHide()&&ue.delaySetPopupVisible(!1,ue.props.blurDelay)},ue.onContextMenu=function(Pe){Pe.preventDefault(),ue.fireEvents("onContextMenu",Pe),ue.setPopupVisible(!0,Pe)},ue.onContextMenuClose=function(){ue.isContextMenuToShow()&&ue.close()},ue.onClick=function(Pe){if(ue.fireEvents("onClick",Pe),ue.focusTime){var qe;if(ue.preClickTime&&ue.preTouchTime?qe=Math.min(ue.preClickTime,ue.preTouchTime):ue.preClickTime?qe=ue.preClickTime:ue.preTouchTime&&(qe=ue.preTouchTime),Math.abs(qe-ue.focusTime)<20)return;ue.focusTime=0}ue.preClickTime=0,ue.preTouchTime=0,ue.isClickToShow()&&(ue.isClickToHide()||ue.isBlurToHide())&&Pe&&Pe.preventDefault&&Pe.preventDefault();var Ie=!ue.state.popupVisible;(ue.isClickToHide()&&!Ie||Ie&&ue.isClickToShow())&&ue.setPopupVisible(!ue.state.popupVisible,Pe)},ue.onPopupMouseDown=function(){if(ue.hasPopupMouseDown=!0,clearTimeout(ue.mouseDownTimeout),ue.mouseDownTimeout=window.setTimeout(function(){ue.hasPopupMouseDown=!1},0),ue.context){var Pe;(Pe=ue.context).onPopupMouseDown.apply(Pe,arguments)}},ue.onDocumentClick=function(Pe){if(ue.props.mask&&!ue.props.maskClosable)return;var qe=Pe.target,Ie=ue.getRootDomNode(),ut=ue.getPopupDomNode();(!Object(tn.a)(Ie,qe)||ue.isContextMenuOnly())&&!Object(tn.a)(ut,qe)&&!ue.hasPopupMouseDown&&ue.close()},ue.getRootDomNode=function(){var Pe=ue.props.getTriggerDOMNode;if(Pe)return Pe(ue.triggerRef.current);try{var qe=Object(En.a)(ue.triggerRef.current);if(qe)return qe}catch(Ie){}return en.a.findDOMNode(Object(v.a)(ue))},ue.getPopupClassNameFromAlign=function(Pe){var qe=[],Ie=ue.props,ut=Ie.popupPlacement,Ut=Ie.builtinPlacements,an=Ie.prefixCls,mn=Ie.alignPoint,Hn=Ie.getPopupClassNameFromAlign;return ut&&Ut&&qe.push(st(Ut,an,Pe,mn)),Hn&&qe.push(Hn(Pe)),qe.join(" ")},ue.getComponent=function(){var Pe=ue.props,qe=Pe.prefixCls,Ie=Pe.destroyPopupOnHide,ut=Pe.popupClassName,Ut=Pe.onPopupAlign,an=Pe.popupMotion,mn=Pe.popupAnimation,Hn=Pe.popupTransitionName,Vn=Pe.popupStyle,fr=Pe.mask,dr=Pe.maskAnimation,wr=Pe.maskTransitionName,Ar=Pe.maskMotion,gr=Pe.zIndex,Cr=Pe.popup,Lr=Pe.stretch,gn=Pe.alignPoint,nn=Pe.mobile,xn=Pe.forceRender,zt=ue.state,Vt=zt.popupVisible,pr=zt.point,Mr=ue.getPopupAlign(),ir={};return ue.isMouseEnterToShow()&&(ir.onMouseEnter=ue.onPopupMouseEnter),ue.isMouseLeaveToHide()&&(ir.onMouseLeave=ue.onPopupMouseLeave),ir.onMouseDown=ue.onPopupMouseDown,ir.onTouchStart=ue.onPopupMouseDown,P.createElement(Sr,Object(C.a)({prefixCls:qe,destroyPopupOnHide:Ie,visible:Vt,point:gn&&pr,className:ut,align:Mr,onAlign:Ut,animation:mn,getClassNameFromAlign:ue.getPopupClassNameFromAlign},ir,{stretch:Lr,getRootDomNode:ue.getRootDomNode,style:Vn,mask:fr,zIndex:gr,transitionName:Hn,maskAnimation:dr,maskTransitionName:wr,maskMotion:Ar,ref:ue.popupRef,motion:an,mobile:nn,forceRender:xn}),typeof Cr=="function"?Cr():Cr)},ue.attachParent=function(Pe){tt.a.cancel(ue.attachId);var qe=ue.props,Ie=qe.getPopupContainer,ut=qe.getDocument,Ut=ue.getRootDomNode(),an;Ie?(Ut||Ie.length===0)&&(an=Ie(Ut)):an=ut(ue.getRootDomNode()).body,an?an.appendChild(Pe):ue.attachId=Object(tt.a)(function(){ue.attachParent(Pe)})},ue.getContainer=function(){var Pe=ue.props.getDocument,qe=Pe(ue.getRootDomNode()).createElement("div");return qe.style.position="absolute",qe.style.top="0",qe.style.left="0",qe.style.width="100%",ue.attachParent(qe),qe},ue.setPoint=function(Pe){var qe=ue.props.alignPoint;if(!qe||!Pe)return;ue.setState({point:{pageX:Pe.pageX,pageY:Pe.pageY}})},ue.handlePortalUpdate=function(){ue.state.prevPopupVisible!==ue.state.popupVisible&&ue.props.afterPopupVisibleChange(ue.state.popupVisible)},ue.triggerContextValue={onPopupMouseDown:ue.onPopupMouseDown};var Oe;return"popupVisible"in me?Oe=!!me.popupVisible:Oe=!!me.defaultPopupVisible,ue.state={prevPopupVisible:Oe,popupVisible:Oe},bn.forEach(function(Pe){ue["fire".concat(Pe)]=function(qe){ue.fireEvents(Pe,qe)}}),ue}return Object(S.a)(re,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ue=this.props,Oe=this.state;if(Oe.popupVisible){var Pe;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Pe=ue.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Fe.a)(Pe,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Pe=Pe||ue.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Fe.a)(Pe,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Pe=Pe||ue.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Fe.a)(Pe,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Fe.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 ue;return((ue=this.popupRef.current)===null||ue===void 0?void 0:ue.getElement())||null}},{key:"getPopupAlign",value:function(){var ue=this.props,Oe=ue.popupPlacement,Pe=ue.popupAlign,qe=ue.builtinPlacements;return Oe&&qe?nt(qe,Oe,Pe):Pe}},{key:"setPopupVisible",value:function(ue,Oe){var Pe=this.props.alignPoint,qe=this.state.popupVisible;this.clearDelayTimer(),qe!==ue&&("popupVisible"in this.props||this.setState({popupVisible:ue,prevPopupVisible:qe}),this.props.onPopupVisibleChange(ue)),Pe&&Oe&&ue&&this.setPoint(Oe)}},{key:"delaySetPopupVisible",value:function(ue,Oe,Pe){var qe=this,Ie=Oe*1e3;if(this.clearDelayTimer(),Ie){var ut=Pe?{pageX:Pe.pageX,pageY:Pe.pageY}:null;this.delayTimer=window.setTimeout(function(){qe.setPopupVisible(ue,ut),qe.clearDelayTimer()},Ie)}else this.setPopupVisible(ue,Pe)}},{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(ue){var Oe=this.props.children.props,Pe=this.props;return Oe[ue]&&Pe[ue]?this["fire".concat(ue)]:Oe[ue]||Pe[ue]}},{key:"isClickToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("click")!==-1||Pe.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ue=this.props.action;return ue==="contextMenu"||ue.length===1&&ue[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("contextMenu")!==-1||Pe.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.hideAction;return Oe.indexOf("click")!==-1||Pe.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("hover")!==-1||Pe.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.hideAction;return Oe.indexOf("hover")!==-1||Pe.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("focus")!==-1||Pe.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.hideAction;return Oe.indexOf("focus")!==-1||Pe.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ue;(ue=this.popupRef.current)===null||ue===void 0||ue.forceAlign()}}},{key:"fireEvents",value:function(ue,Oe){var Pe=this.props.children.props[ue];Pe&&Pe(Oe);var qe=this.props[ue];qe&&qe(Oe)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ue=this.state.popupVisible,Oe=this.props,Pe=Oe.children,qe=Oe.forceRender,Ie=Oe.alignPoint,ut=Oe.className,Ut=Oe.autoDestroy,an=P.Children.only(Pe),mn={key:"trigger"};this.isContextMenuToShow()?mn.onContextMenu=this.onContextMenu:mn.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(mn.onClick=this.onClick,mn.onMouseDown=this.onMouseDown,mn.onTouchStart=this.onTouchStart):(mn.onClick=this.createTwoChains("onClick"),mn.onMouseDown=this.createTwoChains("onMouseDown"),mn.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(mn.onMouseEnter=this.onMouseEnter,Ie&&(mn.onMouseMove=this.onMouseMove)):mn.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?mn.onMouseLeave=this.onMouseLeave:mn.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(mn.onFocus=this.onFocus,mn.onBlur=this.onBlur):(mn.onFocus=this.createTwoChains("onFocus"),mn.onBlur=this.createTwoChains("onBlur"));var Hn=K()(an&&an.props&&an.props.className,ut);Hn&&(mn.className=Hn);var Vn=Object(G.a)({},mn);Object(We.c)(an)&&(Vn.ref=Object(We.a)(this.triggerRef,an.ref));var fr=P.cloneElement(an,Vn),dr;return(ue||this.popupRef.current||qe)&&(dr=P.createElement(Ee,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ue&&Ut&&(dr=null),P.createElement(Br.Provider,{value:this.triggerContextValue},fr,dr)}}],[{key:"getDerivedStateFromProps",value:function(ue,Oe){var Pe=ue.popupVisible,qe={};return Pe!==void 0&&Oe.popupVisible!==Pe&&(qe.popupVisible=Pe,qe.prevPopupVisible=Oe.popupVisible),qe}}]),re}(P.Component);return Ue.contextType=Br,Ue.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:_n,getDocument:Sn,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},Ue}var sr=ur(yt.a),Q={adjustX:1,adjustY:1},ce={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},Ce={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},Te=ce,rt=0,Re={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},$e=function(Ue,Ve,Se){var re=gt(Ve),me=Ue.getState();Ue.setState({defaultActiveFirst:Object(G.a)(Object(G.a)({},me.defaultActiveFirst),{},Object(Z.a)({},re,Se))})},it=function(Ee){Object(E.a)(Ve,Ee);var Ue=Object(f.a)(Ve);function Ve(Se){var re;Object(R.a)(this,Ve),re=Ue.call(this,Se),re.onDestroy=function(Ie){re.props.onDestroy(Ie)},re.onKeyDown=function(Ie){var ut=Ie.keyCode,Ut=re.menuInstance,an=re.props.store,mn=re.getVisible();if(ut===o.a.ENTER)return re.onTitleClick(Ie),$e(an,re.props.eventKey,!0),!0;if(ut===o.a.RIGHT)return mn?Ut.onKeyDown(Ie):(re.triggerOpenChange(!0),$e(an,re.props.eventKey,!0)),!0;if(ut===o.a.LEFT){var Hn;if(mn)Hn=Ut.onKeyDown(Ie);else return;return Hn||(re.triggerOpenChange(!1),Hn=!0),Hn}return mn&&(ut===o.a.UP||ut===o.a.DOWN)?Ut.onKeyDown(Ie):void 0},re.onOpenChange=function(Ie){re.props.onOpenChange(Ie)},re.onPopupVisibleChange=function(Ie){re.triggerOpenChange(Ie,Ie?"mouseenter":"mouseleave")},re.onMouseEnter=function(Ie){var ut=re.props,Ut=ut.eventKey,an=ut.onMouseEnter,mn=ut.store;$e(mn,re.props.eventKey,!1),an({key:Ut,domEvent:Ie})},re.onMouseLeave=function(Ie){var ut=re.props,Ut=ut.parentMenu,an=ut.eventKey,mn=ut.onMouseLeave;Ut.subMenuInstance=Object(v.a)(re),mn({key:an,domEvent:Ie})},re.onTitleMouseEnter=function(Ie){var ut=re.props,Ut=ut.eventKey,an=ut.onItemHover,mn=ut.onTitleMouseEnter;an({key:Ut,hover:!0}),mn({key:Ut,domEvent:Ie})},re.onTitleMouseLeave=function(Ie){var ut=re.props,Ut=ut.parentMenu,an=ut.eventKey,mn=ut.onItemHover,Hn=ut.onTitleMouseLeave;Ut.subMenuInstance=Object(v.a)(re),mn({key:an,hover:!1}),Hn({key:an,domEvent:Ie})},re.onTitleClick=function(Ie){var ut=Object(v.a)(re),Ut=ut.props;if(Ut.onTitleClick({key:Ut.eventKey,domEvent:Ie}),Ut.triggerSubMenuAction==="hover")return;re.triggerOpenChange(!re.getVisible(),"click"),$e(Ut.store,re.props.eventKey,!1)},re.onSubMenuClick=function(Ie){typeof re.props.onClick=="function"&&re.props.onClick(re.addKeyPath(Ie))},re.onSelect=function(Ie){re.props.onSelect(Ie)},re.onDeselect=function(Ie){re.props.onDeselect(Ie)},re.getPrefixCls=function(){return"".concat(re.props.rootPrefixCls,"-submenu")},re.getActiveClassName=function(){return"".concat(re.getPrefixCls(),"-active")},re.getDisabledClassName=function(){return"".concat(re.getPrefixCls(),"-disabled")},re.getSelectedClassName=function(){return"".concat(re.getPrefixCls(),"-selected")},re.getOpenClassName=function(){return"".concat(re.props.rootPrefixCls,"-submenu-open")},re.getVisible=function(){return re.state.isOpen},re.getMode=function(){return re.state.mode},re.saveMenuInstance=function(Ie){re.menuInstance=Ie},re.addKeyPath=function(Ie){return Object(G.a)(Object(G.a)({},Ie),{},{keyPath:(Ie.keyPath||[]).concat(re.props.eventKey)})},re.triggerOpenChange=function(Ie,ut){var Ut=re.props.eventKey,an=function(){re.onOpenChange({key:Ut,item:Object(v.a)(re),trigger:ut,open:Ie})};ut==="mouseenter"?re.mouseenterTimeout=setTimeout(function(){an()},0):an()},re.isChildrenSelected=function(){var Ie={find:!1};return jt(re.props.children,re.props.selectedKeys,Ie),Ie.find},re.isInlineMode=function(){return re.getMode()==="inline"},re.adjustWidth=function(){if(!re.subMenuTitle||!re.menuInstance)return;var Ie=Wt.findDOMNode(re.menuInstance);if(Ie.offsetWidth>=re.subMenuTitle.offsetWidth)return;Ie.style.minWidth="".concat(re.subMenuTitle.offsetWidth,"px")},re.saveSubMenuTitle=function(Ie){re.subMenuTitle=Ie},re.getBaseProps=function(){var Ie=Object(v.a)(re),ut=Ie.props,Ut=re.getMode();return{mode:Ut==="horizontal"?"vertical":Ut,visible:re.getVisible(),level:ut.level+1,inlineIndent:ut.inlineIndent,focusable:!1,onClick:re.onSubMenuClick,onSelect:re.onSelect,onDeselect:re.onDeselect,onDestroy:re.onDestroy,selectedKeys:ut.selectedKeys,eventKey:"".concat(ut.eventKey,"-menu-"),openKeys:ut.openKeys,motion:ut.motion,onOpenChange:re.onOpenChange,subMenuOpenDelay:ut.subMenuOpenDelay,parentMenu:Object(v.a)(re),subMenuCloseDelay:ut.subMenuCloseDelay,forceSubMenuRender:ut.forceSubMenuRender,triggerSubMenuAction:ut.triggerSubMenuAction,builtinPlacements:ut.builtinPlacements,defaultActiveFirst:ut.store.getState().defaultActiveFirst[gt(ut.eventKey)],multiple:ut.multiple,prefixCls:ut.rootPrefixCls,id:re.internalMenuId,manualRef:re.saveMenuInstance,itemIcon:ut.itemIcon,expandIcon:ut.expandIcon,direction:ut.direction}},re.getMotion=function(Ie,ut){var Ut=Object(v.a)(re),an=Ut.haveRendered,mn=re.props,Hn=mn.motion,Vn=mn.rootPrefixCls,fr=Object(G.a)(Object(G.a)({},Hn),{},{leavedClassName:"".concat(Vn,"-hidden"),removeOnLeave:!1,motionAppear:an||!ut||Ie!=="inline"});return fr};var me=Se.store,ue=Se.eventKey,Oe=me.getState(),Pe=Oe.defaultActiveFirst;re.isRootMenu=!1;var qe=!1;return Pe&&(qe=Pe[ue]),$e(me,ue,qe),re.state={mode:Se.mode,isOpen:Se.isOpen},re}return Object(S.a)(Ve,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var re=this,me=this.props,ue=me.mode,Oe=me.parentMenu,Pe=me.manualRef,qe=me.isOpen,Ie=function(){re.setState({mode:ue,isOpen:qe})},ut=qe!==this.state.isOpen,Ut=ue!==this.state.mode;if((Ut||ut)&&(tt.a.cancel(this.updateStateRaf),Ut?this.updateStateRaf=Object(tt.a)(Ie):Ie()),Pe&&Pe(this),ue!=="horizontal"||!(Oe==null?void 0:Oe.isRootMenu)||!qe)return;this.minWidthTimeout=setTimeout(function(){return re.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var re=this.props,me=re.onDestroy,ue=re.eventKey;me&&me(ue),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(re,me){var ue=this.getBaseProps();return P.createElement(On,Object(C.a)({},ue,{id:this.internalMenuId,className:re,style:me}),this.props.children)}},{key:"renderChildren",value:function(){var re=this,me=this.getBaseProps(),ue=me.mode,Oe=me.visible,Pe=me.forceSubMenuRender,qe=me.direction,Ie=this.getMotion(ue,Oe);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Oe||Pe,!this.haveOpened)return P.createElement("div",null);var ut=K()("".concat(me.prefixCls,"-sub"),Object(Z.a)({},"".concat(me.prefixCls,"-rtl"),qe==="rtl"));return this.isInlineMode()?P.createElement(ne,Object(C.a)({visible:me.visible,forceRender:Pe},Ie),function(Ut){var an=Ut.className,mn=Ut.style,Hn=K()(ut,an);return re.renderPopupMenu(Hn,mn)}):this.renderPopupMenu(ut)}},{key:"render",value:function(){var re,me,ue,Oe=Object(G.a)({},this.props),Pe=this.getVisible(),qe=this.getPrefixCls(),Ie=this.isInlineMode(),ut=this.getMode(),Ut=K()(qe,"".concat(qe,"-").concat(ut),(re={},Object(Z.a)(re,Oe.className,!!Oe.className),Object(Z.a)(re,this.getOpenClassName(),Pe),Object(Z.a)(re,this.getActiveClassName(),Oe.active||Pe&&!Ie),Object(Z.a)(re,this.getDisabledClassName(),Oe.disabled),Object(Z.a)(re,this.getSelectedClassName(),this.isChildrenSelected()),re));this.internalMenuId||(Oe.eventKey?this.internalMenuId="".concat(Oe.eventKey,"$Menu"):(rt+=1,this.internalMenuId="$__$".concat(rt,"$Menu")));var an={},mn={},Hn={};Oe.disabled||(an={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mn={onClick:this.onTitleClick},Hn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Vn={},fr=Oe.direction,dr=fr==="rtl";Ie&&(dr?Vn.paddingRight=Oe.inlineIndent*Oe.level:Vn.paddingLeft=Oe.inlineIndent*Oe.level);var wr={};this.getVisible()&&(wr={"aria-owns":this.internalMenuId});var Ar=null;ut!=="horizontal"&&(Ar=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Ar=P.createElement(this.props.expandIcon,Object(G.a)({},this.props))));var gr=P.createElement("div",Object(C.a)({ref:this.saveSubMenuTitle,style:Vn,className:"".concat(qe,"-title"),role:"button"},Hn,mn,{"aria-expanded":Pe},wr,{"aria-haspopup":"true",title:typeof Oe.title=="string"?Oe.title:void 0}),Oe.title,Ar||P.createElement("i",{className:"".concat(qe,"-arrow")})),Cr=this.renderChildren(),Lr=((me=Oe.parentMenu)===null||me===void 0?void 0:me.isRootMenu)?Oe.parentMenu.props.getPopupContainer:function(zr){return zr.parentNode},gn=Re[ut],nn=Oe.popupOffset?{offset:Oe.popupOffset}:{},xn=K()((ue={},Object(Z.a)(ue,Oe.popupClassName,Oe.popupClassName&&!Ie),Object(Z.a)(ue,"".concat(qe,"-rtl"),dr),ue)),zt=Oe.disabled,Vt=Oe.triggerSubMenuAction,pr=Oe.subMenuOpenDelay,Mr=Oe.forceSubMenuRender,ir=Oe.subMenuCloseDelay,Ur=Oe.builtinPlacements;oe.forEach(function(zr){return delete Oe[zr]}),delete Oe.onClick;var oi=dr?Object(G.a)(Object(G.a)({},Ce),Ur):Object(G.a)(Object(G.a)({},ce),Ur);delete Oe.direction;var jr=this.getBaseProps(),Xr=Ie?null:this.getMotion(jr.mode,jr.visible);return P.createElement("li",Object(C.a)({},Oe,an,{className:Ut,role:"menuitem"}),P.createElement(sr,{prefixCls:qe,popupClassName:K()("".concat(qe,"-popup"),xn),getPopupContainer:Lr,builtinPlacements:oi,popupPlacement:gn,popupVisible:Ie?!1:Pe,popupAlign:nn,popup:Ie?null:Cr,action:zt||Ie?[]:[Vt],mouseEnterDelay:pr,mouseLeaveDelay:ir,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Mr,popupMotion:Xr},gr),Ie?Cr:null)}}]),Ve}(P.Component);it.defaultProps={onMouseEnter:St,onMouseLeave:St,onTitleMouseEnter:St,onTitleMouseLeave:St,onTitleClick:St,manualRef:St,mode:"vertical",title:""};var Dt=Object(h.b)(function(Ee,Ue){var Ve=Ee.openKeys,Se=Ee.activeKey,re=Ee.selectedKeys,me=Ue.eventKey,ue=Ue.subMenuKey;return{isOpen:Ve.indexOf(me)>-1,active:Se[ue]===me,selectedKeys:re}})(it);Dt.isSubMenu=!0;var Tt=Dt,Be="menuitem-overflowed",_t=.5,ot=function(Ee){Object(E.a)(Ve,Ee);var Ue=Object(f.a)(Ve);function Ve(){var Se;return Object(R.a)(this,Ve),Se=Ue.apply(this,arguments),Se.resizeObserver=null,Se.mutationObserver=null,Se.originalTotalWidth=0,Se.overflowedItems=[],Se.menuItemSizes=[],Se.cancelFrameId=null,Se.state={lastVisibleIndex:void 0},Se.childRef=P.createRef(),Se.getMenuItemNodes=function(){var re=Se.props.prefixCls,me=Se.childRef.current;return me?[].slice.call(me.children).filter(function(ue){return ue.className.split(" ").indexOf("".concat(re,"-overflowed-submenu"))<0}):[]},Se.getOverflowedSubMenuItem=function(re,me,ue){var Oe=Se.props,Pe=Oe.overflowedIndicator,qe=Oe.level,Ie=Oe.mode,ut=Oe.prefixCls,Ut=Oe.theme;if(qe!==1||Ie!=="horizontal")return null;var an=Se.props.children[0],mn=an.props,Hn=mn.children,Vn=mn.title,fr=mn.style,dr=Object(U.a)(mn,["children","title","style"]),wr=Object(G.a)({},fr),Ar="".concat(re,"-overflowed-indicator"),gr="".concat(re,"-overflowed-indicator");me.length===0&&ue!==!0?wr=Object(G.a)(Object(G.a)({},wr),{},{display:"none"}):ue&&(wr=Object(G.a)(Object(G.a)({},wr),{},{visibility:"hidden",position:"absolute"}),Ar="".concat(Ar,"-placeholder"),gr="".concat(gr,"-placeholder"));var Cr=Ut?"".concat(ut,"-").concat(Ut):"",Lr={};return oe.forEach(function(gn){dr[gn]!==void 0&&(Lr[gn]=dr[gn])}),P.createElement(Tt,Object(C.a)({title:Pe,className:"".concat(ut,"-overflowed-submenu"),popupClassName:Cr},Lr,{key:Ar,eventKey:gr,disabled:!1,style:wr}),me)},Se.setChildrenWidthAndResize=function(){if(Se.props.mode!=="horizontal")return;var re=Se.childRef.current;if(!re)return;var me=re.children;if(!me||me.length===0)return;var ue=re.children[me.length-1];Ge(ue,"display","inline-block");var Oe=Se.getMenuItemNodes(),Pe=Oe.filter(function(qe){return qe.className.split(" ").indexOf(Be)>=0});Pe.forEach(function(qe){Ge(qe,"display","inline-block")}),Se.menuItemSizes=Oe.map(function(qe){return Ne(qe,!0)}),Pe.forEach(function(qe){Ge(qe,"display","none")}),Se.overflowedIndicatorWidth=Ne(re.children[re.children.length-1],!0),Se.originalTotalWidth=Se.menuItemSizes.reduce(function(qe,Ie){return qe+Ie},0),Se.handleResize(),Ge(ue,"display","none")},Se.handleResize=function(){if(Se.props.mode!=="horizontal")return;var re=Se.childRef.current;if(!re)return;var me=Ne(re);Se.overflowedItems=[];var ue=0,Oe;Se.originalTotalWidth>me+_t&&(Oe=-1,Se.menuItemSizes.forEach(function(Pe){ue+=Pe,ue+Se.overflowedIndicatorWidth<=me&&(Oe+=1)})),Se.setState({lastVisibleIndex:Oe})},Se}return Object(S.a)(Ve,[{key:"componentDidMount",value:function(){var re=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var me=this.childRef.current;if(!me)return;this.resizeObserver=new Bt.default(function(ue){ue.forEach(function(){var Oe=re.cancelFrameId;cancelAnimationFrame(Oe),re.cancelFrameId=requestAnimationFrame(re.setChildrenWidthAndResize)})}),[].slice.call(me.children).concat(me).forEach(function(ue){re.resizeObserver.observe(ue)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){re.resizeObserver.disconnect(),[].slice.call(me.children).concat(me).forEach(function(ue){re.resizeObserver.observe(ue)}),re.setChildrenWidthAndResize()}),this.mutationObserver.observe(me,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(re){var me=this,ue=this.state.lastVisibleIndex;return(re||[]).reduce(function(Oe,Pe,qe){var Ie=Pe;if(me.props.mode==="horizontal"){var ut=me.getOverflowedSubMenuItem(Pe.props.eventKey,[]);ue!==void 0&&me.props.className.indexOf("".concat(me.props.prefixCls,"-root"))!==-1&&(qe>ue&&(Ie=P.cloneElement(Pe,{style:{display:"none"},eventKey:"".concat(Pe.props.eventKey,"-hidden"),className:"".concat(Be)})),qe===ue+1&&(me.overflowedItems=re.slice(ue+1).map(function(an){return P.cloneElement(an,{key:an.props.eventKey,mode:"vertical-left"})}),ut=me.getOverflowedSubMenuItem(Pe.props.eventKey,me.overflowedItems)));var Ut=[].concat(Object(M.a)(Oe),[ut,Ie]);return qe===re.length-1&&Ut.push(me.getOverflowedSubMenuItem(Pe.props.eventKey,[],!0)),Ut}return[].concat(Object(M.a)(Oe),[Ie])},[])}},{key:"render",value:function(){var re=this.props,me=re.visible,ue=re.prefixCls,Oe=re.overflowedIndicator,Pe=re.mode,qe=re.level,Ie=re.tag,ut=re.children,Ut=re.theme,an=Object(U.a)(re,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),mn=Ie;return P.createElement(mn,Object(C.a)({ref:this.childRef},an),this.renderChildren(ut))}}]),Ve}(P.Component);ot.defaultProps={tag:"div",className:""};var ht=ot;function wt(Ee){return Ee.length?Ee.every(function(Ue){return!!Ue.props.disabled}):!0}function It(Ee,Ue,Ve){var Se=Ee.getState();Ee.setState({activeKey:Object(G.a)(Object(G.a)({},Se.activeKey),{},Object(Z.a)({},Ue,Ve))})}function vt(Ee){return Ee.eventKey||"0-menu-"}function Xt(Ee,Ue){var Ve=Ue,Se=Ee.children,re=Ee.eventKey;if(Ve){var me;if(ct(Se,function(ue,Oe){ue&&ue.props&&!ue.props.disabled&&Ve===ze(ue,re,Oe)&&(me=!0)}),me)return Ve}return Ve=null,Ee.defaultActiveFirst&&ct(Se,function(ue,Oe){!Ve&&ue&&!ue.props.disabled&&(Ve=ze(ue,re,Oe))}),Ve}function dn(Ee){if(!Ee)return;var Ue=this.instanceArray.indexOf(Ee);Ue!==-1?this.instanceArray[Ue]=Ee:this.instanceArray.push(Ee)}var Pn=function(Ee){Object(E.a)(Ve,Ee);var Ue=Object(f.a)(Ve);function Ve(Se){var re;return Object(R.a)(this,Ve),re=Ue.call(this,Se),re.onKeyDown=function(me,ue){var Oe=me.keyCode,Pe;if(re.getFlatInstanceArray().forEach(function(Ie){Ie&&Ie.props.active&&Ie.onKeyDown&&(Pe=Ie.onKeyDown(me))}),Pe)return 1;var qe=null;return(Oe===o.a.UP||Oe===o.a.DOWN)&&(qe=re.step(Oe===o.a.UP?-1:1)),qe?(me.preventDefault(),It(re.props.store,vt(re.props),qe.props.eventKey),typeof ue=="function"&&ue(qe),1):void 0},re.onItemHover=function(me){var ue=me.key,Oe=me.hover;It(re.props.store,vt(re.props),Oe?ue:null)},re.onDeselect=function(me){re.props.onDeselect(me)},re.onSelect=function(me){re.props.onSelect(me)},re.onClick=function(me){re.props.onClick(me)},re.onOpenChange=function(me){re.props.onOpenChange(me)},re.onDestroy=function(me){re.props.onDestroy(me)},re.getFlatInstanceArray=function(){return re.instanceArray},re.step=function(me){var ue=re.getFlatInstanceArray(),Oe=re.props.store.getState().activeKey[vt(re.props)],Pe=ue.length;if(!Pe)return null;me<0&&(ue=ue.concat().reverse());var qe=-1;if(ue.every(function(an,mn){return an&&an.props.eventKey===Oe?(qe=mn,!1):!0}),!re.props.defaultActiveFirst&&qe!==-1&&wt(ue.slice(qe,Pe-1)))return;var Ie=(qe+1)%Pe,ut=Ie;do{var Ut=ue[ut];if(!Ut||Ut.props.disabled)ut=(ut+1)%Pe;else return Ut}while(ut!==Ie);return null},re.renderCommonMenuItem=function(me,ue,Oe){var Pe=re.props.store.getState(),qe=Object(v.a)(re),Ie=qe.props,ut=ze(me,Ie.eventKey,ue),Ut=me.props;if(!Ut||typeof me.type=="string")return me;var an=ut===Pe.activeKey,mn=Object(G.a)(Object(G.a)({mode:Ut.mode||Ie.mode,level:Ie.level,inlineIndent:Ie.inlineIndent,renderMenuItem:re.renderMenuItem,rootPrefixCls:Ie.prefixCls,index:ue,parentMenu:Ie.parentMenu,manualRef:Ut.disabled?void 0:Object(g.a)(me.ref,dn.bind(Object(v.a)(re))),eventKey:ut,active:!Ut.disabled&&an,multiple:Ie.multiple,onClick:function(Vn){(Ut.onClick||St)(Vn),re.onClick(Vn)},onItemHover:re.onItemHover,motion:Ie.motion,subMenuOpenDelay:Ie.subMenuOpenDelay,subMenuCloseDelay:Ie.subMenuCloseDelay,forceSubMenuRender:Ie.forceSubMenuRender,onOpenChange:re.onOpenChange,onDeselect:re.onDeselect,onSelect:re.onSelect,builtinPlacements:Ie.builtinPlacements,itemIcon:Ut.itemIcon||re.props.itemIcon,expandIcon:Ut.expandIcon||re.props.expandIcon},Oe),{},{direction:Ie.direction});return(Ie.mode==="inline"||Xe())&&(mn.triggerSubMenuAction="click"),P.cloneElement(me,Object(G.a)(Object(G.a)({},mn),{},{key:ut||ue}))},re.renderMenuItem=function(me,ue,Oe){if(!me)return null;var Pe=re.props.store.getState(),qe={openKeys:Pe.openKeys,selectedKeys:Pe.selectedKeys,triggerSubMenuAction:re.props.triggerSubMenuAction,subMenuKey:Oe};return re.renderCommonMenuItem(me,ue,qe)},Se.store.setState({activeKey:Object(G.a)(Object(G.a)({},Se.store.getState().activeKey),{},Object(Z.a)({},Se.eventKey,Xt(Se,Se.activeKey)))}),re.instanceArray=[],re}return Object(S.a)(Ve,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(re){return this.props.visible||re.visible||this.props.className!==re.className||!j()(this.props.style,re.style)}},{key:"componentDidUpdate",value:function(re){var me=this.props,ue="activeKey"in me?me.activeKey:me.store.getState().activeKey[vt(me)],Oe=Xt(me,ue);if(Oe!==ue)It(me.store,vt(me),Oe);else if("activeKey"in re){var Pe=Xt(re,re.activeKey);Oe!==Pe&&It(me.store,vt(me),Oe)}}},{key:"render",value:function(){var re=this,me=Object(C.a)({},this.props);this.instanceArray=[];var ue=K()(me.prefixCls,me.className,"".concat(me.prefixCls,"-").concat(me.mode)),Oe={className:ue,role:me.role||"menu"};me.id&&(Oe.id=me.id),me.focusable&&(Oe.tabIndex=0,Oe.onKeyDown=this.onKeyDown);var Pe=me.prefixCls,qe=me.eventKey,Ie=me.visible,ut=me.level,Ut=me.mode,an=me.overflowedIndicator,mn=me.theme;return oe.forEach(function(Hn){return delete me[Hn]}),delete me.onClick,P.createElement(ht,Object(C.a)({},me,{prefixCls:Pe,mode:Ut,tag:"ul",level:ut,theme:mn,visible:Ie,overflowedIndicator:an},Oe),Object(I.a)(me.children).map(function(Hn,Vn){return re.renderMenuItem(Hn,Vn,qe||"0-menu-")}))}}]),Ve}(P.Component);Pn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:St};var Gn=Object(h.b)()(Pn),On=Gn,Nn=D("Kwbf");function Mn(Ee,Ue,Ve){var Se=Ee.prefixCls,re=Ee.motion,me=Ee.defaultMotions,ue=me===void 0?{}:me,Oe=Ee.openAnimation,Pe=Ee.openTransitionName,qe=Ue.switchingModeFromInline;if(re)return re;if(Object(B.a)(Oe)==="object"&&Oe)Object(Nn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Oe=="string")return{motionName:"".concat(Se,"-open-").concat(Oe)};if(Pe)return{motionName:Pe};var Ie=ue[Ve];return Ie||(qe?null:ue.other)}var Pt=function(Ee){Object(E.a)(Ve,Ee);var Ue=Object(f.a)(Ve);function Ve(Se){var re;Object(R.a)(this,Ve),re=Ue.call(this,Se),re.onSelect=function(Oe){var Pe=Object(v.a)(re),qe=Pe.props;if(qe.selectable){var Ie=re.store.getState(),ut=Ie.selectedKeys,Ut=Oe.key;qe.multiple?ut=ut.concat([Ut]):ut=[Ut],"selectedKeys"in qe||re.store.setState({selectedKeys:ut}),qe.onSelect(Object(G.a)(Object(G.a)({},Oe),{},{selectedKeys:ut}))}},re.onClick=function(Oe){var Pe=re.getRealMenuMode(),qe=Object(v.a)(re),Ie=qe.store,ut=qe.props.onOpenChange;Pe!=="inline"&&!("openKeys"in re.props)&&(Ie.setState({openKeys:[]}),ut([])),re.props.onClick(Oe)},re.onKeyDown=function(Oe,Pe){re.innerMenu.getWrappedInstance().onKeyDown(Oe,Pe)},re.onOpenChange=function(Oe){var Pe=Object(v.a)(re),qe=Pe.props,Ie=re.store.getState().openKeys.concat(),ut=!1,Ut=function(mn){var Hn=!1;if(mn.open)Hn=Ie.indexOf(mn.key)===-1,Hn&&Ie.push(mn.key);else{var Vn=Ie.indexOf(mn.key);Hn=Vn!==-1,Hn&&Ie.splice(Vn,1)}ut=ut||Hn};Array.isArray(Oe)?Oe.forEach(Ut):Ut(Oe),ut&&("openKeys"in re.props||re.store.setState({openKeys:Ie}),qe.onOpenChange(Ie))},re.onDeselect=function(Oe){var Pe=Object(v.a)(re),qe=Pe.props;if(qe.selectable){var Ie=re.store.getState().selectedKeys.concat(),ut=Oe.key,Ut=Ie.indexOf(ut);Ut!==-1&&Ie.splice(Ut,1),"selectedKeys"in qe||re.store.setState({selectedKeys:Ie}),qe.onDeselect(Object(G.a)(Object(G.a)({},Oe),{},{selectedKeys:Ie}))}},re.onMouseEnter=function(Oe){re.restoreModeVerticalFromInline();var Pe=re.props.onMouseEnter;Pe&&Pe(Oe)},re.onTransitionEnd=function(Oe){var Pe=Oe.propertyName==="width"&&Oe.target===Oe.currentTarget,qe=Oe.target.className,Ie=Object.prototype.toString.call(qe)==="[object SVGAnimatedString]"?qe.animVal:qe,ut=Oe.propertyName==="font-size"&&Ie.indexOf("anticon")>=0;(Pe||ut)&&re.restoreModeVerticalFromInline()},re.setInnerMenu=function(Oe){re.innerMenu=Oe},re.isRootMenu=!0;var me=Se.defaultSelectedKeys,ue=Se.defaultOpenKeys;return"selectedKeys"in Se&&(me=Se.selectedKeys||[]),"openKeys"in Se&&(ue=Se.openKeys||[]),re.store=Object(h.c)({selectedKeys:me,openKeys:ue,activeKey:{"0-menu-":Xt(Se,Se.activeKey)}}),re.state={switchingModeFromInline:!1,prevProps:Se,inlineOpenKeys:[],store:re.store},re}return Object(S.a)(Ve,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(re){var me=this.props,ue=me.siderCollapsed,Oe=me.inlineCollapsed,Pe=me.onOpenChange;(!re.inlineCollapsed&&Oe||!re.siderCollapsed&&ue)&&Pe([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var re=this.props.collapsedWidth,me=this.store,ue=this.prevOpenKeys,Oe=this.getInlineCollapsed()&&(re===0||re==="0"||re==="0px");Oe?(this.prevOpenKeys=me.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ue&&(this.store.setState({openKeys:ue}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var re=this.props.mode,me=this.state.switchingModeFromInline,ue=this.getInlineCollapsed();return me&&ue?"inline":ue?"vertical":re}},{key:"getInlineCollapsed",value:function(){var re=this.props,me=re.inlineCollapsed,ue=re.siderCollapsed;return ue!==void 0?ue:me}},{key:"restoreModeVerticalFromInline",value:function(){var re=this.state.switchingModeFromInline;re&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var re=Object(G.a)({},Object(y.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),me=this.getRealMenuMode();return re.className+=" ".concat(re.prefixCls,"-root"),re.direction==="rtl"&&(re.className+=" ".concat(re.prefixCls,"-rtl")),re=Object(G.a)(Object(G.a)({},re),{},{mode:me,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Mn(this.props,this.state,me)}),delete re.openAnimation,delete re.openTransitionName,P.createElement(h.a,{store:this.store},P.createElement(On,Object(C.a)({},re,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(re,me){var ue=me.prevProps,Oe=me.store,Pe=Oe.getState(),qe={},Ie={prevProps:re};return ue.mode==="inline"&&re.mode!=="inline"&&(Ie.switchingModeFromInline=!0),"openKeys"in re?qe.openKeys=re.openKeys||[]:((re.inlineCollapsed&&!ue.inlineCollapsed||re.siderCollapsed&&!ue.siderCollapsed)&&(Ie.switchingModeFromInline=!0,Ie.inlineOpenKeys=Pe.openKeys,qe.openKeys=[]),(!re.inlineCollapsed&&ue.inlineCollapsed||!re.siderCollapsed&&ue.siderCollapsed)&&(qe.openKeys=me.inlineOpenKeys,Ie.inlineOpenKeys=[])),Object.keys(qe).length&&Oe.setState(qe),Ie}}]),Ve}(P.Component);Pt.defaultProps={selectable:!0,onClick:St,onSelect:St,onOpenChange:St,onDeselect:St,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:P.createElement("span",null,"\xB7\xB7\xB7")};var hn=Pt,Kt=function(Ee){Object(E.a)(Ve,Ee);var Ue=Object(f.a)(Ve);function Ve(){var Se;return Object(R.a)(this,Ve),Se=Ue.apply(this,arguments),Se.onKeyDown=function(re){var me=re.keyCode;return me===o.a.ENTER?(Se.onClick(re),!0):void 0},Se.onMouseLeave=function(re){var me=Se.props,ue=me.eventKey,Oe=me.onItemHover,Pe=me.onMouseLeave;Oe({key:ue,hover:!1}),Pe({key:ue,domEvent:re})},Se.onMouseEnter=function(re){var me=Se.props,ue=me.eventKey,Oe=me.onItemHover,Pe=me.onMouseEnter;Oe({key:ue,hover:!0}),Pe({key:ue,domEvent:re})},Se.onClick=function(re){var me=Se.props,ue=me.eventKey,Oe=me.multiple,Pe=me.onClick,qe=me.onSelect,Ie=me.onDeselect,ut=me.isSelected,Ut={key:ue,keyPath:[ue],item:Object(v.a)(Se),domEvent:re};Pe(Ut),Oe?ut?Ie(Ut):qe(Ut):ut||qe(Ut)},Se.saveNode=function(re){Se.node=re},Se}return Object(S.a)(Ve,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var re=this.props;re.onDestroy&&re.onDestroy(re.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var re,me=Object(G.a)({},this.props),ue=K()(this.getPrefixCls(),me.className,(re={},Object(Z.a)(re,this.getActiveClassName(),!me.disabled&&me.active),Object(Z.a)(re,this.getSelectedClassName(),me.isSelected),Object(Z.a)(re,this.getDisabledClassName(),me.disabled),re)),Oe=Object(G.a)(Object(G.a)({},me.attribute),{},{title:typeof me.title=="string"?me.title:void 0,className:ue,role:me.role||"menuitem","aria-disabled":me.disabled});me.role==="option"?Oe=Object(G.a)(Object(G.a)({},Oe),{},{role:"option","aria-selected":me.isSelected}):(me.role===null||me.role==="none")&&(Oe.role="none");var Pe={onClick:me.disabled?null:this.onClick,onMouseLeave:me.disabled?null:this.onMouseLeave,onMouseEnter:me.disabled?null:this.onMouseEnter},qe=Object(G.a)({},me.style);me.mode==="inline"&&(me.direction==="rtl"?qe.paddingRight=me.inlineIndent*me.level:qe.paddingLeft=me.inlineIndent*me.level),oe.forEach(function(ut){return delete me[ut]}),delete me.direction;var Ie=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ie=P.createElement(this.props.itemIcon,this.props)),P.createElement("li",Object(C.a)({},Object(y.a)(me,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Oe,Pe,{style:qe,ref:this.saveNode}),me.children,Ie)}}]),Ve}(P.Component);Kt.isMenuItem=!0,Kt.defaultProps={onSelect:St,onMouseEnter:St,onMouseLeave:St,manualRef:St};var Rt=Object(h.b)(function(Ee,Ue){var Ve=Ee.activeKey,Se=Ee.selectedKeys,re=Ue.eventKey,me=Ue.subMenuKey;return{active:Ve[me]===re,isSelected:Array.isArray(Se)?Se.indexOf(re)!==-1:Se===re}})(Kt),Un=Rt,Rn=function(Ee){Object(E.a)(Ve,Ee);var Ue=Object(f.a)(Ve);function Ve(){var Se;return Object(R.a)(this,Ve),Se=Ue.apply(this,arguments),Se.renderInnerMenuItem=function(re){var me=Se.props,ue=me.renderMenuItem,Oe=me.index;return ue(re,Oe,Se.props.subMenuKey)},Se}return Object(S.a)(Ve,[{key:"render",value:function(){var re=Object(C.a)({},this.props),me=re.className,ue=me===void 0?"":me,Oe=re.rootPrefixCls,Pe="".concat(Oe,"-item-group-title"),qe="".concat(Oe,"-item-group-list"),Ie=re.title,ut=re.children;return oe.forEach(function(Ut){return delete re[Ut]}),delete re.direction,P.createElement("li",Object(C.a)({},re,{onClick:function(an){return an.stopPropagation()},className:"".concat(ue," ").concat(Oe,"-item-group")}),P.createElement("div",{className:Pe,title:typeof Ie=="string"?Ie:void 0},Ie),P.createElement("ul",{className:qe},P.Children.map(ut,this.renderInnerMenuItem)))}}]),Ve}(P.Component);Rn.isMenuItemGroup=!0,Rn.defaultProps={disabled:!0};var Yt=Rn,ft=function(Ue){var Ve=Ue.className,Se=Ue.rootPrefixCls,re=Ue.style;return P.createElement("li",{className:"".concat(Ve," ").concat(Se,"-item-divider"),style:re})};ft.defaultProps={disabled:!0,className:"",style:{}};var jn=ft,fn=hn,Qn=D("eDIo");function qt(Ee,Ue){var Ve=Ee.prefixCls,Se=Ee.editable,re=Ee.locale,me=Ee.style;return!Se||Se.showAdd===!1?null:P.createElement("button",{ref:Ue,type:"button",className:"".concat(Ve,"-nav-add"),style:me,"aria-label":(re==null?void 0:re.addAriaLabel)||"Add tab",onClick:function(Oe){Se.onEdit("add",{event:Oe})}},Se.addIcon||"+")}var An=P.forwardRef(qt);function Fn(Ee,Ue){var Ve=Ee.prefixCls,Se=Ee.id,re=Ee.tabs,me=Ee.locale,ue=Ee.mobile,Oe=Ee.moreIcon,Pe=Oe===void 0?"More":Oe,qe=Ee.moreTransitionName,Ie=Ee.style,ut=Ee.className,Ut=Ee.editable,an=Ee.tabBarGutter,mn=Ee.rtl,Hn=Ee.onTabClick,Vn=Object(P.useState)(!1),fr=Object(V.a)(Vn,2),dr=fr[0],wr=fr[1],Ar=Object(P.useState)(null),gr=Object(V.a)(Ar,2),Cr=gr[0],Lr=gr[1],gn="".concat(Se,"-more-popup"),nn="".concat(Ve,"-dropdown"),xn=Cr!==null?"".concat(gn,"-").concat(Cr):null,zt=me==null?void 0:me.dropdownAriaLabel,Vt=P.createElement(fn,{onClick:function(Xr){var zr=Xr.key,Wr=Xr.domEvent;Hn(zr,Wr),wr(!1)},id:gn,tabIndex:-1,role:"listbox","aria-activedescendant":xn,selectedKeys:[Cr],"aria-label":zt!==void 0?zt:"expanded dropdown"},re.map(function(jr){return P.createElement(Un,{key:jr.key,id:"".concat(gn,"-").concat(jr.key),role:"option","aria-controls":Se&&"".concat(Se,"-panel-").concat(jr.key),disabled:jr.disabled},jr.tab)}));function pr(jr){for(var Xr=re.filter(function(yi){return!yi.disabled}),zr=Xr.findIndex(function(yi){return yi.key===Cr})||0,Wr=Xr.length,Hr=0;Hr<Wr;Hr+=1){zr=(zr+jr+Wr)%Wr;var vr=Xr[zr];if(!vr.disabled){Lr(vr.key);return}}}function Mr(jr){var Xr=jr.which;if(!dr){[o.a.DOWN,o.a.SPACE,o.a.ENTER].includes(Xr)&&(wr(!0),jr.preventDefault());return}switch(Xr){case o.a.UP:pr(-1),jr.preventDefault();break;case o.a.DOWN:pr(1),jr.preventDefault();break;case o.a.ESC:wr(!1);break;case o.a.SPACE:case o.a.ENTER:Cr!==null&&Hn(Cr,jr);break}}Object(P.useEffect)(function(){var jr=document.getElementById(xn);jr&&jr.scrollIntoView&&jr.scrollIntoView(!1)},[Cr]),Object(P.useEffect)(function(){dr||Lr(null)},[dr]);var ir=Object(Z.a)({},mn?"marginLeft":"marginRight",an);re.length||(ir.visibility="hidden",ir.order=1);var Ur=K()(Object(Z.a)({},"".concat(nn,"-rtl"),mn)),oi=ue?null:P.createElement(Qn.a,{prefixCls:nn,overlay:Vt,trigger:["hover"],visible:dr,transitionName:qe,onVisibleChange:wr,overlayClassName:Ur,mouseEnterDelay:.1,mouseLeaveDelay:.1},P.createElement("button",{type:"button",className:"".concat(Ve,"-nav-more"),style:ir,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":gn,id:"".concat(Se,"-more"),"aria-expanded":dr,onKeyDown:Mr},Pe));return P.createElement("div",{className:K()("".concat(Ve,"-nav-operations"),ut),style:Ie,ref:Ue},oi,P.createElement(An,{prefixCls:Ve,locale:me,editable:Ut}))}var vn=P.forwardRef(Fn),yr=Object(P.createContext)(null),Ln=.1,wn=.01,Lt=20,Ze=Math.pow(.995,Lt);function Nt(){var Ee=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ee)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ee.substr(0,4)))}function Mt(Ee,Ue){var Ve=Object(P.useState)(),Se=Object(V.a)(Ve,2),re=Se[0],me=Se[1],ue=Object(P.useState)(0),Oe=Object(V.a)(ue,2),Pe=Oe[0],qe=Oe[1],Ie=Object(P.useState)(0),ut=Object(V.a)(Ie,2),Ut=ut[0],an=ut[1],mn=Object(P.useState)(),Hn=Object(V.a)(mn,2),Vn=Hn[0],fr=Hn[1],dr=Object(P.useRef)();function wr(zt){var Vt=zt.touches[0],pr=Vt.screenX,Mr=Vt.screenY;me({x:pr,y:Mr}),window.clearInterval(dr.current)}function Ar(zt){if(!re)return;zt.preventDefault();var Vt=zt.touches[0],pr=Vt.screenX,Mr=Vt.screenY;me({x:pr,y:Mr});var ir=pr-re.x,Ur=Mr-re.y;Ue(ir,Ur);var oi=Date.now();qe(oi),an(oi-Pe),fr({x:ir,y:Ur})}function gr(){if(!re)return;if(me(null),fr(null),Vn){var zt=Vn.x/Ut,Vt=Vn.y/Ut,pr=Math.abs(zt),Mr=Math.abs(Vt);if(Math.max(pr,Mr)<Ln)return;var ir=zt,Ur=Vt;dr.current=window.setInterval(function(){if(Math.abs(ir)<wn&&Math.abs(Ur)<wn){window.clearInterval(dr.current);return}ir*=Ze,Ur*=Ze,Ue(ir*Lt,Ur*Lt)},Lt)}}var Cr=Object(P.useRef)(0),Lr=Object(P.useRef)(!1),gn=Object(P.useRef)();function nn(zt){var Vt=zt.deltaX,pr=zt.deltaY,Mr=0,ir=Math.abs(Vt),Ur=Math.abs(pr);ir===Ur?Mr=gn.current==="x"?Vt:pr:ir>Ur?(Mr=Vt,gn.current="x"):(Mr=pr,gn.current="y");var oi=Date.now();oi-Cr.current>100&&(Lr.current=!1),(Ue(-Mr,-Mr)||Lr.current)&&(zt.preventDefault(),Lr.current=!0),Cr.current=oi}var xn=Object(P.useRef)(null);xn.current={onTouchStart:wr,onTouchMove:Ar,onTouchEnd:gr,onWheel:nn},P.useEffect(function(){function zt(ir){xn.current.onTouchStart(ir)}function Vt(ir){xn.current.onTouchMove(ir)}function pr(ir){xn.current.onTouchEnd(ir)}function Mr(ir){xn.current.onWheel(ir)}return document.addEventListener("touchmove",Vt,{passive:!1}),document.addEventListener("touchend",pr,{passive:!1}),Ee.current.addEventListener("touchstart",zt,{passive:!1}),Ee.current.addEventListener("wheel",Mr),function(){document.removeEventListener("touchmove",Vt),document.removeEventListener("touchend",pr)}},[])}function cn(){var Ee=Object(P.useRef)(new Map);function Ue(Se){return Ee.current.has(Se)||Ee.current.set(Se,P.createRef()),Ee.current.get(Se)}function Ve(Se){Ee.current.delete(Se)}return[Ue,Ve]}function zn(Ee,Ue){var Ve=P.useRef(Ee),Se=P.useState({}),re=Object(V.a)(Se,2),me=re[1];function ue(Oe){var Pe=typeof Oe=="function"?Oe(Ve.current):Oe;Pe!==Ve.current&&Ue(Pe,Ve.current),Ve.current=Pe,me({})}return[Ve.current,ue]}var kn=function(Ue){var Ve=Ue.position,Se=Ue.prefixCls,re=Ue.extra;if(!re)return null;var me,ue=re;return Ve==="right"&&(me=ue.right||!ue.left&&ue||null),Ve==="left"&&(me=ue.left||null),me?P.createElement("div",{className:"".concat(Se,"-extra-content")},me):null};function lr(Ee,Ue){var Ve,Se=P.useContext(yr),re=Se.prefixCls,me=Se.tabs,ue=Ee.className,Oe=Ee.style,Pe=Ee.id,qe=Ee.animated,Ie=Ee.activeKey,ut=Ee.rtl,Ut=Ee.extra,an=Ee.editable,mn=Ee.locale,Hn=Ee.tabPosition,Vn=Ee.tabBarGutter,fr=Ee.children,dr=Ee.onTabClick,wr=Ee.onTabScroll,Ar=Object(P.useRef)(),gr=Object(P.useRef)(),Cr=Object(P.useRef)(),Lr=Object(P.useRef)(),gn=cn(),nn=Object(V.a)(gn,2),xn=nn[0],zt=nn[1],Vt=Hn==="top"||Hn==="bottom",pr=zn(0,function($r,Nr){Vt&&wr&&wr({direction:$r>Nr?"left":"right"})}),Mr=Object(V.a)(pr,2),ir=Mr[0],Ur=Mr[1],oi=zn(0,function($r,Nr){!Vt&&wr&&wr({direction:$r>Nr?"top":"bottom"})}),jr=Object(V.a)(oi,2),Xr=jr[0],zr=jr[1],Wr=Object(P.useState)(0),Hr=Object(V.a)(Wr,2),vr=Hr[0],yi=Hr[1],Qi=Object(P.useState)(0),ji=Object(V.a)(Qi,2),Ri=ji[0],ui=ji[1],qr=Object(P.useState)(0),ii=Object(V.a)(qr,2),ci=ii[0],Fi=ii[1],ha=Object(P.useState)(0),sa=Object(V.a)(ha,2),ei=sa[0],Zi=sa[1],qi=Object(P.useState)(null),si=Object(V.a)(qi,2),Qr=si[0],Ti=si[1],Ma=Object(P.useState)(null),no=Object(V.a)(Ma,2),la=no[0],Ca=no[1],Ta=Object(P.useState)(0),Sa=Object(V.a)(Ta,2),ka=Sa[0],co=Sa[1],Ro=Object(P.useState)(0),za=Object(V.a)(Ro,2),Oa=za[0],Va=za[1],_a=a(new Map),Ra=Object(V.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=n(me,ho,vr),Da="".concat(re,"-nav-operations-hidden"),ya=0,Ni=0;Vt?ut?(ya=0,Ni=Math.max(0,vr-Qr)):(ya=Math.min(0,Qr-vr),Ni=0):(ya=Math.min(0,la-Ri),Ni=0);function fa($r){return $r<ya?[ya,!1]:$r>Ni?[Ni,!1]:[$r,!0]}var pa=Object(P.useRef)(),ba=Object(P.useState)(),ma=Object(V.a)(ba,2),Xa=ma[0],$a=ma[1];function Ja(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}Mt(Ar,function($r,Nr){var gi=!1;function Bi(La,ca){La(function(ja){var da=fa(ja+ca),Si=Object(V.a)(da,2),Fa=Si[0],Ba=Si[1];return gi=Ba,Fa})}if(Vt){if(Qr>=vr)return gi;Bi(Ur,$r)}else{if(la>=Ri)return gi;Bi(zr,Nr)}return Ia(),Ja(),gi}),Object(P.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ua(){var $r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ie,Nr=Aa.get($r);if(!Nr)return;if(Vt){var gi=ir;ut?Nr.right<ir?gi=Nr.right:Nr.right+Nr.width>ir+Qr&&(gi=Nr.right+Nr.width-Qr):Nr.left<-ir?gi=-Nr.left:Nr.left+Nr.width>-ir+Qr&&(gi=-(Nr.left+Nr.width-Qr)),zr(0),Ur(fa(gi)[0])}else{var Bi=Xr;Nr.top<-Xr?Bi=-Nr.top:Nr.top+Nr.height>-Xr+la&&(Bi=-(Nr.top+Nr.height-la)),Ur(0),zr(fa(Bi)[0])}}var Ea=T(Aa,{width:Qr,height:la,left:ir,top:Xr},{width:ci,height:ei},{width:ka,height:Oa},Object(G.a)(Object(G.a)({},Ee),{},{tabs:me})),ro=Object(V.a)(Ea,2),Ao=ro[0],Do=ro[1],fo=me.map(function($r){var Nr=$r.key;return P.createElement(s,{id:Pe,prefixCls:re,key:Nr,rtl:ut,tab:$r,closable:$r.closable,editable:an,active:Nr===Ie,tabPosition:Hn,tabBarGutter:Vn,renderWrapper:fr,removeAriaLabel:mn==null?void 0:mn.removeAriaLabel,ref:xn(Nr),onClick:function(Bi){dr(Nr,Bi)},onRemove:function(){zt(Nr)},onFocus:function(){ua(Nr),Ja(),ut||(Ar.current.scrollLeft=0),Ar.current.scrollTop=0}})}),io=u(function(){var $r,Nr,gi,Bi,La,ca,ja,da,Si,Fa=(($r=Ar.current)===null||$r===void 0?void 0:$r.offsetWidth)||0,Ba=((Nr=Ar.current)===null||Nr===void 0?void 0:Nr.offsetHeight)||0,Ha=((gi=Lr.current)===null||gi===void 0?void 0:gi.offsetWidth)||0,Gi=((Bi=Lr.current)===null||Bi===void 0?void 0:Bi.offsetHeight)||0,Vr=((La=Cr.current)===null||La===void 0?void 0:La.offsetWidth)||0,Or=((ca=Cr.current)===null||ca===void 0?void 0:ca.offsetHeight)||0;Ti(Fa),Ca(Ba),co(Ha),Va(Gi);var $n=(((ja=gr.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,hr=(((da=gr.current)===null||da===void 0?void 0:da.offsetHeight)||0)-Gi;yi($n),ui(hr);var Ir=(Si=Cr.current)===null||Si===void 0?void 0:Si.className.includes(Da);Fi($n-(Ir?0:Vr)),Zi(hr-(Ir?0:Or)),Ya(function(){var fi=new Map;return me.forEach(function(ga){var aa=ga.key,Mi=xn(aa).current;Mi&&fi.set(aa,{width:Mi.offsetWidth,height:Mi.offsetHeight,left:Mi.offsetLeft,top:Mi.offsetTop})}),fi})}),po=me.slice(0,Ao),Ki=me.slice(Do+1),bi=[].concat(Object(M.a)(po),Object(M.a)(Ki)),Pi=Object(P.useState)(),Ei=Object(V.a)(Pi,2),Na=Ei[0],mo=Ei[1],ea=Aa.get(Ie),ao=Object(P.useRef)();function oo(){p.a.cancel(ao.current)}Object(P.useEffect)(function(){var $r={};return ea&&(Vt?(ut?$r.right=ea.right:$r.left=ea.left,$r.width=ea.width):($r.top=ea.top,$r.height=ea.height)),oo(),ao.current=p()(function(){mo($r)}),oo},[ea,Vt,ut]),Object(P.useEffect)(function(){ua()},[Ie,ea,Aa,Vt]),Object(P.useEffect)(function(){io()},[ut,Vn,Ie,me.map(function($r){return $r.key}).join("_")]);var so=!!bi.length,xa="".concat(re,"-nav-wrap"),Qa,Ua,go,Za;return Vt?ut?(Ua=ir>0,Qa=ir+Qr<vr):(Qa=ir<0,Ua=-ir+Qr<vr):(go=Xr<0,Za=-Xr+la<Ri),P.createElement("div",{ref:Ue,role:"tablist",className:K()("".concat(re,"-nav"),ue),style:Oe,onKeyDown:function(){Ja()}},P.createElement(kn,{position:"left",extra:Ut,prefixCls:re}),P.createElement(m.a,{onResize:io},P.createElement("div",{className:K()(xa,(Ve={},Object(Z.a)(Ve,"".concat(xa,"-ping-left"),Qa),Object(Z.a)(Ve,"".concat(xa,"-ping-right"),Ua),Object(Z.a)(Ve,"".concat(xa,"-ping-top"),go),Object(Z.a)(Ve,"".concat(xa,"-ping-bottom"),Za),Ve)),ref:Ar},P.createElement(m.a,{onResize:io},P.createElement("div",{ref:gr,className:"".concat(re,"-nav-list"),style:{transform:"translate(".concat(ir,"px, ").concat(Xr,"px)"),transition:Xa?"none":void 0}},fo,P.createElement(An,{ref:Lr,prefixCls:re,locale:mn,editable:an,style:{visibility:so?"hidden":null}}),P.createElement("div",{className:K()("".concat(re,"-ink-bar"),Object(Z.a)({},"".concat(re,"-ink-bar-animated"),qe.inkBar)),style:Na}))))),P.createElement(vn,Object.assign({},Ee,{ref:Cr,prefixCls:re,tabs:bi,className:!so&&Da})),P.createElement(kn,{position:"right",extra:Ut,prefixCls:re}))}var er=P.forwardRef(lr);function Rr(Ee){var Ue=Ee.id,Ve=Ee.activeKey,Se=Ee.animated,re=Ee.tabPosition,me=Ee.rtl,ue=Ee.destroyInactiveTabPane,Oe=P.useContext(yr),Pe=Oe.prefixCls,qe=Oe.tabs,Ie=Se.tabPane,ut=qe.findIndex(function(Ut){return Ut.key===Ve});return P.createElement("div",{className:K()("".concat(Pe,"-content-holder"))},P.createElement("div",{className:K()("".concat(Pe,"-content"),"".concat(Pe,"-content-").concat(re),Object(Z.a)({},"".concat(Pe,"-content-animated"),Ie)),style:ut&&Ie?Object(Z.a)({},me?"marginRight":"marginLeft","-".concat(ut,"00%")):null},qe.map(function(Ut){return P.cloneElement(Ut.node,{key:Ut.key,prefixCls:Pe,tabKey:Ut.key,id:Ue,animated:Ie,active:Ut.key===Ve,destroyInactiveTabPane:ue})})))}function mr(Ee){var Ue=Ee.prefixCls,Ve=Ee.forceRender,Se=Ee.className,re=Ee.style,me=Ee.id,ue=Ee.active,Oe=Ee.animated,Pe=Ee.destroyInactiveTabPane,qe=Ee.tabKey,Ie=Ee.children,ut=P.useState(Ve),Ut=Object(V.a)(ut,2),an=Ut[0],mn=Ut[1];P.useEffect(function(){ue?mn(!0):Pe&&mn(!1)},[ue,Pe]);var Hn={};return ue||(Oe?(Hn.visibility="hidden",Hn.height=0,Hn.overflowY="hidden"):Hn.display="none"),P.createElement("div",{id:me&&"".concat(me,"-panel-").concat(qe),role:"tabpanel",tabIndex:ue?0:-1,"aria-labelledby":me&&"".concat(me,"-tab-").concat(qe),"aria-hidden":!ue,style:Object(G.a)(Object(G.a)({},Hn),re),className:K()("".concat(Ue,"-tabpane"),ue&&"".concat(Ue,"-tabpane-active"),Se)},(ue||an||Ve)&&Ie)}var xr=0;function Zr(Ee){return Object(I.a)(Ee).map(function(Ue){if(P.isValidElement(Ue)){var Ve=Ue.key!==void 0?String(Ue.key):void 0;return Object(G.a)(Object(G.a)({key:Ve},Ue.props),{},{node:Ue})}return null}).filter(function(Ue){return Ue})}function Yr(Ee,Ue){var Ve,Se=Ee.id,re=Ee.prefixCls,me=re===void 0?"rc-tabs":re,ue=Ee.className,Oe=Ee.children,Pe=Ee.direction,qe=Ee.activeKey,Ie=Ee.defaultActiveKey,ut=Ee.editable,Ut=Ee.animated,an=Ee.tabPosition,mn=an===void 0?"top":an,Hn=Ee.tabBarGutter,Vn=Ee.tabBarStyle,fr=Ee.tabBarExtraContent,dr=Ee.locale,wr=Ee.moreIcon,Ar=Ee.moreTransitionName,gr=Ee.destroyInactiveTabPane,Cr=Ee.renderTabBar,Lr=Ee.onChange,gn=Ee.onTabClick,nn=Ee.onTabScroll,xn=Object(U.a)(Ee,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),zt=Zr(Oe),Vt=Pe==="rtl",pr;Ut===!1?pr={inkBar:!1,tabPane:!1}:pr=Object(G.a)({inkBar:!0,tabPane:!1},Ut!==!0?Ut:null);var Mr=Object(P.useState)(!1),ir=Object(V.a)(Mr,2),Ur=ir[0],oi=ir[1];Object(P.useEffect)(function(){oi(Nt())},[]);var jr=Object(r.a)(function(){var ei;return(ei=zt[0])===null||ei===void 0?void 0:ei.key},{value:qe,defaultValue:Ie}),Xr=Object(V.a)(jr,2),zr=Xr[0],Wr=Xr[1],Hr=Object(P.useState)(function(){return zt.findIndex(function(ei){return ei.key===zr})}),vr=Object(V.a)(Hr,2),yi=vr[0],Qi=vr[1];Object(P.useEffect)(function(){var ei=zt.findIndex(function(qi){return qi.key===zr});if(ei===-1){var Zi;ei=Math.max(0,Math.min(yi,zt.length-1)),Wr((Zi=zt[ei])===null||Zi===void 0?void 0:Zi.key)}Qi(ei)},[zt.map(function(ei){return ei.key}).join("_"),zr,yi]);var ji=Object(r.a)(null,{value:Se}),Ri=Object(V.a)(ji,2),ui=Ri[0],qr=Ri[1],ii=mn;Ur&&!["left","right"].includes(mn)&&(ii="top"),Object(P.useEffect)(function(){Se||(qr("rc-tabs-".concat(xr)),xr+=1)},[]);function ci(ei,Zi){gn==null||gn(ei,Zi),Wr(ei),Lr==null||Lr(ei)}var Fi={id:ui,activeKey:zr,animated:pr,tabPosition:ii,rtl:Vt,mobile:Ur},ha,sa=Object(G.a)(Object(G.a)({},Fi),{},{editable:ut,locale:dr,moreIcon:wr,moreTransitionName:Ar,tabBarGutter:Hn,onTabClick:ci,onTabScroll:nn,extra:fr,style:Vn,panes:Oe});return Cr?ha=Cr(sa,er):ha=P.createElement(er,Object.assign({},sa)),P.createElement(yr.Provider,{value:{tabs:zt,prefixCls:me}},P.createElement("div",Object.assign({ref:Ue,id:Se,className:K()(me,"".concat(me,"-").concat(ii),(Ve={},Object(Z.a)(Ve,"".concat(me,"-mobile"),Ur),Object(Z.a)(Ve,"".concat(me,"-editable"),ut),Object(Z.a)(Ve,"".concat(me,"-rtl"),Vt),Ve),ue)},xn),ha,P.createElement(Rr,Object.assign({destroyInactiveTabPane:gr},Fi,{animated:pr}))))}var Jr=P.forwardRef(Yr);Jr.TabPane=mr;var vi=Jr,_i=he.b=vi},kSUc:function(Gt,he,D){},lZu9:function(Gt,he,D){(function(Z){Z(D("VrN/"),D("1eCo"),D("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(V,U){var G=Z.getMode(V,"text/html"),P=G.name=="null";function k(F){if(Z.findModeByName){var w=Z.findModeByName(F);w&&(F=w.mime||w.mimes[0])}var Y=Z.getMode(V,F);return Y.name=="null"?null:Y}U.highlightFormatting===void 0&&(U.highlightFormatting=!1),U.maxBlockquoteDepth===void 0&&(U.maxBlockquoteDepth=0),U.taskLists===void 0&&(U.taskLists=!1),U.strikethrough===void 0&&(U.strikethrough=!1),U.emoji===void 0&&(U.emoji=!1),U.fencedCodeBlockHighlighting===void 0&&(U.fencedCodeBlockHighlighting=!0),U.fencedCodeBlockDefaultMode===void 0&&(U.fencedCodeBlockDefaultMode="text/plain"),U.xml===void 0&&(U.xml=!0),U.tokenTypeOverrides===void 0&&(U.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var I in K)K.hasOwnProperty(I)&&U.tokenTypeOverrides[I]&&(K[I]=U.tokenTypeOverrides[I]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,_=/^\[(x| )\](?=\s)/i,p=U.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,o=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,s=" ";function i(F,w,Y){return w.f=w.inline=Y,Y(F,w)}function n(F,w,Y){return w.f=w.block=Y,Y(F,w)}function O(F){return!F||!/\S/.test(F.string)}function T(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==R){var w=P;if(!w){var Y=Z.innerMode(G,F.htmlState);w=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}w&&(F.f=f,F.block=C,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function C(F,w){var Y=F.column()===w.indentation,q=O(w.prevLine.stream),ie=w.indentedCode,ge=w.prevLine.hr,Je=w.list!==!1,xe=(w.listStack[w.listStack.length-1]||0)+3;w.indentedCode=!1;var ke=w.indentation;if(w.indentationDiff===null&&(w.indentationDiff=w.indentation,Je)){for(w.list=null;ke<w.listStack[w.listStack.length-1];)w.listStack.pop(),w.listStack.length?w.indentation=w.listStack[w.listStack.length-1]:w.list=!1;w.list!==!1&&(w.indentationDiff=ke-w.listStack[w.listStack.length-1])}var Qe=!q&&!ge&&!w.prevLine.header&&(!Je||!ie)&&!w.prevLine.fencedCodeEnd,Ye=(w.list===!1||ge||q)&&w.indentation<=xe&&F.match(r),ve=null;if(w.indentationDiff>=4&&(ie||w.prevLine.fencedCodeEnd||w.prevLine.header||q))return F.skipToEnd(),w.indentedCode=!0,K.code;if(F.eatSpace())return null;if(Y&&w.indentation<=xe&&(ve=F.match(p))&&ve[1].length<=6)return w.quote=0,w.header=ve[1].length,w.thisLine.header=!0,U.highlightFormatting&&(w.formatting="header"),w.f=w.inline,v(w);if(w.indentation<=xe&&F.eat(">"))return w.quote=Y?1:w.quote+1,U.highlightFormatting&&(w.formatting="quote"),F.eatSpace(),v(w);if(!Ye&&!w.setext&&Y&&w.indentation<=xe&&(ve=F.match(M))){var fe=ve[1]?"ol":"ul";return w.indentation=ke+F.current().length,w.list=!0,w.quote=0,w.listStack.push(w.indentation),w.em=!1,w.strong=!1,w.code=!1,w.strikethrough=!1,U.taskLists&&F.match(_,!1)&&(w.taskList=!0),w.f=w.inline,U.highlightFormatting&&(w.formatting=["list","list-"+fe]),v(w)}else{if(Y&&w.indentation<=xe&&(ve=F.match(a,!0)))return w.quote=0,w.fencedEndRE=new RegExp(ve[1]+"+ *$"),w.localMode=U.fencedCodeBlockHighlighting&&k(ve[2]||U.fencedCodeBlockDefaultMode),w.localMode&&(w.localState=Z.startState(w.localMode)),w.f=w.block=S,U.highlightFormatting&&(w.formatting="code-block"),w.code=-1,v(w);if(w.setext||(!Qe||!Je)&&!w.quote&&w.list===!1&&!w.code&&!Ye&&!o.test(F.string)&&(ve=F.lookAhead(1))&&(ve=ve.match(m)))return w.setext?(w.header=w.setext,w.setext=0,F.skipToEnd(),U.highlightFormatting&&(w.formatting="header")):(w.header=ve[0].charAt(0)=="="?1:2,w.setext=w.header),w.thisLine.header=!0,w.f=w.inline,v(w);if(Ye)return F.skipToEnd(),w.hr=!0,w.thisLine.hr=!0,K.hr;if(F.peek()==="[")return i(F,w,j)}return i(F,w,w.inline)}function R(F,w){var Y=G.token(F,w.htmlState);if(!P){var q=Z.innerMode(G,w.htmlState);(q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText||w.md_inside&&F.current().indexOf(">")>-1)&&(w.f=f,w.block=C,w.htmlState=null)}return Y}function S(F,w){var Y=w.listStack[w.listStack.length-1]||0,q=w.indentation<Y,ie=Y+3;if(w.fencedEndRE&&w.indentation<=ie&&(q||F.match(w.fencedEndRE))){U.highlightFormatting&&(w.formatting="code-block");var ge;return q||(ge=v(w)),w.localMode=w.localState=null,w.block=C,w.f=f,w.fencedEndRE=null,w.code=0,w.thisLine.fencedCodeEnd=!0,q?n(F,w,w.block):ge}else return w.localMode?w.localMode.token(F,w.localState):(F.skipToEnd(),K.code)}function v(F){var w=[];if(F.formatting){w.push(K.formatting),typeof F.formatting=="string"&&(F.formatting=[F.formatting]);for(var Y=0;Y<F.formatting.length;Y++)w.push(K.formatting+"-"+F.formatting[Y]),F.formatting[Y]==="header"&&w.push(K.formatting+"-"+F.formatting[Y]+"-"+F.header),F.formatting[Y]==="quote"&&(!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=F.quote?w.push(K.formatting+"-"+F.formatting[Y]+"-"+F.quote):w.push("error"))}if(F.taskOpen)return w.push("meta"),w.length?w.join(" "):null;if(F.taskClosed)return w.push("property"),w.length?w.join(" "):null;if(F.linkHref?w.push(K.linkHref,"url"):(F.strong&&w.push(K.strong),F.em&&w.push(K.em),F.strikethrough&&w.push(K.strikethrough),F.emoji&&w.push(K.emoji),F.linkText&&w.push(K.linkText),F.code&&w.push(K.code),F.image&&w.push(K.image),F.imageAltText&&w.push(K.imageAltText,"link"),F.imageMarker&&w.push(K.imageMarker)),F.header&&w.push(K.header,K.header+"-"+F.header),F.quote&&(w.push(K.quote),!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=F.quote?w.push(K.quote+"-"+F.quote):w.push(K.quote+"-"+U.maxBlockquoteDepth)),F.list!==!1){var q=(F.listStack.length-1)%3;q?q===1?w.push(K.list2):w.push(K.list3):w.push(K.list1)}return F.trailingSpaceNewLine?w.push("trailing-space-new-line"):F.trailingSpace&&w.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),w.length?w.join(" "):null}function E(F,w){return F.match(u,!0)?v(w):void 0}function f(F,w){var Y=w.text(F,w);if(typeof Y!="undefined")return Y;if(w.list)return w.list=null,v(w);if(w.taskList){var q=F.match(_,!0)[1]===" ";return q?w.taskOpen=!0:w.taskClosed=!0,U.highlightFormatting&&(w.formatting="task"),w.taskList=!1,v(w)}if(w.taskOpen=!1,w.taskClosed=!1,w.header&&F.match(/^#+$/,!0))return U.highlightFormatting&&(w.formatting="header"),v(w);var ie=F.next();if(w.linkTitle){w.linkTitle=!1;var ge=ie;ie==="("&&(ge=")"),ge=(ge+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Je="^\\s*(?:[^"+ge+"\\\\]+|\\\\\\\\|\\\\.)"+ge;if(F.match(new RegExp(Je),!0))return K.linkHref}if(ie==="`"){var xe=w.formatting;U.highlightFormatting&&(w.formatting="code"),F.eatWhile("`");var ke=F.current().length;if(w.code==0&&(!w.quote||ke==1))return w.code=ke,v(w);if(ke==w.code){var Qe=v(w);return w.code=0,Qe}else return w.formatting=xe,v(w)}else if(w.code)return v(w);if(ie==="\\"&&(F.next(),U.highlightFormatting)){var Ye=v(w),ve=K.formatting+"-escape";return Ye?Ye+" "+ve:ve}if(ie==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return w.imageMarker=!0,w.image=!0,U.highlightFormatting&&(w.formatting="image"),v(w);if(ie==="["&&w.imageMarker&&F.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return w.imageMarker=!1,w.imageAltText=!0,U.highlightFormatting&&(w.formatting="image"),v(w);if(ie==="]"&&w.imageAltText){U.highlightFormatting&&(w.formatting="image");var Ye=v(w);return w.imageAltText=!1,w.image=!1,w.inline=w.f=y,Ye}if(ie==="["&&!w.image)return w.linkText&&F.match(/^.*?\]/)||(w.linkText=!0,U.highlightFormatting&&(w.formatting="link")),v(w);if(ie==="]"&&w.linkText){U.highlightFormatting&&(w.formatting="link");var Ye=v(w);return w.linkText=!1,w.inline=w.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?y:f,Ye}if(ie==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,U.highlightFormatting&&(w.formatting="link");var Ye=v(w);return Ye?Ye+=" ":Ye="",Ye+K.linkInline}if(ie==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,U.highlightFormatting&&(w.formatting="link");var Ye=v(w);return Ye?Ye+=" ":Ye="",Ye+K.linkEmail}if(U.xml&&ie==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var fe=F.string.indexOf(">",F.pos);if(fe!=-1){var at=F.string.substring(F.start,fe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(at)&&(w.md_inside=!0)}return F.backUp(1),w.htmlState=Z.startState(G),n(F,w,R)}if(U.xml&&ie==="<"&&F.match(/^\/\w*?>/))return w.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var Jt=1,Ft=F.pos==1?" ":F.string.charAt(F.pos-2);Jt<3&&F.eat(ie);)Jt++;var St=F.peek()||" ",ze=!/\s/.test(St)&&(!c.test(St)||/\s/.test(Ft)||c.test(Ft)),gt=!/\s/.test(Ft)&&(!c.test(Ft)||/\s/.test(St)||c.test(St)),ct=null,jt=null;if(Jt%2&&(!w.em&&ze&&(ie==="*"||!gt||c.test(Ft))?ct=!0:w.em==ie&&gt&&(ie==="*"||!ze||c.test(St))&&(ct=!1)),Jt>1&&(!w.strong&&ze&&(ie==="*"||!gt||c.test(Ft))?jt=!0:w.strong==ie&&gt&&(ie==="*"||!ze||c.test(St))&&(jt=!1)),jt!=null||ct!=null){U.highlightFormatting&&(w.formatting=ct==null?"strong":jt==null?"em":"strong em"),ct===!0&&(w.em=ie),jt===!0&&(w.strong=ie);var Qe=v(w);return ct===!1&&(w.em=!1),jt===!1&&(w.strong=!1),Qe}}else if(ie===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return v(w);F.backUp(1)}if(U.strikethrough){if(ie==="~"&&F.eatWhile(ie)){if(w.strikethrough){U.highlightFormatting&&(w.formatting="strikethrough");var Qe=v(w);return w.strikethrough=!1,Qe}else if(F.match(/^[^\s]/,!1))return w.strikethrough=!0,U.highlightFormatting&&(w.formatting="strikethrough"),v(w)}else if(ie===" "&&F.match(/^~~/,!0)){if(F.peek()===" ")return v(w);F.backUp(2)}}if(U.emoji&&ie===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){w.emoji=!0,U.highlightFormatting&&(w.formatting="emoji");var oe=v(w);return w.emoji=!1,oe}return ie===" "&&(F.match(/^ +$/,!1)?w.trailingSpace++:w.trailingSpace&&(w.trailingSpaceNewLine=!0)),v(w)}function h(F,w){var Y=F.next();if(Y===">"){w.f=w.inline=f,U.highlightFormatting&&(w.formatting="link");var q=v(w);return q?q+=" ":q="",q+K.linkInline}return F.match(/^[^>]+/,!0),K.linkInline}function y(F,w){if(F.eatSpace())return null;var Y=F.next();return Y==="("||Y==="["?(w.f=w.inline=x(Y==="("?")":"]"),U.highlightFormatting&&(w.formatting="link-string"),w.linkHref=!0,v(w)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(F){return function(w,Y){var q=w.next();if(q===F){Y.f=Y.inline=f,U.highlightFormatting&&(Y.formatting="link-string");var ie=v(Y);return Y.linkHref=!1,ie}return w.match(g[F]),Y.linkHref=!0,v(Y)}}function j(F,w){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(w.f=B,F.next(),U.highlightFormatting&&(w.formatting="link"),w.linkText=!0,v(w)):i(F,w,f)}function B(F,w){if(F.match(/^\]:/,!0)){w.f=w.inline=A,U.highlightFormatting&&(w.formatting="link");var Y=v(w);return w.linkText=!1,Y}return F.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function A(F,w){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?w.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),w.f=w.inline=f,K.linkHref+" url")}var H={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:f,text:E,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&Z.copyState(G,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?Z.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,w){if(w.formatting=!1,F!=w.thisLine.stream){if(w.header=0,w.hr=!1,F.match(/^\s*$/,!0))return T(w),null;if(w.prevLine=w.thisLine,w.thisLine={stream:F},w.taskList=!1,w.trailingSpace=0,w.trailingSpaceNewLine=!1,!w.localState&&(w.f=w.block,w.f!=R)){var Y=F.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(w.indentation=Y,w.indentationDiff=null,Y>0)return null}}return w.f(F,w)},innerMode:function(F){return F.block==R?{state:F.htmlState,mode:G}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:H}},indent:function(F,w,Y){return F.block==R&&G.indent?G.indent(F.htmlState,w,Y):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,w,Y):Z.Pass},blankLine:T,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},mgmH:function(Gt,he,D){"use strict";D.d(he,"d",function(){return m}),D.d(he,"b",function(){return u}),D.d(he,"e",function(){return a}),D.d(he,"c",function(){return o}),D.d(he,"n",function(){return c}),D.d(he,"g",function(){return s}),D.d(he,"h",function(){return i}),D.d(he,"j",function(){return O}),D.d(he,"a",function(){return T}),D.d(he,"l",function(){return C}),D.d(he,"f",function(){return R}),D.d(he,"k",function(){return S}),D.d(he,"m",function(){return v}),D.d(he,"i",function(){return E}),D.d(he,"o",function(){return f}),D.d(he,"t",function(){return h}),D.d(he,"s",function(){return y}),D.d(he,"p",function(){return g}),D.d(he,"q",function(){return x}),D.d(he,"r",function(){return j}),D.d(he,"v",function(){return B}),D.d(he,"u",function(){return A});var Z=D("miYZ"),V=D("tsqr"),U=D("k1fw"),G=D("9og8"),P=D("WmNS"),k=D.n(P),K=D("oUNq"),I=D("9kvl"),r=D("1vsH"),M=D("m3rI"),_=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(I.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},m=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return _(),ie.next=3,Object(K.t)(Object(U.a)({},w));case 3:if(Y=ie.sent,!(Y.status===0)){ie.next=7;break}return ie.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/export_couser_info.json"),query:w}));case 7:p();case 8:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),u=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.r)(Object(U.a)({},w));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_member_act_score")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),a=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.u)(Object(U.a)({},w));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_score")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_score")));case 13:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),o=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.s)(Object(U.a)({},w));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),c=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.z)(Object(U.a)({},w));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),s=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.v)(Object(U.a)({},w));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_homework")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),i=function(){var H=Object(G.a)(k.a.mark(function F(w,Y){var q;return k.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.next=2,Object(K.x)(Object(U.a)({},w));case 2:q=ge.sent,q.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/").concat(Y))):q.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/").concat(Y)));case 4:case"end":return ge.stop()}},F)}));return function(w,Y){return H.apply(this,arguments)}}(),n=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return _(),ie.next=3,Object(K.w)(Object(U.a)({},w));case 3:if(Y=ie.sent,!(Y.status===0)){ie.next=7;break}return ie.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/homework_commons/".concat(w.categoryId,"/works_list.zip"),query:w}));case 7:p();case 8:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),O=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return _(),ie.next=3,Object(K.A)(Object(U.a)({},w));case 3:if(Y=ie.sent,!(Y.status===0)){ie.next=7;break}return ie.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/polls/".concat(w.categoryId,"/commit_result.xlsx"),query:w}));case 7:p();case 8:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),T=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/attendances/export_xlsx_data.xlsx"),query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),C=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/video_study_statics.xlsx"),query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),R=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/export_course_students_info.xlsx"),query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),S=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/item_banks/export.xlsx",query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),v=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),E=function(){var H=Object(G.a)(k.a.mark(function F(w){var Y;return k.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.y)(Object(U.a)({},w));case 2:Y=ie.sent,Y.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/exercise_score"))):Y.status===-3&&(Object(I.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),I.d.push("/classrooms/".concat(w.coursesId,"/exportlist/exercise_score")));case 4:case"end":return ie.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),f=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),q.next=3,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/export_records/".concat(w.id,".xlsx"),query:w}));case 3:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),h=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),y=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_years/".concat(w==null?void 0:w.ec_year_id,"/ec_training_objectives.xlsx"),query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),g=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)(w==null?void 0:w.name,Object(r.Y)({url:M.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),x=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_years/".concat(w==null?void 0:w.ec_year_id,"/ec_courses.xlsx"),query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),j=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_years/".concat(w==null?void 0:w.ec_year_id,"/ec_graduation_requirements.xlsx"),query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),B=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/rank_list.xlsx",query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}(),A=function(){var H=Object(G.a)(k.a.mark(function F(w){return k.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:w}));case 2:case"end":return q.stop()}},F)}));return function(w){return H.apply(this,arguments)}}()},n6Qo:function(Gt,he,D){"use strict";D.d(he,"a",function(){return I});var Z=D("q1tI"),V=D("biw7"),U=D("fyJ8");function G(r){var M=r.className,_=r.index,p=r.children,m=r.colSpan,u=r.rowSpan,a=Z.useContext(V.a),o=a.prefixCls,c=a.fixedInfoList,s=c[_];return Z.createElement(U.a,Object.assign({className:M,index:_,component:"td",prefixCls:o,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:m,rowSpan:u}}}},s))}function P(r){return Z.createElement("tr",Object.assign({},r))}function k(r){var M=r.children,_=Z.useContext(V.a),p=_.prefixCls;return Z.createElement("tfoot",{className:"".concat(p,"-summary")},M)}var K=he.b=k,I={Cell:G,Row:P}},nEHx:function(Gt,he,D){"use strict";D.d(he,"a",function(){return Z});var Z;(function(V){V.DARK="dark",V.LIGHT="light",V.HIGH_CONTRAST="hc"})(Z||(Z={}))},nPLb:function(Gt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("g9YV"),G=D("wCAj"),P=D("5NDa"),k=D("5rEg"),K=D("14J3"),I=D("BMrR"),r=D("iQDF"),M=D("+eQT"),_=D("miYZ"),p=D("tsqr"),m=D("jrin"),u=D("oBTY"),a=D("k1fw"),o=D("9og8"),c=D("y8nQ"),s=D("Vl3Y"),i=D("tJVT"),n=D("PpiC"),O=D("WmNS"),T=D.n(O),C=D("q1tI"),R=D.n(C),S=D("wd/R"),v=D.n(S),E=D("ErOA"),f=D("1vsH"),h=D("Ty5D"),y=D("9kvl"),g=D("oUNq"),x=D("xKgJ"),j=D("eozf"),B=function(H){var F=H.classroomList,w=H.dispatch,Y=H.courseEndTime,q=Object(n.a)(H,["classroomList","dispatch","courseEndTime"]),ie=Object(h.i)(),ge=s.a.useForm(),Je=Object(i.a)(ge,1),xe=Je[0],ke=Object(C.useState)(1),Qe=Object(i.a)(ke,2),Ye=Qe[0],ve=Qe[1],fe=Object(C.useState)([]),at=Object(i.a)(fe,2),Jt=at[0],Ft=at[1],St=Object(C.useState)(0),ze=Object(i.a)(St,2),gt=ze[0],ct=ze[1],jt=Object(C.useState)(2e4),oe=Object(i.a)(jt,2),Ne=oe[0],Ge=oe[1],Xe=Object(C.useState)(!0),Bt=Object(i.a)(Xe,2),Wt=Bt[0],en=Bt[1],tt=Object(C.useState)(),tn=Object(i.a)(tt,2),En=tn[0],We=tn[1],Fe=Object(C.useState)([]),yt=Object(i.a)(Fe,2),At=yt[0],nt=yt[1];ie.id=ie.coursesId,Object(C.useEffect)(function(){F.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?st():(nt([]),Ft([]))},[F.actionTabs.key]);var st=function(){var ae=Object(o.a)(T.a.mark(function se(pe){var _e,be,Ke;return T.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return en(!0),rn.next=3,Object(g.D)(Object(a.a)(Object(a.a)({},ie),{},{page:pe||Ye,limit:Ne,homework_id:F.actionTabs.type===1?"":F.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:_e=rn.sent,_e==null||_e.course_groups.map(function(Dn){Dn.key=Dn.id}),_e&&(Ft([].concat(Object(u.a)(Jt),Object(u.a)(_e==null?void 0:_e.course_groups))),ct(_e==null?void 0:_e.group_count),We(_e==null?void 0:_e.course_groups),en(!1),pe||xe.setFieldsValue((Ke={},Object(m.a)(Ke,"group_ids",_e==null||((be=_e.course_groups)===null||be===void 0)?void 0:be.map(function(Dn){return String(Dn.id)})),Object(m.a)(Ke,"end_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Ke)));case 6:case"end":return rn.stop()}},se)}));return function(pe){return ae.apply(this,arguments)}}(),De=function(){var ae=Object(o.a)(T.a.mark(function se(){var pe,_e,be,Ke;return T.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:if(pe=Object(a.a)({},xe.getFieldsValue()),console.log("----",pe.group_ids),!(En!=null&&En.length&&!(At!=null&&At.length))){rn.next=5;break}return p.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),rn.abrupt("return");case 5:return rn.next=7,Object(E.a)("/api/courses/".concat(ie.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(u.a)(F.actionTabs.selectArrs),group_ids:(At==null?void 0:At.length)>0?At:[],unified_setting:!(Jt!=null&&Jt.length),end_time:v()(pe.end_time).format("YYYY-MM-DD HH:mm")}});case 7:_e=rn.sent,_e.status===0&&(ye(),Object(f.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),p.b.success("\u64CD\u4F5C\u6210\u529F"),w({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),q.onCallback&&q.onCallback(),Object(x.c)()?(w({type:"classroomList/setActionTabs",payload:{}}),(F==null||((be=F.actionTabs)===null||be===void 0||((Ke=be.selectArrsAll)===null||Ke===void 0))?void 0:Ke.length)>0?w({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},F.actionTabs.params),{},{type:5})}):w({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},ie)})):w({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},F.actionTabs.params)}));case 9:case"end":return rn.stop()}},se)}));return function(){return ae.apply(this,arguments)}}(),ye=function(){ve(1),Ft([])},we=F.detailCommonHomeworksList;return R.a.createElement(V.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:F.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:De,onCancel:function(){ye(),w({type:"classroomList/setActionTabs",payload:{}})}},R.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",R.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),Jt&&R.a.createElement(s.a,{form:xe},R.a.createElement(I.a,null,R.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),R.a.createElement(s.a.Item,{name:"end_time"},R.a.createElement(M.a,{style:{width:170},getPopupContainer:function(se){return se.parentNode},disabledDate:function(se){return Object(j.b)(se,Y)},disabledTime:function(se){return Object(j.c)(se)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(f.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(En==null?void 0:En.length)>0&&R.a.createElement(I.a,null,R.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),R.a.createElement(k.a.Search,{style:{width:"300px"},onChange:function(se){Ft(En.filter(function(pe){return pe.name.indexOf(se.target.value)>-1}))}})),(Jt==null?void 0:Jt.length)>0&&F.actionTabs.type===1&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(se,pe){nt(se)}},rowKey:"id",pagination:!1,dataSource:Jt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(Jt==null?void 0:Jt.length)>0&&F.actionTabs.type===2&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(se,pe){nt(se)}},rowKey:"id",pagination:!1,dataSource:Jt,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"}]})))};he.a=Object(y.a)(function(A){var H=A.classroomList;return{classroomList:H}})(B)},nnTU:function(Gt,he,D){"use strict";D.d(he,"b",function(){return K}),D.d(he,"a",function(){return I});var Z=D("MI8n"),V=D("JYp7"),U=D("pmY6"),G=D("24hK"),P=D("746U"),k=D("Cg/j");const K=Object(k.c)("commandService"),I=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,M){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!M)throw new Error("invalid command");return this.registerCommand({id:r,handler:M})}if(r.description){const a=[];for(let c of r.description.args)a.push(c.constraint);const o=r.handler;r.handler=function(c,...s){return Object(P.o)(s,a),o(c,...s)}}const{id:_}=r;let p=this._commands.get(_);p||(p=new G.a,this._commands.set(_,p));let m=p.unshift(r),u=Object(U.i)(()=>{m();const a=this._commands.get(_);(a==null?void 0:a.isEmpty())&&this._commands.delete(_)});return this._onDidRegisterCommand.fire(_),u}registerCommandAlias(r,M){return I.registerCommand(r,(_,...p)=>_.get(K).executeCommand(M,...p))}getCommand(r){const M=this._commands.get(r);return!M||M.isEmpty()?void 0:V.a.first(M)}getCommands(){const r=new Map;for(const M of this._commands.keys()){const _=this.getCommand(M);_&&r.set(M,_)}return r}};I.registerCommand("noop",()=>{})},oOBs:function(Gt,he,D){Gt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(Gt,he,D){"use strict";D.d(he,"a",function(){return ur});var Z=D("1OyB"),V=D("vuIU"),U=D("Ji7U"),G=D("LK+K"),P=D("rePB"),k=D("VTBJ"),K=D("ODXe"),I=D("q1tI"),r=D("TSYQ"),M=D.n(r),_=D("Kwbf"),p=D("6cGi"),m=D("U8pU"),u=D("4IlW"),a=I.createContext({}),o=a,c={visibility:"hidden"};function s(Q){var ce=Q.prefixCls,Ce=Q.prevIcon,Te=Ce===void 0?"\u2039":Ce,rt=Q.nextIcon,Re=rt===void 0?"\u203A":rt,$e=Q.superPrevIcon,it=$e===void 0?"\xAB":$e,Dt=Q.superNextIcon,Tt=Dt===void 0?"\xBB":Dt,Be=Q.onSuperPrev,_t=Q.onSuperNext,ot=Q.onPrev,ht=Q.onNext,wt=Q.children,It=I.useContext(o),vt=It.hideNextBtn,Xt=It.hidePrevBtn;return I.createElement("div",{className:ce},Be&&I.createElement("button",{type:"button",onClick:Be,tabIndex:-1,className:"".concat(ce,"-super-prev-btn"),style:Xt?c:{}},it),ot&&I.createElement("button",{type:"button",onClick:ot,tabIndex:-1,className:"".concat(ce,"-prev-btn"),style:Xt?c:{}},Te),I.createElement("div",{className:"".concat(ce,"-view")},wt),ht&&I.createElement("button",{type:"button",onClick:ht,tabIndex:-1,className:"".concat(ce,"-next-btn"),style:vt?c:{}},Re),_t&&I.createElement("button",{type:"button",onClick:_t,tabIndex:-1,className:"".concat(ce,"-super-next-btn"),style:vt?c:{}},Tt))}var i=s;function n(Q){var ce=I.useContext(o),Ce=ce.hideHeader;if(Ce)return null;var Te=Q.prefixCls,rt=Q.generateConfig,Re=Q.locale,$e=Q.value,it=Q.format,Dt="".concat(Te,"-header");return I.createElement(i,{prefixCls:Dt},$e?rt.locale.format(Re.locale,$e,it):"\xA0")}var O=n,T=D("YrtM"),C=D("KQm4"),R=new Map;function S(Q,ce,Ce){if(R.get(Q)&&cancelAnimationFrame(R.get(Q)),Ce<=0){R.set(Q,requestAnimationFrame(function(){Q.scrollTop=ce}));return}var Te=ce-Q.scrollTop,rt=Te/Ce*10;R.set(Q,requestAnimationFrame(function(){Q.scrollTop+=rt,Q.scrollTop!==ce&&S(Q,ce,Ce-10)}))}function v(Q,ce){var Ce=ce.onLeftRight,Te=ce.onCtrlLeftRight,rt=ce.onUpDown,Re=ce.onPageUpDown,$e=ce.onEnter,it=Q.which,Dt=Q.ctrlKey,Tt=Q.metaKey;switch(it){case u.a.LEFT:if(Dt||Tt){if(Te)return Te(-1),!0}else if(Ce)return Ce(-1),!0;break;case u.a.RIGHT:if(Dt||Tt){if(Te)return Te(1),!0}else if(Ce)return Ce(1),!0;break;case u.a.UP:if(rt)return rt(-1),!0;break;case u.a.DOWN:if(rt)return rt(1),!0;break;case u.a.PAGE_UP:if(Re)return Re(-1),!0;break;case u.a.PAGE_DOWN:if(Re)return Re(1),!0;break;case u.a.ENTER:if($e)return $e(),!0;break}return!1}function E(Q,ce,Ce,Te){var rt=Q;if(!rt)switch(ce){case"time":rt=Te?"hh:mm:ss a":"HH:mm:ss";break;case"week":rt="gggg-wo";break;case"month":rt="YYYY-MM";break;case"quarter":rt="YYYY-[Q]Q";break;case"year":rt="YYYY";break;default:rt=Ce?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return rt}function f(Q,ce){var Ce=Q==="time"?8:10;return Math.max(Ce,ce.length)+2}var h=null,y=new Set;function g(Q){return!h&&typeof window!="undefined"&&window.addEventListener&&(h=function(Ce){Object(C.a)(y).forEach(function(Te){Te(Ce)})},window.addEventListener("mousedown",h)),y.add(Q),function(){y.delete(Q),y.size===0&&(window.removeEventListener("mousedown",h),h=null)}}var x=function(ce){return ce==="month"||ce==="date"?"year":ce},j=function(ce){return ce==="date"?"month":ce},B=function(ce){return ce==="month"||ce==="date"?"quarter":ce},A=function(ce){return ce==="date"?"week":ce},H={year:x,month:j,quarter:B,week:A,time:null,date:null};function F(Q,ce){return Q.some(function(Ce){return Ce&&Ce.contains(ce)})}function w(Q){var ce=Q.prefixCls,Ce=Q.units,Te=Q.onSelect,rt=Q.value,Re=Q.active,$e=Q.hideDisabledOptions,it="".concat(ce,"-cell"),Dt=I.useContext(o),Tt=Dt.open,Be=I.useRef(null),_t=I.useRef(new Map);return I.useLayoutEffect(function(){var ot=_t.current.get(rt);ot&&Tt!==!1&&S(Be.current,ot.offsetTop,120)},[rt]),I.useLayoutEffect(function(){if(Tt){var ot=_t.current.get(rt);ot&&S(Be.current,ot.offsetTop,0)}},[Tt]),I.createElement("ul",{className:M()("".concat(ce,"-column"),Object(P.a)({},"".concat(ce,"-column-active"),Re)),ref:Be,style:{position:"relative"}},Ce.map(function(ot){var ht;return $e&&ot.disabled?null:I.createElement("li",{key:ot.value,ref:function(It){_t.current.set(ot.value,It)},className:M()(it,(ht={},Object(P.a)(ht,"".concat(it,"-disabled"),ot.disabled),Object(P.a)(ht,"".concat(it,"-selected"),rt===ot.value),ht)),onClick:function(){if(ot.disabled)return;Te(ot.value)}},I.createElement("div",{className:"".concat(it,"-inner")},ot.label))}))}var Y=w;function q(Q,ce){for(var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Te=String(Q);Te.length<ce;)Te="".concat(Ce).concat(Q);return Te}var ie=function(){for(var ce=arguments.length,Ce=new Array(ce),Te=0;Te<ce;Te++)Ce[Te]=arguments[Te];return Ce};function ge(Q){return Q==null?[]:Array.isArray(Q)?Q:[Q]}function Je(Q){var ce={};return Object.keys(Q).forEach(function(Ce){(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role"||Ce==="name")&&Ce.substr(0,7)!=="data-__"&&(ce[Ce]=Q[Ce])}),ce}function xe(Q,ce){return Q?Q[ce]:null}function ke(Q,ce,Ce){var Te=[xe(Q,0),xe(Q,1)];return Te[Ce]=typeof ce=="function"?ce(Te[Ce]):ce,!Te[0]&&!Te[1]?null:Te}function Qe(Q,ce,Ce,Te,rt){var Re=Q.setHour(ce,Ce);return Re=Q.setMinute(Re,Te),Re=Q.setSecond(Re,rt),Re}function Ye(Q,ce,Ce,Te,rt,Re){var $e=Math.floor(Q/Te)*Te;if($e<Q)return[$e,60-rt,60-Re];var it=Math.floor(ce/rt)*rt;if(it<ce)return[$e,it,60-Re];var Dt=Math.floor(Ce/Re)*Re;return[$e,it,Dt]}function ve(Q,ce){if(Q.length!==ce.length)return!0;for(var Ce=0;Ce<Q.length;Ce+=1)if(Q[Ce].disabled!==ce[Ce].disabled)return!0;return!1}function fe(Q,ce,Ce,Te){for(var rt=[],Re=Q;Re<=ce;Re+=Ce)rt.push({label:q(Re,2),value:Re,disabled:(Te||[]).includes(Re)});return rt}function at(Q){var ce=Q.generateConfig,Ce=Q.prefixCls,Te=Q.operationRef,rt=Q.activeColumnIndex,Re=Q.value,$e=Q.showHour,it=Q.showMinute,Dt=Q.showSecond,Tt=Q.use12Hours,Be=Q.hourStep,_t=Be===void 0?1:Be,ot=Q.minuteStep,ht=ot===void 0?1:ot,wt=Q.secondStep,It=wt===void 0?1:wt,vt=Q.disabledHours,Xt=Q.disabledMinutes,dn=Q.disabledSeconds,Pn=Q.hideDisabledOptions,Gn=Q.onSelect,On=[],Nn="".concat(Ce,"-content"),Mn="".concat(Ce,"-time-panel"),Pt,hn=Re?ce.getHour(Re):-1,Kt=Re?ce.getMinute(Re):-1,Rt=Re?ce.getSecond(Re):-1,Un=function(wn,Lt,Ze,Nt){var Mt=Re||ce.getNow(),cn=Math.max(0,Lt),zn=Math.max(0,Ze),kn=Math.max(0,Nt);return Mt=Qe(ce,Mt,!Tt||!wn?cn:cn+12,zn,kn),Mt},Rn=fe(0,23,_t,vt&&vt()),Yt=Object(T.a)(function(){return Rn},Rn,ve);Tt&&(Pt=hn>=12,hn%=12);var ft=I.useMemo(function(){if(!Tt)return[!1,!1];var Ln=[!0,!0];return Yt.forEach(function(wn){var Lt=wn.disabled,Ze=wn.value;if(Lt)return;Ze>=12?Ln[1]=!1:Ln[0]=!1}),Ln},[Tt,Yt]),jn=Object(K.a)(ft,2),fn=jn[0],Qn=jn[1],qt=I.useMemo(function(){return Tt?Yt.filter(Pt?function(Ln){return Ln.value>=12}:function(Ln){return Ln.value<12}).map(function(Ln){var wn=Ln.value%12,Lt=wn===0?"12":q(wn,2);return Object(k.a)(Object(k.a)({},Ln),{},{label:Lt,value:wn})}):Yt},[Tt,Yt]),An=fe(0,59,ht,Xt&&Xt(hn)),Fn=fe(0,59,It,dn&&dn(hn,Kt));Te.current={onUpDown:function(wn){var Lt=On[rt];if(Lt)for(var Ze=Lt.units.findIndex(function(zn){return zn.value===Lt.value}),Nt=Lt.units.length,Mt=1;Mt<Nt;Mt+=1){var cn=Lt.units[(Ze+wn*Mt+Nt)%Nt];if(cn.disabled!==!0){Lt.onSelect(cn.value);break}}}};function vn(Ln,wn,Lt,Ze,Nt){Ln!==!1&&On.push({node:I.cloneElement(wn,{prefixCls:Mn,value:Lt,active:rt===On.length,onSelect:Nt,units:Ze,hideDisabledOptions:Pn}),onSelect:Nt,value:Lt,units:Ze})}vn($e,I.createElement(Y,{key:"hour"}),hn,qt,function(Ln){Gn(Un(Pt,Ln,Kt,Rt),"mouse")}),vn(it,I.createElement(Y,{key:"minute"}),Kt,An,function(Ln){Gn(Un(Pt,hn,Ln,Rt),"mouse")}),vn(Dt,I.createElement(Y,{key:"second"}),Rt,Fn,function(Ln){Gn(Un(Pt,hn,Kt,Ln),"mouse")});var yr=-1;return typeof Pt=="boolean"&&(yr=Pt?1:0),vn(Tt===!0,I.createElement(Y,{key:"12hours"}),yr,[{label:"AM",value:0,disabled:fn},{label:"PM",value:1,disabled:Qn}],function(Ln){Gn(Un(!!Ln,hn,Kt,Rt),"mouse")}),I.createElement("div",{className:Nn},On.map(function(Ln){var wn=Ln.node;return wn}))}var Jt=at,Ft=function(ce){return ce.filter(function(Ce){return Ce!==!1}).length};function St(Q){var ce=Q.generateConfig,Ce=Q.format,Te=Ce===void 0?"HH:mm:ss":Ce,rt=Q.prefixCls,Re=Q.active,$e=Q.operationRef,it=Q.showHour,Dt=Q.showMinute,Tt=Q.showSecond,Be=Q.use12Hours,_t=Be===void 0?!1:Be,ot=Q.onSelect,ht=Q.value,wt="".concat(rt,"-time-panel"),It=I.useRef(),vt=I.useState(-1),Xt=Object(K.a)(vt,2),dn=Xt[0],Pn=Xt[1],Gn=Ft([it,Dt,Tt,_t]);return $e.current={onKeyDown:function(Nn){return v(Nn,{onLeftRight:function(Pt){Pn((dn+Pt+Gn)%Gn)},onUpDown:function(Pt){dn===-1?Pn(0):It.current&&It.current.onUpDown(Pt)},onEnter:function(){ot(ht||ce.getNow(),"key"),Pn(-1)}})},onBlur:function(){Pn(-1)}},I.createElement("div",{className:M()(wt,Object(P.a)({},"".concat(wt,"-active"),Re))},I.createElement(O,Object.assign({},Q,{format:Te,prefixCls:rt})),I.createElement(Jt,Object.assign({},Q,{prefixCls:rt,activeColumnIndex:dn,operationRef:It})))}var ze=St,gt=7;function ct(Q,ce){return!Q&&!ce?!0:!Q||!ce?!1:void 0}function jt(Q,ce,Ce){var Te=ct(ce,Ce);if(typeof Te=="boolean")return Te;var rt=Math.floor(Q.getYear(ce)/10),Re=Math.floor(Q.getYear(Ce)/10);return rt===Re}function oe(Q,ce,Ce){var Te=ct(ce,Ce);return typeof Te=="boolean"?Te:Q.getYear(ce)===Q.getYear(Ce)}function Ne(Q,ce){var Ce=Math.floor(Q.getMonth(ce)/3);return Ce+1}function Ge(Q,ce,Ce){var Te=ct(ce,Ce);return typeof Te=="boolean"?Te:oe(Q,ce,Ce)&&Ne(Q,ce)===Ne(Q,Ce)}function Xe(Q,ce,Ce){var Te=ct(ce,Ce);return typeof Te=="boolean"?Te:oe(Q,ce,Ce)&&Q.getMonth(ce)===Q.getMonth(Ce)}function Bt(Q,ce,Ce){var Te=ct(ce,Ce);return typeof Te=="boolean"?Te:Q.getYear(ce)===Q.getYear(Ce)&&Q.getMonth(ce)===Q.getMonth(Ce)&&Q.getDate(ce)===Q.getDate(Ce)}function Wt(Q,ce,Ce){var Te=ct(ce,Ce);return typeof Te=="boolean"?Te:Q.getHour(ce)===Q.getHour(Ce)&&Q.getMinute(ce)===Q.getMinute(Ce)&&Q.getSecond(ce)===Q.getSecond(Ce)}function en(Q,ce,Ce,Te){var rt=ct(Ce,Te);return typeof rt=="boolean"?rt:Q.locale.getWeek(ce,Ce)===Q.locale.getWeek(ce,Te)}function tt(Q,ce,Ce){return Bt(Q,ce,Ce)&&Wt(Q,ce,Ce)}function tn(Q,ce,Ce,Te){return!ce||!Ce||!Te?!1:!Bt(Q,ce,Te)&&!Bt(Q,Ce,Te)&&Q.isAfter(Te,ce)&&Q.isAfter(Ce,Te)}function En(Q,ce,Ce){var Te=ce.locale.getWeekFirstDay(Q),rt=ce.setDate(Ce,1),Re=ce.getWeekDay(rt),$e=ce.addDate(rt,Te-Re);return ce.getMonth($e)===ce.getMonth(Ce)&&ce.getDate($e)>1&&($e=ce.addDate($e,-7)),$e}function We(Q,ce,Ce){var Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ce){case"year":return Ce.addYear(Q,Te*10);case"quarter":case"month":return Ce.addYear(Q,Te);default:return Ce.addMonth(Q,Te)}}var Fe=I.createContext({}),yt=Fe;function At(Q){var ce=Q.cellPrefixCls,Ce=Q.generateConfig,Te=Q.rangedValue,rt=Q.hoverRangedValue,Re=Q.isInView,$e=Q.isSameCell,it=Q.offsetCell,Dt=Q.today,Tt=Q.value;function Be(_t){var ot,ht=it(_t,-1),wt=it(_t,1),It=xe(Te,0),vt=xe(Te,1),Xt=xe(rt,0),dn=xe(rt,1),Pn=tn(Ce,Xt,dn,_t);function Gn(Kt){return $e(It,Kt)}function On(Kt){return $e(vt,Kt)}var Nn=$e(Xt,_t),Mn=$e(dn,_t),Pt=(Pn||Mn)&&(!Re(ht)||On(ht)),hn=(Pn||Nn)&&(!Re(wt)||Gn(wt));return ot={},Object(P.a)(ot,"".concat(ce,"-in-view"),Re(_t)),Object(P.a)(ot,"".concat(ce,"-in-range"),tn(Ce,It,vt,_t)),Object(P.a)(ot,"".concat(ce,"-range-start"),Gn(_t)),Object(P.a)(ot,"".concat(ce,"-range-end"),On(_t)),Object(P.a)(ot,"".concat(ce,"-range-start-single"),Gn(_t)&&!vt),Object(P.a)(ot,"".concat(ce,"-range-end-single"),On(_t)&&!It),Object(P.a)(ot,"".concat(ce,"-range-start-near-hover"),Gn(_t)&&($e(ht,Xt)||tn(Ce,Xt,dn,ht))),Object(P.a)(ot,"".concat(ce,"-range-end-near-hover"),On(_t)&&($e(wt,dn)||tn(Ce,Xt,dn,wt))),Object(P.a)(ot,"".concat(ce,"-range-hover"),Pn),Object(P.a)(ot,"".concat(ce,"-range-hover-start"),Nn),Object(P.a)(ot,"".concat(ce,"-range-hover-end"),Mn),Object(P.a)(ot,"".concat(ce,"-range-hover-edge-start"),Pt),Object(P.a)(ot,"".concat(ce,"-range-hover-edge-end"),hn),Object(P.a)(ot,"".concat(ce,"-range-hover-edge-start-near-range"),Pt&&$e(ht,vt)),Object(P.a)(ot,"".concat(ce,"-range-hover-edge-end-near-range"),hn&&$e(wt,It)),Object(P.a)(ot,"".concat(ce,"-today"),$e(Dt,_t)),Object(P.a)(ot,"".concat(ce,"-selected"),$e(Tt,_t)),ot}return Be}function nt(Q){for(var ce=Q.prefixCls,Ce=Q.disabledDate,Te=Q.onSelect,rt=Q.rowNum,Re=Q.colNum,$e=Q.prefixColumn,it=Q.rowClassName,Dt=Q.baseDate,Tt=Q.getCellClassName,Be=Q.getCellText,_t=Q.getCellNode,ot=Q.getCellDate,ht=Q.titleCell,wt=Q.headerCells,It=I.useContext(o),vt=It.onDateMouseEnter,Xt=It.onDateMouseLeave,dn="".concat(ce,"-cell"),Pn=[],Gn=0;Gn<rt;Gn+=1){for(var On=[],Nn=void 0,Mn=function(Kt){var Rt=Gn*Re+Kt,Un=ot(Dt,Rt),Rn=Ce&&Ce(Un);Kt===0&&(Nn=Un,$e&&On.push($e(Nn))),On.push(I.createElement("td",{key:Kt,title:ht&&ht(Un),className:M()(dn,Object(k.a)(Object(P.a)({},"".concat(dn,"-disabled"),Rn),Tt(Un))),onClick:function(){Rn||Te(Un)},onMouseEnter:function(){!Rn&&vt&&vt(Un)},onMouseLeave:function(){!Rn&&Xt&&Xt(Un)}},_t?_t(Un):I.createElement("div",{className:"".concat(dn,"-inner")},Be(Un))))},Pt=0;Pt<Re;Pt+=1)Mn(Pt);Pn.push(I.createElement("tr",{key:Gn,className:it&&it(Nn)},On))}return I.createElement("div",{className:"".concat(ce,"-body")},I.createElement("table",{className:"".concat(ce,"-content")},wt&&I.createElement("thead",null,I.createElement("tr",null,wt)),I.createElement("tbody",null,Pn)))}function st(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.prefixColumn,rt=Q.locale,Re=Q.rowCount,$e=Q.viewDate,it=Q.value,Dt=Q.dateRender,Tt=I.useContext(yt),Be=Tt.rangedValue,_t=Tt.hoverRangedValue,ot=En(rt.locale,Ce,$e),ht="".concat(ce,"-cell"),wt=Ce.locale.getWeekFirstDay(rt.locale),It=Ce.getNow(),vt=[],Xt=rt.shortWeekDays||(Ce.locale.getShortWeekDays?Ce.locale.getShortWeekDays(rt.locale):[]);Te&&vt.push(I.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var dn=0;dn<gt;dn+=1)vt.push(I.createElement("th",{key:dn},Xt[(dn+wt)%gt]));var Pn=At({cellPrefixCls:ht,today:It,value:it,generateConfig:Ce,rangedValue:Te?null:Be,hoverRangedValue:Te?null:_t,isSameCell:function(Nn,Mn){return Bt(Ce,Nn,Mn)},isInView:function(Nn){return Xe(Ce,Nn,$e)},offsetCell:function(Nn,Mn){return Ce.addDate(Nn,Mn)}}),Gn=Dt?function(On){return Dt(On,It)}:void 0;return I.createElement(nt,Object.assign({},Q,{rowNum:Re,colNum:gt,baseDate:ot,getCellNode:Gn,getCellText:Ce.getDate,getCellClassName:Pn,getCellDate:Ce.addDate,titleCell:function(Nn){return Ce.locale.format(rt.locale,Nn,"YYYY-MM-DD")},headerCells:vt}))}var De=st;function ye(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.viewDate,Re=Q.onNextMonth,$e=Q.onPrevMonth,it=Q.onNextYear,Dt=Q.onPrevYear,Tt=Q.onYearClick,Be=Q.onMonthClick,_t=I.useContext(o),ot=_t.hideHeader;if(ot)return null;var ht="".concat(ce,"-header"),wt=Te.shortMonths||(Ce.locale.getShortMonths?Ce.locale.getShortMonths(Te.locale):[]),It=Ce.getMonth(rt),vt=I.createElement("button",{type:"button",key:"year",onClick:Tt,tabIndex:-1,className:"".concat(ce,"-year-btn")},Ce.locale.format(Te.locale,rt,Te.yearFormat)),Xt=I.createElement("button",{type:"button",key:"month",onClick:Be,tabIndex:-1,className:"".concat(ce,"-month-btn")},Te.monthFormat?Ce.locale.format(Te.locale,rt,Te.monthFormat):wt[It]),dn=Te.monthBeforeYear?[Xt,vt]:[vt,Xt];return I.createElement(i,Object.assign({},Q,{prefixCls:ht,onSuperPrev:Dt,onPrev:$e,onNext:Re,onSuperNext:it}),dn)}var we=ye,ae=6;function se(Q){var ce=Q.prefixCls,Ce=Q.panelName,Te=Ce===void 0?"date":Ce,rt=Q.keyboardConfig,Re=Q.active,$e=Q.operationRef,it=Q.generateConfig,Dt=Q.value,Tt=Q.viewDate,Be=Q.onViewDateChange,_t=Q.onPanelChange,ot=Q.onSelect,ht="".concat(ce,"-").concat(Te,"-panel");$e.current={onKeyDown:function(Xt){return v(Xt,Object(k.a)({onLeftRight:function(Pn){ot(it.addDate(Dt||Tt,Pn),"key")},onCtrlLeftRight:function(Pn){ot(it.addYear(Dt||Tt,Pn),"key")},onUpDown:function(Pn){ot(it.addDate(Dt||Tt,Pn*gt),"key")},onPageUpDown:function(Pn){ot(it.addMonth(Dt||Tt,Pn),"key")}},rt))}};var wt=function(Xt){var dn=it.addYear(Tt,Xt);Be(dn),_t(null,dn)},It=function(Xt){var dn=it.addMonth(Tt,Xt);Be(dn),_t(null,dn)};return I.createElement("div",{className:M()(ht,Object(P.a)({},"".concat(ht,"-active"),Re))},I.createElement(we,Object.assign({},Q,{prefixCls:ce,value:Dt,viewDate:Tt,onPrevYear:function(){wt(-1)},onNextYear:function(){wt(1)},onPrevMonth:function(){It(-1)},onNextMonth:function(){It(1)},onMonthClick:function(){_t("month",Tt)},onYearClick:function(){_t("year",Tt)}})),I.createElement(De,Object.assign({},Q,{onSelect:function(Xt){return ot(Xt,"mouse")},prefixCls:ce,value:Dt,viewDate:Tt,rowCount:ae})))}var pe=se;function _e(Q,ce,Ce){if(!Ce)return ce;var Te=ce;return Te=Q.setHour(Te,Q.getHour(Ce)),Te=Q.setMinute(Te,Q.getMinute(Ce)),Te=Q.setSecond(Te,Q.getSecond(Ce)),Te}var be=ie("date","time");function Ke(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.generateConfig,rt=Q.value,Re=Q.defaultValue,$e=Q.disabledTime,it=Q.showTime,Dt=Q.onSelect,Tt="".concat(ce,"-datetime-panel"),Be=I.useState(null),_t=Object(K.a)(Be,2),ot=_t[0],ht=_t[1],wt=I.useRef({}),It=I.useRef({}),vt=Object(m.a)(it)==="object"?Object(k.a)({},it):{};function Xt(On){var Nn=be.indexOf(ot)+On,Mn=be[Nn]||null;return Mn}var dn=function(Nn){It.current.onBlur&&It.current.onBlur(Nn),ht(null)};Ce.current={onKeyDown:function(Nn){if(Nn.which===u.a.TAB){var Mn=Xt(Nn.shiftKey?-1:1);return ht(Mn),Mn&&Nn.preventDefault(),!0}if(ot){var Pt=ot==="date"?wt:It;return Pt.current&&Pt.current.onKeyDown&&Pt.current.onKeyDown(Nn),!0}return[u.a.LEFT,u.a.RIGHT,u.a.UP,u.a.DOWN].includes(Nn.which)?(ht("date"),!0):!1},onBlur:dn,onClose:dn};var Pn=function(Nn,Mn){var Pt=Nn;Mn==="date"&&!rt&&vt.defaultValue?(Pt=Te.setHour(Pt,Te.getHour(vt.defaultValue)),Pt=Te.setMinute(Pt,Te.getMinute(vt.defaultValue)),Pt=Te.setSecond(Pt,Te.getSecond(vt.defaultValue))):Mn==="time"&&!rt&&Re&&(Pt=Te.setYear(Pt,Te.getYear(Re)),Pt=Te.setMonth(Pt,Te.getMonth(Re)),Pt=Te.setDate(Pt,Te.getDate(Re))),Dt&&Dt(Pt,"mouse")},Gn=$e?$e(rt||null):{};return I.createElement("div",{className:M()(Tt,Object(P.a)({},"".concat(Tt,"-active"),ot))},I.createElement(pe,Object.assign({},Q,{operationRef:wt,active:ot==="date",onSelect:function(Nn){Pn(_e(Te,Nn,it&&Object(m.a)(it)==="object"?it.defaultValue:null),"date")}})),I.createElement(ze,Object.assign({},Q,{format:void 0},vt,Gn,{defaultValue:void 0,operationRef:It,active:ot==="time",onSelect:function(Nn){Pn(Nn,"time")}})))}var Ot=Ke;function rn(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.value,Re="".concat(ce,"-cell"),$e=function(Be){return I.createElement("td",{key:"week",className:M()(Re,"".concat(Re,"-week"))},Ce.locale.getWeek(Te.locale,Be))},it="".concat(ce,"-week-panel-row"),Dt=function(Be){return M()(it,Object(P.a)({},"".concat(it,"-selected"),en(Ce,Te.locale,rt,Be)))};return I.createElement(pe,Object.assign({},Q,{panelName:"week",prefixColumn:$e,rowClassName:Dt,keyboardConfig:{onLeftRight:null}}))}var Dn=rn;function bt(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.viewDate,Re=Q.onNextYear,$e=Q.onPrevYear,it=Q.onYearClick,Dt=I.useContext(o),Tt=Dt.hideHeader;if(Tt)return null;var Be="".concat(ce,"-header");return I.createElement(i,Object.assign({},Q,{prefixCls:Be,onSuperPrev:$e,onSuperNext:Re}),I.createElement("button",{type:"button",onClick:it,className:"".concat(ce,"-year-btn")},Ce.locale.format(Te.locale,rt,Te.yearFormat)))}var Qt=bt,Et=3,Ct=4;function lt(Q){var ce=Q.prefixCls,Ce=Q.locale,Te=Q.value,rt=Q.viewDate,Re=Q.generateConfig,$e=Q.monthCellRender,it=I.useContext(yt),Dt=it.rangedValue,Tt=it.hoverRangedValue,Be="".concat(ce,"-cell"),_t=At({cellPrefixCls:Be,value:Te,generateConfig:Re,rangedValue:Dt,hoverRangedValue:Tt,isSameCell:function(vt,Xt){return Xe(Re,vt,Xt)},isInView:function(){return!0},offsetCell:function(vt,Xt){return Re.addMonth(vt,Xt)}}),ot=Ce.shortMonths||(Re.locale.getShortMonths?Re.locale.getShortMonths(Ce.locale):[]),ht=Re.setMonth(rt,0),wt=$e?function(It){return $e(It,Ce)}:void 0;return I.createElement(nt,Object.assign({},Q,{rowNum:Ct,colNum:Et,baseDate:ht,getCellNode:wt,getCellText:function(vt){return Ce.monthFormat?Re.locale.format(Ce.locale,vt,Ce.monthFormat):ot[Re.getMonth(vt)]},getCellClassName:_t,getCellDate:Re.addMonth,titleCell:function(vt){return Re.locale.format(Ce.locale,vt,"YYYY-MM")}}))}var de=lt;function Ae(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.onViewDateChange,rt=Q.generateConfig,Re=Q.value,$e=Q.viewDate,it=Q.onPanelChange,Dt=Q.onSelect,Tt="".concat(ce,"-month-panel");Ce.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(wt){Dt(rt.addMonth(Re||$e,wt),"key")},onCtrlLeftRight:function(wt){Dt(rt.addYear(Re||$e,wt),"key")},onUpDown:function(wt){Dt(rt.addMonth(Re||$e,wt*Et),"key")},onEnter:function(){it("date",Re||$e)}})}};var Be=function(ot){var ht=rt.addYear($e,ot);Te(ht),it(null,ht)};return I.createElement("div",{className:Tt},I.createElement(Qt,Object.assign({},Q,{prefixCls:ce,onPrevYear:function(){Be(-1)},onNextYear:function(){Be(1)},onYearClick:function(){it("year",$e)}})),I.createElement(de,Object.assign({},Q,{prefixCls:ce,onSelect:function(ot){Dt(ot,"mouse"),it("date",ot)}})))}var kt=Ae;function dt(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.viewDate,Re=Q.onNextYear,$e=Q.onPrevYear,it=Q.onYearClick,Dt=I.useContext(o),Tt=Dt.hideHeader;if(Tt)return null;var Be="".concat(ce,"-header");return I.createElement(i,Object.assign({},Q,{prefixCls:Be,onSuperPrev:$e,onSuperNext:Re}),I.createElement("button",{type:"button",onClick:it,className:"".concat(ce,"-year-btn")},Ce.locale.format(Te.locale,rt,Te.yearFormat)))}var Zt=dt,un=4,Le=1;function et(Q){var ce=Q.prefixCls,Ce=Q.locale,Te=Q.value,rt=Q.viewDate,Re=Q.generateConfig,$e=I.useContext(yt),it=$e.rangedValue,Dt=$e.hoverRangedValue,Tt="".concat(ce,"-cell"),Be=At({cellPrefixCls:Tt,value:Te,generateConfig:Re,rangedValue:it,hoverRangedValue:Dt,isSameCell:function(ht,wt){return Ge(Re,ht,wt)},isInView:function(){return!0},offsetCell:function(ht,wt){return Re.addMonth(ht,wt*3)}}),_t=Re.setDate(Re.setMonth(rt,0),1);return I.createElement(nt,Object.assign({},Q,{rowNum:Le,colNum:un,baseDate:_t,getCellText:function(ht){return Re.locale.format(Ce.locale,ht,Ce.quarterFormat||"[Q]Q")},getCellClassName:Be,getCellDate:function(ht,wt){return Re.addMonth(ht,wt*3)},titleCell:function(ht){return Re.locale.format(Ce.locale,ht,"YYYY-[Q]Q")}}))}var mt=et;function Ht(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.onViewDateChange,rt=Q.generateConfig,Re=Q.value,$e=Q.viewDate,it=Q.onPanelChange,Dt=Q.onSelect,Tt="".concat(ce,"-quarter-panel");Ce.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(wt){Dt(rt.addMonth(Re||$e,wt*3),"key")},onCtrlLeftRight:function(wt){Dt(rt.addYear(Re||$e,wt),"key")},onUpDown:function(wt){Dt(rt.addYear(Re||$e,wt),"key")}})}};var Be=function(ot){var ht=rt.addYear($e,ot);Te(ht),it(null,ht)};return I.createElement("div",{className:Tt},I.createElement(Zt,Object.assign({},Q,{prefixCls:ce,onPrevYear:function(){Be(-1)},onNextYear:function(){Be(1)},onYearClick:function(){it("year",$e)}})),I.createElement(mt,Object.assign({},Q,{prefixCls:ce,onSelect:function(ot){Dt(ot,"mouse")}})))}var sn=Ht;function yn(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.viewDate,rt=Q.onPrevDecade,Re=Q.onNextDecade,$e=Q.onDecadeClick,it=I.useContext(o),Dt=it.hideHeader;if(Dt)return null;var Tt="".concat(ce,"-header"),Be=Ce.getYear(Te),_t=Math.floor(Be/rr)*rr,ot=_t+rr-1;return I.createElement(i,Object.assign({},Q,{prefixCls:Tt,onSuperPrev:rt,onSuperNext:Re}),I.createElement("button",{type:"button",onClick:$e,className:"".concat(ce,"-decade-btn")},_t,"-",ot))}var nr=yn,Kn=3,Cn=4;function br(Q){var ce=Q.prefixCls,Ce=Q.value,Te=Q.viewDate,rt=Q.locale,Re=Q.generateConfig,$e=I.useContext(yt),it=$e.rangedValue,Dt=$e.hoverRangedValue,Tt="".concat(ce,"-cell"),Be=Re.getYear(Te),_t=Math.floor(Be/rr)*rr,ot=_t+rr-1,ht=Re.setYear(Te,_t-Math.ceil((Kn*Cn-rr)/2)),wt=function(Xt){var dn=Re.getYear(Xt);return _t<=dn&&dn<=ot},It=At({cellPrefixCls:Tt,value:Ce,generateConfig:Re,rangedValue:it,hoverRangedValue:Dt,isSameCell:function(Xt,dn){return oe(Re,Xt,dn)},isInView:wt,offsetCell:function(Xt,dn){return Re.addYear(Xt,dn)}});return I.createElement(nt,Object.assign({},Q,{rowNum:Cn,colNum:Kn,baseDate:ht,getCellText:Re.getYear,getCellClassName:It,getCellDate:Re.addYear,titleCell:function(Xt){return Re.locale.format(rt.locale,Xt,"YYYY")}}))}var Er=br,rr=10;function cr(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.onViewDateChange,rt=Q.generateConfig,Re=Q.value,$e=Q.viewDate,it=Q.sourceMode,Dt=Q.onSelect,Tt=Q.onPanelChange,Be="".concat(ce,"-year-panel");Ce.current={onKeyDown:function(ht){return v(ht,{onLeftRight:function(It){Dt(rt.addYear(Re||$e,It),"key")},onCtrlLeftRight:function(It){Dt(rt.addYear(Re||$e,It*rr),"key")},onUpDown:function(It){Dt(rt.addYear(Re||$e,It*Kn),"key")},onEnter:function(){Tt(it==="date"?"date":"month",Re||$e)}})}};var _t=function(ht){var wt=rt.addYear($e,ht*10);Te(wt),Tt(null,wt)};return I.createElement("div",{className:Be},I.createElement(nr,Object.assign({},Q,{prefixCls:ce,onPrevDecade:function(){_t(-1)},onNextDecade:function(){_t(1)},onDecadeClick:function(){Tt("decade",$e)}})),I.createElement(Er,Object.assign({},Q,{prefixCls:ce,onSelect:function(ht){Tt(it==="date"?"date":"month",ht),Dt(ht,"mouse")}})))}var Pr=cr;function Kr(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.viewDate,rt=Q.onPrevDecades,Re=Q.onNextDecades,$e=I.useContext(o),it=$e.hideHeader;if(it)return null;var Dt="".concat(ce,"-header"),Tt=Ce.getYear(Te),Be=Math.floor(Tt/ni)*ni,_t=Be+ni-1;return I.createElement(i,Object.assign({},Q,{prefixCls:Dt,onSuperPrev:rt,onSuperNext:Re}),Be,"-",_t)}var hi=Kr,pn=3,or=4;function mi(Q){var ce=ti-1,Ce=Q.prefixCls,Te=Q.viewDate,rt=Q.generateConfig,Re=Q.disabledDate,$e="".concat(Ce,"-cell"),it=rt.getYear(Te),Dt=Math.floor(it/ti)*ti,Tt=Math.floor(it/ni)*ni,Be=Tt+ni-1,_t=rt.setYear(Te,Tt-Math.ceil((pn*or*ti-ni)/2)),ot=function(wt){var It,vt=Re&&Re(wt),Xt=rt.getYear(wt),dn=Xt+ce;return It={},Object(P.a)(It,"".concat($e,"-disabled"),vt),Object(P.a)(It,"".concat($e,"-in-view"),Tt<=Xt&&dn<=Be),Object(P.a)(It,"".concat($e,"-selected"),Xt===Dt),It};return I.createElement(nt,Object.assign({},Q,{rowNum:or,colNum:pn,baseDate:_t,getCellText:function(wt){var It=rt.getYear(wt);return"".concat(It,"-").concat(It+ce)},getCellClassName:ot,getCellDate:function(wt,It){return rt.addYear(wt,It*ti)}}))}var wi=mi,ti=10,ni=ti*10;function X(Q){var ce=Q.prefixCls,Ce=Q.onViewDateChange,Te=Q.generateConfig,rt=Q.viewDate,Re=Q.operationRef,$e=Q.onSelect,it=Q.onPanelChange,Dt="".concat(ce,"-decade-panel");Re.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(wt){$e(Te.addYear(rt,wt*ti),"key")},onCtrlLeftRight:function(wt){$e(Te.addYear(rt,wt*ni),"key")},onUpDown:function(wt){$e(Te.addYear(rt,wt*ti*pn),"key")},onEnter:function(){it("year",rt)}})}};var Tt=function(ot){var ht=Te.addYear(rt,ot*ni);Ce(ht),it(null,ht)},Be=function(ot){$e(ot,"mouse"),it("year",ot)};return I.createElement("div",{className:Dt},I.createElement(hi,Object.assign({},Q,{prefixCls:ce,onPrevDecades:function(){Tt(-1)},onNextDecades:function(){Tt(1)}})),I.createElement(wi,Object.assign({},Q,{prefixCls:ce,onSelect:Be})))}var L=X;function N(Q,ce,Ce){return Ce?I.createElement("div",{className:"".concat(Q,"-footer-extra")},Ce(ce)):null}function z(Q){var ce=Q.prefixCls,Ce=Q.rangeList,Te=Ce===void 0?[]:Ce,rt=Q.components,Re=rt===void 0?{}:rt,$e=Q.needConfirmButton,it=Q.onNow,Dt=Q.onOk,Tt=Q.okDisabled,Be=Q.showNow,_t=Q.locale,ot,ht;if(Te.length){var wt=Re.rangeItem||"span";ot=I.createElement(I.Fragment,null,Te.map(function(vt){var Xt=vt.label,dn=vt.onClick,Pn=vt.onMouseEnter,Gn=vt.onMouseLeave;return I.createElement("li",{key:Xt,className:"".concat(ce,"-preset")},I.createElement(wt,{onClick:dn,onMouseEnter:Pn,onMouseLeave:Gn},Xt))}))}if($e){var It=Re.button||"button";it&&!ot&&Be!==!1&&(ot=I.createElement("li",{className:"".concat(ce,"-now")},I.createElement("a",{className:"".concat(ce,"-now-btn"),onClick:it},_t.now))),ht=$e&&I.createElement("li",{className:"".concat(ce,"-ok")},I.createElement(It,{disabled:Tt,onClick:Dt},_t.ok))}return!ot&&!ht?null:I.createElement("ul",{className:"".concat(ce,"-ranges")},ot,ht)}function ne(Q){var ce,Ce=Q.prefixCls,Te=Ce===void 0?"rc-picker":Ce,rt=Q.className,Re=Q.style,$e=Q.locale,it=Q.generateConfig,Dt=Q.value,Tt=Q.defaultValue,Be=Q.pickerValue,_t=Q.defaultPickerValue,ot=Q.disabledDate,ht=Q.mode,wt=Q.picker,It=wt===void 0?"date":wt,vt=Q.tabIndex,Xt=vt===void 0?0:vt,dn=Q.showNow,Pn=Q.showTime,Gn=Q.showToday,On=Q.renderExtraFooter,Nn=Q.hideHeader,Mn=Q.onSelect,Pt=Q.onChange,hn=Q.onPanelChange,Kt=Q.onMouseDown,Rt=Q.onPickerValueChange,Un=Q.onOk,Rn=Q.components,Yt=Q.direction,ft=Q.hourStep,jn=ft===void 0?1:ft,fn=Q.minuteStep,Qn=fn===void 0?1:fn,qt=Q.secondStep,An=qt===void 0?1:qt,Fn=It==="date"&&!!Pn||It==="time",vn=24%jn===0,yr=60%Qn===0,Ln=60%An===0,wn=I.useContext(o),Lt=wn.operationRef,Ze=wn.panelRef,Nt=wn.onSelect,Mt=wn.hideRanges,cn=wn.defaultOpenValue,zn=I.useContext(yt),kn=zn.inRange,lr=zn.panelPosition,er=zn.rangedValue,Rr=zn.hoverRangedValue,mr=I.useRef({}),xr=I.useRef(!0),Zr=Object(p.a)(null,{value:Dt,defaultValue:Tt,postState:function(zt){return!zt&&cn&&It==="time"?cn:zt}}),Yr=Object(K.a)(Zr,2),Jr=Yr[0],vi=Yr[1],_i=Object(p.a)(null,{value:Be,defaultValue:_t||Jr,postState:function(zt){return zt||it.getNow()}}),Ee=Object(K.a)(_i,2),Ue=Ee[0],Ve=Ee[1],Se=function(zt){Ve(zt),Rt&&Rt(zt)},re=function(zt){var Vt=H[It];return Vt?Vt(zt):zt},me=Object(p.a)(function(){return It==="time"?"time":re("date")},{value:ht}),ue=Object(K.a)(me,2),Oe=ue[0],Pe=ue[1];I.useEffect(function(){Pe(It)},[It]);var qe=I.useState(function(){return Oe}),Ie=Object(K.a)(qe,2),ut=Ie[0],Ut=Ie[1],an=function(zt,Vt){var pr=re(zt||Oe);Ut(Oe),Pe(pr),hn&&(Oe!==pr||tt(it,Ue,Ue))&&hn(Vt,pr)},mn=function(zt,Vt){var pr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Oe===It||pr)&&(vi(zt),Mn&&Mn(zt),Nt&&Nt(zt,Vt),Pt&&!tt(it,zt,Jr)&&Pt(zt))},Hn=function(zt){return mr.current&&mr.current.onKeyDown?([u.a.LEFT,u.a.RIGHT,u.a.UP,u.a.DOWN,u.a.PAGE_UP,u.a.PAGE_DOWN,u.a.ENTER].includes(zt.which)&&zt.preventDefault(),mr.current.onKeyDown(zt)):(Object(_.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Vn=function(zt){mr.current&&mr.current.onBlur&&mr.current.onBlur(zt)};Lt&&lr!=="right"&&(Lt.current={onKeyDown:Hn,onClose:function(){mr.current&&mr.current.onClose&&mr.current.onClose()}}),I.useEffect(function(){Dt&&!xr.current&&Ve(Dt)},[Dt]),I.useEffect(function(){xr.current=!1},[]);var fr,dr=Object(k.a)(Object(k.a)({},Q),{},{operationRef:mr,prefixCls:Te,viewDate:Ue,value:Jr,onViewDateChange:Se,sourceMode:ut,onPanelChange:an,disabledDate:Oe!=="decade"?ot:void 0});delete dr.onChange,delete dr.onSelect;switch(Oe){case"decade":fr=I.createElement(L,Object.assign({},dr,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}}));break;case"year":fr=I.createElement(Pr,Object.assign({},dr,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}}));break;case"month":fr=I.createElement(kt,Object.assign({},dr,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}}));break;case"quarter":fr=I.createElement(sn,Object.assign({},dr,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}}));break;case"week":fr=I.createElement(Dn,Object.assign({},dr,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}}));break;case"time":delete dr.showTime,fr=I.createElement(ze,Object.assign({},dr,Object(m.a)(Pn)==="object"?Pn:null,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}}));break;default:Pn?fr=I.createElement(Ot,Object.assign({},dr,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}})):fr=I.createElement(pe,Object.assign({},dr,{onSelect:function(zt,Vt){Se(zt),mn(zt,Vt)}}))}var wr,Ar,gr=function(){var zt=it.getNow(),Vt=Ye(it.getHour(zt),it.getMinute(zt),it.getSecond(zt),vn?jn:1,yr?Qn:1,Ln?An:1),pr=Qe(it,zt,Vt[0],Vt[1],Vt[2]);mn(pr,"submit")};Mt||(wr=N(Te,Oe,On),Ar=z({prefixCls:Te,components:Rn,needConfirmButton:Fn,okDisabled:!Jr||ot&&ot(Jr),locale:$e,showNow:dn,onNow:Fn&&gr,onOk:function(){Jr&&(mn(Jr,"submit",!0),Un&&Un(Jr))}}));var Cr;if(Gn&&Oe==="date"&&It==="date"&&!Pn){var Lr=it.getNow(),gn="".concat(Te,"-today-btn"),nn=ot&&ot(Lr);Cr=I.createElement("a",{className:M()(gn,nn&&"".concat(gn,"-disabled")),"aria-disabled":nn,onClick:function(){nn||mn(Lr,"mouse",!0)}},$e.today)}return I.createElement(o.Provider,{value:Object(k.a)(Object(k.a)({},wn),{},{hideHeader:"hideHeader"in Q?Nn:wn.hideHeader,hidePrevBtn:kn&&lr==="right",hideNextBtn:kn&&lr==="left"})},I.createElement("div",{tabIndex:Xt,className:M()("".concat(Te,"-panel"),rt,(ce={},Object(P.a)(ce,"".concat(Te,"-panel-has-range"),er&&er[0]&&er[1]),Object(P.a)(ce,"".concat(Te,"-panel-has-range-hover"),Rr&&Rr[0]&&Rr[1]),Object(P.a)(ce,"".concat(Te,"-panel-rtl"),Yt==="rtl"),ce)),style:Re,onKeyDown:Hn,onBlur:Vn,onMouseDown:Kt,ref:Ze},fr,wr||Ar||Cr?I.createElement("div",{className:"".concat(Te,"-footer")},wr,Ar,Cr):null))}var J=ne,je=D("uciX"),$t={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function In(Q){var ce,Ce=Q.prefixCls,Te=Q.popupElement,rt=Q.popupStyle,Re=Q.visible,$e=Q.dropdownClassName,it=Q.dropdownAlign,Dt=Q.transitionName,Tt=Q.getPopupContainer,Be=Q.children,_t=Q.range,ot=Q.popupPlacement,ht=Q.direction,wt="".concat(Ce,"-dropdown"),It=function(){return ot!==void 0?ot:ht==="rtl"?"bottomRight":"bottomLeft"};return I.createElement(je.a,{showAction:[],hideAction:[],popupPlacement:It(),builtinPlacements:$t,prefixCls:wt,popupTransitionName:Dt,popup:Te,popupAlign:it,popupVisible:Re,popupClassName:M()($e,(ce={},Object(P.a)(ce,"".concat(wt,"-range"),_t),Object(P.a)(ce,"".concat(wt,"-rtl"),ht==="rtl"),ce)),popupStyle:rt,getPopupContainer:Tt},Be)}var Jn=In;function ln(Q){var ce=Q.open,Ce=Q.value,Te=Q.isClickOutside,rt=Q.triggerOpen,Re=Q.forwardKeyDown,$e=Q.blurToCancel,it=Q.onSubmit,Dt=Q.onCancel,Tt=Q.onFocus,Be=Q.onBlur,_t=Object(I.useState)(!1),ot=Object(K.a)(_t,2),ht=ot[0],wt=ot[1],It=Object(I.useState)(!1),vt=Object(K.a)(It,2),Xt=vt[0],dn=vt[1],Pn=Object(I.useRef)(!1),Gn=Object(I.useRef)(!1),On={onMouseDown:function(){wt(!0),rt(!0)},onKeyDown:function(Mn){switch(Mn.which){case u.a.ENTER:{ce?it()!==!1&&wt(!0):rt(!0),Mn.preventDefault();return}case u.a.TAB:{ht&&ce&&!Mn.shiftKey?(wt(!1),Mn.preventDefault()):!ht&&ce&&(!Re(Mn)&&Mn.shiftKey&&(wt(!0),Mn.preventDefault()));return}case u.a.ESC:{wt(!0),Dt();return}}!ce&&![u.a.SHIFT].includes(Mn.which)?rt(!0):ht||Re(Mn)},onFocus:function(Mn){wt(!0),dn(!0),Tt&&Tt(Mn)},onBlur:function(Mn){if(Pn.current||!Te(document.activeElement)){Pn.current=!1;return}$e?setTimeout(function(){Te(document.activeElement)&&Dt()},0):ce&&(rt(!1),Gn.current&&it()),dn(!1),Be&&Be(Mn)}};return Object(I.useEffect)(function(){Gn.current=!1},[ce]),Object(I.useEffect)(function(){Gn.current=!0},[Ce]),Object(I.useEffect)(function(){return g(function(Nn){var Mn=Nn.target;ce&&(Te(Mn)?Xt||rt(!1):(Pn.current=!0,requestAnimationFrame(function(){Pn.current=!1})))})}),[On,{focused:Xt,typing:ht}]}function tr(Q){var ce=Q.valueTexts,Ce=Q.onTextChange,Te=I.useState(""),rt=Object(K.a)(Te,2),Re=rt[0],$e=rt[1],it=I.useRef([]);it.current=ce;function Dt(Be){$e(Be),Ce(Be)}function Tt(){$e(it.current[0])}return I.useEffect(function(){ce.every(function(Be){return Be!==Re})&&Tt()},[ce.join("||")]),[Re,Dt,Tt]}var qn=D("Gytx"),kr=D.n(qn);function li(Q,ce){var Ce=ce.formatList,Te=ce.generateConfig,rt=ce.locale;return Object(T.a)(function(){if(!Q)return[[""],""];for(var Re="",$e=[],it=0;it<Ce.length;it+=1){var Dt=Ce[it],Tt=Te.locale.format(rt.locale,Q,Dt);$e.push(Tt),it===0&&(Re=Tt)}return[$e,Re]},[Q,Ce],function(Re,$e){return Re[0]!==$e[0]||!kr()(Re[1],$e[1])})}function ai(Q,ce){var Ce=ce.formatList,Te=ce.generateConfig,rt=ce.locale,Re=Object(I.useState)(null),$e=Object(K.a)(Re,2),it=$e[0],Dt=$e[1],Tt=Object(I.useRef)(null);function Be(vt){var Xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Tt.current),Xt){Dt(vt);return}Tt.current=requestAnimationFrame(function(){Dt(vt)})}var _t=li(it,{formatList:Ce,generateConfig:Te,locale:rt}),ot=Object(K.a)(_t,2),ht=ot[1];function wt(vt){Be(vt)}function It(){var vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Be(null,vt)}return Object(I.useEffect)(function(){It(!0)},[Q]),Object(I.useEffect)(function(){return function(){return cancelAnimationFrame(Tt.current)}},[]),[ht,wt,It]}function Gr(Q){var ce,Ce=Q.prefixCls,Te=Ce===void 0?"rc-picker":Ce,rt=Q.id,Re=Q.tabIndex,$e=Q.style,it=Q.className,Dt=Q.dropdownClassName,Tt=Q.dropdownAlign,Be=Q.popupStyle,_t=Q.transitionName,ot=Q.generateConfig,ht=Q.locale,wt=Q.inputReadOnly,It=Q.allowClear,vt=Q.autoFocus,Xt=Q.showTime,dn=Q.picker,Pn=dn===void 0?"date":dn,Gn=Q.format,On=Q.use12Hours,Nn=Q.value,Mn=Q.defaultValue,Pt=Q.open,hn=Q.defaultOpen,Kt=Q.defaultOpenValue,Rt=Q.suffixIcon,Un=Q.clearIcon,Rn=Q.disabled,Yt=Q.disabledDate,ft=Q.placeholder,jn=Q.getPopupContainer,fn=Q.pickerRef,Qn=Q.panelRender,qt=Q.onChange,An=Q.onOpenChange,Fn=Q.onFocus,vn=Q.onBlur,yr=Q.onMouseDown,Ln=Q.onMouseUp,wn=Q.onMouseEnter,Lt=Q.onMouseLeave,Ze=Q.onContextMenu,Nt=Q.onClick,Mt=Q.direction,cn=Q.autoComplete,zn=cn===void 0?"off":cn,kn=I.useRef(null),lr=Pn==="date"&&!!Xt||Pn==="time",er=ge(E(Gn,Pn,Xt,On)),Rr=I.useRef(null),mr=I.useRef(null),xr=Object(p.a)(null,{value:Nn,defaultValue:Mn}),Zr=Object(K.a)(xr,2),Yr=Zr[0],Jr=Zr[1],vi=I.useState(Yr),_i=Object(K.a)(vi,2),Ee=_i[0],Ue=_i[1],Ve=I.useRef(null),Se=Object(p.a)(!1,{value:Pt,defaultValue:hn,postState:function(vr){return Rn?!1:vr},onChange:function(vr){An&&An(vr),!vr&&Ve.current&&Ve.current.onClose&&Ve.current.onClose()}}),re=Object(K.a)(Se,2),me=re[0],ue=re[1],Oe=li(Ee,{formatList:er,generateConfig:ot,locale:ht}),Pe=Object(K.a)(Oe,2),qe=Pe[0],Ie=Pe[1],ut=tr({valueTexts:qe,onTextChange:function(vr){var yi=ot.locale.parse(ht.locale,vr,er);yi&&(!Yt||!Yt(yi))&&Ue(yi)}}),Ut=Object(K.a)(ut,3),an=Ut[0],mn=Ut[1],Hn=Ut[2],Vn=function(vr){Ue(vr),Jr(vr),qt&&!tt(ot,Yr,vr)&&qt(vr,vr?ot.locale.format(ht.locale,vr,er[0]):"")},fr=function(vr){if(Rn&&vr)return;ue(vr)},dr=function(vr){return me&&Ve.current&&Ve.current.onKeyDown?Ve.current.onKeyDown(vr):(Object(_.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},wr=function(){Ln&&Ln.apply(void 0,arguments),kn.current&&(kn.current.focus(),fr(!0))},Ar=ln({blurToCancel:lr,open:me,value:an,triggerOpen:fr,forwardKeyDown:dr,isClickOutside:function(vr){return!F([Rr.current,mr.current],vr)},onSubmit:function(){return Yt&&Yt(Ee)?!1:(Vn(Ee),fr(!1),Hn(),!0)},onCancel:function(){fr(!1),Ue(Yr),Hn()},onFocus:Fn,onBlur:vn}),gr=Object(K.a)(Ar,2),Cr=gr[0],Lr=gr[1],gn=Lr.focused,nn=Lr.typing;I.useEffect(function(){me||(Ue(Yr),!qe.length||qe[0]===""?mn(""):Ie!==an&&Hn())},[me,qe]),I.useEffect(function(){me||Hn()},[Pn]),I.useEffect(function(){Ue(Yr)},[Yr]),fn&&(fn.current={focus:function(){kn.current&&kn.current.focus()},blur:function(){kn.current&&kn.current.blur()}});var xn=Object(k.a)(Object(k.a)({},Q),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),zt=I.createElement(J,Object.assign({},xn,{generateConfig:ot,className:M()(Object(P.a)({},"".concat(Te,"-panel-focused"),!nn)),value:Ee,locale:ht,tabIndex:-1,onChange:Ue,direction:Mt}));Qn&&(zt=Qn(zt));var Vt=I.createElement("div",{className:"".concat(Te,"-panel-container"),onMouseDown:function(vr){vr.preventDefault()}},zt),pr;Rt&&(pr=I.createElement("span",{className:"".concat(Te,"-suffix")},Rt));var Mr;It&&Yr&&!Rn&&(Mr=I.createElement("span",{onMouseDown:function(vr){vr.preventDefault(),vr.stopPropagation()},onMouseUp:function(vr){vr.preventDefault(),vr.stopPropagation(),Vn(null),fr(!1)},className:"".concat(Te,"-clear")},Un||I.createElement("span",{className:"".concat(Te,"-clear-btn")})));var ir=function(vr,yi){(yi==="submit"||yi!=="key"&&!lr)&&(Vn(vr),fr(!1))},Ur=Mt==="rtl"?"bottomRight":"bottomLeft",oi=ai(an,{formatList:er,generateConfig:ot,locale:ht}),jr=Object(K.a)(oi,3),Xr=jr[0],zr=jr[1],Wr=jr[2];return I.createElement(o.Provider,{value:{operationRef:Ve,hideHeader:Pn==="time",panelRef:Rr,onSelect:ir,open:me,defaultOpenValue:Kt,onDateMouseEnter:zr,onDateMouseLeave:Wr}},I.createElement(Jn,{visible:me,popupElement:Vt,popupStyle:Be,prefixCls:Te,dropdownClassName:Dt,dropdownAlign:Tt,getPopupContainer:jn,transitionName:_t,popupPlacement:Ur,direction:Mt},I.createElement("div",{className:M()(Te,it,(ce={},Object(P.a)(ce,"".concat(Te,"-disabled"),Rn),Object(P.a)(ce,"".concat(Te,"-focused"),gn),Object(P.a)(ce,"".concat(Te,"-rtl"),Mt==="rtl"),ce)),style:$e,onMouseDown:yr,onMouseUp:wr,onMouseEnter:wn,onMouseLeave:Lt,onContextMenu:Ze,onClick:Nt},I.createElement("div",{className:M()("".concat(Te,"-input"),Object(P.a)({},"".concat(Te,"-input-placeholder"),!!Xr)),ref:mr},I.createElement("input",Object.assign({id:rt,tabIndex:Re,disabled:Rn,readOnly:wt||!nn,value:Xr||an,onChange:function(vr){mn(vr.target.value)},autoFocus:vt,placeholder:ft,ref:kn,title:an},Cr,{size:f(Pn,er[0])},Je(Q),{autoComplete:zn})),pr,Mr))))}var Li=function(Q){Object(U.a)(Ce,Q);var ce=Object(G.a)(Ce);function Ce(){var Te;return Object(Z.a)(this,Ce),Te=ce.apply(this,arguments),Te.pickerRef=I.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(V.a)(Ce,[{key:"render",value:function(){return I.createElement(Gr,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(I.Component),Vi=Li;function Dr(Q,ce,Ce){var Te=Q.picker,rt=Q.locale,Re=Q.selectedValue,$e=Q.disabledDate,it=Q.disabled,Dt=Q.generateConfig,Tt=xe(Re,0),Be=xe(Re,1);function _t(vt){var Xt=Dt.getYear(vt),dn=Dt.locale.getWeek(rt.locale,vt);return Xt*100+dn}function ot(vt){var Xt=Dt.getYear(vt),dn=Dt.getMonth(vt);return Xt*100+dn}function ht(vt){var Xt=Dt.getYear(vt),dn=Ne(Dt,vt);return Xt*10+dn}var wt=I.useCallback(function(vt){if($e&&$e(vt))return!0;if(it[1]&&Be)return!Bt(Dt,vt,Be)&&Dt.isAfter(vt,Be);if(ce&&Be)switch(Te){case"quarter":return ht(vt)>ht(Be);case"month":return ot(vt)>ot(Be);case"week":return _t(vt)>_t(Be);default:return!Bt(Dt,vt,Be)&&Dt.isAfter(vt,Be)}return!1},[$e,it[1],Be,ce]),It=I.useCallback(function(vt){if($e&&$e(vt))return!0;if(it[0]&&Tt)return!Bt(Dt,vt,Be)&&Dt.isAfter(Tt,vt);if(Ce&&Tt)switch(Te){case"quarter":return ht(vt)<ht(Tt);case"month":return ot(vt)<ot(Tt);case"week":return _t(vt)<_t(Tt);default:return!Bt(Dt,vt,Tt)&&Dt.isAfter(Tt,vt)}return!1},[$e,it[0],Tt,Ce]);return[wt,It]}function Sr(Q,ce,Ce,Te){var rt=We(Q,Ce,Te,1);function Re($e){return $e(Q,ce)?"same":$e(rt,ce)?"closing":"far"}switch(Ce){case"year":return Re(function($e,it){return jt(Te,$e,it)});case"quarter":case"month":return Re(function($e,it){return oe(Te,$e,it)});default:return Re(function($e,it){return Xe(Te,$e,it)})}}function ri(Q,ce,Ce,Te){var rt=xe(Q,0),Re=xe(Q,1);if(ce===0)return rt;if(rt&&Re){var $e=Sr(rt,Re,Ce,Te);switch($e){case"same":return rt;case"closing":return rt;default:return We(Re,Ce,Te,-1)}}return rt}function Br(Q){var ce=Q.values,Ce=Q.picker,Te=Q.defaultDates,rt=Q.generateConfig,Re=I.useState(function(){return[xe(Te,0),xe(Te,1)]}),$e=Object(K.a)(Re,2),it=$e[0],Dt=$e[1],Tt=I.useState(null),Be=Object(K.a)(Tt,2),_t=Be[0],ot=Be[1],ht=xe(ce,0),wt=xe(ce,1);function It(Xt){return it[Xt]?it[Xt]:xe(_t,Xt)||ri(ce,Xt,Ce,rt)||ht||wt||rt.getNow()}function vt(Xt,dn){if(Xt){var Pn=ke(_t,Xt,dn);Dt(ke(it,null,dn)||[null,null]);var Gn=(dn+1)%2;xe(ce,Gn)||(Pn=ke(Pn,Xt,Gn)),ot(Pn)}else(ht||wt)&&ot(null)}return[It,vt]}function Bn(Q,ce){return Q&&Q[0]&&Q[1]&&ce.isAfter(Q[0],Q[1])?[Q[1],Q[0]]:Q}function _n(Q,ce,Ce,Te){return Q||Te&&Te[ce]?!0:!!Ce[(ce+1)%2]}function Sn(Q){var ce,Ce,Te,rt=Q.prefixCls,Re=rt===void 0?"rc-picker":rt,$e=Q.id,it=Q.style,Dt=Q.className,Tt=Q.popupStyle,Be=Q.dropdownClassName,_t=Q.transitionName,ot=Q.dropdownAlign,ht=Q.getPopupContainer,wt=Q.generateConfig,It=Q.locale,vt=Q.placeholder,Xt=Q.autoFocus,dn=Q.disabled,Pn=Q.format,Gn=Q.picker,On=Gn===void 0?"date":Gn,Nn=Q.showTime,Mn=Q.use12Hours,Pt=Q.separator,hn=Pt===void 0?"~":Pt,Kt=Q.value,Rt=Q.defaultValue,Un=Q.defaultPickerValue,Rn=Q.open,Yt=Q.defaultOpen,ft=Q.disabledDate,jn=Q.disabledTime,fn=Q.dateRender,Qn=Q.panelRender,qt=Q.ranges,An=Q.allowEmpty,Fn=Q.allowClear,vn=Q.suffixIcon,yr=Q.clearIcon,Ln=Q.pickerRef,wn=Q.inputReadOnly,Lt=Q.mode,Ze=Q.renderExtraFooter,Nt=Q.onChange,Mt=Q.onOpenChange,cn=Q.onPanelChange,zn=Q.onCalendarChange,kn=Q.onFocus,lr=Q.onBlur,er=Q.onOk,Rr=Q.components,mr=Q.order,xr=Q.direction,Zr=Q.activePickerIndex,Yr=Q.autoComplete,Jr=Yr===void 0?"off":Yr,vi=On==="date"&&!!Nn||On==="time",_i=Object(I.useRef)({}),Ee=Object(I.useRef)(null),Ue=Object(I.useRef)(null),Ve=Object(I.useRef)(null),Se=Object(I.useRef)(null),re=Object(I.useRef)(null),me=Object(I.useRef)(null),ue=Object(I.useRef)(null),Oe=ge(E(Pn,On,Nn,Mn)),Pe=Object(p.a)(0,{value:Zr}),qe=Object(K.a)(Pe,2),Ie=qe[0],ut=qe[1],Ut=Object(I.useRef)(null),an=I.useMemo(function(){return Array.isArray(dn)?dn:[dn||!1,dn||!1]},[dn]),mn=Object(p.a)(null,{value:Kt,defaultValue:Rt,postState:function($n){return On==="time"&&!mr?$n:Bn($n,wt)}}),Hn=Object(K.a)(mn,2),Vn=Hn[0],fr=Hn[1],dr=Br({values:Vn,picker:On,defaultDates:Un,generateConfig:wt}),wr=Object(K.a)(dr,2),Ar=wr[0],gr=wr[1],Cr=Object(p.a)(Vn,{postState:function($n){var hr=$n;if(an[0]&&an[1])return hr;for(var Ir=0;Ir<2;Ir+=1)an[Ir]&&!xe(hr,Ir)&&!xe(An,Ir)&&(hr=ke(hr,wt.getNow(),Ir));return hr}}),Lr=Object(K.a)(Cr,2),gn=Lr[0],nn=Lr[1],xn=Object(p.a)([On,On],{value:Lt}),zt=Object(K.a)(xn,2),Vt=zt[0],pr=zt[1];Object(I.useEffect)(function(){pr([On,On])},[On]);var Mr=function($n,hr){pr($n),cn&&cn(hr,$n)},ir=Dr({picker:On,selectedValue:gn,locale:It,disabled:an,disabledDate:ft,generateConfig:wt},_i.current[1],_i.current[0]),Ur=Object(K.a)(ir,2),oi=Ur[0],jr=Ur[1],Xr=Object(p.a)(!1,{value:Rn,defaultValue:Yt,postState:function($n){return an[Ie]?!1:$n},onChange:function($n){Mt&&Mt($n),!$n&&Ut.current&&Ut.current.onClose&&Ut.current.onClose()}}),zr=Object(K.a)(Xr,2),Wr=zr[0],Hr=zr[1],vr=Wr&&Ie===0,yi=Wr&&Ie===1,Qi=Object(I.useState)(0),ji=Object(K.a)(Qi,2),Ri=ji[0],ui=ji[1];Object(I.useEffect)(function(){!Wr&&Ee.current&&ui(Ee.current.offsetWidth)},[Wr]);var qr=I.useRef();function ii(Or,$n){if(Or)clearTimeout(qr.current),_i.current[$n]=!0,ut($n),Hr(Or),Wr||gr(null,$n);else if(Ie===$n){Hr(Or);var hr=_i.current;qr.current=setTimeout(function(){hr===_i.current&&(_i.current={})})}}function ci(Or){ii(!0,Or),setTimeout(function(){var $n=[me,ue][Or];$n.current&&$n.current.focus()},0)}function Fi(Or,$n){var hr=Or,Ir=xe(hr,0),fi=xe(hr,1);Ir&&fi&&wt.isAfter(Ir,fi)&&(On==="week"&&!en(wt,It.locale,Ir,fi)||On==="quarter"&&!Ge(wt,Ir,fi)||On!=="week"&&On!=="quarter"&&On!=="time"&&!Bt(wt,Ir,fi)?($n===0?(hr=[Ir,null],fi=null):(Ir=null,hr=[null,fi]),_i.current=Object(P.a)({},$n,!0)):(On!=="time"||mr!==!1)&&(hr=Bn(hr,wt))),nn(hr);var ga=hr&&hr[0]?wt.locale.format(It.locale,hr[0],Oe[0]):"",aa=hr&&hr[1]?wt.locale.format(It.locale,hr[1],Oe[0]):"";if(zn){var Mi={range:$n===0?"start":"end"};zn(hr,[ga,aa],Mi)}var $i=_n(Ir,0,an,An),va=_n(fi,1,an,An),Wa=hr===null||$i&&va;Wa&&(fr(hr),Nt&&(!tt(wt,xe(Vn,0),Ir)||!tt(wt,xe(Vn,1),fi))&&Nt(hr,[ga,aa]));var Ai=null;$n===0&&!an[1]?Ai=1:$n===1&&!an[0]&&(Ai=0),Ai!==null&&Ai!==Ie&&(!_i.current[Ai]||!xe(hr,Ai))&&xe(hr,$n)?ci(Ai):ii(!1,$n)}var ha=function($n){return Wr&&Ut.current&&Ut.current.onKeyDown?Ut.current.onKeyDown($n):(Object(_.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sa={formatList:Oe,generateConfig:wt,locale:It},ei=li(xe(gn,0),sa),Zi=Object(K.a)(ei,2),qi=Zi[0],si=Zi[1],Qr=li(xe(gn,1),sa),Ti=Object(K.a)(Qr,2),Ma=Ti[0],no=Ti[1],la=function($n,hr){var Ir=wt.locale.parse(It.locale,$n,Oe),fi=hr===0?oi:jr;Ir&&!fi(Ir)&&(nn(ke(gn,Ir,hr)),gr(Ir,hr))},Ca=tr({valueTexts:qi,onTextChange:function($n){return la($n,0)}}),Ta=Object(K.a)(Ca,3),Sa=Ta[0],ka=Ta[1],co=Ta[2],Ro=tr({valueTexts:Ma,onTextChange:function($n){return la($n,1)}}),za=Object(K.a)(Ro,3),Oa=za[0],Va=za[1],_a=za[2],Ra=Object(I.useState)(null),ho=Object(K.a)(Ra,2),Ya=ho[0],Aa=ho[1],Da=Object(I.useState)(null),ya=Object(K.a)(Da,2),Ni=ya[0],fa=ya[1],pa=ai(Sa,{formatList:Oe,generateConfig:wt,locale:It}),ba=Object(K.a)(pa,3),ma=ba[0],Xa=ba[1],$a=ba[2],Ja=ai(Oa,{formatList:Oe,generateConfig:wt,locale:It}),Ia=Object(K.a)(Ja,3),ua=Ia[0],Ea=Ia[1],ro=Ia[2],Ao=function($n){fa(ke(gn,$n,Ie)),Ie===0?Xa($n):Ea($n)},Do=function(){fa(ke(gn,null,Ie)),Ie===0?$a():ro()},fo=function($n,hr){return{blurToCancel:vi,forwardKeyDown:ha,onBlur:lr,isClickOutside:function(fi){return!F([Ue.current,Ve.current,Se.current],fi)},onFocus:function(fi){ut($n),kn&&kn(fi)},triggerOpen:function(fi){ii(fi,$n)},onSubmit:function(){Fi(gn,$n),hr()},onCancel:function(){ii(!1,$n),nn(Vn),hr()}}},io=ln(Object(k.a)(Object(k.a)({},fo(0,co)),{},{open:vr,value:Sa})),po=Object(K.a)(io,2),Ki=po[0],bi=po[1],Pi=bi.focused,Ei=bi.typing,Na=ln(Object(k.a)(Object(k.a)({},fo(1,_a)),{},{open:yi,value:Oa})),mo=Object(K.a)(Na,2),ea=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function($n){!Wr&&!me.current.contains($n.target)&&!ue.current.contains($n.target)&&(an[0]?an[1]||ci(1):ci(0))},Qa=function($n){Wr&&(Pi||oo)&&!me.current.contains($n.target)&&!ue.current.contains($n.target)&&$n.preventDefault()},Ua=Vn&&Vn[0]?wt.locale.format(It.locale,Vn[0],"YYYYMMDDHHmmss"):"",go=Vn&&Vn[1]?wt.locale.format(It.locale,Vn[1],"YYYYMMDDHHmmss"):"";Object(I.useEffect)(function(){Wr||(nn(Vn),!qi.length||qi[0]===""?ka(""):si!==Sa&&co(),!Ma.length||Ma[0]===""?Va(""):no!==Oa&&_a())},[Wr,qi,Ma]),Object(I.useEffect)(function(){nn(Vn)},[Ua,go]),Ln&&(Ln.current={focus:function(){me.current&&me.current.focus()},blur:function(){me.current&&me.current.blur(),ue.current&&ue.current.blur()}});var Za=Object.keys(qt||{}),$r=Za.map(function(Or){var $n=qt[Or],hr=typeof $n=="function"?$n():$n;return{label:Or,onClick:function(){Fi(hr,null),ii(!1,Ie)},onMouseEnter:function(){Aa(hr)},onMouseLeave:function(){Aa(null)}}});function Nr(){var Or=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,$n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},hr=null;Wr&&Ni&&Ni[0]&&Ni[1]&&wt.isAfter(Ni[1],Ni[0])&&(hr=Ni);var Ir=Nn;if(Nn&&Object(m.a)(Nn)==="object"&&Nn.defaultValue){var fi=Nn.defaultValue;Ir=Object(k.a)(Object(k.a)({},Nn),{},{defaultValue:xe(fi,Ie)||void 0})}var ga=null;return fn&&(ga=function(Mi,$i){return fn(Mi,$i,{range:Ie?"end":"start"})}),I.createElement(yt.Provider,{value:{inRange:!0,panelPosition:Or,rangedValue:Ya||gn,hoverRangedValue:hr}},I.createElement(J,Object.assign({},Q,$n,{dateRender:ga,showTime:Ir,mode:Vt[Ie],generateConfig:wt,style:void 0,direction:xr,disabledDate:Ie===0?oi:jr,disabledTime:function(Mi){return jn?jn(Mi,Ie===0?"start":"end"):!1},className:M()(Object(P.a)({},"".concat(Re,"-panel-focused"),Ie===0?!Ei:!so)),value:xe(gn,Ie),locale:It,tabIndex:-1,onPanelChange:function(Mi,$i){Mr(ke(Vt,$i,Ie),ke(gn,Mi,Ie));var va=Mi;Or==="right"&&Vt[Ie]===$i&&(va=We(va,$i,wt,-1)),gr(va,Ie)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var gi=0,Bi=0;Ie&&Ve.current&&re.current&&Ue.current&&(gi=Ve.current.offsetWidth+re.current.offsetWidth,Ue.current.offsetWidth&&gi>Ue.current.offsetWidth&&(Bi=gi));var La=xr==="rtl"?{right:gi}:{left:gi};function ca(){var Or,$n=N(Re,Vt[Ie],Ze),hr=z({prefixCls:Re,components:Rr,needConfirmButton:vi,okDisabled:!xe(gn,Ie)||ft&&ft(gn[Ie]),locale:It,rangeList:$r,onOk:function(){xe(gn,Ie)&&(Fi(gn,Ie),er&&er(gn))}});if(On!=="time"&&!Nn){var Ir=Ar(Ie),fi=We(Ir,On,wt),ga=Vt[Ie],aa=ga===On,Mi=Nr(aa?"left":!1,{pickerValue:Ir,onPickerValueChange:function(Ai){gr(Ai,Ie)}}),$i=Nr("right",{pickerValue:fi,onPickerValueChange:function(Ai){gr(We(Ai,On,wt,-1),Ie)}});xr==="rtl"?Or=I.createElement(I.Fragment,null,$i,aa&&Mi):Or=I.createElement(I.Fragment,null,Mi,aa&&$i)}else Or=Nr();var va=I.createElement(I.Fragment,null,I.createElement("div",{className:"".concat(Re,"-panels")},Or),($n||hr)&&I.createElement("div",{className:"".concat(Re,"-footer")},$n,hr));return Qn&&(va=Qn(va)),I.createElement("div",{className:"".concat(Re,"-panel-container"),style:{marginLeft:Bi},ref:Ue,onMouseDown:function(Ai){Ai.preventDefault()}},va)}var ja=I.createElement("div",{className:M()("".concat(Re,"-range-wrapper"),"".concat(Re,"-").concat(On,"-range-wrapper")),style:{minWidth:Ri}},I.createElement("div",{className:"".concat(Re,"-range-arrow"),style:La}),ca()),da;vn&&(da=I.createElement("span",{className:"".concat(Re,"-suffix")},vn));var Si;Fn&&(xe(Vn,0)&&!an[0]||xe(Vn,1)&&!an[1])&&(Si=I.createElement("span",{onMouseDown:function($n){$n.preventDefault(),$n.stopPropagation()},onMouseUp:function($n){$n.preventDefault(),$n.stopPropagation();var hr=Vn;an[0]||(hr=ke(hr,null,0)),an[1]||(hr=ke(hr,null,1)),Fi(hr,null),ii(!1,Ie)},className:"".concat(Re,"-clear")},yr||I.createElement("span",{className:"".concat(Re,"-clear-btn")})));var Fa={size:f(On,Oe[0])},Ba=0,Ha=0;Ve.current&&Se.current&&re.current&&(Ie===0?Ha=Ve.current.offsetWidth:(Ba=gi,Ha=Se.current.offsetWidth));var Gi=xr==="rtl"?{right:Ba}:{left:Ba},Vr=function($n,hr){var Ir=ke(gn,$n,Ie);hr==="submit"||hr!=="key"&&!vi?(Fi(Ir,Ie),Ie===0?$a():ro()):nn(Ir)};return I.createElement(o.Provider,{value:{operationRef:Ut,hideHeader:On==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Vr,open:Wr}},I.createElement(Jn,{visible:Wr,popupElement:ja,popupStyle:Tt,prefixCls:Re,dropdownClassName:Be,dropdownAlign:ot,getPopupContainer:ht,transitionName:_t,range:!0,direction:xr},I.createElement("div",Object.assign({ref:Ee,className:M()(Re,"".concat(Re,"-range"),Dt,(ce={},Object(P.a)(ce,"".concat(Re,"-disabled"),an[0]&&an[1]),Object(P.a)(ce,"".concat(Re,"-focused"),Ie===0?Pi:oo),Object(P.a)(ce,"".concat(Re,"-rtl"),xr==="rtl"),ce)),style:it,onClick:xa,onMouseDown:Qa},Je(Q)),I.createElement("div",{className:M()("".concat(Re,"-input"),(Ce={},Object(P.a)(Ce,"".concat(Re,"-input-active"),Ie===0),Object(P.a)(Ce,"".concat(Re,"-input-placeholder"),!!ma),Ce)),ref:Ve},I.createElement("input",Object.assign({id:$e,disabled:an[0],readOnly:wn||!Ei,value:ma||Sa,onChange:function($n){ka($n.target.value)},autoFocus:Xt,placeholder:xe(vt,0)||"",ref:me},Ki,Fa,{autoComplete:Jr}))),I.createElement("div",{className:"".concat(Re,"-range-separator"),ref:re},hn),I.createElement("div",{className:M()("".concat(Re,"-input"),(Te={},Object(P.a)(Te,"".concat(Re,"-input-active"),Ie===1),Object(P.a)(Te,"".concat(Re,"-input-placeholder"),!!ua),Te)),ref:Se},I.createElement("input",Object.assign({disabled:an[1],readOnly:wn||!so,value:ua||Oa,onChange:function($n){Va($n.target.value)},placeholder:xe(vt,1)||"",ref:ue},ea,Fa,{autoComplete:Jr}))),I.createElement("div",{className:"".concat(Re,"-active-bar"),style:Object(k.a)(Object(k.a)({},Gi),{},{width:Ha,position:"absolute"})}),da,Si)))}var bn=function(Q){Object(U.a)(Ce,Q);var ce=Object(G.a)(Ce);function Ce(){var Te;return Object(Z.a)(this,Ce),Te=ce.apply(this,arguments),Te.pickerRef=I.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(V.a)(Ce,[{key:"render",value:function(){return I.createElement(Sn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(I.Component),ur=bn,sr=he.b=Vi},osHv:function(Gt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";var V=Z.Pos;function U(c,s){return c.line-s.line||c.ch-s.ch}var G="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",P=G+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",k=new RegExp("<(/?)(["+G+"]["+P+"]*)","g");function K(c,s,i,n){this.line=s,this.ch=i,this.cm=c,this.text=c.getLine(s),this.min=n?Math.max(n.from,c.firstLine()):c.firstLine(),this.max=n?Math.min(n.to-1,c.lastLine()):c.lastLine()}function I(c,s){var i=c.cm.getTokenTypeAt(V(c.line,s));return i&&/\btag\b/.test(i)}function r(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function M(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function _(c){for(;;){var s=c.text.indexOf(">",c.ch);if(s==-1){if(r(c))continue;return}if(!I(c,s+1)){c.ch=s+1;continue}var i=c.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(c.text.slice(i+1,s));return c.ch=s+1,n?"selfClose":"regular"}}function p(c){for(;;){var s=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(s==-1){if(M(c))continue;return}if(!I(c,s+1)){c.ch=s;continue}k.lastIndex=s,c.ch=s;var i=k.exec(c.text);if(i&&i.index==s)return i}}function m(c){for(;;){k.lastIndex=c.ch;var s=k.exec(c.text);if(!s){if(r(c))continue;return}if(!I(c,s.index+1)){c.ch=s.index+1;continue}return c.ch=s.index+s[0].length,s}}function u(c){for(;;){var s=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(s==-1){if(M(c))continue;return}if(!I(c,s+1)){c.ch=s;continue}var i=c.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(c.text.slice(i+1,s));return c.ch=s+1,n?"selfClose":"regular"}}function a(c,s){for(var i=[];;){var n=m(c),O,T=c.line,C=c.ch-(n?n[0].length:0);if(!n||!(O=_(c)))return;if(O=="selfClose")continue;if(n[1]){for(var R=i.length-1;R>=0;--R)if(i[R]==n[2]){i.length=R;break}if(R<0&&(!s||s==n[2]))return{tag:n[2],from:V(T,C),to:V(c.line,c.ch)}}else i.push(n[2])}}function o(c,s){for(var i=[];;){var n=u(c);if(!n)return;if(n=="selfClose"){p(c);continue}var O=c.line,T=c.ch,C=p(c);if(!C)return;if(C[1])i.push(C[2]);else{for(var R=i.length-1;R>=0;--R)if(i[R]==C[2]){i.length=R;break}if(R<0&&(!s||s==C[2]))return{tag:C[2],from:V(c.line,c.ch),to:V(O,T)}}}}Z.registerHelper("fold","xml",function(c,s){for(var i=new K(c,s.line,0);;){var n=m(i);if(!n||i.line!=s.line)return;var O=_(i);if(!O)return;if(!n[1]&&O!="selfClose"){var T=V(i.line,i.ch),C=a(i,n[2]);return C&&U(C.from,T)>0?{from:T,to:C.from}:null}}}),Z.findMatchingTag=function(c,s,i){var n=new K(c,s.line,s.ch,i);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var O=_(n),T=O&&V(n.line,n.ch),C=O&&p(n);if(!O||!C||U(n,s)>0)return;var R={from:V(n.line,n.ch),to:T,tag:C[2]};return O=="selfClose"?{open:R,close:null,at:"open"}:C[1]?{open:o(n,C[2]),close:R,at:"close"}:(n=new K(c,T.line,T.ch,i),{open:R,close:a(n,C[2]),at:"open"})},Z.findEnclosingTag=function(c,s,i,n){for(var O=new K(c,s.line,s.ch,i);;){var T=o(O,n);if(!T)break;var C=new K(c,s.line,s.ch,i),R=a(C,T.tag);if(R)return{open:T,close:R}}},Z.scanForClosingTag=function(c,s,i,n){var O=new K(c,s.line,s.ch,n?{from:0,to:n}:null);return a(O,i)}})},p5ED:function(Gt,he,D){"use strict";var Z=D("+L6B"),V=D("2/Rp"),U=D("5Dmo"),G=D("3S7+"),P=D("k1fw"),k=D("9og8"),K=D("tJVT"),I=D("WmNS"),r=D.n(I),M=D("q1tI"),_=D.n(M),p=D("vHTk"),m=D.n(p),u=D("yEEn"),a=D("ZW9T"),o=D("1vsH"),c=D("V0Rq"),s=D("m3rI");he.a=function(i){var n,O,T,C,R,S,v,E=i.editOffice,f=E===void 0?"view":E,h=i.data,y=i.theme,g=i.type,x=i.filename,j=i.monacoEditor,B=i.className,A=i.style,H=i.close,F=i.onClose,w=i.hasMask,Y=i.disabledDownload,q=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ie=Object(K.a)(q,2),ge=ie[0],Je=ie[1],xe=Object(M.useState)(""),ke=Object(K.a)(xe,2),Qe=ke[0],Ye=ke[1],ve=Object(M.useState)(),fe=Object(K.a)(ve,2),at=fe[0],Jt=fe[1],Ft=window.ENV==="build"?"/react/build":"",St=s.a.PROXY_SERVER||location.origin,ze,gt=1024*1024,ct=10*gt,jt=Object(M.useRef)();(n=h)!==null&&n!==void 0&&n.startsWith("/api")&&g!=="txt"&&(h=s.a.API_SERVER+h),g==="office"&&(ze=Object(o.T)(h).filesize,ze>ct&&(g="other")),x&&j&&(j.filename=x),Object(M.useEffect)(function(){var Xe,Bt,Wt=(Xe=document.cookie)===null||Xe===void 0||((Bt=Xe.replace(/\s/g,""))===null||Bt===void 0)?void 0:Bt.split(";");Wt==null||Wt.map(function(en){var tt=en.split("=");tt[0]==="_educoder_session"&&Ye(tt[1])})},[]),Object(M.useEffect)(function(){g==="office"&&oe()},[g,h]);var oe=function(){var Xe=Object(k.a)(r.a.mark(function Bt(){var Wt,en,tt;return r.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return console.log("data:",h),Wt=h,h.startsWith("http")||(Wt=location.origin+Wt),en=new URL(Wt).pathname.split("/").pop(),En.next=6,Object(c.V)({attachment_id:en});case 6:tt=En.sent,Jt(tt);case 8:case"end":return En.stop()}},Bt)}));return function(){return Xe.apply(this,arguments)}}(),Ne=function(){if(h.startsWith("http")||h.startsWith("blob:")){Ge();return}Object(o.z)(x||"educoder",h,x)},Ge=function(){Object(o.x)(x||"educoder",decodeURIComponent(h))};return _.a.createElement("div",{style:Object(P.a)({},A||{}),className:"".concat(w&&m.a.bgBlack," ").concat(g?m.a.wrp:"hide")},H&&_.a.createElement("div",{className:m.a.close,ref:jt},!Y&&_.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return jt.current}},_.a.createElement("span",{onClick:Ge},_.a.createElement("i",{className:"icon-quxiaozhiding"}))),_.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return jt.current}},_.a.createElement("span",{className:"",onClick:F},_.a.createElement("i",{className:"icon-guanbi1"})))),_.a.createElement("div",{className:"".concat(m.a[B]," ").concat(B," ").concat(m.a.monaco," ").concat(g==="txt"?"show":"hide")},g==="txt"&&_.a.createElement(a.b,j)),g==="audio"&&_.a.createElement("audio",{src:"".concat(((O=h)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((T=h)===null||T===void 0?void 0:T.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),g==="video"&&_.a.createElement(_.a.Fragment,null,((C=h)===null||C===void 0?void 0:C.indexOf("http"))>-1?_.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):_.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),g==="office"&&at&&_.a.createElement("iframe",{src:"".concat(Ft,"/office.html?key=").concat(at.key,"&url=").concat(St+at.url,"&callbackUrl=").concat(St+at.callbackUrl,"&fileType=").concat(at.fileType,"&title=").concat(at.title,"&model=").concat(f,"&officeServer=").concat(s.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),g==="html"&&_.a.createElement("iframe",{src:h+"&disposition=inline"}),g==="pdf"&&_.a.createElement("iframe",{src:"".concat(Ft,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!Y)}),g==="image"&&_.a.createElement("img",{src:"".concat(((R=h)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((S=h)===null||S===void 0?void 0:S.indexOf("https://"))>-1||(v=h)!==null&&v!==void 0&&v.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),g==="other"&&_.a.createElement("div",null,_.a.createElement(V.a,{type:"primary",size:"large",onClick:Ne},_.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),g==="download"&&_.a.createElement(V.a,{type:"primary",size:"large",onClick:Ne},_.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Gt,he,D){},pmY6:function(Gt,he,D){"use strict";D.d(he,"h",function(){return M}),D.d(he,"g",function(){return p}),D.d(he,"f",function(){return m}),D.d(he,"e",function(){return u}),D.d(he,"i",function(){return a}),D.d(he,"b",function(){return o}),D.d(he,"a",function(){return c}),D.d(he,"d",function(){return s}),D.d(he,"c",function(){return i});var Z=D("C/vA"),V=D("JYp7");const U=!1;let G=null;function P(n){G=n}if(U){const n="__is_disposable_tracked__";P(new class{trackDisposable(O){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[n]||console.log(T)},3e3)}setParent(O,T){if(O&&O!==c.None)try{O[n]=!0}catch(C){}}markAsDisposed(O){if(O&&O!==c.None)try{O[n]=!0}catch(T){}}markAsSingleton(O){}})}function k(n){return G==null||G.trackDisposable(n),n}function K(n){G==null||G.markAsDisposed(n)}function I(n,O){G==null||G.setParent(n,O)}function r(n,O){if(!G)return;for(const T of n)G.setParent(T,O)}function M(n){return G==null||G.markAsSingleton(n),n}class _ extends Error{constructor(n){super(`Encountered errors while disposing of store. Errors: [${n.join(", ")}]`);this.errors=n}}function p(n){return typeof n.dispose=="function"&&n.dispose.length===0}function m(n){if(V.a.is(n)){let O=[];for(const T of n)if(T)try{T.dispose()}catch(C){O.push(C)}if(O.length===1)throw O[0];if(O.length>1)throw new _(O);return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function u(...n){const O=a(()=>m(n));return r(n,O),O}function a(n){const O=k({dispose:Object(Z.a)(()=>{K(O),n()})});return O}class o{constructor(){this._toDispose=new Set,this._isDisposed=!1,k(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return I(n,this),this._isDisposed?o.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}}o.DISABLE_DISPOSED_WARNING=!1;class c{constructor(){this._store=new o,k(this),I(this._store,this)}dispose(){K(this),this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}}c.None=Object.freeze({dispose(){}});class s{constructor(){this._isDisposed=!1,k(this)}get value(){return this._isDisposed?void 0:this._value}set value(n){var O;if(this._isDisposed||n===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),n&&I(n,this),this._value=n}clear(){this.value=void 0}dispose(){var n;this._isDisposed=!0,K(this),(n=this._value)===null||n===void 0||n.dispose(),this._value=void 0}clearAndLeak(){const n=this._value;return this._value=void 0,n&&I(n,null),n}}class i{constructor(n){this.object=n}dispose(){}}},psGv:function(Gt,he,D){var Z,V;(function(){var U;(function(){"use strict";var K=[,,function(_){function p(a){this.__parent=a,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var a=new p(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},p.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},p.prototype.has_match=function(a){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(a))return!0;return!1},p.prototype.set_indent=function(a,o){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(a){this.__items.push(a);var o=a.lastIndexOf(`
`);o!==-1?this.__character_count=a.length-o:this.__character_count+=a.length},p.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function m(a,o){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),o=o||"",a.indent_level>0&&(o=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(a,o){var c=this.__base_string_length;return o=o||0,a<0&&(c=0),c+=a*this.__indent_size,c+=o,c},m.prototype.get_indent_string=function(a,o){var c=this.__base_string;return o=o||0,a<0&&(a=0,c=""),o+=a*this.__indent_size,this.__ensure_cache(o),c+=this.__cache[o],c},m.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var a=this.__cache.length,o=0,c="";this.__indent_size&&a>=this.__indent_size&&(o=Math.floor(a/this.__indent_size),a-=o*this.__indent_size,c=new Array(o+1).join(this.__indent_string)),a&&(c+=new Array(a+1).join(" ")),this.__cache.push(c)};function u(a,o){this.__indent_cache=new m(a,o),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(a,o){return this.__indent_cache.get_indent_string(a,o)},u.prototype.get_indent_size=function(a,o){return this.__indent_cache.get_indent_size(a,o)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(a){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
`);return a!==`
`&&(c=c.replace(/[\n]/g,a)),c},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(a,o){return a=a||0,o=o||0,this.next_line.set_indent(a,o),this.__lines.length>1?(this.current_line.set_indent(a,o),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(a){for(var o=0;o<a.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},u.prototype.remove_indent=function(a){for(var o=this.__lines.length;a<o;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(a,o){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(a)!==0&&s.item(-1)!==o){this.__lines.splice(c+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},_.exports.Output=u},function(_){function p(m,u,a,o){this.type=m,this.text=u,this.comments_before=null,this.newlines=a||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}_.exports.Token=p},,,function(_){function p(a,o){this.raw_options=m(a,o),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(a,o){var c=this.raw_options[a],s=o||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},p.prototype._get_boolean=function(a,o){var c=this.raw_options[a],s=c===void 0?!!o:!!c;return s},p.prototype._get_characters=function(a,o){var c=this.raw_options[a],s=o||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},p.prototype._get_number=function(a,o){var c=this.raw_options[a];o=parseInt(o,10),isNaN(o)&&(o=0);var s=parseInt(c,10);return isNaN(s)&&(s=o),s},p.prototype._get_selection=function(a,o,c){var s=this._get_selection_list(a,o,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[a]+"'");return s[0]},p.prototype._get_selection_list=function(a,o,c){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[o[0]],!this._is_valid_selection(c,o))throw new Error("Invalid Default Value!");var s=this._get_array(a,c);if(!this._is_valid_selection(s,o))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[a]+"'");return s},p.prototype._is_valid_selection=function(a,o){return a.length&&o.length&&!a.some(function(c){return o.indexOf(c)===-1})};function m(a,o){var c={};a=u(a);var s;for(s in a)s!==o&&(c[s]=a[s]);if(o&&a[o])for(s in a[o])c[s]=a[o][s];return c}function u(a){var o={},c;for(c in a){var s=c.replace(/-/g,"_");o[s]=a[c]}return o}_.exports.Options=p,_.exports.normalizeOpts=u,_.exports.mergeOpts=m},,function(_){var p=RegExp.prototype.hasOwnProperty("sticky");function m(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},m.prototype.peek=function(u){var a=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(a=this.__input.charAt(u)),a},m.prototype.__match=function(u,a){u.lastIndex=a;var o=u.exec(this.__input);return o&&!(p&&u.sticky)&&(o.index!==a&&(o=null)),o},m.prototype.test=function(u,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(u,a):!1},m.prototype.testChar=function(u,a){var o=this.peek(a);return u.lastIndex=0,o!==null&&u.test(o)},m.prototype.match=function(u){var a=this.__match(u,this.__position);return a?this.__position+=a[0].length:a=null,a},m.prototype.read=function(u,a,o){var c="",s;return u&&(s=this.match(u),s&&(c+=s[0])),a&&(s||!u)&&(c+=this.readUntil(a,o)),c},m.prototype.readUntil=function(u,a){var o="",c=this.__position;u.lastIndex=this.__position;var s=u.exec(this.__input);return s?(c=s.index,a&&(c+=s[0].length)):c=this.__input_length,o=this.__input.substring(this.__position,c),this.__position=c,o},m.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},m.prototype.get_regexp=function(u,a){var o=null,c="g";return a&&p&&(c="y"),typeof u=="string"&&u!==""?o=new RegExp(u,c):u&&(o=new RegExp(u.source,c)),o},m.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(u){var a=this.__position,o=this.readUntilAfter(u);return this.__position=a,o},m.prototype.lookBack=function(u){var a=this.__position-1;return a>=u.length&&this.__input.substring(a-u.length,a).toLowerCase()===u},_.exports.InputScanner=m},function(_,p,m){var u=m(8).InputScanner,a=m(3).Token,o=m(10).TokenStream,c=m(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(n,O){this._input=new u(n),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var n,O=new a(s.START,""),T=null,C=[],R=new o;O.type!==s.EOF;){for(n=this._get_next_token(O,T);this._is_comment(n);)R.add(n),n=this._get_next_token(O,T);R.isEmpty()||(n.comments_before=R,R=new o),n.parent=T,this._is_opening(n)?(C.push(T),T=n):T&&this._is_closing(n,T)&&(n.opened=T,T.closed=n,T=C.pop(),n.parent=T),n.previous=O,O.next=n,this.__tokens.add(n),O=n}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(n,O){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(s.RAW,T):this._create_token(s.EOF,"")},i.prototype._is_comment=function(n){return!1},i.prototype._is_opening=function(n){return!1},i.prototype._is_closing=function(n,O){return!1},i.prototype._create_token=function(n,O){var T=new a(n,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},_.exports.Tokenizer=i,_.exports.TOKEN=s},function(_){function p(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},p.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(u=this.__tokens[m]),u},p.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},_.exports.TokenStream=p},function(_,p,m){var u=m(12).Pattern;function a(o,c){u.call(this,o,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new u,a.prototype.__set_whitespace_patterns=function(o,c){o+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var c=this.__split(this._newline_regexp,o);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return o},a.prototype.matching=function(o,c){var s=this._create();return s.__set_whitespace_patterns(o,c),s._update(),s},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(o,c){o.lastIndex=0;for(var s=0,i=[],n=o.exec(c);n;)i.push(c.substring(s,n.index)),s=n.index+n[0].length,n=o.exec(c);return s<c.length?i.push(c.substring(s,c.length)):i.push(""),i},_.exports.WhitespacePattern=a},function(_){function p(m,u){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}p.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(m){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.until=function(m){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.starting_with=function(m){var u=this._create();return u._starting_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype.matching=function(m){var u=this._create();return u._match_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},_.exports.Pattern=p},function(_){function p(m,u){m=typeof m=="string"?m:m.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+u,"g")}p.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(m);a;)u[a[1]]=a[2],a=this.__directive_pattern.exec(m);return u},p.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},_.exports.Directives=p},function(_,p,m){var u=m(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(c,s){u.call(this,c,s),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var i=new u(c);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new u,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(c){var s=this._create();return s._disabled[c]=!0,s._update(),s},o.prototype.read_options=function(c){var s=this._create();for(var i in a)s._disabled[i]=c.templating.indexOf(i)===-1;return s._update(),s},o.prototype.exclude=function(c){var s=this._create();return s._excluded[c]=!0,s._update(),s},o.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),c+=s,s=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},o.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},o.prototype._read_template=function(){var c="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(c=c||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},_.exports.TemplatablePattern=o},,,,function(_,p,m){var u=m(19).Beautifier,a=m(20).Options;function o(c,s,i,n){var O=new u(c,s,i,n);return O.beautify()}_.exports=o,_.exports.defaultOptions=function(){return new a}},function(_,p,m){var u=m(20).Options,a=m(2).Output,o=m(21).Tokenizer,c=m(21).TOKEN,s=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,n=function(y,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=y.max_preserve_newlines,this.preserve_newlines=y.preserve_newlines,this._output=new a(y,g)};n.prototype.current_line_has_match=function(y){return this._output.current_line.has_match(y)},n.prototype.set_space_before_token=function(y,g){this._output.space_before_token=y,this._output.non_breaking_space=g},n.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},n.prototype.add_raw_token=function(y){this._output.add_raw_token(y)},n.prototype.print_preserved_newlines=function(y){var g=0;y.type!==c.TEXT&&y.previous.type!==c.TEXT&&(g=y.newlines?1:0),this.preserve_newlines&&(g=y.newlines<this.max_preserve_newlines+1?y.newlines:this.max_preserve_newlines+1);for(var x=0;x<g;x++)this.print_newline(x>0);return g!==0},n.prototype.traverse_whitespace=function(y){return y.whitespace_before||y.newlines?(this.print_preserved_newlines(y)||(this._output.space_before_token=!0),!0):!1},n.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},n.prototype.print_newline=function(y){this._output.add_new_line(y)},n.prototype.print_token=function(y){y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(y.text))},n.prototype.indent=function(){this.indent_level++},n.prototype.get_full_indent=function(y){return y=this.indent_level+(y||0),y<1?"":this._output.get_indent_string(y)};var O=function(y){for(var g=null,x=y.next;x.type!==c.EOF&&y.closed!==x;){if(x.type===c.ATTRIBUTE&&x.text==="type"){x.next&&x.next.type===c.EQUALS&&x.next.next&&x.next.next.type===c.VALUE&&(g=x.next.next.text);break}x=x.next}return g},T=function(y,g){var x=null,j=null;return g.closed?(y==="script"?x="text/javascript":y==="style"&&(x="text/css"),x=O(g)||x,x.search("text/css")>-1?j="css":x.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":x.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":x.search(/test\/null/)>-1&&(j="null"),j):null};function C(y,g){return g.indexOf(y)!==-1}function R(y,g,x){this.parent=y||null,this.tag=g?g.tag_name:"",this.indent_level=x||0,this.parser_token=g||null}function S(y){this._printer=y,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(y){var g=new R(this._current_frame,y,this._printer.indent_level);this._current_frame=g},S.prototype._try_pop_frame=function(y){var g=null;return y&&(g=y.parser_token,this._printer.indent_level=y.indent_level,this._current_frame=y.parent),g},S.prototype._get_frame=function(y,g){for(var x=this._current_frame;x&&!(y.indexOf(x.tag)!==-1);){if(g&&g.indexOf(x.tag)!==-1){x=null;break}x=x.parent}return x},S.prototype.try_pop=function(y,g){var x=this._get_frame([y],g);return this._try_pop_frame(x)},S.prototype.indent_to_tag=function(y){var g=this._get_frame(y);g&&(this._printer.indent_level=g.indent_level)};function v(y,g,x,j){this._source_text=y||"",g=g||{},this._js_beautify=x,this._css_beautify=j,this._tag_stack=null;var B=new u(g,"html");this._options=B,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
`,y&&s.test(y)&&(g=y.match(s)[0])),y=y.replace(i,`
`);var x=y.match(/^[\t ]*/)[0],j={text:"",type:""},B=new E,A=new n(this._options,x),H=new o(y,this._options).tokenize();this._tag_stack=new S(A);for(var F=null,w=H.next();w.type!==c.EOF;)w.type===c.TAG_OPEN||w.type===c.COMMENT?(F=this._handle_tag_open(A,w,B,j),B=F):w.type===c.ATTRIBUTE||w.type===c.EQUALS||w.type===c.VALUE||w.type===c.TEXT&&!B.tag_complete?F=this._handle_inside_tag(A,w,B,H):w.type===c.TAG_CLOSE?F=this._handle_tag_close(A,w,B):w.type===c.TEXT?F=this._handle_text(A,w,B):A.add_raw_token(w),j=F,w=H.next();var Y=A._output.get_code(g);return Y},v.prototype._handle_tag_close=function(y,g,x){var j={text:g.text,type:g.type};return y.alignment_size=0,x.tag_complete=!0,y.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),x.is_unformatted?y.add_raw_token(g):(x.tag_start_char==="<"&&(y.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&x.has_wrapped_attrs&&y.print_newline(!1)),y.print_token(g)),x.indent_content&&!(x.is_unformatted||x.is_content_unformatted)&&(y.indent(),x.indent_content=!1),!x.is_inline_element&&!(x.is_unformatted||x.is_content_unformatted)&&y.set_wrap_point(),j},v.prototype._handle_inside_tag=function(y,g,x,j){var B=x.has_wrapped_attrs,A={text:g.text,type:g.type};if(y.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),x.is_unformatted)y.add_raw_token(g);else if(x.tag_start_char==="{"&&g.type===c.TEXT)y.print_preserved_newlines(g)?(g.newlines=0,y.add_raw_token(g)):y.print_token(g);else{if(g.type===c.ATTRIBUTE?(y.set_space_before_token(!0),x.attr_count+=1):(g.type===c.EQUALS||g.type===c.VALUE&&g.previous.type===c.EQUALS)&&y.set_space_before_token(!1),g.type===c.ATTRIBUTE&&x.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(y.traverse_whitespace(g),B=B||g.newlines!==0),this._is_wrap_attributes_force)){var H=x.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&x.attr_count===1){var F=!0,w=0,Y;do{if(Y=j.peek(w),Y.type===c.ATTRIBUTE){F=!1;break}w+=1}while(w<4&&Y.type!==c.EOF&&Y.type!==c.TAG_CLOSE);H=!F}H&&(y.print_newline(!1),B=!0)}y.print_token(g),B=B||y.previous_token_wrapped(),x.has_wrapped_attrs=B}return A},v.prototype._handle_text=function(y,g,x){var j={text:g.text,type:"TK_CONTENT"};return x.custom_beautifier_name?this._print_custom_beatifier_text(y,g,x):x.is_unformatted||x.is_content_unformatted?y.add_raw_token(g):(y.traverse_whitespace(g),y.print_token(g)),j},v.prototype._print_custom_beatifier_text=function(y,g,x){var j=this;if(g.text!==""){var B=g.text,A,H=1,F="",w="";x.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:x.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:x.custom_beautifier_name==="html"&&(A=function(xe,ke){var Qe=new v(xe,ke,j._js_beautify,j._css_beautify);return Qe.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-y.indent_level);var Y=y.get_full_indent(H);if(B=B.replace(/\n[ \t]*$/,""),x.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!q){y.add_raw_token(g);return}F=Y+q[1]+`
`,B=q[4],q[5]&&(w=Y+q[5]),B=B.replace(/\n[ \t]*$/,""),(q[2]||q[3].indexOf(`
`)!==-1)&&(q=q[3].match(/[ \t]+$/),q&&(g.whitespace_before=q[0]))}if(B)if(A){var ie=function(){this.eol=`
`};ie.prototype=this._options.raw_options;var ge=new ie;B=A(Y+B,ge)}else{var Je=g.whitespace_before;Je&&(B=B.replace(new RegExp(`
(`+Je+")?","g"),`
`)),B=Y+B.replace(/\n/g,`
`+Y)}F&&(B?B=F+B+`
`+w:B=F+w),y.print_newline(!1),B&&(g.text=B,g.whitespace_before="",g.newlines=0,y.add_raw_token(g),y.print_newline(!0))}},v.prototype._handle_tag_open=function(y,g,x,j){var B=this._get_tag_open_token(g);return(x.is_unformatted||x.is_content_unformatted)&&!x.is_empty_element&&g.type===c.TAG_OPEN&&g.text.indexOf("</")===0?(y.add_raw_token(g),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(y.traverse_whitespace(g),this._set_tag_position(y,g,B,x,j),B.is_inline_element||y.set_wrap_point(),y.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=g.text.length+1),!B.tag_complete&&!B.is_unformatted&&(y.alignment_size=B.alignment_size),B};var E=function(y,g){if(this.parent=y||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!g)this.tag_complete=!0;else{var x;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(x=g.text.match(/^<([^\s>]*)/),this.tag_check=x?x[1]:""):(x=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=x?x[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.type===c.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||g.closed&&g.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};v.prototype._get_tag_open_token=function(y){var g=new E(this._tag_stack.get_parser_token(),y);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||C(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&C(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&C(g.tag_check,this._options.content_unformatted),g.is_inline_element=C(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},v.prototype._set_tag_position=function(y,g,x,j,B){if(x.is_empty_element||(x.is_end_tag?x.start_tag_token=this._tag_stack.try_pop(x.tag_name):(this._do_optional_end_element(x)&&(x.is_inline_element||y.print_newline(!1)),this._tag_stack.record_tag(x),(x.tag_name==="script"||x.tag_name==="style")&&!(x.is_unformatted||x.is_content_unformatted)&&(x.custom_beautifier_name=T(x.tag_check,g)))),C(x.tag_check,this._options.extra_liners)&&(y.print_newline(!1),y._output.just_added_blankline()||y.print_newline(!0)),x.is_empty_element){if(x.tag_start_char==="{"&&x.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),x.indent_content=!0;var A=y.current_line_has_match(/{{#if/);A||y.print_newline(!1)}x.tag_name==="!--"&&B.type===c.TAG_CLOSE&&j.is_end_tag&&x.text.indexOf(`
`)===-1||(x.is_inline_element||x.is_unformatted||y.print_newline(!1),this._calcluate_parent_multiline(y,x))}else if(x.is_end_tag){var H=!1;H=x.start_tag_token&&x.start_tag_token.multiline_content,H=H||!x.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(B.type===c.TAG_CLOSE&&x.start_tag_token===j)&&B.type!=="TK_CONTENT",(x.is_content_unformatted||x.is_unformatted)&&(H=!1),H&&y.print_newline(!1)}else x.indent_content=!x.custom_beautifier_name,x.tag_start_char==="<"&&(x.tag_name==="html"?x.indent_content=this._options.indent_inner_html:x.tag_name==="head"?x.indent_content=this._options.indent_head_inner_html:x.tag_name==="body"&&(x.indent_content=this._options.indent_body_inner_html)),!(x.is_inline_element||x.is_unformatted)&&(B.type!=="TK_CONTENT"||x.is_content_unformatted)&&y.print_newline(!1),this._calcluate_parent_multiline(y,x)},v.prototype._calcluate_parent_multiline=function(y,g){g.parent&&y._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var f=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],h=["a","audio","del","ins","map","noscript","video"];v.prototype._do_optional_end_element=function(y){var g=null;if(y.is_empty_element||!y.is_start_tag||!y.parent)return;if(y.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(y.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(y.tag_name==="dd"||y.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(y.parent.tag_name==="p"&&f.indexOf(y.tag_name)!==-1){var x=y.parent.parent;(!x||h.indexOf(x.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else y.tag_name==="rp"||y.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):y.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):y.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):y.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):y.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):y.tag_name==="tbody"||y.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):y.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(y.tag_name==="th"||y.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return y.parent=this._tag_stack.get_parser_token(),g},_.exports.Beautifier=v},function(_,p,m){var u=m(6).Options;function a(o){u.call(this,o,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}a.prototype=new u,_.exports.Options=a},function(_,p,m){var u=m(9).Tokenizer,a=m(9).TOKEN,o=m(13).Directives,c=m(14).TemplatablePattern,s=m(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},n=new o(/<\!--/,/-->/),O=function(T,C){u.call(this,T,C),this._current_tag_name="";var R=new c(this._input).read_options(this._options),S=new s(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(v).until_after(v)}};O.prototype=new u,O.prototype._is_comment=function(T){return!1},O.prototype._is_opening=function(T){return T.type===i.TAG_OPEN},O.prototype._is_closing=function(T,C){return T.type===i.TAG_CLOSE&&C&&((T.text===">"||T.text==="/>")&&C.text[0]==="<"||T.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(T,C){var R=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(i.EOF,""):(R=R||this._read_open_handlebars(S,C),R=R||this._read_attribute(S,T,C),R=R||this._read_close(S,C),R=R||this._read_raw_content(S,T,C),R=R||this._read_content_word(S),R=R||this._read_comment_or_cdata(S),R=R||this._read_processing(S),R=R||this._read_open(S,C),R=R||this._create_token(i.UNKNOWN,this._input.next()),R)},O.prototype._read_comment_or_cdata=function(T){var C=null,R=null,S=null;if(T==="<"){var v=this._input.peek(1);v==="!"&&(R=this.__patterns.comment.read(),R?(S=n.get_directives(R),S&&S.ignore==="start"&&(R+=n.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(C=this._create_token(i.COMMENT,R),C.directives=S)}return C},O.prototype._read_processing=function(T){var C=null,R=null,S=null;if(T==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(C=this._create_token(i.COMMENT,R),C.directives=S)}return C},O.prototype._read_open=function(T,C){var R=null,S=null;return C||T==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),S=this._create_token(i.TAG_OPEN,R)),S},O.prototype._read_open_handlebars=function(T,C){var R=null,S=null;return C||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),S=this._create_token(i.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),S=this._create_token(i.TAG_OPEN,R))),S},O.prototype._read_close=function(T,C){var R=null,S=null;return C&&(C.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(R=this._input.next(),T==="/"&&(R+=this._input.next()),S=this._create_token(i.TAG_CLOSE,R)):C.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(i.TAG_CLOSE,"}}"))),S},O.prototype._read_attribute=function(T,C,R){var S=null,v="";if(R&&R.text[0]==="<")if(T==="=")S=this._create_token(i.EQUALS,this._input.next());else if(T==='"'||T==="'"){var E=this._input.next();T==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),S=this._create_token(i.VALUE,E)}else v=this.__patterns.attribute.read(),v&&(C.type===i.EQUALS?S=this._create_token(i.VALUE,v):S=this._create_token(i.ATTRIBUTE,v));return S},O.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},O.prototype._read_raw_content=function(T,C,R){var S="";if(R&&R.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(C.type===i.TAG_CLOSE&&C.opened.text[0]==="<"&&C.text[0]!=="/"){var v=C.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var E=this._read_comment_or_cdata(T);if(E)return E.type=i.TEXT,E;S=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(S=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(i.TEXT,S):null},O.prototype._read_content_word=function(T){var C="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(C=this.__patterns.unformatted_content_delimiter.read())),C||(C=this.__patterns.word.read()),C)return this._create_token(i.TEXT,C)},_.exports.Tokenizer=O,_.exports.TOKEN=i}],I={};function r(_){var p=I[_];if(p!==void 0)return p.exports;var m=I[_]={exports:{}};return K[_](m,m.exports,r),m.exports}var M=r(18);U=M})();var G=U;if(!0)!(Z=[D,D("6UM0"),D("TXwP")],V=function(K){var I=D("6UM0"),r=D("TXwP");return{html_beautify:function(M,_){return G(M,_,I.js_beautify,r.css_beautify)}}}.apply(he,Z),V!==void 0&&(Gt.exports=V));else var P,k})()},"rAM+":function(Gt,he,D){"use strict";D.d(he,"a",function(){return V});var Z=D("Qw5x");function V(U,G){var P;if(typeof Symbol=="undefined"||U[Symbol.iterator]==null){if(Array.isArray(U)||(P=Object(Z.a)(U))||G&&U&&typeof U.length=="number"){P&&(U=P);var k=0,K=function(){};return{s:K,n:function(){return k>=U.length?{done:!0}:{done:!1,value:U[k++]}},e:function(p){throw p},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var I=!0,r=!1,M;return{s:function(){P=U[Symbol.iterator]()},n:function(){var p=P.next();return I=p.done,p},e:function(p){r=!0,M=p},f:function(){try{!I&&P.return!=null&&P.return()}finally{if(r)throw M}}}}},rUJ1:function(Gt,he){const D=/[&<>"']/,Z=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=S=>G[S];function k(S,v){if(v){if(D.test(S))return S.replace(Z,P)}else if(V.test(S))return S.replace(U,P);return S}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(S){return S.replace(K,(v,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const r=/(^|[^\[])\^/g;function M(S,v){S=S.source||S,v=v||"";const E={replace:(f,h)=>(h=h.source||h,h=h.replace(r,"$1"),S=S.replace(f,h),E),getRegex:()=>new RegExp(S,v)};return E}const _=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(S,v,E){if(S){let f;try{f=decodeURIComponent(I(E)).replace(_,"").toLowerCase()}catch(h){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}v&&!p.test(E)&&(E=s(v,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(f){return null}return E}const u={},a=/^[^:]+:\/*[^/]*$/,o=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(S,v){u[" "+S]||(a.test(S)?u[" "+S]=S+"/":u[" "+S]=T(S,"/",!0)),S=u[" "+S];const E=S.indexOf(":")===-1;return v.substring(0,2)==="//"?E?v:S.replace(o,"$1")+v:v.charAt(0)==="/"?E?v:S.replace(c,"$1")+v:S+v}const i={exec:function(){}};function n(S){let v=1,E,f;for(;v<arguments.length;v++){E=arguments[v];for(f in E)Object.prototype.hasOwnProperty.call(E,f)&&(S[f]=E[f])}return S}function O(S,v){const E=S.replace(/\|/g,(y,g,x)=>{let j=!1,B=g;for(;--B>=0&&x[B]==="\\";)j=!j;return j?"|":" |"}),f=E.split(/ \|/);let h=0;if(f.length>v)f.splice(v);else for(;f.length<v;)f.push("");for(;h<f.length;h++)f[h]=f[h].trim().replace(/\\\|/g,"|");return f}function T(S,v,E){const f=S.length;if(f===0)return"";let h=0;for(;h<f;){const y=S.charAt(f-h-1);if(y===v&&!E)h++;else if(y!==v&&E)h++;else break}return S.substr(0,f-h)}function C(S,v){if(S.indexOf(v[1])===-1)return-1;const E=S.length;let f=0,h=0;for(;h<E;h++)if(S[h]==="\\")h++;else if(S[h]===v[0])f++;else if(S[h]===v[1]&&(f--,f<0))return h;return-1}function R(S){S&&S.sanitize&&!S.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Gt.exports={escape:k,unescape:I,edit:M,cleanUrl:m,resolveUrl:s,noopTest:i,merge:n,splitCells:O,rtrim:T,findClosingBracket:C,checkSanitizeDeprecation:R}},sR1s:function(Gt,he,D){"use strict";D.d(he,"b",function(){return G}),D.d(he,"a",function(){return P}),D.d(he,"c",function(){return k}),D.d(he,"d",function(){return K});var Z=D("U8pU"),V="RC_TABLE_KEY";function U(I){return I==null?[]:Array.isArray(I)?I:[I]}function G(I,r){if(!r&&typeof r!="number")return I;for(var M=U(r),_=I,p=0;p<M.length;p+=1){if(!_)return null;var m=M[p];_=_[m]}return _}function P(I){var r=[],M={};return I.forEach(function(_){for(var p=_||{},m=p.key,u=p.dataIndex,a=m||U(u).join("-")||V;M[a];)a="".concat(a,"_next");M[a]=!0,r.push(a)}),r}function k(){var I={};function r(m,u){u&&Object.keys(u).forEach(function(a){var o=u[a];o&&Object(Z.a)(o)==="object"?(m[a]=m[a]||{},r(m[a],o)):m[a]=o})}for(var M=arguments.length,_=new Array(M),p=0;p<M;p++)_[p]=arguments[p];return _.forEach(function(m){r(I,m)}),I}function K(I){return I!=null}},sboe:function(Gt,he,D){"use strict";D.d(he,"a",function(){return U});var Z=D("q1tI"),V=D.n(Z),U=Z.createContext(null)},t23M:function(Gt,he,D){"use strict";var Z=D("VTBJ"),V=D("1OyB"),U=D("vuIU"),G=D("Ji7U"),P=D("LK+K"),k=D("q1tI"),K=D.n(k),I=D("m+aA"),r=D("Zm9Q"),M=D("Kwbf"),_=D("c+Xe"),p=D("bdgK"),m="rc-observer-key",u=function(a){Object(G.a)(c,a);var o=Object(P.a)(c);function c(){var s;return Object(V.a)(this,c),s=o.apply(this,arguments),s.resizeObserver=null,s.childNode=null,s.currentElement=null,s.state={width:0,height:0,offsetHeight:0,offsetWidth:0},s.onResize=function(i){var n=s.props.onResize,O=i[0].target,T=O.getBoundingClientRect(),C=T.width,R=T.height,S=O.offsetWidth,v=O.offsetHeight,E=Math.floor(C),f=Math.floor(R);if(s.state.width!==E||s.state.height!==f||s.state.offsetWidth!==S||s.state.offsetHeight!==v){var h={width:E,height:f,offsetWidth:S,offsetHeight:v};s.setState(h),n&&Promise.resolve().then(function(){n(Object(Z.a)(Object(Z.a)({},h),{},{offsetWidth:S,offsetHeight:v}))})}},s.setChildNode=function(i){s.childNode=i},s}return Object(U.a)(c,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var n=Object(I.a)(this.childNode||this),O=n!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=n),!this.resizeObserver&&n&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(n))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,n=Object(r.a)(i);if(n.length>1)Object(M.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(n.length===0)return Object(M.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=n[0];if(k.isValidElement(O)&&Object(_.c)(O)){var T=O.ref;n[0]=k.cloneElement(O,{ref:Object(_.a)(T,this.setChildNode)})}return n.length===1?n[0]:n.map(function(C,R){return!k.isValidElement(C)||"key"in C&&C.key!==null?C:k.cloneElement(C,{key:"".concat(m,"-").concat(R)})})}}]),c}(k.Component);u.displayName="ResizeObserver",he.a=u},t9D7:function(Gt,he,D){"use strict";D.d(he,"b",function(){return K}),D.d(he,"g",function(){return r}),D.d(he,"d",function(){return M}),D.d(he,"e",function(){return _}),D.d(he,"a",function(){return p}),D.d(he,"f",function(){return a}),D.d(he,"c",function(){return o});var Z=D("Vhoy"),V=D("MI8n"),U=D("pmY6"),G=D("Cg/j"),P=D("ic2d"),k=D("nEHx");const K=Object(G.c)("themeService");var I;(function(c){function s(i){return i&&typeof i=="object"&&typeof i.id=="string"}c.isThemeColor=s})(I||(I={}));function r(c){return{id:c}}var M;(function(c){function s(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||I.isThemeColor(R.color))}c.isThemeIcon=s;const i=new RegExp(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function n(R){const S=i.exec(R);if(!S)return;let[,v]=S;return{id:v}}c.fromString=n;function O(R,S){let v=R.id;const E=v.lastIndexOf("~");return E!==-1&&(v=v.substring(0,E)),S&&(v=`${v}~${S}`),{id:v}}c.modify=O;function T(R,S){var v,E;return R.id===S.id&&((v=R.color)===null||v===void 0?void 0:v.id)===((E=S.color)===null||E===void 0?void 0:E.id)}c.isEqual=T;function C(R,S){return{id:R.id,color:S?r(S):void 0}}c.asThemeIcon=C,c.asClassNameArray=Z.a.asClassNameArray,c.asClassName=Z.a.asClassName,c.asCSSSelector=Z.a.asCSSSelector})(M||(M={}));function _(c){switch(c){case k.a.DARK:return"vs-dark";case k.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new V.b}onColorThemeChange(c){return this.themingParticipants.push(c),this.onThemingParticipantAddedEmitter.fire(c),Object(U.i)(()=>{const s=this.themingParticipants.indexOf(c);this.themingParticipants.splice(s,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;P.a.add(p.ThemingContribution,u);function a(c){return u.onColorThemeChange(c)}class o extends U.a{constructor(c){super();this.themeService=c,this.theme=c.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(s=>this.onThemeChange(s)))}onThemeChange(c){this.theme=c,this.updateStyles()}updateStyles(){}}},ulZh:function(Gt,he,D){typeof window!="undefined"&&function(V,U){Gt.exports=U()}(this,function(){return function(Z){var V={};function U(G){if(V[G])return V[G].exports;var P=V[G]={i:G,l:!1,exports:{}};return Z[G].call(P.exports,P,P.exports,U),P.l=!0,P.exports}return U.m=Z,U.c=V,U.d=function(G,P,k){U.o(G,P)||Object.defineProperty(G,P,{enumerable:!0,get:k})},U.r=function(G){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},U.t=function(G,P){if(P&1&&(G=U(G)),P&8)return G;if(P&4&&typeof G=="object"&&G&&G.__esModule)return G;var k=Object.create(null);if(U.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:G}),P&2&&typeof G!="string")for(var K in G)U.d(k,K,function(I){return G[I]}.bind(null,K));return k},U.n=function(G){var P=G&&G.__esModule?function(){return G.default}:function(){return G};return U.d(P,"a",P),P},U.o=function(G,P){return Object.prototype.hasOwnProperty.call(G,P)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,V,U){"use strict";var G=Object.prototype.hasOwnProperty,P="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(P=!1));function K(_,p,m){this.fn=_,this.context=p,this.once=m||!1}function I(_,p,m,u,a){if(typeof m!="function")throw new TypeError("The listener must be a function");var o=new K(m,u||_,a),c=P?P+p:p;return _._events[c]?_._events[c].fn?_._events[c]=[_._events[c],o]:_._events[c].push(o):(_._events[c]=o,_._eventsCount++),_}function r(_,p){--_._eventsCount===0?_._events=new k:delete _._events[p]}function M(){this._events=new k,this._eventsCount=0}M.prototype.eventNames=function(){var p=[],m,u;if(this._eventsCount===0)return p;for(u in m=this._events)G.call(m,u)&&p.push(P?u.slice(1):u);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},M.prototype.listeners=function(p){var m=P?P+p:p,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var a=0,o=u.length,c=new Array(o);a<o;a++)c[a]=u[a].fn;return c},M.prototype.listenerCount=function(p){var m=P?P+p:p,u=this._events[m];return u?u.fn?1:u.length:0},M.prototype.emit=function(p,m,u,a,o,c){var s=P?P+p:p;if(!this._events[s])return!1;var i=this._events[s],n=arguments.length,O,T;if(i.fn){i.once&&this.removeListener(p,i.fn,void 0,!0);switch(n){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,m),!0;case 3:return i.fn.call(i.context,m,u),!0;case 4:return i.fn.call(i.context,m,u,a),!0;case 5:return i.fn.call(i.context,m,u,a,o),!0;case 6:return i.fn.call(i.context,m,u,a,o,c),!0}for(T=1,O=new Array(n-1);T<n;T++)O[T-1]=arguments[T];i.fn.apply(i.context,O)}else{var C=i.length,R;for(T=0;T<C;T++){i[T].once&&this.removeListener(p,i[T].fn,void 0,!0);switch(n){case 1:i[T].fn.call(i[T].context);break;case 2:i[T].fn.call(i[T].context,m);break;case 3:i[T].fn.call(i[T].context,m,u);break;case 4:i[T].fn.call(i[T].context,m,u,a);break;default:if(!O)for(R=1,O=new Array(n-1);R<n;R++)O[R-1]=arguments[R];i[T].fn.apply(i[T].context,O)}}}return!0},M.prototype.on=function(p,m,u){return I(this,p,m,u,!1)},M.prototype.once=function(p,m,u){return I(this,p,m,u,!0)},M.prototype.removeListener=function(p,m,u,a){var o=P?P+p:p;if(!this._events[o])return this;if(!m)return r(this,o),this;var c=this._events[o];if(c.fn)c.fn===m&&(!a||c.once)&&(!u||c.context===u)&&r(this,o);else{for(var s=0,i=[],n=c.length;s<n;s++)(c[s].fn!==m||a&&!c[s].once||u&&c[s].context!==u)&&i.push(c[s]);i.length?this._events[o]=i.length===1?i[0]:i:r(this,o)}return this},M.prototype.removeAllListeners=function(p){var m;return p?(m=P?P+p:p,this._events[m]&&r(this,m)):(this._events=new k,this._eventsCount=0),this},M.prototype.off=M.prototype.removeListener,M.prototype.addListener=M.prototype.on,M.prefixed=P,M.EventEmitter=M,Z.exports=M},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,V,U){(function(G){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,k=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,I=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(M,_,p){if(p=p||{},M=M.trim(),_=_.trim(),!_){if(!p.alwaysNormalize)return M;var m=r.parseURL(M);if(!m)throw new Error("Error trying to parse base URL.");return m.path=r.normalizePath(m.path),r.buildURLFromParts(m)}var u=r.parseURL(_);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return p.alwaysNormalize?(u.path=r.normalizePath(u.path),r.buildURLFromParts(u)):_;var a=r.parseURL(M);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var o=k.exec(a.path);a.netLoc=o[1],a.path=o[2]}a.netLoc&&!a.path&&(a.path="/");var c={scheme:a.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(c.netLoc=a.netLoc,u.path[0]!=="/"))if(!u.path)c.path=a.path,u.params||(c.params=a.params,u.query||(c.query=a.query));else{var s=a.path,i=s.substring(0,s.lastIndexOf("/")+1)+u.path;c.path=r.normalizePath(i)}return c.path===null&&(c.path=p.alwaysNormalize?r.normalizePath(u.path):u.path),r.buildURLFromParts(c)},parseURL:function(M){var _=P.exec(M);return _?{scheme:_[1]||"",netLoc:_[2]||"",path:_[3]||"",params:_[4]||"",query:_[5]||"",fragment:_[6]||""}:null},normalizePath:function(M){for(M=M.split("").reverse().join("").replace(K,"");M.length!==(M=M.replace(I,"")).length;);return M.split("").reverse().join("")},buildURLFromParts:function(M){return M.scheme+M.netLoc+M.path+M.params+M.query+M.fragment}};Z.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(Z,V,U){function G(p){var m={};function u(o){if(m[o])return m[o].exports;var c=m[o]={i:o,l:!1,exports:{}};return p[o].call(c.exports,c,c.exports,u),c.l=!0,c.exports}u.m=p,u.c=m,u.i=function(o){return o},u.d=function(o,c,s){u.o(o,c)||Object.defineProperty(o,c,{configurable:!1,enumerable:!0,get:s})},u.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},u.n=function(o){var c=o&&o.__esModule?function(){return o.default}:function(){return o};return u.d(c,"a",c),c},u.o=function(o,c){return Object.prototype.hasOwnProperty.call(o,c)},u.p="/",u.oe=function(o){throw console.error(o),o};var a=u(u.s=ENTRY_MODULE);return a.default||a}var P="[\\.|\\-|\\+|\\w|/|@]+",k="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function K(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function I(p){return!isNaN(1*p)}function r(p,m,u){var a={};a[u]=[];var o=m.toString(),c=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return a;for(var s=c[1],i=new RegExp("(\\\\n|\\W)"+K(s)+k,"g"),n;n=i.exec(o);){if(n[3]==="dll-reference")continue;a[u].push(n[3])}for(i=new RegExp("\\("+K(s)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+k,"g");n=i.exec(o);)p[n[2]]||(a[u].push(n[1]),p[n[2]]=U(n[1]).m),a[n[2]]=a[n[2]]||[],a[n[2]].push(n[4]);for(var O=Object.keys(a),T=0;T<O.length;T++)for(var C=0;C<a[O[T]].length;C++)I(a[O[T]][C])&&(a[O[T]][C]=1*a[O[T]][C]);return a}function M(p){var m=Object.keys(p);return m.reduce(function(u,a){return u||p[a].length>0},!1)}function _(p,m){for(var u={main:[m]},a={main:[]},o={main:{}};M(u);)for(var c=Object.keys(u),s=0;s<c.length;s++){var i=c[s],n=u[i],O=n.pop();if(o[i]=o[i]||{},o[i][O]||!p[i][O])continue;o[i][O]=!0,a[i]=a[i]||[],a[i].push(O);for(var T=r(p,p[i][O],i),C=Object.keys(T),R=0;R<C.length;R++)u[C[R]]=u[C[R]]||[],u[C[R]]=u[C[R]].concat(T[C[R]])}return a}Z.exports=function(p,m){m=m||{};var u={main:U.m},a=m.all?{main:Object.keys(u.main)}:_(u,p),o="";Object.keys(a).filter(function(O){return O!=="main"}).forEach(function(O){for(var T=0;a[O][T];)T++;a[O].push(T),u[O][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+O+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+a[O].map(function(C){return""+JSON.stringify(C)+": "+u[O][C].toString()}).join(",")+`});
`}),o=o+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+a.main.map(function(O){return""+JSON.stringify(O)+": "+u.main[O].toString()}).join(",")+"}))(self);";var c=new window.Blob([o],{type:"text/javascript"});if(m.bare)return c;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,i=s.createObjectURL(c),n=new window.Worker(i);return n.objectURL=i,n}},"./src/config.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"hlsDefaultConfig",function(){return R}),U.d(V,"mergeConfig",function(){return v}),U.d(V,"enableStreamingMode",function(){return E});var G=U("./src/controller/abr-controller.ts"),P=U("./src/controller/audio-stream-controller.ts"),k=U("./src/controller/audio-track-controller.ts"),K=U("./src/controller/subtitle-stream-controller.ts"),I=U("./src/controller/subtitle-track-controller.ts"),r=U("./src/controller/buffer-controller.ts"),M=U("./src/controller/timeline-controller.ts"),_=U("./src/controller/cap-level-controller.ts"),p=U("./src/controller/fps-controller.ts"),m=U("./src/controller/eme-controller.ts"),u=U("./src/controller/cmcd-controller.ts"),a=U("./src/utils/xhr-loader.ts"),o=U("./src/utils/fetch-loader.ts"),c=U("./src/utils/cues.ts"),s=U("./src/utils/mediakeys-helper.ts"),i=U("./src/utils/logger.ts");function n(){return n=Object.assign||function(f){for(var h=1;h<arguments.length;h++){var y=arguments[h];for(var g in y)Object.prototype.hasOwnProperty.call(y,g)&&(f[g]=y[g])}return f},n.apply(this,arguments)}function O(f,h){var y=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(f,x).enumerable})),y.push.apply(y,g)}return y}function T(f){for(var h=1;h<arguments.length;h++){var y=arguments[h]!=null?arguments[h]:{};h%2?O(Object(y),!0).forEach(function(g){C(f,g,y[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(y)):O(Object(y)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(y,g))})}return f}function C(f,h,y){return h in f?Object.defineProperty(f,h,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[h]=y,f}var R=T(T({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:r.default,capLevelController:_.default,fpsController:p.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},S()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:I.default,timelineController:M.TimelineController,audioStreamController:P.default,audioTrackController:k.default,emeController:m.default,cmcdController:u.default});function S(){return{cueHandler:c.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function v(f,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},f,h)}function E(f){var h=f.loader;if(h!==o.default&&h!==a.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var y=Object(o.fetchSupported)();y&&(f.loader=o.default,f.progressive=!0,f.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/utils/ewma-bandwidth-estimator.ts"),k=U("./src/events.ts"),K=U("./src/utils/buffer-helper.ts"),I=U("./src/errors.ts"),r=U("./src/types/loader.ts"),M=U("./src/utils/logger.ts");function _(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function p(u,a,o){return a&&_(u.prototype,a),o&&_(u,o),u}var m=function(){function u(o){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=o;var c=o.config;this.bwEstimator=new P.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var a=u.prototype;return a.registerListeners=function(){var c=this.hls;c.on(k.Events.FRAG_LOADING,this.onFragLoading,this),c.on(k.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(k.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var c=this.hls;c.off(k.Events.FRAG_LOADING,this.onFragLoading,this),c.off(k.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(k.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(c,s){var i=s.frag;if(i.type===r.PlaylistLevelType.MAIN&&!this.timer){var n;this.fragCurrent=i,this.partCurrent=(n=s.part)!=null?n:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(c,s){var i=this.hls.config;s.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.autoLevelEnabled,O=i.config,T=i.media;if(!c||!T)return;var C=s?s.stats:c.stats,R=s?s.duration:c.duration;if(C.aborted){M.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||T.paused||!T.playbackRate||!T.readyState)return;var S=performance.now()-C.loading.start,v=Math.abs(T.playbackRate);if(S<=500*R/v)return;var E=i.levels,f=i.minAutoLevel,h=E[c.level],y=C.total||Math.max(C.loaded,Math.round(R*h.maxBitrate/8)),g=Math.max(1,C.bwEstimate?C.bwEstimate/8:C.loaded*1e3/S),x=(y-C.loaded)/g,j=T.currentTime,B=(K.BufferHelper.bufferInfo(T,j,O.maxBufferHole).end-j)/v;if(B>=2*R/v||x<=B)return;var A=Number.POSITIVE_INFINITY,H;for(H=c.level-1;H>f;H--){var F=E[H].maxBitrate;if(A=R*F/(8*.8*g),A<B)break}if(A>=x)return;var w=this.bwEstimator.getEstimate();M.logger.warn("Fragment "+c.sn+(s?" part "+s.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+(Object(G.isFiniteNumber)(w)?(w/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+x.toFixed(3)+` s
Estimated load time for the next fragment: `+A.toFixed(3)+` s
Time to underbuffer: `+B.toFixed(3)+" s"),i.nextLoadLevel=H,this.bwEstimator.sample(S,C.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),i.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:s,stats:C})},a.onFragLoaded=function(c,s){var i=s.frag,n=s.part;if(i.type===r.PlaylistLevelType.MAIN&&Object(G.isFiniteNumber)(i.sn)){var O=n?n.stats:i.stats,T=n?n.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var C=this.hls.levels[i.level],R=(C.loaded?C.loaded.bytes:0)+O.loaded,S=(C.loaded?C.loaded.duration:0)+T;C.loaded={bytes:R,duration:S},C.realBitrate=Math.round(8*R/S)}if(i.bitrateTest){var v={stats:O,frag:i,part:n,id:i.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,v),i.bitrateTest=!1}}},a.onFragBuffered=function(c,s){var i=s.frag,n=s.part,O=n?n.stats:i.stats;if(O.aborted)return;if(i.type!==r.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var T=O.parsing.end-O.loading.start;this.bwEstimator.sample(T,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},a.onError=function(c,s){switch(s.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.maxAutoLevel,O=i.config,T=i.minAutoLevel,C=i.media,R=s?s.duration:c?c.duration:0,S=C?C.currentTime:0,v=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,f=(K.BufferHelper.bufferInfo(C,S,O.maxBufferHole).end-S)/v,h=this.findBestLevel(E,T,n,f,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(h>=0)return h;M.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var y=R?Math.min(R,O.maxStarvationDelay):O.maxStarvationDelay,g=O.abrBandWidthFactor,x=O.abrBandWidthUpFactor;if(!f){var j=this.bitrateTestDelay;if(j){var B=R?Math.min(R,O.maxLoadingDelay):O.maxLoadingDelay;y=B-j,M.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*y)+" ms"),g=x=1}}return h=this.findBestLevel(E,T,n,f+y,g,x),Math.max(h,0)},a.findBestLevel=function(c,s,i,n,O,T){for(var C,R=this.fragCurrent,S=this.partCurrent,v=this.lastLoadedFragLevel,E=this.hls.levels,f=E[v],h=!!(f!=null&&(C=f.details)!==null&&C!==void 0&&C.live),y=f==null?void 0:f.codecSet,g=S?S.duration:R?R.duration:0,x=i;x>=s;x--){var j=E[x];if(!j||y&&j.codecSet!==y)continue;var B=j.details,A=(S?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||g,H=void 0;x<=v?H=O*c:H=T*c;var F=E[x].maxBitrate,w=F*A/H;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(H)+"/"+F+"/"+A+"/"+n+"/"+w),H>F&&(!w||h&&!this.bitrateTestDelay||w<n))return x}return-1},p(u,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,s=this.bwEstimator;if(c!==-1&&(!s||!s.canEstimate()))return c;var i=this.getNextABRAutoLevel();return c!==-1&&(i=Math.min(c,i)),i},set:function(c){this._nextAutoLevel=c}}]),u}();V.default=m},"./src/controller/audio-stream-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/controller/base-stream-controller.ts"),k=U("./src/events.ts"),K=U("./src/utils/buffer-helper.ts"),I=U("./src/controller/fragment-tracker.ts"),r=U("./src/types/level.ts"),M=U("./src/types/loader.ts"),_=U("./src/loader/fragment.ts"),p=U("./src/demux/chunk-cache.ts"),m=U("./src/demux/transmuxer-interface.ts"),u=U("./src/types/transmuxer.ts"),a=U("./src/controller/fragment-finders.ts"),o=U("./src/utils/discontinuities.ts"),c=U("./src/errors.ts"),s=U("./src/utils/logger.ts");function i(){return i=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var v=arguments[S];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E])}return R},i.apply(this,arguments)}function n(R,S){R.prototype=Object.create(S.prototype),R.prototype.constructor=R,O(R,S)}function O(R,S){return O=Object.setPrototypeOf||function(E,f){return E.__proto__=f,E},O(R,S)}var T=100,C=function(R){n(S,R);function S(E,f){var h;return h=R.call(this,E,f,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var v=S.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var f=this.hls;f.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(k.Events.ERROR,this.onError,this),f.on(k.Events.BUFFER_RESET,this.onBufferReset,this),f.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var f=this.hls;f.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(k.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(k.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(k.Events.ERROR,this.onError,this),f.off(k.Events.BUFFER_RESET,this.onBufferReset,this),f.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(k.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(k.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(f,h){var y=h.frag,g=h.id,x=h.initPTS;if(g==="main"){var j=y.cc;this.initPTS[y.cc]=x,this.log("InitPTS for cc: "+j+" found from main: "+x),this.videoTrackCC=j,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=P.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,h>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},v.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var f,h=this.levels,y=this.trackId,g=h==null||((f=h[y])===null||f===void 0)?void 0:f.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var x,j=performance.now(),B=this.retryDate;(!B||j>=B||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var H=A.frag,F=A.part,w=A.cache,Y=A.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var q=w.flush(),ie={frag:H,part:F,payload:q,networkDetails:null};this._handleFragmentLoadProgress(ie),Y&&R.prototype._handleFragmentLoadComplete.call(this,ie)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ge=this.getLoadPosition(),Je=K.BufferHelper.bufferInfo(this.mediaBuffer,ge,this.config.maxBufferHole),xe=Object(a.fragmentWithinToleranceTest)(Je.end,this.config.maxFragLookUpTolerance,H);xe<0&&(s.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+Je.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},v.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:f,y=h.buffered;!this.loadedmetadata&&y.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},v.doTickIdle=function(){var f,h,y=this.hls,g=this.levels,x=this.media,j=this.trackId,B=y.config;if(!g||!g[j])return;if(!x&&(this.startFragRequested||!B.startFragPrefetch))return;var A=g[j],H=A.details;if(!H||H.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(H)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,_.ElementaryStreamTypes.AUDIO,M.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,M.PlaylistLevelType.AUDIO);if(F===null)return;var w=F.len,Y=this.getMaxBufferLength(),q=this.audioSwitch;if(w>=Y&&!q)return;if(!q&&this._streamEnded(F,H)){y.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var ie=H.fragments,ge=ie[0].start,Je=F.end;if(q){var xe=this.getLoadPosition();Je=xe,H.PTSKnown&&xe<ge&&((F.end>ge||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=ge+.05))}var ke=this.getNextFragment(Je,H);if(!ke){this.bufferFlushed=!0;return}((f=ke.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((h=ke.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(ke,H):this.loadFragment(ke,H,Je)},v.getMaxBufferLength=function(){var f=R.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return h===null?f:Math.max(f,h.len)},v.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(f,h){var y=h.audioTracks;this.resetTransmuxer(),this.levels=y.map(function(g){return new r.Level(g)})},v.onAudioTrackSwitching=function(f,h){var y=!!h.url;this.trackId=h.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),y?this.setInterval(T):this.resetTransmuxer(),y?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(f,h){this.mainDetails=h.details},v.onAudioTrackLoaded=function(f,h){var y,g=this.levels,x=h.details,j=h.id;if(!g){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var B=g[j],A=0;if(x.live||(y=B.details)!==null&&y!==void 0&&y.live){var H=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!H)return;!B.details&&x.hasProgramDateTime&&H.hasProgramDateTime?(Object(o.alignMediaPlaylistByPDT)(x,H),A=x.fragments[0].start):A=this.alignPlaylists(x,B.details)}B.details=x,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(B.details,A),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=P.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(f){var h,y=f.frag,g=f.part,x=f.payload,j=this.config,B=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+y.sn+" of level "+y.level+" will not be buffered");return}var H=A[B];console.assert(H,"Audio track is defined on fragment load progress");var F=H.details;console.assert(F,"Audio track details are defined on fragment load progress");var w=j.defaultAudioCodec||H.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new m.default(this.hls,M.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var q=this.initPTS[y.cc],ie=(h=y.initSegment)===null||h===void 0?void 0:h.data;if(q!==void 0){var ge=!1,Je=g?g.index:-1,xe=Je!==-1,ke=new u.ChunkMetadata(y.level,y.sn,y.stats.chunkCount,x.byteLength,Je,xe);Y.push(x,ie,w,"",y,g,F.totalduration,ge,ke,q)}else{s.logger.log("Unknown video PTS for cc "+y.cc+", waiting for video PTS before demuxing audio frag "+y.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+B);var Qe=this.waitingData=this.waitingData||{frag:y,part:g,cache:new p.default,complete:!1},Ye=Qe.cache;Ye.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,f)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(f,h){var y=h.tracks.audio;y&&(this.mediaBuffer=y.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},v.onFragBuffered=function(f,h){var y=h.frag,g=h.part;if(y.type!==M.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(y)){this.warn("Fragment "+y.sn+(g?" p: "+g.index:"")+" of level "+y.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}y.sn!=="initSegment"&&(this.fragPrevious=y,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(y,g)},v.onError=function(f,h){switch(h.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.AUDIO,h);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=h.fatal?P.State.ERROR:P.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var y=!0,g=this.getFwdBufferInfo(this.mediaBuffer,M.PlaylistLevelType.AUDIO);g&&g.len>.5&&(y=!this.reduceMaxBufferLength(g.len)),y&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(f,h){var y=h.type;y===_.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(f){var h,y="audio",g=this.hls,x=f.remuxResult,j=f.chunkMeta,B=this.getCurrentContext(j);if(!B){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var A=B.frag,H=B.part,F=x.audio,w=x.text,Y=x.id3,q=x.initSegment;if(this.fragContextChanged(A))return;if(this.state=P.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),q!=null&&q.tracks&&(this._bufferInitSegment(q.tracks,A,j),g.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:y,tracks:q.tracks})),F){var ie=F.startPTS,ge=F.endPTS,Je=F.startDTS,xe=F.endDTS;H&&(H.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:ge,startDTS:Je,endDTS:xe}),A.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,ie,ge,Je,xe),this.bufferFragmentData(F,A,H,j)}if(Y!=null&&(h=Y.samples)!==null&&h!==void 0&&h.length){var ke=i({frag:A,id:y},Y);g.trigger(k.Events.FRAG_PARSING_METADATA,ke)}if(w){var Qe=i({frag:A,id:y},w);g.trigger(k.Events.FRAG_PARSING_USERDATA,Qe)}},v._bufferInitSegment=function(f,h,y){if(this.state!==P.State.PARSING)return;f.video&&delete f.video;var g=f.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(k.Events.BUFFER_CODECS,f);var x=g.initSegment;if(x!=null&&x.byteLength){var j={type:"audio",frag:h,part:null,chunkMeta:y,parent:h.type,data:x};this.hls.trigger(k.Events.BUFFER_APPENDING,j)}this.tick()},v.loadFragment=function(f,h,y){var g=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||g===I.FragmentState.NOT_LOADED||g===I.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):h.live&&!Object(G.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,f,h,y)))},v.completeAudioSwitch=function(){var f=this.hls,h=this.media,y=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:y})},S}(P.default);V.default=C},"./src/controller/audio-track-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/errors.ts"),k=U("./src/controller/base-playlist-controller.ts"),K=U("./src/types/loader.ts");function I(m,u){for(var a=0;a<u.length;a++){var o=u[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}function r(m,u,a){return u&&I(m.prototype,u),a&&I(m,a),m}function M(m,u){m.prototype=Object.create(u.prototype),m.prototype.constructor=m,_(m,u)}function _(m,u){return _=Object.setPrototypeOf||function(o,c){return o.__proto__=c,o},_(m,u)}var p=function(m){M(u,m);function u(o){var c;return c=m.call(this,o,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var a=u.prototype;return a.registerListeners=function(){var c=this.hls;c.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(G.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var c=this.hls;c.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(G.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(c,s){this.tracks=s.audioTracks||[]},a.onAudioTrackLoaded=function(c,s){var i=s.id,n=s.details,O=this.tracksInGroup[i];if(!O){this.warn("Invalid audio track id "+i);return}var T=O.details;O.details=s.details,this.log("audioTrack "+i+" loaded ["+n.startSN+"-"+n.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,s,T))},a.onLevelLoading=function(c,s){this.switchLevel(s.level)},a.onLevelSwitching=function(c,s){this.switchLevel(s.level)},a.switchLevel=function(c){var s=this.hls.levels[c];if(!(s!=null&&s.audioGroupIds))return;var i=s.audioGroupIds[s.urlId];if(this.groupId!==i){this.groupId=i;var n=this.tracks.filter(function(T){return!i||T.groupId===i});this.selectDefaultTrack&&!n.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var O={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(G.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},a.onError=function(c,s){if(m.prototype.onError.call(this,c,s),s.fatal||!s.context)return;s.context.type===K.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},a.setAudioTrack=function(c){var s=this.tracksInGroup;if(c<0||c>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=s[this.trackId];this.log("Now switching to audio-track index "+c);var n=s[c],O=n.id,T=n.groupId,C=T===void 0?"":T,R=n.name,S=n.type,v=n.url;if(this.trackId=c,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(G.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:C,name:R,type:S,url:v}),n.details&&!n.details.live)return;var E=this.switchParams(n.url,i==null?void 0:i.details);this.loadPlaylist(E)},a.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,i=this.findTrackId(s)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(c){for(var s=this.tracksInGroup,i=0;i<s.length;i++){var n=s[i];if((!this.selectDefaultTrack||n.default)&&(!c||c===n.name))return n.id}return-1},a.loadPlaylist=function(c){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var i=s.id,n=s.groupId,O=s.url;if(c)try{O=c.addDirectives(O)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(G.Events.AUDIO_TRACK_LOADING,{url:O,id:i,groupId:n,deliveryDirectives:c||null})}},r(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),u}(k.default);V.default=p},"./src/controller/base-playlist-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return r});var G=U("./src/polyfills/number.ts"),P=U("./src/types/level.ts"),k=U("./src/controller/level-helper.ts"),K=U("./src/utils/logger.ts"),I=U("./src/errors.ts"),r=function(){function M(p,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,m+":"),this.warn=K.logger.warn.bind(K.logger,m+":"),this.hls=p}var _=M.prototype;return _.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},_.onError=function(m,u){u.fatal&&u.type===I.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},_.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},_.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},_.stopLoad=function(){this.canLoad=!1,this.clearTimer()},_.switchParams=function(m,u){var a=u==null?void 0:u.renditionReports;if(a)for(var o=0;o<a.length;o++){var c=a[o],s=""+c.URI;if(s===m.substr(-s.length)){var i=parseInt(c["LAST-MSN"]),n=parseInt(c["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var O=Math.min(u.age-u.partTarget,u.targetduration);n!==void 0&&O>u.partTarget&&(n+=1)}if(Object(G.isFiniteNumber)(i))return new P.HlsUrlParameters(i,Object(G.isFiniteNumber)(n)?n:void 0,P.HlsSkip.No)}}},_.loadPlaylist=function(m){},_.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},_.playlistLoaded=function(m,u,a){var o=this,c=u.details,s=u.stats,i=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(c.advancedDateTime=Date.now()-i,c.live||a!=null&&a.live){if(c.reloaded(a),a&&this.log("live playlist "+m+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),a&&c.fragments.length>0&&Object(k.mergeDetails)(a,c),!this.canLoad||!c.live)return;var n,O=void 0,T=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var C=this.hls.config.lowLatencyMode,R=c.lastPartSn,S=c.endSN,v=c.lastPartIndex,E=v!==-1,f=R===S,h=C?0:v;E?(O=f?S+1:R,T=f?h:v+1):O=S+1;var y=c.age,g=y+c.ageHeader,x=Math.min(g-c.partTarget,c.targetduration*1.5);if(x>0){if(a&&x>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+x+" with playlist age: "+c.age),x=0;else{var j=Math.floor(x/c.targetduration);if(O+=j,T!==void 0){var B=Math.round(x%c.targetduration/c.partTarget);T+=B}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+y.toFixed(2)+"s goal: "+x+" skip sn "+j+" to part "+T)}c.tuneInGoal=x}if(n=this.getDeliveryDirectives(c,u.deliveryDirectives,O,T),C||!f){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(c,u.deliveryDirectives,O,T);var A=Object(k.computeReloadInterval)(c,s);O!==void 0&&c.canBlockReload&&(A-=c.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return o.loadPlaylist(n)},A)}else this.clearTimer()},_.getDeliveryDirectives=function(m,u,a,o){var c=Object(P.getSkipValue)(m,a);return u!=null&&u.skip&&m.deltaUpdateFailed&&(a=u.msn,o=u.part,c=P.HlsSkip.No),new P.HlsUrlParameters(a,o,c)},_.retryLoadingOrFail=function(m){var u=this,a=this.hls.config,o=this.retryCount<a.levelLoadingMaxRetry;if(o){var c;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(c=m.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return o},M}()},"./src/controller/base-stream-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"State",function(){return S}),U.d(V,"default",function(){return v});var G=U("./src/polyfills/number.ts"),P=U("./src/task-loop.ts"),k=U("./src/controller/fragment-tracker.ts"),K=U("./src/utils/buffer-helper.ts"),I=U("./src/utils/logger.ts"),r=U("./src/events.ts"),M=U("./src/errors.ts"),_=U("./src/types/transmuxer.ts"),p=U("./src/utils/mp4-tools.ts"),m=U("./src/utils/discontinuities.ts"),u=U("./src/controller/fragment-finders.ts"),a=U("./src/controller/level-helper.ts"),o=U("./src/loader/fragment-loader.ts"),c=U("./src/crypt/decrypter.ts"),s=U("./src/utils/time-ranges.ts"),i=U("./src/types/loader.ts");function n(E,f){for(var h=0;h<f.length;h++){var y=f[h];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}function O(E,f,h){return f&&n(E.prototype,f),h&&n(E,h),E}function T(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function C(E,f){E.prototype=Object.create(f.prototype),E.prototype.constructor=E,R(E,f)}function R(E,f){return R=Object.setPrototypeOf||function(y,g){return y.__proto__=g,y},R(E,f)}var S={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},v=function(E){C(f,E);function f(y,g,x){var j;return j=E.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=S.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=x,j.log=I.logger.log.bind(I.logger,x+":"),j.warn=I.logger.warn.bind(I.logger,x+":"),j.hls=y,j.fragmentLoader=new o.default(y.config),j.fragmentTracker=g,j.config=y.config,j.decrypter=new c.default(y,y.config),y.on(r.Events.KEY_LOADED,j.onKeyLoaded,T(j)),j}var h=f.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(g){},h.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},h._streamEnded=function(g,x){var j=this.fragCurrent,B=this.fragmentTracker;if(!x.live&&j&&j.sn===x.endSN&&!g.nextStart){var A=B.getState(j);return A===k.FragmentState.PARTIAL||A===k.FragmentState.OK}return!1},h.onMediaAttached=function(g,x){var j=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(B.startPosition)},h.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var g=this.config,x=this.fragCurrent,j=this.media,B=this.mediaBuffer,A=this.state,H=j?j.currentTime:0,F=K.BufferHelper.bufferInfo(B||j,H,g.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+A),A===S.ENDED)this.resetLoadingState();else if(x&&!F.len){var w=g.maxFragLookUpTolerance,Y=x.start-w,q=x.start+x.duration+w,ie=H>q;(H<Y||ie)&&(ie&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=H),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(g,x){if(this.state!==S.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=S.IDLE;var j=this.levels[x.frag.level].details;j&&this.loadFragment(x.frag,j,x.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,E.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(g,x){this.log("Loading key for "+g.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=S.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(r.Events.KEY_LOADING,{frag:g})},h.loadFragment=function(g,x,j){this._loadFragForPlayback(g,x,j)},h._loadFragForPlayback=function(g,x,j){var B=this,A=function(F){if(B.fragContextChanged(g)){B.warn("Fragment "+g.sn+(F.part?" p: "+F.part.index:"")+" of level "+g.level+" was dropped during download."),B.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,B._handleFragmentLoadProgress(F)};this._doFragLoad(g,x,j,A).then(function(H){if(!H)return;B.fragLoadError=0;var F=B.state;if(B.fragContextChanged(g)){(F===S.FRAG_LOADING||F===S.BACKTRACKING||!B.fragCurrent&&F===S.PARSING)&&(B.fragmentTracker.removeFragment(g),B.state=S.IDLE);return}if("payload"in H&&(B.log("Loaded fragment "+g.sn+" of level "+g.level),B.hls.trigger(r.Events.FRAG_LOADED,H),B.state===S.BACKTRACKING)){B.fragmentTracker.backtrack(g,H),B.resetFragmentLoading(g);return}B._handleFragmentLoadComplete(H)}).catch(function(H){B.warn(H),B.resetFragmentLoading(g)})},h.flushMainBuffer=function(g,x,j){if(j===void 0&&(j=null),!(g-x))return;var B={startOffset:g,endOffset:x,type:j};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,B)},h._loadInitSegment=function(g){var x=this;this._doFragLoad(g).then(function(j){if(!j||x.fragContextChanged(g)||!x.levels)throw new Error("init load aborted");return j}).then(function(j){var B=x.hls,A=j.payload,H=g.decryptdata;if(A&&A.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var F=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(A),H.key.buffer,H.iv.buffer).then(function(w){var Y=self.performance.now();return B.trigger(r.Events.FRAG_DECRYPTED,{frag:g,payload:w,stats:{tstart:F,tdecrypt:Y}}),j.payload=w,j})}return j}).then(function(j){var B=x.fragCurrent,A=x.hls,H=x.levels;if(!H)throw new Error("init load aborted, missing levels");var F=H[g.level].details;console.assert(F,"Level details are defined when init segment is loaded");var w=g.stats;x.state=S.IDLE,x.fragLoadError=0,g.data=new Uint8Array(j.payload),w.parsing.start=w.buffering.start=self.performance.now(),w.parsing.end=w.buffering.end=self.performance.now(),j.frag===B&&A.trigger(r.Events.FRAG_BUFFERED,{stats:w,frag:B,part:null,id:g.type}),x.tick()}).catch(function(j){x.warn(j),x.resetFragmentLoading(g)})},h.fragContextChanged=function(g){var x=this.fragCurrent;return!g||!x||g.level!==x.level||g.sn!==x.sn||g.urlId!==x.urlId},h.fragBufferedComplete=function(g,x){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+s.default.toString(K.BufferHelper.getBuffered(j))),this.state=S.IDLE,this.tick()},h._handleFragmentLoadComplete=function(g){var x=this.transmuxer;if(!x)return;var j=g.frag,B=g.part,A=g.partsLoaded,H=!A||A.length===0||A.some(function(w){return!w}),F=new _.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,B?B.index:-1,!H);x.flush(F)},h._handleFragmentLoadProgress=function(g){},h._doFragLoad=function(g,x,j,B){var A=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(g.start,j||0),this.config.lowLatencyMode&&x){var H=x.partList;if(H&&B){j>g.end&&x.fragmentHint&&(g=x.fragmentHint);var F=this.getNextPart(H,g,j);if(F>-1){var w=H[F];return this.log("Loading part sn: "+g.sn+" p: "+w.index+" cc: "+g.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+F+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=w.start+w.duration,this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,part:H[F],targetBufferTime:j}),this.doFragPartsLoad(g,H,F,B).catch(function(Y){return A.handleFragLoadError(Y)})}else if(!g.url||this.loadedEndOfParts(H,j))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(j.toFixed(3))),Object(G.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,targetBufferTime:j}),this.fragmentLoader.load(g,B).catch(function(Y){return A.handleFragLoadError(Y)})},h.doFragPartsLoad=function(g,x,j,B){var A=this;return new Promise(function(H,F){var w=[],Y=function q(ie){var ge=x[ie];A.fragmentLoader.loadPart(g,ge,B).then(function(Je){w[ge.index]=Je;var xe=Je.part;A.hls.trigger(r.Events.FRAG_LOADED,Je);var ke=x[ie+1];if(ke&&ke.fragment===g)q(ie+1);else return H({frag:g,part:xe,partsLoaded:w})}).catch(F)};Y(j)})},h.handleFragLoadError=function(g){var x=g.data;return x&&x.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(r.Events.ERROR,x),null},h._handleTransmuxerFlush=function(g){var x=this.getCurrentContext(g);if(!x||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var j=x.frag,B=x.part,A=x.level,H=self.performance.now();j.stats.parsing.end=H,B&&(B.stats.parsing.end=H),this.updateLevelTiming(j,B,A,g.partial)},h.getCurrentContext=function(g){var x=this.levels,j=g.level,B=g.sn,A=g.part;if(!x||!x[j])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+j+". The current chunk will not be buffered."),null;var H=x[j],F=A>-1?Object(a.getPartWith)(H,B,A):null,w=F?F.fragment:Object(a.getFragmentWithSN)(H,B,this.fragCurrent);return w?{frag:w,part:F,level:H}:null},h.bufferFragmentData=function(g,x,j,B){if(!g||this.state!==S.PARSING)return;var A=g.data1,H=g.data2,F=A;if(A&&H&&(F=Object(p.appendUint8Array)(A,H)),!F||!F.length)return;var w={type:g.type,frag:x,part:j,chunkMeta:B,parent:x.type,data:F};this.hls.trigger(r.Events.BUFFER_APPENDING,w),g.dropped&&g.independent&&!j&&this.flushBufferGap(x)},h.flushBufferGap=function(g){var x=this.media;if(!x)return;if(!K.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,g.start);return}var j=x.currentTime,B=K.BufferHelper.bufferInfo(x,j,0),A=g.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),F=Math.max(Math.min(g.start-H,B.end-H),j+H);g.start-F>H&&this.flushMainBuffer(F,g.start)},h.getFwdBufferInfo=function(g,x){var j=this.config,B=this.getLoadPosition();if(!Object(G.isFiniteNumber)(B))return null;var A=K.BufferHelper.bufferInfo(g,B,j.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(B,x);if(H&&A.nextStart<H.end)return K.BufferHelper.bufferInfo(g,B,Math.max(A.nextStart,j.maxBufferHole))}return A},h.getMaxBufferLength=function(g){var x=this.config,j;return g?j=Math.max(8*x.maxBufferSize/g,x.maxBufferLength):j=x.maxBufferLength,Math.min(j,x.maxMaxBufferLength)},h.reduceMaxBufferLength=function(g){var x=this.config,j=g||x.maxBufferLength;return x.maxMaxBufferLength>=j?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(g,x){var j,B,A=x.fragments,H=A.length;if(!H)return null;var F=this.config,w=A[0].start,Y;if(x.live){var q=F.initialLiveManifestSize;if(H<q)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+q+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(x,A),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:g)}else g<=w&&(Y=A[0]);if(!Y){var ie=F.lowLatencyMode?x.partEnd:x.fragmentEnd;Y=this.getFragmentAtPosition(g,ie,x)}return(j=Y)!==null&&j!==void 0&&j.initSegment&&!((B=Y)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},h.getNextPart=function(g,x,j){for(var B=-1,A=!1,H=!0,F=0,w=g.length;F<w;F++){var Y=g[F];if(H=H&&!Y.independent,B>-1&&j<Y.start)break;var q=Y.loaded;!q&&(A||Y.independent||H)&&Y.fragment===x&&(B=F),A=q}return B},h.loadedEndOfParts=function(g,x){var j=g[g.length-1];return j&&x>j.start&&j.loaded},h.getInitialLiveFragment=function(g,x){var j=this.fragPrevious,B=null;if(j){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),B=Object(u.findFragmentByPDT)(x,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var A=j.sn+1;if(A>=g.startSN&&A<=g.endSN){var H=x[A-g.startSN];j.cc===H.cc&&(B=H,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(u.findFragWithCC)(x,j.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(B=this.getFragmentAtPosition(F,this.bitrateTest?g.fragmentEnd:g.edge,g))}return B},h.getFragmentAtPosition=function(g,x,j){var B=this.config,A=this.fragPrevious,H=j.fragments,F=j.endSN,w=j.fragmentHint,Y=B.maxFragLookUpTolerance,q=!!(B.lowLatencyMode&&j.partList&&w);q&&w&&!this.bitrateTest&&(H=H.concat(w),F=w.sn);var ie;if(g<x){var ge=g>x-Y?0:Y;ie=Object(u.findFragmentByPTS)(A,H,g,ge)}else ie=H[H.length-1];if(ie){var Je=ie.sn-j.startSN,xe=A&&ie.level===A.level,ke=H[Je+1],Qe=this.fragmentTracker.getState(ie);if(Qe===k.FragmentState.BACKTRACKED){ie=null;for(var Ye=Je;H[Ye]&&this.fragmentTracker.getState(H[Ye])===k.FragmentState.BACKTRACKED;)A?ie=H[Ye--]:ie=H[--Ye];ie||(ie=ke)}else A&&ie.sn===A.sn&&!q&&(xe&&(ie.sn<F&&this.fragmentTracker.getState(ke)!==k.FragmentState.OK?(this.log("SN "+ie.sn+" just loaded, load next one: "+ke.sn),ie=ke):ie=null))}return ie},h.synchronizeToLiveEdge=function(g){var x=this.config,j=this.media;if(!j)return;var B=this.hls.liveSyncPosition,A=j.currentTime,H=g.fragments[0].start,F=g.edge,w=A>=H-x.maxFragLookUpTolerance&&A<=F;if(B!==null&&j.duration>B&&(A<B||!w)){var Y=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*g.targetduration;(!w&&j.readyState<4||A<F-Y)&&(this.loadedmetadata||(this.nextLoadPosition=B),j.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+B.toFixed(3)),j.currentTime=B))}},h.alignPlaylists=function(g,x){var j=this.levels,B=this.levelLastLoaded,A=this.fragPrevious,H=B!==null?j[B]:null,F=g.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var w=g.fragments[0].start,Y=!x,q=g.alignedSliding&&Object(G.isFiniteNumber)(w);if(Y||!q&&!w){Object(m.alignStream)(A,H,g);var ie=g.fragments[0].start;return this.log("Live playlist sliding: "+ie.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+g.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+F),ie}return w},h.waitForCdnTuneIn=function(g){var x=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*x)},h.setStartPosition=function(g,x){var j=this.startPosition;if(j<x&&(j=-1),j===-1||this.lastCurrentTime===-1){var B=g.startTimeOffset;Object(G.isFiniteNumber)(B)?(j=x+B,B<0&&(j+=g.totalduration),j=Math.min(Math.max(x,j),x+g.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+j),this.startPosition=j):g.live?j=this.hls.liveSyncPosition||x:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},h.getLoadPosition=function(){var g=this.media,x=0;return this.loadedmetadata&&g?x=g.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},h.handleFragLoadAborted=function(g,x){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(x?" part"+x.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},h.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=S.IDLE)},h.onFragmentOrKeyLoadError=function(g,x){if(x.fatal)return;var j=x.frag;if(!j||j.type!==g)return;var B=this.fragCurrent;console.assert(B&&j.sn===B.sn&&j.level===B.level&&j.urlId===B.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+g+" "+j.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(g===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(I.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)},h.afterBufferFlushed=function(g,x,j){if(!g)return;var B=K.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(x,B,j),this.state===S.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},h.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[g].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(g,x,j,B){var A=this,H=j.details;console.assert(!!H,"level.details must be defined");var F=Object.keys(g.elementaryStreams).reduce(function(w,Y){var q=g.elementaryStreams[Y];if(q){var ie=q.endPTS-q.startPTS;if(ie<=0)return A.warn("Could not parse fragment "+g.sn+" "+Y+" duration reliably ("+ie+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),w||!1;var ge=B?0:Object(a.updateFragPTSDTS)(H,g,q.startPTS,q.endPTS,q.startDTS,q.endDTS);return A.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:H,level:j,drift:ge,type:Y,frag:g,start:q.startPTS,end:q.endPTS}),!0}return w},!1);F?(this.state=S.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:g,part:x})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(f,[{key:"state",get:function(){return this._state},set:function(g){var x=this._state;x!==g&&(this._state=g,this.log(x+"->"+g))}}]),f}(P.default)},"./src/controller/buffer-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return u});var G=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),k=U("./src/utils/logger.ts"),K=U("./src/errors.ts"),I=U("./src/utils/buffer-helper.ts"),r=U("./src/utils/mediasource-helper.ts"),M=U("./src/loader/fragment.ts"),_=U("./src/controller/buffer-operation-queue.ts"),p=Object(r.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function a(c){var s=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var i=s.hls,n=s.media,O=s.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),n&&(s.updateMediaElementDuration(),i.trigger(P.Events.MEDIA_ATTACHED,{media:n})),O&&O.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){k.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){k.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var o=a.prototype;return o.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},o.destroy=function(){this.unregisterListeners(),this.details=null},o.registerListeners=function(){var s=this.hls;s.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(P.Events.BUFFER_RESET,this.onBufferReset,this),s.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(P.Events.BUFFER_EOS,this.onBufferEos,this),s.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(P.Events.FRAG_PARSED,this.onFragParsed,this),s.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},o.unregisterListeners=function(){var s=this.hls;s.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(P.Events.BUFFER_RESET,this.onBufferReset,this),s.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(P.Events.BUFFER_EOS,this.onBufferEos,this),s.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(P.Events.FRAG_PARSED,this.onFragParsed,this),s.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},o._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new _.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},o.onManifestParsed=function(s,i){var n=2;(i.audio&&!i.video||!i.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},o.onMediaAttaching=function(s,i){var n=this.media=i.media;if(n&&p){var O=this.mediaSource=new p;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(O),this._objectUrl=n.src}},o.onMediaDetaching=function(){var s=this.media,i=this.mediaSource,n=this._objectUrl;if(i){if(k.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(O){k.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(n&&self.URL.revokeObjectURL(n),s.src===n?(s.removeAttribute("src"),s.load()):k.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(P.Events.MEDIA_DETACHED,void 0)},o.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(i){var n=s.sourceBuffer[i];try{n&&(s.removeBufferListeners(i),s.mediaSource&&s.mediaSource.removeSourceBuffer(n),s.sourceBuffer[i]=void 0)}catch(O){k.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",O)}}),this._initSourceBuffer()},o.onBufferCodecs=function(s,i){var n=this,O=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(T){if(O){var C=n.tracks[T];if(C&&typeof C.buffer.changeType=="function"){var R=i[T],S=R.codec,v=R.levelCodec,E=R.container,f=(C.levelCodec||C.codec).replace(m,"$1"),h=(v||S).replace(m,"$1");if(f!==h){var y=E+";codecs="+(v||S);n.appendChangeType(T,y)}}}else n.pendingTracks[T]=i[T]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},o.appendChangeType=function(s,i){var n=this,O=this.operationQueue,T={execute:function(){var R=n.sourceBuffer[s];R&&(k.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+i),R.changeType(i)),O.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(R){k.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",R)}};O.append(T,s)},o.onBufferAppending=function(s,i){var n=this,O=this.hls,T=this.operationQueue,C=this.tracks,R=i.data,S=i.type,v=i.frag,E=i.part,f=i.chunkMeta,h=f.buffering[S],y=self.performance.now();h.start=y;var g=v.stats.buffering,x=E?E.stats.buffering:null;g.start===0&&(g.start=y),x&&x.start===0&&(x.start=y);var j=C.audio,B=S==="audio"&&f.id===1&&(j==null?void 0:j.container)==="audio/mpeg",A={execute:function(){if(h.executeStart=self.performance.now(),B){var F=n.sourceBuffer[S];if(F){var w=v.start-F.timestampOffset;Math.abs(w)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+w+") sn: "+v.sn+")"),F.timestampOffset=v.start)}}n.appendExecutor(R,S)},onStart:function(){},onComplete:function(){var F=self.performance.now();h.executeEnd=h.end=F,g.first===0&&(g.first=F),x&&x.first===0&&(x.first=F);var w=n.sourceBuffer,Y={};for(var q in w)Y[q]=I.BufferHelper.getBuffered(w[q]);n.appendError=0,n.hls.trigger(P.Events.BUFFER_APPENDED,{type:S,frag:v,part:E,chunkMeta:f,parent:v.type,timeRanges:Y})},onError:function(F){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",F);var w={type:K.ErrorTypes.MEDIA_ERROR,parent:v.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?w.details=K.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,w.details=K.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>O.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),w.fatal=!0)),O.trigger(P.Events.ERROR,w)}};T.append(A,S)},o.onBufferFlushing=function(s,i){var n=this,O=this.operationQueue,T=function(R){return{execute:n.removeExecutor.bind(n,R,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(P.Events.BUFFER_FLUSHED,{type:R})},onError:function(v){k.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",v)}}};i.type?O.append(T(i.type),i.type):this.getSourceBufferTypes().forEach(function(C){O.append(T(C),C)})},o.onFragParsed=function(s,i){var n=this,O=i.frag,T=i.part,C=[],R=T?T.elementaryStreams:O.elementaryStreams;R[M.ElementaryStreamTypes.AUDIOVIDEO]?C.push("audiovideo"):(R[M.ElementaryStreamTypes.AUDIO]&&C.push("audio"),R[M.ElementaryStreamTypes.VIDEO]&&C.push("video"));var S=function(){var E=self.performance.now();O.stats.buffering.end=E,T&&(T.stats.buffering.end=E);var f=T?T.stats:O.stats;n.hls.trigger(P.Events.FRAG_BUFFERED,{frag:O,part:T,stats:f,id:O.type})};C.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(S,C)},o.onFragChanged=function(s,i){this.flushBackBuffer()},o.onBufferEos=function(s,i){var n=this,O=this.getSourceBufferTypes().reduce(function(T,C){var R=n.sourceBuffer[C];return(!i.type||i.type===C)&&(R&&!R.ended&&(R.ended=!0,k.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),T&&!!(!R||R.ended)},!0);O&&this.blockBuffers(function(){var T=n.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},o.onLevelUpdated=function(s,i){var n=i.details;if(!n.fragments.length)return;this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},o.flushBackBuffer=function(){var s=this.hls,i=this.details,n=this.media,O=this.sourceBuffer;if(!n||i===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var C=i.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(G.isFiniteNumber)(C)||C<0)return;var R=n.currentTime,S=i.levelTargetDuration,v=Math.max(C,S),E=Math.floor(R/S)*S-v;T.forEach(function(f){var h=O[f];if(h){var y=I.BufferHelper.getBuffered(h);y.length>0&&E>y.start(0)&&(s.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),i.live&&s.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),s.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:f}))}})},o.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,i=this.hls,n=this.media,O=this.mediaSource,T=s.fragments[0].start+s.totalduration,C=n.duration,R=Object(G.isFiniteNumber)(O.duration)?O.duration:0;s.live&&i.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(s)):(T>R&&T>C||!Object(G.isFiniteNumber)(C))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),O.duration=T)},o.updateSeekableRange=function(s){var i=this.mediaSource,n=s.fragments,O=n.length;if(O&&s.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var T=Math.max(0,n[0].start),C=Math.max(T,T+s.totalduration);i.setLiveSeekableRange(T,C)}},o.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,i=this.operationQueue,n=this.pendingTracks,O=Object.keys(n).length;if(O&&!s||O===2){this.createSourceBuffers(n),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(C){i.executeNext(C)})}},o.createSourceBuffers=function(s){var i=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var T in s)if(!i[T]){var C=s[T];if(!C)throw Error("source buffer exists for track "+T+", however track does not");var R=C.levelCodec||C.codec,S=C.container+";codecs="+R;k.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var v=i[T]=n.addSourceBuffer(S),E=T;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[T]={buffer:v,codec:R,container:C.container,levelCodec:C.levelCodec,id:C.id},O++}catch(f){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:S})}}O&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},o._onSBUpdateStart=function(s){var i=this.operationQueue,n=i.current(s);n.onStart()},o._onSBUpdateEnd=function(s){var i=this.operationQueue,n=i.current(s);n.onComplete(),i.shiftAndExecuteNext(s)},o._onSBUpdateError=function(s,i){k.logger.error("[buffer-controller]: "+s+" SourceBuffer error",i),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(s);n&&n.onError(i)},o.removeExecutor=function(s,i,n){var O=this.media,T=this.mediaSource,C=this.operationQueue,R=this.sourceBuffer,S=R[s];if(!O||!T||!S){k.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),C.shiftAndExecuteNext(s);return}var v=Object(G.isFiniteNumber)(O.duration)?O.duration:Infinity,E=Object(G.isFiniteNumber)(T.duration)?T.duration:Infinity,f=Math.max(0,i),h=Math.min(n,v,E);h>f?(k.logger.log("[buffer-controller]: Removing ["+f+","+h+"] from the "+s+" SourceBuffer"),console.assert(!S.updating,s+" sourceBuffer must not be updating"),S.remove(f,h)):C.shiftAndExecuteNext(s)},o.appendExecutor=function(s,i){var n=this.operationQueue,O=this.sourceBuffer,T=O[i];if(!T){k.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(i);return}T.ended=!1,console.assert(!T.updating,i+" sourceBuffer must not be updating"),T.appendBuffer(s)},o.blockBuffers=function(s,i){var n=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var O=this.operationQueue,T=i.map(function(C){return O.appendBlocker(C)});Promise.all(T).then(function(){s(),i.forEach(function(C){var R=n.sourceBuffer[C];(!R||!R.updating)&&O.shiftAndExecuteNext(C)})})},o.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},o.addBufferListener=function(s,i,n){var O=this.sourceBuffer[s];if(!O)return;var T=n.bind(this,s);this.listeners[s].push({event:i,listener:T}),O.addEventListener(i,T)},o.removeBufferListeners=function(s){var i=this.sourceBuffer[s];if(!i)return;this.listeners[s].forEach(function(n){i.removeEventListener(n.event,n.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return P});var G=U("./src/utils/logger.ts"),P=function(){function k(I){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=I}var K=k.prototype;return K.append=function(r,M){var _=this.queues[M];_.push(r),_.length===1&&this.buffers[M]&&this.executeNext(M)},K.insertAbort=function(r,M){var _=this.queues[M];_.unshift(r),this.executeNext(M)},K.appendBlocker=function(r){var M,_=new Promise(function(m){M=m}),p={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,r),_},K.executeNext=function(r){var M=this.buffers,_=this.queues,p=M[r],m=_[r];if(m.length){var u=m[0];try{u.execute()}catch(a){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(a),(!p||!p.updating)&&(m.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},k}()},"./src/controller/cap-level-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts");function P(I,r){for(var M=0;M<r.length;M++){var _=r[M];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(I,_.key,_)}}function k(I,r,M){return r&&P(I.prototype,r),M&&P(I,M),I}var K=function(){function I(M){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=M,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=I.prototype;return r.setStreamController=function(_){this.streamController=_},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var _=this.hls;_.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var _=this.hls;_.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(_,p){I.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},r.onMediaAttaching=function(_,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},r.onManifestParsed=function(_,p){var m=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onBufferCodecs=function(_,p){var m=this.hls;m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var _=this.hls.levels;if(_.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(_.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},r.getMaxLevel=function(_){var p=this,m=this.hls.levels;if(!m.length)return-1;var u=m.filter(function(a,o){return I.isLevelAllowed(o,p.restrictedLevels)&&o<=_});return this.clientRect=null,I.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var _=this.media,p={width:0,height:0};if(_){var m=_.getBoundingClientRect();p.width=m.width,p.height=m.height,!p.width&&!p.height&&(p.width=m.right-m.left||_.width||0,p.height=m.bottom-m.top||_.height||0)}return this.clientRect=p,p},I.isLevelAllowed=function(_,p){return p===void 0&&(p=[]),p.indexOf(_)===-1},I.getMaxLevelByMediaSize=function(_,p,m){if(!_||!_.length)return-1;for(var u=function(i,n){return n?i.width!==n.width||i.height!==n.height:!0},a=_.length-1,o=0;o<_.length;o+=1){var c=_[o];if((c.width>=p||c.height>=m)&&u(c,_[o+1])){a=o;break}}return a},k(I,[{key:"mediaWidth",get:function(){return this.getDimensions().width*I.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*I.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var _=1;try{_=self.devicePixelRatio}catch(p){}return _}}]),I}();V.default=K},"./src/controller/cmcd-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return u});var G=U("./src/events.ts"),P=U("./src/types/cmcd.ts"),k=U("./src/utils/buffer-helper.ts"),K=U("./src/utils/logger.ts");function I(a,o){for(var c=0;c<o.length;c++){var s=o[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function r(a,o,c){return o&&I(a.prototype,o),c&&I(a,c),a}function M(a,o){var c=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(c)return(c=c.call(a)).next.bind(c);if(Array.isArray(a)||(c=_(a))||o&&a&&typeof a.length=="number"){c&&(a=c);var s=0;return function(){return s>=a.length?{done:!0}:{done:!1,value:a[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(a,o){if(!a)return;if(typeof a=="string")return p(a,o);var c=Object.prototype.toString.call(a).slice(8,-1);if(c==="Object"&&a.constructor&&(c=a.constructor.name),c==="Map"||c==="Set")return Array.from(a);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return p(a,o)}function p(a,o){(o==null||o>a.length)&&(o=a.length);for(var c=0,s=new Array(o);c<o;c++)s[c]=a[c];return s}function m(){return m=Object.assign||function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(a[s]=c[s])}return a},m.apply(this,arguments)}var u=function(){function a(c){var s=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(O){try{s.apply(O,{ot:P.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(T){K.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(O){try{var T=O.frag,C=s.hls.levels[T.level],R=s.getObjectType(T),S={d:T.duration*1e3,ot:R};(R===P.CMCDObjectType.VIDEO||R===P.CMCDObjectType.AUDIO||R==P.CMCDObjectType.MUXED)&&(S.br=C.bitrate/1e3,S.tb=s.getTopBandwidth(R),S.bl=s.getBufferLength(R)),s.apply(O,S)}catch(v){K.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=c;var i=this.config=c.config,n=i.cmcd;n!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||a.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var o=a.prototype;return o.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this)},o.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},o.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},o.onMediaAttached=function(s,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},o.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},o.onBufferCreated=function(s,i){var n,O;this.audioBuffer=(n=i.tracks.audio)===null||n===void 0?void 0:n.buffer,this.videoBuffer=(O=i.tracks.video)===null||O===void 0?void 0:O.buffer},o.createData=function(){var s;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},o.apply=function(s,i){i===void 0&&(i={}),m(i,this.createData());var n=i.ot===P.CMCDObjectType.INIT||i.ot===P.CMCDObjectType.VIDEO||i.ot===P.CMCDObjectType.MUXED;if(this.starved&&n&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var O=a.toHeaders(i);if(!Object.keys(O).length)return;s.headers||(s.headers={}),m(s.headers,O)}else{var T=a.toQuery(i);if(!T)return;s.url=a.appendQueryToUri(s.url,T)}},o.getObjectType=function(s){var i=s.type;return i==="subtitle"?P.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?P.CMCDObjectType.INIT:i==="audio"?P.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},o.getTopBandwidth=function(s){for(var i=0,n=s===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=M(n),T;!(T=O()).done;){var C=T.value;C.bitrate>i&&(i=C.bitrate)}return i>0?i:NaN},o.getBufferLength=function(s){var i=this.hls.media,n=s===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!i)return NaN;var O=k.BufferHelper.bufferInfo(n,i.currentTime,this.config.maxBufferHole);return O.len*1e3},o.createPlaylistLoader=function(){var s=this.config.pLoader,i=this.applyPlaylistData,n=s||this.config.loader;return function(){function O(C){this.loader=void 0,this.loader=new n(C)}var T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(R,S,v){i(R),this.loader.load(R,S,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},o.createFragmentLoader=function(){var s=this.config.fLoader,i=this.applyFragmentData,n=s||this.config.loader;return function(){function O(C){this.loader=void 0,this.loader=new n(C)}var T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(R,S,v){i(R),this.loader.load(R,S,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},a.uuid=function(){var s=URL.createObjectURL(new Blob),i=s.toString();return URL.revokeObjectURL(s),i.substr(i.lastIndexOf("/")+1)},a.serialize=function(s){for(var i=[],n=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},O=function(B){return Math.round(B)},T=function(B){return O(B/100)*100},C=function(B){return encodeURIComponent(B)},R={br:O,d:O,bl:T,dl:T,mtp:T,nor:C,rtp:T,tb:O},S=Object.keys(s||{}).sort(),v=M(S),E;!(E=v()).done;){var f=E.value,h=s[f];if(!n(h))continue;if(f==="v"&&h===1)continue;if(f=="pr"&&h===1)continue;var y=R[f];y&&(h=y(h));var g=typeof h,x=void 0;f==="ot"||f==="sf"||f==="st"?x=f+"="+h:g==="boolean"?x=f:g==="number"?x=f+"="+h:x=f+"="+JSON.stringify(h),i.push(x)}return i.join(",")},a.toHeaders=function(s){for(var i=Object.keys(s),n={},O=["Object","Request","Session","Status"],T=[{},{},{},{}],C={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,S=i;R<S.length;R++){var v=S[R],E=C[v]!=null?C[v]:1;T[E][v]=s[v]}for(var f=0;f<T.length;f++){var h=a.serialize(T[f]);h&&(n["CMCD-"+O[f]]=h)}return n},a.toQuery=function(s){return"CMCD="+encodeURIComponent(a.serialize(s))},a.appendQueryToUri=function(s,i){if(!i)return s;var n=s.includes("?")?"&":"?";return""+s+n+i},a}()},"./src/controller/eme-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/errors.ts"),k=U("./src/utils/logger.ts"),K=U("./src/utils/mediakeys-helper.ts");function I(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function r(u,a,o){return a&&I(u.prototype,a),o&&I(u,o),u}var M=3,_=function(a,o,c){var s={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(i){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:c.audioRobustness||""})}),o.forEach(function(i){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:c.videoRobustness||""})}),[s]},p=function(a,o,c,s){switch(a){case K.KeySystems.WIDEVINE:return _(o,c,s);default:throw new Error("Unknown key-system: "+a)}},m=function(){function u(o){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=o,this._config=o.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var a=u.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(c){switch(c){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},a._attemptKeySystemAccess=function(c,s,i){var n=this,O=p(c,s,i,this._drmSystemOptions);k.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(c,O);this.mediaKeysPromise=T.then(function(C){return n._onMediaKeySystemAccessObtained(c,C)}),T.catch(function(C){k.logger.error('Failed to obtain key-system "'+c+'" access:',C)})},a._onMediaKeySystemAccessObtained=function(c,s){var i=this;k.logger.log('Access for key-system "'+c+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:c};this._mediaKeysList.push(n);var O=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(T){return n.mediaKeys=T,k.logger.log('Media-keys created for key-system "'+c+'"'),i._onMediaKeysCreated(),T});return O.catch(function(T){k.logger.error("Failed to create media-keys:",T)}),O},a._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),c._onNewMediaKeySession(s.mediaKeysSession))})},a._onNewMediaKeySession=function(c){var s=this;k.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(i){s._onKeySessionMessage(c,i.message)},!1)},a._onKeySessionMessage=function(c,s){k.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(i){k.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),c.update(i)})},a.onMediaEncrypted=function(c){var s=this;if(k.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(O){if(!s._media)return;s._attemptSetMediaKeys(O),s._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(i).catch(i)},a._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){k.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}k.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(c,s){var i=this,n=this._mediaKeysList[0];if(!n){k.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(n.mediaKeysSessionInitialized){k.logger.warn("Key-Session already initialized but requested again");return}var O=n.mediaKeysSession;if(!O){k.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){k.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}k.logger.log('Generating key-session request for "'+c+'" init data type'),n.mediaKeysSessionInitialized=!0,O.generateRequest(c,s).then(function(){k.logger.debug("Key-session generation succeeded")}).catch(function(T){k.logger.error("Error generating key-session request:",T),i.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(c,s,i){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,c,s,i);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,n,c),O=void 0}catch(T){k.logger.error(T)}try{n.readyState||n.open("POST",c,!0),O&&O.call(this.hls,n,c)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return n},a._onLicenseRequestReadyStageChange=function(c,s,i,n){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,k.logger.log("License request succeeded");var O=c.response,T=this._licenseResponseCallback;if(T)try{O=T.call(this.hls,c,s)}catch(R){k.logger.error(R)}n(O)}else{if(k.logger.error("License Request XHR failed ("+s+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>M){this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var C=M-this._requestLicenseFailureCount+1;k.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(i,n)}break}},a._generateLicenseRequestChallenge=function(c,s){switch(c.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},a._requestLicense=function(c,s){k.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){k.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(i.mediaKeySystemDomain),O=this._createLicenseXhr(n,c,s);k.logger.log("Sending license request to URL: "+n);var T=this._generateLicenseRequestChallenge(i,c);O.send(T)}catch(C){k.logger.error("Failure requesting DRM license: "+C),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(c,s){if(!this._emeEnabled)return;var i=s.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var c=this._media,s=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(c,s){if(!this._emeEnabled)return;var i=s.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),n=s.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,i,n)},r(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();V.default=m},"./src/controller/fps-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/utils/logger.ts"),k=function(){function K(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var I=K.prototype;return I.setStreamController=function(M){this.streamController=M},I.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},I.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching)},I.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},I.onMediaAttaching=function(M,_){var p=this.hls.config;if(p.capLevelOnFPSDrop){var m=_.media instanceof self.HTMLVideoElement?_.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},I.checkFPS=function(M,_,p){var m=performance.now();if(_){if(this.lastTime){var u=m-this.lastTime,a=p-this.lastDroppedFrames,o=_-this.lastDecodedFrames,c=1e3*a/u,s=this.hls;if(s.trigger(G.Events.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:p}),c>0&&a>s.config.fpsDroppedMonitoringThreshold*o){var i=s.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=i)&&(i=i-1,s.trigger(G.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:s.currentLevel}),s.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=p,this.lastDecodedFrames=_}},I.checkFPSInterval=function(){var M=this.media;if(M)if(this.isVideoPlaybackQualityAvailable){var _=M.getVideoPlaybackQuality();this.checkFPS(M,_.totalVideoFrames,_.droppedVideoFrames)}else this.checkFPS(M,M.webkitDecodedFrameCount,M.webkitDroppedFrameCount)},K}();V.default=k},"./src/controller/fragment-finders.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"findFragmentByPDT",function(){return k}),U.d(V,"findFragmentByPTS",function(){return K}),U.d(V,"fragmentWithinToleranceTest",function(){return I}),U.d(V,"pdtWithinToleranceTest",function(){return r}),U.d(V,"findFragWithCC",function(){return M});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/binary-search.ts");function k(_,p,m){if(p===null||!Array.isArray(_)||!_.length||!Object(G.isFiniteNumber)(p))return null;var u=_[0].programDateTime;if(p<(u||0))return null;var a=_[_.length-1].endProgramDateTime;if(p>=(a||0))return null;m=m||0;for(var o=0;o<_.length;++o){var c=_[o];if(r(p,m,c))return c}return null}function K(_,p,m,u){m===void 0&&(m=0),u===void 0&&(u=0);var a=null;if(_?a=p[_.sn-p[0].sn+1]||null:m===0&&p[0].start===0&&(a=p[0]),a&&I(m,u,a)===0)return a;var o=P.default.search(p,I.bind(null,m,u));return o||a}function I(_,p,m){_===void 0&&(_=0),p===void 0&&(p=0);var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-u<=_?1:m.start-u>_&&m.start?-1:0}function r(_,p,m){var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,a=m.endProgramDateTime||0;return a-u>_}function M(_,p){return P.default.search(_,function(m){return m.cc<p?1:m.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"FragmentState",function(){return k}),U.d(V,"FragmentTracker",function(){return K});var G=U("./src/events.ts"),P=U("./src/types/loader.ts"),k;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(k||(k={}));var K=function(){function M(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var _=M.prototype;return _._registerListeners=function(){var m=this.hls;m.on(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(G.Events.FRAG_LOADED,this.onFragLoaded,this)},_._unregisterListeners=function(){var m=this.hls;m.off(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(G.Events.FRAG_LOADED,this.onFragLoaded,this)},_.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},_.getAppendedFrag=function(m,u){if(u===P.PlaylistLevelType.MAIN){var a=this.activeFragment,o=this.activeParts;if(!a)return null;if(o)for(var c=o.length;c--;){var s=o[c],i=s?s.end:a.appendedPTS;if(s.start<=m&&i!==void 0&&m<=i)return c>9&&(this.activeParts=o.slice(c-9)),s}else if(a.start<=m&&a.appendedPTS!==void 0&&m<=a.appendedPTS)return a}return this.getBufferedFrag(m,u)},_.getBufferedFrag=function(m,u){for(var a=this.fragments,o=Object.keys(a),c=o.length;c--;){var s=a[o[c]];if((s==null?void 0:s.body.type)===u&&s.buffered){var i=s.body;if(i.start<=m&&m<=i.end)return i}}return null},_.detectEvictedFragments=function(m,u,a){var o=this;Object.keys(this.fragments).forEach(function(c){var s=o.fragments[c];if(!s)return;if(!s.buffered){s.body.type===a&&o.removeFragment(s.body);return}var i=s.range[m];if(!i)return;i.time.some(function(n){var O=!o.isTimeBuffered(n.startPTS,n.endPTS,u);return O&&o.removeFragment(s.body),O})})},_.detectPartialFragments=function(m){var u=this,a=this.timeRanges,o=m.frag,c=m.part;if(!a||o.sn==="initSegment")return;var s=r(o),i=this.fragments[s];if(!i)return;Object.keys(a).forEach(function(n){var O=o.elementaryStreams[n];if(!O)return;var T=a[n],C=c!==null||O.partial===!0;i.range[n]=u.getBufferedTimes(o,c,C,T)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},_.fragBuffered=function(m){var u=r(m),a=this.fragments[u];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},_.getBufferedTimes=function(m,u,a,o){for(var c={time:[],partial:a},s=u?u.start:m.start,i=u?u.end:m.end,n=m.minEndPTS||i,O=m.maxStartPTS||s,T=0;T<o.length;T++){var C=o.start(T)-this.bufferPadding,R=o.end(T)+this.bufferPadding;if(O>=C&&n<=R){c.time.push({startPTS:Math.max(s,o.start(T)),endPTS:Math.min(i,o.end(T))});break}else if(s<R&&i>C)c.partial=!0,c.time.push({startPTS:Math.max(s,o.start(T)),endPTS:Math.min(i,o.end(T))});else if(i<=C)break}return c},_.getPartialFragment=function(m){var u=null,a,o,c,s=0,i=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(O){var T=n[O];if(!T)return;I(T)&&(o=T.body.start-i,c=T.body.end+i,m>=o&&m<=c&&(a=Math.min(m-o,c-m),s<=a&&(u=T.body,s=a)))}),u},_.getState=function(m){var u=r(m),a=this.fragments[u];return a?a.buffered?I(a)?k.PARTIAL:k.OK:a.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},_.backtrack=function(m,u){var a=r(m),o=this.fragments[a];if(!o||o.backtrack)return null;var c=o.backtrack=u||o.loaded;return o.loaded=null,c},_.getBacktrackData=function(m){var u=r(m),a=this.fragments[u];if(a){var o,c=a.backtrack;if(c!=null&&(o=c.payload)!==null&&o!==void 0&&o.byteLength)return c;this.removeFragment(m)}return null},_.isTimeBuffered=function(m,u,a){for(var o,c,s=0;s<a.length;s++){if(o=a.start(s)-this.bufferPadding,c=a.end(s)+this.bufferPadding,m>=o&&u<=c)return!0;if(u<=o)return!1}return!1},_.onFragLoaded=function(m,u){var a=u.frag,o=u.part;if(a.sn==="initSegment"||a.bitrateTest||o)return;var c=r(a);this.fragments[c]={body:a,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},_.onBufferAppended=function(m,u){var a=this,o=u.frag,c=u.part,s=u.timeRanges;if(o.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=o,c){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(c)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(n){var O=s[n];if(a.detectEvictedFragments(n,O),!c)for(var T=0;T<O.length;T++)o.appendedPTS=Math.max(O.end(T),o.appendedPTS||0)})},_.onFragBuffered=function(m,u){this.detectPartialFragments(u)},_.hasFragment=function(m){var u=r(m);return!!this.fragments[u]},_.removeFragmentsInRange=function(m,u,a){var o=this;Object.keys(this.fragments).forEach(function(c){var s=o.fragments[c];if(!s)return;if(s.buffered){var i=s.body;i.type===a&&i.start<u&&i.end>m&&o.removeFragment(i)}})},_.removeFragment=function(m){var u=r(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},_.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},M}();function I(M){var _,p;return M.buffered&&(((_=M.range.video)===null||_===void 0?void 0:_.partial)||((p=M.range.audio)===null||p===void 0?void 0:p.partial))}function r(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"STALL_MINIMUM_DURATION_MS",function(){return I}),U.d(V,"MAX_START_GAP_JUMP",function(){return r}),U.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),U.d(V,"SKIP_BUFFER_RANGE_START",function(){return _}),U.d(V,"default",function(){return p});var G=U("./src/utils/buffer-helper.ts"),P=U("./src/errors.ts"),k=U("./src/events.ts"),K=U("./src/utils/logger.ts"),I=250,r=2,M=.1,_=.05,p=function(){function m(a,o,c,s){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=a,this.media=o,this.fragmentTracker=c,this.hls=s}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(o){var c=this.config,s=this.media,i=this.stalled,n=s.currentTime,O=s.seeking,T=this.seeking&&!O,C=!this.seeking&&O;if(this.seeking=O,n!==o){if(this.moved=!0,i!==null){if(this.stallReported){var R=self.performance.now()-i;K.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||T)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!G.BufferHelper.getBuffered(s).length)return;var S=G.BufferHelper.bufferInfo(s,n,0),v=S.len>0,E=S.nextStart||0;if(!v&&!E)return;if(O){var f=S.len>r,h=!E||E-n>r&&!this.fragmentTracker.getPartialFragment(n);if(f||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var y,g=Math.max(E,S.start||0)-n,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=x==null||((y=x.details)===null||y===void 0)?void 0:y.live,B=j?x.details.targetduration*2:r;if(g>0&&g<=B){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(i===null){this.stalled=A;return}var H=A-i;!O&&H>=I&&this._reportStall(S.len);var F=G.BufferHelper.bufferInfo(s,n,c.maxBufferHole);this._tryFixBufferStall(F,H)},u._tryFixBufferStall=function(o,c){var s=this.config,i=this.fragmentTracker,n=this.media,O=n.currentTime,T=i.getPartialFragment(O);if(T){var C=this._trySkipBufferHole(T);if(C)return}o.len>s.maxBufferHole&&c>s.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(o){var c=this.hls,s=this.media,i=this.stallReported;i||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+o+")"),c.trigger(k.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},u._trySkipBufferHole=function(o){for(var c=this.config,s=this.hls,i=this.media,n=i.currentTime,O=0,T=G.BufferHelper.getBuffered(i),C=0;C<T.length;C++){var R=T.start(C);if(n+c.maxBufferHole>=O&&n<R){var S=Math.max(R+_,i.currentTime+M);return K.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+S),this.moved=!0,this.stalled=null,i.currentTime=S,o&&s.trigger(k.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+S,frag:o}),S}O=T.end(C)}return 0},u._tryNudgeBuffer=function(){var o=this.config,c=this.hls,s=this.media,i=s.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<o.nudgeMaxRetry){var O=i+n*o.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+i+" to "+O),s.currentTime=O,c.trigger(k.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+o.nudgeMaxRetry+" nudges"),c.trigger(k.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/utils/texttrack-utils.ts"),k=U("./src/demux/id3.ts"),K=.25,I=function(){function r(_){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=_,this._registerListeners()}var M=r.prototype;return M.destroy=function(){this._unregisterListeners()},M._registerListeners=function(){var p=this.hls;p.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M._unregisterListeners=function(){var p=this.hls;p.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M.onMediaAttached=function(p,m){this.media=m.media},M.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},M.getID3Track=function(p){if(!this.media)return;for(var m=0;m<p.length;m++){var u=p[m];if(u.kind==="metadata"&&u.label==="id3")return Object(P.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},M.onFragParsingMetadata=function(p,m){if(!this.media)return;var u=m.frag,a=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var o=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<a.length;c++){var s=k.getID3Frames(a[c].data);if(s){var i=a[c].pts,n=c<a.length-1?a[c+1].pts:u.end,O=n-i;O<=0&&(n=i+K);for(var T=0;T<s.length;T++){var C=s[T];if(!k.isTimeStampFrame(C)){var R=new o(i,n,"");R.value=C,this.id3Track.addCue(R)}}}}},M.onBufferFlushing=function(p,m){var u=m.startOffset,a=m.endOffset,o=m.type;if(!o||o==="audio"){var c=this.id3Track;c&&Object(P.removeCuesInRange)(c,u,a)}},r}();V.default=I},"./src/controller/latency-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return r});var G=U("./src/errors.ts"),P=U("./src/events.ts"),k=U("./src/utils/logger.ts");function K(M,_){for(var p=0;p<_.length;p++){var m=_[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(M,m.key,m)}}function I(M,_,p){return _&&K(M.prototype,_),p&&K(M,p),M}var r=function(){function M(p){var m=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return m.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var _=M.prototype;return _.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},_.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},_.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},_.onMediaAttached=function(m,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},_.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},_.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},_.onLevelUpdated=function(m,u){var a=u.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},_.onError=function(m,u){if(u.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,k.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},_.timeupdate=function(){var m=this.media,u=this.levelDetails;if(!m||!u)return;this.currentTime=m.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var o=this.config,c=o.lowLatencyMode,s=o.maxLiveSyncPlaybackRate;if(!c||s===1)return;var i=this.targetLatency;if(i===null)return;var n=a-i,O=Math.min(this.maxLatency,i+u.targetduration),T=n<O;if(u.live&&T&&n>.05&&this.forwardBufferLength>1){var C=Math.min(2,Math.max(1,s)),R=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;m.playbackRate=Math.min(C,Math.max(1,R))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},_.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},_.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},I(M,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,u=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:u?m.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var u=m.holdBack,a=m.partHoldBack,o=m.targetduration,c=this.config,s=c.liveSyncDuration,i=c.liveSyncDurationCount,n=c.lowLatencyMode,O=this.hls.userConfig,T=n&&a||u;(O.liveSyncDuration||O.liveSyncDurationCount||T===0)&&(T=s!==void 0?s:i*o);var C=o,R=1;return T+Math.min(this.stallCount*R,C)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,a=this.levelDetails;if(m===null||u===null||a===null)return null;var o=a.edge,c=m-u-this.edgeStalled,s=o-a.totalduration,i=o-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(s,c),i)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var u=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-u,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,u=this.levelDetails;if(!m||!u)return 0;var a=m.buffered.length;return a?m.buffered.end(a-1):u.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return c});var G=U("./src/types/level.ts"),P=U("./src/events.ts"),k=U("./src/errors.ts"),K=U("./src/utils/codecs.ts"),I=U("./src/controller/level-helper.ts"),r=U("./src/controller/base-playlist-controller.ts"),M=U("./src/types/loader.ts");function _(){return _=Object.assign||function(s){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var O in n)Object.prototype.hasOwnProperty.call(n,O)&&(s[O]=n[O])}return s},_.apply(this,arguments)}function p(s,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(s,O.key,O)}}function m(s,i,n){return i&&p(s.prototype,i),n&&p(s,n),s}function u(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,a(s,i)}function a(s,i){return a=Object.setPrototypeOf||function(O,T){return O.__proto__=T,O},a(s,i)}var o=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(s){u(i,s);function i(O){var T;return T=s.call(this,O,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var n=i.prototype;return n._registerListeners=function(){var T=this.hls;T.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(P.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var T=this.hls;T.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(P.Events.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},n.startLoad=function(){var T=this._levels;T.forEach(function(C){C.loadError=0}),s.prototype.startLoad.call(this)},n.onManifestLoaded=function(T,C){var R=[],S=[],v=[],E,f={},h,y=!1,g=!1,x=!1;if(C.levels.forEach(function(H){var F=H.attrs;y=y||!!(H.width&&H.height),g=g||!!H.videoCodec,x=x||!!H.audioCodec,o&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var w=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;h=f[w],h?h.url.push(H.url):(h=new G.Level(H),f[w]=h,R.push(h)),F&&(F.AUDIO&&Object(I.addGroupId)(h,"audio",F.AUDIO),F.SUBTITLES&&Object(I.addGroupId)(h,"text",F.SUBTITLES))}),(y||g)&&x&&(R=R.filter(function(H){var F=H.videoCodec,w=H.width,Y=H.height;return!!F||!!(w&&Y)})),R=R.filter(function(H){var F=H.audioCodec,w=H.videoCodec;return(!F||Object(K.isCodecSupportedInMp4)(F,"audio"))&&(!w||Object(K.isCodecSupportedInMp4)(w,"video"))}),C.audioTracks&&(S=C.audioTracks.filter(function(H){return!H.audioCodec||Object(K.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(I.assignTrackIdsByGroup)(S)),C.subtitles&&(v=C.subtitles,Object(I.assignTrackIdsByGroup)(v)),R.length>0){E=R[0].bitrate,R.sort(function(H,F){return H.bitrate-F.bitrate}),this._levels=R;for(var j=0;j<R.length;j++)if(R[j].bitrate===E){this._firstLevel=j,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+E);break}var B=x&&!g,A={levels:R,audioTracks:S,subtitleTracks:v,firstLevel:this._firstLevel,stats:C.stats,audio:x,video:g,altAudio:!B&&S.some(function(H){return!!H.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:k.ErrorTypes.MEDIA_ERROR,details:k.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:C.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(T,C){if(s.prototype.onError.call(this,T,C),C.fatal)return;var R=C.context,S=this._levels[this.currentLevelIndex];if(R&&(R.type===M.PlaylistContextType.AUDIO_TRACK&&S.audioGroupIds&&R.groupId===S.audioGroupIds[S.urlId]||R.type===M.PlaylistContextType.SUBTITLE_TRACK&&S.textGroupIds&&R.groupId===S.textGroupIds[S.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,E=!0,f;switch(C.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:case k.ErrorDetails.KEY_LOAD_ERROR:case k.ErrorDetails.KEY_LOAD_TIMEOUT:if(C.frag){var h=this._levels[C.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=C.frag.level)):f=C.frag.level}break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(E=!1),f=R.level),v=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:f=C.level,v=!0;break}f!==void 0&&this.recoverLevel(C,f,v,E)},n.recoverLevel=function(T,C,R,S){var v=T.details,E=this._levels[C];if(E.loadError++,R){var f=this.retryLoadingOrFail(T);if(f)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var h=E.url.length;if(h>1&&E.loadError<h)T.levelRetry=!0,this.redundantFailover(C);else if(this.manualLevelIndex===-1){var y=C===0?this._levels.length-1:C-1;this.currentLevelIndex!==y&&this._levels[y].loadError===0&&(this.warn(v+": switch to "+y),T.levelRetry=!0,this.hls.nextAutoLevel=y)}}},n.redundantFailover=function(T){var C=this._levels[T],R=C.url.length;if(R>1){var S=(C.urlId+1)%R;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(v){v.urlId=S}),this.level=T}},n.onFragLoaded=function(T,C){var R=C.frag;if(R!==void 0&&R.type===M.PlaylistLevelType.MAIN){var S=this._levels[R.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},n.onLevelLoaded=function(T,C){var R,S=C.level,v=C.details,E=this._levels[S];if(!E){var f;this.warn("Invalid level index "+S),(f=C.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(v.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(S,C,E.details)):(R=C.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(v.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(T,C){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var S=-1,v=this.hls.audioTracks[C.id].groupId,E=0;E<R.audioGroupIds.length;E++)if(R.audioGroupIds[E]===v){S=E;break}S!==R.urlId&&(R.urlId=S,this.startLoad())}},n.loadPlaylist=function(T){var C=this.currentLevelIndex,R=this._levels[C];if(this.canLoad&&R&&R.url.length>0){var S=R.urlId,v=R.url[S];if(T)try{v=T.addDirectives(v)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+C+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+S+" "+v),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:v,level:C,id:S,deliveryDirectives:T||null})}},n.removeLevel=function(T,C){var R=function(E,f){return f!==C},S=this._levels.filter(function(v,E){return E!==T?!0:v.url.length>1&&C!==void 0?(v.url=v.url.filter(R),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(R)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(R)),v.urlId=0,!0):!1}).map(function(v,E){var f=v.details;return f!=null&&f.fragments&&f.fragments.forEach(function(h){h.level=E}),v});this._levels=S,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:S})},m(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var C,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===T&&(C=R[T])!==null&&C!==void 0&&C.details)return;if(T<0||T>=R.length){var S=T<0;if(this.hls.trigger(P.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:S,reason:"invalid level idx"}),S)return;T=Math.min(T,R.length-1)}this.clearTimer();var v=this.currentLevelIndex,E=R[v],f=R[T];this.log("switching to level "+T+" from "+v),this.currentLevelIndex=T;var h=_({},f,{level:T,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete h._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,h);var y=f.details;if(!y||y.live){var g=this.switchParams(f.uri,E==null?void 0:E.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),i}(r.default)},"./src/controller/level-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"addGroupId",function(){return k}),U.d(V,"assignTrackIdsByGroup",function(){return K}),U.d(V,"updatePTS",function(){return I}),U.d(V,"updateFragPTSDTS",function(){return M}),U.d(V,"mergeDetails",function(){return _}),U.d(V,"mapPartIntersection",function(){return p}),U.d(V,"mapFragmentIntersection",function(){return m}),U.d(V,"adjustSliding",function(){return u}),U.d(V,"addSliding",function(){return a}),U.d(V,"computeReloadInterval",function(){return o}),U.d(V,"getFragmentWithSN",function(){return c}),U.d(V,"getPartWith",function(){return s});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/logger.ts");function k(i,n,O){switch(n){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(O);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(O);break}}function K(i){var n={};i.forEach(function(O){var T=O.groupId||"";O.id=n[T]=n[T]||0,n[T]++})}function I(i,n,O){var T=i[n],C=i[O];r(T,C)}function r(i,n){var O=n.startPTS;if(Object(G.isFiniteNumber)(O)){var T=0,C;n.sn>i.sn?(T=O-i.start,C=i):(T=i.start-O,C=n),C.duration!==T&&(C.duration=T)}else if(n.sn>i.sn){var R=i.cc===n.cc;R&&i.minEndPTS?n.start=i.start+(i.minEndPTS-i.start):n.start=i.start+i.duration}else n.start=Math.max(i.start-n.duration,0)}function M(i,n,O,T,C,R){var S=T-O;S<=0&&(P.logger.warn("Fragment should have a positive duration",n),T=O+n.duration,R=C+n.duration);var v=O,E=T,f=n.startPTS,h=n.endPTS;if(Object(G.isFiniteNumber)(f)){var y=Math.abs(f-O);Object(G.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(y,n.deltaPTS):n.deltaPTS=y,v=Math.max(O,f),O=Math.min(O,f),C=Math.min(C,n.startDTS),E=Math.min(T,h),T=Math.max(T,h),R=Math.max(R,n.endDTS)}n.duration=T-O;var g=O-n.start;n.appendedPTS=T,n.start=n.startPTS=O,n.maxStartPTS=v,n.startDTS=C,n.endPTS=T,n.minEndPTS=E,n.endDTS=R;var x=n.sn;if(!i||x<i.startSN||x>i.endSN)return 0;var j,B=x-i.startSN,A=i.fragments;for(A[B]=n,j=B;j>0;j--)r(A[j],A[j-1]);for(j=B;j<A.length-1;j++)r(A[j],A[j+1]);return i.fragmentHint&&r(A[A.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,g}function _(i,n){for(var O=null,T=i.fragments,C=T.length-1;C>=0;C--){var R=T[C].initSegment;if(R){O=R;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var S=0,v;if(m(i,n,function(j,B){j.relurl&&(S=j.cc-B.cc),Object(G.isFiniteNumber)(j.startPTS)&&Object(G.isFiniteNumber)(j.endPTS)&&(B.start=B.startPTS=j.startPTS,B.startDTS=j.startDTS,B.appendedPTS=j.appendedPTS,B.maxStartPTS=j.maxStartPTS,B.endPTS=j.endPTS,B.endDTS=j.endDTS,B.minEndPTS=j.minEndPTS,B.duration=j.endPTS-j.startPTS,B.duration&&(v=B),n.PTSKnown=n.alignedSliding=!0),B.elementaryStreams=j.elementaryStreams,B.loader=j.loader,B.stats=j.stats,B.urlId=j.urlId,j.initSegment&&(B.initSegment=j.initSegment,O=j.initSegment)}),O){var E=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;E.forEach(function(j){var B;(!j.initSegment||j.initSegment.relurl===((B=O)===null||B===void 0?void 0:B.relurl))&&(j.initSegment=O)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(j){return!j}),n.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=n.skippedSegments;f--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var h=n.fragments;if(S){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y<h.length;y++)h[y].cc+=S}n.skippedSegments&&(n.startCC=n.fragments[0].cc),p(i.partList,n.partList,function(j,B){B.elementaryStreams=j.elementaryStreams,B.stats=j.stats}),v?M(n,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):u(i,n),h.length&&(n.totalduration=n.edge-h[0].start),n.driftStartTime=i.driftStartTime,n.driftStart=i.driftStart;var g=n.advancedDateTime;if(n.advanced&&g){var x=n.edge;n.driftStart||(n.driftStartTime=g,n.driftStart=x),n.driftEndTime=g,n.driftEnd=x}else n.driftEndTime=i.driftEndTime,n.driftEnd=i.driftEnd,n.advancedDateTime=i.advancedDateTime}function p(i,n,O){if(i&&n)for(var T=0,C=0,R=i.length;C<=R;C++){var S=i[C],v=n[C+T];S&&v&&S.index===v.index&&S.fragment.sn===v.fragment.sn?O(S,v):T--}}function m(i,n,O){for(var T=n.skippedSegments,C=Math.max(i.startSN,n.startSN)-n.startSN,R=(i.fragmentHint?1:0)+(T?n.endSN:Math.min(i.endSN,n.endSN))-n.startSN,S=n.startSN-i.startSN,v=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,E=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,f=C;f<=R;f++){var h=E[S+f],y=v[f];T&&!y&&f<T&&(y=n.fragments[f]=h),h&&y&&O(h,y)}}function u(i,n){var O=n.startSN+n.skippedSegments-i.startSN,T=i.fragments;if(O<0||O>=T.length)return;a(n,T[O].start)}function a(i,n){if(n){for(var O=i.fragments,T=i.skippedSegments;T<O.length;T++)O[T].start+=n;i.fragmentHint&&(i.fragmentHint.start+=n)}}function o(i,n){var O=1e3*i.levelTargetDuration,T=O/2,C=i.age,R=C>0&&C<O*3,S=n.loading.end-n.loading.start,v,E=i.availabilityDelay;if(i.updated===!1)if(R){var f=333*i.misses;v=Math.max(Math.min(T,S*2),f),i.availabilityDelay=(i.availabilityDelay||0)+v}else v=T;else R?(E=Math.min(E||O/2,C),i.availabilityDelay=E,v=E+O-C):v=O-S;return Math.round(v)}function c(i,n,O){if(!i||!i.details)return null;var T=i.details,C=T.fragments[n-T.startSN];return C||(C=T.fragmentHint,C&&C.sn===n?C:n<T.startSN&&O&&O.sn===n?O:null)}function s(i,n,O){if(!i||!i.details)return null;var T=i.details.partList;if(T)for(var C=T.length;C--;){var R=T[C];if(R.index===O&&R.fragment.sn===n)return R}return null}},"./src/controller/stream-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return T});var G=U("./src/polyfills/number.ts"),P=U("./src/controller/base-stream-controller.ts"),k=U("./src/is-supported.ts"),K=U("./src/events.ts"),I=U("./src/utils/buffer-helper.ts"),r=U("./src/controller/fragment-tracker.ts"),M=U("./src/types/loader.ts"),_=U("./src/loader/fragment.ts"),p=U("./src/demux/transmuxer-interface.ts"),m=U("./src/types/transmuxer.ts"),u=U("./src/controller/gap-controller.ts"),a=U("./src/errors.ts"),o=U("./src/utils/logger.ts");function c(C,R){for(var S=0;S<R.length;S++){var v=R[S];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function s(C,R,S){return R&&c(C.prototype,R),S&&c(C,S),C}function i(C,R){C.prototype=Object.create(R.prototype),C.prototype.constructor=C,n(C,R)}function n(C,R){return n=Object.setPrototypeOf||function(v,E){return v.__proto__=E,v},n(C,R)}var O=100,T=function(C){i(R,C);function R(v,E){var f;return f=C.call(this,v,E,"[stream-controller]")||this,f.audioCodecSwap=!1,f.gapController=null,f.level=-1,f._forceStartLoad=!1,f.altAudio=!1,f.audioOnly=!1,f.fragPlaying=null,f.onvplaying=null,f.onvseeked=null,f.fragLastKbps=0,f.stalled=!1,f.couldBacktrack=!1,f.audioCodecSwitch=!1,f.videoBuffer=null,f._registerListeners(),f}var S=R.prototype;return S._registerListeners=function(){var E=this.hls;E.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(K.Events.ERROR,this.onError,this),E.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var E=this.hls;E.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(K.Events.ERROR,this.onError,this),E.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(E){if(this.levels){var f=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var y=h.startLevel;y===-1&&(h.config.testBandwidth?(y=0,this.bitrateTest=!0):y=h.nextAutoLevel),this.level=h.nextLoadLevel=y,this.loadedmetadata=!1}f>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),E=f),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var E,f=this.levels,h=this.level,y=f==null||((E=f[h])===null||E===void 0)?void 0:E.details;if(y&&(!y.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(y))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var g,x=self.performance.now(),j=this.retryDate;(!j||x>=j||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var E,f,h=this.hls,y=this.levelLastLoaded,g=this.levels,x=this.media,j=h.config,B=h.nextLoadLevel;if(y===null||!x&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[B])return;var A=g[B];this.level=h.nextLoadLevel=B;var H=A.details;if(!H||this.state===P.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==B){this.state=P.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:x,M.PlaylistLevelType.MAIN);if(F===null)return;var w=F.len,Y=this.getMaxBufferLength(A.maxBitrate);if(w>=Y)return;if(this._streamEnded(F,H)){var q={};this.altAudio&&(q.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,q),this.state=P.State.ENDED;return}var ie=F.end,ge=this.getNextFragment(ie,H);if(this.couldBacktrack&&!this.fragPrevious&&ge&&ge.sn!=="initSegment"){var Je=ge.sn-H.startSN;Je>1&&(ge=H.fragments[Je-1],this.fragmentTracker.removeFragment(ge))}if(ge&&this.fragmentTracker.getState(ge)===r.FragmentState.OK&&this.nextLoadPosition>ie){var xe=this.audioOnly&&!this.altAudio?_.ElementaryStreamTypes.AUDIO:_.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,xe,M.PlaylistLevelType.MAIN),ge=this.getNextFragment(this.nextLoadPosition,H)}if(!ge)return;ge.initSegment&&!ge.initSegment.data&&!this.bitrateTest&&(ge=ge.initSegment),((E=ge.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((f=ge.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(ge,H):this.loadFragment(ge,H,ie)},S.loadFragment=function(E,f,h){var y,g=this.fragmentTracker.getState(E);if(this.fragCurrent=E,g===r.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(E);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);return}else g=r.FragmentState.NOT_LOADED}g===r.FragmentState.NOT_LOADED||g===r.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,E,f,h)):g===r.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((y=this.media)===null||y===void 0?void 0:y.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(E){var f=this.fragmentTracker.getAppendedFrag(E,M.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},S.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,M.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var E=this.levels,f=this.media;if(f!=null&&f.readyState){var h,y=this.getAppendedFrag(f.currentTime);if(y&&y.start>1&&this.flushMainBuffer(0,y.start-1),!f.paused&&E){var g=this.hls.nextLoadLevel,x=E[g],j=this.fragLastKbps;j&&this.fragCurrent?h=this.fragCurrent.duration*x.maxBitrate/(1e3*j)+1:h=0}else h=0;var B=this.getBufferedFrag(f.currentTime+h);if(B){var A=this.followingBufferedFrag(B);if(A){this.abortCurrentFrag();var H=A.maxStartPTS?A.maxStartPTS:A.start,F=A.duration,w=Math.max(B.end,H+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(w,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(E,f){C.prototype.flushMainBuffer.call(this,E,f,this.altAudio?"video":null)},S.onMediaAttached=function(E,f){C.prototype.onMediaAttached.call(this,E,f);var h=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,h,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var E=this.media,f=E?E.currentTime:null;Object(G.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(E,f){var h=!1,y=!1,g;f.levels.forEach(function(x){g=x.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(h=!0),g.indexOf("mp4a.40.5")!==-1&&(y=!0))}),this.audioCodecSwitch=h&&y&&!Object(k.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},S.onLevelLoading=function(E,f){var h=this.levels;if(!h||this.state!==P.State.IDLE)return;var y=h[f.level];(!y.details||y.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(y.details))&&(this.state=P.State.WAITING_LEVEL)},S.onLevelLoaded=function(E,f){var h,y=this.levels,g=f.level,x=f.details,j=x.totalduration;if(!y){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+j);var B=this.fragCurrent;B&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==f.level&&B.loader&&(this.state=P.State.IDLE,B.loader.abort()));var A=y[g],H=0;if(x.live||(h=A.details)!==null&&h!==void 0&&h.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;H=this.alignPlaylists(x,A.details)}if(A.details=x,this.levelLastLoaded=g,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:x,level:g}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=P.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,H),this.tick()},S._handleFragmentLoadProgress=function(E){var f,h=E.frag,y=E.part,g=E.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var j=x[h.level],B=j.details;if(!B){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var A=j.videoCodec,H=B.PTSKnown||!B.live,F=(f=h.initSegment)===null||f===void 0?void 0:f.data,w=this._getAudioCodec(j),Y=this.transmuxer=this.transmuxer||new p.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),q=y?y.index:-1,ie=q!==-1,ge=new m.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,g.byteLength,q,ie),Je=this.initPTS[h.cc];Y.push(g,F,w,A,h,y,B.totalduration,H,ge,Je)},S.onAudioTrackSwitching=function(E,f){var h=this.altAudio,y=!!f.url,g=f.id;if(!y){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;h&&j.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:g})}},S.onAudioTrackSwitched=function(E,f){var h=f.id,y=!!this.hls.audioTracks[h].url;if(y){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=y,this.tick()},S.onBufferCreated=function(E,f){var h=f.tracks,y,g,x=!1;for(var j in h){var B=h[j];if(B.id==="main"){if(g=j,y=B,j==="video"){var A=h[j];A&&(this.videoBuffer=A.buffer)}}else x=!0}x&&y?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(E,f){var h=f.frag,y=f.part;if(h&&h.type!==M.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(y?" p: "+y.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var g=y?y.stats:h.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,y)},S.onError=function(E,f){switch(f.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,f);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=P.State.ERROR):!f.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var h=!0,y=this.getFwdBufferInfo(this.media,M.PlaylistLevelType.MAIN);y&&y.len>.5&&(h=!this.reduceMaxBufferLength(y.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var E=this.media,f=this.gapController;if(!E||!f||!E.readyState)return;var h=I.BufferHelper.getBuffered(E);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(E,f){var h=f.type;if(h!==_.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var y=(h===_.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(y,h,M.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(E,f){this.levels=f.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var E=this.media,f=E.currentTime,h=this.startPosition;if(h>=0&&f<h){if(E.seeking){o.logger.log("could not seek to "+h+", already seeking at "+f);return}var y=I.BufferHelper.getBuffered(E),g=y.length?y.start(0):0,x=g-h;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(o.logger.log("adjusting start position by "+x+" to match buffer start"),h+=x,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+f),E.currentTime=h}},S._getAudioCodec=function(E){var f=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},S._loadBitrateTestFrag=function(E){var f=this;this._doFragLoad(E).then(function(h){var y=f.hls;if(!h||y.nextLoadLevel||f.fragContextChanged(E))return;f.fragLoadError=0,f.state=P.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var g=E.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),y.trigger(K.Events.FRAG_LOADED,h)})},S._handleTransmuxComplete=function(E){var f,h="main",y=this.hls,g=E.remuxResult,x=E.chunkMeta,j=this.getCurrentContext(x);if(!j){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var B=j.frag,A=j.part,H=j.level,F=g.video,w=g.text,Y=g.id3,q=g.initSegment,ie=this.altAudio?void 0:g.audio;if(this.fragContextChanged(B))return;if(this.state=P.State.PARSING,q){q.tracks&&(this._bufferInitSegment(H,q.tracks,B,x),y.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:h,tracks:q.tracks}));var ge=q.initPTS,Je=q.timescale;Object(G.isFiniteNumber)(ge)&&(this.initPTS[B.cc]=ge,y.trigger(K.Events.INIT_PTS_FOUND,{frag:B,id:h,initPTS:ge,timescale:Je}))}if(F&&g.independent!==!1){if(H.details){var xe=F.startPTS,ke=F.endPTS,Qe=F.startDTS,Ye=F.endDTS;if(A)A.elementaryStreams[F.type]={startPTS:xe,endPTS:ke,startDTS:Qe,endDTS:Ye};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var ve=this.getLoadPosition()+this.config.maxBufferHole;if(ve<xe){this.backtrack(B);return}B.setElementaryStreamInfo(F.type,B.start,ke,B.start,Ye,!0)}B.setElementaryStreamInfo(F.type,xe,ke,Qe,Ye),this.bufferFragmentData(F,B,A,x)}}else if(g.independent===!1){this.backtrack(B);return}if(ie){var fe=ie.startPTS,at=ie.endPTS,Jt=ie.startDTS,Ft=ie.endDTS;A&&(A.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:at,startDTS:Jt,endDTS:Ft}),B.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,fe,at,Jt,Ft),this.bufferFragmentData(ie,B,A,x)}if(Y!=null&&(f=Y.samples)!==null&&f!==void 0&&f.length){var St={frag:B,id:h,samples:Y.samples};y.trigger(K.Events.FRAG_PARSING_METADATA,St)}if(w){var ze={frag:B,id:h,samples:w.samples};y.trigger(K.Events.FRAG_PARSING_USERDATA,ze)}},S._bufferInitSegment=function(E,f,h,y){var g=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var x=f.audio,j=f.video,B=f.audiovideo;if(x){var A=E.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),x.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(A="mp4a.40.5")),H.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),E.audioCodec&&E.audioCodec!==A&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+A+'"'),x.levelCodec=A,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(E.audioCodec||"")+"/"+x.codec+"]")}j&&(j.levelCodec=E.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+j.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(F){var w=f[F],Y=w.initSegment;Y!=null&&Y.byteLength&&g.hls.trigger(K.Events.BUFFER_APPENDING,{type:F,data:Y,frag:h,part:null,chunkMeta:y,parent:h.type})}),this.tick()},S.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var f=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,f?this.resetFragmentLoading(E):this.state=P.State.BACKTRACKING},S.checkFragmentChanged=function(){var E=this.media,f=null;if(E&&E.readyState>1&&E.seeking===!1){var h=E.currentTime;if(I.BufferHelper.isBuffered(E,h)?f=this.getAppendedFrag(h):I.BufferHelper.isBuffered(E,h+.1)&&(f=this.getAppendedFrag(h+.1)),f){var y=this.fragPlaying,g=f.level;(!y||f.sn!==y.sn||y.level!==g||f.urlId!==y.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:f}),(!y||y.level!==g)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=f)}}},s(R,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var f=this.getAppendedFrag(E.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var f=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"SubtitleStreamController",function(){return i});var G=U("./src/events.ts"),P=U("./src/utils/logger.ts"),k=U("./src/utils/buffer-helper.ts"),K=U("./src/controller/fragment-finders.ts"),I=U("./src/utils/discontinuities.ts"),r=U("./src/controller/level-helper.ts"),M=U("./src/controller/fragment-tracker.ts"),_=U("./src/controller/base-stream-controller.ts"),p=U("./src/types/loader.ts"),m=U("./src/types/level.ts");function u(n,O){for(var T=0;T<O.length;T++){var C=O[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(n,C.key,C)}}function a(n,O,T){return O&&u(n.prototype,O),T&&u(n,T),n}function o(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,c(n,O)}function c(n,O){return c=Object.setPrototypeOf||function(C,R){return C.__proto__=R,C},c(n,O)}var s=500,i=function(n){o(O,n);function O(C,R){var S;return S=n.call(this,C,R,"[subtitle-stream-controller]")||this,S.levels=[],S.currentTrackId=-1,S.tracksBuffered=[],S.mainDetails=null,S._registerListeners(),S}var T=O.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var R=this.hls;R.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(G.Events.ERROR,this.onError,this),R.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var R=this.hls;R.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(G.Events.ERROR,this.onError,this),R.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=_.State.IDLE,this.setInterval(s),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(R,S){this.mainDetails=S.details},T.onSubtitleFragProcessed=function(R,S){var v=S.frag,E=S.success;if(this.fragPrevious=v,this.state=_.State.IDLE,!E)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var h,y=v.start,g=0;g<f.length;g++)if(y>=f[g].start&&y<=f[g].end){h=f[g];break}var x=v.start+v.duration;h?h.end=x:(h={start:y,end:x},f.push(h)),this.fragmentTracker.fragBuffered(v)},T.onBufferFlushing=function(R,S){var v=S.startOffset,E=S.endOffset;if(v===0&&E!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,h=this.levels;if(!h.length||!h[f]||!h[f].details)return;var y=h[f].details,g=y.targetduration,x=E-g;if(x<=0)return;S.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(j){for(var B=0;B<j.length;){if(j[B].end<=x){j.shift();continue}else if(j[B].start<x)j[B].start=x;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(v,x,p.PlaylistLevelType.SUBTITLE)}},T.onError=function(R,S){var v,E=S.frag;if(!E||E.type!==p.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=_.State.IDLE},T.onSubtitleTracksUpdated=function(R,S){var v=this,E=S.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(f){return new m.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){v.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(R,S){if(this.currentTrackId=S.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var v=this.levels[this.currentTrackId];v!=null&&v.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,v&&this.setInterval(s)},T.onSubtitleTrackLoaded=function(R,S){var v,E=S.details,f=S.id,h=this.currentTrackId,y=this.levels;if(!y.length)return;var g=y[h];if(f>=y.length||f!==h||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(v=g.details)!==null&&v!==void 0&&v.live){var x=this.mainDetails;if(E.deltaUpdateFailed||!x)return;var j=x.fragments[0];if(!g.details)E.hasProgramDateTime&&x.hasProgramDateTime?Object(I.alignMediaPlaylistByPDT)(E,x):j&&Object(r.addSliding)(E,j.start);else{var B=this.alignPlaylists(E,g.details);B===0&&j&&Object(r.addSliding)(E,j.start)}}if(g.details=E,this.levelLastLoaded=f,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===_.State.IDLE){var A=Object(K.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},T._handleFragmentLoadComplete=function(R){var S=R.frag,v=R.payload,E=S.decryptdata,f=this.hls;if(this.fragContextChanged(S))return;if(v&&v.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),E.key.buffer,E.iv.buffer).then(function(y){var g=performance.now();f.trigger(G.Events.FRAG_DECRYPTED,{frag:S,payload:y,stats:{tstart:h,tdecrypt:g}})})}},T.doTick=function(){if(!this.media){this.state=_.State.IDLE;return}if(this.state===_.State.IDLE){var R,S=this.currentTrackId,v=this.levels;if(!v.length||!v[S]||!v[S].details)return;var E=v[S].details,f=E.targetduration,h=this.config,y=this.media,g=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,y.currentTime-f,h.maxBufferHole),x=g.end,j=g.len,B=this.getMaxBufferLength()+f;if(j>B)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var A=E.fragments,H=A.length,F=E.edge,w,Y=this.fragPrevious;if(x<F){var q=h.maxFragLookUpTolerance;Y&&E.hasProgramDateTime&&(w=Object(K.findFragmentByPDT)(A,Y.endProgramDateTime,q)),w||(w=Object(K.findFragmentByPTS)(Y,A,x,q),!w&&Y&&Y.start<A[0].start&&(w=A[0]))}else w=A[H-1];(R=w)!==null&&R!==void 0&&R.encrypted?(P.logger.log("Loading key for "+w.sn),this.state=_.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:w})):w&&this.fragmentTracker.getState(w)===M.FragmentState.NOT_LOADED&&this.loadFragment(w,E,x)}},T.loadFragment=function(R,S,v){this.fragCurrent=R,n.prototype.loadFragment.call(this,R,S,v)},a(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(_.default)},"./src/controller/subtitle-track-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/utils/texttrack-utils.ts"),k=U("./src/controller/base-playlist-controller.ts"),K=U("./src/types/loader.ts");function I(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function r(u,a,o){return a&&I(u.prototype,a),o&&I(u,o),u}function M(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,_(u,a)}function _(u,a){return _=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},_(u,a)}var p=function(u){M(a,u);function a(c){var s;return s=u.call(this,c,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var o=a.prototype;return o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},o.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(G.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(G.Events.ERROR,this.onError,this)},o.onMediaAttached=function(s,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},o.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},o.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var s=m(this.media.textTracks);s.forEach(function(i){Object(P.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(s,i){this.tracks=i.subtitleTracks},o.onSubtitleTrackLoaded=function(s,i){var n=i.id,O=i.details,T=this.trackId,C=this.tracksInGroup[T];if(!C){this.warn("Invalid subtitle track id "+n);return}var R=C.details;C.details=i.details,this.log("subtitle track "+n+" loaded ["+O.startSN+"-"+O.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,i,R))},o.onLevelLoading=function(s,i){this.switchLevel(i.level)},o.onLevelSwitching=function(s,i){this.switchLevel(i.level)},o.switchLevel=function(s){var i=this.hls.levels[s];if(!(i!=null&&i.textGroupIds))return;var n=i.textGroupIds[i.urlId];if(this.groupId!==n){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(S){return!n||S.groupId===n});this.tracksInGroup=T;var C=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=n;var R={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,R),C!==-1&&this.setSubtitleTrack(C,O)}},o.findTrackId=function(s){for(var i=this.tracksInGroup,n=0;n<i.length;n++){var O=i[n];if((!this.selectDefaultTrack||O.default)&&(!s||s===O.name))return O.id}return-1},o.onError=function(s,i){if(u.prototype.onError.call(this,s,i),i.fatal||!i.context)return;i.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},o.loadPlaylist=function(s){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var n=i.id,O=i.groupId,T=i.url;if(s)try{T=s.addDirectives(T)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADING,{url:T,id:n,groupId:O,deliveryDirectives:s||null})}},o.toggleTrackModes=function(s){var i=this,n=this.media,O=this.subtitleDisplay,T=this.trackId;if(!n)return;var C=m(n.textTracks),R=C.filter(function(E){return E.groupId===i.groupId});if(s===-1)[].slice.call(C).forEach(function(E){E.mode="disabled"});else{var S=R[T];S&&(S.mode="disabled")}var v=R[s];v&&(v.mode=O?"showing":"hidden")},o.setSubtitleTrack=function(s,i){var n,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(n=O[s])!==null&&n!==void 0&&n.details)||s<-1||s>=O.length)return;this.clearTimer();var T=O[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,T){var C=T.id,R=T.groupId,S=R===void 0?"":R,v=T.name,E=T.type,f=T.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:S,name:v,type:E,url:f});var h=this.switchParams(T.url,i==null?void 0:i.details);this.loadPlaylist(h)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:s})},o.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,i=m(this.media.textTracks),n=0;n<i.length;n++)if(i[n].mode==="hidden")s=n;else if(i[n].mode==="showing"){s=n;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},r(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,i)}}]),a}(k.default);function m(u){for(var a=[],o=0;o<u.length;o++){var c=u[o];c.kind==="subtitles"&&c.label&&a.push(u[o])}return a}V.default=p},"./src/controller/timeline-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"TimelineController",function(){return m});var G=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),k=U("./src/utils/cea-608-parser.ts"),K=U("./src/utils/output-filter.ts"),I=U("./src/utils/webvtt-parser.ts"),r=U("./src/utils/texttrack-utils.ts"),M=U("./src/utils/imsc1-ttml-parser.ts"),_=U("./src/types/loader.ts"),p=U("./src/utils/logger.ts"),m=function(){function c(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var n=new K.default(this,"textTrack1"),O=new K.default(this,"textTrack2"),T=new K.default(this,"textTrack3"),C=new K.default(this,"textTrack4");this.cea608Parser1=new k.default(1,n,O),this.cea608Parser2=new k.default(3,T,C)}i.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(P.Events.FRAG_LOADING,this.onFragLoading,this),i.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=c.prototype;return s.destroy=function(){var n=this.hls;n.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.off(P.Events.FRAG_LOADING,this.onFragLoading,this),n.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(n,O,T,C,R){for(var S=!1,v=R.length;v--;){var E=R[v],f=a(E[0],E[1],O,T);if(f>=0&&(E[0]=Math.min(E[0],O),E[1]=Math.max(E[1],T),S=!0,f/(T-O)>.5))return}if(S||R.push([O,T]),this.config.renderTextTracksNatively){var h=this.captionsTracks[n];this.Cues.newCue(h,O,T,C)}else{var y=this.Cues.newCue(null,O,T,C);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:y,track:n})}},s.onInitPtsFound=function(n,O){var T=this,C=O.frag,R=O.id,S=O.initPTS,v=O.timescale,E=this.unparsedVttFrags;R==="main"&&(this.initPTS[C.cc]=S,this.timescale[C.cc]=v),E.length&&(this.unparsedVttFrags=[],E.forEach(function(f){T.onFragLoaded(P.Events.FRAG_LOADED,f)}))},s.getExistingTrack=function(n){var O=this.media;if(O)for(var T=0;T<O.textTracks.length;T++){var C=O.textTracks[T];if(C[n])return C}return null},s.createCaptionsTrack=function(n){this.config.renderTextTracksNatively?this.createNativeTrack(n):this.createNonNativeTrack(n)},s.createNativeTrack=function(n){if(this.captionsTracks[n])return;var O=this.captionsProperties,T=this.captionsTracks,C=this.media,R=O[n],S=R.label,v=R.languageCode,E=this.getExistingTrack(n);if(E)T[n]=E,Object(r.clearCurrentCues)(T[n]),Object(r.sendAddTrackEvent)(T[n],C);else{var f=this.createTextTrack("captions",S,v);f&&(f[n]=!0,T[n]=f)}},s.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var O=this.captionsProperties[n];if(!O)return;var T=O.label,C={_id:n,label:T,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[n]=C,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[C]})},s.createTextTrack=function(n,O,T){var C=this.media;return C?C.addTextTrack(n,O,T):void 0},s.onMediaAttaching=function(n,O){this.media=O.media,this._cleanTracks()},s.onMediaDetaching=function(){var n=this.captionsTracks;Object.keys(n).forEach(function(O){Object(r.clearCurrentCues)(n[O]),delete n[O]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},s._cleanTracks=function(){var n=this.media;if(!n)return;var O=n.textTracks;if(O)for(var T=0;T<O.length;T++)Object(r.clearCurrentCues)(O[T])},s.onSubtitleTracksUpdated=function(n,O){var T=this;this.textTracks=[];var C=O.subtitleTracks||[],R=C.some(function(f){return f.textCodec===M.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var S=this.tracks&&C&&this.tracks.length===C.length;if(this.tracks=C||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,h){var y;if(h<v.length){for(var g=null,x=0;x<v.length;x++)if(u(v[x],f)){g=v[x];break}g&&(y=g)}y?Object(r.clearCurrentCues)(y):(y=T.createTextTrack("subtitles",f.name,f.lang),y&&(y.mode="disabled")),y&&(y.groupId=f.groupId,T.textTracks.push(y))})}else if(!S&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},s.onManifestLoaded=function(n,O){var T=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(C){var R=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(!R)return;var S="textTrack"+R[1],v=T.captionsProperties[S];if(!v)return;v.label=C.name,C.lang&&(v.languageCode=C.lang),v.media=C})},s.onFragLoading=function(n,O){var T=this.cea608Parser1,C=this.cea608Parser2,R=this.lastSn,S=this.lastPartIndex;if(!this.enabled||!(T&&C))return;if(O.frag.type===_.PlaylistLevelType.MAIN){var v,E,f=O.frag.sn,h=(v=O==null||((E=O.part)===null||E===void 0)?void 0:E.index)!=null?v:-1;f===R+1||f===R&&h===S+1||(T.reset(),C.reset()),this.lastSn=f,this.lastPartIndex=h}},s.onFragLoaded=function(n,O){var T=O.frag,C=O.payload,R=this.initPTS,S=this.unparsedVttFrags;if(T.type===_.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!Object(G.isFiniteNumber)(R[T.cc])){S.push(O),R.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var v=T.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var E=this.tracks[T.level],f=this.vttCCs;f[T.cc]||(f[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),E&&E.textCodec===M.IMSC1_CODEC?this._parseIMSC1(T,C):this._parseVTTs(T,C,f)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(n,O){var T=this,C=this.hls;Object(M.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(R){T._appendCues(R,n.level),C.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(R){p.logger.log("Failed to parse IMSC1: "+R),C.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:R})})},s._parseVTTs=function(n,O,T){var C=this,R=this.hls;Object(I.parseWebVTT)(O,this.initPTS[n.cc],this.timescale[n.cc],T,n.cc,n.start,function(S){C._appendCues(S,n.level),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(S){C._fallbackToIMSC1(n,O),p.logger.log("Failed to parse VTT cue: "+S),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:S})})},s._fallbackToIMSC1=function(n,O){var T=this,C=this.tracks[n.level];C.textCodec||Object(M.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(){C.textCodec=M.IMSC1_CODEC,T._parseIMSC1(n,O)},function(){C.textCodec="wvtt"})},s._appendCues=function(n,O){var T=this.hls;if(this.config.renderTextTracksNatively){var C=this.textTracks[O];if(C.mode==="disabled")return;n.forEach(function(v){return Object(r.addCueToTrack)(C,v)})}else{var R=this.tracks[O],S=R.default?"default":"subtitles"+O;T.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:n,track:S})}},s.onFragDecrypted=function(n,O){var T=O.frag;if(T.type===_.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(P.Events.FRAG_LOADED,O)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(n,O){var T=this.cea608Parser1,C=this.cea608Parser2;if(!this.enabled||!(T&&C))return;for(var R=0;R<O.samples.length;R++){var S=O.samples[R].bytes;if(S){var v=this.extractCea608Data(S);T.addData(O.samples[R].pts,v[0]),C.addData(O.samples[R].pts,v[1])}}},s.onBufferFlushing=function(n,O){var T=O.startOffset,C=O.endOffset,R=O.endOffsetSubtitles,S=O.type,v=this.media;if(!v||v.currentTime<C)return;if(!S||S==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(h){return Object(r.removeCuesInRange)(E[h],T,C)})}if(this.config.renderTextTracksNatively&&(T===0&&R!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(h){return Object(r.removeCuesInRange)(f[h],T,R)})}},s.extractCea608Data=function(n){for(var O=n[0]&31,T=2,C=[[],[]],R=0;R<O;R++){var S=n[T++],v=127&n[T++],E=127&n[T++],f=(4&S)!==0,h=3&S;if(v===0&&E===0)continue;f&&((h===0||h===1)&&(C[h].push(v),C[h].push(E)))}return C},c}();function u(c,s){return c&&c.label===s.name&&!(c.textTrack1||c.textTrack2)}function a(c,s,i,n){return Math.min(s,n)-Math.max(c,i)}function o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(K,I){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=I}var k=P.prototype;return k.decrypt=function(I,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,I)},P}()},"./src/crypt/aes-decryptor.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"removePadding",function(){return P}),U.d(V,"default",function(){return k});var G=U("./src/utils/typed-array.ts");function P(K){var I=K.byteLength,r=I&&new DataView(K.buffer).getUint8(I-1);return r?Object(G.sliceUint8)(K,0,I-r):K}var k=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var I=K.prototype;return I.uint8ArrayToUint32Array_=function(M){for(var _=new DataView(M),p=new Uint32Array(4),m=0;m<4;m++)p[m]=_.getUint32(m*4);return p},I.initTable=function(){var M=this.sBox,_=this.invSBox,p=this.subMix,m=p[0],u=p[1],a=p[2],o=p[3],c=this.invSubMix,s=c[0],i=c[1],n=c[2],O=c[3],T=new Uint32Array(256),C=0,R=0,S=0;for(S=0;S<256;S++)S<128?T[S]=S<<1:T[S]=S<<1^283;for(S=0;S<256;S++){var v=R^R<<1^R<<2^R<<3^R<<4;v=v>>>8^v&255^99,M[C]=v,_[v]=C;var E=T[C],f=T[E],h=T[f],y=T[v]*257^v*16843008;m[C]=y<<24|y>>>8,u[C]=y<<16|y>>>16,a[C]=y<<8|y>>>24,o[C]=y,y=h*16843009^f*65537^E*257^C*16843008,s[v]=y<<24|y>>>8,i[v]=y<<16|y>>>16,n[v]=y<<8|y>>>24,O[v]=y,C?(C=E^T[T[T[h^E]]],R^=T[T[R]]):C=R=1}},I.expandKey=function(M){for(var _=this.uint8ArrayToUint32Array_(M),p=!0,m=0;m<_.length&&p;)p=_[m]===this.key[m],m++;if(p)return;this.key=_;var u=this.keySize=_.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var a=this.ksRows=(u+6+1)*4,o,c,s=this.keySchedule=new Uint32Array(a),i=this.invKeySchedule=new Uint32Array(a),n=this.sBox,O=this.rcon,T=this.invSubMix,C=T[0],R=T[1],S=T[2],v=T[3],E,f;for(o=0;o<a;o++){if(o<u){E=s[o]=_[o];continue}f=E,o%u===0?(f=f<<8|f>>>24,f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255],f^=O[o/u|0]<<24):u>6&&o%u===4&&(f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255]),s[o]=E=(s[o-u]^f)>>>0}for(c=0;c<a;c++)o=a-c,c&3?f=s[o]:f=s[o-4],c<4||o<=4?i[c]=f:i[c]=C[n[f>>>24]]^R[n[f>>>16&255]]^S[n[f>>>8&255]]^v[n[f&255]],i[c]=i[c]>>>0},I.networkToHostOrderSwap=function(M){return M<<24|(M&65280)<<8|(M&16711680)>>8|M>>>24},I.decrypt=function(M,_,p){for(var m=this.keySize+6,u=this.invKeySchedule,a=this.invSBox,o=this.invSubMix,c=o[0],s=o[1],i=o[2],n=o[3],O=this.uint8ArrayToUint32Array_(p),T=O[0],C=O[1],R=O[2],S=O[3],v=new Int32Array(M),E=new Int32Array(v.length),f,h,y,g,x,j,B,A,H,F,w,Y,q,ie,ge=this.networkToHostOrderSwap;_<v.length;){for(H=ge(v[_]),F=ge(v[_+1]),w=ge(v[_+2]),Y=ge(v[_+3]),x=H^u[0],j=Y^u[1],B=w^u[2],A=F^u[3],q=4,ie=1;ie<m;ie++)f=c[x>>>24]^s[j>>16&255]^i[B>>8&255]^n[A&255]^u[q],h=c[j>>>24]^s[B>>16&255]^i[A>>8&255]^n[x&255]^u[q+1],y=c[B>>>24]^s[A>>16&255]^i[x>>8&255]^n[j&255]^u[q+2],g=c[A>>>24]^s[x>>16&255]^i[j>>8&255]^n[B&255]^u[q+3],x=f,j=h,B=y,A=g,q=q+4;f=a[x>>>24]<<24^a[j>>16&255]<<16^a[B>>8&255]<<8^a[A&255]^u[q],h=a[j>>>24]<<24^a[B>>16&255]<<16^a[A>>8&255]<<8^a[x&255]^u[q+1],y=a[B>>>24]<<24^a[A>>16&255]<<16^a[x>>8&255]<<8^a[j&255]^u[q+2],g=a[A>>>24]<<24^a[x>>16&255]<<16^a[j>>8&255]<<8^a[B&255]^u[q+3],E[_]=ge(f^T),E[_+1]=ge(g^C),E[_+2]=ge(y^R),E[_+3]=ge(h^S),T=H,C=F,R=w,S=Y,_=_+4}return E.buffer},K}()},"./src/crypt/decrypter.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return _});var G=U("./src/crypt/aes-crypto.ts"),P=U("./src/crypt/fast-aes-key.ts"),k=U("./src/crypt/aes-decryptor.ts"),K=U("./src/utils/logger.ts"),I=U("./src/utils/mp4-tools.ts"),r=U("./src/utils/typed-array.ts"),M=16,_=function(){function p(u,a,o){var c=o===void 0?{}:o,s=c.removePKCS7Padding,i=s===void 0?!0:s;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=u,this.config=a,this.removePKCS7Padding=i,i)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=p.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var o=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(k.removePadding)(o):o},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(a,o,c,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),o,c);var i=this.flush();i&&s(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),o,c).then(s)},m.softwareDecrypt=function(a,o,c){var s=this.currentIV,i=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(a=Object(I.appendUint8Array)(n,a),this.remainderData=null);var O=this.getValidChunk(a);if(!O.length)return null;s&&(c=s);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new k.default),T.expandKey(o);var C=i;return this.currentResult=T.decrypt(O.buffer,0,c),this.currentIV=Object(r.sliceUint8)(O,-16).buffer,C||null},m.webCryptoDecrypt=function(a,o,c){var s=this,i=this.subtle;return(this.key!==o||!this.fastAesKey)&&(this.key=o,this.fastAesKey=new P.default(i,o)),this.fastAesKey.expandKey().then(function(n){if(!i)return Promise.reject(new Error("web crypto not initialized"));var O=new G.default(i,c);return O.decrypt(a.buffer,n)}).catch(function(n){return s.onWebCryptoError(n,a,o,c)})},m.onWebCryptoError=function(a,o,c,s){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(o,c,s)},m.getValidChunk=function(a){var o=a,c=a.length-a.length%M;return c!==a.length&&(o=Object(r.sliceUint8)(a,0,c),this.remainderData=Object(r.sliceUint8)(a,c)),o},m.logOnce=function(a){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(K,I){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=I}var k=P.prototype;return k.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/demux/base-audio-demuxer.ts"),P=U("./src/demux/adts.ts"),k=U("./src/utils/logger.ts"),K=U("./src/demux/id3.ts");function I(_,p){_.prototype=Object.create(p.prototype),_.prototype.constructor=_,r(_,p)}function r(_,p){return r=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},r(_,p)}var M=function(_){I(p,_);function p(u,a){var o;return o=_.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=u,o.config=a,o}var m=p.prototype;return m.resetInitSegment=function(a,o,c){_.prototype.resetInitSegment.call(this,a,o,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:c,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var o=K.getID3Data(a,0)||[],c=o.length,s=a.length;c<s;c++)if(P.probe(a,c))return k.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(a,o){return P.canParse(a,o)},m.appendFrame=function(a,o,c){P.initTrackConfig(a,this.observer,o,c,a.manifestCodec);var s=P.appendFrame(a,o,c,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},p}(G.default);M.minProbeByteLength=9,V.default=M},"./src/demux/adts.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"getAudioConfig",function(){return K}),U.d(V,"isHeaderPattern",function(){return I}),U.d(V,"getHeaderLength",function(){return r}),U.d(V,"getFullFrameLength",function(){return M}),U.d(V,"canGetFrameLength",function(){return _}),U.d(V,"isHeader",function(){return p}),U.d(V,"canParse",function(){return m}),U.d(V,"probe",function(){return u}),U.d(V,"initTrackConfig",function(){return a}),U.d(V,"getFrameDuration",function(){return o}),U.d(V,"parseFrameHeader",function(){return c}),U.d(V,"appendFrame",function(){return s});var G=U("./src/utils/logger.ts"),P=U("./src/errors.ts"),k=U("./src/events.ts");function K(i,n,O,T){var C,R,S,v,E=navigator.userAgent.toLowerCase(),f=T,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];C=((n[O+2]&192)>>>6)+1;var y=(n[O+2]&60)>>>2;if(y>h.length-1){i.trigger(k.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+y});return}return S=(n[O+2]&1)<<2,S|=(n[O+3]&192)>>>6,G.logger.log("manifest codec:"+T+", ADTS type:"+C+", samplingIndex:"+y),/firefox/i.test(E)?y>=6?(C=5,v=new Array(4),R=y-3):(C=2,v=new Array(2),R=y):E.indexOf("android")!==-1?(C=2,v=new Array(2),R=y):(C=5,v=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&y>=6?R=y-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(y>=6&&S===1||/vivaldi/i.test(E))||!T&&S===1)&&(C=2,v=new Array(2)),R=y)),v[0]=C<<3,v[0]|=(y&14)>>1,v[1]|=(y&1)<<7,v[1]|=S<<3,C===5&&(v[1]|=(R&14)>>1,v[2]=(R&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:h[y],channelCount:S,codec:"mp4a.40."+C,manifestCodec:f}}function I(i,n){return i[n]===255&&(i[n+1]&246)===240}function r(i,n){return i[n+1]&1?7:9}function M(i,n){return(i[n+3]&3)<<11|i[n+4]<<3|(i[n+5]&224)>>>5}function _(i,n){return n+5<i.length}function p(i,n){return n+1<i.length&&I(i,n)}function m(i,n){return _(i,n)&&I(i,n)&&M(i,n)<=i.length-n}function u(i,n){if(p(i,n)){var O=r(i,n);if(n+O>=i.length)return!1;var T=M(i,n);if(T<=O)return!1;var C=n+T;return C===i.length||p(i,C)}return!1}function a(i,n,O,T,C){if(!i.samplerate){var R=K(n,O,T,C);if(!R)return;i.config=R.config,i.samplerate=R.samplerate,i.channelCount=R.channelCount,i.codec=R.codec,i.manifestCodec=R.manifestCodec,G.logger.log("parsed codec:"+i.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function o(i){return 1024*9e4/i}function c(i,n,O,T,C){var R=r(i,n),S=M(i,n);if(S-=R,S>0){var v=O+T*C;return{headerLength:R,frameLength:S,stamp:v}}}function s(i,n,O,T,C){var R=o(i.samplerate),S=c(n,O,T,C,R);if(S){var v=S.frameLength,E=S.headerLength,f=S.stamp,h=E+v,y=Math.max(0,O+h-n.length),g;y?(g=new Uint8Array(h-E),g.set(n.subarray(O+E,n.length),0)):g=n.subarray(O+E,O+h);var x={unit:g,pts:f};return y||i.samples.push(x),{sample:x,length:h,missing:y}}}},"./src/demux/base-audio-demuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"initPTSFn",function(){return M});var G=U("./src/polyfills/number.ts"),P=U("./src/demux/id3.ts"),k=U("./src/demux/dummy-demuxed-track.ts"),K=U("./src/utils/mp4-tools.ts"),I=U("./src/utils/typed-array.ts"),r=function(){function _(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=_.prototype;return p.resetInitSegment=function(u,a,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(u,a){return!1},p.appendFrame=function(u,a,o){},p.demux=function(u,a){this.cachedData&&(u=Object(K.appendUint8Array)(this.cachedData,u),this.cachedData=null);var o=P.getID3Data(u,0),c=o?o.length:0,s,i,n=this._audioTrack,O=this._id3Track,T=o?P.getTimeStamp(o):void 0,C=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(T,a)),o&&o.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:o}),i=this.initPTS;c<C;){if(this.canParse(u,c)){var R=this.appendFrame(n,u,c);R?(this.frameIndex++,i=R.sample.pts,c+=R.length,s=c):c=C}else P.canParse(u,c)?(o=P.getID3Data(u,c),O.samples.push({pts:i,dts:i,data:o}),c+=o.length,s=c):c++;if(c===C&&s!==C){var S=Object(I.sliceUint8)(u,s);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,S):this.cachedData=S}}return{audioTrack:n,avcTrack:Object(k.dummyTrack)(),id3Track:O,textTrack:Object(k.dummyTrack)()}},p.demuxSampleAes=function(u,a,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(u){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(k.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(k.dummyTrack)()}},p.destroy=function(){},_}(),M=function(p,m){return Object(G.isFiniteNumber)(p)?p*90:m*9e4};V.default=r},"./src/demux/chunk-cache.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function k(){this.chunks=[],this.dataLength=0}var K=k.prototype;return K.push=function(r){this.chunks.push(r),this.dataLength+=r.length},K.flush=function(){var r=this.chunks,M=this.dataLength,_;if(r.length)r.length===1?_=r[0]:_=P(r,M);else return new Uint8Array(0);return this.reset(),_},K.reset=function(){this.chunks.length=0,this.dataLength=0},k}();function P(k,K){for(var I=new Uint8Array(K),r=0,M=0;M<k.length;M++){var _=k[M];I.set(_,r),r+=_.length}return I}},"./src/demux/dummy-demuxed-track.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"dummyTrack",function(){return G});function G(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/logger.ts"),P=function(){function k(I){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=I,this.bytesAvailable=I.byteLength,this.word=0,this.bitsAvailable=0}var K=k.prototype;return K.loadWord=function(){var r=this.data,M=this.bytesAvailable,_=r.byteLength-M,p=new Uint8Array(4),m=Math.min(4,M);if(m===0)throw new Error("no bytes available");p.set(r.subarray(_,_+m)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},K.skipBits=function(r){var M;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,M=r>>3,r-=M>>3,this.bytesAvailable-=M,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var M=Math.min(this.bitsAvailable,r),_=this.word>>>32-M;return r>32&&G.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=M,this.bitsAvailable>0?this.word<<=M:this.bytesAvailable>0&&this.loadWord(),M=r-M,M>0&&this.bitsAvailable?_<<M|this.readBits(M):_},K.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var M=8,_=8,p,m=0;m<r;m++)_!==0&&(p=this.readEG(),_=(M+p+256)%256),M=_===0?M:_},K.readSPS=function(){var r=0,M=0,_=0,p=0,m,u,a,o=this.readUByte.bind(this),c=this.readBits.bind(this),s=this.readUEG.bind(this),i=this.readBoolean.bind(this),n=this.skipBits.bind(this),O=this.skipEG.bind(this),T=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);o();var R=o();if(c(5),n(3),o(),T(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var S=s();if(S===3&&n(1),T(),T(),n(1),i())for(u=S!==3?8:12,a=0;a<u;a++)i()&&(a<6?C(16):C(64))}T();var v=s();if(v===0)s();else if(v===1)for(n(1),O(),O(),m=s(),a=0;a<m;a++)O();T(),n(1);var E=s(),f=s(),h=c(1);h===0&&n(1),n(1),i()&&(r=s(),M=s(),_=s(),p=s());var y=[1,1];if(i()&&i()){var g=o();switch(g){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:{y=[o()<<8|o(),o()<<8|o()];break}}}return{width:Math.ceil((E+1)*16-r*2-M*2),height:(2-h)*(f+1)*16-(h?2:4)*(_+p),pixelRatio:y}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},k}();V.default=P},"./src/demux/id3.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isHeader",function(){return G}),U.d(V,"isFooter",function(){return P}),U.d(V,"getID3Data",function(){return k}),U.d(V,"canParse",function(){return I}),U.d(V,"getTimeStamp",function(){return r}),U.d(V,"isTimeStampFrame",function(){return M}),U.d(V,"getID3Frames",function(){return p}),U.d(V,"decodeFrame",function(){return m}),U.d(V,"utf8ArrayToStr",function(){return s}),U.d(V,"testables",function(){return i});var G=function(C,R){return R+10<=C.length&&(C[R]===73&&C[R+1]===68&&C[R+2]===51&&(C[R+3]<255&&C[R+4]<255&&(C[R+6]<128&&C[R+7]<128&&C[R+8]<128&&C[R+9]<128)))},P=function(C,R){return R+10<=C.length&&(C[R]===51&&C[R+1]===68&&C[R+2]===73&&(C[R+3]<255&&C[R+4]<255&&(C[R+6]<128&&C[R+7]<128&&C[R+8]<128&&C[R+9]<128)))},k=function(C,R){for(var S=R,v=0;G(C,R);){v+=10;var E=K(C,R+6);v+=E,P(C,R+10)&&(v+=10),R+=v}return v>0?C.subarray(S,S+v):void 0},K=function(C,R){var S=0;return S=(C[R]&127)<<21,S|=(C[R+1]&127)<<14,S|=(C[R+2]&127)<<7,S|=C[R+3]&127,S},I=function(C,R){return G(C,R)&&K(C,R+6)+10<=C.length-R},r=function(C){for(var R=p(C),S=0;S<R.length;S++){var v=R[S];if(M(v))return c(v)}return},M=function(C){return C&&C.key==="PRIV"&&C.info==="com.apple.streaming.transportStreamTimestamp"},_=function(C){var R=String.fromCharCode(C[0],C[1],C[2],C[3]),S=K(C,4),v=10;return{type:R,size:S,data:C.subarray(v,v+S)}},p=function(C){for(var R=0,S=[];G(C,R);){var v=K(C,R+6);R+=10;for(var E=R+v;R+8<E;){var f=_(C.subarray(R)),h=m(f);h&&S.push(h),R+=f.size+10}P(C,R)&&(R+=10)}return S},m=function(C){return C.type==="PRIV"?u(C):C.type[0]==="W"?o(C):a(C)},u=function(C){if(C.size<2)return;var R=s(C.data,!0),S=new Uint8Array(C.data.subarray(R.length+1));return{key:C.type,info:R,data:S.buffer}},a=function(C){if(C.size<2)return;if(C.type==="TXXX"){var R=1,S=s(C.data.subarray(R),!0);R+=S.length+1;var v=s(C.data.subarray(R));return{key:C.type,info:S,data:v}}var E=s(C.data.subarray(1));return{key:C.type,data:E}},o=function(C){if(C.type==="WXXX"){if(C.size<2)return;var R=1,S=s(C.data.subarray(R),!0);R+=S.length+1;var v=s(C.data.subarray(R));return{key:C.type,info:S,data:v}}var E=s(C.data);return{key:C.type,data:E}},c=function(C){if(C.data.byteLength===8){var R=new Uint8Array(C.data),S=R[3]&1,v=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return v/=45,S&&(v+=4772185884e-2),Math.round(v)}return},s=function(C,R){R===void 0&&(R=!1);var S=O();if(S){var v=S.decode(C);if(R){var E=v.indexOf("\0");return E!==-1?v.substring(0,E):v}return v.replace(/\0/g,"")}for(var f=C.length,h,y,g,x="",j=0;j<f;){if(h=C[j++],h===0&&R)return x;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(h);break;case 12:case 13:y=C[j++],x+=String.fromCharCode((h&31)<<6|y&63);break;case 14:y=C[j++],g=C[j++],x+=String.fromCharCode((h&15)<<12|(y&63)<<6|(g&63)<<0);break;default:}}return x},i={decodeTextFrame:a},n;function O(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/demux/base-audio-demuxer.ts"),P=U("./src/demux/id3.ts"),k=U("./src/utils/logger.ts"),K=U("./src/demux/mpegaudio.ts");function I(_,p){_.prototype=Object.create(p.prototype),_.prototype.constructor=_,r(_,p)}function r(_,p){return r=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},r(_,p)}var M=function(_){I(p,_);function p(){return _.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(a,o,c){_.prototype.resetInitSegment.call(this,a,o,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:c,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var o=P.getID3Data(a,0)||[],c=o.length,s=a.length;c<s;c++)if(K.probe(a,c))return k.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(a,o){return K.canParse(a,o)},m.appendFrame=function(a,o,c){return this.initPTS===null?void 0:K.appendFrame(a,o,c,this.initPTS,this.frameIndex)},p}(G.default);M.minProbeByteLength=4,V.default=M},"./src/demux/mp4demuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/mp4-tools.ts"),P=U("./src/demux/dummy-demuxed-track.ts"),k=function(){function K(r,M){this.remainderData=null,this.config=void 0,this.config=M}var I=K.prototype;return I.resetTimeStamp=function(){},I.resetInitSegment=function(){},I.resetContiguity=function(){},K.probe=function(M){return Object(G.findBox)({data:M,start:0,end:Math.min(M.length,16384)},["moof"]).length>0},I.demux=function(M){var _=M,p=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(_=Object(G.appendUint8Array)(this.remainderData,M));var m=Object(G.segmentValidRange)(_);this.remainderData=m.remainder,p.samples=m.valid||new Uint8Array}else p.samples=_;return{audioTrack:Object(P.dummyTrack)(),avcTrack:p,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},I.flush=function(){var M=Object(P.dummyTrack)();return M.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:M,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},I.demuxSampleAes=function(M,_,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},I.destroy=function(){},K}();k.minProbeByteLength=1024,V.default=k},"./src/demux/mpegaudio.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"appendFrame",function(){return r}),U.d(V,"parseHeader",function(){return M}),U.d(V,"isHeaderPattern",function(){return _}),U.d(V,"isHeader",function(){return p}),U.d(V,"canParse",function(){return m}),U.d(V,"probe",function(){return u});var G=null,P=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],k=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],I=[0,1,1,4];function r(a,o,c,s,i){if(c+24>o.length)return;var n=M(o,c);if(n&&c+n.frameLength<=o.length){var O=n.samplesPerFrame*9e4/n.sampleRate,T=s+i*O,C={unit:o.subarray(c,c+n.frameLength),pts:T,dts:T};return a.config=[],a.channelCount=n.channelCount,a.samplerate=n.sampleRate,a.samples.push(C),{sample:C,length:n.frameLength,missing:0}}}function M(a,o){var c=a[o+1]>>3&3,s=a[o+1]>>1&3,i=a[o+2]>>4&15,n=a[o+2]>>2&3;if(c!==1&&i!==0&&i!==15&&n!==3){var O=a[o+2]>>1&1,T=a[o+3]>>6,C=c===3?3-s:s===3?3:4,R=P[C*14+i-1]*1e3,S=c===3?0:c===2?1:2,v=k[S*3+n],E=T===3?1:2,f=K[c][s],h=I[s],y=f*8*h,g=Math.floor(f*R/v+O)*h;if(G===null){var x=navigator.userAgent||"",j=x.match(/Chrome\/(\d+)/i);G=j?parseInt(j[1]):0}var B=!!G&&G<=87;return B&&s===2&&R>=224e3&&T===0&&(a[o+3]=a[o+3]|128),{sampleRate:v,channelCount:E,frameLength:g,samplesPerFrame:y}}}function _(a,o){return a[o]===255&&(a[o+1]&224)===224&&(a[o+1]&6)!==0}function p(a,o){return o+1<a.length&&_(a,o)}function m(a,o){var c=4;return _(a,o)&&c<=a.length-o}function u(a,o){if(o+1<a.length&&_(a,o)){var c=4,s=M(a,o),i=c;s!=null&&s.frameLength&&(i=s.frameLength);var n=o+i;return n===a.length||p(a,n)}return!1}},"./src/demux/sample-aes.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/crypt/decrypter.ts"),P=U("./src/demux/tsdemuxer.ts"),k=function(){function K(r,M,_){this.keyData=void 0,this.decrypter=void 0,this.keyData=_,this.decrypter=new G.default(r,M,{removePKCS7Padding:!1})}var I=K.prototype;return I.decryptBuffer=function(M,_){this.decrypter.decrypt(M,this.keyData.key.buffer,this.keyData.iv.buffer,_)},I.decryptAacSample=function(M,_,p,m){var u=M[_].unit,a=u.subarray(16,u.length-u.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),c=this;this.decryptBuffer(o,function(s){var i=new Uint8Array(s);u.set(i,16),m||c.decryptAacSamples(M,_+1,p)})},I.decryptAacSamples=function(M,_,p){for(;;_++){if(_>=M.length){p();return}if(M[_].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(M,_,p,m),!m)return}},I.getAvcEncryptedData=function(M){for(var _=Math.floor((M.length-48)/160)*16+16,p=new Int8Array(_),m=0,u=32;u<=M.length-16;u+=160,m+=16)p.set(M.subarray(u,u+16),m);return p},I.getAvcDecryptedUnit=function(M,_){for(var p=new Uint8Array(_),m=0,u=32;u<=M.length-16;u+=160,m+=16)M.set(p.subarray(m,m+16),u);return M},I.decryptAvcSample=function(M,_,p,m,u,a){var o=Object(P.discardEPB)(u.data),c=this.getAvcEncryptedData(o),s=this;this.decryptBuffer(c.buffer,function(i){u.data=s.getAvcDecryptedUnit(o,i),a||s.decryptAvcSamples(M,_,p+1,m)})},I.decryptAvcSamples=function(M,_,p,m){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;_++,p=0){if(_>=M.length){m();return}for(var u=M[_].units;!(p>=u.length);p++){var a=u[p];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var o=this.decrypter.isSync();if(this.decryptAvcSample(M,_,p,m,a,o),!o)return}}},K}();V.default=k},"./src/demux/transmuxer-interface.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return u});var G=U("./node_modules/webworkify-webpack/index.js"),P=U.n(G),k=U("./src/events.ts"),K=U("./src/demux/transmuxer.ts"),I=U("./src/utils/logger.ts"),r=U("./src/errors.ts"),M=U("./src/utils/mediasource-helper.ts"),_=U("./node_modules/eventemitter3/index.js"),p=U.n(_),m=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function a(c,s,i,n){var O=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=c,this.id=s,this.onTransmuxComplete=i,this.onFlush=n;var T=c.config,C=function(f,h){h=h||{},h.frag=O.frag,h.id=O.id,c.trigger(f,h)};this.observer=new _.EventEmitter,this.observer.on(k.Events.FRAG_DECRYPTED,C),this.observer.on(k.Events.ERROR,C);var R={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){I.logger.log("demuxing in webworker");var v;try{v=this.worker=G("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(E){c.trigger(k.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},v.postMessage({cmd:"init",typeSupported:R,vendor:S,id:s,config:JSON.stringify(T)})}catch(E){I.logger.warn("Error in worker:",E),I.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new K.default(this.observer,R,T,S,s),this.worker=null}}else this.transmuxer=new K.default(this.observer,R,T,S,s)}var o=a.prototype;return o.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},o.push=function(s,i,n,O,T,C,R,S,v,E){var f=this;v.transmuxing.start=self.performance.now();var h=this.transmuxer,y=this.worker,g=C?C.start:T.start,x=T.decryptdata,j=this.frag,B=!(j&&T.cc===j.cc),A=!(j&&v.level===j.level),H=j?v.sn-j.sn:-1,F=this.part?v.part-this.part.index:1,w=!A&&(H===1||H===0&&F===1),Y=self.performance.now();(A||H||T.stats.parsing.start===0)&&(T.stats.parsing.start=Y),C&&(F||!w)&&(C.stats.parsing.start=Y);var q=new K.TransmuxState(B,w,S,A,g);if(!w||B){I.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
discontinuity: `+B+`
trackSwitch: `+A+`
contiguous: `+w+`
accurateTimeOffset: `+S+`
timeOffset: `+g);var ie=new K.TransmuxConfig(n,O,i,R,E);this.configureTransmuxer(ie)}if(this.frag=T,this.part=C,y)y.postMessage({cmd:"demux",data:s,decryptdata:x,chunkMeta:v,state:q},s instanceof ArrayBuffer?[s]:[]);else if(h){var ge=h.push(s,x,v,q);Object(K.isPromise)(ge)?ge.then(function(Je){f.handleTransmuxComplete(Je)}):this.handleTransmuxComplete(ge)}},o.flush=function(s){var i=this;s.transmuxing.start=self.performance.now();var n=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:s});else if(n){var T=n.flush(s);Object(K.isPromise)(T)?T.then(function(C){i.handleFlushResult(C,s)}):this.handleFlushResult(T,s)}},o.handleFlushResult=function(s,i){var n=this;s.forEach(function(O){n.handleTransmuxComplete(O)}),this.onFlush(i)},o.onWorkerMessage=function(s){var i=s.data,n=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,n.trigger(i.event,i.data);break}}},o.configureTransmuxer=function(s){var i=this.worker,n=this.transmuxer;i?i.postMessage({cmd:"configure",config:s}):n&&n.configure(s)},o.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},a}()},"./src/demux/transmuxer-worker.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return r});var G=U("./src/demux/transmuxer.ts"),P=U("./src/events.ts"),k=U("./src/utils/logger.ts"),K=U("./node_modules/eventemitter3/index.js"),I=U.n(K);function r(u){var a=new K.EventEmitter,o=function(s,i){u.postMessage({event:s,data:i})};a.on(P.Events.FRAG_DECRYPTED,o),a.on(P.Events.ERROR,o),u.addEventListener("message",function(c){var s=c.data;switch(s.cmd){case"init":{var i=JSON.parse(s.config);u.transmuxer=new G.default(a,s.typeSupported,i,s.vendor,s.id),Object(k.enableLogs)(i.debug),o("init",null);break}case"configure":{u.transmuxer.configure(s.config);break}case"demux":{var n=u.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(G.isPromise)(n)?n.then(function(C){M(u,C)}):M(u,n);break}case"flush":{var O=s.chunkMeta,T=u.transmuxer.flush(O);Object(G.isPromise)(T)?T.then(function(C){p(u,C,O)}):p(u,T,O);break}default:break}})}function M(u,a){if(m(a.remuxResult))return;var o=[],c=a.remuxResult,s=c.audio,i=c.video;s&&_(o,s),i&&_(o,i),u.postMessage({event:"transmuxComplete",data:a},o)}function _(u,a){a.data1&&u.push(a.data1.buffer),a.data2&&u.push(a.data2.buffer)}function p(u,a,o){a.forEach(function(c){M(u,c)}),u.postMessage({event:"flush",data:o})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return i}),U.d(V,"isPromise",function(){return T}),U.d(V,"TransmuxConfig",function(){return C}),U.d(V,"TransmuxState",function(){return R});var G=U("./src/events.ts"),P=U("./src/errors.ts"),k=U("./src/crypt/decrypter.ts"),K=U("./src/demux/aacdemuxer.ts"),I=U("./src/demux/mp4demuxer.ts"),r=U("./src/demux/tsdemuxer.ts"),M=U("./src/demux/mp3demuxer.ts"),_=U("./src/remux/mp4-remuxer.ts"),p=U("./src/remux/passthrough-remuxer.ts"),m=U("./src/demux/chunk-cache.ts"),u=U("./src/utils/mp4-tools.ts"),a=U("./src/utils/logger.ts"),o;try{o=self.performance.now.bind(self.performance)}catch(S){a.logger.debug("Unable to use Performance API on this environment"),o=self.Date.now}var c=[{demux:r.default,remux:_.default},{demux:I.default,remux:p.default},{demux:K.default,remux:_.default},{demux:M.default,remux:_.default}],s=1024;c.forEach(function(S){var v=S.demux;s=Math.max(s,v.minProbeByteLength)});var i=function(){function S(E,f,h,y,g){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new m.default,this.observer=E,this.typeSupported=f,this.config=h,this.vendor=y,this.id=g}var v=S.prototype;return v.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},v.push=function(f,h,y,g){var x=this,j=y.transmuxing;j.executeStart=o();var B=new Uint8Array(f),A=this.cache,H=this.config,F=this.currentTransmuxState,w=this.transmuxConfig;g&&(this.currentTransmuxState=g);var Y=n(B,h);if(Y&&Y.method==="AES-128"){var q=this.getDecrypter();if(H.enableSoftwareAES){var ie=q.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!ie)return j.executeEnd=o(),O(y);B=new Uint8Array(ie)}else return this.decryptionPromise=q.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(ct){var jt=x.push(ct,null,y);return x.decryptionPromise=null,jt}),this.decryptionPromise}var ge=g||F,Je=ge.contiguous,xe=ge.discontinuity,ke=ge.trackSwitch,Qe=ge.accurateTimeOffset,Ye=ge.timeOffset,ve=w.audioCodec,fe=w.videoCodec,at=w.defaultInitPts,Jt=w.duration,Ft=w.initSegmentData;if((xe||ke)&&this.resetInitSegment(Ft,ve,fe,Jt),xe&&this.resetInitialTimestamp(at),Je||this.resetContiguity(),this.needsProbing(B,xe,ke)){if(A.dataLength){var St=A.flush();B=Object(u.appendUint8Array)(St,B)}this.configureTransmuxer(B,w)}var ze=this.transmux(B,Y,Ye,Qe,y),gt=this.currentTransmuxState;return gt.contiguous=!0,gt.discontinuity=!1,gt.trackSwitch=!1,j.executeEnd=o(),ze},v.flush=function(f){var h=this,y=f.transmuxing;y.executeStart=o();var g=this.decrypter,x=this.cache,j=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return h.flush(f)});var A=[],H=j.timeOffset;if(g){var F=g.flush();F&&A.push(this.push(F,null,f))}var w=x.dataLength;x.reset();var Y=this.demuxer,q=this.remuxer;if(!Y||!q)return w>=s&&this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),y.executeEnd=o(),[O(f)];var ie=Y.flush(H);return T(ie)?ie.then(function(ge){return h.flushRemux(A,ge,f),A}):(this.flushRemux(A,ie,f),A)},v.flushRemux=function(f,h,y){var g=h.audioTrack,x=h.avcTrack,j=h.id3Track,B=h.textTrack,A=this.currentTransmuxState,H=A.accurateTimeOffset,F=A.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+y.sn+(y.part>-1?" p: "+y.part:"")+" of level "+y.level);var w=this.remuxer.remux(g,x,j,B,F,H,!0,this.id);f.push({remuxResult:w,chunkMeta:y}),y.transmuxing.executeEnd=o()},v.resetInitialTimestamp=function(f){var h=this.demuxer,y=this.remuxer;if(!h||!y)return;h.resetTimeStamp(f),y.resetTimeStamp(f)},v.resetContiguity=function(){var f=this.demuxer,h=this.remuxer;if(!f||!h)return;f.resetContiguity(),h.resetNextTimestamp()},v.resetInitSegment=function(f,h,y,g){var x=this.demuxer,j=this.remuxer;if(!x||!j)return;x.resetInitSegment(h,y,g),j.resetInitSegment(f,h,y)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(f,h,y,g,x){var j;return h&&h.method==="SAMPLE-AES"?j=this.transmuxSampleAes(f,h,y,g,x):j=this.transmuxUnencrypted(f,y,g,x),j},v.transmuxUnencrypted=function(f,h,y,g){var x=this.demuxer.demux(f,h,!1,!this.config.progressive),j=x.audioTrack,B=x.avcTrack,A=x.id3Track,H=x.textTrack,F=this.remuxer.remux(j,B,A,H,h,y,!1,this.id);return{remuxResult:F,chunkMeta:g}},v.transmuxSampleAes=function(f,h,y,g,x){var j=this;return this.demuxer.demuxSampleAes(f,h,y).then(function(B){var A=j.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,y,g,!1,j.id);return{remuxResult:A,chunkMeta:x}})},v.configureTransmuxer=function(f,h){for(var y=this.config,g=this.observer,x=this.typeSupported,j=this.vendor,B=h.audioCodec,A=h.defaultInitPts,H=h.duration,F=h.initSegmentData,w=h.videoCodec,Y,q=0,ie=c.length;q<ie;q++)if(c[q].demux.probe(f)){Y=c[q];break}Y||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:I.default,remux:p.default});var ge=this.demuxer,Je=this.remuxer,xe=Y.remux,ke=Y.demux;(!Je||!(Je instanceof xe))&&(this.remuxer=new xe(g,y,x,j)),(!ge||!(ge instanceof ke))&&(this.demuxer=new ke(g,y,x),this.probe=ke.probe),this.resetInitSegment(F,B,w,H),this.resetInitialTimestamp(A)},v.needsProbing=function(f,h,y){return!this.demuxer||!this.remuxer||h||y},v.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new k.default(this.observer,this.config)),f},S}();function n(S,v){var E=null;return S.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(E=v),E}var O=function(v){return{remuxResult:{},chunkMeta:v}};function T(S){return"then"in S&&S.then instanceof Function}var C=function(v,E,f,h,y){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=E,this.initSegmentData=f,this.duration=h,this.defaultInitPts=y},R=function(v,E,f,h,y){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=E,this.accurateTimeOffset=f,this.trackSwitch=h,this.timeOffset=y}},"./src/demux/tsdemuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"discardEPB",function(){return O});var G=U("./src/demux/adts.ts"),P=U("./src/demux/mpegaudio.ts"),k=U("./src/demux/exp-golomb.ts"),K=U("./src/demux/id3.ts"),I=U("./src/demux/sample-aes.ts"),r=U("./src/events.ts"),M=U("./src/utils/mp4-tools.ts"),_=U("./src/utils/logger.ts"),p=U("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},u=function(){function T(R,S,v){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=S,this.typeSupported=v}T.probe=function(S){var v=T.syncOffset(S);return v<0?!1:(v&&_.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},T.syncOffset=function(S){for(var v=Math.min(1e3,S.length-3*188),E=0;E<v;){if(S[E]===71&&S[E+188]===71&&S[E+2*188]===71)return E;E++}return-1},T.createTrack=function(S,v){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:m[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?v:void 0}};var C=T.prototype;return C.resetInitSegment=function(S,v,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",E),this._audioTrack=T.createTrack("audio",E),this._id3Track=T.createTrack("id3",E),this._txtTrack=T.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=S,this.videoCodec=v,this._duration=E},C.resetTimeStamp=function(){},C.resetContiguity=function(){var S=this._audioTrack,v=this._avcTrack,E=this._id3Track;S&&(S.pesData=null),v&&(v.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},C.demux=function(S,v,E,f){E===void 0&&(E=!1),f===void 0&&(f=!1),E||(this.sampleAes=null);var h,y=this._avcTrack,g=this._audioTrack,x=this._id3Track,j=y.pid,B=y.pesData,A=g.pid,H=x.pid,F=g.pesData,w=x.pesData,Y=!1,q=this.pmtParsed,ie=this._pmtId,ge=S.length;if(this.remainderData&&(S=Object(M.appendUint8Array)(this.remainderData,S),ge=S.length,this.remainderData=null),ge<188&&!f)return this.remainderData=S,{audioTrack:g,avcTrack:y,id3Track:x,textTrack:this._txtTrack};var Je=Math.max(0,T.syncOffset(S));ge-=(ge+Je)%188,ge<S.byteLength&&!f&&(this.remainderData=new Uint8Array(S.buffer,ge,S.buffer.byteLength-ge));for(var xe=Je;xe<ge;xe+=188)if(S[xe]===71){var ke=!!(S[xe+1]&64),Qe=((S[xe+1]&31)<<8)+S[xe+2],Ye=(S[xe+3]&48)>>4,ve=void 0;if(Ye>1){if(ve=xe+5+S[xe+4],ve===xe+188)continue}else ve=xe+4;switch(Qe){case j:ke&&(B&&(h=s(B))&&this.parseAVCPES(h,!1),B={data:[],size:0}),B&&(B.data.push(S.subarray(ve,xe+188)),B.size+=xe+188-ve);break;case A:ke&&(F&&(h=s(F))&&(g.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),F={data:[],size:0}),F&&(F.data.push(S.subarray(ve,xe+188)),F.size+=xe+188-ve);break;case H:ke&&(w&&(h=s(w))&&this.parseID3PES(h),w={data:[],size:0}),w&&(w.data.push(S.subarray(ve,xe+188)),w.size+=xe+188-ve);break;case 0:ke&&(ve+=S[ve]+1),ie=this._pmtId=o(S,ve);break;case ie:{ke&&(ve+=S[ve]+1);var fe=c(S,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);j=fe.avc,j>0&&(y.pid=j),A=fe.audio,A>0&&(g.pid=A,g.isAAC=fe.isAAC),H=fe.id3,H>0&&(x.pid=H),Y&&!q&&(_.logger.log("reparse from beginning"),Y=!1,xe=Je-188),q=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});y.pesData=B,g.pesData=F,x.pesData=w;var at={audioTrack:g,avcTrack:y,id3Track:x,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(at),at},C.flush=function(){var S=this.remainderData;this.remainderData=null;var v;return S?v=this.demux(S,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},C.extractRemainingSamples=function(S){var v=S.audioTrack,E=S.avcTrack,f=S.id3Track,h=E.pesData,y=v.pesData,g=f.pesData,x;h&&(x=s(h))?(this.parseAVCPES(x,!0),E.pesData=null):E.pesData=h,y&&(x=s(y))?(v.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),v.pesData=null):(y!=null&&y.size&&_.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=y),g&&(x=s(g))?(this.parseID3PES(x),f.pesData=null):f.pesData=g},C.demuxSampleAes=function(S,v,E){var f=this.demux(S,E,!0,!this.config.progressive),h=this.sampleAes=new I.default(this.observer,this.config,v);return this.decrypt(f,h)},C.decrypt=function(S,v){return new Promise(function(E){var f=S.audioTrack,h=S.avcTrack;f.samples&&f.isAAC?v.decryptAacSamples(f.samples,0,function(){h.samples?v.decryptAvcSamples(h.samples,0,0,function(){E(S)}):E(S)}):h.samples&&v.decryptAvcSamples(h.samples,0,0,function(){E(S)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(S,v){var E=this,f=this._avcTrack,h=this.parseAVCNALu(S.data),y=!1,g=this.avcSample,x,j=!1;S.data=null,g&&h.length&&!f.audFound&&(i(g,f),g=this.avcSample=a(!1,S.pts,S.dts,"")),h.forEach(function(B){switch(B.type){case 1:{x=!0,g||(g=E.avcSample=a(!0,S.pts,S.dts,"")),y&&(g.debug+="NDR "),g.frame=!0;var A=B.data;if(j&&A.length>4){var H=new k.default(A).readSliceType();(H===2||H===4||H===7||H===9)&&(g.key=!0)}break}case 5:x=!0,g||(g=E.avcSample=a(!0,S.pts,S.dts,"")),y&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{x=!0,y&&g&&(g.debug+="SEI ");var F=new k.default(O(B.data));F.readUByte();for(var w=0,Y=0,q=!1,ie=0;!q&&F.bytesAvailable>1;){w=0;do ie=F.readUByte(),w+=ie;while(ie===255);Y=0;do ie=F.readUByte(),Y+=ie;while(ie===255);if(w===4&&F.bytesAvailable!==0){q=!0;var ge=F.readUByte();if(ge===181){var Je=F.readUShort();if(Je===49){var xe=F.readUInt();if(xe===1195456820){var ke=F.readUByte();if(ke===3){for(var Qe=F.readUByte(),Ye=F.readUByte(),ve=31&Qe,fe=[Qe,Ye],at=0;at<ve;at++)fe.push(F.readUByte()),fe.push(F.readUByte()),fe.push(F.readUByte());n(E._txtTrack.samples,{type:3,pts:S.pts,bytes:fe})}}}}}else if(w===5&&F.bytesAvailable!==0){if(q=!0,Y>16){for(var Jt=[],Ft=0;Ft<16;Ft++)Jt.push(F.readUByte().toString(16)),(Ft===3||Ft===5||Ft===7||Ft===9)&&Jt.push("-");for(var St=Y-16,ze=new Uint8Array(St),gt=0;gt<St;gt++)ze[gt]=F.readUByte();n(E._txtTrack.samples,{pts:S.pts,payloadType:w,uuid:Jt.join(""),userData:Object(K.utf8ArrayToStr)(ze),userDataBytes:ze})}}else if(Y<F.bytesAvailable)for(var ct=0;ct<Y;ct++)F.readUByte()}break}case 7:if(x=!0,j=!0,y&&g&&(g.debug+="SPS "),!f.sps){var jt=new k.default(B.data),oe=jt.readSPS();f.width=oe.width,f.height=oe.height,f.pixelRatio=oe.pixelRatio,f.sps=[B.data],f.duration=E._duration;for(var Ne=B.data.subarray(1,4),Ge="avc1.",Xe=0;Xe<3;Xe++){var Bt=Ne[Xe].toString(16);Bt.length<2&&(Bt="0"+Bt),Ge+=Bt}f.codec=Ge}break;case 8:x=!0,y&&g&&(g.debug+="PPS "),f.pps||(f.pps=[B.data]);break;case 9:x=!1,f.audFound=!0,g&&i(g,f),g=E.avcSample=a(!1,S.pts,S.dts,y?"AUD ":"");break;case 12:x=!1;break;default:x=!1,g&&(g.debug+="unknown NAL "+B.type+" ");break}if(g&&x){var Wt=g.units;Wt.push(B)}}),v&&g&&(i(g,f),this.avcSample=null)},C.getLastNalUnit=function(){var S,v=this.avcSample,E;if(!v||v.units.length===0){var f=this._avcTrack.samples;v=f[f.length-1]}if((S=v)!==null&&S!==void 0&&S.units){var h=v.units;E=h[h.length-1]}return E},C.parseAVCNALu=function(S){var v=S.byteLength,E=this._avcTrack,f=E.naluState||0,h=f,y=[],g=0,x,j,B,A=-1,H=0;for(f===-1&&(A=0,H=S[0]&31,f=0,g=1);g<v;){if(x=S[g++],!f){f=x?0:1;continue}if(f===1){f=x?0:2;continue}if(!x)f=3;else if(x===1){if(A>=0){var F={data:S.subarray(A,g-f-1),type:H};y.push(F)}else{var w=this.getLastNalUnit();if(w&&(h&&g<=4-h&&(w.state&&(w.data=w.data.subarray(0,w.data.byteLength-h))),j=g-f-1,j>0)){var Y=new Uint8Array(w.data.byteLength+j);Y.set(w.data,0),Y.set(S.subarray(0,j),w.data.byteLength),w.data=Y,w.state=0}}g<v?(B=S[g]&31,A=g,H=B,f=0):f=-1}else f=0}if(A>=0&&f>=0){var q={data:S.subarray(A,v),type:H,state:f};y.push(q)}if(y.length===0){var ie=this.getLastNalUnit();if(ie){var ge=new Uint8Array(ie.data.byteLength+S.byteLength);ge.set(ie.data,0),ge.set(S,ie.data.byteLength),ie.data=ge}}return E.naluState=f,y},C.parseAACPES=function(S){var v=0,E=this._audioTrack,f=this.aacOverFlow,h=S.data;if(f){this.aacOverFlow=null;var y=f.sample.unit.byteLength,g=Math.min(f.missing,y),x=y-g;f.sample.unit.set(h.subarray(0,g),x),E.samples.push(f.sample),v=f.missing}var j,B;for(j=v,B=h.length;j<B-1&&!G.isHeader(h,j);j++);if(j!==v){var A,H;if(j<B-1?(A="AAC PES did not start with ADTS header,offset:"+j,H=!1):(A="no ADTS header found in AAC PES",H=!0),_.logger.warn("parsing error:"+A),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:A}),H)return}G.initTrackConfig(E,this.observer,h,j,this.audioCodec);var F;if(S.pts!==void 0)F=S.pts;else if(f){var w=G.getFrameDuration(E.samplerate);F=f.sample.pts+w}else{_.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;j<B;)if(G.isHeader(h,j)){if(j+5<B){var q=G.appendFrame(E,h,j,F,Y);if(q)if(q.missing)this.aacOverFlow=q;else{j+=q.length,Y++;continue}}break}else j++},C.parseMPEGPES=function(S){var v=S.data,E=v.length,f=0,h=0,y=S.pts;if(y===void 0){_.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<E;)if(P.isHeader(v,h)){var g=P.appendFrame(this._audioTrack,v,h,y,f);if(g)h+=g.length,f++;else break}else h++},C.parseID3PES=function(S){if(S.pts===void 0){_.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(S)},T}();u.minProbeByteLength=188;function a(T,C,R,S){return{key:T,frame:!1,pts:C,dts:R,units:[],debug:S,length:0}}function o(T,C){return(T[C+10]&31)<<8|T[C+11]}function c(T,C,R,S){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(T[C+1]&15)<<8|T[C+2],f=C+3+E-4,h=(T[C+10]&15)<<8|T[C+11];for(C+=12+h;C<f;){var y=(T[C+1]&31)<<8|T[C+2];switch(T[C]){case 207:if(!S){_.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=y);break;case 21:v.id3===-1&&(v.id3=y);break;case 219:if(!S){_.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=y);break;case 3:case 4:R?v.audio===-1&&(v.audio=y,v.isAAC=!1):_.logger.log("MPEG audio found, not supported in this browser");break;case 36:_.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((T[C+3]&15)<<8|T[C+4])+5}return v}function s(T){var C=0,R,S,v,E,f,h=T.data;if(!T||T.size===0)return null;for(;h[0].length<19&&h.length>1;){var y=new Uint8Array(h[0].length+h[1].length);y.set(h[0]),y.set(h[1],h[0].length),h[0]=y,h.splice(1,1)}R=h[0];var g=(R[0]<<16)+(R[1]<<8)+R[2];if(g===1){if(S=(R[4]<<8)+R[5],S&&S>T.size-6)return null;var x=R[7];x&192&&(E=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,x&64?(f=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,E-f>60*9e4&&(_.logger.warn(Math.round((E-f)/9e4)+"s delta between PTS and DTS, align them"),E=f)):f=E),v=R[8];var j=v+9;if(T.size<=j)return null;T.size-=j;for(var B=new Uint8Array(T.size),A=0,H=h.length;A<H;A++){R=h[A];var F=R.byteLength;if(j)if(j>F){j-=F;continue}else R=R.subarray(j),F-=j,j=0;B.set(R,C),C+=F}return S&&(S-=v+3),{data:B,pts:E,dts:f,len:S}}return null}function i(T,C){if(T.units.length&&T.frame){if(T.pts===void 0){var R=C.samples,S=R.length;if(S){var v=R[S-1];T.pts=v.pts,T.dts=v.dts}else{C.dropped++;return}}C.samples.push(T)}T.debug.length&&_.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function n(T,C){var R=T.length;if(R>0){if(C.pts>=T[R-1].pts)T.push(C);else for(var S=R-1;S>=0;S--)if(C.pts<T[S].pts){T.splice(S,0,C);break}}else T.push(C)}function O(T){for(var C=T.byteLength,R=[],S=1;S<C-2;)T[S]===0&&T[S+1]===0&&T[S+2]===3?(R.push(S+2),S+=2):S++;if(R.length===0)return T;var v=C-R.length,E=new Uint8Array(v),f=0;for(S=0;S<v;f++,S++)f===R[0]&&(f++,R.shift()),E[S]=T[f];return E}V.default=u},"./src/errors.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"ErrorTypes",function(){return G}),U.d(V,"ErrorDetails",function(){return P});var G;(function(k){k.NETWORK_ERROR="networkError",k.MEDIA_ERROR="mediaError",k.KEY_SYSTEM_ERROR="keySystemError",k.MUX_ERROR="muxError",k.OTHER_ERROR="otherError"})(G||(G={}));var P;(function(k){k.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",k.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",k.KEY_SYSTEM_NO_SESSION="keySystemNoSession",k.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",k.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",k.MANIFEST_LOAD_ERROR="manifestLoadError",k.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",k.MANIFEST_PARSING_ERROR="manifestParsingError",k.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",k.LEVEL_EMPTY_ERROR="levelEmptyError",k.LEVEL_LOAD_ERROR="levelLoadError",k.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",k.LEVEL_SWITCH_ERROR="levelSwitchError",k.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",k.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",k.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",k.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",k.FRAG_LOAD_ERROR="fragLoadError",k.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",k.FRAG_DECRYPT_ERROR="fragDecryptError",k.FRAG_PARSING_ERROR="fragParsingError",k.REMUX_ALLOC_ERROR="remuxAllocError",k.KEY_LOAD_ERROR="keyLoadError",k.KEY_LOAD_TIMEOUT="keyLoadTimeOut",k.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",k.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",k.BUFFER_APPEND_ERROR="bufferAppendError",k.BUFFER_APPENDING_ERROR="bufferAppendingError",k.BUFFER_STALLED_ERROR="bufferStalledError",k.BUFFER_FULL_ERROR="bufferFullError",k.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",k.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",k.INTERNAL_EXCEPTION="internalException",k.INTERNAL_ABORTED="aborted",k.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"Events",function(){return G});var G;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(G||(G={}))},"./src/hls.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return T});var G=U("./node_modules/url-toolkit/src/url-toolkit.js"),P=U.n(G),k=U("./src/loader/playlist-loader.ts"),K=U("./src/loader/key-loader.ts"),I=U("./src/controller/id3-track-controller.ts"),r=U("./src/controller/latency-controller.ts"),M=U("./src/controller/level-controller.ts"),_=U("./src/controller/fragment-tracker.ts"),p=U("./src/controller/stream-controller.ts"),m=U("./src/is-supported.ts"),u=U("./src/utils/logger.ts"),a=U("./src/config.ts"),o=U("./node_modules/eventemitter3/index.js"),c=U.n(o),s=U("./src/events.ts"),i=U("./src/errors.ts");function n(C,R){for(var S=0;S<R.length;S++){var v=R[S];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function O(C,R,S){return R&&n(C.prototype,R),S&&n(C,S),C}var T=function(){C.isSupported=function(){return Object(m.isSupported)()};function C(S){S===void 0&&(S={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new o.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var v=this.config=Object(a.mergeConfig)(C.DefaultConfig,S);this.userConfig=S,Object(u.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(a.enableStreamingMode)(v);var E=v.abrController,f=v.bufferController,h=v.capLevelController,y=v.fpsController,g=this.abrController=new E(this),x=this.bufferController=new f(this),j=this.capLevelController=new h(this),B=new y(this),A=new k.default(this),H=new K.default(this),F=new I.default(this),w=this.levelController=new M.default(this),Y=new _.FragmentTracker(this),q=this.streamController=new p.default(this,Y);j.setStreamController(q),B.setStreamController(q);var ie=[w,q];this.networkControllers=ie;var ge=[A,H,g,x,j,B,F,Y];this.audioTrackController=this.createController(v.audioTrackController,null,ie),this.createController(v.audioStreamController,Y,ie),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,ie),this.createController(v.subtitleStreamController,Y,ie),this.createController(v.timelineController,null,ge),this.emeController=this.createController(v.emeController,null,ge),this.cmcdController=this.createController(v.cmcdController,null,ge),this.latencyController=this.createController(r.default,null,ge),this.coreComponents=ge}var R=C.prototype;return R.createController=function(v,E,f){if(v){var h=E?new v(this,E):new v(this);return f&&f.push(h),h}return null},R.on=function(v,E,f){f===void 0&&(f=this),this._emitter.on(v,E,f)},R.once=function(v,E,f){f===void 0&&(f=this),this._emitter.once(v,E,f)},R.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},R.off=function(v,E,f,h){f===void 0&&(f=this),this._emitter.off(v,E,f,h)},R.listeners=function(v){return this._emitter.listeners(v)},R.emit=function(v,E,f){return this._emitter.emit(v,E,f)},R.trigger=function(v,E){if(this.config.debug)return this.emit(v,v,E);try{return this.emit(v,v,E)}catch(f){u.logger.error("An internal error happened while handling event "+v+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(s.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:f})}return!1},R.listenerCount=function(v){return this._emitter.listenerCount(v)},R.destroy=function(){u.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(v){return v.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(v){return v.destroy()}),this.coreComponents.length=0},R.attachMedia=function(v){u.logger.log("attachMedia"),this._media=v,this.trigger(s.Events.MEDIA_ATTACHING,{media:v})},R.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(v){this.stopLoad();var E=this.media,f=this.url,h=this.url=G.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});u.logger.log("loadSource:"+h),E&&f&&f!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(s.Events.MANIFEST_LOADING,{url:v})},R.startLoad=function(v){v===void 0&&(v=-1),u.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(E){E.startLoad(v)})},R.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},R.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){u.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},R.removeLevel=function(v,E){E===void 0&&(E=0),this.levelController.removeLevel(v,E)},O(C,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){u.logger.log("set currentLevel:"+v),this.loadLevel=v,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(v){u.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){u.logger.log("set loadLevel:"+v),this.levelController.manualLevel=v}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(v){this.levelController.nextLoadLevel=v}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(v){u.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){u.logger.log("set startLevel:"+v),v!==-1&&(v=Math.max(v,this.minAutoLevel)),this.levelController.startLevel=v}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(v){var E=!!v;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(v){this._autoLevelCapping!==v&&(u.logger.log("set autoLevelCapping:"+v),this._autoLevelCapping=v)}},{key:"bandwidthEstimate",get:function(){var v=this.abrController.bwEstimator;return v?v.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var v=this.levels,E=this.config.minAutoBitrate;if(!v)return 0;for(var f=v.length,h=0;h<f;h++)if(v[h].maxBitrate>E)return h;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,E=this.autoLevelCapping,f;return E===-1&&v&&v.length?f=v.length-1:f=E,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var E=this.audioTrackController;E&&(E.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var E=this.subtitleTrackController;E&&(E.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return s.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:a.hlsDefaultConfig},set:function(v){C.defaultConfig=v}}]),C}();T.defaultConfig=void 0},"./src/is-supported.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isSupported",function(){return k}),U.d(V,"changeTypeSupported",function(){return K});var G=U("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var I=Object(G.getMediaSource)();if(!I)return!1;var r=P(),M=I&&typeof I.isTypeSupported=="function"&&I.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),_=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!M&&!!_}function K(){var I,r=P();return typeof(r==null||((I=r.prototype)===null||I===void 0)?void 0:I.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return u}),U.d(V,"LoadError",function(){return o});var G=U("./src/polyfills/number.ts"),P=U("./src/errors.ts");function k(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,_(c,s)}function K(c){var s=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!M(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(n))return s.get(n);s.set(n,O)}function O(){return I(n,arguments,p(this).constructor)}return O.prototype=Object.create(n.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),_(O,n)},K(c)}function I(c,s,i){return r()?I=Reflect.construct:I=function(O,T,C){var R=[null];R.push.apply(R,T);var S=Function.bind.apply(O,R),v=new S;return C&&_(v,C.prototype),v},I.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function M(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function _(c,s){return _=Object.setPrototypeOf||function(n,O){return n.__proto__=O,n},_(c,s)}function p(c){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},p(c)}var m=Math.pow(2,17),u=function(){function c(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var s=c.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(n,O){var T=this,C=n.url;if(!C)return Promise.reject(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(C?"part list":"url")));this.abort();var R=this.config,S=R.fLoader,v=R.loader;return new Promise(function(E,f){T.loader&&T.loader.destroy();var h=T.loader=n.loader=S?new S(R):new v(R),y=a(n),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};n.stats=h.stats,h.load(y,g,{onSuccess:function(j,B,A,H){T.resetLoader(n,h),E({frag:n,part:null,payload:j.data,networkDetails:H})},onError:function(j,B,A){T.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:j,networkDetails:A}))},onAbort:function(j,B,A){T.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:A}))},onTimeout:function(j,B,A){T.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:A}))},onProgress:function(j,B,A,H){O&&O({frag:n,part:null,payload:A,networkDetails:H})}})})},s.loadPart=function(n,O,T){var C=this;this.abort();var R=this.config,S=R.fLoader,v=R.loader;return new Promise(function(E,f){C.loader&&C.loader.destroy();var h=C.loader=n.loader=S?new S(R):new v(R),y=a(n,O),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};O.stats=h.stats,h.load(y,g,{onSuccess:function(j,B,A,H){C.resetLoader(n,h),C.updateStatsFromPart(n,O);var F={frag:n,part:O,payload:j.data,networkDetails:H};T(F),E(F)},onError:function(j,B,A){C.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:O,response:j,networkDetails:A}))},onAbort:function(j,B,A){n.stats.aborted=O.stats.aborted,C.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:O,networkDetails:A}))},onTimeout:function(j,B,A){C.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:O,networkDetails:A}))}})})},s.updateStatsFromPart=function(n,O){var T=n.stats,C=O.stats,R=C.total;if(T.loaded+=C.loaded,R){var S=Math.round(n.duration/O.duration),v=Math.min(Math.round(T.loaded/R),S),E=S-v,f=E*Math.round(T.loaded/v);T.total=T.loaded+f}else T.total=Math.max(T.loaded,T.total);var h=T.loading,y=C.loading;h.start?h.first+=y.first-y.start:(h.start=y.start,h.first=y.first),h.end=y.end},s.resetLoader=function(n,O){n.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},c}();function a(c,s){s===void 0&&(s=null);var i=s||c,n={frag:c,part:s,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},O=i.byteRangeStartOffset,T=i.byteRangeEndOffset;return Object(G.isFiniteNumber)(O)&&Object(G.isFiniteNumber)(T)&&(n.rangeStart=O,n.rangeEnd=T),n}var o=function(c){k(s,c);function s(i){for(var n,O=arguments.length,T=new Array(O>1?O-1:0),C=1;C<O;C++)T[C-1]=arguments[C];return n=c.call.apply(c,[this].concat(T))||this,n.data=void 0,n.data=i,n}return s}(K(Error))},"./src/loader/fragment.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"ElementaryStreamTypes",function(){return u}),U.d(V,"BaseSegment",function(){return a}),U.d(V,"Fragment",function(){return o}),U.d(V,"Part",function(){return c});var G=U("./src/polyfills/number.ts"),P=U("./node_modules/url-toolkit/src/url-toolkit.js"),k=U.n(P),K=U("./src/utils/logger.ts"),I=U("./src/loader/level-key.ts"),r=U("./src/loader/load-stats.ts");function M(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,_(s,i)}function _(s,i){return _=Object.setPrototypeOf||function(O,T){return O.__proto__=T,O},_(s,i)}function p(s,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(s,O.key,O)}}function m(s,i,n){return i&&p(s.prototype,i),n&&p(s,n),s}var u;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(u||(u={}));var a=function(){function s(n){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[u.AUDIO]=null,O[u.VIDEO]=null,O[u.AUDIOVIDEO]=null,O),this.baseurl=n}var i=s.prototype;return i.setByteRange=function(O,T){var C=O.split("@",2),R=[];C.length===1?R[0]=T?T.byteRangeEndOffset:0:R[0]=parseInt(C[1]),R[1]=parseInt(C[0])+R[0],this._byteRange=R},m(s,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(O){this._url=O}}]),s}(),o=function(s){M(i,s);function i(O,T){var C;return C=s.call(this,T)||this,C._decryptdata=null,C.rawProgramDateTime=null,C.programDateTime=null,C.tagList=[],C.duration=0,C.sn=0,C.levelkey=void 0,C.type=void 0,C.loader=null,C.level=-1,C.cc=0,C.startPTS=void 0,C.endPTS=void 0,C.appendedPTS=void 0,C.startDTS=void 0,C.endDTS=void 0,C.start=0,C.deltaPTS=void 0,C.maxStartPTS=void 0,C.minEndPTS=void 0,C.stats=new r.LoadStats,C.urlId=0,C.data=void 0,C.bitrateTest=!1,C.title=null,C.initSegment=null,C.type=O,C}var n=i.prototype;return n.createInitializationVector=function(T){for(var C=new Uint8Array(16),R=12;R<16;R++)C[R]=T>>8*(15-R)&255;return C},n.setDecryptDataFromLevelKey=function(T,C){var R=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(R=I.LevelKey.fromURI(T.uri),R.method=T.method,R.iv=this.createInitializationVector(C),R.keyFormat="identity"),R},n.setElementaryStreamInfo=function(T,C,R,S,v,E){E===void 0&&(E=!1);var f=this.elementaryStreams,h=f[T];if(!h){f[T]={startPTS:C,endPTS:R,startDTS:S,endDTS:v,partial:E};return}h.startPTS=Math.min(h.startPTS,C),h.endPTS=Math.max(h.endPTS,R),h.startDTS=Math.min(h.startDTS,S),h.endDTS=Math.max(h.endDTS,v)},n.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[u.AUDIO]=null,T[u.VIDEO]=null,T[u.AUDIOVIDEO]=null},m(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(G.isFiniteNumber)(this.programDateTime))return null;var T=Object(G.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),i}(a),c=function(s){M(i,s);function i(n,O,T,C,R){var S;S=s.call(this,T)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new r.LoadStats,S.duration=n.decimalFloatingPoint("DURATION"),S.gap=n.bool("GAP"),S.independent=n.bool("INDEPENDENT"),S.relurl=n.enumeratedString("URI"),S.fragment=O,S.index=C;var v=n.enumeratedString("BYTERANGE");return v&&S.setByteRange(v,R),R&&(S.fragOffset=R.fragOffset+R.duration),S}return m(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),i}(a)},"./src/loader/key-loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return K});var G=U("./src/events.ts"),P=U("./src/errors.ts"),k=U("./src/utils/logger.ts"),K=function(){function I(M){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=M,this._registerListeners()}var r=I.prototype;return r._registerListeners=function(){this.hls.on(G.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(G.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var _ in this.loaders){var p=this.loaders[_];p&&p.destroy()}this.loaders={}},r.onKeyLoading=function(_,p){var m=p.frag,u=m.type,a=this.loaders[u];if(!m.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var o=m.decryptdata.uri;if(o!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(a&&(k.logger.warn("abort previous key loader for type:"+u),a.abort()),!o){k.logger.warn("key uri is falsy");return}var s=c.loader,i=m.loader=this.loaders[u]=new s(c);this.decrypturl=o,this.decryptkey=null;var n={url:o,frag:m,responseType:"arraybuffer"},O={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(n,O,T)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:m}))},r.loadsuccess=function(_,p,m){var u=m.frag;if(!u.decryptdata){k.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(_.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:u})},r.loaderror=function(_,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:_})},r.loadtimeout=function(_,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},I}()},"./src/loader/level-details.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"LevelDetails",function(){return I});var G=U("./src/polyfills/number.ts");function P(r,M){for(var _=0;_<M.length;_++){var p=M[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function k(r,M,_){return M&&P(r.prototype,M),_&&P(r,_),r}var K=10,I=function(){function r(_){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=_}var M=r.prototype;return M.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-p.lastPartSn,u=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!u||!!m,this.advanced=this.endSN>p.endSN||m>0||m===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},k(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(G.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var m=this.driftEnd-this.driftStart;return m*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"LevelKey",function(){return I});var G=U("./node_modules/url-toolkit/src/url-toolkit.js"),P=U.n(G);function k(r,M){for(var _=0;_<M.length;_++){var p=M[_];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function K(r,M,_){return M&&k(r.prototype,M),_&&k(r,_),r}var I=function(){r.fromURL=function(_,p){return new r(_,p)},r.fromURI=function(_){return new r(_)};function r(M,_){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,_?this._uri=Object(G.buildAbsoluteURL)(M,_,{alwaysNormalize:!0}):this._uri=M}return K(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"LoadStats",function(){return G});var G=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return i});var G=U("./src/polyfills/number.ts"),P=U("./node_modules/url-toolkit/src/url-toolkit.js"),k=U.n(P),K=U("./src/loader/fragment.ts"),I=U("./src/loader/level-details.ts"),r=U("./src/loader/level-key.ts"),M=U("./src/utils/attr-list.ts"),_=U("./src/utils/logger.ts"),p=U("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,u=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),o=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function s(R){var S,v;return c.test((S=(v=P.parseURL(R))===null||v===void 0?void 0:v.path)!=null?S:"")}var i=function(){function R(){}return R.findGroup=function(v,E){for(var f=0;f<v.length;f++){var h=v[f];if(h.id===E)return h}},R.convertAVC1ToAVCOTI=function(v){var E=v.split(".");if(E.length>2){var f=E.shift()+".";return f+=parseInt(E.shift()).toString(16),f+=("000"+parseInt(E.shift()).toString(16)).substr(-4),f}return v},R.resolve=function(v,E){return P.buildAbsoluteURL(E,v,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(v,E){var f=[],h={},y=!1;m.lastIndex=0;for(var g;(g=m.exec(v))!=null;)if(g[1]){var x=new M.AttrList(g[1]),j={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:R.resolve(g[2],E)},B=x.decimalResolution("RESOLUTION");B&&(j.width=B.width,j.height=B.height),n((x.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=R.convertAVC1ToAVCOTI(j.videoCodec)),f.push(j)}else if(g[3]){var A=new M.AttrList(g[3]);A["DATA-ID"]&&(y=!0,h[A["DATA-ID"]]=A)}return{levels:f,sessionData:y?h:null}},R.parseMasterPlaylistMedia=function(v,E,f,h){h===void 0&&(h=[]);var y,g=[],x=0;for(u.lastIndex=0;(y=u.exec(v))!==null;){var j=new M.AttrList(y[1]);if(j.TYPE===f){var B={attrs:j,bitrate:0,id:x++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:f,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?R.resolve(j.URI,E):""};if(h.length){var A=R.findGroup(h,B.groupId)||h[0];O(B,A,"audioCodec"),O(B,A,"textCodec")}g.push(B)}}return g},R.parseLevelPlaylist=function(v,E,f,h,y){var g=new I.LevelDetails(E),x=g.fragments,j=null,B=0,A=0,H=0,F=0,w=null,Y=new K.Fragment(h,E),q,ie,ge,Je=-1,xe=!1;for(a.lastIndex=0,g.m3u8=v;(q=a.exec(v))!==null;){xe&&(xe=!1,Y=new K.Fragment(h,E),Y.start=H,Y.sn=B,Y.cc=F,Y.level=f,j&&(Y.initSegment=j,Y.rawProgramDateTime=j.rawProgramDateTime));var ke=q[1];if(ke){Y.duration=parseFloat(ke);var Qe=(" "+q[2]).slice(1);Y.title=Qe||null,Y.tagList.push(Qe?["INF",ke,Qe]:["INF",ke])}else if(q[3])Object(G.isFiniteNumber)(Y.duration)&&(Y.start=H,ge&&(Y.levelkey=ge),Y.sn=B,Y.level=f,Y.cc=F,Y.urlId=y,x.push(Y),Y.relurl=(" "+q[3]).slice(1),C(Y,w),w=Y,H+=Y.duration,B++,A=0,xe=!0);else if(q[4]){var Ye=(" "+q[4]).slice(1);w?Y.setByteRange(Ye,w):Y.setByteRange(Ye)}else if(q[5])Y.rawProgramDateTime=(" "+q[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Je===-1&&(Je=x.length);else{if(q=q[0].match(o),!q){_.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<q.length&&!(typeof q[ie]!="undefined");ie++);var ve=(" "+q[ie]).slice(1),fe=(" "+q[ie+1]).slice(1),at=q[ie+2]?(" "+q[ie+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":g.type=fe.toUpperCase();break;case"MEDIA-SEQUENCE":B=g.startSN=parseInt(fe);break;case"SKIP":{var Jt=new M.AttrList(fe),Ft=Jt.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)(Ft)){g.skippedSegments=Ft;for(var St=Ft;St--;)x.unshift(null);B+=Ft}var ze=Jt.enumeratedString("RECENTLY-REMOVED-DATERANGES");ze&&(g.recentlyRemovedDateranges=ze.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(fe);break;case"VERSION":g.version=parseInt(fe);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(fe||at)&&Y.tagList.push(at?[fe,at]:[fe]);break;case"DIS":F++;case"GAP":Y.tagList.push([ve]);break;case"BITRATE":Y.tagList.push([ve,fe]);break;case"DISCONTINUITY-SEQ":F=parseInt(fe);break;case"KEY":{var gt,ct=new M.AttrList(fe),jt=ct.enumeratedString("METHOD"),oe=ct.URI,Ne=ct.hexadecimalInteger("IV"),Ge=ct.enumeratedString("KEYFORMATVERSIONS"),Xe=ct.enumeratedString("KEYID"),Bt=(gt=ct.enumeratedString("KEYFORMAT"))!=null?gt:"identity",Wt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Wt.indexOf(Bt)>-1){_.logger.warn("Keyformat "+Bt+" is not supported from the manifest");continue}else if(Bt!=="identity")continue;jt&&(ge=r.LevelKey.fromURL(E,oe),oe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(jt)>=0&&(ge.method=jt,ge.keyFormat=Bt,Xe&&(ge.keyID=Xe),Ge&&(ge.keyFormatVersions=Ge),ge.iv=Ne));break}case"START":{var en=new M.AttrList(fe),tt=en.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(tt)&&(g.startTimeOffset=tt);break}case"MAP":{var tn=new M.AttrList(fe);Y.relurl=tn.URI,tn.BYTERANGE&&Y.setByteRange(tn.BYTERANGE),Y.level=f,Y.sn="initSegment",ge&&(Y.levelkey=ge),Y.initSegment=null,j=Y,xe=!0;break}case"SERVER-CONTROL":{var En=new M.AttrList(fe);g.canBlockReload=En.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=En.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&En.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=En.optionalFloat("PART-HOLD-BACK",0),g.holdBack=En.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var We=new M.AttrList(fe);g.partTarget=We.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Fe=g.partList;Fe||(Fe=g.partList=[]);var yt=A>0?Fe[Fe.length-1]:void 0,At=A++,nt=new K.Part(new M.AttrList(fe),Y,E,At,yt);Fe.push(nt),Y.duration+=nt.duration;break}case"PRELOAD-HINT":{var st=new M.AttrList(fe);g.preloadHint=st;break}case"RENDITION-REPORT":{var De=new M.AttrList(fe);g.renditionReports=g.renditionReports||[],g.renditionReports.push(De);break}default:_.logger.warn("line parsed but not handled: "+q);break}}}w&&!w.relurl?(x.pop(),H-=w.duration,g.partList&&(g.fragmentHint=w)):g.partList&&(C(Y,w),Y.cc=F,g.fragmentHint=Y);var ye=x.length,we=x[0],ae=x[ye-1];if(H+=g.skippedSegments*g.targetduration,H>0&&ye&&ae){g.averagetargetduration=H/ye;var se=ae.sn;g.endSN=se!=="initSegment"?se:0,we&&(g.startCC=we.cc,we.initSegment||g.fragments.every(function(pe){return pe.relurl&&s(pe.relurl)})&&(_.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new K.Fragment(h,E),Y.relurl=ae.relurl,Y.level=f,Y.sn="initSegment",we.initSegment=Y,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(H+=g.fragmentHint.duration),g.totalduration=H,g.endCC=F,Je>0&&T(x,Je),g},R}();function n(R,S){["video","audio","text"].forEach(function(v){var E=R.filter(function(h){return Object(p.isCodecType)(h,v)});if(E.length){var f=E.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});S[v+"Codec"]=f.length>0?f[0]:E[0],R=R.filter(function(h){return E.indexOf(h)===-1})}}),S.unknownCodecs=R}function O(R,S,v){var E=S[v];E&&(R[v]=E)}function T(R,S){for(var v=R[S],E=S;E--;){var f=R[E];if(!f)return;f.programDateTime=v.programDateTime-f.duration*1e3,v=f}}function C(R,S){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):S!=null&&S.programDateTime&&(R.programDateTime=S.endProgramDateTime),Object(G.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),k=U("./src/errors.ts"),K=U("./src/utils/logger.ts"),I=U("./src/utils/mp4-tools.ts"),r=U("./src/loader/m3u8-parser.ts"),M=U("./src/types/loader.ts"),_=U("./src/utils/attr-list.ts");function p(a){var o=a.type;switch(o){case M.PlaylistContextType.AUDIO_TRACK:return M.PlaylistLevelType.AUDIO;case M.PlaylistContextType.SUBTITLE_TRACK:return M.PlaylistLevelType.SUBTITLE;default:return M.PlaylistLevelType.MAIN}}function m(a,o){var c=a.url;return(c===void 0||c.indexOf("data:")===0)&&(c=o.url),c}var u=function(){function a(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var o=a.prototype;return o.registerListeners=function(){var s=this.hls;s.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.unregisterListeners=function(){var s=this.hls;s.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.createInternalLoader=function(s){var i=this.hls.config,n=i.pLoader,O=i.loader,T=n||O,C=new T(i);return s.loader=C,this.loaders[s.type]=C,C},o.getInternalLoader=function(s){return this.loaders[s.type]},o.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},o.destroyInternalLoaders=function(){for(var s in this.loaders){var i=this.loaders[s];i&&i.destroy(),this.resetInternalLoader(s)}},o.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},o.onManifestLoading=function(s,i){var n=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:M.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},o.onLevelLoading=function(s,i){var n=i.id,O=i.level,T=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:null,level:O,responseType:"text",type:M.PlaylistContextType.LEVEL,url:T,deliveryDirectives:C})},o.onAudioTrackLoading=function(s,i){var n=i.id,O=i.groupId,T=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:C})},o.onSubtitleTrackLoading=function(s,i){var n=i.id,O=i.groupId,T=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:C})},o.load=function(s){var i,n=this.hls.config,O=this.getInternalLoader(s);if(O){var T=O.context;if(T&&T.url===s.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),O.abort()}var C,R,S,v;switch(s.type){case M.PlaylistContextType.MANIFEST:C=n.manifestLoadingMaxRetry,R=n.manifestLoadingTimeOut,S=n.manifestLoadingRetryDelay,v=n.manifestLoadingMaxRetryTimeout;break;case M.PlaylistContextType.LEVEL:case M.PlaylistContextType.AUDIO_TRACK:case M.PlaylistContextType.SUBTITLE_TRACK:C=0,R=n.levelLoadingTimeOut;break;default:C=n.levelLoadingMaxRetry,R=n.levelLoadingTimeOut,S=n.levelLoadingRetryDelay,v=n.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(s),(i=s.deliveryDirectives)!==null&&i!==void 0&&i.part){var E;if(s.type===M.PlaylistContextType.LEVEL&&s.level!==null?E=this.hls.levels[s.level].details:s.type===M.PlaylistContextType.AUDIO_TRACK&&s.id!==null?E=this.hls.audioTracks[s.id].details:s.type===M.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(E=this.hls.subtitleTracks[s.id].details),E){var f=E.partTarget,h=E.targetduration;f&&h&&(R=Math.min(Math.max(f*3,h*.8)*1e3,R))}}var y={timeout:R,maxRetry:C,retryDelay:S,maxRetryDelay:v,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(s,y,g)},o.loadsuccess=function(s,i,n,O){if(O===void 0&&(O=null),n.isSidxRequest){this.handleSidxRequest(s,n),this.handlePlaylistLoaded(s,i,n,O);return}this.resetInternalLoader(n.type);var T=s.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,n,"no EXTM3U delimiter",O);return}i.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,i,n,O):this.handleMasterPlaylist(s,i,n,O)},o.loaderror=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!1,s)},o.loadtimeout=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!0)},o.handleMasterPlaylist=function(s,i,n,O){var T=this.hls,C=s.data,R=m(s,n),S=r.default.parseMasterPlaylist(C,R),v=S.levels,E=S.sessionData;if(!v.length){this.handleManifestParsingError(s,n,"no level found in manifest",O);return}var f=v.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),h=v.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),y=r.default.parseMasterPlaylistMedia(C,R,"AUDIO",f),g=r.default.parseMasterPlaylistMedia(C,R,"SUBTITLES",h),x=r.default.parseMasterPlaylistMedia(C,R,"CLOSED-CAPTIONS");if(y.length){var j=y.some(function(B){return!B.url});!j&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new _.AttrList({}),bitrate:0,url:""}))}T.trigger(P.Events.MANIFEST_LOADED,{levels:v,audioTracks:y,subtitles:g,captions:x,url:R,stats:i,networkDetails:O,sessionData:E})},o.handleTrackOrLevelPlaylist=function(s,i,n,O){var T=this.hls,C=n.id,R=n.level,S=n.type,v=m(s,n),E=Object(G.isFiniteNumber)(C)?C:0,f=Object(G.isFiniteNumber)(R)?R:E,h=p(n),y=r.default.parseLevelPlaylist(s.data,v,f,h,E);if(!y.fragments.length){T.trigger(P.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(S===M.PlaylistContextType.MANIFEST){var g={attrs:new _.AttrList({}),bitrate:0,details:y,name:"",url:v};T.trigger(P.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:v,stats:i,networkDetails:O,sessionData:null})}if(i.parsing.end=performance.now(),y.needSidxRanges){var x,j=(x=y.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:j,isSidxRequest:!0,type:S,level:R,levelDetails:y,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=y,this.handlePlaylistLoaded(s,i,n,O)},o.handleSidxRequest=function(s,i){var n=Object(I.parseSegmentIndex)(new Uint8Array(s.data));if(!n)return;var O=n.references,T=i.levelDetails;O.forEach(function(C,R){var S=C.info,v=T.fragments[R];v.byteRange.length===0&&v.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),v.initSegment&&v.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},o.handleManifestParsingError=function(s,i,n,O){this.hls.trigger(P.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===M.PlaylistContextType.MANIFEST,url:s.url,reason:n,response:s,context:i,networkDetails:O})},o.handleNetworkError=function(s,i,n,O){n===void 0&&(n=!1),K.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var T=k.ErrorDetails.UNKNOWN,C=!1,R=this.getInternalLoader(s);switch(s.type){case M.PlaylistContextType.MANIFEST:T=n?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case M.PlaylistContextType.LEVEL:T=n?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case M.PlaylistContextType.AUDIO_TRACK:T=n?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:T=n?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}R&&this.resetInternalLoader(s.type);var S={type:k.ErrorTypes.NETWORK_ERROR,details:T,fatal:C,url:s.url,loader:R,context:s,networkDetails:i};O&&(S.response=O),this.hls.trigger(P.Events.ERROR,S)},o.handlePlaylistLoaded=function(s,i,n,O){var T=n.type,C=n.level,R=n.id,S=n.groupId,v=n.loader,E=n.levelDetails,f=n.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(s,n,"invalid target duration",O);return}if(!v)return;E.live&&(v.getCacheAge&&(E.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(T){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:E,level:C||0,id:R||0,stats:i,networkDetails:O,deliveryDirectives:f});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:f});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:f});break}},a}();V.default=u},"./src/polyfills/number.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isFiniteNumber",function(){return G}),U.d(V,"MAX_SAFE_INTEGER",function(){return P});var G=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,V,U){"use strict";U.r(V);var G=function(){function P(){}return P.getSilentFrame=function(K,I){switch(K){case"mp4a.40.2":if(I===1)return new Uint8Array([0,200,0,128,35,128]);if(I===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(I===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(I===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(I===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(I===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(I===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(I===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(I===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},P}();V.default=G},"./src/remux/mp4-generator.ts":function(Z,V,U){"use strict";U.r(V);var G=Math.pow(2,32)-1,P=function(){function k(){}return k.init=function(){k.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var I;for(I in k.types)k.types.hasOwnProperty(I)&&(k.types[I]=[I.charCodeAt(0),I.charCodeAt(1),I.charCodeAt(2),I.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),M=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);k.HDLR_TYPES={video:r,audio:M};var _=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);k.STTS=k.STSC=k.STCO=p,k.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),k.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),k.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),k.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,m,a,m,u),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,_))},k.box=function(I){for(var r=8,M=arguments.length,_=new Array(M>1?M-1:0),p=1;p<M;p++)_[p-1]=arguments[p];for(var m=_.length,u=m;m--;)r+=_[m].byteLength;var a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(I,4),m=0,r=8;m<u;m++)a.set(_[m],r),r+=_[m].byteLength;return a},k.hdlr=function(I){return k.box(k.types.hdlr,k.HDLR_TYPES[I])},k.mdat=function(I){return k.box(k.types.mdat,I)},k.mdhd=function(I,r){r*=I;var M=Math.floor(r/(G+1)),_=Math.floor(r%(G+1));return k.box(k.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,M>>24,M>>16&255,M>>8&255,M&255,_>>24,_>>16&255,_>>8&255,_&255,85,196,0,0]))},k.mdia=function(I){return k.box(k.types.mdia,k.mdhd(I.timescale,I.duration),k.hdlr(I.type),k.minf(I))},k.mfhd=function(I){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255]))},k.minf=function(I){return I.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(I)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(I))},k.moof=function(I,r,M){return k.box(k.types.moof,k.mfhd(I),k.traf(M,r))},k.moov=function(I){for(var r=I.length,M=[];r--;)M[r]=k.trak(I[r]);return k.box.apply(null,[k.types.moov,k.mvhd(I[0].timescale,I[0].duration)].concat(M).concat(k.mvex(I)))},k.mvex=function(I){for(var r=I.length,M=[];r--;)M[r]=k.trex(I[r]);return k.box.apply(null,[k.types.mvex].concat(M))},k.mvhd=function(I,r){r*=I;var M=Math.floor(r/(G+1)),_=Math.floor(r%(G+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,M>>24,M>>16&255,M>>8&255,M&255,_>>24,_>>16&255,_>>8&255,_&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return k.box(k.types.mvhd,p)},k.sdtp=function(I){var r=I.samples||[],M=new Uint8Array(4+r.length),_,p;for(_=0;_<r.length;_++)p=r[_].flags,M[_+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return k.box(k.types.sdtp,M)},k.stbl=function(I){return k.box(k.types.stbl,k.stsd(I),k.box(k.types.stts,k.STTS),k.box(k.types.stsc,k.STSC),k.box(k.types.stsz,k.STSZ),k.box(k.types.stco,k.STCO))},k.avc1=function(I){var r=[],M=[],_,p,m;for(_=0;_<I.sps.length;_++)p=I.sps[_],m=p.byteLength,r.push(m>>>8&255),r.push(m&255),r=r.concat(Array.prototype.slice.call(p));for(_=0;_<I.pps.length;_++)p=I.pps[_],m=p.byteLength,M.push(m>>>8&255),M.push(m&255),M=M.concat(Array.prototype.slice.call(p));var u=k.box(k.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|I.sps.length].concat(r).concat([I.pps.length]).concat(M))),a=I.width,o=I.height,c=I.pixelRatio[0],s=I.pixelRatio[1];return k.box(k.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,a&255,o>>8&255,o&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,k.box(k.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),k.box(k.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255])))},k.esds=function(I){var r=I.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(I.config).concat([6,1,2]))},k.mp4a=function(I){var r=I.samplerate;return k.box(k.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),k.box(k.types.esds,k.esds(I)))},k.mp3=function(I){var r=I.samplerate;return k.box(k.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,I.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},k.stsd=function(I){return I.type==="audio"?!I.isAAC&&I.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(I)):k.box(k.types.stsd,k.STSD,k.mp4a(I)):k.box(k.types.stsd,k.STSD,k.avc1(I))},k.tkhd=function(I){var r=I.id,M=I.duration*I.timescale,_=I.width,p=I.height,m=Math.floor(M/(G+1)),u=Math.floor(M%(G+1));return k.box(k.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,_>>8&255,_&255,0,0,p>>8&255,p&255,0,0]))},k.traf=function(I,r){var M=k.sdtp(I),_=I.id,p=Math.floor(r/(G+1)),m=Math.floor(r%(G+1));return k.box(k.types.traf,k.box(k.types.tfhd,new Uint8Array([0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255])),k.box(k.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])),k.trun(I,M.length+16+20+8+16+8+8),M)},k.trak=function(I){return I.duration=I.duration||4294967295,k.box(k.types.trak,k.tkhd(I),k.mdia(I))},k.trex=function(I){var r=I.id;return k.box(k.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},k.trun=function(I,r){var M=I.samples||[],_=M.length,p=12+16*_,m=new Uint8Array(p),u,a,o,c,s,i;for(r+=8+p,m.set([0,0,15,1,_>>>24&255,_>>>16&255,_>>>8&255,_&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),u=0;u<_;u++)a=M[u],o=a.duration,c=a.size,s=a.flags,i=a.cts,m.set([o>>>24&255,o>>>16&255,o>>>8&255,o&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*u);return k.box(k.types.trun,m)},k.initSegment=function(I){k.types||k.init();var r=k.moov(I),M=new Uint8Array(k.FTYP.byteLength+r.byteLength);return M.set(k.FTYP),M.set(r,k.FTYP.byteLength),M},k}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,V.default=P},"./src/remux/mp4-remuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return i}),U.d(V,"normalizePts",function(){return n});var G=U("./src/polyfills/number.ts"),P=U("./src/remux/aac-helper.ts"),k=U("./src/remux/mp4-generator.ts"),K=U("./src/events.ts"),I=U("./src/errors.ts"),r=U("./src/utils/logger.ts"),M=U("./src/types/loader.ts"),_=U("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var v=arguments[S];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E])}return R},p.apply(this,arguments)}var m=10*1e3,u=1024,a=1152,o=null,c=null,s=!1,i=function(){function R(v,E,f,h){if(h===void 0&&(h=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=v,this.config=E,this.typeSupported=f,this.ISGenerated=!1,o===null){var y=navigator.userAgent||"",g=y.match(/Chrome\/(\d+)/i);o=g?parseInt(g[1]):0}if(c===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);c=x?parseInt(x[1]):0}s=!!o&&o<75||!!c&&c<600}var S=R.prototype;return S.destroy=function(){},S.resetTimeStamp=function(E){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},S.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},S.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},S.getVideoStartPts=function(E){var f=!1,h=E.reduce(function(y,g){var x=g.pts-y;return x<-4294967296?(f=!0,n(y,g.pts)):x>0?y:g.pts},E[0].pts);return f&&r.logger.debug("PTS rollover detected"),h},S.remux=function(E,f,h,y,g,x,j,B){var A,H,F,w,Y,q,ie=g,ge=g,Je=E.pid>-1,xe=f.pid>-1,ke=f.samples.length,Qe=E.samples.length>0,Ye=ke>1,ve=(!Je||Qe)&&(!xe||Ye)||this.ISGenerated||j;if(ve){this.ISGenerated||(F=this.generateIS(E,f,g));var fe=this.isVideoContiguous,at=-1;if(Ye&&(at=O(f.samples),!fe&&this.config.forceKeyFrameOnDiscontinuity))if(q=!0,at>0){r.logger.warn("[mp4-remuxer]: Dropped "+at+" out of "+ke+" video samples due to a missing keyframe");var Jt=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(at),f.dropped+=at,ge+=(f.samples[0].pts-Jt)/(f.timescale||9e4)}else at===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+ke+" video samples"),q=!1);if(this.ISGenerated){if(Qe&&Ye){var Ft=this.getVideoStartPts(f.samples),St=n(E.samples[0].pts,Ft)-Ft,ze=St/f.inputTimeScale;ie+=Math.max(0,ze),ge+=Math.max(0,-ze)}if(Qe){if(E.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(E,f,g)),H=this.remuxAudio(E,ie,this.isAudioContiguous,x,xe||Ye||B===M.PlaylistLevelType.AUDIO?ge:void 0),Ye){var gt=H?H.endPTS-H.startPTS:0;f.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(E,f,g)),A=this.remuxVideo(f,ge,fe,gt)}}else Ye&&(A=this.remuxVideo(f,ge,fe,0));A&&(A.firstKeyFrame=at,A.independent=at!==-1)}}return this.ISGenerated&&(h.samples.length&&(Y=this.remuxID3(h,g)),y.samples.length&&(w=this.remuxText(y,g))),{audio:H,video:A,initSegment:F,independent:q,text:w,id3:Y}},S.generateIS=function(E,f,h){var y=E.samples,g=f.samples,x=this.typeSupported,j={},B=!Object(G.isFiniteNumber)(this._initPTS),A="audio/mp4",H,F,w;if(B&&(H=F=Infinity),E.config&&y.length&&(E.timescale=E.samplerate,E.isAAC||(x.mpeg?(A="audio/mpeg",E.codec=""):x.mp3&&(E.codec="mp3")),j.audio={id:"audio",container:A,codec:E.codec,initSegment:!E.isAAC&&x.mpeg?new Uint8Array(0):k.default.initSegment([E]),metadata:{channelCount:E.channelCount}},B&&(w=E.inputTimeScale,H=F=y[0].pts-Math.round(w*h))),f.sps&&f.pps&&g.length&&(f.timescale=f.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:k.default.initSegment([f]),metadata:{width:f.width,height:f.height}},B)){w=f.inputTimeScale;var Y=this.getVideoStartPts(g),q=Math.round(w*h);F=Math.min(F,n(g[0].dts,Y)-q),H=Math.min(H,Y-q)}if(Object.keys(j).length)return this.ISGenerated=!0,B&&(this._initPTS=H,this._initDTS=F),{tracks:j,initPTS:H,timescale:w}},S.remuxVideo=function(E,f,h,y){var g=E.inputTimeScale,x=E.samples,j=[],B=x.length,A=this._initPTS,H=this.nextAvcDts,F=8,w,Y,q,ie=Number.POSITIVE_INFINITY,ge=Number.NEGATIVE_INFINITY,Je=0,xe=!1;if(!h||H===null){var ke=f*g,Qe=x[0].pts-n(x[0].dts,x[0].pts);H=ke-Qe}for(var Ye=0;Ye<B;Ye++){var ve=x[Ye];if(ve.pts=n(ve.pts-A,H),ve.dts=n(ve.dts-A,H),ve.dts>ve.pts){var fe=9e4*.2;Je=Math.max(Math.min(Je,ve.pts-ve.dts),-1*fe)}ve.dts<x[Ye>0?Ye-1:Ye].dts&&(xe=!0)}xe&&x.sort(function(Qt,Et){var Ct=Qt.dts-Et.dts,lt=Qt.pts-Et.pts;return Ct||lt}),Y=x[0].dts,q=x[x.length-1].dts;var at=Math.round((q-Y)/(B-1));if(Je<0){if(Je<at*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(_.toMsFromMpegTsClock)(-at,!0)+" ms");for(var Jt=Je,Ft=0;Ft<B;Ft++)x[Ft].dts=Jt=Math.max(Jt,x[Ft].pts-at),x[Ft].pts=Math.max(Jt,x[Ft].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(_.toMsFromMpegTsClock)(Je,!0)+" ms to overcome this issue");for(var St=0;St<B;St++)x[St].dts=x[St].dts+Je}Y=x[0].dts}if(h){var ze=Y-H,gt=ze>at,ct=ze<-1;if(gt||ct){gt?r.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(ze,!0)+" ms ("+ze+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(-ze,!0)+" ms ("+ze+"dts) overlapping between fragments detected"),Y=H;var jt=x[0].pts-ze;x[0].dts=Y,x[0].pts=jt,r.logger.log("Video: First PTS/DTS adjusted: "+Object(_.toMsFromMpegTsClock)(jt,!0)+"/"+Object(_.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(_.toMsFromMpegTsClock)(ze,!0)+" ms")}}s&&(Y=Math.max(0,Y));for(var oe=0,Ne=0,Ge=0;Ge<B;Ge++){for(var Xe=x[Ge],Bt=Xe.units,Wt=Bt.length,en=0,tt=0;tt<Wt;tt++)en+=Bt[tt].data.length;Ne+=en,oe+=Wt,Xe.length=en,Xe.dts=Math.max(Xe.dts,Y),Xe.pts=Math.max(Xe.pts,Xe.dts,0),ie=Math.min(Xe.pts,ie),ge=Math.max(Xe.pts,ge)}q=x[B-1].dts;var tn=Ne+4*oe+8,En;try{En=new Uint8Array(tn)}catch(Qt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:tn,reason:"fail allocating video mdat "+tn});return}var We=new DataView(En.buffer);We.setUint32(0,tn),En.set(k.default.types.mdat,4);for(var Fe=0;Fe<B;Fe++){for(var yt=x[Fe],At=yt.units,nt=0,st=0,De=At.length;st<De;st++){var ye=At[st],we=ye.data,ae=ye.data.byteLength;We.setUint32(F,ae),F+=4,En.set(we,F),F+=ae,nt+=4+ae}if(Fe<B-1)w=x[Fe+1].dts-yt.dts;else{var se=this.config,pe=yt.dts-x[Fe>0?Fe-1:Fe].dts;if(se.stretchShortVideoTrack&&this.nextAudioPts!==null){var _e=Math.floor(se.maxBufferHole*g),be=(y?ie+y*g:this.nextAudioPts)-yt.pts;be>_e?(w=be-pe,w<0&&(w=pe),r.logger.log("[mp4-remuxer]: It is approximately "+be/90+" ms to the next segment; using duration "+w/90+" ms for the last video frame.")):w=pe}else w=pe}var Ke=Math.round(yt.pts-yt.dts);j.push(new T(yt.key,w,nt,Ke))}if(j.length&&o&&o<70){var Ot=j[0].flags;Ot.dependsOn=2,Ot.isNonSync=0}console.assert(w!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=q+w,this.isVideoContiguous=!0;var rn=k.default.moof(E.sequenceNumber++,Y,p({},E,{samples:j})),Dn="video",bt={data1:rn,data2:En,startPTS:ie/g,endPTS:(ge+w)/g,startDTS:Y/g,endDTS:H/g,type:Dn,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(En.length,"MDAT length must not be zero"),bt},S.remuxAudio=function(E,f,h,y,g){var x=E.inputTimeScale,j=E.samplerate?E.samplerate:x,B=x/j,A=E.isAAC?u:a,H=A*B,F=this._initPTS,w=!E.isAAC&&this.typeSupported.mpeg,Y=[],q=E.samples,ie=w?0:8,ge=this.nextAudioPts||-1,Je=f*x;if(this.isAudioContiguous=h=h||q.length&&ge>0&&(y&&Math.abs(Je-ge)<9e3||Math.abs(n(q[0].pts-F,Je)-ge)<20*H),q.forEach(function(we){we.pts=n(we.pts-F,Je)}),!h||ge<0){if(q=q.filter(function(we){return we.pts>=0}),!q.length)return;g===0?ge=0:y?ge=Math.max(0,Je):ge=q[0].pts}if(E.isAAC)for(var xe=g!==void 0,ke=this.config.maxAudioFramesDrift,Qe=0,Ye=ge;Qe<q.length;Qe++){var ve=q[Qe],fe=ve.pts,at=fe-Ye,Jt=Math.abs(1e3*at/x);if(at<=-ke*H&&xe)Qe===0&&(r.logger.warn("Audio frame @ "+(fe/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*at/x)+" ms."),this.nextAudioPts=ge=Ye=fe);else if(at>=ke*H&&Jt<m&&xe){var Ft=Math.round(at/H);Ye=fe-Ft*H,Ye<0&&(Ft--,Ye+=H),Qe===0&&(this.nextAudioPts=ge=Ye),r.logger.warn("[mp4-remuxer]: Injecting "+Ft+" audio frame @ "+(Ye/x).toFixed(3)+"s due to "+Math.round(1e3*at/x)+" ms gap.");for(var St=0;St<Ft;St++){var ze=Math.max(Ye,0),gt=P.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);gt||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),gt=ve.unit.subarray()),q.splice(Qe,0,{unit:gt,pts:ze}),Ye+=H,Qe++}}ve.pts=Ye,Ye+=H}for(var ct=null,jt=null,oe,Ne=0,Ge=q.length;Ge--;)Ne+=q[Ge].unit.byteLength;for(var Xe=0,Bt=q.length;Xe<Bt;Xe++){var Wt=q[Xe],en=Wt.unit,tt=Wt.pts;if(jt!==null){var tn=Y[Xe-1];tn.duration=Math.round((tt-jt)/B)}else if(h&&E.isAAC&&(tt=ge),ct=tt,Ne>0){Ne+=ie;try{oe=new Uint8Array(Ne)}catch(we){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:I.ErrorTypes.MUX_ERROR,details:I.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ne,reason:"fail allocating audio mdat "+Ne});return}if(!w){var En=new DataView(oe.buffer);En.setUint32(0,Ne),oe.set(k.default.types.mdat,4)}}else return;oe.set(en,ie);var We=en.byteLength;ie+=We,Y.push(new T(!0,A,We,0)),jt=tt}var Fe=Y.length;if(!Fe)return;var yt=Y[Y.length-1];this.nextAudioPts=ge=jt+B*yt.duration;var At=w?new Uint8Array(0):k.default.moof(E.sequenceNumber++,ct/B,p({},E,{samples:Y}));E.samples=[];var nt=ct/x,st=ge/x,De="audio",ye={data1:At,data2:oe,startPTS:nt,endPTS:st,startDTS:nt,endDTS:st,type:De,hasAudio:!0,hasVideo:!1,nb:Fe};return this.isAudioContiguous=!0,console.assert(oe.length,"MDAT length must not be zero"),ye},S.remuxEmptyAudio=function(E,f,h,y){var g=E.inputTimeScale,x=E.samplerate?E.samplerate:g,j=g/x,B=this.nextAudioPts,A=(B!==null?B:y.startDTS*g)+this._initDTS,H=y.endDTS*g+this._initDTS,F=j*u,w=Math.ceil((H-A)/F),Y=P.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var q=[],ie=0;ie<w;ie++){var ge=A+ie*F;q.push({unit:Y,pts:ge,dts:ge})}return E.samples=q,this.remuxAudio(E,f,h,!1)},S.remuxID3=function(E,f){var h=E.samples.length;if(!h)return;for(var y=E.inputTimeScale,g=this._initPTS,x=this._initDTS,j=0;j<h;j++){var B=E.samples[j];B.pts=n(B.pts-g,f*y)/y,B.dts=n(B.dts-x,f*y)/y}var A=E.samples;return E.samples=[],{samples:A}},S.remuxText=function(E,f){var h=E.samples.length;if(!h)return;for(var y=E.inputTimeScale,g=this._initPTS,x=0;x<h;x++){var j=E.samples[x];j.pts=n(j.pts-g,f*y)/y}E.samples.sort(function(A,H){return A.pts-H.pts});var B=E.samples;return E.samples=[],{samples:B}},R}();function n(R,S){var v;if(S===null)return R;for(S<R?v=-8589934592:v=8589934592;Math.abs(R-S)>4294967296;)R+=v;return R}function O(R){for(var S=0;S<R.length;S++)if(R[S].key)return S;return-1}var T=function(S,v,E,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=E,this.cts=f,this.flags=new C(S)},C=function(S){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=S?2:1,this.isNonSync=S?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/utils/mp4-tools.ts"),k=U("./src/loader/fragment.ts"),K=U("./src/utils/logger.ts"),I=function(){function _(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var p=_.prototype;return p.destroy=function(){},p.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(u,a,o){this.audioCodec=a,this.videoCodec=o,this.generateInitSegment(u),this.emitInitSegment=!0},p.generateInitSegment=function(u){var a=this.audioCodec,o=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(P.parseInitSegment)(u);a||(a=M(c.audio,k.ElementaryStreamTypes.AUDIO)),o||(o=M(c.video,k.ElementaryStreamTypes.VIDEO));var s={};c.audio&&c.video?s.audiovideo={container:"video/mp4",codec:a+","+o,initSegment:u,id:"main"}:c.audio?s.audio={container:"audio/mp4",codec:a,initSegment:u,id:"audio"}:c.video?s.video={container:"video/mp4",codec:o,initSegment:u,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},p.remux=function(u,a,o,c,s){var i=this.initPTS,n=this.lastEndDTS,O={audio:void 0,video:void 0,text:c,id3:o,initSegment:void 0};Object(G.isFiniteNumber)(n)||(n=this.lastEndDTS=s||0);var T=a.samples;if(!T||!T.length)return O;var C={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(T),R=this.initData),!R||!R.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(C.tracks=this.initTracks,this.emitInitSegment=!1),Object(G.isFiniteNumber)(i)||(this.initPTS=C.initPTS=i=r(R,T,n));var S=Object(P.getDuration)(T,R),v=n,E=S+v;Object(P.offsetStartDTS)(R,T,i),S>0?this.lastEndDTS=E:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!R.audio,h=!!R.video,y="";f&&(y+="audio"),h&&(y+="video");var g={data1:T,startPTS:v,startDTS:v,endPTS:E,endDTS:E,type:y,hasAudio:f,hasVideo:h,nb:1,dropped:0};return O.audio=g.type==="audio"?g:void 0,O.video=g.type!=="audio"?g:void 0,O.text=c,O.id3=o,O.initSegment=C,O},_}(),r=function(p,m,u){return Object(P.getStartDTS)(p,m)-u};function M(_,p){var m=_==null?void 0:_.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||p===k.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=I},"./src/task-loop.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var k=P.prototype;return k.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},k.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},k.onHandlerDestroyed=function(){},k.hasInterval=function(){return!!this._tickInterval},k.hasNextTick=function(){return!!this._tickTimer},k.setInterval=function(I){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,I),!0)},k.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},k.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},k.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},k.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},k.doTick=function(){},P}()},"./src/types/cmcd.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"CMCDVersion",function(){return G}),U.d(V,"CMCDObjectType",function(){return P}),U.d(V,"CMCDStreamingFormat",function(){return k}),U.d(V,"CMCDStreamType",function(){return K});var G=1,P;(function(I){I.MANIFEST="m",I.AUDIO="a",I.VIDEO="v",I.MUXED="av",I.INIT="i",I.CAPTION="c",I.TIMED_TEXT="tt",I.KEY="k",I.OTHER="o"})(P||(P={}));var k;(function(I){I.DASH="d",I.HLS="h",I.SMOOTH="s",I.OTHER="o"})(k||(k={}));var K;(function(I){I.VOD="v",I.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"HlsSkip",function(){return k}),U.d(V,"getSkipValue",function(){return K}),U.d(V,"HlsUrlParameters",function(){return I}),U.d(V,"Level",function(){return r});function G(M,_){for(var p=0;p<_.length;p++){var m=_[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(M,m.key,m)}}function P(M,_,p){return _&&G(M.prototype,_),p&&G(M,p),M}var k;(function(M){M.No="",M.Yes="YES",M.v2="v2"})(k||(k={}));function K(M,_){var p=M.canSkipUntil,m=M.canSkipDateRanges,u=M.endSN,a=_!==void 0?_-u:0;return p&&a<p?m?k.v2:k.Yes:k.No}var I=function(){function M(p,m,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=m,this.skip=u}var _=M.prototype;return _.addDirectives=function(m){var u=new self.URL(m);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},M}(),r=function(){function M(_){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[_.url],this.attrs=_.attrs,this.bitrate=_.bitrate,_.details&&(this.details=_.details),this.id=_.id||0,this.name=_.name,this.width=_.width||0,this.height=_.height||0,this.audioCodec=_.audioCodec,this.videoCodec=_.videoCodec,this.unknownCodecs=_.unknownCodecs,this.codecSet=[_.videoCodec,_.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return P(M,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(p){var m=p%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),M}()},"./src/types/loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"PlaylistContextType",function(){return G}),U.d(V,"PlaylistLevelType",function(){return P});var G;(function(k){k.MANIFEST="manifest",k.LEVEL="level",k.AUDIO_TRACK="audioTrack",k.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var P;(function(k){k.MAIN="main",k.AUDIO="audio",k.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"ChunkMetadata",function(){return G});var G=function(K,I,r,M,_,p){M===void 0&&(M=0),_===void 0&&(_=-1),p===void 0&&(p=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=K,this.sn=I,this.id=r,this.size=M,this.part=_,this.partial=p};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"AttrList",function(){return k});var G=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,k=function(){function K(r){typeof r=="string"&&(r=K.parseAttrList(r));for(var M in r)r.hasOwnProperty(M)&&(this[M]=r[M])}var I=K.prototype;return I.decimalInteger=function(M){var _=parseInt(this[M],10);return _>Number.MAX_SAFE_INTEGER?Infinity:_},I.hexadecimalInteger=function(M){if(this[M]){var _=(this[M]||"0x").slice(2);_=(_.length&1?"0":"")+_;for(var p=new Uint8Array(_.length/2),m=0;m<_.length/2;m++)p[m]=parseInt(_.slice(m*2,m*2+2),16);return p}else return null},I.hexadecimalIntegerAsNumber=function(M){var _=parseInt(this[M],16);return _>Number.MAX_SAFE_INTEGER?Infinity:_},I.decimalFloatingPoint=function(M){return parseFloat(this[M])},I.optionalFloat=function(M,_){var p=this[M];return p?parseFloat(p):_},I.enumeratedString=function(M){return this[M]},I.bool=function(M){return this[M]==="YES"},I.decimalResolution=function(M){var _=G.exec(this[M]);return _===null?void 0:{width:parseInt(_[1],10),height:parseInt(_[2],10)}},K.parseAttrList=function(M){var _,p={},m='"';for(P.lastIndex=0;(_=P.exec(M))!==null;){var u=_[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),p[_[1]]=u}return p},K}()},"./src/utils/binary-search.ts":function(Z,V,U){"use strict";U.r(V);var G={search:function(k,K){for(var I=0,r=k.length-1,M=null,_=null;I<=r;){M=(I+r)/2|0,_=k[M];var p=K(_);if(p>0)I=M+1;else if(p<0)r=M-1;else return _}return null}};V.default=G},"./src/utils/buffer-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"BufferHelper",function(){return k});var G=U("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function K(){}return K.isBuffered=function(r,M){try{if(r){for(var _=K.getBuffered(r),p=0;p<_.length;p++)if(M>=_.start(p)&&M<=_.end(p))return!0}}catch(m){}return!1},K.bufferInfo=function(r,M,_){try{if(r){var p=K.getBuffered(r),m=[],u;for(u=0;u<p.length;u++)m.push({start:p.start(u),end:p.end(u)});return this.bufferedInfo(m,M,_)}}catch(a){}return{len:0,start:M,end:M,nextStart:void 0}},K.bufferedInfo=function(r,M,_){M=Math.max(0,M),r.sort(function(C,R){var S=C.start-R.start;return S||R.end-C.end});var p=[];if(_)for(var m=0;m<r.length;m++){var u=p.length;if(u){var a=p[u-1].end;r[m].start-a<_?r[m].end>a&&(p[u-1].end=r[m].end):p.push(r[m])}else p.push(r[m])}else p=r;for(var o=0,c,s=M,i=M,n=0;n<p.length;n++){var O=p[n].start,T=p[n].end;if(M+_>=O&&M<T)s=O,i=T,o=i-M;else if(M+_<O){c=O;break}}return{len:o,start:s||0,end:i||0,nextStart:c}},K.getBuffered=function(r){try{return r.buffered}catch(M){return G.logger.log("failed to get media.buffered",M),P}},K}()},"./src/utils/cea-608-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"Row",function(){return i}),U.d(V,"CaptionScreen",function(){return n});var G=U("./src/utils/logger.ts"),P={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},k=function(E){var f=E;return P.hasOwnProperty(E)&&(f=P[E]),String.fromCharCode(f)},K=15,I=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},M={17:2,18:4,21:6,22:8,23:10,19:13,20:15},_={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(u||(u={}));var a=function(){function v(){this.time=null,this.verboseLevel=u.ERROR}var E=v.prototype;return E.log=function(h,y){this.verboseLevel>=h&&G.logger.log(this.time+" ["+h+"] "+y)},v}(),o=function(E){for(var f=[],h=0;h<E.length;h++)f.push(E[h].toString(16));return f},c=function(){function v(f,h,y,g,x){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=h||!1,this.italics=y||!1,this.background=g||"black",this.flash=x||!1}var E=v.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(h){for(var y=["foreground","underline","italics","background","flash"],g=0;g<y.length;g++){var x=y[g];h.hasOwnProperty(x)&&(this[x]=h[x])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},E.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),s=function(){function v(f,h,y,g,x,j){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new c(h,y,g,x,j)}var E=v.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(h,y){this.uchar=h,this.penState.copy(y)},E.setPenState=function(h){this.penState.copy(h)},E.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},E.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),i=function(){function v(f){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<I;h++)this.chars.push(new s);this.logger=f,this.pos=0,this.currPenState=new c}var E=v.prototype;return E.equals=function(h){for(var y=!0,g=0;g<I;g++)if(!this.chars[g].equals(h.chars[g])){y=!1;break}return y},E.copy=function(h){for(var y=0;y<I;y++)this.chars[y].copy(h.chars[y])},E.isEmpty=function(){for(var h=!0,y=0;y<I;y++)if(!this.chars[y].isEmpty()){h=!1;break}return h},E.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>I&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=I)},E.moveCursor=function(h){var y=this.pos+h;if(h>1)for(var g=this.pos+1;g<y+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(y)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(h){h>=144&&this.backSpace();var y=k(h);if(this.pos>=I){this.logger.log(u.ERROR,"Cannot insert "+h.toString(16)+" ("+y+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(y,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(h){var y;for(y=h;y<I;y++)this.chars[y].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var h=[],y=!0,g=0;g<I;g++){var x=this.chars[g].uchar;x!==" "&&(y=!1),h.push(x)}return y?"":h.join("")},E.setPenStyles=function(h){this.currPenState.setStyles(h);var y=this.chars[this.pos];y.setPenState(this.currPenState)},v}(),n=function(){function v(f){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<K;h++)this.rows.push(new i(f));this.logger=f,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=v.prototype;return E.reset=function(){for(var h=0;h<K;h++)this.rows[h].clear();this.currRow=K-1},E.equals=function(h){for(var y=!0,g=0;g<K;g++)if(!this.rows[g].equals(h.rows[g])){y=!1;break}return y},E.copy=function(h){for(var y=0;y<K;y++)this.rows[y].copy(h.rows[y])},E.isEmpty=function(){for(var h=!0,y=0;y<K;y++)if(!this.rows[y].isEmpty()){h=!1;break}return h},E.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},E.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},E.insertChar=function(h){var y=this.rows[this.currRow];y.insertChar(h)},E.setPen=function(h){var y=this.rows[this.currRow];y.setPenStyles(h)},E.moveCursor=function(h){var y=this.rows[this.currRow];y.moveCursor(h)},E.setCursor=function(h){this.logger.log(u.INFO,"setCursor: "+h);var y=this.rows[this.currRow];y.setCursor(h)},E.setPAC=function(h){this.logger.log(u.INFO,"pacData = "+JSON.stringify(h));var y=h.row-1;if(this.nrRollUpRows&&y<this.nrRollUpRows-1&&(y=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==y){for(var g=0;g<K;g++)this.rows[g].clear();var x=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var B=j.rows[x].cueStartTime,A=this.logger.time;if(B&&A!==null&&B<A)for(var H=0;H<this.nrRollUpRows;H++)this.rows[y-this.nrRollUpRows+H+1].copy(j.rows[x+H])}}this.currRow=y;var F=this.rows[this.currRow];if(h.indent!==null){var w=h.indent,Y=Math.max(w-1,0);F.setCursor(h.indent),h.color=F.chars[Y].penState.foreground}var q={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(q)},E.setBkgData=function(h){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},E.setRollUpRows=function(h){this.nrRollUpRows=h},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,y=this.rows.splice(h,1)[0];y.clear(),this.rows.splice(this.currRow,0,y),this.logger.log(u.INFO,"Rolling up")},E.getDisplayText=function(h){h=h||!1;for(var y=[],g="",x=-1,j=0;j<K;j++){var B=this.rows[j].getTextString();B&&(x=j+1,h?y.push("Row "+x+": '"+B+"'"):y.push(B.trim()))}return y.length>0&&(h?g="["+y.join(" | ")+"]":g=y.join(`
`)),g},E.getTextAndFormat=function(){return this.rows},v}(),O=function(){function v(f,h,y){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=f,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new n(y),this.nonDisplayedMemory=new n(y),this.lastOutputScreen=new n(y),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=y}var E=v.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(h){this.outputFilter=h},E.setPAC=function(h){this.writeScreen.setPAC(h)},E.setBkgData=function(h){this.writeScreen.setBkgData(h)},E.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(u.INFO,"MODE="+h),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=h},E.insertChars=function(h){for(var y=0;y<h.length;y++)this.writeScreen.insertChar(h[y]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(h){this.logger.log(u.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},E.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(h){this.logger.log(u.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},E.ccMIDROW=function(h){var y={flash:!1};if(y.underline=h%2===1,y.italics=h>=46,y.italics)y.foreground="white";else{var g=Math.floor(h/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];y.foreground=x[g]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(y)),this.writeScreen.setPen(y)},E.outputDataUpdate=function(h){h===void 0&&(h=!1);var y=this.logger.time;if(y===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=y:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,y,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:y),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},v}(),T=function(){function v(f,h,y){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new a;this.channels=[null,new O(f,h,g),new O(f+1,y,g)],this.cmdHistory=S(),this.logger=g}var E=v.prototype;return E.getHandler=function(h){return this.channels[h].getHandler()},E.setHandler=function(h,y){this.channels[h].setHandler(y)},E.addData=function(h,y){var g,x,j,B=!1;this.logger.time=h;for(var A=0;A<y.length;A+=2){if(x=y[A]&127,j=y[A+1]&127,x===0&&j===0)continue;if(this.logger.log(u.DATA,"["+o([y[A],y[A+1]])+"] -> ("+o([x,j])+")"),g=this.parseCmd(x,j),g||(g=this.parseMidrow(x,j)),g||(g=this.parsePAC(x,j)),g||(g=this.parseBackgroundAttributes(x,j)),!g&&(B=this.parseChars(x,j),B)){var H=this.currentChannel;if(H&&H>0){var F=this.channels[H];F.insertChars(B)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!B&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+o([x,j])+" orig: "+o([y[A],y[A+1]]))}},E.parseCmd=function(h,y){var g=this.cmdHistory,x=(h===20||h===28||h===21||h===29)&&y>=32&&y<=47,j=(h===23||h===31)&&y>=33&&y<=35;if(!(x||j))return!1;if(R(h,y,g))return C(null,null,g),this.logger.log(u.DEBUG,"Repeated command ("+o([h,y])+") is dropped"),!0;var B=h===20||h===21||h===23?1:2,A=this.channels[B];return h===20||h===21||h===28||h===29?y===32?A.ccRCL():y===33?A.ccBS():y===34?A.ccAOF():y===35?A.ccAON():y===36?A.ccDER():y===37?A.ccRU(2):y===38?A.ccRU(3):y===39?A.ccRU(4):y===40?A.ccFON():y===41?A.ccRDC():y===42?A.ccTR():y===43?A.ccRTD():y===44?A.ccEDM():y===45?A.ccCR():y===46?A.ccENM():y===47&&A.ccEOC():A.ccTO(y-32),C(h,y,g),this.currentChannel=B,!0},E.parseMidrow=function(h,y){var g=0;if((h===17||h===25)&&y>=32&&y<=47){if(h===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[g];return x?(x.ccMIDROW(y),this.logger.log(u.DEBUG,"MIDROW ("+o([h,y])+")"),!0):!1}return!1},E.parsePAC=function(h,y){var g,x=this.cmdHistory,j=(h>=17&&h<=23||h>=25&&h<=31)&&y>=64&&y<=127,B=(h===16||h===24)&&y>=64&&y<=95;if(!(j||B))return!1;if(R(h,y,x))return C(null,null,x),!0;var A=h<=23?1:2;y>=64&&y<=95?g=A===1?r[h]:_[h]:g=A===1?M[h]:p[h];var H=this.channels[A];return H?(H.setPAC(this.interpretPAC(g,y)),C(h,y,x),this.currentChannel=A,!0):!1},E.interpretPAC=function(h,y){var g,x={color:null,italics:!1,indent:null,underline:!1,row:h};return y>95?g=y-96:g=y-64,x.underline=(g&1)===1,g<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((g-16)/2)*4,x},E.parseChars=function(h,y){var g,x=null,j=null;if(h>=25?(g=2,j=h-8):(g=1,j=h),j>=17&&j<=19){var B;j===17?B=y+80:j===18?B=y+112:B=y+144,this.logger.log(u.INFO,"Special char '"+k(B)+"' in channel "+g),x=[B]}else h>=32&&h<=127&&(x=y===0?[h]:[h,y]);if(x){var A=o(x);this.logger.log(u.DEBUG,"Char codes = "+A.join(",")),C(h,y,this.cmdHistory)}return x},E.parseBackgroundAttributes=function(h,y){var g=(h===16||h===24)&&y>=32&&y<=47,x=(h===23||h===31)&&y>=45&&y<=47;if(!(g||x))return!1;var j,B={};h===16||h===24?(j=Math.floor((y-32)/2),B.background=m[j],y%2===1&&(B.background=B.background+"_semi")):y===45?B.background="transparent":(B.foreground="black",y===47&&(B.underline=!0));var A=h<=23?1:2,H=this.channels[A];return H.setBkgData(B),C(h,y,this.cmdHistory),!0},E.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var y=this.channels[h];y&&y.reset()}this.cmdHistory=S()},E.cueSplitAtTime=function(h){for(var y=0;y<this.channels.length;y++){var g=this.channels[y];g&&g.cueSplitAtTime(h)}},v}();function C(v,E,f){f.a=v,f.b=E}function R(v,E,f){return f.a===v&&f.b===E}function S(){return{a:null,b:null}}V.default=T},"./src/utils/codecs.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isCodecType",function(){return P}),U.d(V,"isCodecSupportedInMp4",function(){return k});var G={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function P(K,I){var r=G[I];return!!r&&r[K.slice(0,4)]===!0}function k(K,I){return MediaSource.isTypeSupported((I||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/vttparser.ts"),P=U("./src/utils/webvtt-parser.ts"),k=U("./src/utils/texttrack-utils.ts"),K=/\s/,I={newCue:function(M,_,p,m){for(var u=[],a,o,c,s,i,n=self.VTTCue||self.TextTrackCue,O=0;O<m.rows.length;O++)if(a=m.rows[O],c=!0,s=0,i="",!a.isEmpty()){for(var T=0;T<a.chars.length;T++)K.test(a.chars[T].uchar)&&c?s++:(i+=a.chars[T].uchar,c=!1);a.cueStartTime=_,_===p&&(p+=1e-4),s>=16?s--:s++;var C=Object(G.fixLineBreaks)(i.trim()),R=Object(P.generateCueId)(_,p,C);(!M||!M.cues||!M.cues.getCueById(R))&&(o=new n(_,p,C),o.id=R,o.line=O+1,o.align="left",o.position=10+Math.min(80,Math.floor(s*8/32)*10),u.push(o))}return M&&u.length&&(u.sort(function(S,v){return S.line==="auto"||v.line==="auto"?0:S.line>8&&v.line>8?v.line-S.line:S.line-v.line}),u.forEach(function(S){return Object(k.addCueToTrack)(M,S)})),u}};V.default=I},"./src/utils/discontinuities.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"findFirstFragWithCC",function(){return K}),U.d(V,"shouldAlignOnDiscontinuities",function(){return I}),U.d(V,"findDiscontinuousReferenceFrag",function(){return r}),U.d(V,"adjustSlidingStart",function(){return _}),U.d(V,"alignStream",function(){return p}),U.d(V,"alignPDT",function(){return u}),U.d(V,"alignFragmentByPDTDelta",function(){return a}),U.d(V,"alignMediaPlaylistByPDT",function(){return o});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/logger.ts"),k=U("./src/controller/level-helper.ts");function K(c,s){for(var i=null,n=0,O=c.length;n<O;n++){var T=c[n];if(T&&T.cc===s){i=T;break}}return i}function I(c,s,i){return!!(s.details&&(i.endCC>i.startCC||c&&c.cc<i.startCC))}function r(c,s){var i=c.fragments,n=s.fragments;if(!n.length||!i.length){P.logger.log("No fragments to align");return}var O=K(i,n[0].cc);if(!O||O&&!O.startPTS){P.logger.log("No frag in previous level to align on");return}return O}function M(c,s){if(c){var i=c.start+s;c.start=c.startPTS=i,c.endPTS=i+c.duration}}function _(c,s){for(var i=s.fragments,n=0,O=i.length;n<O;n++)M(i[n],c);s.fragmentHint&&M(s.fragmentHint,c),s.alignedSliding=!0}function p(c,s,i){if(!s)return;m(c,i,s),!i.alignedSliding&&s.details&&u(i,s.details),!i.alignedSliding&&s.details&&!i.skippedSegments&&Object(k.adjustSliding)(s.details,i)}function m(c,s,i){if(I(c,i,s)){var n=r(i.details,s);n&&Object(G.isFiniteNumber)(n.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),_(n.start,s))}}function u(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=c.fragments[0].programDateTime,O=(n-i)/1e3+s.fragments[0].start;O&&Object(G.isFiniteNumber)(O)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(n-i)+"ms, sliding:"+O.toFixed(3)+" "+c.url+" "),_(O,c))}function a(c,s){var i=c.programDateTime;if(!i)return;var n=(i-s)/1e3;c.start=c.startPTS=n,c.endPTS=n+c.duration}function o(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=s.fragments[0].start,O=i-n*1e3;c.fragments.forEach(function(T){a(T,O)}),c.fragmentHint&&a(c.fragmentHint,O),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/ewma.ts"),P=function(){function k(I,r,M){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=M,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new G.default(I),this.fast_=new G.default(r)}var K=k.prototype;return K.update=function(r,M){var _=this.slow_,p=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new G.default(r,_.getEstimate(),_.getTotalWeight())),this.fast_.halfLife!==M&&(this.fast_=new G.default(M,p.getEstimate(),p.getTotalWeight()))},K.sample=function(r,M){r=Math.max(r,this.minDelayMs_);var _=8*M,p=r/1e3,m=_/p;this.fast_.sample(p,m),this.slow_.sample(p,m)},K.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},k}();V.default=P},"./src/utils/ewma.ts":function(Z,V,U){"use strict";U.r(V);var G=function(){function P(K,I,r){I===void 0&&(I=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=I,this.totalWeight_=r}var k=P.prototype;return k.sample=function(I,r){var M=Math.pow(this.alpha_,I);this.estimate_=r*(1-M)+M*this.estimate_,this.totalWeight_+=I},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var I=1-Math.pow(this.alpha_,this.totalWeight_);if(I)return this.estimate_/I}return this.estimate_},P}();V.default=G},"./src/utils/fetch-loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"fetchSupported",function(){return a});var G=U("./src/polyfills/number.ts"),P=U("./src/loader/load-stats.ts"),k=U("./src/demux/chunk-cache.ts");function K(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,p(n,O)}function I(n){var O=typeof Map=="function"?new Map:void 0;return I=function(C){if(C===null||!_(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(C))return O.get(C);O.set(C,R)}function R(){return r(C,arguments,m(this).constructor)}return R.prototype=Object.create(C.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),p(R,C)},I(n)}function r(n,O,T){return M()?r=Reflect.construct:r=function(R,S,v){var E=[null];E.push.apply(E,S);var f=Function.bind.apply(R,E),h=new f;return v&&p(h,v.prototype),h},r.apply(null,arguments)}function M(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function _(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function p(n,O){return p=Object.setPrototypeOf||function(C,R){return C.__proto__=R,C},p(n,O)}function m(n){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},m(n)}function u(){return u=Object.assign||function(n){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&(n[C]=T[C])}return n},u.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var o=function(){function n(T){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=T.fetchSetup||s,this.controller=new self.AbortController,this.stats=new P.LoadStats}var O=n.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var C=this.response;(!C||!C.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(C,R,S){var v=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var f=c(C,this.controller.signal),h=S.onProgress,y=C.responseType==="arraybuffer",g=y?"byteLength":"length";this.context=C,this.config=R,this.callbacks=S,this.request=this.fetchSetup(C,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),S.onTimeout(E,C,v.response)},R.timeout),self.fetch(this.request).then(function(x){if(v.response=v.loader=x,!x.ok){var j=x.status,B=x.statusText;throw new i(B||"fetch, bad network response",j,x)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(x.headers.get("Content-Length")||"0"),h&&Object(G.isFiniteNumber)(R.highWaterMark)?v.loadProgressively(x,E,C,R.highWaterMark,h):y?x.arrayBuffer():x.text()}).then(function(x){var j=v.response;self.clearTimeout(v.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=x[g];var B={url:j.url,data:x};h&&!Object(G.isFiniteNumber)(R.highWaterMark)&&h(E,C,x,j),S.onSuccess(B,E,C,j)}).catch(function(x){if(self.clearTimeout(v.requestTimeout),E.aborted)return;var j=x.code||0;S.onError({code:j,text:x.message},C,x.details)})},O.getCacheAge=function(){var C=null;if(this.response){var R=this.response.headers.get("age");C=R?parseFloat(R):null}return C},O.loadProgressively=function(C,R,S,v,E){v===void 0&&(v=0);var f=new k.default,h=C.body.getReader(),y=function g(){return h.read().then(function(x){if(x.done)return f.dataLength&&E(R,S,f.flush(),C),Promise.resolve(new ArrayBuffer(0));var j=x.value,B=j.length;return R.loaded+=B,B<v||f.dataLength?(f.push(j),f.dataLength>=v&&E(R,S,f.flush(),C)):E(R,S,j,C),g()}).catch(function(){return Promise.reject()})};return y()},n}();function c(n,O){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(u({},n.headers))};return n.rangeEnd&&T.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),T}function s(n,O){return new self.Request(n.url,O)}var i=function(n){K(O,n);function O(T,C,R){var S;return S=n.call(this,T)||this,S.code=void 0,S.details=void 0,S.code=C,S.details=R,S}return O}(I(Error));V.default=o},"./src/utils/imsc1-ttml-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"IMSC1_CODEC",function(){return _}),U.d(V,"parseIMSC1",function(){return a});var G=U("./src/utils/mp4-tools.ts"),P=U("./src/utils/vttparser.ts"),k=U("./src/utils/vttcue.ts"),K=U("./src/demux/id3.ts"),I=U("./src/utils/timescale-conversion.ts"),r=U("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(v){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(v[h]=f[h])}return v},M.apply(this,arguments)}var _="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(v,E,f,h,y){var g=Object(G.findBox)(new Uint8Array(v),["mdat"]);if(g.length===0){y(new Error("Could not parse IMSC1 mdat"));return}var x=g[0],j=Object(K.utf8ArrayToStr)(new Uint8Array(v,x.start,x.end-x.start)),B=Object(I.toTimescaleFromScale)(E,1,f);try{h(o(j,B))}catch(A){y(A)}}function o(v,E){var f=new DOMParser,h=f.parseFromString(v,"text/xml"),y=h.getElementsByTagName("tt")[0];if(!y)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(g).reduce(function(F,w){return F[w]=y.getAttribute("ttp:"+w)||g[w],F},{}),j=y.getAttribute("xml:space")!=="preserve",B=s(c(y,"styling","style")),A=s(c(y,"layout","region")),H=c(y,"body","[begin]");return[].map.call(H,function(F){var w=i(F,j);if(!w||!F.hasAttribute("begin"))return null;var Y=C(F.getAttribute("begin"),x),q=C(F.getAttribute("dur"),x),ie=C(F.getAttribute("end"),x);if(Y===null)throw T(F);if(ie===null){if(q===null)throw T(F);ie=Y+q}var ge=new k.default(Y-E,ie-E,w);ge.id=Object(r.generateCueId)(ge.startTime,ge.endTime,ge.text);var Je=A[F.getAttribute("region")],xe=B[F.getAttribute("style")];ge.position=10,ge.size=80;var ke=n(Je,xe),Qe=ke.textAlign;if(Qe){var Ye=u[Qe];Ye&&(ge.lineAlign=Ye),ge.align=Qe}return M(ge,ke),ge}).filter(function(F){return F!==null})}function c(v,E,f){var h=v.getElementsByTagName(E)[0];return h?[].slice.call(h.querySelectorAll(f)):[]}function s(v){return v.reduce(function(E,f){var h=f.getAttribute("xml:id");return h&&(E[h]=f),E},{})}function i(v,E){return[].slice.call(v.childNodes).reduce(function(f,h,y){var g;return h.nodeName==="br"&&y?f+`
`:(g=h.childNodes)!==null&&g!==void 0&&g.length?i(h,E):E?f+h.textContent.trim().replace(/\s+/g," "):f+h.textContent},"")}function n(v,E){var f="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(y,g){var x=O(E,f,g)||O(v,f,g);return x&&(y[g]=x),y},{})}function O(v,E,f){return v.hasAttributeNS(E,f)?v.getAttributeNS(E,f):null}function T(v){return new Error("Could not parse ttml timestamp "+v)}function C(v,E){if(!v)return null;var f=Object(P.parseTimeStamp)(v);return f===null&&(p.test(v)?f=R(v,E):m.test(v)&&(f=S(v,E))),f}function R(v,E){var f=p.exec(v),h=(f[4]|0)+(f[5]|0)/E.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+h/E.frameRate}function S(v,E){var f=m.exec(v),h=Number(f[1]),y=f[2];switch(y){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/E.frameRate;case"t":return h/E.tickRate}return h}},"./src/utils/logger.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"enableLogs",function(){return r}),U.d(V,"logger",function(){return M});var G=function(){},P={trace:G,debug:G,log:G,warn:G,info:G,error:G},k=P;function K(_){var p=self.console[_];return p?p.bind(self.console,"["+_+"] >"):G}function I(_){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];m.forEach(function(a){k[a]=_[a]?_[a].bind(_):K(a)})}function r(_){if(self.console&&_===!0||typeof _=="object"){I(_,"debug","log","info","warn","error");try{k.log()}catch(p){k=P}}else k=P}var M=k},"./src/utils/mediakeys-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"KeySystems",function(){return G}),U.d(V,"requestMediaKeySystemAccess",function(){return P});var G;(function(k){k.WIDEVINE="com.widevine.alpha",k.PLAYREADY="com.microsoft.playready"})(G||(G={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"bin2str",function(){return I}),U.d(V,"readUint16",function(){return r}),U.d(V,"readUint32",function(){return M}),U.d(V,"writeUint32",function(){return _}),U.d(V,"findBox",function(){return p}),U.d(V,"parseSegmentIndex",function(){return m}),U.d(V,"parseInitSegment",function(){return u}),U.d(V,"getStartDTS",function(){return a}),U.d(V,"getDuration",function(){return o}),U.d(V,"computeRawDurationFromSamples",function(){return c}),U.d(V,"offsetStartDTS",function(){return s}),U.d(V,"segmentValidRange",function(){return i}),U.d(V,"appendUint8Array",function(){return n});var G=U("./src/utils/typed-array.ts"),P=U("./src/loader/fragment.ts"),k=Math.pow(2,32)-1,K=[].push;function I(O){return String.fromCharCode.apply(null,O)}function r(O,T){"data"in O&&(T+=O.start,O=O.data);var C=O[T]<<8|O[T+1];return C<0?65536+C:C}function M(O,T){"data"in O&&(T+=O.start,O=O.data);var C=O[T]<<24|O[T+1]<<16|O[T+2]<<8|O[T+3];return C<0?4294967296+C:C}function _(O,T,C){"data"in O&&(T+=O.start,O=O.data),O[T]=C>>24,O[T+1]=C>>16&255,O[T+2]=C>>8&255,O[T+3]=C&255}function p(O,T){var C=[];if(!T.length)return C;var R,S,v;"data"in O?(R=O.data,S=O.start,v=O.end):(R=O,S=0,v=R.byteLength);for(var E=S;E<v;){var f=M(R,E),h=I(R.subarray(E+4,E+8)),y=f>1?E+f:v;if(h===T[0])if(T.length===1)C.push({data:R,start:E+8,end:y});else{var g=p({data:R,start:E+8,end:y},T.slice(1));g.length&&K.apply(C,g)}E=y}return C}function m(O){var T=p(O,["moov"]),C=T[0],R=C?C.end:null,S=p(O,["sidx"]);if(!S||!S[0])return null;var v=[],E=S[0],f=E.data[0],h=f===0?8:16,y=M(E,h);h+=4;var g=0,x=0;f===0?h+=8:h+=16,h+=2;var j=E.end+x,B=r(E,h);h+=2;for(var A=0;A<B;A++){var H=h,F=M(E,H);H+=4;var w=F&2147483647,Y=(F&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var q=M(E,H);H+=4,v.push({referenceSize:w,subsegmentDuration:q,info:{duration:q/y,start:j,end:j+w-1}}),j+=w,H+=4,h=H}return{earliestPresentationTime:g,timescale:y,version:f,referencesCount:B,references:v,moovEndOffset:R}}function u(O){for(var T=[],C=p(O,["moov","trak"]),R=0;R<C.length;R++){var S=C[R],v=p(S,["tkhd"])[0];if(v){var E=v.data[v.start],f=E===0?12:20,h=M(v,f),y=p(S,["mdia","mdhd"])[0];if(y){E=y.data[y.start],f=E===0?12:20;var g=M(y,f),x=p(S,["mdia","hdlr"])[0];if(x){var j=I(x.data.subarray(x.start+8,x.start+12)),B={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[j];if(B){var A=p(S,["mdia","minf","stbl","stsd"])[0],H=void 0;A&&(H=I(A.data.subarray(A.start+12,A.start+16))),T[h]={timescale:g,type:B},T[B]={timescale:g,id:h,codec:H}}}}}}var F=p(O,["moov","mvex","trex"]);return F.forEach(function(w){var Y=M(w,4),q=T[Y];q&&(q.default={duration:M(w,12),flags:M(w,20)})}),T}function a(O,T){return p(T,["moof","traf"]).reduce(function(C,R){var S=p(R,["tfdt"])[0],v=S.data[S.start],E=p(R,["tfhd"]).reduce(function(f,h){var y=M(h,4),g=O[y];if(g){var x=M(S,4);v===1&&(x*=Math.pow(2,32),x+=M(S,8));var j=g.timescale||9e4,B=x/j;if(isFinite(B)&&(f===null||B<f))return B}return f},null);return E!==null&&isFinite(E)&&(C===null||E<C)?E:C},null)||0}function o(O,T){for(var C=0,R=0,S=0,v=p(O,["moof","traf"]),E=0;E<v.length;E++){var f=v[E],h=p(f,["tfhd"])[0],y=M(h,4),g=T[y];if(!g)continue;var x=g.default,j=M(h,0)|(x==null?void 0:x.flags),B=x==null?void 0:x.duration;j&8&&(j&2?B=M(h,12):B=M(h,8));for(var A=g.timescale||9e4,H=p(f,["trun"]),F=0;F<H.length;F++){if(B){var w=M(H[F],4);C=B*w}else C=c(H[F]);g.type===P.ElementaryStreamTypes.VIDEO?R+=C/A:g.type===P.ElementaryStreamTypes.AUDIO&&(S+=C/A)}}if(R===0&&S===0){var Y=m(O);if(Y!=null&&Y.references)return Y.references.reduce(function(q,ie){return q+ie.info.duration||0},0)}return R||S}function c(O){var T=M(O,0),C=8;T&1&&(C+=4),T&4&&(C+=4);for(var R=0,S=M(O,4),v=0;v<S;v++){if(T&256){var E=M(O,C);R+=E,C+=4}T&512&&(C+=4),T&1024&&(C+=4),T&2048&&(C+=4)}return R}function s(O,T,C){p(T,["moof","traf"]).forEach(function(R){p(R,["tfhd"]).forEach(function(S){var v=M(S,4),E=O[v];if(!E)return;var f=E.timescale||9e4;p(R,["tfdt"]).forEach(function(h){var y=h.data[h.start],g=M(h,4);if(y===0)_(h,4,g-C*f);else{g*=Math.pow(2,32),g+=M(h,8),g-=C*f,g=Math.max(g,0);var x=Math.floor(g/(k+1)),j=Math.floor(g%(k+1));_(h,4,x),_(h,8,j)}})})})}function i(O){var T={valid:null,remainder:null},C=p(O,["moof"]);if(C){if(C.length<2)return T.remainder=O,T}else return T;var R=C[C.length-1];return T.valid=Object(G.sliceUint8)(O,0,R.start-8),T.remainder=Object(G.sliceUint8)(O,R.start-8),T}function n(O,T){var C=new Uint8Array(O.length+T.length);return C.set(O),C.set(T,O.length),C}},"./src/utils/output-filter.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(K,I){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=I}var k=P.prototype;return k.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},k.newCue=function(I,r,M){(this.startTime===null||this.startTime>I)&&(this.startTime=I),this.endTime=r,this.screen=M,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"sendAddTrackEvent",function(){return P}),U.d(V,"addCueToTrack",function(){return k}),U.d(V,"clearCurrentCues",function(){return K}),U.d(V,"removeCuesInRange",function(){return I}),U.d(V,"getCuesInRange",function(){return M});var G=U("./src/utils/logger.ts");function P(_,p){var m;try{m=new Event("addtrack")}catch(u){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=_,p.dispatchEvent(m)}function k(_,p){var m=_.mode;if(m==="disabled"&&(_.mode="hidden"),_.cues&&!_.cues.getCueById(p.id))try{if(_.addCue(p),!_.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(a){G.logger.debug("[texttrack-utils]: "+a);var u=new self.TextTrackCue(p.startTime,p.endTime,p.text);u.id=p.id,_.addCue(u)}m==="disabled"&&(_.mode=m)}function K(_){var p=_.mode;if(p==="disabled"&&(_.mode="hidden"),_.cues)for(var m=_.cues.length;m--;)_.removeCue(_.cues[m]);p==="disabled"&&(_.mode=p)}function I(_,p,m){var u=_.mode;if(u==="disabled"&&(_.mode="hidden"),_.cues&&_.cues.length>0)for(var a=M(_.cues,p,m),o=0;o<a.length;o++)_.removeCue(a[o]);u==="disabled"&&(_.mode=u)}function r(_,p){if(p<_[0].startTime)return 0;var m=_.length-1;if(p>_[m].endTime)return-1;for(var u=0,a=m;u<=a;){var o=Math.floor((a+u)/2);if(p<_[o].startTime)a=o-1;else if(p>_[o].startTime&&u<m)u=o+1;else return o}return _[u].startTime-p<p-_[a].startTime?u:a}function M(_,p,m){var u=[],a=r(_,p);if(a>-1)for(var o=a,c=_.length;o<c;o++){var s=_[o];if(s.startTime>=p&&s.endTime<=m)u.push(s);else if(s.startTime>m)return u}return u}},"./src/utils/time-ranges.ts":function(Z,V,U){"use strict";U.r(V);var G={toString:function(k){for(var K="",I=k.length,r=0;r<I;r++)K+="["+k.start(r).toFixed(3)+","+k.end(r).toFixed(3)+"]";return K}};V.default=G},"./src/utils/timescale-conversion.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"toTimescaleFromBase",function(){return P}),U.d(V,"toTimescaleFromScale",function(){return k}),U.d(V,"toMsFromMpegTsClock",function(){return K}),U.d(V,"toMpegTsClockFromTimescale",function(){return I});var G=9e4;function P(r,M,_,p){_===void 0&&(_=1),p===void 0&&(p=!1);var m=r*M*_;return p?Math.round(m):m}function k(r,M,_,p){return _===void 0&&(_=1),p===void 0&&(p=!1),P(r,M,1/_,p)}function K(r,M){return M===void 0&&(M=!1),P(r,1e3,1/G,M)}function I(r,M){return M===void 0&&(M=1),P(r,G,1/M)}},"./src/utils/typed-array.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"sliceUint8",function(){return G});function G(P,k,K){return Uint8Array.prototype.slice?P.slice(k,K):new Uint8Array(Array.prototype.slice.call(P,k,K))}},"./src/utils/vttcue.ts":function(Z,V,U){"use strict";U.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var G=["","lr","rl"],P=["start","middle","end","left","right"];function k(_,p){if(typeof p!="string")return!1;if(!Array.isArray(_))return!1;var m=p.toLowerCase();return~_.indexOf(m)?m:!1}function K(_){return k(G,_)}function I(_){return k(P,_)}function r(_){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];for(var a=1;a<arguments.length;a++){var o=arguments[a];for(var c in o)_[c]=o[c]}return _}function M(_,p,m){var u=this,a={enumerable:!0};u.hasBeenReset=!1;var o="",c=!1,s=_,i=p,n=m,O=null,T="",C=!0,R="auto",S="start",v=50,E="middle",f=50,h="middle";Object.defineProperty(u,"id",r({},a,{get:function(){return o},set:function(g){o=""+g}})),Object.defineProperty(u,"pauseOnExit",r({},a,{get:function(){return c},set:function(g){c=!!g}})),Object.defineProperty(u,"startTime",r({},a,{get:function(){return s},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");s=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",r({},a,{get:function(){return i},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");i=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",r({},a,{get:function(){return n},set:function(g){n=""+g,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",r({},a,{get:function(){return O},set:function(g){O=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",r({},a,{get:function(){return T},set:function(g){var x=K(g);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",r({},a,{get:function(){return C},set:function(g){C=!!g,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",r({},a,{get:function(){return R},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",r({},a,{get:function(){return S},set:function(g){var x=I(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");S=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",r({},a,{get:function(){return v},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");v=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",r({},a,{get:function(){return E},set:function(g){var x=I(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");E=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",r({},a,{get:function(){return f},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");f=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",r({},a,{get:function(){return h},set:function(g){var x=I(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");h=x,this.hasBeenReset=!0}})),u.displayState=void 0}return M.prototype.getCueAsHTML=function(){var _=self.WebVTT;return _.convertCueToDOMTree(self,this.text)},M}()},"./src/utils/vttparser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"parseTimeStamp",function(){return k}),U.d(V,"fixLineBreaks",function(){return p}),U.d(V,"VTTParser",function(){return m});var G=U("./src/utils/vttcue.ts"),P=function(){function u(){}var a=u.prototype;return a.decode=function(c,s){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},u}();function k(u){function a(c,s,i,n){return(c|0)*3600+(s|0)*60+(i|0)+parseFloat(n||0)}var o=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?a(o[2],o[3],0,o[4]):a(o[1],o[2],o[3],o[4]):null}var K=function(){function u(){this.values=Object.create(null)}var a=u.prototype;return a.set=function(c,s){!this.get(c)&&s!==""&&(this.values[c]=s)},a.get=function(c,s,i){return i?this.has(c)?this.values[c]:s[i]:this.has(c)?this.values[c]:s},a.has=function(c){return c in this.values},a.alt=function(c,s,i){for(var n=0;n<i.length;++n)if(s===i[n]){this.set(c,s);break}},a.integer=function(c,s){/^-?\d+$/.test(s)&&this.set(c,parseInt(s,10))},a.percent=function(c,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var i=parseFloat(s);if(i>=0&&i<=100)return this.set(c,i),!0}return!1},u}();function I(u,a,o,c){var s=c?u.split(c):[u];for(var i in s){if(typeof s[i]!="string")continue;var n=s[i].split(o);if(n.length!==2)continue;var O=n[0],T=n[1];a(O,T)}}var r=new G.default(0,0,""),M=r.align==="middle"?"middle":"center";function _(u,a,o){var c=u;function s(){var O=k(u);if(O===null)throw new Error("Malformed timestamp: "+c);return u=u.replace(/^[^\sa-zA-Z-]+/,""),O}function i(O,T){var C=new K;I(O,function(v,E){var f;switch(v){case"region":for(var h=o.length-1;h>=0;h--)if(o[h].id===E){C.set(v,o[h].region);break}break;case"vertical":C.alt(v,E,["rl","lr"]);break;case"line":f=E.split(","),C.integer(v,f[0]),C.percent(v,f[0])&&C.set("snapToLines",!1),C.alt(v,f[0],["auto"]),f.length===2&&C.alt("lineAlign",f[1],["start",M,"end"]);break;case"position":f=E.split(","),C.percent(v,f[0]),f.length===2&&C.alt("positionAlign",f[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":C.percent(v,E);break;case"align":C.alt(v,E,["start",M,"end","left","right"]);break}},/:/,/\s/),T.region=C.get("region",null),T.vertical=C.get("vertical","");var R=C.get("line","auto");R==="auto"&&r.line===-1&&(R=-1),T.line=R,T.lineAlign=C.get("lineAlign","start"),T.snapToLines=C.get("snapToLines",!0),T.size=C.get("size",100),T.align=C.get("align",M);var S=C.get("position","auto");S==="auto"&&r.position===50&&(S=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=S}function n(){u=u.replace(/^\s+/,"")}if(n(),a.startTime=s(),n(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);u=u.substr(3),n(),a.endTime=s(),n(),i(u,a)}function p(u){return u.replace(/<br(?: \/)?>/gi,`
`)}var m=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=u.prototype;return a.parse=function(c){var s=this;c&&(s.buffer+=s.decoder.decode(c,{stream:!0}));function i(){var S=s.buffer,v=0;for(S=p(S);v<S.length&&S[v]!=="\r"&&S[v]!==`
`;)++v;var E=S.substr(0,v);return S[v]==="\r"&&++v,S[v]===`
`&&++v,s.buffer=S.substr(v),E}function n(S){I(S,function(v,E){},/:/)}try{var O="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;O=i();var T=O.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var C=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;C?C=!1:O=i();switch(s.state){case"HEADER":/:/.test(O)?n(O):O||(s.state="ID");continue;case"NOTE":O||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){s.state="NOTE";break}if(!O)continue;if(s.cue=new G.default(0,0,""),s.state="CUE",O.indexOf("-->")===-1){s.cue.id=O;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{_(O,s.cue,s.regionList)}catch(S){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var R=O.indexOf("-->")!==-1;if(!O||R&&(C=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=`
`),s.cue.text+=O}continue;case"BADCUE":O||(s.state="ID")}}}catch(S){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=`
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){c.onparsingerror&&c.onparsingerror(s)}return c.onflush&&c.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"generateCueId",function(){return m}),U.d(V,"parseWebVTT",function(){return a});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/vttparser.ts"),k=U("./src/demux/id3.ts"),K=U("./src/utils/timescale-conversion.ts"),I=U("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,M=function(c,s,i){return i===void 0&&(i=0),c.substr(i,s.length)===s},_=function(c){var s=parseInt(c.substr(-3)),i=parseInt(c.substr(-6,2)),n=parseInt(c.substr(-9,2)),O=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(G.isFiniteNumber)(s)||!Object(G.isFiniteNumber)(i)||!Object(G.isFiniteNumber)(n)||!Object(G.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return s+=1e3*i,s+=60*1e3*n,s+=60*60*1e3*O,s},p=function(c){for(var s=5381,i=c.length;i;)s=s*33^c.charCodeAt(--i);return(s>>>0).toString()};function m(o,c,s){return p(o.toString())+p(c.toString())+p(s)}var u=function(c,s,i){var n=c[s],O=c[n.prevCC];if(!O||!O.new&&n.new){c.ccOffset=c.presentationOffset=n.start,n.new=!1;return}for(;(T=O)!==null&&T!==void 0&&T.new;){var T;c.ccOffset+=n.start-O.start,n.new=!1,n=O,O=c[n.prevCC]}c.presentationOffset=i};function a(o,c,s,i,n,O,T,C){var R=new P.VTTParser,S=Object(k.utf8ArrayToStr)(new Uint8Array(o)).trim().replace(r,`
`).split(`
`),v=[],E=Object(K.toMpegTsClockFromTimescale)(c,s),f="00:00.000",h=0,y=0,g,x=!0,j=!1;R.oncue=function(B){var A=i[n],H=i.ccOffset,F=(h-E)/9e4;if(A!=null&&A.new&&(y!==void 0?H=i.ccOffset=A.start:u(i,n,F)),F&&(H=F-i.presentationOffset),j){var w=B.endTime-B.startTime,Y=Object(I.normalizePts)((B.startTime+H-y)*9e4,O*9e4)/9e4;B.startTime=Y,B.endTime=Y+w}var q=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(q)),B.id||(B.id=m(B.startTime,B.endTime,q)),B.endTime>0&&v.push(B)},R.onparsingerror=function(B){g=B},R.onflush=function(){if(g){C(g);return}T(v)},S.forEach(function(B){if(x)if(M(B,"X-TIMESTAMP-MAP=")){x=!1,j=!0,B.substr(16).split(",").forEach(function(A){M(A,"LOCAL:")?f=A.substr(6):M(A,"MPEGTS:")&&(h=parseInt(A.substr(7)))});try{y=_(f)/1e3}catch(A){j=!1,g=A}return}else B===""&&(x=!1);R.parse(B+`
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/logger.ts"),P=U("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,K=function(){function I(M){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=M?M.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var r=I.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var _=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),_&&(_.onreadystatechange=null,_.onprogress=null,_.readyState!==4&&(this.stats.aborted=!0,_.abort()))},r.abort=function(){var _;this.abortInternal(),(_=this.callbacks)!==null&&_!==void 0&&_.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(_,p,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=_,this.config=p,this.callbacks=m,this.retryDelay=p.retryDelay,this.loadInternal()},r.loadInternal=function(){var _=this.config,p=this.context;if(!_)return;var m=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var a=this.xhrSetup;try{if(a)try{a(m,p.url)}catch(s){m.open("GET",p.url,!0),a(m,p.url)}m.readyState||m.open("GET",p.url,!0);var o=this.context.headers;if(o)for(var c in o)m.setRequestHeader(c,o[c])}catch(s){this.callbacks.onError({code:m.status,text:s.message},p,m);return}p.rangeEnd&&m.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),_.timeout),m.send()},r.readystatechange=function(){var _=this.context,p=this.loader,m=this.stats;if(!_||!p)return;var u=p.readyState,a=this.config;if(m.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),u===4){p.onreadystatechange=null,p.onprogress=null;var o=p.status;if(o>=200&&o<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var c,s;if(_.responseType==="arraybuffer"?(c=p.response,s=c.byteLength):(c=p.responseText,s=c.length),m.loaded=m.total=s,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(m,_,c,p),!this.callbacks)return;var n={url:p.responseURL,data:c};this.callbacks.onSuccess(n,m,_,p)}else m.retry>=a.maxRetry||o>=400&&o<499?(G.logger.error(o+" while loading "+_.url),this.callbacks.onError({code:o,text:p.statusText},_,p)):(G.logger.warn(o+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},r.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var _=this.callbacks;_&&(this.abortInternal(),_.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(_){var p=this.stats;p.loaded=_.loaded,_.lengthComputable&&(p.total=_.total)},r.getCacheAge=function(){var _=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");_=p?parseFloat(p):null}return _},I}();V.default=K}}).default})},vHTk:function(Gt,he,D){Gt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Gt,he,D){"use strict";D.d(he,"a",function(){return en});var Z=D("rePB"),V=D("VTBJ"),U=D("KQm4"),G=D("U8pU"),P=D("ODXe"),k=D("q1tI"),K=D("TSYQ"),I=D.n(K),r=D("Gytx"),M=D.n(r),_=D("Kwbf"),p=D("t23M"),m=D("qx4F"),u=D("6eGT"),a=D("IBYe"),o=D("Ff2n"),c=D("c+Xe"),s=D("fyJ8"),i=D("biw7");function n(We,Fe,yt,At,nt){var st=yt[We]||{},De=yt[Fe]||{},ye,we;st.fixed==="left"?ye=At.left[We]:De.fixed==="right"&&(we=At.right[Fe]);var ae=!1,se=!1,pe=!1,_e=!1,be=yt[Fe+1],Ke=yt[We-1];if(nt==="rtl"){if(ye!==void 0){var Ot=Ke&&Ke.fixed==="left";_e=!Ot}else if(we!==void 0){var rn=be&&be.fixed==="right";pe=!rn}}else if(ye!==void 0){var Dn=be&&be.fixed==="left";ae=!Dn}else if(we!==void 0){var bt=Ke&&Ke.fixed==="right";se=!bt}return{fixLeft:ye,fixRight:we,lastFixLeft:ae,firstFixRight:se,lastFixRight:pe,firstFixLeft:_e,isSticky:At.isSticky}}var O=D("sR1s");function T(We){var Fe=We.cells,yt=We.stickyOffsets,At=We.flattenColumns,nt=We.rowComponent,st=We.cellComponent,De=We.onHeaderRow,ye=We.index,we=k.useContext(i.a),ae=we.prefixCls,se=we.direction,pe;De&&(pe=De(Fe.map(function(be){return be.column}),ye));var _e=Object(O.a)(Fe.map(function(be){return be.column}));return k.createElement(nt,Object.assign({},pe),Fe.map(function(be,Ke){var Ot=be.column,rn=n(be.colStart,be.colEnd,At,yt,se),Dn;return Ot&&Ot.onHeaderCell&&(Dn=be.column.onHeaderCell(Ot)),k.createElement(s.a,Object.assign({},be,{ellipsis:Ot.ellipsis,align:Ot.align,component:st,prefixCls:ae,key:_e[Ke]},rn,{additionalProps:Dn,rowType:"header"}))}))}T.displayName="HeaderRow";var C=T;function R(We){var Fe=[];function yt(De,ye){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Fe[we]=Fe[we]||[];var ae=ye,se=De.filter(Boolean).map(function(pe){var _e={key:pe.key,className:pe.className||"",children:pe.title,column:pe,colStart:ae},be=1,Ke=pe.children;return Ke&&Ke.length>0&&(be=yt(Ke,ae,we+1).reduce(function(Ot,rn){return Ot+rn},0),_e.hasSubColumns=!0),"colSpan"in pe&&(be=pe.colSpan),"rowSpan"in pe&&(_e.rowSpan=pe.rowSpan),_e.colSpan=be,_e.colEnd=_e.colStart+be-1,Fe[we].push(_e),ae+=be,be});return se}yt(We,0);for(var At=Fe.length,nt=function(ye){Fe[ye].forEach(function(we){!("rowSpan"in we)&&!we.hasSubColumns&&(we.rowSpan=At-ye)})},st=0;st<At;st+=1)nt(st);return Fe}function S(We){var Fe=We.stickyOffsets,yt=We.columns,At=We.flattenColumns,nt=We.onHeaderRow,st=k.useContext(i.a),De=st.prefixCls,ye=st.getComponent,we=k.useMemo(function(){return R(yt)},[yt]),ae=ye(["header","wrapper"],"thead"),se=ye(["header","row"],"tr"),pe=ye(["header","cell"],"th");return k.createElement(ae,{className:"".concat(De,"-thead")},we.map(function(_e,be){var Ke=k.createElement(C,{key:be,flattenColumns:At,cells:_e,stickyOffsets:Fe,rowComponent:se,cellComponent:pe,onHeaderRow:nt,index:be});return Ke}))}var v=S,E=D("hW8S");function f(We){for(var Fe=We.colWidths,yt=We.columns,At=We.columCount,nt=[],st=At||yt.length,De=!1,ye=st-1;ye>=0;ye-=1){var we=Fe[ye],ae=yt&&yt[ye],se=ae&&ae[E.a];(we||se||De)&&(nt.unshift(k.createElement("col",Object.assign({key:ye,style:{width:we,minWidth:we}},se))),De=!0)}return k.createElement("colgroup",null,nt)}var h=f;function y(We,Fe){return Object(k.useMemo)(function(){for(var yt=[],At=0;At<Fe;At+=1){var nt=We[At];if(nt!==void 0)yt[At]=nt;else return null}return yt},[We.join("_"),Fe])}var g=k.forwardRef(function(We,Fe){var yt=We.noData,At=We.columns,nt=We.flattenColumns,st=We.colWidths,De=We.columCount,ye=We.stickyOffsets,we=We.direction,ae=We.fixHeader,se=We.offsetHeader,pe=We.stickyClassName,_e=We.onScroll,be=Object(o.a)(We,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ke=k.useContext(i.a),Ot=Ke.prefixCls,rn=Ke.scrollbarSize,Dn=Ke.isSticky,bt=Dn&&!ae?0:rn,Qt=k.useRef(null),Et=k.useCallback(function(Zt){Object(c.b)(Fe,Zt),Object(c.b)(Qt,Zt)},[]);k.useEffect(function(){var Zt;function un(Le){var et=Le.currentTarget,mt=Le.deltaX;mt&&(_e({currentTarget:et,scrollLeft:et.scrollLeft+mt}),Le.preventDefault())}return(Zt=Qt.current)===null||Zt===void 0||Zt.addEventListener("wheel",un),function(){var Le;(Le=Qt.current)===null||Le===void 0||Le.removeEventListener("wheel",un)}},[]);var Ct=nt[nt.length-1],lt={fixed:Ct?Ct.fixed:null,onHeaderCell:function(){return{className:"".concat(Ot,"-cell-scrollbar")}}},de=Object(k.useMemo)(function(){return bt?[].concat(Object(U.a)(At),[lt]):At},[bt,At]),Ae=Object(k.useMemo)(function(){return bt?[].concat(Object(U.a)(nt),[lt]):nt},[bt,nt]),kt=Object(k.useMemo)(function(){var Zt=ye.right,un=ye.left;return Object(V.a)(Object(V.a)({},ye),{},{left:we==="rtl"?[].concat(Object(U.a)(un.map(function(Le){return Le+bt})),[0]):un,right:we==="rtl"?Zt:[].concat(Object(U.a)(Zt.map(function(Le){return Le+bt})),[0]),isSticky:Dn})},[bt,ye,Dn]),dt=y(st,De);return k.createElement("div",{style:Object(V.a)({overflow:"hidden"},Dn?{top:se}:{}),ref:Et,className:I()("".concat(Ot,"-header"),Object(Z.a)({},pe,!!pe))},k.createElement("table",{style:{tableLayout:"fixed",visibility:yt||dt?null:"hidden"}},k.createElement(h,{colWidths:dt?[].concat(Object(U.a)(dt),[bt]):[],columCount:De+1,columns:Ae}),k.createElement(v,Object.assign({},be,{stickyOffsets:kt,columns:de,flattenColumns:Ae}))))});g.displayName="FixedHeader";var x=g,j=k.createContext(null),B=j;function A(We){var Fe=We.prefixCls,yt=We.children,At=We.component,nt=We.cellComponent,st=We.fixHeader,De=We.fixColumn,ye=We.horizonScroll,we=We.className,ae=We.expanded,se=We.componentWidth,pe=We.colSpan,_e=k.useContext(i.a),be=_e.scrollbarSize;return k.useMemo(function(){var Ke=yt;return De&&(Ke=k.createElement("div",{style:{width:se-(st?be:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Fe,"-expanded-row-fixed")},Ke)),k.createElement(At,{className:we,style:{display:ae?null:"none"}},k.createElement(s.a,{component:nt,prefixCls:Fe,colSpan:pe},Ke))},[yt,At,st,ye,we,ae,se,pe,be])}var H=A;function F(We){var Fe=We.className,yt=We.style,At=We.record,nt=We.index,st=We.rowKey,De=We.getRowKey,ye=We.rowExpandable,we=We.expandedKeys,ae=We.onRow,se=We.indent,pe=se===void 0?0:se,_e=We.rowComponent,be=We.cellComponent,Ke=We.childrenColumnName,Ot=k.useContext(i.a),rn=Ot.prefixCls,Dn=Ot.fixedInfoList,bt=k.useContext(B),Qt=bt.fixHeader,Et=bt.fixColumn,Ct=bt.horizonScroll,lt=bt.componentWidth,de=bt.flattenColumns,Ae=bt.expandableType,kt=bt.expandRowByClick,dt=bt.onTriggerExpand,Zt=bt.rowClassName,un=bt.expandedRowClassName,Le=bt.indentSize,et=bt.expandIcon,mt=bt.expandedRowRender,Ht=bt.expandIconColumnIndex,sn=k.useState(!1),yn=Object(P.a)(sn,2),nr=yn[0],Kn=yn[1],Cn=we&&we.has(We.recordKey);k.useEffect(function(){Cn&&Kn(!0)},[Cn]);var br=Ae==="row"&&(!ye||ye(At)),Er=Ae==="nest",rr=Ke&&At&&At[Ke],cr=br||Er,Pr;ae&&(Pr=ae(At,nt));var Kr=function(L){if(kt&&cr&&dt(At,L),Pr&&Pr.onClick){for(var N,z=arguments.length,ne=new Array(z>1?z-1:0),J=1;J<z;J++)ne[J-1]=arguments[J];(N=Pr).onClick.apply(N,[L].concat(ne))}},hi;typeof Zt=="string"?hi=Zt:typeof Zt=="function"&&(hi=Zt(At,nt,pe));var pn=Object(O.a)(de),or=k.createElement(_e,Object.assign({},Pr,{"data-row-key":st,className:I()(Fe,"".concat(rn,"-row"),"".concat(rn,"-row-level-").concat(pe),hi,Pr&&Pr.className),style:Object(V.a)(Object(V.a)({},yt),Pr?Pr.style:null),onClick:Kr}),de.map(function(X,L){var N=X.render,z=X.dataIndex,ne=X.className,J=pn[L],je=Dn[L],$t;L===(Ht||0)&&Er&&($t=k.createElement(k.Fragment,null,k.createElement("span",{style:{paddingLeft:"".concat(Le*pe,"px")},className:"".concat(rn,"-row-indent indent-level-").concat(pe)}),et({prefixCls:rn,expanded:Cn,expandable:rr,record:At,onExpand:dt})));var In;return X.onCell&&(In=X.onCell(At,nt)),k.createElement(s.a,Object.assign({className:ne,ellipsis:X.ellipsis,align:X.align,component:be,prefixCls:rn,key:J,record:At,index:nt,dataIndex:z,render:N,shouldCellUpdate:X.shouldCellUpdate},je,{appendNode:$t,additionalProps:In}))})),mi;if(br&&(nr||Cn)){var wi=mt(At,nt,pe+1,Cn),ti=un&&un(At,nt,pe);mi=k.createElement(H,{expanded:Cn,className:I()("".concat(rn,"-expanded-row"),"".concat(rn,"-expanded-row-level-").concat(pe+1),ti),prefixCls:rn,fixHeader:Qt,fixColumn:Et,horizonScroll:Ct,component:_e,componentWidth:lt,cellComponent:be,colSpan:de.length},wi)}var ni;return rr&&Cn&&(ni=(At[Ke]||[]).map(function(X,L){var N=De(X,L);return k.createElement(F,Object.assign({},We,{key:N,rowKey:N,record:X,recordKey:N,index:L,indent:pe+1}))})),k.createElement(k.Fragment,null,or,mi,ni)}F.displayName="BodyRow";var w=F,Y=k.createContext(null),q=Y;function ie(We){var Fe=We.columnKey,yt=We.onColumnResize,At=k.useRef();return k.useEffect(function(){At.current&&yt(Fe,At.current.offsetWidth)},[]),k.createElement(p.a,{onResize:function(st){var De=st.offsetWidth;yt(Fe,De)}},k.createElement("td",{ref:At,style:{padding:0,border:0,height:0}},k.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ge(We){var Fe=We.data,yt=We.getRowKey,At=We.measureColumnWidth,nt=We.expandedKeys,st=We.onRow,De=We.rowExpandable,ye=We.emptyNode,we=We.childrenColumnName,ae=k.useContext(q),se=ae.onColumnResize,pe=k.useContext(i.a),_e=pe.prefixCls,be=pe.getComponent,Ke=k.useContext(B),Ot=Ke.fixHeader,rn=Ke.horizonScroll,Dn=Ke.flattenColumns,bt=Ke.componentWidth;return k.useMemo(function(){var Qt=be(["body","wrapper"],"tbody"),Et=be(["body","row"],"tr"),Ct=be(["body","cell"],"td"),lt;Fe.length?lt=Fe.map(function(Ae,kt){var dt=yt(Ae,kt);return k.createElement(w,{key:dt,rowKey:dt,record:Ae,recordKey:dt,index:kt,rowComponent:Et,cellComponent:Ct,expandedKeys:nt,onRow:st,getRowKey:yt,rowExpandable:De,childrenColumnName:we})}):lt=k.createElement(H,{expanded:!0,className:"".concat(_e,"-placeholder"),prefixCls:_e,fixHeader:Ot,fixColumn:rn,horizonScroll:rn,component:Et,componentWidth:bt,cellComponent:Ct,colSpan:Dn.length},ye);var de=Object(O.a)(Dn);return k.createElement(Qt,{className:"".concat(_e,"-tbody")},At&&k.createElement("tr",{"aria-hidden":"true",className:"".concat(_e,"-measure-row"),style:{height:0}},de.map(function(Ae){return k.createElement(ie,{key:Ae,columnKey:Ae,onColumnResize:se})})),lt)},[Fe,_e,st,At,nt,yt,be,bt,ye,Dn])}var Je=k.memo(ge);Je.displayName="Body";var xe=Je,ke=D("wRmb"),Qe=D("xEkU"),Ye=D.n(Qe);function ve(We){var Fe=Object(k.useRef)(We),yt=Object(k.useState)({}),At=Object(P.a)(yt,2),nt=At[1],st=Object(k.useRef)(null),De=Object(k.useRef)([]);function ye(we){st.current===null&&(De.current=[],st.current=Ye()(function(){De.current.forEach(function(ae){Fe.current=ae(Fe.current)}),st.current=null,nt({})})),De.current.push(we)}return Object(k.useEffect)(function(){return function(){Ye.a.cancel(st.current)}},[]),[Fe.current,ye]}function fe(We){var Fe=Object(k.useRef)(We),yt=Object(k.useRef)(null);function At(){window.clearTimeout(yt.current)}function nt(De){Fe.current=De,At(),yt.current=window.setTimeout(function(){Fe.current=null,yt.current=null},100)}function st(){return Fe.current}return Object(k.useEffect)(function(){return At},[]),[nt,st]}function at(We,Fe,yt){var At=Object(k.useMemo)(function(){for(var nt=[],st=[],De=0,ye=0,we=0;we<Fe;we+=1)if(yt==="rtl"){st[we]=ye,ye+=We[we]||0;var ae=Fe-we-1;nt[ae]=De,De+=We[ae]||0}else{nt[we]=De,De+=We[we]||0;var se=Fe-we-1;st[se]=ye,ye+=We[se]||0}return{left:nt,right:st}},[We,Fe,yt]);return At}var Jt=at;function Ft(We){var Fe=We.className,yt=We.children;return k.createElement("div",{className:Fe},yt)}var St=Ft,ze=D("n6Qo");function gt(We){var Fe,yt=We.prefixCls,At=We.record,nt=We.onExpand,st=We.expanded,De=We.expandable,ye="".concat(yt,"-row-expand-icon");if(!De)return k.createElement("span",{className:I()(ye,"".concat(yt,"-row-spaced"))});var we=function(se){nt(At,se),se.stopPropagation()};return k.createElement("span",{className:I()(ye,(Fe={},Object(Z.a)(Fe,"".concat(yt,"-row-expanded"),st),Object(Z.a)(Fe,"".concat(yt,"-row-collapsed"),!st),Fe)),onClick:we})}function ct(We,Fe,yt){var At=[];function nt(st){(st||[]).forEach(function(De,ye){At.push(Fe(De,ye)),nt(De[yt])})}return nt(We),At}var jt=D("zT1h"),oe=D("y0+3"),Ne=function(Fe,yt){var At,nt,st=Fe.scrollBodyRef,De=Fe.onScroll,ye=Fe.offsetScroll,we=k.useContext(i.a),ae=we.prefixCls,se=((At=st.current)===null||At===void 0?void 0:At.scrollWidth)||0,pe=((nt=st.current)===null||nt===void 0?void 0:nt.clientWidth)||0,_e=se&&pe*(pe/se),be=k.useRef(),Ke=ve({scrollLeft:0,isHiddenScrollBar:!1}),Ot=Object(P.a)(Ke,2),rn=Ot[0],Dn=Ot[1],bt=k.useRef({delta:0,x:0}),Qt=k.useState(!1),Et=Object(P.a)(Qt,2),Ct=Et[0],lt=Et[1],de=function(){lt(!1)},Ae=function(Le){Le.persist(),bt.current.delta=Le.pageX-rn.scrollLeft,bt.current.x=0,lt(!0),Le.preventDefault()},kt=function(Le){var et,mt=Le||((et=window)===null||et===void 0?void 0:et.event),Ht=mt.buttons;if(!Ct||Ht===0){Ct&&lt(!1);return}var sn=bt.current.x+Le.pageX-bt.current.x-bt.current.delta;sn<=0&&(sn=0),sn+_e>=pe&&(sn=pe-_e),De({scrollLeft:sn/pe*(se+2)}),bt.current.x=Le.pageX},dt=function(){var Le=Object(oe.b)(st.current).top,et=Le+st.current.offsetHeight,mt=document.documentElement.scrollTop+window.innerHeight;et-Object(m.a)()<=mt||Le>=mt-ye?Dn(function(Ht){return Object(V.a)(Object(V.a)({},Ht),{},{isHiddenScrollBar:!0})}):Dn(function(Ht){return Object(V.a)(Object(V.a)({},Ht),{},{isHiddenScrollBar:!1})})},Zt=function(Le){Dn(function(et){return Object(V.a)(Object(V.a)({},et),{},{scrollLeft:Le/se*pe||0})})};return k.useImperativeHandle(yt,function(){return{setScrollLeft:Zt}}),k.useEffect(function(){var un=Object(jt.a)(document.body,"mouseup",de,!1),Le=Object(jt.a)(document.body,"mousemove",kt,!1);return dt(),function(){un.remove(),Le.remove()}},[_e,Ct]),k.useEffect(function(){var un=Object(jt.a)(window,"scroll",dt,!1),Le=Object(jt.a)(window,"resize",dt,!1);return function(){un.remove(),Le.remove()}},[]),k.useEffect(function(){rn.isHiddenScrollBar||Dn(function(un){var Le,et;return Object(V.a)(Object(V.a)({},un),{},{scrollLeft:st.current.scrollLeft/((Le=st.current)===null||Le===void 0?void 0:Le.scrollWidth)*((et=st.current)===null||et===void 0?void 0:et.clientWidth)})})},[rn.isHiddenScrollBar]),se<=pe||!_e||rn.isHiddenScrollBar?null:k.createElement("div",{style:{height:Object(m.a)(),width:pe,bottom:ye},className:"".concat(ae,"-sticky-scroll")},k.createElement("div",{onMouseDown:Ae,ref:be,className:I()("".concat(ae,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(ae,"-sticky-scroll-bar-active"),Ct)),style:{width:"".concat(_e,"px"),transform:"translate3d(".concat(rn.scrollLeft,"px, 0, 0)")}}))},Ge=k.forwardRef(Ne);function Xe(We,Fe){return k.useMemo(function(){var yt=!!We;return{isSticky:yt,stickyClassName:yt?"".concat(Fe,"-sticky-header"):"",offsetHeader:Object(G.a)(We)==="object"&&We.offsetHeader||0,offsetScroll:Object(G.a)(We)==="object"&&We.offsetScroll||0}},[We,Fe])}var Bt=[],Wt={},en="rc-table-internal-hook",tt=k.memo(function(We){var Fe=We.children;return Fe},function(We,Fe){return M()(We.props,Fe.props)?We.pingLeft!==Fe.pingLeft||We.pingRight!==Fe.pingRight:!1});function tn(We){var Fe,yt=We.prefixCls,At=We.className,nt=We.rowClassName,st=We.style,De=We.data,ye=We.rowKey,we=We.scroll,ae=We.tableLayout,se=We.direction,pe=We.title,_e=We.footer,be=We.summary,Ke=We.id,Ot=We.showHeader,rn=We.components,Dn=We.emptyText,bt=We.onRow,Qt=We.onHeaderRow,Et=We.internalHooks,Ct=We.transformColumns,lt=We.internalRefs,de=We.sticky,Ae=De||Bt,kt=!!Ae.length,dt=k.useState(0),Zt=Object(P.a)(dt,2),un=Zt[0],Le=Zt[1];k.useEffect(function(){Le(Object(m.a)())});var et=k.useMemo(function(){return Object(O.c)(rn,{})},[rn]),mt=k.useCallback(function(Ln,wn){return Object(O.b)(et,Ln)||wn},[et]),Ht=k.useMemo(function(){return typeof ye=="function"?ye:function(Ln){var wn=Ln&&Ln[ye];return wn}},[ye]),sn=Object(E.c)(We),yn=sn.expandIcon,nr=sn.expandedRowKeys,Kn=sn.defaultExpandedRowKeys,Cn=sn.defaultExpandAllRows,br=sn.expandedRowRender,Er=sn.onExpand,rr=sn.onExpandedRowsChange,cr=sn.expandRowByClick,Pr=sn.rowExpandable,Kr=sn.expandIconColumnIndex,hi=sn.expandedRowClassName,pn=sn.childrenColumnName,or=sn.indentSize,mi=yn||gt,wi=pn||"children",ti=k.useMemo(function(){return br?"row":We.expandable&&Et===en&&We.expandable.__PARENT_RENDER_ICON__||Ae.some(function(Ln){return Ln&&Object(G.a)(Ln)==="object"&&Ln[wi]})?"nest":!1},[!!br,Ae]),ni=k.useState(function(){return Kn||(Cn?ct(Ae,Ht,wi):[])}),X=Object(P.a)(ni,2),L=X[0],N=X[1],z=k.useMemo(function(){return new Set(nr||L||[])},[nr,L]),ne=k.useCallback(function(Ln){var wn=Ht(Ln,Ae.indexOf(Ln)),Lt,Ze=z.has(wn);Ze?(z.delete(wn),Lt=Object(U.a)(z)):Lt=[].concat(Object(U.a)(z),[wn]),N(Lt),Er&&Er(!Ze,Ln),rr&&rr(Lt)},[Ht,z,Ae,Er,rr]),J=k.useState(0),je=Object(P.a)(J,2),$t=je[0],In=je[1],Jn=Object(ke.b)(Object(V.a)(Object(V.a)(Object(V.a)({},We),sn),{},{expandable:!!br,expandedKeys:z,getRowKey:Ht,onTriggerExpand:ne,expandIcon:mi,expandIconColumnIndex:Kr,direction:se}),Et===en?Ct:null),ln=Object(P.a)(Jn,2),tr=ln[0],qn=ln[1],kr=k.useMemo(function(){return{columns:tr,flattenColumns:qn}},[tr,qn]),li=k.useRef(),ai=k.useRef(),Gr=k.useRef(),Li=k.useState(!1),Vi=Object(P.a)(Li,2),Dr=Vi[0],Sr=Vi[1],ri=k.useState(!1),Br=Object(P.a)(ri,2),Bn=Br[0],_n=Br[1],Sn=ve(new Map),bn=Object(P.a)(Sn,2),ur=bn[0],sr=bn[1],Q=Object(O.a)(qn),ce=Q.map(function(Ln){return ur.get(Ln)}),Ce=k.useMemo(function(){return ce},[ce.join("_")]),Te=Jt(Ce,qn.length,se),rt=we&&Object(O.d)(we.y),Re=we&&Object(O.d)(we.x),$e=Re&&qn.some(function(Ln){var wn=Ln.fixed;return wn}),it=k.useRef(),Dt=Xe(de,yt),Tt=Dt.isSticky,Be=Dt.offsetHeader,_t=Dt.offsetScroll,ot=Dt.stickyClassName,ht,wt,It;rt&&(wt={overflowY:"scroll",maxHeight:we.y}),Re&&(ht={overflowX:"auto"},rt||(wt={overflowY:"hidden"}),It={width:we.x===!0?"auto":we.x,minWidth:"100%"});var vt=k.useCallback(function(Ln,wn){sr(function(Lt){var Ze=new Map(Lt);return Ze.set(Ln,wn),Ze})},[]),Xt=fe(null),dn=Object(P.a)(Xt,2),Pn=dn[0],Gn=dn[1];function On(Ln,wn){if(!wn)return;typeof wn=="function"?wn(Ln):wn.scrollLeft!==Ln&&(wn.scrollLeft=Ln)}var Nn=function(wn){var Lt=wn.currentTarget,Ze=wn.scrollLeft,Nt=typeof Ze=="number"?Ze:Lt.scrollLeft,Mt=Lt||Wt;if(!Gn()||Gn()===Mt){var cn;Pn(Mt),On(Nt,ai.current),On(Nt,Gr.current),On(Nt,(cn=it.current)===null||cn===void 0?void 0:cn.setScrollLeft)}if(Lt){var zn=Lt.scrollWidth,kn=Lt.clientWidth;Sr(Nt>0),_n(Nt<zn-kn)}},Mn=function(){Gr.current&&Nn({currentTarget:Gr.current})},Pt=function(wn){var Lt=wn.width;Mn(),In(li.current?li.current.offsetWidth:Lt)};k.useEffect(function(){return Mn},[]),k.useEffect(function(){Re&&Mn()},[Re]),k.useEffect(function(){Et===en&&lt&&(lt.body.current=Gr.current)});var hn=mt(["table"],"table"),Kt=k.useMemo(function(){return ae||($e?we.x==="max-content"?"auto":"fixed":rt||qn.some(function(Ln){var wn=Ln.ellipsis;return wn})?"fixed":"auto")},[rt,$e,qn,ae]),Rt,Un={colWidths:Ce,columCount:qn.length,stickyOffsets:Te,onHeaderRow:Qt,fixHeader:rt},Rn=k.useMemo(function(){return kt?null:typeof Dn=="function"?Dn():Dn},[kt,Dn]),Yt=k.createElement(xe,{data:Ae,measureColumnWidth:rt||Re||Tt,expandedKeys:z,rowExpandable:Pr,getRowKey:Ht,onRow:bt,emptyNode:Rn,childrenColumnName:wi}),ft=k.createElement(h,{colWidths:qn.map(function(Ln){var wn=Ln.width;return wn}),columns:qn}),jn=be&&k.createElement(ze.b,null,be(Ae)),fn=mt(["body"]);if(rt||Tt){var Qn;typeof fn=="function"?(Qn=fn(Ae,{scrollbarSize:un,ref:Gr,onScroll:Nn}),Un.colWidths=qn.map(function(Ln,wn){var Lt=Ln.width,Ze=wn===tr.length-1?Lt-un:Lt;return typeof Ze=="number"&&!Number.isNaN(Ze)?Ze:(Object(_.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Qn=k.createElement("div",{style:Object(V.a)(Object(V.a)({},ht),wt),onScroll:Nn,ref:Gr,className:I()("".concat(yt,"-body"))},k.createElement(hn,{style:Object(V.a)(Object(V.a)({},It),{},{tableLayout:Kt})},ft,Yt,jn),Tt&&k.createElement(Ge,{ref:it,offsetScroll:_t,scrollBodyRef:Gr,onScroll:Nn})),Rt=k.createElement(k.Fragment,null,Ot!==!1&&k.createElement(x,Object.assign({noData:!Ae.length},Un,kr,{direction:se,offsetHeader:Be,stickyClassName:ot,ref:ai,onScroll:Nn})),Qn)}else Rt=k.createElement("div",{style:Object(V.a)(Object(V.a)({},ht),wt),className:I()("".concat(yt,"-content")),onScroll:Nn,ref:Gr},k.createElement(hn,{style:Object(V.a)(Object(V.a)({},It),{},{tableLayout:Kt})},ft,Ot!==!1&&k.createElement(v,Object.assign({},Un,kr)),Yt,jn));var qt=Object(E.b)(We),An=k.createElement("div",Object.assign({className:I()(yt,At,(Fe={},Object(Z.a)(Fe,"".concat(yt,"-rtl"),se==="rtl"),Object(Z.a)(Fe,"".concat(yt,"-ping-left"),Dr),Object(Z.a)(Fe,"".concat(yt,"-ping-right"),Bn),Object(Z.a)(Fe,"".concat(yt,"-layout-fixed"),ae==="fixed"),Object(Z.a)(Fe,"".concat(yt,"-fixed-header"),rt),Object(Z.a)(Fe,"".concat(yt,"-fixed-column"),$e),Object(Z.a)(Fe,"".concat(yt,"-scroll-horizontal"),Re),Object(Z.a)(Fe,"".concat(yt,"-has-fix-left"),qn[0]&&qn[0].fixed),Object(Z.a)(Fe,"".concat(yt,"-has-fix-right"),qn[qn.length-1]&&qn[qn.length-1].fixed==="right"),Fe)),style:st,id:Ke,ref:li},qt),k.createElement(tt,{pingLeft:Dr,pingRight:Bn,props:Object(V.a)(Object(V.a)({},We),{},{stickyOffsets:Te,mergedExpandedKeys:z})},pe&&k.createElement(St,{className:"".concat(yt,"-title")},pe(Ae)),k.createElement("div",{className:"".concat(yt,"-container")},Rt),_e&&k.createElement(St,{className:"".concat(yt,"-footer")},_e(Ae))));Re&&(An=k.createElement(p.a,{onResize:Pt},An));var Fn=k.useMemo(function(){return{prefixCls:yt,getComponent:mt,scrollbarSize:un,direction:se,fixedInfoList:qn.map(function(Ln,wn){return n(wn,wn,qn,Te,se)}),isSticky:Tt}},[yt,mt,un,se,qn,Te,se,Tt]),vn=k.useMemo(function(){return Object(V.a)(Object(V.a)({},kr),{},{tableLayout:Kt,rowClassName:nt,expandedRowClassName:hi,componentWidth:$t,fixHeader:rt,fixColumn:$e,horizonScroll:Re,expandIcon:mi,expandableType:ti,expandRowByClick:cr,expandedRowRender:br,onTriggerExpand:ne,expandIconColumnIndex:Kr,indentSize:or})},[kr,Kt,nt,hi,$t,rt,$e,Re,mi,ti,cr,br,ne,Kr,or]),yr=k.useMemo(function(){return{onColumnResize:vt}},[vt]);return k.createElement(i.a.Provider,{value:Fn},k.createElement(B.Provider,{value:vn},k.createElement(q.Provider,{value:yr},An)))}tn.Column=a.a,tn.ColumnGroup=u.a,tn.Summary=ze.a,tn.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var En=he.b=tn},wRmb:function(Gt,he,D){"use strict";D.d(he,"a",function(){return M});var Z=D("rePB"),V=D("KQm4"),U=D("VTBJ"),G=D("Ff2n"),P=D("q1tI"),k=D.n(P),K=D("Kwbf"),I=D("Zm9Q"),r=D("hW8S");function M(a){return Object(I.a)(a).filter(function(o){return P.isValidElement(o)}).map(function(o){var c=o.key,s=o.props,i=s.children,n=Object(G.a)(s,["children"]),O=Object(U.a)({key:c},n);return i&&(O.children=M(i)),O})}function _(a){return a.reduce(function(o,c){var s=c.fixed,i=s===!0?"left":s,n=c.children;return n&&n.length>0?[].concat(Object(V.a)(o),Object(V.a)(_(n).map(function(O){return Object(U.a)({fixed:i},O)}))):[].concat(Object(V.a)(o),[Object(U.a)(Object(U.a)({},c),{},{fixed:i})])},[])}function p(a){for(var o=!0,c=0;c<a.length;c+=1){var s=a[c];if(o&&s.fixed!=="left")o=!1;else if(!o&&s.fixed==="left"){Object(K.a)(!1,"Index ".concat(c-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,n=a.length-1;n>=0;n-=1){var O=a[n];if(i&&O.fixed!=="right")i=!1;else if(!i&&O.fixed==="right"){Object(K.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function m(a){return a.map(function(o){var c=o.fixed,s=Object(G.a)(o,["fixed"]),i=c;return c==="left"?i="right":c==="right"&&(i="left"),Object(U.a)({fixed:i},s)})}function u(a,o){var c=a.prefixCls,s=a.columns,i=a.children,n=a.expandable,O=a.expandedKeys,T=a.getRowKey,C=a.onTriggerExpand,R=a.expandIcon,S=a.rowExpandable,v=a.expandIconColumnIndex,E=a.direction,f=a.expandRowByClick,h=P.useMemo(function(){return s||M(i)},[s,i]),y=P.useMemo(function(){if(n){var j,B=v||0,A=h[B],H=(j={},Object(Z.a)(j,r.a,{className:"".concat(c,"-expand-icon-col")}),Object(Z.a)(j,"title",""),Object(Z.a)(j,"fixed",A?A.fixed:null),Object(Z.a)(j,"className","".concat(c,"-row-expand-icon-cell")),Object(Z.a)(j,"render",function(Y,q,ie){var ge=T(q,ie),Je=O.has(ge),xe=S?S(q):!0,ke=R({prefixCls:c,expanded:Je,expandable:xe,record:q,onExpand:C});return f?P.createElement("span",{onClick:function(Ye){return Ye.stopPropagation()}},ke):ke}),j),F=h.slice();return B>=0&&F.splice(B,0,H),F}return h},[n,h,T,O,R,E]),g=P.useMemo(function(){var j=y;return o&&(j=o(j)),j.length||(j=[{render:function(){return null}}]),j},[o,y,E]),x=P.useMemo(function(){return E==="rtl"?m(_(g)):_(g)},[g,E]);return[g,x]}he.b=u},wwSX:function(Gt,he,D){Gt.exports=D.p+"static/b2.2c844a2a.svg"},xOL1:function(Gt,he){Gt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(Gt,he,D){Gt.exports={flex_box_center:"flex_box_center___2oNqn",flex_space_between:"flex_space_between___eTRhm",flex_box_vertical_center:"flex_box_vertical_center___1jD6_",flex_box_center_end:"flex_box_center_end___3s_Sd",flex_box_column:"flex_box_column___11Wn_",form:"form___34z-w",btns:"btns___3O6K5",hackList:"hackList___2L3co",title:"title___2fVFF",subtitle:"subtitle___Ydv-g",efficiency:"efficiency___1wrjh"}},"y0+3":function(Gt,he,D){"use strict";D.d(he,"a",function(){return _}),D.d(he,"b",function(){return m});var Z=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},U={cssFloat:1,styleFloat:1,float:1};function G(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function P(u,a,o){if(a=a.toLowerCase(),o==="auto"){if(a==="height")return u.offsetHeight;if(a==="width")return u.offsetWidth}return a in V||(V[a]=Z.test(a)),V[a]?parseFloat(o)||0:o}function k(u,a){var o=arguments.length,c=G(u);return a=U[a]?"cssFloat"in u.style?"cssFloat":"styleFloat":a,o===1?c:P(u,a,c[a]||u.style[a])}function K(u,a,o){var c=arguments.length;if(a=U[a]?"cssFloat"in u.style?"cssFloat":"styleFloat":a,c===3)return typeof o=="number"&&Z.test(a)&&(o="".concat(o,"px")),u.style[a]=o,o;for(var s in a)a.hasOwnProperty(s)&&K(u,s,a[s]);return G(u)}function I(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function r(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function M(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:a}}function _(){var u=document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return{width:u,height:a}}function p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(u){var a=u.getBoundingClientRect(),o=document.documentElement;return{left:a.left+(window.pageXOffset||o.scrollLeft)-(o.clientLeft||document.body.clientLeft||0),top:a.top+(window.pageYOffset||o.scrollTop)-(o.clientTop||document.body.clientTop||0)}}},"yTi+":function(Gt,he,D){Gt.exports=D.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(Gt,he,D){Gt.exports={flex_box_center:"flex_box_center___Joa_H",flex_space_between:"flex_space_between___3VhCy",flex_box_vertical_center:"flex_box_vertical_center___3wSNZ",flex_box_center_end:"flex_box_center_end___3z8HR",flex_box_column:"flex_box_column___KdHzx",form:"form___3KoYn",efficiency:"efficiency___1LMk4"}},zlzj:function(Gt,he,D){Gt.exports=D.p+"static/b3.30079151.svg"}}]);